<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6898804038410932940</id><updated>2026-06-03T03:49:16.025-07:00</updated><category term="music sheet"/><category term="American citizens will find the backbone to start speaking and voicing the same truths"/><category term="Bangkok Christian College Field Trip"/><category term="I lost all my earning in tuibux.com"/><category term="bangkok"/><category term="www.tuibux.com is scam"/><category term="America"/><category term="Happy"/><category term="I love Bangkok"/><category term="Needs A Leader Like This"/><category term="at"/><category term="australia"/><category term="bangruk"/><category term="boy"/><category term="city life"/><category term="mean"/><category term="silom"/><category term="thai travel"/><category term="thailand"/><category term="กรุงเทพคริสเตียนวิทยาลัย"/><category term="คุณค่าของวรรณคดีเรื่องรามเกียรติ์"/><category term="สะมาเรีย"/><category term="สู่ปลายแผ่นดินโลก"/><category term="หนังสือส"/><category term="โบลิเวีย"/><category term="BCC"/><category term="ดาหลัง"/><category term="นามของเจ้าและลูกหลานของเจ้าจะยั่งยืนอยู่ฉันนั้น"/><category term="เบนฮาดัดที่"/><category term="musescore"/><category term="Verilog"/><category term="piano sheets"/><category term="life"/><category term="piano sheet"/><category term="LECTURE NOTE"/><category term="free"/><category term="free internet"/><category term="free money"/><category term="free wifi"/><category term="piano"/><category term="pic"/><category term="picture"/><category term="student"/><category term="usa"/><category term="Bangkok The Capital City of Thailand"/><category term="FALSE"/><category term="Optometry"/><category term="Spanish-American War"/><category term="True or False"/><category term="University of Kentucky"/><category term="What does man gain from all his labor"/><category term="alertpay"/><category term="alliance"/><category term="amazon"/><category term="bank account free 150 dollars"/><category term="beware of scammer"/><category term="bible"/><category term="children"/><category term="china"/><category term="christmas"/><category term="coupon code"/><category term="download"/><category term="get paid to click"/><category term="iphone app"/><category term="national park"/><category term="open bank account and get free money"/><category term="play"/><category term="real"/><category term="secular"/><category term="woocommerce"/><category term="ทัศนมาตรศาสตร์"/><category term="พระเยซูคริสต์"/><category term="มัทธิว"/><category term="เปาโล"/><category term="&quot;.&quot;"/><category term="&quot;ฯ&quot;  VS"/><category term="1809-1817; called the"/><category term="1861-1917"/><category term="2 to 1 multiplexer"/><category term="20 Famous Places In The World"/><category term="3x8 decoder"/><category term="4x16 decoder structural"/><category term="7zip download"/><category term="90 years"/><category term="Accord"/><category term="Aged-related macular degeneration"/><category term="Airpay promotion"/><category term="Alfred T. Mahan"/><category term="Amazon Advertisement"/><category term="Amazon Prime free trial"/><category term="Amazon Student free trials"/><category term="Ambrose Bierce"/><category term="American dream bus"/><category term="Amount"/><category term="An Occurrence at Owl Creek Bridge"/><category term="Analyzing Phylogeography"/><category term="Ancient Jewels game."/><category term="Application of solubility"/><category term="Armritsar"/><category term="Asburry University"/><category term="Asburry University SOCCER FIELD"/><category term="Asburry University in December 2012"/><category term="Audiobooks free trials"/><category term="Australia Disney World"/><category term="Author"/><category term="Avant Browser"/><category term="BIO155"/><category term="Bangkok View From a Tower in Bangkok"/><category term="Bootstrapping process"/><category term="CHINA GRADUATE SCHOOL OF THEOLOGY"/><category term="CIS110 project"/><category term="Cape Town"/><category term="China Communism 1921-2011"/><category term="Christ"/><category term="Cincinnati"/><category term="Cincinnati from Devou Park."/><category term="Colossians"/><category term="Communists celebrate 90 years in China"/><category term="Compare And Contrast"/><category term="Compare And Contrast The Criticisms Of Monarchy Government"/><category term="Constitution Convention"/><category term="Create Bible Verse PowerPoint Automatically"/><category term="Create an Amazon Baby Registry"/><category term="Create an Amazon Wedding Registry"/><category term="Ctrl"/><category term="DFF"/><category term="Deep Net Browser"/><category term="Devou Park"/><category term="Download Iu Mien Bible Here"/><category term="Download Real Player"/><category term="Dress Pavillion"/><category term="E-Gold"/><category term="Early 1900s newspaper publisher; used"/><category term="Earn $30+/hour"/><category term="Eastern Europe"/><category term="Ephesians"/><category term="Epistles"/><category term="Equivalent resistance can be found in any resistor network."/><category term="Essay on The Turn of the Screw"/><category term="Estimating Evolutionary Tree"/><category term="Ethanol"/><category term="F. Scott Fitzgerald"/><category term="FINAL ESSAY"/><category term="Famous Places"/><category term="Father of the Constitution for his leadership at the"/><category term="Flash Chess"/><category term="Florida"/><category term="For a set of resistors in parallel"/><category term="Free Coke Rewards Codes"/><category term="GAME"/><category term="George Dewey"/><category term="God"/><category term="Golden Temple"/><category term="Google Ads coupons"/><category term="Google Advertising"/><category term="Google Advertising offer"/><category term="Google Chrome"/><category term="Google adword coupons"/><category term="Google search"/><category term="HIS113 essay"/><category term="Here are some bunny"/><category term="Heteroatoms"/><category term="How did Chameleons Get from Africa to India"/><category term="How to get free meal from IHOP"/><category term="I took this picture"/><category term="INTERVIEW"/><category term="IS SMOKING WRONG?"/><category term="Imperfect"/><category term="Intermolecular forces"/><category term="Internet Explorer"/><category term="Interview with Secular Student Alliance"/><category term="Introduction to Organic Molecules and Functional Group"/><category term="Island"/><category term="It is impossible to find the equivalent resistance of a non-planar resistor network."/><category term="Joseph Pulitzer"/><category term="KEY TERM"/><category term="Las Vegas"/><category term="Liberal Legacies"/><category term="Material In Our World"/><category term="Maxthon"/><category term="Maybe if we circulate this amongst ourselves"/><category term="Mien bible software"/><category term="MoneyBookers"/><category term="Mozilla Firefox"/><category term="Netpay"/><category term="Newspaper publisher"/><category term="OPT201"/><category term="Officer in the United States Navy"/><category term="Ohio PICTURE"/><category term="Opera"/><category term="Owl Creek Bridge"/><category term="PC Cheats"/><category term="PHOTOSHOP CS3"/><category term="PTC"/><category term="Palmbux"/><category term="Palmmy"/><category term="Paper on An Occurrence at Owl Creek Bridge"/><category term="Paul"/><category term="Pearson LearningStudio Reminder/Notifier iPhone App"/><category term="Pearson LearningStudio app"/><category term="Perfect"/><category term="Places In"/><category term="Plot Summary"/><category term="PostMates"/><category term="President"/><category term="Problem Science Has With Jesus Christ"/><category term="Problems with Tuibux.com"/><category term="Real PLayer"/><category term="Rock Melt Browser"/><category term="S. Thananta"/><category term="SOCCER FIELD"/><category term="Safari"/><category term="Saint Augustine of Hippo"/><category term="Sanctification"/><category term="Sanctification Perfect or Imperfect in This Life"/><category term="Sea Monkey"/><category term="Secular Student Alliance"/><category term="Select All"/><category term="Soldier"/><category term="States"/><category term="Stormpay"/><category term="Stronghold Crusader Extreme"/><category term="Stronghold Crusader Extreme PC Cheats"/><category term="Sugar"/><category term="Sydney"/><category term="THE GREAT GATSBY by"/><category term="THE GREAT GATSBY by F. Scott Fitzgerald  Plot Summary"/><category term="Taj Mahal"/><category term="Teacher"/><category term="Teacher Soldier President: The Life of James Garfield"/><category term="The Cell Membrane"/><category term="The Confessions of St. Augustine"/><category term="The Confessions of St. Augustine essay"/><category term="The Governments Of Modern"/><category term="The Life of James Garfield"/><category term="Theology"/><category term="Top Five Material"/><category term="Top Five Material In Our World Ranked By Amount"/><category term="Top Highest Paying Textbook Buyback Company"/><category term="Top Ten Online Hotel Booking Services"/><category term="Travelocity.com coupon"/><category term="True or False: The power dissipated by an ideal current source depends only on its output current."/><category term="True or False: To increase the power delivered to a circuit"/><category term="US Great Barrier Reef"/><category term="US leader"/><category term="Verilog 2 to 1 mux gate"/><category term="Verilog 4x16 decoder"/><category term="Verilog 4x16 using 3x8 decoder"/><category term="Virtual Families"/><category term="Voltaire’s Book With Drakulic’s Criticisms"/><category term="WHAT A WONDERFUL ADVICE FOR ALL YOUNG AND OLD"/><category term="Wesley"/><category term="Western Civilization"/><category term="Why The Governess Was Right"/><category term="William Randolph Hearst"/><category term="World Ranked"/><category term="Zion"/><category term="Zion National"/><category term="Zion National Park"/><category term="Zion National Park PICTURE"/><category term="adobe photoshop"/><category term="ads"/><category term="advice"/><category term="adwords discount"/><category term="all about attitude"/><category term="alliances or friendships"/><category term="amazon.com"/><category term="amino acids"/><category term="analysis st Augustine"/><category term="analyze The Confessions"/><category term="ancient jewel"/><category term="and Foreign Affairs"/><category term="android"/><category term="ask"/><category term="atheism"/><category term="atheist"/><category term="attitude"/><category term="auto hot key"/><category term="baggage storage"/><category term="balance of power Kant"/><category term="bank"/><category term="bankrollbucks"/><category term="battle"/><category term="beatitude"/><category term="become"/><category term="beijing"/><category term="best Hotel Booking Web Site"/><category term="best ptc web"/><category term="best textbook buyback website"/><category term="best view to see downtown Cincinnati"/><category term="between &quot;ฯ&quot; symbol and period &quot;.&quot;"/><category term="bible encyclopedia"/><category term="big"/><category term="birth"/><category term="blessed"/><category term="blessed life"/><category term="book hotel"/><category term="bridge"/><category term="brown"/><category term="brown rabbit"/><category term="bunny"/><category term="bus"/><category term="bus 14"/><category term="bux scam"/><category term="bux site"/><category term="bux3.com"/><category term="buxtro"/><category term="buy"/><category term="california"/><category term="can&#39;t open www.tuibux.com"/><category term="cash"/><category term="cash crate"/><category term="cheap hotel"/><category term="cheat"/><category term="cheat code"/><category term="check out page edit"/><category term="checker game"/><category term="chinese"/><category term="chinese board game"/><category term="chinese checker"/><category term="chinese comunist"/><category term="chord"/><category term="christians"/><category term="cincy"/><category term="citizen"/><category term="click on the advertisements"/><category term="clicks"/><category term="coca-cola"/><category term="coke"/><category term="coke rewards codes for free"/><category term="college"/><category term="com"/><category term="comma"/><category term="communism"/><category term="communist"/><category term="community"/><category term="conflicting"/><category term="coulomb"/><category term="coupon"/><category term="cpc"/><category term="current"/><category term="d flip flop test fixture"/><category term="d flip flop verilog"/><category term="d flip flop with set"/><category term="daily luggage storage"/><category term="dance"/><category term="decoder"/><category term="delivering foods on your own schedule with"/><category term="difference"/><category term="directly"/><category term="discount send money"/><category term="discounted giftcards"/><category term="doing"/><category term="download Mien bible software"/><category term="download free game"/><category term="download free movies"/><category term="download real player free"/><category term="download software"/><category term="e-store"/><category term="eBay"/><category term="earning"/><category term="economic factors"/><category term="enable"/><category term="engine"/><category term="eshop"/><category term="essay about history"/><category term="essay on An Occurrence at Owl Creek Bridge"/><category term="explain Saint Augustine of Hippo"/><category term="explore"/><category term="faith"/><category term="fight"/><category term="film"/><category term="film downloader"/><category term="finish"/><category term="fitbit"/><category term="flea market"/><category term="flv player"/><category term="forcht"/><category term="free 125 dollars"/><category term="free 150"/><category term="free 150 dollar coupons"/><category term="free 50 dollar"/><category term="free amazon trials"/><category term="free foods"/><category term="free game"/><category term="free ihop pancake"/><category term="free meal"/><category term="free one dollar"/><category term="free pancake"/><category term="free pizza"/><category term="free real player download"/><category term="free shipping"/><category term="free software"/><category term="free video"/><category term="free vpn 10gb"/><category term="from 1887"/><category term="frostwire"/><category term="future of the United"/><category term="game download"/><category term="gamefly coupon"/><category term="gamefly.com"/><category term="get 1 dollar"/><category term="get 150"/><category term="get 150 ads"/><category term="get IHOP free"/><category term="get money"/><category term="get paid"/><category term="get subtitle from facebook video"/><category term="ghost"/><category term="gift card for free"/><category term="giftcard sales"/><category term="globalactioncash"/><category term="glua"/><category term="go"/><category term="good morning"/><category term="google"/><category term="gpt"/><category term="gpt with bonus sign up"/><category term="gpt with cash sign  up"/><category term="graboid"/><category term="graduate"/><category term="greg page"/><category term="heaven"/><category term="help"/><category term="highest offer rate gpt 2012"/><category term="highest paying gpt"/><category term="highest textbook buyback"/><category term="history"/><category term="home buying"/><category term="homology"/><category term="hong kong"/><category term="hosting"/><category term="hotel booking"/><category term="hotel deal"/><category term="humanism"/><category term="huntington bank"/><category term="international"/><category term="international festival"/><category term="international student"/><category term="is bux3 a scam"/><category term="is smoking a sin"/><category term="is smoking bad"/><category term="islam"/><category term="it also depends on the voltage"/><category term="joy"/><category term="kentucky bank"/><category term="kingdom"/><category term="leader"/><category term="learn"/><category term="led a surprise attack in the Philippines during the Spanish-American War that destroyed the entire Spanish fleet"/><category term="lextran"/><category term="lextran bus"/><category term="liberal principles"/><category term="lipids and nucleotides"/><category term="live"/><category term="love"/><category term="luke"/><category term="make money"/><category term="make money online"/><category term="media download"/><category term="michael"/><category term="microsoft excel"/><category term="minimum payout"/><category term="mom"/><category term="monophyletic"/><category term="mother"/><category term="movie"/><category term="mplayer"/><category term="musdic"/><category term="music"/><category term="music download"/><category term="muslim"/><category term="mux gate"/><category term="my coke reward"/><category term="natural bridge"/><category term="naver"/><category term="neobux"/><category term="nervous"/><category term="never get paid from bux3"/><category term="normally voltage source are not put in parallel"/><category term="october 2011"/><category term="of"/><category term="offline Mien Bible"/><category term="ohio"/><category term="old"/><category term="online fax"/><category term="online nba betting"/><category term="online shopping coupons"/><category term="open account"/><category term="open new Regions bank checking account and get $125 free"/><category term="open pnc account"/><category term="papa john"/><category term="papa john coupon"/><category term="papa john give free pizza"/><category term="papa john super bowl coin toss"/><category term="parking Americans dream"/><category term="pay"/><category term="payment"/><category term="paypal"/><category term="people"/><category term="person"/><category term="phuket"/><category term="pictures"/><category term="pictures of a rabbit"/><category term="play game free"/><category term="pnc free money"/><category term="political factors"/><category term="poor"/><category term="post modern"/><category term="power"/><category term="pray"/><category term="program download"/><category term="promo code"/><category term="proof"/><category term="property"/><category term="psr e433"/><category term="ptc scam"/><category term="public sentiment in favor of the"/><category term="purcahse"/><category term="rabbit picture"/><category term="rand Canyon"/><category term="rank of textbook buyback companies"/><category term="re"/><category term="real estate"/><category term="real player download"/><category term="realists"/><category term="receive"/><category term="regret"/><category term="remote contrl"/><category term="resistance will get the largest share of the total current."/><category term="review"/><category term="reviews"/><category term="reward"/><category term="rich"/><category term="right"/><category term="river"/><category term="school"/><category term="search"/><category term="search property"/><category term="seminary"/><category term="shop"/><category term="shopping online"/><category term="siser"/><category term="smartwatch"/><category term="social factors"/><category term="social welfare"/><category term="sonic"/><category term="sources in parallel."/><category term="species"/><category term="spirit"/><category term="sportsbook"/><category term="square coupon"/><category term="square free"/><category term="square promo"/><category term="srt file from fb vid"/><category term="stock bonus"/><category term="supper bowl"/><category term="symbol"/><category term="tab"/><category term="tagged as"/><category term="temple"/><category term="thai"/><category term="thai christian song"/><category term="the development of Western Civilization"/><category term="the life of blessing"/><category term="the most popular and most used web browser in the year of 2013"/><category term="the one with the largest"/><category term="the sun"/><category term="theological"/><category term="they&#39;ve"/><category term="to the"/><category term="travelocity discount"/><category term="tuibux.com is scam"/><category term="tuibux.com web page"/><category term="turn of the screw"/><category term="uky"/><category term="until his death in 1951; used"/><category term="verilog Behavioral"/><category term="view"/><category term="view of downtown"/><category term="views"/><category term="visiting"/><category term="volt"/><category term="vtf mux"/><category term="w501"/><category term="watt"/><category term="websites"/><category term="webstore"/><category term="what"/><category term="what bible said about smoking"/><category term="what do christian thnik about smoking"/><category term="which he toils under"/><category term="while"/><category term="who argued in 1890 that the economic"/><category term="whose"/><category term="with"/><category term="witness"/><category term="woocmmerce api limit"/><category term="woocommerce customize checkout page"/><category term="wordpress"/><category term="world"/><category term="worldview"/><category term="yamaha keyboard"/><category term="yamaha psr e433"/><category term="yao language"/><category term="yosemite"/><category term="young"/><category term="your"/><category term="your referrals"/><category term="กรมเวียง"/><category term="กรุงเทพมหานคร vs  กทม."/><category term="กลมกลืน"/><category term="กลมเกลียว"/><category term="กลอน"/><category term="กลัว"/><category term="การทำดี"/><category term="การประสาน"/><category term="การศึกษา"/><category term="การเริ่มต้นใหม่"/><category term="การให้ด้วยใจกว้างขวาง"/><category term="ก่อ"/><category term="ขอโทษ"/><category term="ขอโทษกับการเริ่มต้นใหม่"/><category term="ขโมยแกะ"/><category term="ข่าวประเสริฐมาก"/><category term="ข้าพเจ้ากับทัศนมาตรศาสตร์"/><category term="คริสตจักร"/><category term="คริสตมาส"/><category term="ครู"/><category term="ความชั่วร้าย"/><category term="ความชั่วร้ายมาจากใหน"/><category term="ความบาปผิด"/><category term="ความยินดี"/><category term="ความรู้"/><category term="ความสว่างของโลก"/><category term="ความสำคัญ"/><category term="คอร์ด"/><category term="คอร์ด guitar"/><category term="คอร์ดรักเติมเต็มใจ"/><category term="คำถามพร้อมคำตอบ"/><category term="จะอยู่รอบๆไม่ไกลจากราชธานี"/><category term="ชีววิทยา"/><category term="ซาตาน"/><category term="ดามัสกัส"/><category term="ดาวน์โหลดพระคัมภีร์ภาษาเย้าที่นี่"/><category term="ดาวน์โหลดแทปเพลงกลัว"/><category term="ตรีเอกานุภาพ"/><category term="ต้นกำเนิดพระเยซูคริสต์"/><category term="ทัศนศึกษา"/><category term="ที่"/><category term="ธรรมิกชน"/><category term="นดารอาหาร"/><category term="นิทาน"/><category term="นิทานเรื่องเด็กชายสามคน"/><category term="นิมิต"/><category term="บัญญัติเอก"/><category term="ปกครองในสมัยกรุงธนบุรี"/><category term="ประสาทตา"/><category term="ปัจจัย"/><category term="ปัจจุบัน"/><category term="ปาล์มมี่"/><category term="ผิวขาว"/><category term="ผู้ทรงรัก"/><category term="พงศ์กษัตริย์"/><category term="พระคริสตธรรมคัมภีร์ ภาษาไทย"/><category term="พระคุณที่สาม"/><category term="พระพร"/><category term="พระราชนิเวศน์มฤคทายวัน"/><category term="พระอาจารย์"/><category term="พระเจ้า"/><category term="พระเจ้ากับวิทยาศาสตร์"/><category term="พระเจ้าทรงสร้างความชั่วร้ายหรือ"/><category term="พระเยซูทรงห่วงข้าหรือไม่ คอร์ด"/><category term="พัฒนา"/><category term="ฟังเพลง กลัว"/><category term="ฟังเพลงมองข้าม"/><category term="ฟาร์มแกะ"/><category term="ภาพหรืออักษรที่เลือก"/><category term="มนุษย์"/><category term="มาซิโดเนีย"/><category term="ยอมรับกัน"/><category term="ยิวกับกรีก"/><category term="ยิวสู้กรีก"/><category term="ยุโรป"/><category term="ระหว่าง"/><category term="รักเติมเต็มใจ"/><category term="ร้อยแก้ว"/><category term="ลำดับพงศ์พันธ์"/><category term="ลูกา"/><category term="วัน"/><category term="วิชาทัศนมาตรศาสตร์"/><category term="วิทยาศาสตรกับพระเจ้า"/><category term="วิทยาศาสตร์"/><category term="ศิลปิน"/><category term="ศึกษา"/><category term="ศึกษา Photoshop"/><category term="สรุป"/><category term="สร้าง"/><category term="สวรรค์มีตา"/><category term="สาธารณสุขกับทัศนมาตร"/><category term="สารานุกรม"/><category term="สีผิว"/><category term="สื่อสารพระกิตติคุณกับมุสลิม"/><category term="สเปน โปรตุเกส"/><category term="หนังสือจากเยรูซาเล็ม"/><category term="หนังสือม้วนอิสยาห์"/><category term="หลักข้อเชื่อของอัครทูต"/><category term="อนาจักรกรีก"/><category term="อาวุธ"/><category term="อาเมน"/><category term="อิตาลี"/><category term="อิสราเอล"/><category term="อิฮฺรอม"/><category term="อิเหนา"/><category term="อุณรุท"/><category term="อเมริกาเหนือและใต้"/><category term="ฮีบรู"/><category term="ฯ"/><category term="เครื่องมือ"/><category term="เด็กชายสามคน"/><category term="เนินเชเฟลาห์"/><category term="เนื้อเพลง พระเยซูทรงห่วงข้าหรือไม่"/><category term="เนื้อเพลงรักเติมเต็มใจ"/><category term="เพลง"/><category term="เพลงคริสเตียน"/><category term="เพลงมอง(มองข้าม) โดยกบ วีรศักดิ์"/><category term="เพศชาย"/><category term="เพศหญิง"/><category term="เยเรมี"/><category term="เยเรมีกับแกะของเขา"/><category term="เยโฮรัม"/><category term="เราไม่ทิ้งกัน"/><category term="เรียงความ"/><category term="เรียงความการใช้เทคโนโลยีตามเศรษฐกิจพอเพียง"/><category term="เลือกทั้งหมดหรือแทนคำว่า"/><category term="เวลา"/><category term="เศรษฐกิจพอเพียง"/><category term="เอเชีย"/><category term="เอเฟซัส"/><category term="แกะ"/><category term="แค่ผลักดัน， มิลลิเมตรเดียว ，เขากำลังล้มเหลว， มารซาตาน"/><category term="แทป"/><category term="โครินธ์"/><category term="โจทย์ชีวะ，ข้อสอบวิชาชีวะ， ช่องเหงือก ，ข้อสอบวิชาชีววิทยา"/><category term="โซโซ้"/><category term="โด้โด้"/><category term="โธมัส"/><category term="โน้ต เปียโน"/><category term="โน้ตเพลง"/><category term="โน๊ตเปียโน"/><category term="โปรแกรมสร้าง PowerPoint"/><category term="โรคจอประสาทตาเสื่อม"/><category term="โรคตา"/><category term="โหลดพระคัมภีร์ภาษาเมี่ยน"/><category term="โหลดเพลงมอง"/><category term="โอกาส"/><category term="โอ๋ ทาโร่"/><category term="ไม่มีการหวนกลับ"/><category term="“Old Man” and “New Man” in the Epistles to the Ephesian"/><category term="“yellow journalism” in the 1890s to stir up sentiment in favor of the"/><category term="“yellow journalism” to stir up"/><title type='text'>SAVEmightLIFE</title><subtitle type='html'>Find FREE products and money, coupons and great deals. FREE piano sheets, guitar chords, useful softwares. READ Honest product and service reviews.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://lertsirikarn.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default'/><link rel='alternate' type='text/html' href='http://lertsirikarn.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default?start-index=26&amp;max-results=25'/><author><name>Ahgwai</name><uri>http://www.blogger.com/profile/06698874521088701882</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>449</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6898804038410932940.post-2453910170061670762</id><published>2026-03-23T16:52:50.940-07:00</published><updated>2026-03-23T16:53:30.144-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="American dream bus"/><category scheme="http://www.blogger.com/atom/ns#" term="parking Americans dream"/><title type='text'>The American Dream Lacks of Transportation: Why the Largest Mall in the U.S. Lacks Public Transportation </title><content type='html'>&lt;b&gt;Why the Largest Mall in the U.S. Lacks Public Transportation&amp;nbsp;&lt;/b&gt;&lt;div&gt;&lt;br&gt;&lt;div&gt;If you’ve ever looked across the Hudson River from Manhattan, you’ve seen the massive complex that is American Dream.&lt;/div&gt;&lt;div&gt;At 3 million square feet, it is the largest mall in the United States and ranks among the top 15 in the world. It’s a multi-billion dollar destination featuring an indoor ski slope, a massive ice rink, and the largest indoor water park in the country. But while it sits just a few miles from NYC, getting there on a weekday is a significant challenge.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;The Limited Bus Schedule&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Many visitors assume there is constant shuttle service from the Port Authority Bus Terminal. However, the direct 355 Express bus only runs a few times a day on weekdays—typically just two departures in the morning and two in the evening.&lt;/div&gt;&lt;div&gt;On weekends, the service is frequent and reliable. But on a Tuesday afternoon, that direct link essentially disappears, leaving travelers to find alternative routes through local buses or train transfers.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;The Dedicated Train Station Without Daily Trains&lt;/b&gt;&lt;/div&gt;&lt;div&gt;The most confusing part of the American Dream infrastructure is the Meadowlands Station. It is a modern, multi-million dollar train station located right at the mall&#39;s doorstep.&lt;/div&gt;&lt;div&gt;The tracks and platforms are fully built and ready for use. Yet, on a typical weekday, no trains arrive at this station. The platform stays dark and the gates remain closed unless there is a major event, like a concert or a football game at the stadium next door. It is a massive piece of transit infrastructure that sits unused for the majority of the week.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;The Reason: Technical and Financial Barriers&lt;/b&gt;&lt;/div&gt;&lt;div&gt;There are two main reasons why the transit isn&#39;t as consistent as people expect:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;1. The &quot;Spur&quot; Technical Conflict&lt;/b&gt;&lt;/div&gt;&lt;div&gt;The rail line leading to the mall is a &quot;stub-end spur&quot; that branches off the main NJ Transit lines. To run daily trains here, the agency would have to divert equipment and crews away from the main lines that carry thousands of daily commuters to work. NJ Transit has stated that the current system lacks the &quot;resilience&quot; to handle daily mall service without causing delays for the rest of the state&#39;s rail network. Until major track upgrades are completed, the station remains for event-use only.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;2. The Demand Gap&lt;/b&gt;&lt;/div&gt;&lt;div&gt;When American Dream first opened, NJ Transit actually tested a high-frequency express bus service as a pilot program. However, the weekday demand from Manhattan was much lower than anticipated. Because it is expensive to run large buses and trains, the agency couldn&#39;t justify the cost of operating nearly empty vehicles through the Lincoln Tunnel on weekdays. As a result, the schedule was cut back to a &quot;survival&quot; level—just enough to help staff get to their shifts.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;For now, the transit system and the mall are in a stalemate. The transit agency is waiting for higher visitor numbers to justify more service, while visitors are waiting for better service to make the trip easier. Until one of those things changes, the &quot;Dream&quot; will continue to be a weekend-heavy destination for those coming from the city. Ohh, and one more thing, it&#39;s $5 dollars to park at American Dream Mall if you decided to drive there.&amp;nbsp;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lertsirikarn.blogspot.com/feeds/2453910170061670762/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lertsirikarn.blogspot.com/2026/03/the-american-dream-lacks-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/2453910170061670762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/2453910170061670762'/><link rel='alternate' type='text/html' href='http://lertsirikarn.blogspot.com/2026/03/the-american-dream-lacks-of.html' title='The American Dream Lacks of Transportation: Why the Largest Mall in the U.S. Lacks Public Transportation '/><author><name>saveMightLife</name><uri>http://www.blogger.com/profile/07139052104556306035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6898804038410932940.post-6516999935340138159</id><published>2026-02-22T12:59:30.341-08:00</published><updated>2026-02-22T13:06:22.689-08:00</updated><title type='text'>Doordash dasher referral code New Jersey February 2026</title><content type='html'>Expiration date February 27th 2026&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Here’s my referral link to sign up to deliver with DoorDash:&amp;nbsp;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://drd.sh/pa5wUZRalD8Vqw8q/&quot;&gt;&lt;b&gt;https://drd.sh/pa5wUZRalD8Vqw8q/&lt;/b&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;If you do 250 deliveries in Metro Jersey within 60 days you’ll get a $400 bonus!&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEihyhmhstrQKIarEMHN97r5ScU5Y8MsQxbq-QNw4ijL-dQ0zrvuyn3sglg0kkQeo7Tua0yN4jErl14avt4Ois22XyWcD6u0uyhuyU1sJUDq5_-X82AgargbTkl-HuRjKkBXrp-mx_p9WhJtPUdie-NWvg0c5-s2RHQLdEOHjX_SXwGSBPLKzFPkqNZQWoLY&quot;&gt;
    &lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEihyhmhstrQKIarEMHN97r5ScU5Y8MsQxbq-QNw4ijL-dQ0zrvuyn3sglg0kkQeo7Tua0yN4jErl14avt4Ois22XyWcD6u0uyhuyU1sJUDq5_-X82AgargbTkl-HuRjKkBXrp-mx_p9WhJtPUdie-NWvg0c5-s2RHQLdEOHjX_SXwGSBPLKzFPkqNZQWoLY&quot; width=&quot;400&quot;&gt;
  &lt;/a&gt;
&lt;/div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I will update this post with new referral bonus link every months.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEh0dkj6ucSXcCMe4pBSq2ErW0usuCeTflRuuvrMojDnELJSRCRICh--twqtMjKSImmRNabRJ6h_4-qZQslPM3ZsL8f3-NfYE5SxpfBr65hrd8ZRJi2Vl-1q5IrFSx96xmlAUQY3nr0A8oZe8Xw5LuQijgWAHDRBchBLxpsFsudfn6dwfP5wwWPv_z-0pz7m&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;
    &lt;img border=&quot;0&quot;   src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEh0dkj6ucSXcCMe4pBSq2ErW0usuCeTflRuuvrMojDnELJSRCRICh--twqtMjKSImmRNabRJ6h_4-qZQslPM3ZsL8f3-NfYE5SxpfBr65hrd8ZRJi2Vl-1q5IrFSx96xmlAUQY3nr0A8oZe8Xw5LuQijgWAHDRBchBLxpsFsudfn6dwfP5wwWPv_z-0pz7m&quot; width=&quot;400&quot;&gt;
  &lt;/a&gt;
&lt;/div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Related Articles: DoorDash driver bonus, DoorDash referral code 2026, $400 DoorDash bonus NJ, Metro Jersey DoorDash, New Jersey DoorDash jobs, Newark DoorDash delivery, NJ delivery driver bonus, DoorDash 250 deliveries bonus, Sign up DoorDash Metro Jersey, DoorDash driver referral NJ, 60 days DoorDash bonus NJ, Become DoorDash driver, DoorDash side hustle NJ, Earn money delivering NJ, DoorDash dasher signup NJ, Jersey City delivery gig, Elizabeth NJ DoorDash jobs, Union City food delivery bonus, best side hustle Newark, DoorDash promo code 2026, NJ dasher referral link, flexible hours delivery driver, earn $400 fast DoorDash, Metro NJ gig economy jobs, DoorDash new driver incentives, Hoboken delivery partner bonus, Bayonne dasher sign up, part time delivery Newark NJ, DoorDash peak pay Jersey, top gig apps New Jersey, quick cash DoorDash NJ, dasher app referral bonus, local delivery driver promo, and Jersey area food courier jobs&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lertsirikarn.blogspot.com/feeds/6516999935340138159/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lertsirikarn.blogspot.com/2026/02/doordash-dasher-referral-code-new.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/6516999935340138159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/6516999935340138159'/><link rel='alternate' type='text/html' href='http://lertsirikarn.blogspot.com/2026/02/doordash-dasher-referral-code-new.html' title='Doordash dasher referral code New Jersey February 2026'/><author><name>saveMightLife</name><uri>http://www.blogger.com/profile/07139052104556306035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEihyhmhstrQKIarEMHN97r5ScU5Y8MsQxbq-QNw4ijL-dQ0zrvuyn3sglg0kkQeo7Tua0yN4jErl14avt4Ois22XyWcD6u0uyhuyU1sJUDq5_-X82AgargbTkl-HuRjKkBXrp-mx_p9WhJtPUdie-NWvg0c5-s2RHQLdEOHjX_SXwGSBPLKzFPkqNZQWoLY=s72-c" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6898804038410932940.post-1638482280824515693</id><published>2026-01-24T19:36:06.629-08:00</published><updated>2026-02-23T22:33:47.875-08:00</updated><title type='text'>Capital One 360 Checking referral bonus</title><content type='html'>&lt;h1 class=&quot;sec-1-head&quot;&gt;&lt;span class=&quot;sec-1-title&quot;&gt;Earn up t&lt;/span&gt;&lt;span class=&quot;bonus-amount&quot;&gt;o $300&lt;/span&gt;&lt;/h1&gt;Use this link to get Capital One 360 Checking account opening bonus&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://i.capitalone.com/JMPe8xsSp&quot;&gt;https://i.capitalone.com/JMPe8xsSp&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;section class=&quot;sec-1 flex-row&quot; id=&quot;sec-1&quot;&gt;&lt;div class=&quot;main&quot;&gt;&lt;div class=&quot;left&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img _ngcontent-web-shell-c3097950413=&quot;&quot; alt=&quot;&quot; class=&quot;featuredImage center&quot; height=&quot;158&quot; src=&quot;https://ecm.capitalone.com/WCM/bank/campaigns/referrals/checking300/b4.d/customer-lp1---desktop_608x480.svg&quot; width=&quot;200&quot; /&gt;&lt;section class=&quot;grv-background--white&quot;&gt;&lt;div _ngcontent-web-shell-c2475558917=&quot;&quot; class=&quot;grv-shr-lib-wrapper icon-set&quot;&gt;&lt;div _ngcontent-web-shell-c2475558917=&quot;&quot; class=&quot;grv-shr-lib-grid&quot;&gt;&lt;div _ngcontent-web-shell-c2475558917=&quot;&quot; class=&quot;grv-shr-lib-row icon-set-headline-container ng-star-inserted&quot;&gt;&lt;h2 _ngcontent-web-shell-c2475558917=&quot;&quot; class=&quot;icon-set-headline grv-shr-lib-text__heading--normal&quot;&gt;How to earn your $300 bonus&lt;/h2&gt;&lt;/div&gt;&lt;div _ngcontent-web-shell-c2475558917=&quot;&quot; class=&quot;grv-shr-lib-row&quot;&gt;&lt;div _ngcontent-web-shell-c2475558917=&quot;&quot; class=&quot;grv-shr-lib-col--sm-4 grv-shr-lib-col--md-third grv-shr-lib-col--lg-4 ng-star-inserted&quot;&gt;&lt;div style=&quot;position: relative;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div _ngcontent-web-shell-c2004653602=&quot;&quot; class=&quot;icon-set-tile&quot;&gt;&lt;div _ngcontent-web-shell-c2004653602=&quot;&quot; class=&quot;icon-set-3 ng-star-inserted&quot;&gt;&lt;div _ngcontent-web-shell-c2004653602=&quot;&quot; class=&quot;icon-set-3-img&quot;&gt;&lt;img _ngcontent-web-shell-c2004653602=&quot;&quot; alt=&quot;&quot; src=&quot;https://ecm.capitalone.com/WCM/bank/campaigns/cd-retention/phase-1-fall-2023/cdr-icon-set/steps-1.svg&quot; /&gt;&lt;/div&gt;&lt;div _ngcontent-web-shell-c2004653602=&quot;&quot; class=&quot;icon-set-3-content&quot;&gt;&lt;h4 _ngcontent-web-shell-c2004653602=&quot;&quot; class=&quot;tile-3-headline grv-shr-lib-text--large-light ng-star-inserted&quot;&gt;Open an account&lt;/h4&gt;&lt;p _ngcontent-web-shell-c2004653602=&quot;&quot; class=&quot;icon-set-3-content-subheadline ng-star-inserted&quot;&gt;Use your friend’s unique referral code to open a 360 Checking account. &lt;a href=&quot;https://www.capitalone.com/bank/referrals/checking300/friend/?referralCode=KHFPQROAS&amp;amp;programCode=RAFOFFER300#footer-section&quot;&gt;See offer eligibility&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div _ngcontent-web-shell-c2475558917=&quot;&quot; class=&quot;grv-shr-lib-col--sm-4 grv-shr-lib-col--md-third grv-shr-lib-col--lg-4 ng-star-inserted&quot;&gt;&lt;div style=&quot;position: relative;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div _ngcontent-web-shell-c2004653602=&quot;&quot; class=&quot;icon-set-tile&quot;&gt;&lt;div _ngcontent-web-shell-c2004653602=&quot;&quot; class=&quot;icon-set-3 ng-star-inserted&quot;&gt;&lt;div _ngcontent-web-shell-c2004653602=&quot;&quot; class=&quot;icon-set-3-img&quot;&gt;&lt;img _ngcontent-web-shell-c2004653602=&quot;&quot; alt=&quot;&quot; src=&quot;https://ecm.capitalone.com/WCM/bank/campaigns/cd-retention/phase-1-fall-2023/cdr-icon-set/steps-2.svg&quot; /&gt;&lt;/div&gt;&lt;div _ngcontent-web-shell-c2004653602=&quot;&quot; class=&quot;icon-set-3-content&quot;&gt;&lt;h4 _ngcontent-web-shell-c2004653602=&quot;&quot; class=&quot;tile-3-headline grv-shr-lib-text--large-light ng-star-inserted&quot;&gt;Get direct deposits&lt;/h4&gt;&lt;p _ngcontent-web-shell-c2004653602=&quot;&quot; class=&quot;icon-set-3-content-subheadline ng-star-inserted&quot;&gt;Set up and receive at least 2 qualifying direct deposits, each of $500 or more, within 75 days of account opening.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div _ngcontent-web-shell-c2475558917=&quot;&quot; class=&quot;grv-shr-lib-col--sm-4 grv-shr-lib-col--md-third grv-shr-lib-col--lg-4 ng-star-inserted&quot;&gt;&lt;div style=&quot;position: relative;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div _ngcontent-web-shell-c2004653602=&quot;&quot; class=&quot;icon-set-tile&quot;&gt;&lt;div _ngcontent-web-shell-c2004653602=&quot;&quot; class=&quot;icon-set-3 ng-star-inserted&quot;&gt;&lt;div _ngcontent-web-shell-c2004653602=&quot;&quot; class=&quot;icon-set-3-img&quot;&gt;&lt;img _ngcontent-web-shell-c2004653602=&quot;&quot; alt=&quot;&quot; src=&quot;https://ecm.capitalone.com/WCM/bank/campaigns/cd-retention/phase-1-fall-2023/cdr-icon-set/steps-3svg.svg&quot; /&gt;&lt;/div&gt;&lt;div _ngcontent-web-shell-c2004653602=&quot;&quot; class=&quot;icon-set-3-content&quot;&gt;&lt;h4 _ngcontent-web-shell-c2004653602=&quot;&quot; class=&quot;tile-3-headline grv-shr-lib-text--large-light ng-star-inserted&quot;&gt;Enjoy your bonus&lt;/h4&gt;&lt;p _ngcontent-web-shell-c2004653602=&quot;&quot; class=&quot;icon-set-3-content-subheadline ng-star-inserted&quot;&gt;Your $300 &amp;nbsp;bonus will be deposited into your new account after you complete these steps. &lt;a href=&quot;https://www.capitalone.com/bank/referrals/checking300/friend/?referralCode=KHFPQROAS&amp;amp;programCode=RAFOFFER300#footer-section&quot;&gt;Review footnotes for full offer details&lt;/a&gt;.&lt;/p&gt;&lt;p _ngcontent-web-shell-c2004653602=&quot;&quot; class=&quot;icon-set-3-content-subheadline ng-star-inserted&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p _ngcontent-web-shell-c2004653602=&quot;&quot; class=&quot;icon-set-3-content-subheadline ng-star-inserted&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p _ngcontent-web-shell-c2004653602=&quot;&quot; class=&quot;icon-set-3-content-subheadline ng-star-inserted&quot;&gt;&lt;img _ngcontent-web-shell-c1404726243=&quot;&quot; alt=&quot;&quot; height=&quot;240&quot; src=&quot;https://ecm.capitalone.com/WCM/bank/campaigns/referrals/checking300/e4-checkered/checking-benefits---desktop---1920x1440.jpg&quot; style=&quot;background-position: center center;&quot; width=&quot;320&quot; /&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lertsirikarn.blogspot.com/feeds/1638482280824515693/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lertsirikarn.blogspot.com/2026/01/chase-business-checking-bonus.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/1638482280824515693'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/1638482280824515693'/><link rel='alternate' type='text/html' href='http://lertsirikarn.blogspot.com/2026/01/chase-business-checking-bonus.html' title='Capital One 360 Checking referral bonus'/><author><name>saveMightLife</name><uri>http://www.blogger.com/profile/07139052104556306035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6898804038410932940.post-5592582288579629339</id><published>2025-11-15T09:06:00.000-08:00</published><updated>2025-11-15T09:09:38.277-08:00</updated><title type='text'>ออมเงินให้ &quot;ชิล&quot; พร้อม &quot;ดี&quot; ไปด้วยกัน! แนะนำ บัญชีเงินฝากออมทรัพย์ชิลดี ซีไอเอ็มบี ไทย</title><content type='html'>&lt;p&gt;&lt;/p&gt;&lt;div _ngcontent-ng-c1613261715=&quot;&quot; aria-busy=&quot;false&quot; aria-live=&quot;polite&quot; class=&quot;markdown markdown-main-panel enable-updated-hr-color&quot; dir=&quot;ltr&quot; id=&quot;model-response-message-contentr_a77a5073ce9cdc46&quot; inline-copy-host=&quot;&quot; style=&quot;--animation-duration: 400ms; --fade-animation-function: linear; animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; color: #1b1c1d; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; font-family: &amp;quot;Google Sans Text&amp;quot;, sans-serif !important; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;p data-path-to-node=&quot;2&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;/p&gt;&lt;h1 style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; font-family: &amp;quot;Google Sans&amp;quot;, sans-serif !important; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;br /&gt;&lt;/h1&gt;&lt;p style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;/p&gt;&lt;p data-path-to-node=&quot;3&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;สวัสดีครับ/ค่ะ นักออมเงินยุคใหม่ทุกท่าน!&lt;/p&gt;&lt;p data-path-to-node=&quot;3&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p data-path-to-node=&quot;3&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;a href=&quot;https://atth.me/go/1HQiPB5Z&quot;&gt;กดที่นี่เพื่อสมัครออนไลน์ผ่านแอป&lt;/a&gt;&lt;/p&gt;&lt;p data-path-to-node=&quot;4&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;เคยไหมที่อยากออมเงินแต่ก็รู้สึกว่า &quot;ยุ่งยาก&quot; หรือผลตอบแทน &quot;ไม่โดนใจ&quot; เลย? ในโลกที่เต็มไปด้วยความเร่งรีบ เราทุกคนต่างมองหาวิธีการบริหารจัดการเงินที่ &lt;b style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; display: inline; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;ง่าย สะดวก&lt;/b&gt; และให้ &lt;b style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; display: inline; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;ผลตอบแทนที่ดี&lt;/b&gt; ไปพร้อมๆ กัน&lt;/p&gt;



&lt;p data-path-to-node=&quot;5&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p data-path-to-node=&quot;5&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p data-path-to-node=&quot;5&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p data-path-to-node=&quot;5&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;hr data-path-to-node=&quot;6&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot; /&gt;&lt;p data-path-to-node=&quot;7&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;/p&gt;&lt;h2 style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; font-family: &amp;quot;Google Sans&amp;quot;, sans-serif !important; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;ทำไมต้อง &quot;ชิลดี&quot; CIMB Thai?&lt;/h2&gt;&lt;p style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;/p&gt;&lt;p data-path-to-node=&quot;8&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;บัญชีเงินฝากออมทรัพย์ชิลดี ถูกออกแบบมาเพื่อตอบโจทย์ไลฟ์สไตล์ของคนยุคดิจิทัลอย่างแท้จริง ด้วยจุดเด่นที่ทำให้คุณสามารถออมเงินได้อย่างสบายใจ ไม่ต้องมีเงื่อนไขจุกจิก&lt;/p&gt;&lt;p data-path-to-node=&quot;9&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;/p&gt;&lt;h3 style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; font-family: &amp;quot;Google Sans&amp;quot;, sans-serif !important; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;1. อัตราดอกเบี้ยสุดพิเศษ!&lt;/h3&gt;&lt;p style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;/p&gt;&lt;p data-path-to-node=&quot;10&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;นี่คือพระเอกตัวจริง! บัญชีชิลดีมักจะมีอัตราดอกเบี้ยที่น่าสนใจและสูงกว่าบัญชีออมทรัพย์ทั่วไป ทำให้เงินของคุณงอกเงยได้อย่างรวดเร็ว&lt;/p&gt;&lt;blockquote data-path-to-node=&quot;11&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 16px; margin-left: 40px; margin-right: 40px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;p data-path-to-node=&quot;11,0&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;b style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; display: inline; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;เคล็ดลับ:&lt;/b&gt; ลองดูอัตราดอกเบี้ยล่าสุดของบัญชีชิลดี เพราะอาจมีการให้ดอกเบี้ยแบบเป็นขั้นบันได (Tiered Interest Rate) ที่ให้ดอกเบี้ยสูงขึ้นเมื่อยอดเงินฝากเพิ่มขึ้น! ยิ่งออมมาก ยิ่งได้มาก!&lt;/p&gt;&lt;/blockquote&gt;&lt;p data-path-to-node=&quot;12&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;/p&gt;&lt;h3 style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; font-family: &amp;quot;Google Sans&amp;quot;, sans-serif !important; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;2. &quot;ชิล&quot; ไม่มีเงื่อนไขยุ่งยาก&lt;/h3&gt;&lt;p style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;/p&gt;&lt;p data-path-to-node=&quot;13&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;การเปิดบัญชีก็ง่ายดาย และที่สำคัญคือ &lt;b style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; display: inline; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;ไม่มีการกำหนดเงินฝากขั้นต่ำ&lt;/b&gt; ในการเปิดบัญชี และ &lt;b style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; display: inline; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;ไม่มีค่าธรรมเนียม&lt;/b&gt; ในการรักษาบัญชี ไม่ต้องกังวลว่ายอดเงินจะต่ำกว่าเกณฑ์!&lt;/p&gt;&lt;p data-path-to-node=&quot;14&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;/p&gt;&lt;h3 style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; font-family: &amp;quot;Google Sans&amp;quot;, sans-serif !important; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;3. โอน จ่าย สะดวก &quot;ดี&quot; ผ่านดิจิทัล&lt;/h3&gt;&lt;p style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;/p&gt;&lt;p data-path-to-node=&quot;15&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;เข้าถึงและจัดการบัญชีของคุณได้ทุกที่ทุกเวลา ผ่านแอปพลิเคชัน CIMB Thai Digital Banking ทำให้การโอนเงิน จ่ายบิล หรือเช็คยอด เป็นเรื่องง่ายแค่ปลายนิ้ว&lt;/p&gt;&lt;p data-path-to-node=&quot;16&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;/p&gt;&lt;h3 style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; font-family: &amp;quot;Google Sans&amp;quot;, sans-serif !important; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;4. ฟรี! ค่าธรรมเนียมการทำธุรกรรม (ตามเงื่อนไข)&lt;/h3&gt;&lt;p style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;/p&gt;&lt;p data-path-to-node=&quot;17&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;บัญชีชิลดีมักจะมอบสิทธิพิเศษเรื่องค่าธรรมเนียมการทำธุรกรรม เช่น &lt;b style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; display: inline; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;ฟรี! ค่าธรรมเนียมการโอนเงิน&lt;/b&gt; ต่างธนาคารผ่านช่องทางดิจิทัล ทำให้คุณประหยัดค่าใช้จ่ายเล็กๆ น้อยๆ ไปได้อีกเยอะ&lt;/p&gt;&lt;hr data-path-to-node=&quot;18&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot; /&gt;&lt;p data-path-to-node=&quot;19&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;/p&gt;&lt;h2 style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; font-family: &amp;quot;Google Sans&amp;quot;, sans-serif !important; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&quot;ชิลดี&quot; เหมาะกับใคร?&lt;/h2&gt;&lt;p style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;/p&gt;&lt;ul data-path-to-node=&quot;20&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding-inline-start: 32px; padding: 0px 0px 0px 27px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;li style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px 0px 0px 4px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;p data-path-to-node=&quot;20,0,0&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px 0px 0px 4px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;b style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; display: inline; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;นักออมมือใหม่:&lt;/b&gt; ที่ต้องการเริ่มต้นออมเงินด้วยบัญชีที่เข้าใจง่าย และได้ดอกเบี้ยดี&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px 0px 0px 4px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;p data-path-to-node=&quot;20,1,0&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px 0px 0px 4px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;b style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; display: inline; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;มนุษย์เงินเดือน:&lt;/b&gt; ที่ต้องการพักเงินสำรอง (Emergency Fund) หรือเงินที่ยังไม่ถึงกำหนดใช้จ่าย โดยให้เงินทำงานแทนคุณ&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px 0px 0px 4px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;p data-path-to-node=&quot;20,2,0&quot; style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px 0px 0px 4px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;&lt;b style=&quot;animation: 0s ease 0s 1 normal none running none; appearance: none; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; border: 0px none rgb(27, 28, 29); clear: none; clip: auto; columns: auto; contain: none; container: none; content: normal; cursor: auto; cx: 0px; cy: 0px; d: none; direction: ltr; display: inline; fill: rgb(0, 0, 0); filter: none; flex: 0 1 auto; float: none; gap: normal; hyphens: manual; inset: auto; interactivity: auto; isolation: auto; line-height: 1.15 !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; marker: none; mask: none; offset: normal; opacity: 1; order: 0; outline: rgb(27, 28, 29) none 0px; overlay: none; padding: 0px; page: auto; perspective: none; position: static; quotes: auto; r: 0px; resize: none; rotate: none; rx: auto; ry: auto; scale: none; speak: normal; stroke: none; transform: none; transition: all; translate: none; visibility: visible; x: 0px; y: 0px; zoom: 1;&quot;&gt;นักลงทุนที่เน้นสภาพคล่อง:&lt;/b&gt; ที่ต้องการบัญชีที่มีความยืดหยุ่น สามารถถอนเมื่อไหร่ก็ได้ แต่ก็ยังได้รับผลตอบแทนที่ดี&lt;/p&gt;
  

&lt;a href=&quot;https://atth.me/adv.php?rk=00efav000l0m&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://imp.accesstrade.in.th/img.php?rk=00efav000l0m&quot; border=&quot;0&quot;/&gt;&lt;/a&gt;


&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;!----&gt;</content><link rel='replies' type='application/atom+xml' href='http://lertsirikarn.blogspot.com/feeds/5592582288579629339/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lertsirikarn.blogspot.com/2025/11/blog-post.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/5592582288579629339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/5592582288579629339'/><link rel='alternate' type='text/html' href='http://lertsirikarn.blogspot.com/2025/11/blog-post.html' title='ออมเงินให้ &quot;ชิล&quot; พร้อม &quot;ดี&quot; ไปด้วยกัน! แนะนำ บัญชีเงินฝากออมทรัพย์ชิลดี ซีไอเอ็มบี ไทย'/><author><name>saveMightLife</name><uri>http://www.blogger.com/profile/07139052104556306035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6898804038410932940.post-630842455275707322</id><published>2025-11-02T22:17:44.420-08:00</published><updated>2025-11-02T22:25:23.524-08:00</updated><title type='text'>ฟรี Perplexity Pro หนึ่งเดือน</title><content type='html'>&lt;div&gt;ใช้ลิงค์ชวนเพื่อนด้านล่างนี้&lt;/div&gt;&lt;div&gt;&amp;nbsp;เพื่อที่จะได้รับ Perplexity Pro ฟรี 1 เดือน&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://pplx.ai/mightlertya&quot;&gt;https://pplx.ai/mightlertya&lt;/a&gt;&lt;a href=&quot;https://pplx.ai/mightlertya&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Comet Browser เป็นเว็บเบราว์เซอร์ที่มี AI ช่วยเหลือในตัว ถูกออกแบบมาเพื่อเปลี่ยนประสบการณ์ใช้งานอินเทอร์เน็ตให้ฉลาดและอัตโนมัติมากขึ้น พร้อมฟีเจอร์สรุปบทความ, วางแผน และทำงานแทนผู้ใช้ หลายคนในประเทศไทยก็เริ่มหันมาใช้งานเพราะติดตั้งง่ายและฟรี&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Comet Browser คืออะไร&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Comet Browser เป็นเบราว์เซอร์ที่พัฒนาโดย Perplexity AI จุดเด่นคือ “ผู้ช่วย AI” ที่พร้อมสรุปข้อมูล, ช่วยค้นหา, วางแผน หรือแม้แต่ทำงานข้ามแท็บให้แบบอัตโนมัติ ถูกสร้างบนพื้นฐาน Chromium ดังนั้นใช้งานส่วนขยาย Chrome ได้และสามารถย้ายบุ๊กมาร์ก, รหัสผ่าน มาได้ทันที&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;วิธีดาวน์โหลด Comet Browser&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;เปิดเว็บไซต์นี้&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;a href=&quot;https://pplx.ai/mightlertya&quot;&gt;https://www.perplexity.ai/comet&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lertsirikarn.blogspot.com/feeds/630842455275707322/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lertsirikarn.blogspot.com/2025/11/ai-comet-browser.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/630842455275707322'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/630842455275707322'/><link rel='alternate' type='text/html' href='http://lertsirikarn.blogspot.com/2025/11/ai-comet-browser.html' title='ฟรี Perplexity Pro หนึ่งเดือน'/><author><name>saveMightLife</name><uri>http://www.blogger.com/profile/07139052104556306035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6898804038410932940.post-1501410520041969043</id><published>2025-09-24T00:42:00.000-07:00</published><updated>2025-09-24T00:42:34.968-07:00</updated><title type='text'>Iu Mien (Yao) cartoon drawings </title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;These are some Mien (Yao) people cartoon drawings.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuxn-2TlPEUYO6hk3X1Lz5QjlIh_bbw-GgbOxxMVK7lnZwvSRyyrRQszID53UvLSAVz8fKWm8zy4cfxF_rwfoj2WWAoH_-C4KYiINFacDEg9urU5nsmgGmW1x1ah58uR6yaaP4AqgMx2zXRgp2lNdxqDRkRpZ9SVZI012HJBgZ7DvzoDojSCbFSxRPD3W6/s1024/Generated%20Image%20September%2024,%202025%20-%203_36AM(2).png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1024&quot; data-original-width=&quot;1024&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuxn-2TlPEUYO6hk3X1Lz5QjlIh_bbw-GgbOxxMVK7lnZwvSRyyrRQszID53UvLSAVz8fKWm8zy4cfxF_rwfoj2WWAoH_-C4KYiINFacDEg9urU5nsmgGmW1x1ah58uR6yaaP4AqgMx2zXRgp2lNdxqDRkRpZ9SVZI012HJBgZ7DvzoDojSCbFSxRPD3W6/s320/Generated%20Image%20September%2024,%202025%20-%203_36AM(2).png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXHSAQz1pQXa4P6IzFOG5NESduaWRrvvMtjTFNG6np0ZiIMBMr5ygECGzvCstH_Ju57Ku-w0Ql8CACM1n5HJ7kM5M8rtPk-lll3lrJqjAAdIMXGjG9RGURRtjhR_i8pjNnztH9zWDqtiSUIDSXp9MSdfNjy26Pvra72_07AF2kClihzG9zG6mB0sZZtuxZ/s1024/Generated%20Image%20September%2024,%202025%20-%203_36AM(1).png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1024&quot; data-original-width=&quot;1024&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXHSAQz1pQXa4P6IzFOG5NESduaWRrvvMtjTFNG6np0ZiIMBMr5ygECGzvCstH_Ju57Ku-w0Ql8CACM1n5HJ7kM5M8rtPk-lll3lrJqjAAdIMXGjG9RGURRtjhR_i8pjNnztH9zWDqtiSUIDSXp9MSdfNjy26Pvra72_07AF2kClihzG9zG6mB0sZZtuxZ/s320/Generated%20Image%20September%2024,%202025%20-%203_36AM(1).png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmY3mA46rcTR49j2Flo_d4f1AGXIZxaEpbsFup6YwGifVCbK_w89D8GoMiqqdO5hWX80PBkP6DbFSR81vp1boM8dHqqlvwXxZoOnqVg0X8t2ruiJ_XnDHlNI4FD8WP9ozTdCG_MQAeEfOD8q9GHZQCBtdzsdxu-e4YCE_ImeSTKM2EGfjx2eXtayoi6D_k/s1024/Generated%20Image%20September%2024,%202025%20-%203_36AM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1024&quot; data-original-width=&quot;1024&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmY3mA46rcTR49j2Flo_d4f1AGXIZxaEpbsFup6YwGifVCbK_w89D8GoMiqqdO5hWX80PBkP6DbFSR81vp1boM8dHqqlvwXxZoOnqVg0X8t2ruiJ_XnDHlNI4FD8WP9ozTdCG_MQAeEfOD8q9GHZQCBtdzsdxu-e4YCE_ImeSTKM2EGfjx2eXtayoi6D_k/s320/Generated%20Image%20September%2024,%202025%20-%203_36AM.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqT1yZRovBGdSQI4UL23meDtIvH_dK8-rHkm8_omaEzraMde9mWqEaaFam-VF6d5l-hW-mZQI0Qrkic-KFRYdZbPoGvd_2RTD-m08H8lB9QTVHW8Tp8ux1kjHth0U17e2703UTLvhfZLbFquY5wwVwIJxHK-xIs4XBWZm9G7-io3ACUTo80o2d8tAmG8wS/s1024/1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1024&quot; data-original-width=&quot;1024&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqT1yZRovBGdSQI4UL23meDtIvH_dK8-rHkm8_omaEzraMde9mWqEaaFam-VF6d5l-hW-mZQI0Qrkic-KFRYdZbPoGvd_2RTD-m08H8lB9QTVHW8Tp8ux1kjHth0U17e2703UTLvhfZLbFquY5wwVwIJxHK-xIs4XBWZm9G7-io3ACUTo80o2d8tAmG8wS/s320/1.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6UFFppuH1KDHLvLxuFXv2kMqYv9DOAlCezhugmqeViy0mkyPMi8poQmdneCTZ6HCqBn8pwA-yyZuaEKIpREgdOlJso1zboB2QoI_xflUQEdLcSjoAs7IeN4dZPX8LHjwsjTTUECm5SnK2bWYJUpON1ux_5nk0mliavHa-442_z3WdxHG7aFsgLbfYxR1a/s1024/Generated%20Image%20September%2024,%202025%20-%203_41AM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1024&quot; data-original-width=&quot;1024&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6UFFppuH1KDHLvLxuFXv2kMqYv9DOAlCezhugmqeViy0mkyPMi8poQmdneCTZ6HCqBn8pwA-yyZuaEKIpREgdOlJso1zboB2QoI_xflUQEdLcSjoAs7IeN4dZPX8LHjwsjTTUECm5SnK2bWYJUpON1ux_5nk0mliavHa-442_z3WdxHG7aFsgLbfYxR1a/s320/Generated%20Image%20September%2024,%202025%20-%203_41AM.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiW64eKot6LxmVbc1Y1Wei8LMrkUSh1AB0lu-Shm6EcC1g3DpLhnqgWG9OcVE1x8IgRmT3mXaojBtaQjGM5hK8Iq7yXkxc5-lfl_xft6ivO0TZOL9EYE6FfctHqKm9pwmsM4rhavul7s_tVlQdfhdEx-lNq7pxdKWsaL1fj1zJt5xJfEQfIFCLxAuQ6zzyT/s1024/Generated%20Image%20September%2024,%202025%20-%203_40AM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1024&quot; data-original-width=&quot;1024&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiW64eKot6LxmVbc1Y1Wei8LMrkUSh1AB0lu-Shm6EcC1g3DpLhnqgWG9OcVE1x8IgRmT3mXaojBtaQjGM5hK8Iq7yXkxc5-lfl_xft6ivO0TZOL9EYE6FfctHqKm9pwmsM4rhavul7s_tVlQdfhdEx-lNq7pxdKWsaL1fj1zJt5xJfEQfIFCLxAuQ6zzyT/s320/Generated%20Image%20September%2024,%202025%20-%203_40AM.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFv3WGfQZrt67KqiksGIyyPFkHkCUM4qokALHZoJFr9RDLxIY4K6Cq80gQAfUaDAJS1RfUoY4sQXpOszZyRy4nyH7aQFB-UY2XVvcHlEUe_mYgsjfTeIWuJ32pDRF3XFX7O9wBNftvm90UVVU_Hh6D2y40MCQJWTzvuF6LbJGslEJVzHPfpHwk9hXgPxjr/s1024/Generated%20Image%20September%2024,%202025%20-%203_38AM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1024&quot; data-original-width=&quot;1024&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFv3WGfQZrt67KqiksGIyyPFkHkCUM4qokALHZoJFr9RDLxIY4K6Cq80gQAfUaDAJS1RfUoY4sQXpOszZyRy4nyH7aQFB-UY2XVvcHlEUe_mYgsjfTeIWuJ32pDRF3XFX7O9wBNftvm90UVVU_Hh6D2y40MCQJWTzvuF6LbJGslEJVzHPfpHwk9hXgPxjr/s320/Generated%20Image%20September%2024,%202025%20-%203_38AM.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj459E5DdPBKUIjwGkCwLSwrRa88IbQF7r8ajr8vi7qHzJyiT0tl6alU8wGSvme-vHgA2euMHOK3cKnsUS3I-S1CiXdBGtX7Ynb6jGNVmj8YOQ2iZqjHiQow_eILzvGUIoCIGinQC7iYMLveQfSErHgtVupJ9a3c21eCNQPGrWl1b1uwHPbveJ-UTDOaaqU/s1024/Generated%20Image%20September%2024,%202025%20-%203_37AM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1024&quot; data-original-width=&quot;1024&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj459E5DdPBKUIjwGkCwLSwrRa88IbQF7r8ajr8vi7qHzJyiT0tl6alU8wGSvme-vHgA2euMHOK3cKnsUS3I-S1CiXdBGtX7Ynb6jGNVmj8YOQ2iZqjHiQow_eILzvGUIoCIGinQC7iYMLveQfSErHgtVupJ9a3c21eCNQPGrWl1b1uwHPbveJ-UTDOaaqU/s320/Generated%20Image%20September%2024,%202025%20-%203_37AM.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://lertsirikarn.blogspot.com/feeds/1501410520041969043/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lertsirikarn.blogspot.com/2025/09/iu-mien-yao-cartoon-drawings.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/1501410520041969043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/1501410520041969043'/><link rel='alternate' type='text/html' href='http://lertsirikarn.blogspot.com/2025/09/iu-mien-yao-cartoon-drawings.html' title='Iu Mien (Yao) cartoon drawings '/><author><name>saveMightLife</name><uri>http://www.blogger.com/profile/07139052104556306035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuxn-2TlPEUYO6hk3X1Lz5QjlIh_bbw-GgbOxxMVK7lnZwvSRyyrRQszID53UvLSAVz8fKWm8zy4cfxF_rwfoj2WWAoH_-C4KYiINFacDEg9urU5nsmgGmW1x1ah58uR6yaaP4AqgMx2zXRgp2lNdxqDRkRpZ9SVZI012HJBgZ7DvzoDojSCbFSxRPD3W6/s72-c/Generated%20Image%20September%2024,%202025%20-%203_36AM(2).png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6898804038410932940.post-1951448126194113046</id><published>2025-07-27T10:35:00.000-07:00</published><updated>2025-09-02T22:30:52.060-07:00</updated><title type='text'>Browser use VS Nano browser. Which agentic AI browser is better</title><content type='html'>When evaluating which of browser-use or nanobrowser is better, it&#39;s essential to consider their different philosophies, architectures, and intended use cases beyond just form filling and signups. Both are powerful tools, but they excel in different areas.&lt;div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Here&#39;s a general comparison:&lt;/div&gt;&lt;div&gt;&lt;div&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgBUUrcvl6jDm1vsTsM9--1JFJhWO-8xD8bnslfwZJL0I4l0HRZrOY6_Lb3RlrHiQKC3IFnd_YZmz9-j_qIVVrMJW_QAfPKh7cpwAlzua5DRUlXbNFeN7Aw3Fsyf5rjzUe3QyVJz_J258chYnK8w5llFJWLt_hNC5xjFqOn2vHHWPSkOvYFcXDAPN0UVKDl&quot;&gt;
    &lt;br&gt;
  &lt;/a&gt;
&lt;/div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Browser-Use: The Foundational AI Browser Agent&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Strengths:&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Core AI-Browser Control: Browser-use focuses on providing the fundamental capability for an AI agent (LLM) to control a web browser. It acts as a robust base layer for AI to interact with web elements.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* API/Library Flexibility: As a Python library with an API, browser-use is highly flexible for developers looking to integrate AI browser automation into larger, custom applications or workflows. It&#39;s an excellent choice for building more complex, tailor-made AI agents.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Desktop Application: The availability of a desktop app makes it accessible for users who prefer a standalone application to run AI-driven browser tasks locally.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Direct Control: It offers a more direct approach to controlling the browser with AI, suitable for scenarios where a single LLM or a custom script is orchestrating the process.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Considerations:&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Orchestration Responsibility: While it provides the core browser control, the overall AI agent orchestration (planning, validation logic) might need to be handled more explicitly by the developer using browser-use as a component.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* User Interface: For non-developers, its primary use as a library or a desktop app might require a bit more technical familiarity compared to a browser extension.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Ideal General Use Cases:&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Developers building custom AI agents that require web interaction.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Integrating web automation into larger data pipelines or backend systems.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Advanced web scraping and data extraction projects where granular control is needed.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Creating specialized AI workflows that combine web actions with other AI capabilities (e.g., data analysis, report generation).&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Nanobrowser: The Integrated Multi-Agent Chrome Extension&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Strengths:&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Multi-Agent Robustness: This is Nanobrowser&#39;s standout feature. The Planner, Navigator, and Validator agents create a highly robust and adaptive system. This makes it more resilient to unexpected changes on websites, network glitches, or complex workflows, as the agents can self-correct and re-plan.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Privacy-Centric (Local Execution): Its design principle of &quot;everything runs in your local browser&quot; is a significant advantage for privacy-conscious users and sensitive tasks. Data and credentials are not sent to external servers, which is crucial for business-critical or personal automation.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Chrome Extension Convenience: Operating as a Chrome extension offers unparalleled convenience. It&#39;s directly integrated into the browser environment where users already spend much of their time, making setup and use potentially simpler for many.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Flexible LLM Integration: The ability to use your own LLM API keys for various providers offers financial control and flexibility in choosing the best model for specific tasks without vendor lock-in.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Builds on Browser-Use: The fact that it builds upon browser-use suggests it leverages proven core browser automation capabilities while adding its unique multi-agent intelligence and user-friendly form factor.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Considerations:&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Browser Dependency: Being a Chrome extension means it&#39;s primarily tied to Chromium-based browsers (Chrome, Edge). While this covers a large user base, it&#39;s not cross-browser in the same way a library like browser-use might enable.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Extension Overhead: For very high-volume, continuous automation, a dedicated library might offer slightly better performance or resource management compared to a browser extension, depending on implementation.&lt;/div&gt;&lt;div&gt;Ideal General Use Cases:&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Everyday web automation tasks for individuals and small businesses.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Automating complex, multi-step online processes that benefit from intelligent planning and validation.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Use cases where privacy and local execution are paramount (e.g., personal financial tasks, sensitive data handling).&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Users who prefer a more &quot;out-of-the-box&quot; AI agent experience directly within their browser.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Exploring and prototyping AI-powered web automation without deep coding knowledge.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Which One is better?&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;There isn&#39;t a single &quot;better&quot; one in general; it depends on your role, technical proficiency, and specific requirements:&lt;/div&gt;&lt;div&gt;&amp;nbsp;* For Developers and Custom Solutions: If you are a developer looking for a powerful foundational library to integrate AI browser control into larger, custom, and potentially headless applications, browser-use provides that robust core. It offers maximum flexibility for building bespoke solutions.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* For Users (including less technical ones) and Robust Browser-Based Automation: If you&#39;re looking for a highly capable, resilient, and privacy-friendly AI web automation tool that runs conveniently in your browser, nanobrowser is likely the &quot;better&quot; general choice. Its multi-agent system makes it more robust for real-world web interactions, and its Chrome extension form factor combined with local execution makes it very accessible and secure for a wider range of users.&lt;/div&gt;&lt;div&gt;In essence, browser-use is a powerful component for building AI agents, while nanobrowser is a more complete and robust AI agent application that leverages such components within a user-friendly browser environment.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Https://github.com/browser-use/browser-use&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;https://github.com/nanobrowser/nanobrowser&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lertsirikarn.blogspot.com/feeds/1951448126194113046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lertsirikarn.blogspot.com/2025/07/browser-use-vs-nano-browser-which.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/1951448126194113046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/1951448126194113046'/><link rel='alternate' type='text/html' href='http://lertsirikarn.blogspot.com/2025/07/browser-use-vs-nano-browser-which.html' title='Browser use VS Nano browser. Which agentic AI browser is better'/><author><name>saveMightLife</name><uri>http://www.blogger.com/profile/07139052104556306035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6898804038410932940.post-4496245034612487912</id><published>2025-05-24T23:55:00.000-07:00</published><updated>2025-05-24T23:56:17.253-07:00</updated><title type='text'>Python: Design in memory database and also able to handle SQL like query</title><content type='html'>&lt;br /&gt;&lt;div&gt;&amp;nbsp;Overview:&lt;br /&gt;This file implements a simple in-memory key-value database using a Python dictionary.&lt;br /&gt;The InMemoryDB class provides basic methods to set, get, delete, and list keys.&lt;br /&gt;&lt;br /&gt;Note: No regular expressions are used for SQL parsing; only simple string operations are used.&lt;br /&gt;&lt;br /&gt;Pros:&lt;br /&gt;- Simple and easy to use.&lt;br /&gt;- Fast operations for small to moderate data sizes.&lt;br /&gt;- No external dependencies.&lt;br /&gt;&lt;br /&gt;Cons:&lt;br /&gt;- Data is lost when the program exits (not persistent).&lt;br /&gt;- Not suitable for large datasets (limited by system memory).&lt;br /&gt;- No support for concurrent access or transactions.&lt;br /&gt;- No advanced querying or indexing features.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #1f1f1f; color: #cccccc; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 14px; font-weight: normal; line-height: 19px; white-space: pre;&quot;&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;InMemoryDB&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;__init__&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Initialize the database with an empty dictionary to hold tables.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Each table is itself a dictionary mapping keys to row data.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_tables&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; {}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Store table schemas: {table_name: {column: type}}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_schemas&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; {}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Store primary key column for each table: {table_name: primary_key_column}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_primary_keys&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; {}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;create_table&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;schema&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;None&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;primary_key&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;None&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Create a new table with an optional schema and primary key.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; schema: dict mapping column names to Python types (e.g., {&#39;name&#39;: str, &#39;age&#39;: int})&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; primary_key: column name to use as primary key&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Sample:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; table_name = &#39;users&#39;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; schema = {&#39;id&#39;: int, &#39;name&#39;: str}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; primary_key = &#39;id&#39;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Only create the table if it doesn&#39;t already exist&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_tables&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Initialize the table as an empty dictionary&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_tables&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; {}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# If a schema is provided, store it; otherwise, use an empty schema&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;schema&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_schemas&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;schema&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_schemas&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; {}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Store primary key if provided&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;primary_key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_primary_keys&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;primary_key&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_primary_keys&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;None&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;drop_table&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Remove a table and its schema from the database if it exists.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Sample:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; table_name = &#39;users&#39;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Remove a table and its schema from the database if it exists.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_tables&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;del&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_tables&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_schemas&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;del&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_schemas&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_primary_keys&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;del&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_primary_keys&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;insert&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Insert a new row into the specified table.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;key&#39; is the unique identifier for the row.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;value&#39; is a dictionary representing the row&#39;s fields.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Sample:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; table_name = &#39;users&#39;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; key = 1&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value = {&#39;id&#39;: 1, &#39;name&#39;: &#39;alice&#39;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Insert a new row into the specified table.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# &#39;key&#39; is the unique identifier for the row.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# &#39;value&#39; is a dictionary representing the row&#39;s fields.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_tables&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Table &#39;&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39; does not exist.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_tables&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;]:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Key &#39;&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39; already exists in table &#39;&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Enforce schema type constraints if schema is defined&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;schema&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_schemas&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, {})&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;primary_key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_primary_keys&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;col&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;col_type&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;schema&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.items():&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Ensure all columns in the schema are present in the value&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;col&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Missing column &#39;&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;col&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39; in insert for table &#39;&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Ensure the type of each column matches the schema&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;isinstance&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;col&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;], &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;col_type&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;TypeError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Column &#39;&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;col&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39; must be of type &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;col_type&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;__name__&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt; in table &#39;&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# If primary key is defined, ensure key matches value[primary_key]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;primary_key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;primary_key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Primary key column &#39;&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;primary_key&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39; must be present in value for table &#39;&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;primary_key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;]:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Key &#39;&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39; does not match primary key value &#39;&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;primary_key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39; for table &#39;&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Store the row in the table&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_tables&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;select&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Retrieve a row from the specified table by its key.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Returns the row dictionary or None if the key does not exist.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Sample:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; table_name = &#39;users&#39;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; key = 1&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Retrieve a row from the specified table by its key.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Returns the row dictionary or None if the key does not exist.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_tables&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Table &#39;&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39; does not exist.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_tables&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;].get(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;None&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;update&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Update an existing row in the specified table.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;key&#39; identifies the row, &#39;value&#39; is the new data.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Sample:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; table_name = &#39;users&#39;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; key = 1&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value = {&#39;id&#39;: 1, &#39;name&#39;: &#39;bob&#39;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Update an existing row in the specified table.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# &#39;key&#39; identifies the row, &#39;value&#39; is the new data.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_tables&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Table &#39;&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39; does not exist.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_tables&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;]:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Key &#39;&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39; does not exist in table &#39;&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Enforce schema type constraints if schema is defined&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;schema&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_schemas&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, {})&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;col&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;col_type&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;schema&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.items():&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Only check columns that are being updated&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;col&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;and&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;isinstance&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;col&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;], &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;col_type&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;TypeError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Column &#39;&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;col&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39; must be of type &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;col_type&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;__name__&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt; in table &#39;&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Update the row with the new value&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_tables&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;delete&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Delete a row from the specified table by its key.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Sample:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; table_name = &#39;users&#39;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; key = 1&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Delete a row from the specified table by its key.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_tables&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Table &#39;&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39; does not exist.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_tables&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;]:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;del&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_tables&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;tables&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Return a list of all table names in the database.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Sample: No parameters.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Return a list of all table names in the database.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;list&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_tables&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;keys&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;())&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;keys&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Return a list of all keys in the specified table.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Sample:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; table_name = &#39;users&#39;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Return a list of all keys in the specified table.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_tables&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Table &#39;&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39; does not exist.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;list&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_tables&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table_name&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;].keys())&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;query&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;sql&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Execute a simple SQL-like query.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Supported:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - SELECT &amp;lt;fields&amp;gt; FROM &amp;lt;table&amp;gt; [WHERE &amp;lt;field&amp;gt;=&#39;&amp;lt;value&amp;gt;&#39;]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - INSERT INTO &amp;lt;table&amp;gt; (&amp;lt;fields&amp;gt;) VALUES (&amp;lt;values&amp;gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - UPDATE &amp;lt;table&amp;gt; SET &amp;lt;field&amp;gt;=&#39;&amp;lt;value&amp;gt;&#39; [WHERE &amp;lt;field&amp;gt;=&#39;&amp;lt;value&amp;gt;&#39;]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - DEL FROM &amp;lt;table&amp;gt; [WHERE &amp;lt;field&amp;gt;=&#39;&amp;lt;value&amp;gt;&#39;]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - CREATE TABLE &amp;lt;table&amp;gt; (&amp;lt;col&amp;gt; &amp;lt;type&amp;gt;, ...)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Returns: list of dicts (rows) for SELECT, None for others&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Now also supports PRIMARY KEY in CREATE TABLE.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Sample:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sql = &quot;SELECT * FROM users&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sql = &quot;CREATE TABLE users (id int, name str, PRIMARY KEY(id))&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;&quot;&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;sql&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;sql&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Handle CREATE TABLE queries&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;sql&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.upper().startswith(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;CREATE TABLE&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Example: CREATE TABLE users (id int, name str, PRIMARY KEY(id))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;after_create&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;sql&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;12&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:].strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Find the opening parenthesis for the schema definition&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;paren_open&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;after_create&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.find(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;(&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Ensure the syntax is correct (parentheses present)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;paren_open&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;or&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;after_create&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.endswith(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;)&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Invalid CREATE TABLE syntax.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Extract the table name (before the parenthesis)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;after_create&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[:&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;paren_open&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;].strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Extract the schema string (inside the parentheses)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;schema_str&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;after_create&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;paren_open&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;].strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Table name required for CREATE TABLE.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;schema&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; {}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;primary_key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;None&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;schema_str&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Split by comma, but handle PRIMARY KEY specially&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;coldefs&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;c&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.strip() &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;c&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;schema_str&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.split(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;,&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;to_remove&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; []&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;coldef&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;enumerate&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;coldefs&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;coldef&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.upper().startswith(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;PRIMARY KEY&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Parse PRIMARY KEY(col)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;pk_start&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;coldef&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.find(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;(&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;pk_end&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;coldef&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.find(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;)&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;pk_start&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;or&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;pk_end&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Invalid PRIMARY KEY syntax.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;pk_col&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;coldef&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;pk_start&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;pk_end&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;].strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;pk_col&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;PRIMARY KEY column name required.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;primary_key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;pk_col&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;to_remove&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;append&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Remove PRIMARY KEY clause(s) from coldefs&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;idx&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;reversed&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;to_remove&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;del&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;coldefs&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;idx&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Parse remaining column definitions&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;coldef&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;coldefs&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;parts&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;coldef&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.strip().split()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;len&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;parts&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Invalid column definition in CREATE TABLE.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;col&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;typ&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;parts&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;typ_map&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; {&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;str&#39;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;str&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;int&#39;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;float&#39;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;float&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;typ&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;typ_map&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Unsupported type &#39;&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;typ&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39; in CREATE TABLE.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;schema&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;col&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;typ_map&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;typ&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# If no primary key specified, default to None&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;create_table&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;schema&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;primary_key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;None&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Handle SELECT queries&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;sql&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.upper().startswith(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;SELECT&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Parse SELECT statement to extract fields, table, and optional WHERE clause&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;select_part&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;sql&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:].strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Find the index of &quot;FROM&quot; to separate fields from table name&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;from_idx&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;select_part&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.upper().find(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;FROM&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;fields_str&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;select_part&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[:&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;from_idx&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;].strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;rest&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;select_part&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;from_idx&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;4&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:].strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Check for WHERE clause&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;WHERE&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;rest&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.upper():&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;where_idx&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;rest&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.upper().find(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;WHERE&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;rest&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[:&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;where_idx&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;].strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;where_clause&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;rest&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;where_idx&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:].strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;rest&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;where_clause&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;None&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Split fields by comma and strip whitespace&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;fields&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.strip() &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;fields_str&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.split(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;,&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_tables&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Table &#39;&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39; does not exist.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Helper function to check if a row matches the WHERE clause&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;row_matches&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;where_clause&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;True&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Only support: field=&#39;value&#39;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;=&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;where_clause&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Only simple equality WHERE clauses are supported.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;field&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;where_clause&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.split(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;=&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;field&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;field&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Remove quotes from value if present&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.startswith(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;&#39;&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;and&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.endswith(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;&#39;&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.get(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;field&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;result&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; []&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Iterate over all rows in the table&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_tables&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;].items():&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Add the key as a field in the row for querying&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;full_row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;dict&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;full_row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;key&#39;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Only include rows that match the WHERE clause (if any)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;row_matches&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;full_row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;fields&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;*&#39;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;]:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Return all fields&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;result&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;append&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;full_row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Return only selected fields&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;result&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;append&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;({&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;full_row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;fields&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;})&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;result&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Handle INSERT queries&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;sql&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.upper().startswith(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;INSERT INTO&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Example: INSERT INTO users (name,age) VALUES (&#39;carol&#39;,22)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;after_into&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;sql&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;11&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:].strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;paren_open&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;after_into&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.find(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;(&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;after_into&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[:&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;paren_open&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;].strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;paren_close&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;after_into&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.find(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;)&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;fields_str&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;after_into&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;paren_open&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;paren_close&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;after_fields&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;after_into&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;paren_close&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:].strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;after_fields&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.upper().startswith(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;VALUES&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Invalid INSERT syntax.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;values_part&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;after_fields&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:].strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;values_part&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.startswith(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;(&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;and&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;values_part&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.endswith(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;)&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Invalid VALUES syntax.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;values_str&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;values_part&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;fields&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.strip() &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;fields_str&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.split(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;,&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Split values by comma, handle quoted strings&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;values&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; []&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;curr&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;in_quote&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;False&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;c&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;values_str&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;c&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;&#39;&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;and&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;in_quote&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;in_quote&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;True&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;curr&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;c&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;elif&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;c&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;&#39;&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;and&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;in_quote&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;in_quote&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;False&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;curr&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;c&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;elif&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;c&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;,&#39;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;and&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;in_quote&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;values&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;append&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;curr&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;strip&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;())&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;curr&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;curr&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;c&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;curr&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;values&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;append&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;curr&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;strip&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;())&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Remove quotes from string values and convert to int if possible&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;clean_values&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; []&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;v&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;values&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;v&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;v&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;v&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.startswith(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;&#39;&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;and&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;v&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.endswith(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;&#39;&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;clean_values&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;append&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;v&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;])&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;try&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;clean_values&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;append&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;v&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;except&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;clean_values&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;append&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;v&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;len&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;fields&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;len&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;clean_values&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Number of fields and values do not match.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_tables&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Table &#39;&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39; does not exist.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;primary_key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_primary_keys&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Build row and key, always include the key field in the row if it is used as key&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;key&#39;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;fields&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key_index&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;fields&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;index&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;key&#39;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;clean_values&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key_index&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; {}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;enumerate&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;fields&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;clean_values&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;elif&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;primary_key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;and&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;primary_key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;fields&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key_index&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;fields&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;index&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;primary_key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;clean_values&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key_index&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; {}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;enumerate&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;fields&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;clean_values&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;clean_values&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; {}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;enumerate&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;fields&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;clean_values&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Call the insert method&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;insert&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;None&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Handle UPDATE queries (no regex)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;sql&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.upper().startswith(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;UPDATE&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Example: UPDATE users SET age=31 WHERE name=&#39;alice&#39;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;after_update&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;sql&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:].strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Find the index of &quot;SET&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;set_idx&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;after_update&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.upper().find(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;SET&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;set_idx&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Invalid UPDATE syntax.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;after_update&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[:&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;set_idx&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;].strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;after_set&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;after_update&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;set_idx&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:].strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Find the index of &quot;WHERE&quot; if present&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;where_idx&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;after_set&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.upper().find(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;WHERE&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;where_idx&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;set_clause&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;after_set&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[:&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;where_idx&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;].strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;where_clause&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;after_set&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;where_idx&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:].strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;set_clause&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;after_set&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;where_clause&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;None&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_tables&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Table &#39;&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39; does not exist.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Parse SET clause: field=&#39;value&#39;,field2=&#39;value2,...&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;set_parts&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;p&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.strip() &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;p&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;set_clause&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.split(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;,&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;set_dict&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; {}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;part&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;set_parts&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;=&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;part&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Invalid SET clause.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;field&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;part&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.split(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;=&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;field&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;field&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Remove quotes from value if present, or convert to int if possible&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.startswith(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;&#39;&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;and&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.endswith(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;&#39;&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;try&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;except&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;pass&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;set_dict&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;field&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Helper function to check if a row matches the WHERE clause&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;row_matches&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;where_clause&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;True&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;=&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;where_clause&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Only simple equality WHERE clauses are supported.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;field&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;where_clause&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.split(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;=&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;field&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;field&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.startswith(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;&#39;&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;and&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.endswith(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;&#39;&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.get(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;field&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# For each matching row, call update&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;list&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_tables&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;].items()):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;full_row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;dict&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;full_row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;key&#39;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;row_matches&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;full_row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Merge the update into the row&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;updated_row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;dict&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;k&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;v&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;set_dict&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;items&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;():&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;k&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;key&#39;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;continue&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;updated_row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;k&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;v&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;update&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;updated_row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;None&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Handle DEL (delete) queries (no regex)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;sql&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.upper().startswith(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;DEL FROM&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Example: DEL FROM users WHERE name=&#39;alice&#39;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;after_del&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;sql&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;8&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:].strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Find the index of &quot;WHERE&quot; if present&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;where_idx&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;after_del&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.upper().find(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;WHERE&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;where_idx&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;!=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;after_del&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[:&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;where_idx&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;].strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;where_clause&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;after_del&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;where_idx&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:].strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;after_del&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;where_clause&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;None&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_tables&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;f&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Table &#39;&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39; does not exist.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Helper function to check if a row matches the WHERE clause&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;row_matches&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;where_clause&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;True&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;=&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;where_clause&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Only simple equality WHERE clauses are supported.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;field&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;where_clause&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.split(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;=&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;field&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;field&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.strip()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.startswith(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;&#39;&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;and&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.endswith(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;&#39;&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.get(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;field&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;value&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Collect keys of rows to delete&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;to_delete&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; []&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;_tables&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;].items():&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;full_row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;dict&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;full_row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;key&#39;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;row_matches&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;full_row&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;to_delete&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;append&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Call the delete method for each key&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;to_delete&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;delete&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;table&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #569cd6;&quot;&gt;None&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# If the query does not match any supported format, raise an error&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;raise&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;Invalid SQL query format.&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Example usage:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #c586c0;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;__name__&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;__main__&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Create an instance of the in-memory database&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;db&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #d4d4d4;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;InMemoryDB&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Create a table named &#39;users&#39; with a schema&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;db&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;create_table&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;users&#39;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, {&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;name&#39;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;str&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;age&#39;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color: #4ec9b0;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;})&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Insert two users into the &#39;users&#39; table&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;db&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;insert&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;users&#39;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;alice&#39;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, {&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;name&#39;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;alice&#39;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;age&#39;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;30&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;})&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;db&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;insert&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;users&#39;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;bob&#39;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, {&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;name&#39;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;bob&#39;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;age&#39;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color: #b5cea8;&quot;&gt;25&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;})&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# SQL-like queries&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Select all users&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;db&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;query&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;SELECT * FROM users&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)) &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# All users&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Select name and age of user where name is &#39;alice&#39;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;db&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;query&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;SELECT name,age FROM users WHERE name=&#39;alice&#39;&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)) &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# alice&#39;s info&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Select age of user where name is &#39;bob&#39;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;db&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;query&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;SELECT age FROM users WHERE name=&#39;bob&#39;&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)) &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# bob&#39;s age&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Insert a new user &#39;carol&#39;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;db&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;query&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;INSERT INTO users (name,age) VALUES (&#39;carol&#39;,22)&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;) &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Insert new user&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Show all users after insert&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;db&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;query&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;SELECT * FROM users&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)) &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# All users after insert&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Update alice&#39;s age to 31&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;db&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;query&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;UPDATE users SET age=31 WHERE name=&#39;alice&#39;&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;) &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Update alice&#39;s age&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Show all users after update&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;db&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;query&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;SELECT * FROM users&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)) &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# All users after update&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Delete user where name is &#39;bob&#39;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;db&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;query&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;DEL FROM users WHERE name=&#39;bob&#39;&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;) &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Delete bob&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Show all users after delete&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;db&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;query&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&quot;SELECT * FROM users&quot;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)) &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# All users after delete&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6a9955;&quot;&gt;# Drop the &#39;users&#39; table&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #9cdcfe;&quot;&gt;db&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #dcdcaa;&quot;&gt;drop_table&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #ce9178;&quot;&gt;&#39;users&#39;&lt;/span&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: #181818; color: #cccccc; font-family: &amp;quot;Segoe WPC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, sans-serif; font-size: 13px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0px 0px 16px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: #181818; color: #cccccc; font-family: &amp;quot;Segoe WPC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, sans-serif; font-size: 13px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0px 0px 16px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;ul style=&quot;-webkit-text-stroke-width: 0px; background-color: #181818; color: #cccccc; font-family: &amp;quot;Segoe WPC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, sans-serif; font-size: 13px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; padding-inline-start: 24px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;li&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lertsirikarn.blogspot.com/feeds/4496245034612487912/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lertsirikarn.blogspot.com/2025/05/python-design-in-memory-database-and.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/4496245034612487912'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/4496245034612487912'/><link rel='alternate' type='text/html' href='http://lertsirikarn.blogspot.com/2025/05/python-design-in-memory-database-and.html' title='Python: Design in memory database and also able to handle SQL like query'/><author><name>saveMightLife</name><uri>http://www.blogger.com/profile/07139052104556306035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6898804038410932940.post-5453609439778763527</id><published>2025-05-22T14:03:00.000-07:00</published><updated>2025-05-22T14:03:36.003-07:00</updated><title type='text'>Python API interview questions and answers</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div _ngcontent-ng-c34882000=&quot;&quot; class=&quot;markdown markdown-main-panel tutor-markdown-rendering enable-updated-hr-color&quot; dir=&quot;ltr&quot; id=&quot;model-response-message-contentr_8437264c8d3ee835&quot; style=&quot;--animation-duration: 400ms; --fade-animation-function: linear; font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;p data-sourcepos=&quot;1:1-1:224&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Here are the some questions about API that are usually asked in Python coding interview Keep in mind that for many questions, there can be multiple valid approaches, and the provided answers represent common or best practices.&lt;/p&gt;&lt;hr data-sourcepos=&quot;3:1-3:3&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot; /&gt;&lt;h2 data-sourcepos=&quot;5:1-5:51&quot; style=&quot;font-family: Google Sans, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;I. Core Python Concepts (as they relate to APIs)&lt;/h2&gt;&lt;p data-sourcepos=&quot;7:1-7:99&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;These questions test your foundational Python knowledge, which is crucial for building robust APIs.&lt;/p&gt;&lt;ol data-sourcepos=&quot;9:1-449:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;9:1-16:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;9:5-9:24&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Data Structures:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;10:5-16:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;10:5-10:189&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; Explain the difference between &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;list&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;tuple&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;dict&lt;/code&gt;, and &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;set&lt;/code&gt; in Python and when you would choose one over the other in the context of API request/response handling.&lt;/li&gt;&lt;li data-sourcepos=&quot;11:5-16:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;12:9-16:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;12:9-12:205&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;list&lt;/code&gt;&lt;/strong&gt;: Ordered, mutable, allows duplicate elements. Good for ordered collections of items, e.g., a list of product IDs in a shopping cart request, or a sequence of events in an API response.&lt;/li&gt;&lt;li data-sourcepos=&quot;13:9-13:365&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;tuple&lt;/code&gt;&lt;/strong&gt;: Ordered, &lt;em style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;immutable&lt;/em&gt;, allows duplicate elements. Good for fixed collections of related items where the order and content should not change, e.g., representing coordinates &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;(latitude, longitude)&lt;/code&gt;, or fixed configuration parameters that an API endpoint might expect. Often used as dictionary keys when order matters and immutability is desired.&lt;/li&gt;&lt;li data-sourcepos=&quot;14:9-14:286&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;dict&lt;/code&gt;&lt;/strong&gt;: Unordered (since Python 3.7, insertion order is preserved), mutable, stores key-value pairs, keys must be unique and immutable. Essential for JSON payloads in API requests and responses, as JSON naturally maps to dictionaries. E.g., &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{&quot;name&quot;: &quot;Alice&quot;, &quot;age&quot;: 30}&lt;/code&gt;.&lt;/li&gt;&lt;li data-sourcepos=&quot;15:9-16:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;set&lt;/code&gt;&lt;/strong&gt;: Unordered, mutable, stores unique elements. Good for checking membership efficiently or removing duplicates from a collection, e.g., to ensure a list of user permissions passed to an API has no duplicates, or to find common elements between two sets of data.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;17:1-81:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;17:5-17:33&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Functions and Decorators:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;18:5-81:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;18:5-18:165&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;18:7-18:165&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; What are Python decorators, and how can they be used in an API context (e.g., for authentication, logging, or rate limiting)? Provide an example.&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;19:5-50:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;19:7-19:17&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;20:9-50:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;20:9-20:312&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;20:11-20:312&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;What are Decorators:&lt;/strong&gt; Decorators are a way to modify or enhance the behavior of functions or methods without explicitly changing their source code. They are essentially functions that take another function as an argument, add some functionality, and return a new function (or the modified original).&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;21:9-25:121&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;21:11-21:32&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;API Context Usage:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;22:13-25:121&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;22:13-22:168&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Authentication/Authorization:&lt;/strong&gt; A decorator can check if a user is logged in or has the necessary permissions before allowing access to an API endpoint.&lt;/li&gt;&lt;li data-sourcepos=&quot;23:13-23:102&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Logging:&lt;/strong&gt; Automatically log every API request, including URL, method, and parameters.&lt;/li&gt;&lt;li data-sourcepos=&quot;24:13-24:124&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Rate Limiting:&lt;/strong&gt; Track and enforce limits on how many requests a client can make within a certain timeframe.&lt;/li&gt;&lt;li data-sourcepos=&quot;25:13-25:121&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Input Validation:&lt;/strong&gt; Validate incoming request data before the main logic of the API endpoint is executed.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;26:9-50:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;26:11-26:39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Example (Authentication):&lt;/strong&gt;&lt;/p&gt;
&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block ng-tns-c564991203-51 ng-trigger ng-trigger-codeBlockRevealAnimation&quot; style=&quot;display: block; font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c564991203-51 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-51&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Python&lt;/span&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;buttons ng-tns-c564991203-51 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;button _ngcontent-ng-c564991203=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c564991203-51 mat-unthemed ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-focus-indicator&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c564991203-51&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;animated-opacity ng-tns-c564991203-51&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;pre _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-51&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-container formatted ng-tns-c564991203-51&quot; data-sourcepos=&quot;28:13-49:69&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt; functools &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt; wraps
&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt; flask &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt; request, jsonify

&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Dummy user check (in a real app, you&#39;d check a database/token)&lt;/span&gt;
AUTHORIZED_USERS = {&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;admin_token&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;user_token&quot;&lt;/span&gt;}

&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;authenticate_token&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&lt;/span&gt;):&lt;/span&gt;
&lt;span class=&quot;hljs-meta&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;    @wraps(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&lt;/span&gt;)&lt;/span&gt;
    &lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;decorated_function&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;*args, **kwargs&lt;/span&gt;):&lt;/span&gt;
        token = request.headers.get(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;Authorization&#39;&lt;/span&gt;)
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;not&lt;/span&gt; token &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;or&lt;/span&gt; token.replace(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Bearer &quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;&quot;&lt;/span&gt;) &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;in&lt;/span&gt; AUTHORIZED_USERS:
            &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; jsonify({&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;message&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Unauthorized&quot;&lt;/span&gt;}), &lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;401&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; f(*args, **kwargs)
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; decorated_function

&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Example Flask API usage&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# @app.route(&#39;/protected_data&#39;)&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# @authenticate_token&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# def protected_data():&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;#     return jsonify({&quot;data&quot;: &quot;This is sensitive data.&quot;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;51:5-51:148&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;51:7-51:148&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; Explain &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;*args&lt;/code&gt; and &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;**kwargs&lt;/code&gt; and how they are useful when designing flexible API endpoints that can accept varying parameters.&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;52:5-81:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;52:7-52:17&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;53:9-81:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;53:9-53:174&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;53:11-53:174&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;*args&lt;/code&gt; (Arbitrary Positional Arguments):&lt;/strong&gt; Allows a function to accept an arbitrary number of positional arguments. These arguments are collected into a &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;tuple&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;54:9-54:176&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;54:11-54:176&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;**kwargs&lt;/code&gt; (Arbitrary Keyword Arguments):&lt;/strong&gt; Allows a function to accept an arbitrary number of keyword arguments. These arguments are collected into a &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;dictionary&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;55:9-58:205&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;55:11-55:102&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Usefulness in APIs:&lt;/strong&gt; They are crucial for creating flexible and extensible API endpoints.&lt;/p&gt;
&lt;ul data-sourcepos=&quot;56:13-58:205&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;56:13-56:197&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Forwarding Arguments:&lt;/strong&gt; An API endpoint might receive parameters and need to forward them to an internal service or another function without knowing all possible parameters upfront.&lt;/li&gt;&lt;li data-sourcepos=&quot;57:13-57:148&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Generic Handlers:&lt;/strong&gt; You can write generic handlers that can process different types of requests, where the specific parameters vary.&lt;/li&gt;&lt;li data-sourcepos=&quot;58:13-58:205&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Middleware/Decorators:&lt;/strong&gt; Decorators or middleware functions can accept &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;*args&lt;/code&gt; and &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;**kwargs&lt;/code&gt; to wrap any function, regardless of its signature, and pass through all its original arguments.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;59:9-81:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;59:11-59:22&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Example:&lt;/strong&gt;&lt;/p&gt;
&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block ng-tns-c564991203-52 ng-trigger ng-trigger-codeBlockRevealAnimation&quot; style=&quot;display: block; font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c564991203-52 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-52&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Python&lt;/span&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;buttons ng-tns-c564991203-52 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;button _ngcontent-ng-c564991203=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c564991203-52 mat-unthemed ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-focus-indicator&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c564991203-52&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;animated-opacity ng-tns-c564991203-52&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;pre _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-52&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-container formatted ng-tns-c564991203-52&quot; data-sourcepos=&quot;61:13-80:39&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;process_request_params&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;endpoint_name, *args, **kwargs&lt;/span&gt;):&lt;/span&gt;
    print(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;Processing request for: &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{endpoint_name}&lt;/span&gt;&quot;&lt;/span&gt;)
    print(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;Positional arguments: &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{args}&lt;/span&gt;&quot;&lt;/span&gt;)
    print(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;Keyword arguments: &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{kwargs}&lt;/span&gt;&quot;&lt;/span&gt;)

    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;user_id&#39;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;in&lt;/span&gt; kwargs:
        print(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;User ID found: &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{kwargs[&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;user_id&#39;&lt;/span&gt;]}&lt;/span&gt;&quot;&lt;/span&gt;)
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;if&lt;/span&gt; args:
        print(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;First positional arg: &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{args[&lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;0&lt;/span&gt;]}&lt;/span&gt;&quot;&lt;/span&gt;)

&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# API endpoint could call this with varying parameters&lt;/span&gt;
process_request_params(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;get_user&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;123&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;active&quot;&lt;/span&gt;, name=&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Alice&quot;&lt;/span&gt;, status=&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;online&quot;&lt;/span&gt;)
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Output:&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Processing request for: get_user&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Positional arguments: (123, &#39;active&#39;)&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Keyword arguments: {&#39;name&#39;: &#39;Alice&#39;, &#39;status&#39;: &#39;online&#39;}&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# User ID found: 123&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# First positional arg: 123&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;82:1-200:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;82:5-82:54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Classes and Object-Oriented Programming (OOP):&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;83:5-200:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;83:5-83:179&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;83:7-83:179&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; How would you design a Python class to represent a &quot;Resource&quot; in a RESTful API (e.g., a &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Product&lt;/code&gt; or &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;User&lt;/code&gt; object)? What methods and attributes would it have?&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;84:5-150:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;84:7-84:17&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;85:9-150:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;85:9-85:227&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;85:11-85:227&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Design Rationale:&lt;/strong&gt; In a RESTful API, resources are the core entities. Representing them as Python classes allows for clean, organized code, encapsulation of data and behavior, and easier mapping to database models.&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;86:9-136:15&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;86:11-86:38&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Example &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Product&lt;/code&gt; Class:&lt;/strong&gt;&lt;/p&gt;
&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block ng-tns-c564991203-53 ng-trigger ng-trigger-codeBlockRevealAnimation&quot; style=&quot;display: block; font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c564991203-53 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-53&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Python&lt;/span&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;buttons ng-tns-c564991203-53 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;button _ngcontent-ng-c564991203=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c564991203-53 mat-unthemed ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-focus-indicator&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c564991203-53&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;animated-opacity ng-tns-c564991203-53&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;pre _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-53&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-container formatted ng-tns-c564991203-53&quot; data-sourcepos=&quot;88:13-136:32&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-class&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Product&lt;/span&gt;:&lt;/span&gt;
    &lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;__init__&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;self, product_id, name, description, price, stock_quantity=&lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;0&lt;/span&gt;&lt;/span&gt;):&lt;/span&gt;
        &lt;span class=&quot;citation-77&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;self.product_id = product_id
        self.name = name
        self.description = description
        self.price = price
        self.stock_quantity = stock_quantity

    &lt;/span&gt;&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-77&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-77 citation-end-77&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;to_dict&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;self&lt;/span&gt;):&lt;/span&gt;
        &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;&quot;&quot;Converts the Product object to a dictionary for JSON serialization.&quot;&quot;&quot;&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; {
            &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;id&quot;&lt;/span&gt;: self.product_id,
            &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;name&quot;&lt;/span&gt;: self.name,
            &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;description&quot;&lt;/span&gt;: self.description,
            &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;price&quot;&lt;/span&gt;: self.price,
            &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;stock_quantity&quot;&lt;/span&gt;: self.stock_quantity
        }

&lt;span class=&quot;hljs-meta&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;    @classmethod&lt;/span&gt;
    &lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from_dict&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;cls, data&lt;/span&gt;):&lt;/span&gt;
        &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;&quot;&quot;Creates a Product object from a dictionary (e.g., from an API request body).&quot;&quot;&quot;&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;all&lt;/span&gt;(k &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;in&lt;/span&gt; data &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;for&lt;/span&gt; k &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;in&lt;/span&gt; [&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;id&#39;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;name&#39;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;price&#39;&lt;/span&gt;]):
            &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;raise&lt;/span&gt; ValueError(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Missing essential product data.&quot;&lt;/span&gt;)
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; cls(
            product_id=data[&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;id&#39;&lt;/span&gt;],
            name=data[&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;name&#39;&lt;/span&gt;],
            description=data.get(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;description&#39;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;&#39;&lt;/span&gt;),
            price=data[&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;price&#39;&lt;/span&gt;],
            stock_quantity=data.get(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;stock_quantity&#39;&lt;/span&gt;, &lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;0&lt;/span&gt;)
        )

    &lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;update&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;self, new_data&lt;/span&gt;):&lt;/span&gt;
        &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;&quot;&quot;Updates product attributes based on new data.&quot;&quot;&quot;&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;for&lt;/span&gt; key, value &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;in&lt;/span&gt; new_data.items():
            &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;hasattr&lt;/span&gt;(self, key): &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Only update existing attributes&lt;/span&gt;
                &lt;span class=&quot;hljs-built_in&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;setattr&lt;/span&gt;(self, key, value)

    &lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;is_in_stock&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;self&lt;/span&gt;):&lt;/span&gt;
        &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;&quot;&quot;Checks if the product is in stock.&quot;&quot;&quot;&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; self.stock_quantity &amp;gt; &lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;0&lt;/span&gt;

    &lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;decrease_stock&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;self, quantity&lt;/span&gt;):&lt;/span&gt;
        &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;&quot;&quot;Decreases the stock quantity.&quot;&quot;&quot;&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;if&lt;/span&gt; self.stock_quantity &amp;gt;= quantity:
            self.stock_quantity -= quantity
            &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-literal&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;True&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-literal&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;False&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;137:9-143:74&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;137:11-137:25&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Attributes:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;138:13-143:74&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;138:13-138:70&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;product_id&lt;/code&gt;: Unique identifier (e.g., UUID or integer).&lt;/li&gt;&lt;li data-sourcepos=&quot;139:13-139:29&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;name&lt;/code&gt;: String.&lt;/li&gt;&lt;li data-sourcepos=&quot;140:13-140:36&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;description&lt;/code&gt;: String.&lt;/li&gt;&lt;li data-sourcepos=&quot;141:13-141:40&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;price&lt;/code&gt;: Float or Decimal.&lt;/li&gt;&lt;li data-sourcepos=&quot;142:13-142:40&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;stock_quantity&lt;/code&gt;: Integer.&lt;/li&gt;&lt;li data-sourcepos=&quot;143:13-143:74&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;created_at&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;updated_at&lt;/code&gt;: Datetime objects (for auditing).&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;144:9-150:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;144:11-144:22&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Methods:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;145:13-150:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;145:13-145:71&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;__init__&lt;/code&gt;: Constructor to initialize product attributes.&lt;/li&gt;&lt;li data-sourcepos=&quot;146:13-146:115&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;to_dict()&lt;/code&gt;: Converts the object into a dictionary, suitable for JSON serialization in API responses.&lt;/li&gt;&lt;li data-sourcepos=&quot;147:13-147:128&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from_dict()&lt;/code&gt; (classmethod): Creates an object from a dictionary, useful for parsing incoming JSON request bodies.&lt;/li&gt;&lt;li data-sourcepos=&quot;148:13-148:89&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;update()&lt;/code&gt;: Modifies attributes based on partial data (for PATCH requests).&lt;/li&gt;&lt;li data-sourcepos=&quot;149:13-150:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;is_in_stock()&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;decrease_stock()&lt;/code&gt;: Business logic related to the product.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;151:5-151:188&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;151:7-151:188&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; Discuss the concept of inheritance and polymorphism in Python and how they might be applied to API design (e.g., different types of users having different permissions).&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;152:5-200:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;152:7-152:17&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;153:9-200:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;153:9-156:280&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;153:11-153:195&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Inheritance:&lt;/strong&gt; Allows a new class (subclass/child) to inherit attributes and methods from an existing class (superclass/parent). This promotes code reuse and a hierarchical structure.&lt;/p&gt;
&lt;ul data-sourcepos=&quot;154:13-156:280&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;154:13-156:280&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;API Application:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;155:17-156:280&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;155:17-155:247&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;User Roles:&lt;/strong&gt; You could have a base &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;User&lt;/code&gt; class and then &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;AdminUser&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;CustomerUser&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;GuestUser&lt;/code&gt; subclasses. Each subclass could inherit basic user properties but override or add methods for specific permissions or behaviors.&lt;/li&gt;&lt;li data-sourcepos=&quot;156:17-156:280&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Resource Types:&lt;/strong&gt; A base &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;APIResource&lt;/code&gt; class could define common methods (&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;get_by_id&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;create&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;update&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;delete&lt;/code&gt;) and then specific resources like &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;ProductResource&lt;/code&gt; or &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;OrderResource&lt;/code&gt; could inherit from it, providing specific implementations for their data.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;157:9-160:321&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;157:11-157:217&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Polymorphism:&lt;/strong&gt; &quot;Many forms.&quot; It refers to the ability of different classes to respond to the same method call in different ways. In Python, this is often achieved through method overriding or duck typing.&lt;/p&gt;
&lt;ul data-sourcepos=&quot;158:13-160:321&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;158:13-160:321&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;API Application:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;159:17-160:321&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;159:17-159:395&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Request Handlers:&lt;/strong&gt; Imagine an API endpoint that processes different types of &quot;events&quot; (e.g., &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;OrderCreatedEvent&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;UserLoggedInEvent&lt;/code&gt;). Each event type could be an object with a &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;process()&lt;/code&gt; method. The API handler could iterate through a list of events and call &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;event.process()&lt;/code&gt; on each, and the specific implementation for processing would vary based on the event&#39;s class.&lt;/li&gt;&lt;li data-sourcepos=&quot;160:17-160:321&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Serializers/Transformers:&lt;/strong&gt; If you have different types of objects that need to be serialized into a standard JSON format, you could define a common &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;serialize()&lt;/code&gt; method. Even if the internal data structure differs, calling &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;obj.serialize()&lt;/code&gt; on different object types would produce the desired output.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;161:9-200:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;161:11-161:35&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Example (User Roles):&lt;/strong&gt;&lt;/p&gt;
&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block ng-tns-c564991203-54 ng-trigger ng-trigger-codeBlockRevealAnimation&quot; style=&quot;display: block; font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c564991203-54 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Python&lt;/span&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;buttons ng-tns-c564991203-54 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;button _ngcontent-ng-c564991203=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c564991203-54 mat-unthemed ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-focus-indicator&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c564991203-54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;animated-opacity ng-tns-c564991203-54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;pre _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-container formatted ng-tns-c564991203-54&quot; data-sourcepos=&quot;163:13-199:61&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-class&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;BaseUser&lt;/span&gt;:&lt;/span&gt;
    &lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;__init__&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;self, user_id, username&lt;/span&gt;):&lt;/span&gt;
        self.user_id = user_id
        self.username = username

    &lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;can_view&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;self, resource_type&lt;/span&gt;):&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-literal&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;False&lt;/span&gt; &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Default: no view access&lt;/span&gt;

    &lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;to_dict&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;self&lt;/span&gt;):&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; {&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;id&quot;&lt;/span&gt;: self.user_id, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;username&quot;&lt;/span&gt;: self.username}

&lt;span class=&quot;hljs-class&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;CustomerUser&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;BaseUser&lt;/span&gt;):&lt;/span&gt;
    &lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;can_view&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;self, resource_type&lt;/span&gt;):&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; resource_type &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;in&lt;/span&gt; [&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;products&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;orders&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;profile&quot;&lt;/span&gt;]

    &lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;place_order&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;self, order_details&lt;/span&gt;):&lt;/span&gt;
        &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Logic to place an order&lt;/span&gt;
        print(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;&lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{self.username}&lt;/span&gt; placing order: &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{order_details}&lt;/span&gt;&quot;&lt;/span&gt;)
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-literal&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;True&lt;/span&gt;

&lt;span class=&quot;hljs-class&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;AdminUser&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;BaseUser&lt;/span&gt;):&lt;/span&gt;
    &lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;can_view&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;self, resource_type&lt;/span&gt;):&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-literal&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;True&lt;/span&gt; &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Admins can view everything&lt;/span&gt;

    &lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;manage_users&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;self, action&lt;/span&gt;):&lt;/span&gt;
        &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Logic for admin actions&lt;/span&gt;
        print(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;&lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{self.username}&lt;/span&gt; performing admin action: &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{action}&lt;/span&gt;&quot;&lt;/span&gt;)
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-literal&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;True&lt;/span&gt;

&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# In an API handler:&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# user_obj = CustomerUser(1, &quot;Alice&quot;) or AdminUser(2, &quot;Bob&quot;)&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# if user_obj.can_view(&quot;products&quot;):&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;#    # Allow access to products endpoint&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# if isinstance(user_obj, AdminUser):&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;#    user_obj.manage_users(&quot;delete_old_accounts&quot;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;201:1-334:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;201:5-201:38&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Error Handling and Exceptions:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;202:5-334:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;202:5-202:207&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;202:7-202:207&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; How do you handle exceptions in Python, and how would you use &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;try-except-finally&lt;/code&gt; blocks to gracefully handle errors in an API endpoint (e.g., invalid input, database connection issues)?&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;203:5-266:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;203:7-203:17&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;204:9-266:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;204:9-208:245&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;204:11-204:109&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Exception Handling:&lt;/strong&gt; Python uses &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;try&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;except&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;else&lt;/code&gt;, and &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;finally&lt;/code&gt; blocks to manage errors.&lt;/p&gt;
&lt;ul data-sourcepos=&quot;205:13-208:245&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;205:13-205:75&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;try&lt;/code&gt;: The code that might raise an exception is placed here.&lt;/li&gt;&lt;li data-sourcepos=&quot;206:13-206:159&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;except&lt;/code&gt;: If an exception occurs in the &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;try&lt;/code&gt; block, the code in the matching &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;except&lt;/code&gt; block is executed. You can catch specific exception types.&lt;/li&gt;&lt;li data-sourcepos=&quot;207:13-207:116&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;else&lt;/code&gt;: (Optional) The code in the &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;else&lt;/code&gt; block is executed if no exception occurs in the &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;try&lt;/code&gt; block.&lt;/li&gt;&lt;li data-sourcepos=&quot;208:13-208:245&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;finally&lt;/code&gt;: (Optional) The &lt;span class=&quot;citation-76&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;code in the &lt;/span&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-76&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;finally&lt;/span&gt;&lt;/code&gt;&lt;span class=&quot;citation-76&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; block is &lt;/span&gt;&lt;em style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-76&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;always&lt;/span&gt;&lt;/em&gt;&lt;span class=&quot;citation-76 citation-end-76&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; executed, regardless of whether an exception occurred or not. It&#39;s often used for cleanup&lt;sup _ngcontent-ng-c4096754574=&quot;&quot; class=&quot;superscript&quot; data-turn-source-index=&quot;1&quot; style=&quot;background-color: transparent !important; font-family: Google Sans Text, sans-serif !important; font-size: 16px !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;1&lt;/sup&gt;&lt;/span&gt; operations (e.g., closing file handles, database connections).&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;209:9-212:114&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;209:11-209:26&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;API Context:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;210:13-212:114&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;210:13-210:98&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Invalid Input:&lt;/strong&gt; Catch &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;ValueError&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;TypeError&lt;/code&gt;, or custom validation exceptions.&lt;/li&gt;&lt;li data-sourcepos=&quot;211:13-211:142&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Database Issues:&lt;/strong&gt; Catch &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;OperationalError&lt;/code&gt; (for connection issues), &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;IntegrityError&lt;/code&gt; (for unique constraint violations), etc.&lt;/li&gt;&lt;li data-sourcepos=&quot;212:13-212:114&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;External Service Calls:&lt;/strong&gt; Catch &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;requests.exceptions.RequestException&lt;/code&gt; for network or HTTP errors.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;213:9-266:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;213:11-213:22&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Example:&lt;/strong&gt;&lt;/p&gt;
&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block ng-tns-c564991203-55 ng-trigger ng-trigger-codeBlockRevealAnimation&quot; style=&quot;display: block; font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c564991203-55 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-55&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Python&lt;/span&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;buttons ng-tns-c564991203-55 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;button _ngcontent-ng-c564991203=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c564991203-55 mat-unthemed ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-focus-indicator&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c564991203-55&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;animated-opacity ng-tns-c564991203-55&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;pre _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-55&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-container formatted ng-tns-c564991203-55&quot; data-sourcepos=&quot;215:13-265:26&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt; flask &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt; Flask, request, jsonify
&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt; sqlite3 &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Example database library&lt;/span&gt;

app = Flask(__name__)
DATABASE = &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;my_api.db&#39;&lt;/span&gt;

&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;get_db_connection&lt;/span&gt;():&lt;/span&gt;
    conn = sqlite3.connect(DATABASE)
    conn.row_factory = sqlite3.Row &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Allows accessing columns by name&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; conn

&lt;span class=&quot;hljs-meta&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;@app.route(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;/users/&amp;lt;int:user_id&amp;gt;&#39;&lt;/span&gt;, methods=[&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;GET&#39;&lt;/span&gt;]&lt;/span&gt;)&lt;/span&gt;
&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;get_user&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;user_id&lt;/span&gt;):&lt;/span&gt;
    conn = &lt;span class=&quot;hljs-literal&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;None&lt;/span&gt; &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Initialize conn to None&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;try&lt;/span&gt;:
        &lt;span class=&quot;citation-75&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;conn = get_db_connection()
        cursor = conn.cursor()
        cursor.execute(&lt;/span&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-75&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;SELECT * FROM users WHERE id = ?&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-75&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;, (user_id,))
        user = cursor.fetchone()

        &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-75&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-75 citation-end-75&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; user&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;hljs-literal&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;None&lt;/span&gt;:
            &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; jsonify({&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;message&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;User with ID &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{user_id}&lt;/span&gt; not found&quot;&lt;/span&gt;}), &lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;404&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;else&lt;/span&gt;:
            &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; jsonify(&lt;span class=&quot;hljs-built_in&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;dict&lt;/span&gt;(user)), &lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;200&lt;/span&gt; &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Convert Row object to dict&lt;/span&gt;

    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;except&lt;/span&gt; sqlite3.OperationalError &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;as&lt;/span&gt; e:
        &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Database connection or query error&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; jsonify({&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;message&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;Database error: &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{&lt;span class=&quot;hljs-built_in&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;str&lt;/span&gt;(e)}&lt;/span&gt;&quot;&lt;/span&gt;}), &lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;500&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;except&lt;/span&gt; ValueError &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;as&lt;/span&gt; e:
        &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# For cases where input parsing might fail before DB&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; jsonify({&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;message&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;Invalid input: &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{&lt;span class=&quot;hljs-built_in&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;str&lt;/span&gt;(e)}&lt;/span&gt;&quot;&lt;/span&gt;}), &lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;400&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;except&lt;/span&gt; Exception &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;as&lt;/span&gt; e:
        &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Catch any other unexpected errors&lt;/span&gt;
        print(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;An unexpected error occurred: &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{e}&lt;/span&gt;&quot;&lt;/span&gt;)
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; jsonify({&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;message&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;An internal server error occurred&quot;&lt;/span&gt;}), &lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;500&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;finally&lt;/span&gt;:
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;if&lt;/span&gt; conn:
            conn.close() &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Ensure database connection is closed&lt;/span&gt;

&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# To run:&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# app.run(debug=True)&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Create a dummy table for testing:&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# &lt;span class=&quot;citation-74&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;conn = sqlite3.connect(DATABASE)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-74&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-74&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# cursor = conn.cursor()&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-74&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-74&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# cursor.execute(&quot;CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY &lt;/span&gt;&lt;span class=&quot;citation-73 citation-74 citation-end-74&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;KEY,&lt;/span&gt;&lt;span class=&quot;citation-73&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; name TEXT)&quot;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-73&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-73&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# cursor.execute(&quot;INSERT INTO users (name) VALUES (&#39;Alice&#39;)&quot;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-73&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-73&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# cursor.execute(&quot;INSERT INTO users (name) VALUES (&#39;Bob&#39;)&quot;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-73&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-73&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# conn.commit()&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-73 citation-end-73&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# conn.close()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;267:5-267:178&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;267:7-267:178&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; What are common HTTP status codes for errors (e.g., 400, 401, 403, 404, 500) and how would you map Python exceptions to these status codes in an API response?&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;268:5-334:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;268:7-268:17&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;269:9-334:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;269:9-278:155&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;269:11-269:40&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Common Error Status Codes:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;270:13-278:155&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;270:13-270:144&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;400 Bad Request&lt;/code&gt;&lt;/strong&gt;: The client sent an invalid request (e.g., malformed JSON, missing required parameters, invalid data types).&lt;/li&gt;&lt;li data-sourcepos=&quot;271:13-271:143&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;401 Unauthorized&lt;/code&gt;&lt;/strong&gt;: The client is not authenticated (i.e., they haven&#39;t provided valid credentials like an API key or token).&lt;/li&gt;&lt;li data-sourcepos=&quot;272:13-272:152&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;403 Forbidden&lt;/code&gt;&lt;/strong&gt;: The client is authenticated but does not have the necessary permissions to access the resource or perform the action.&lt;/li&gt;&lt;li data-sourcepos=&quot;273:13-273:91&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;404 Not Found&lt;/code&gt;&lt;/strong&gt;: The requested resource could not be found on the server.&lt;/li&gt;&lt;li data-sourcepos=&quot;274:13-274:128&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;405 Method Not Allowed&lt;/code&gt;&lt;/strong&gt;: The HTTP method used (e.g., POST) &lt;span class=&quot;citation-72&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;is not supported for the requested resource.&lt;/span&gt;&lt;/li&gt;&lt;span class=&quot;citation-72&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;/span&gt;&lt;li data-sourcepos=&quot;275:13-275:219&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-72&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;409 Conflict&lt;/span&gt;&lt;/code&gt;&lt;/strong&gt;&lt;span class=&quot;citation-72&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;citation-71 citation-72 citation-end-72&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;The request could not be completed due to a conflict with the current state of the resource&lt;sup _ngcontent-ng-c4096754574=&quot;&quot; class=&quot;superscript&quot; data-turn-source-index=&quot;2&quot; style=&quot;background-color: transparent !important; font-family: Google Sans Text, sans-serif !important; font-size: 16px !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;2&lt;/sup&gt;&lt;/span&gt;&lt;span class=&quot;citation-71 citation-end-71&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; (e.g., trying to create a resource that already exists&lt;sup _ngcontent-ng-c4096754574=&quot;&quot; class=&quot;superscript&quot; data-turn-source-index=&quot;3&quot; style=&quot;background-color: transparent !important; font-family: Google Sans Text, sans-serif !important; font-size: 16px !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;3&lt;/sup&gt;&lt;/span&gt; with a unique ID).&lt;/li&gt;&lt;li data-sourcepos=&quot;276:13-276:129&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-70&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;429 Too Many Requests&lt;/span&gt;&lt;/code&gt;&lt;/strong&gt;&lt;span class=&quot;citation-70&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;: The client has sent too many requests in a given amount of time (rate limiting).&lt;/span&gt;&lt;/li&gt;&lt;span class=&quot;citation-70&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;/span&gt;&lt;li data-sourcepos=&quot;277:13-277:231&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-70&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;500 Internal Server Error&lt;/span&gt;&lt;/code&gt;&lt;/strong&gt;&lt;span class=&quot;citation-70 citation-end-70&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;: A generic error message&lt;sup _ngcontent-ng-c4096754574=&quot;&quot; class=&quot;superscript&quot; data-turn-source-index=&quot;4&quot; style=&quot;background-color: transparent !important; font-family: Google Sans Text, sans-serif !important; font-size: 16px !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;4&lt;/sup&gt;&lt;/span&gt; indicating an unexpected condition on the server that prevented the fulfillment of the request. This is a catch-all for unhandled server-side exceptions.&lt;/li&gt;&lt;li data-sourcepos=&quot;278:13-278:155&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-69&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;503 Service Unavailable&lt;/span&gt;&lt;/code&gt;&lt;/strong&gt;&lt;span class=&quot;citation-69 citation-end-69&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;: The server is currently unable to handle the request due to temporary overloading or maintenance.&lt;sup _ngcontent-ng-c4096754574=&quot;&quot; class=&quot;superscript&quot; data-turn-source-index=&quot;5&quot; style=&quot;background-color: transparent !important; font-family: Google Sans Text, sans-serif !important; font-size: 16px !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;5&lt;/sup&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;279:9-334:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;279:11-279:40&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Mapping Python Exceptions:&lt;/strong&gt;&lt;/p&gt;
&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block ng-tns-c564991203-56 ng-trigger ng-trigger-codeBlockRevealAnimation&quot; style=&quot;display: block; font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c564991203-56 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-56&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Python&lt;/span&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;buttons ng-tns-c564991203-56 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;button _ngcontent-ng-c564991203=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c564991203-56 mat-unthemed ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-focus-indicator&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c564991203-56&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;animated-opacity ng-tns-c564991203-56&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;pre _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-56&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-container formatted ng-tns-c564991203-56&quot; data-sourcepos=&quot;281:13-333:51&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt; flask &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt; jsonify

&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Custom Exception Classes for API Errors&lt;/span&gt;
&lt;span class=&quot;hljs-class&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;APIError&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Exception&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;):&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
    status_code = &lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;500&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;__init__&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;self, message, status_code=&lt;/span&gt;&lt;span class=&quot;hljs-literal&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;None&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;, payload=&lt;/span&gt;&lt;span class=&quot;hljs-literal&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;None&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;):&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;hljs-built_in&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;super&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;().__init__(self)
        self.message = message
        &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; status_code &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;is&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;not&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-literal&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;None&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-68 citation-end-68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;:&lt;/span&gt;
            self.status_code = status_code
        self.payload = payload

    &lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;to_dict&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;self&lt;/span&gt;):&lt;/span&gt;
        rv = &lt;span class=&quot;hljs-built_in&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;dict&lt;/span&gt;(self.payload &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;or&lt;/span&gt; ())
        rv[&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;message&#39;&lt;/span&gt;] = self.message
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; rv

&lt;span class=&quot;hljs-class&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;BadRequest&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;APIError&lt;/span&gt;):&lt;/span&gt;
    &lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;__init__&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;self, message=&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Bad Request&quot;&lt;/span&gt;, payload=&lt;span class=&quot;hljs-literal&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;None&lt;/span&gt;&lt;/span&gt;):&lt;/span&gt;
        &lt;span class=&quot;hljs-built_in&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;super&lt;/span&gt;().__init__(message, status_code=&lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;400&lt;/span&gt;, payload=payload)

&lt;span class=&quot;hljs-class&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Unauthorized&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;APIError&lt;/span&gt;):&lt;/span&gt;
    &lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;__init__&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;self, message=&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Unauthorized&quot;&lt;/span&gt;, payload=&lt;span class=&quot;hljs-literal&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;None&lt;/span&gt;&lt;/span&gt;):&lt;/span&gt;
        &lt;span class=&quot;hljs-built_in&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;super&lt;/span&gt;().__init__(message, status_code=&lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;401&lt;/span&gt;, payload=payload)

&lt;span class=&quot;hljs-class&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Forbidden&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;APIError&lt;/span&gt;):&lt;/span&gt;
    &lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;__init__&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;self, message=&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Forbidden&quot;&lt;/span&gt;, payload=&lt;span class=&quot;hljs-literal&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;None&lt;/span&gt;&lt;/span&gt;):&lt;/span&gt;
        &lt;span class=&quot;hljs-built_in&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;super&lt;/span&gt;().__init__(message, status_code=&lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;403&lt;/span&gt;, payload=payload)

&lt;span class=&quot;hljs-class&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;NotFound&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;APIError&lt;/span&gt;):&lt;/span&gt;
    &lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;__init__&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;self, message=&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Resource Not Found&quot;&lt;/span&gt;, payload=&lt;span class=&quot;hljs-literal&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;None&lt;/span&gt;&lt;/span&gt;):&lt;/span&gt;
        &lt;span class=&quot;hljs-built_in&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;super&lt;/span&gt;().__init__(message, status_code=&lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;404&lt;/span&gt;, payload=payload)

&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# In a Flask application (example of a global error handler)&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# @&lt;span class=&quot;citation-67&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;app.errorhandler(APIError)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-67&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-67&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# def handle_api_error(error):&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-67&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-67&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;#     response = jsonify(error.to_dict())&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-67&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-67&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;#     response.status_code = error.status_code&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-67&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-67&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;#     return response&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-67 citation-end-67&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;

&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Example usage in an endpoint:&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# @app.route(&#39;/resource/&amp;lt;int:id&amp;gt;&#39;)&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# def get_resource(id):&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;#    if not is_valid_id(id):&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;#        raise BadRequest(&quot;Invalid resource ID format.&quot;)&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;#    resource = db.get_resource(id)&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;#    if not resource:&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;#        raise NotFound(f&quot;Resource with ID {id} does not exist.&quot;)&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;#    if not current_user.can_access(resource):&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;#        raise Forbidden(&quot;You do not have permission to access this resource.&quot;)&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;#    return jsonify(resource.to_dict())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;335:1-377:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;335:5-335:33&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Generators and Iterators:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;336:5-377:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;336:5-336:194&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; What are Python generators, and when might you use them in an API (e.g., for streaming large datasets, or processing data efficiently without loading everything into memory)?&lt;/li&gt;&lt;li data-sourcepos=&quot;337:5-377:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;338:9-377:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;338:9-338:457&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;338:11-338:457&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Generators:&lt;/strong&gt; Functions that contain one or more &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;yield&lt;/code&gt; statements. When called, they return an iterator, but they don&#39;t execute the entire function at once. Instead, they pause execution at each &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;yield&lt;/code&gt; statement, return a value, and resume from where they left off the next time &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;next()&lt;/code&gt; is called on the iterator. They are memory-efficient because they produce values on demand (&quot;lazy evaluation&quot;) rather than building a full list in memory.&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;339:9-342:151&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;339:11-339:24&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;API Usage:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;340:13-342:151&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;340:13-340:342&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Streaming Large Datasets:&lt;/strong&gt; When an API needs to return a very large amount of data (e.g., millions of log entries, financial transactions), loading it all into memory first can cause out-of-memory errors and high latency. A generator can yield data chunks, allowing the API to stream the response to the client incrementally.&lt;/li&gt;&lt;li data-sourcepos=&quot;341:13-341:219&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Efficient Data Processing:&lt;/strong&gt; If you&#39;re processing data within an API before sending it back (e.g., filtering, transforming), and the intermediate data is large, generators can prevent memory bottlenecks.&lt;/li&gt;&lt;li data-sourcepos=&quot;342:13-342:151&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Reading Large Files:&lt;/strong&gt; If an API reads large files (CSV, JSONL) from disk to serve, generators can read line by line or chunk by chunk.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;343:9-377:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;343:11-343:51&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Example (Streaming a large CSV file):&lt;/strong&gt;&lt;/p&gt;
&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block ng-tns-c564991203-57 ng-trigger ng-trigger-codeBlockRevealAnimation&quot; style=&quot;display: block; font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c564991203-57 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-57&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Python&lt;/span&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;buttons ng-tns-c564991203-57 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;button _ngcontent-ng-c564991203=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c564991203-57 mat-unthemed ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-focus-indicator&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c564991203-57&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;animated-opacity ng-tns-c564991203-57&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;pre _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-57&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-container formatted ng-tns-c564991203-57&quot; data-sourcepos=&quot;345:13-376:31&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt; flask &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt; Flask, Response, stream_with_context
&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt; csv
&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt; io

app = Flask(__name__)

&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Simulate a large dataset&lt;/span&gt;
&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;generate_large_data&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;num_records=&lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;100000&lt;/span&gt;&lt;/span&gt;):&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;for&lt;/span&gt; i &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;hljs-built_in&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;range&lt;/span&gt;(num_records):
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;yield&lt;/span&gt; {&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;id&quot;&lt;/span&gt;: i, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;name&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;User &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{i}&lt;/span&gt;&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;email&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;user&lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{i}&lt;/span&gt;@example.com&quot;&lt;/span&gt;}

&lt;span class=&quot;hljs-meta&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;@app.route(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;/stream_users_csv&#39;&lt;/span&gt;&lt;/span&gt;)&lt;/span&gt;
&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;stream_users_csv&lt;/span&gt;():&lt;/span&gt;
    &lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;generate&lt;/span&gt;():&lt;/span&gt;
        data = io.StringIO()
        writer = csv.writer(data)
        writer.writerow([&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;id&#39;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;name&#39;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;email&#39;&lt;/span&gt;]) &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Header row&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;yield&lt;/span&gt; data.getvalue()
        data.seek(&lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;0&lt;/span&gt;)
        data.truncate(&lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;0&lt;/span&gt;)

        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;for&lt;/span&gt; user &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;in&lt;/span&gt; generate_large_data(num_records=&lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;100000&lt;/span&gt;):
            writer.writerow([user[&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;id&#39;&lt;/span&gt;], user[&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;name&#39;&lt;/span&gt;], user[&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;email&#39;&lt;/span&gt;]])
            &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-66&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;yield&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-66&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; data.getvalue()
            data.seek(&lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-66&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-66&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;)
            data.truncate(&lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-66&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-66&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;)

    &lt;/span&gt;&lt;span class=&quot;citation-65 citation-66&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;response = Response(stream_with_context(generate()), mimetype=&lt;/span&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-65 citation-66&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;text/csv&#39;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-65 citation-66&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;)
    response.headers[&lt;/span&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-65 citation-66&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Content-Disposition&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-65 citation-66 citation-end-66&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;citation-65&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-65&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;attachment; filename=users.csv&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-65 citation-end-65&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; response
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;378:1-449:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;378:5-378:49&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Concurrency and Asynchronous Programming:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;379:5-449:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;379:5-379:193&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;379:7-379:193&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; Explain the Global Interpreter Lock (GIL) in Python and its implications for multi-threaded API applications. How do frameworks like &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;asyncio&lt;/code&gt; help overcome this limitation?&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;380:5-393:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;380:7-380:17&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;381:9-393:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;381:9-381:344&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Global Interpreter Lock (GIL):&lt;/strong&gt; The GIL &lt;span class=&quot;citation-64&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;is a mutex (mutual exclusion lock) &lt;/span&gt;&lt;span class=&quot;citation-63 citation-64 citation-end-64&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;that protects access to Python objects, preventing multiple native threads from executing Python bytecodes&lt;sup _ngcontent-ng-c4096754574=&quot;&quot; class=&quot;superscript&quot; data-turn-source-index=&quot;6&quot; style=&quot;background-color: transparent !important; font-family: Google Sans Text, sans-serif !important; font-size: 16px !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;6&lt;/sup&gt;&lt;/span&gt;&lt;span class=&quot;citation-63 citation-end-63&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; at once. This means that even&lt;sup _ngcontent-ng-c4096754574=&quot;&quot; class=&quot;superscript&quot; data-turn-source-index=&quot;7&quot; style=&quot;background-color: transparent !important; font-family: Google Sans Text, sans-serif !important; font-size: 16px !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;7&lt;/sup&gt;&lt;/span&gt; on a multi-core processor, only one thread can execute Python bytecode at any given time.&lt;/li&gt;&lt;li data-sourcepos=&quot;382:9-384:368&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Implications for Multi-threaded API Applications:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;383:13-384:368&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;383:13-383:350&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;CPU-bound tasks:&lt;/strong&gt; For tasks that are heavily CPU-bound (e.g., complex calculations, heavy data processing), multi-threading in Python doesn&#39;t lead to true parallel execution because of the GIL. A multi-threaded API performing CPU-bound work might actually be slower than a single-threaded one due to the overhead of thread switching.&lt;/li&gt;&lt;li data-sourcepos=&quot;384:13-384:368&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;I/O-bound tasks:&lt;/strong&gt; The GIL is released when a thread is performing an I/O operation (e.g., network requests, file I/O, database queries). This means that for I/O-bound API tasks, multi-threading &lt;em style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;can&lt;/em&gt; offer concurrency because while one thread is waiting for an I/O operation to complete, another thread can acquire the GIL and execute Python bytecode.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;385:9-393:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;How &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;asyncio&lt;/code&gt; Helps:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;386:13-393:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;386:13-386:185&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;asyncio&lt;/code&gt; is Python&#39;s library for writing concurrent code using the &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;async/await&lt;/code&gt; syntax. It&#39;s built on a &lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;single-threaded, cooperative multitasking model&lt;/strong&gt; (event loop).&lt;/li&gt;&lt;li data-sourcepos=&quot;387:13-387:264&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Instead of threads, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;asyncio&lt;/code&gt; uses &lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;coroutines&lt;/strong&gt;. When a coroutine encounters an &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;await&lt;/code&gt;able operation (like an I/O request, e.g., fetching data from another API, waiting for a database query), it &lt;em style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;voluntarily&lt;/em&gt; yields control back to the event loop.&lt;/li&gt;&lt;li data-sourcepos=&quot;388:13-388:182&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;The event loop then switches to another ready coroutine, allowing it to run. This happens without releasing the GIL because the core execution is still single-threaded.&lt;/li&gt;&lt;li data-sourcepos=&quot;389:13-389:151&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;This model is highly efficient for &lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;I/O-bound concurrency&lt;/strong&gt; because there&#39;s no thread switching overhead, and no contention for the GIL.&lt;/li&gt;&lt;li data-sourcepos=&quot;390:13-393:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Analogy:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;391:17-393:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;391:17-391:289&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Threads (with GIL):&lt;/strong&gt; Imagine a kitchen with one chef (CPU core) and multiple assistants (threads). Only one assistant can cook at a time because they all need to use the single stove (GIL). If one assistant needs to wait for water to boil, the stove is still occupied.&lt;/li&gt;&lt;li data-sourcepos=&quot;392:17-393:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;asyncio&lt;/code&gt;:&lt;/strong&gt; One very efficient chef (event loop) who knows how to multitask. When the chef puts water on to boil, they immediately start chopping vegetables or preparing another dish instead of just waiting. When the water boils, they come back to it.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;394:5-394:154&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;394:7-394:154&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; When would you use &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;async/await&lt;/code&gt; in a Python API, and what are the benefits? Provide a simple example of an asynchronous API endpoint.&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;395:5-449:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;395:7-395:17&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;396:9-449:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;396:9-399:212&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;396:11-396:50&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;When to Use &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;async/await&lt;/code&gt; in an API:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;397:13-399:212&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;397:13-397:300&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;I/O-Bound Operations:&lt;/strong&gt; This is the primary use case. If your API frequently makes calls to external services (other APIs, microservices), performs database queries, reads/writes files, or deals with network sockets, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;async/await&lt;/code&gt; can significantly improve performance and throughput.&lt;/li&gt;&lt;li data-sourcepos=&quot;398:13-398:136&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Long-Polling/WebSockets:&lt;/strong&gt; For real-time communication patterns where connections need to stay open and wait for events.&lt;/li&gt;&lt;li data-sourcepos=&quot;399:13-399:212&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;High Concurrency Requirements:&lt;/strong&gt; When you expect a large number of concurrent requests, and each request involves I/O waiting, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;asyncio&lt;/code&gt; allows the server to handle many requests without blocking.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;400:9-404:121&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;400:11-400:23&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Benefits:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;401:13-404:121&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;401:13-401:162&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Increased Throughput:&lt;/strong&gt; An asynchronous API can handle many more concurrent requests than a synchronous one, especially under I/O-bound workloads.&lt;/li&gt;&lt;li data-sourcepos=&quot;402:13-402:122&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Better Resource Utilization:&lt;/strong&gt; The server isn&#39;t wasting CPU cycles waiting for I/O operations to complete.&lt;/li&gt;&lt;li data-sourcepos=&quot;403:13-403:74&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Scalability:&lt;/strong&gt; Easier to scale for I/O-heavy applications.&lt;/li&gt;&lt;li data-sourcepos=&quot;404:13-404:121&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Non-Blocking:&lt;/strong&gt; API calls won&#39;t block the entire server process while waiting for slow external services.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;405:9-449:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;405:11-405:38&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Example (using FastAPI):&lt;/strong&gt;&lt;/p&gt;
&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block ng-tns-c564991203-58 ng-trigger ng-trigger-codeBlockRevealAnimation&quot; style=&quot;display: block; font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c564991203-58 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-58&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Python&lt;/span&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;buttons ng-tns-c564991203-58 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;button _ngcontent-ng-c564991203=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c564991203-58 mat-unthemed ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-focus-indicator&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c564991203-58&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;animated-opacity ng-tns-c564991203-58&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;pre _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-58&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-container formatted ng-tns-c564991203-58&quot; data-sourcepos=&quot;407:13-448:80&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt; fastapi &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt; FastAPI
&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt; httpx &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# An async HTTP client&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt; asyncio &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# For sleep (simulating slow I/O)&lt;/span&gt;

app = FastAPI()

&lt;span class=&quot;hljs-meta&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;@app.get(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;/&quot;&lt;/span&gt;&lt;/span&gt;)&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;read_root&lt;/span&gt;():&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; {&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;message&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Hello World&quot;&lt;/span&gt;}

&lt;span class=&quot;hljs-meta&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;@app.get(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;/sync_sleep&quot;&lt;/span&gt;&lt;/span&gt;)&lt;/span&gt;
&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;sync_sleep&lt;/span&gt;():&lt;/span&gt;
    &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# This will block the entire server process for 5 seconds&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt; time
    time.sleep(&lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;5&lt;/span&gt;)
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; {&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;message&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Slept synchronously for 5 seconds&quot;&lt;/span&gt;}

&lt;span class=&quot;hljs-meta&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;@app.get(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;/async_sleep&quot;&lt;/span&gt;&lt;/span&gt;)&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;async_sleep&lt;/span&gt;():&lt;/span&gt;
    &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# This will yield control back to the event loop,&lt;/span&gt;
    &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# allowing other requests to be processed concurrently.&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;await&lt;/span&gt; asyncio.sleep(&lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;5&lt;/span&gt;)
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; {&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;message&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Slept asynchronously for 5 seconds&quot;&lt;/span&gt;}

&lt;span class=&quot;hljs-meta&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;@app.get(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;/fetch_external_data&quot;&lt;/span&gt;&lt;/span&gt;)&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;fetch_external_data&lt;/span&gt;():&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;with&lt;/span&gt; httpx.AsyncClient() &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;as&lt;/span&gt; client:
        &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Simulate fetching data from a slow external API&lt;/span&gt;
        response = &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;await&lt;/span&gt; client.get(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;https://jsonplaceholder.typicode.com/todos/1&quot;&lt;/span&gt;)
        &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Another slow operation&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;await&lt;/span&gt; asyncio.sleep(&lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;2&lt;/span&gt;)
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; response.json()

&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# To run this:&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# 1. pip install fastapi uvicorn httpx&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# 2. Save as main.py&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# 3. Run: uvicorn main:app --reload&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Test by opening multiple tabs for /sync_sleep vs /async_sleep&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# You&#39;ll notice /sync_sleep blocks, /async_sleep allows concurrency.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ol&gt;&lt;hr data-sourcepos=&quot;450:1-450:3&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot; /&gt;&lt;h2 data-sourcepos=&quot;452:1-452:27&quot; style=&quot;font-family: Google Sans, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;II. RESTful API Concepts&lt;/h2&gt;&lt;p data-sourcepos=&quot;454:1-454:76&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;These questions focus on the architectural style commonly used for web APIs.&lt;/p&gt;&lt;ol data-sourcepos=&quot;456:1-866:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;456:1-481:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;456:5-456:24&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;REST Principles:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;457:5-481:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;457:5-457:165&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;457:7-457:165&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; What are the core principles of REST (Representational State Transfer)? Explain statelessness, client-server architecture, and uniform interface.&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;458:5-471:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;458:7-458:17&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;459:9-471:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;459:9-459:255&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;REST (Representational State Transfer):&lt;/strong&gt; An architectural style for designing networked applications. It&#39;s not a protocol, but a set of constraints that, when adhered to, create a web service that is stateless, scalable, and easy to maintain.&lt;/li&gt;&lt;li data-sourcepos=&quot;460:9-471:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Core Principles (often summarized by the acronym &quot;ROY FIELDING&quot;):&lt;/strong&gt;
&lt;ol data-sourcepos=&quot;461:13-471:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;461:13-461:287&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Client-Server:&lt;/strong&gt; The client and server are separate and independent. The client is responsible for the user interface and user state, while the server is responsible for data storage and management. This separation allows for independent evolution of client and server.&lt;/li&gt;&lt;li data-sourcepos=&quot;462:13-462:258&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-62&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Stateless:&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;citation-62 citation-end-62&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; Each request from client to server must contain all the information necessary to understand the request. The server&lt;sup _ngcontent-ng-c4096754574=&quot;&quot; class=&quot;superscript&quot; data-turn-source-index=&quot;8&quot; style=&quot;background-color: transparent !important; font-family: Google Sans Text, sans-serif !important; font-size: 16px !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;8&lt;/sup&gt;&lt;/span&gt; should not store any client context between requests. This improves scalability and reliability.&lt;/li&gt;&lt;li data-sourcepos=&quot;463:13-463:240&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Cacheable:&lt;/strong&gt; Responses from the server should explicitly or implicitly &lt;span class=&quot;citation-61 citation-end-61&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;define themselves as cacheable or non-cacheable. This allows clients to cache responses, improving performance and reducing server&lt;sup _ngcontent-ng-c4096754574=&quot;&quot; class=&quot;superscript&quot; data-turn-source-index=&quot;9&quot; style=&quot;background-color: transparent !important; font-family: Google Sans Text, sans-serif !important; font-size: 16px !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;9&lt;/sup&gt;&lt;/span&gt; load.&lt;/li&gt;&lt;li data-sourcepos=&quot;464:13-468:200&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Uniform Interface:&lt;/strong&gt; This is the most crucial constraint. It simplifies the overall system architecture by ensuring a consistent way of interacting with resources. It has four sub-constraints:
&lt;ul data-sourcepos=&quot;465:17-468:200&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;465:17-465:115&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Identification of Resources:&lt;/strong&gt; Resources are identified by URIs (Uniform Resource Identifiers).&lt;/li&gt;&lt;li data-sourcepos=&quot;466:17-466:177&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Manipulation of Resources Through Representations:&lt;/strong&gt; Clients manipulate resources by sending representations of the resource (e.g., JSON, XML) to the server.&lt;/li&gt;&lt;li data-sourcepos=&quot;467:17-467:166&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Self-Descriptive Messages:&lt;/strong&gt; Each message includes enough information to describe how to process the message. (e.g., HTTP methods, content types).&lt;/li&gt;&lt;li data-sourcepos=&quot;468:17-468:200&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Hypermedia as the Engine of Application State (HATEOAS):&lt;/strong&gt; Resources should contain links to related resources, allowing clients to discover available actions and navigate the API.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;469:13-469:237&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-60&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Layered System:&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;citation-60 citation-end-60&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; A client cannot ordinarily tell whether it is connected directly to the end server, or to an intermediary along the&lt;sup _ngcontent-ng-c4096754574=&quot;&quot; class=&quot;superscript&quot; data-turn-source-index=&quot;10&quot; style=&quot;background-color: transparent !important; font-family: Google Sans Text, sans-serif !important; font-size: 16px !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;10&lt;/sup&gt;&lt;/span&gt; way. This allows for scalability, load balancing, and security layers.&lt;/li&gt;&lt;li data-sourcepos=&quot;470:13-471:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Code-On-Demand (Optional):&lt;/strong&gt; &lt;span class=&quot;citation-59 citation-end-59&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Servers can temporarily extend or customize client functionality by transferring executable code (e.g., JavaScript). This is&lt;sup _ngcontent-ng-c4096754574=&quot;&quot; class=&quot;superscript&quot; data-turn-source-index=&quot;11&quot; style=&quot;background-color: transparent !important; font-family: Google Sans Text, sans-serif !important; font-size: 16px !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;11&lt;/sup&gt;&lt;/span&gt; the only optional constraint.&lt;/li&gt;&lt;/ol&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;472:5-472:49&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;472:7-472:49&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; How does REST relate to HTTP?&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;473:5-481:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;473:7-473:235&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt; REST is an architectural style, while HTTP (Hypertext Transfer Protocol) is a protocol. HTTP is the &lt;em style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;most common and suitable protocol&lt;/em&gt; for implementing RESTful APIs because it naturally aligns with REST&#39;s principles:&lt;/p&gt;
&lt;ul data-sourcepos=&quot;474:9-481:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;474:9-474:89&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Client-Server:&lt;/strong&gt; HTTP inherently defines a client-server communication model.&lt;/li&gt;&lt;li data-sourcepos=&quot;475:9-475:87&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Statelessness:&lt;/strong&gt; HTTP is a stateless protocol; each request is independent.&lt;/li&gt;&lt;li data-sourcepos=&quot;476:9-476:168&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Methods:&lt;/strong&gt; HTTP verbs (GET, POST, PUT, DELETE, PATCH) map directly to CRUD (Create, Read, Update, Delete) operations on resources, which is central to REST.&lt;/li&gt;&lt;li data-sourcepos=&quot;477:9-477:57&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;URIs:&lt;/strong&gt; HTTP uses URIs to identify resources.&lt;/li&gt;&lt;li data-sourcepos=&quot;478:9-478:150&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Headers:&lt;/strong&gt; HTTP headers (&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Content-Type&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Accept&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Authorization&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Cache-Control&lt;/code&gt;) provide the self-descriptive nature required by REST.&lt;/li&gt;&lt;li data-sourcepos=&quot;479:9-481:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Status Codes:&lt;/strong&gt; HTTP status codes (&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;200 OK&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;404 Not Found&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;500 Internal Server Error&lt;/code&gt;) provide standardized ways to communicate the result of a request.
In essence, HTTP provides the foundational mechanisms that make building RESTful APIs practical and efficient.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;482:1-523:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;482:5-482:29&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;HTTP Methods (Verbs):&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;483:5-523:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;483:5-483:129&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;483:7-483:129&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; Explain the common HTTP methods (GET, POST, PUT, PATCH, DELETE) and their typical use cases in a RESTful API.&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;484:5-505:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;484:7-484:17&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;485:9-505:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;485:9-488:63&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;GET&lt;/code&gt;&lt;/strong&gt;: &lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;READ&lt;/strong&gt; data.
&lt;ul data-sourcepos=&quot;486:13-488:63&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;486:13-486:77&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Use Case:&lt;/strong&gt; Retrieve a resource or a collection of resources.&lt;/li&gt;&lt;li data-sourcepos=&quot;487:13-487:84&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Characteristics:&lt;/strong&gt; Idempotent, safe (no side effects on the server).&lt;/li&gt;&lt;li data-sourcepos=&quot;488:13-488:63&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Example:&lt;/strong&gt; &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;GET /products&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;GET /products/123&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;489:9-492:107&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;POST&lt;/code&gt;&lt;/strong&gt;: &lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;CREATE&lt;/strong&gt; a new resource.
&lt;ul data-sourcepos=&quot;490:13-492:107&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;490:13-490:131&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Use Case:&lt;/strong&gt; Submit data to be processed to a specified resource, often resulting in the creation of a new resource.&lt;/li&gt;&lt;li data-sourcepos=&quot;491:13-491:97&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Characteristics:&lt;/strong&gt; Not idempotent (repeated requests create duplicate resources).&lt;/li&gt;&lt;li data-sourcepos=&quot;492:13-492:107&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Example:&lt;/strong&gt; &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;POST /products&lt;/code&gt; (with product data in the request body to create a new product)&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;493:9-496:87&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;PUT&lt;/code&gt;&lt;/strong&gt;: &lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;UPDATE/REPLACE&lt;/strong&gt; an existing resource or &lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;CREATE&lt;/strong&gt; if it doesn&#39;t exist.
&lt;ul data-sourcepos=&quot;494:13-496:87&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;494:13-494:171&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Use Case:&lt;/strong&gt; Replaces the entire resource at the specified URI with the data provided in the request body. If the resource does not exist, it may create it.&lt;/li&gt;&lt;li data-sourcepos=&quot;495:13-495:131&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Characteristics:&lt;/strong&gt; Idempotent (sending the same PUT request multiple times has the same effect as sending it once).&lt;/li&gt;&lt;li data-sourcepos=&quot;496:13-496:87&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Example:&lt;/strong&gt; &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;PUT /products/123&lt;/code&gt; (with the complete updated product data)&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;497:9-500:86&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;PATCH&lt;/code&gt;&lt;/strong&gt;: &lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;PARTIAL UPDATE&lt;/strong&gt; an existing resource.
&lt;ul data-sourcepos=&quot;498:13-500:86&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;498:13-498:128&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Use Case:&lt;/strong&gt; Apply partial modifications to a resource. Only the fields provided in the request body are updated.&lt;/li&gt;&lt;li data-sourcepos=&quot;499:13-499:166&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Characteristics:&lt;/strong&gt; Not necessarily idempotent (depends on the patch logic, but generally not if it&#39;s based on relative changes like &quot;increment by X&quot;).&lt;/li&gt;&lt;li data-sourcepos=&quot;500:13-500:86&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Example:&lt;/strong&gt; &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;PATCH /products/123&lt;/code&gt; (with only the &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;price&lt;/code&gt; field updated)&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;501:9-505:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;DELETE&lt;/code&gt;&lt;/strong&gt;: &lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;DELETE&lt;/strong&gt; a resource.
&lt;ul data-sourcepos=&quot;502:13-505:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;502:13-502:70&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Use Case:&lt;/strong&gt; Remove the resource identified by the URI.&lt;/li&gt;&lt;li data-sourcepos=&quot;503:13-503:112&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Characteristics:&lt;/strong&gt; Idempotent (deleting something that&#39;s already deleted has no further effect).&lt;/li&gt;&lt;li data-sourcepos=&quot;504:13-505:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Example:&lt;/strong&gt; &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;DELETE /products/123&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;506:5-506:113&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;506:7-506:113&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; What is idempotency, and which HTTP methods are considered idempotent? Why is this important?&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;507:5-523:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;507:7-507:17&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;508:9-523:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;508:9-508:299&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Idempotency:&lt;/strong&gt; An operation is idempotent if executing it multiple times produces the same result as executing it once. In the context of APIs, it means that making the same request multiple times will not cause additional side effects on the server after the first successful execution.&lt;/li&gt;&lt;li data-sourcepos=&quot;509:9-514:23&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Idempotent HTTP Methods:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;510:13-514:23&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;510:13-510:19&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;GET&lt;/code&gt;&lt;/li&gt;&lt;li data-sourcepos=&quot;511:13-511:19&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;PUT&lt;/code&gt;&lt;/li&gt;&lt;li data-sourcepos=&quot;512:13-512:22&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;DELETE&lt;/code&gt;&lt;/li&gt;&lt;li data-sourcepos=&quot;513:13-513:20&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;HEAD&lt;/code&gt;&lt;/li&gt;&lt;li data-sourcepos=&quot;514:13-514:23&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;OPTIONS&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;515:9-517:106&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Non-Idempotent HTTP Methods:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;516:13-517:106&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;516:13-516:105&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;POST&lt;/code&gt; (sending the same POST request multiple times typically creates multiple resources).&lt;/li&gt;&lt;li data-sourcepos=&quot;517:13-517:106&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;PATCH&lt;/code&gt; (can be non-idempotent if the operation is relative, e.g., &quot;add 5 to the quantity&quot;).&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;518:9-523:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Importance:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;519:13-523:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;519:13-519:279&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Network Reliability:&lt;/strong&gt; If a client sends a request and doesn&#39;t receive a response (due to network timeout, etc.), it can safely retry an idempotent request without worrying about unintended duplicate actions. This is crucial for handling flaky network conditions.&lt;/li&gt;&lt;li data-sourcepos=&quot;520:13-520:72&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;API Robustness:&lt;/strong&gt; Simplifies error recovery for clients.&lt;/li&gt;&lt;li data-sourcepos=&quot;521:13-521:157&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Easier Reasoning:&lt;/strong&gt; It makes it easier to reason about the state of the system, as repeated identical requests won&#39;t unexpectedly alter data.&lt;/li&gt;&lt;li data-sourcepos=&quot;522:13-523:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Caching:&lt;/strong&gt; Idempotent methods (especially GET) are often easier to cache.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;524:1-573:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;524:5-524:27&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Resources and URIs:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;525:5-573:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;525:5-525:103&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;525:7-525:103&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; What is a &quot;resource&quot; in the context of a RESTful API? How are resources identified?&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;526:5-534:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;526:7-526:17&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;527:9-534:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;527:9-527:445&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Resource:&lt;/strong&gt; A resource is any information that can be named, stored, and manipulated. It&#39;s the core concept in REST. Resources can be a single entity (e.g., a specific user, a product), a collection of entities (e.g., all users, all products), a service (e.g., a search function), or even a relationship between entities (e.g., a user&#39;s orders). Resources are conceptual; their representation (e.g., JSON, XML) is what&#39;s transferred.&lt;/li&gt;&lt;li data-sourcepos=&quot;528:9-534:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Identification:&lt;/strong&gt; Resources are identified by &lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;URIs (Uniform Resource Identifiers)&lt;/strong&gt;. The URI uniquely points to a resource on the server.
&lt;ul data-sourcepos=&quot;529:13-534:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;529:13-534:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Examples:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;530:17-534:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;530:17-530:48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;/users&lt;/code&gt; (collection of users)&lt;/li&gt;&lt;li data-sourcepos=&quot;531:17-531:60&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;/users/123&lt;/code&gt; (a specific user with ID 123)&lt;/li&gt;&lt;li data-sourcepos=&quot;532:17-532:71&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;/products/electronics/laptops&lt;/code&gt; (a nested collection)&lt;/li&gt;&lt;li data-sourcepos=&quot;533:17-534:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;/orders/456/items&lt;/code&gt; (a sub-collection related to an order)&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;535:5-535:107&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;535:7-535:107&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; Design a URI structure for a simple e-commerce API (e.g., for products, orders, users).&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;536:5-573:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;536:7-536:17&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;537:9-573:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;537:9-542:60&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;537:11-537:33&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;General Principles:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;538:13-542:60&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;538:13-538:38&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Use nouns for resources.&lt;/li&gt;&lt;li data-sourcepos=&quot;539:13-539:76&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Use plural nouns for collections, singular for specific items.&lt;/li&gt;&lt;li data-sourcepos=&quot;540:13-540:59&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Use hierarchical paths to show relationships.&lt;/li&gt;&lt;li data-sourcepos=&quot;541:13-541:63&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Avoid verbs in URIs (verbs are for HTTP methods).&lt;/li&gt;&lt;li data-sourcepos=&quot;542:13-542:60&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Use kebab-case (&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;-&lt;/code&gt;) for readability in paths.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;543:9-573:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;543:11-543:32&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Example Structure:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;545:13-573:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;545:13-552:110&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Products:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;546:17-552:110&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;546:17-546:66&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;GET /products&lt;/code&gt;: Get all products (or paginate).&lt;/li&gt;&lt;li data-sourcepos=&quot;547:17-547:57&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;POST /products&lt;/code&gt;: Create a new product.&lt;/li&gt;&lt;li data-sourcepos=&quot;548:17-548:71&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;GET /products/{product_id}&lt;/code&gt;: Get a specific product.&lt;/li&gt;&lt;li data-sourcepos=&quot;549:17-549:93&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;PUT /products/{product_id}&lt;/code&gt;: Update a specific product (full replacement).&lt;/li&gt;&lt;li data-sourcepos=&quot;550:17-550:86&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;PATCH /products/{product_id}&lt;/code&gt;: Partially update a specific product.&lt;/li&gt;&lt;li data-sourcepos=&quot;551:17-551:77&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;DELETE /products/{product_id}&lt;/code&gt;: Delete a specific product.&lt;/li&gt;&lt;li data-sourcepos=&quot;552:17-552:110&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;GET /products?category=electronics&amp;amp;min_price=100&lt;/code&gt;: Filter products by query parameters.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;553:13-558:76&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Users:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;554:17-558:76&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;554:17-554:46&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;GET /users&lt;/code&gt;: Get all users.&lt;/li&gt;&lt;li data-sourcepos=&quot;555:17-555:51&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;POST /users&lt;/code&gt;: Create a new user.&lt;/li&gt;&lt;li data-sourcepos=&quot;556:17-556:69&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-58&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;GET /users/{user_id}&lt;/span&gt;&lt;/code&gt;&lt;span class=&quot;citation-58&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;: Get a specific user.&lt;/span&gt;&lt;/li&gt;&lt;span class=&quot;citation-58&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;/span&gt;&lt;li data-sourcepos=&quot;557:17-557:65&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-58&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;PUT /users/{user_id}&lt;/span&gt;&lt;/code&gt;&lt;span class=&quot;citation-58&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;: Update a specific user.&lt;/span&gt;&lt;/li&gt;&lt;span class=&quot;citation-58&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;/span&gt;&lt;li data-sourcepos=&quot;558:17-558:76&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-58&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;DELETE /users/{user_id}&lt;/span&gt;&lt;/code&gt;&lt;span class=&quot;citation-58 citation-end-58&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;: Delete a specific user.&lt;sup _ngcontent-ng-c4096754574=&quot;&quot; class=&quot;superscript&quot; data-turn-source-index=&quot;12&quot; style=&quot;background-color: transparent !important; font-family: Google Sans Text, sans-serif !important; font-size: 16px !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;12&lt;/sup&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;559:13-567:86&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Orders (and nested resources):&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;560:17-567:86&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;560:17-560:48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;GET /orders&lt;/code&gt;: Get all orders.&lt;/li&gt;&lt;li data-sourcepos=&quot;561:17-561:53&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;POST /orders&lt;/code&gt;: Create a new order.&lt;/li&gt;&lt;li data-sourcepos=&quot;562:17-562:65&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;GET /orders/{order_id}&lt;/code&gt;: Get a specific order.&lt;/li&gt;&lt;li data-sourcepos=&quot;563:17-563:68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;PUT /orders/{order_id}&lt;/code&gt;: Update a specific order.&lt;/li&gt;&lt;li data-sourcepos=&quot;564:17-564:71&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;DELETE /orders/{order_id}&lt;/code&gt;: Delete a specific order.&lt;/li&gt;&lt;li data-sourcepos=&quot;565:17-565:81&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;GET /orders/{order_id}/items&lt;/code&gt;: Get items for a specific order.&lt;/li&gt;&lt;li data-sourcepos=&quot;566:17-566:84&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;GET /users/{user_id}/orders&lt;/code&gt;: Get all orders for a specific user.&lt;/li&gt;&lt;li data-sourcepos=&quot;567:17-567:86&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;POST /users/{user_id}/orders&lt;/code&gt;: Create an order for a specific user.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;568:13-573:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Shopping Cart:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;569:17-573:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;569:17-569:68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;GET /cart&lt;/code&gt;: Get the current user&#39;s shopping cart.&lt;/li&gt;&lt;li data-sourcepos=&quot;570:17-570:62&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;POST /cart/items&lt;/code&gt;: Add an item to the cart.&lt;/li&gt;&lt;li data-sourcepos=&quot;571:17-571:91&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;PUT /cart/items/{item_id}&lt;/code&gt;: Update an item in the cart (e.g., quantity).&lt;/li&gt;&lt;li data-sourcepos=&quot;572:17-573:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;DELETE /cart/items/{item_id}&lt;/code&gt;: Remove an item from the cart.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;574:1-599:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;574:5-574:26&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;HTTP Status Codes:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;575:5-599:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;575:5-575:142&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; Explain the purpose of HTTP status codes in API responses. Provide examples of 2xx, 4xx, and 5xx codes and their meanings.&lt;/li&gt;&lt;li data-sourcepos=&quot;576:5-599:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;577:9-599:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;577:9-577:387&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Purpose:&lt;/strong&gt; HTTP status codes are 3-digit integer codes returned by a server in response to an HTTP request. They indicate the outcome of the request, providing a standardized way for clients to understand if their request was successful, if there was an error, and what type of error it was. This allows clients to react appropriately (e.g., retry, display an error message).&lt;/li&gt;&lt;li data-sourcepos=&quot;578:9-599:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Categories:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;579:13-599:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;579:13-579:116&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;1xx Informational&lt;/code&gt;&lt;/strong&gt;: Request received, continuing process. (Less common in typical API responses).&lt;/li&gt;&lt;li data-sourcepos=&quot;580:13-583:200&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;2xx Success&lt;/code&gt;&lt;/strong&gt;: The action was successfully received, understood, and accepted.
&lt;ul data-sourcepos=&quot;581:17-583:200&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;581:17-581:92&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;200 OK&lt;/code&gt;: Standard success response. (e.g., &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;GET&lt;/code&gt; request was successful).&lt;/li&gt;&lt;li data-sourcepos=&quot;582:17-582:150&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;201 Created&lt;/code&gt;: The request has been fulfilled and resulted in a new resource being created. (e.g., &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;POST&lt;/code&gt; request to create a user).&lt;/li&gt;&lt;li data-sourcepos=&quot;583:17-583:200&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;204 No Content&lt;/code&gt;: The server successfully processed the request, but is not returning any content. (e.g., &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;DELETE&lt;/code&gt; request successful, or a &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;PUT&lt;/code&gt; request that only updates metadata).&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;584:13-586:147&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;3xx Redirection&lt;/code&gt;&lt;/strong&gt;: Further action needs to be taken by the user agent to fulfill the request.
&lt;ul data-sourcepos=&quot;585:17-586:147&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;585:17-585:96&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;301 Moved Permanently&lt;/code&gt;: The resource has been permanently moved to a new URI.&lt;/li&gt;&lt;li data-sourcepos=&quot;586:17-586:147&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;304 Not Modified&lt;/code&gt;: Used in caching; indicates that the resource has not been modified since the version specified by the client.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;587:13-594:63&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;4xx Client Error&lt;/code&gt;&lt;/strong&gt;: The request contains bad syntax or cannot be fulfilled.
&lt;ul data-sourcepos=&quot;588:17-594:63&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;588:17-588:97&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;400 Bad Request&lt;/code&gt;: General client error (malformed syntax, invalid parameters).&lt;/li&gt;&lt;li data-sourcepos=&quot;589:17-589:76&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;401 Unauthorized&lt;/code&gt;: Authentication required or has failed.&lt;/li&gt;&lt;li data-sourcepos=&quot;590:17-590:82&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;403 Forbidden&lt;/code&gt;: Authenticated, but lacks necessary permissions.&lt;/li&gt;&lt;li data-sourcepos=&quot;591:17-591:77&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;404 Not Found&lt;/code&gt;: The requested resource could not be found.&lt;/li&gt;&lt;li data-sourcepos=&quot;592:17-592:99&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;405 Method Not Allowed&lt;/code&gt;: The HTTP method used is not supported for the resource.&lt;/li&gt;&lt;li data-sourcepos=&quot;593:17-593:145&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;409 Conflict&lt;/code&gt;: Request conflicts with current state of the resource (e.g., trying to create a user with an existing username).&lt;/li&gt;&lt;li data-sourcepos=&quot;594:17-594:63&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;429 Too Many Requests&lt;/code&gt;: Rate limit exceeded.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;595:13-599:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;5xx Server Error&lt;/code&gt;&lt;/strong&gt;: The server failed to fulfill an apparently valid request.
&lt;ul data-sourcepos=&quot;596:17-599:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;596:17-596:97&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;500 Internal Server Error&lt;/code&gt;: A generic server-side error (unhandled exception).&lt;/li&gt;&lt;li data-sourcepos=&quot;597:17-597:145&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-57&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;502 Bad Gateway&lt;/span&gt;&lt;/code&gt;&lt;span class=&quot;citation-57&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;: The server, while acting as a gateway or proxy, received an invalid response from an upstream server.&lt;/span&gt;&lt;/li&gt;&lt;span class=&quot;citation-57&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;/span&gt;&lt;li data-sourcepos=&quot;598:17-599:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-57&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;citation-56 citation-57&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;503 Service Unavailable&lt;/span&gt;&lt;/code&gt;&lt;span class=&quot;citation-56 citation-57 citation-end-57&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;: The server is&lt;sup _ngcontent-ng-c4096754574=&quot;&quot; class=&quot;superscript&quot; data-turn-source-index=&quot;13&quot; style=&quot;background-color: transparent !important; font-family: Google Sans Text, sans-serif !important; font-size: 16px !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;13&lt;/sup&gt;&lt;/span&gt;&lt;span class=&quot;citation-56 citation-end-56&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; currently unable to handle the request due to temporary overloading or maintenance.&lt;sup _ngcontent-ng-c4096754574=&quot;&quot; class=&quot;superscript&quot; data-turn-source-index=&quot;14&quot; style=&quot;background-color: transparent !important; font-family: Google Sans Text, sans-serif !important; font-size: 16px !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;14&lt;/sup&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;600:1-628:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;600:5-600:16&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Headers:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;601:5-628:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;601:5-601:169&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; What is the role of HTTP headers in API requests and responses? Give examples of important headers (e.g., &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Content-Type&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Accept&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Authorization&lt;/code&gt;).&lt;/li&gt;&lt;li data-sourcepos=&quot;602:5-628:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;603:9-628:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;603:9-603:281&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Role of HTTP Headers:&lt;/strong&gt; HTTP headers are key-value pairs that carry metadata about the request or response. They provide essential information that goes beyond the basic HTTP method and URI, enabling features like content negotiation, authentication, caching, and more.&lt;/li&gt;&lt;li data-sourcepos=&quot;604:9-628:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Examples of Important Headers:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;605:13-628:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;605:13-609:109&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Content-Type&lt;/code&gt; (Request/Response):&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;606:17-609:109&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;606:17-606:178&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Role:&lt;/strong&gt; Indicates the media type of the body of the request or response. This tells the server (for requests) or client (for responses) how to parse the data.&lt;/li&gt;&lt;li data-sourcepos=&quot;607:17-607:106&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Examples:&lt;/strong&gt; &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;application/json&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;application/xml&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;text/html&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;multipart/form-data&lt;/code&gt;.&lt;/li&gt;&lt;li data-sourcepos=&quot;608:17-608:99&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;em style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Request:&lt;/em&gt; &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Content-Type: application/json&lt;/code&gt; (telling the server the body is JSON)&lt;/li&gt;&lt;li data-sourcepos=&quot;609:17-609:109&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;em style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Response:&lt;/em&gt; &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Content-Type: application/json&lt;/code&gt; (telling the client the response body is JSON)&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;610:13-612:107&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Accept&lt;/code&gt; (Request):&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;611:17-612:107&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;611:17-611:144&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Role:&lt;/strong&gt; Specifies the media types that the client is willing to accept in the response. This is part of content negotiation.&lt;/li&gt;&lt;li data-sourcepos=&quot;612:17-612:107&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Examples:&lt;/strong&gt; &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Accept: application/json&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Accept: application/xml&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Accept: */*&lt;/code&gt; (any).&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;613:13-615:161&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Authorization&lt;/code&gt; (Request):&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;614:17-615:161&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;614:17-614:118&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Role:&lt;/strong&gt; Carries authentication credentials (e.g., tokens, API keys) from the client to the server.&lt;/li&gt;&lt;li data-sourcepos=&quot;615:17-615:161&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Examples:&lt;/strong&gt; &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Authorization: Bearer &amp;lt;token&amp;gt;&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Authorization: Basic &amp;lt;base64-encoded-credentials&amp;gt;&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Authorization: ApiKey &amp;lt;api_key&amp;gt;&lt;/code&gt;.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;616:13-618:114&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Cache-Control&lt;/code&gt; (Request/Response):&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;617:17-618:114&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;617:17-617:182&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Role:&lt;/strong&gt; Directs caching mechanisms in both requests and responses. Tells caches how long to store a resource, whether it can be re-used without revalidation, etc.&lt;/li&gt;&lt;li data-sourcepos=&quot;618:17-618:114&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Examples:&lt;/strong&gt; &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Cache-Control: no-cache&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Cache-Control: max-age=3600&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Cache-Control: public&lt;/code&gt;.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;619:13-620:155&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;User-Agent&lt;/code&gt; (Request):&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;620:17-620:155&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;620:17-620:155&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Role:&lt;/strong&gt; Identifies the client software making the request (e.g., browser, custom script). Useful for logging, analytics, and debugging.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;621:13-622:114&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Location&lt;/code&gt; (Response):&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;622:17-622:114&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;622:17-622:114&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Role:&lt;/strong&gt; Used with &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;201 Created&lt;/code&gt; status code to indicate the URI of the newly created resource.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;623:13-624:225&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;ETag&lt;/code&gt; / &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;If-None-Match&lt;/code&gt; (Response / Request):&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;624:17-624:225&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;624:17-624:225&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Role:&lt;/strong&gt; Used for caching and conditional requests. &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;ETag&lt;/code&gt; is a unique identifier for a specific version of a resource. &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;If-None-Match&lt;/code&gt; is sent by the client to check if their cached version is still fresh.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;625:13-628:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Link&lt;/code&gt; (Response):&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;626:17-628:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;626:17-626:135&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Role:&lt;/strong&gt; Provides relations to other resources, crucial for HATEOAS (Hypermedia as the Engine of Application State).&lt;/li&gt;&lt;li data-sourcepos=&quot;627:17-628:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Example:&lt;/strong&gt; &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Link: &amp;lt;http://example.com/api/orders?page=2&amp;gt;; rel=&quot;next&quot;&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;629:1-684:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;629:5-629:41&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Authentication and Authorization:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;630:5-684:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;630:5-630:249&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; What&#39;s the difference between authentication and authorization in an API? Describe common authentication methods for REST APIs (e.g., API keys, OAuth, JWT). How would you implement a simple API key authentication in a Python API?&lt;/li&gt;&lt;li data-sourcepos=&quot;631:5-684:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;632:9-684:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;632:9-633:113&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;632:11-632:129&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Authentication:&lt;/strong&gt; The process of &lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;verifying who a user is&lt;/strong&gt;. It answers the question: &quot;Are you who you say you are?&quot;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;633:13-633:113&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;633:13-633:113&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;em style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Example:&lt;/em&gt; Logging in with a username and password, providing an API key, presenting a valid token.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;634:9-635:161&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;634:11-634:159&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Authorization:&lt;/strong&gt; The process of &lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;determining what an authenticated user is allowed to do&lt;/strong&gt;. It answers the question: &quot;Are you allowed to do that?&quot;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;635:13-635:161&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;635:13-635:161&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;em style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Example:&lt;/em&gt; An admin user can delete resources, while a regular user can only view them. A user can only access their own profile data, not others&#39;.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;636:9-650:263&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;636:11-636:44&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Common Authentication Methods:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;637:13-650:263&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;637:13-640:133&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;API Keys:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;638:17-640:133&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;638:17-638:224&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;How it works:&lt;/strong&gt; A secret string (the API key) is generated and provided to the client. The client sends this key with each request, typically in a custom HTTP header (&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;X-API-Key&lt;/code&gt;) or as a query parameter.&lt;/li&gt;&lt;li data-sourcepos=&quot;639:17-639:64&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Pros:&lt;/strong&gt; Simple to implement, easy to revoke.&lt;/li&gt;&lt;li data-sourcepos=&quot;640:17-640:133&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Cons:&lt;/strong&gt; Less secure if exposed (no expiration, often hardcoded), can be vulnerable if sent over unencrypted HTTP.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;641:13-644:68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;OAuth 2.0:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;642:17-644:68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;642:17-642:345&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;How it works:&lt;/strong&gt; A complex protocol primarily used for delegated authorization. It allows a third-party application to access a user&#39;s resources on another service (e.g., &quot;Login with Google&quot;). Involves various &quot;flows&quot; (e.g., authorization code flow). Clients typically receive an &quot;access token&quot; after a user grants permission.&lt;/li&gt;&lt;li data-sourcepos=&quot;643:17-643:97&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Pros:&lt;/strong&gt; Secure delegation, widely adopted, suitable for single sign-on (SSO).&lt;/li&gt;&lt;li data-sourcepos=&quot;644:17-644:68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Cons:&lt;/strong&gt; More complex to implement than API keys.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;645:13-648:175&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;JSON Web Tokens (JWT):&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;646:17-648:175&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;646:17-646:376&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;How it works:&lt;/strong&gt; After a user authenticates (e.g., with username/password), the server issues a digitally signed token (JWT). This token contains claims (e.g., user ID, roles, expiration time) and is sent by the client in the &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Authorization: Bearer &amp;lt;token&amp;gt;&lt;/code&gt; header with subsequent requests. The server verifies the signature to trust the token&#39;s content.&lt;/li&gt;&lt;li data-sourcepos=&quot;647:17-647:144&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Pros:&lt;/strong&gt; Stateless (server doesn&#39;t need to store session info), scalable, can contain arbitrary claims, signed for integrity.&lt;/li&gt;&lt;li data-sourcepos=&quot;648:17-648:175&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Cons:&lt;/strong&gt; Tokens cannot be revoked easily (unless a blocklist is implemented), tokens can be exposed if not handled securely (e.g., stored in local storage).&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;649:13-649:148&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Basic Authentication:&lt;/strong&gt; Sends username and password Base64 encoded in the &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Authorization&lt;/code&gt; header. Simple but insecure without HTTPS.&lt;/li&gt;&lt;li data-sourcepos=&quot;650:13-650:263&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Session-based Authentication:&lt;/strong&gt; Server creates a session for an authenticated user and sends a session ID (cookie) to the client. Client sends cookie with each request. Server looks up session data based on ID. State &lt;em style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;is&lt;/em&gt; maintained on the server.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;651:9-684:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;651:11-651:70&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Simple API Key Authentication in Python (Flask Example):&lt;/strong&gt;&lt;/p&gt;
&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block ng-tns-c564991203-59 ng-trigger ng-trigger-codeBlockRevealAnimation&quot; style=&quot;display: block; font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c564991203-59 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-59&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Python&lt;/span&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;buttons ng-tns-c564991203-59 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;button _ngcontent-ng-c564991203=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c564991203-59 mat-unthemed ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-focus-indicator&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c564991203-59&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;animated-opacity ng-tns-c564991203-59&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;pre _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-59&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-container formatted ng-tns-c564991203-59&quot; data-sourcepos=&quot;653:13-683:60&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt; flask &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt; Flask, request, jsonify

app = Flask(__name__)

&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# In a real app, this would be stored securely (e.g., database, environment variable)&lt;/span&gt;
VALID_API_KEYS = {
    &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;your_secret_api_key_123&quot;&lt;/span&gt;,
    &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;another_client_key_abc&quot;&lt;/span&gt;
}

&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;require_api_key&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&lt;/span&gt;):&lt;/span&gt;
&lt;span class=&quot;hljs-meta&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;    @app.route.wraps(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&lt;/span&gt;) &lt;/span&gt;&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Important for preserving function metadata&lt;/span&gt;
    &lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;decorated_function&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;*args, **kwargs&lt;/span&gt;):&lt;/span&gt;
        api_key = request.headers.get(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;X-API-Key&#39;&lt;/span&gt;)
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;not&lt;/span&gt; api_key &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;or&lt;/span&gt; api_key &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;in&lt;/span&gt; VALID_API_KEYS:
            &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; jsonify({&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;message&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Forbidden: Invalid or missing API Key&quot;&lt;/span&gt;}), &lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;403&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; f(*args, **kwargs)
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; decorated_function

&lt;span class=&quot;hljs-meta&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;@app.route(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;/data&#39;&lt;/span&gt;&lt;/span&gt;)&lt;/span&gt;
&lt;span class=&quot;hljs-meta&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;@require_api_key&lt;/span&gt;
&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;get_protected_data&lt;/span&gt;():&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; jsonify({&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;message&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Access granted! This is protected data.&quot;&lt;/span&gt;})

&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# To run:&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# app.run(debug=True)&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Test with:&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# curl -H &quot;X-API-Key: your_secret_api_key_123&quot; http://127.0.0.1:5000/data&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# curl http://127.0.0.1:5000/data (will get 403)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;685:1-714:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;685:5-685:19&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Versioning:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;686:5-714:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;686:5-686:144&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; Why is API versioning important? Describe different strategies for API versioning (e.g., URI versioning, header versioning).&lt;/li&gt;&lt;li data-sourcepos=&quot;687:5-714:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;688:9-714:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;688:9-692:118&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Why Important:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;689:13-692:118&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;689:13-689:120&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Backward Compatibility:&lt;/strong&gt; Allows developers to make changes to an API without breaking existing clients.&lt;/li&gt;&lt;li data-sourcepos=&quot;690:13-690:147&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Simultaneous Evolution:&lt;/strong&gt; Enables new features and improvements to be rolled out without forcing all clients to update immediately.&lt;/li&gt;&lt;li data-sourcepos=&quot;691:13-691:153&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Graceful Deprecation:&lt;/strong&gt; Provides a pathway for clients to migrate to newer versions, giving ample time before older versions are retired.&lt;/li&gt;&lt;li data-sourcepos=&quot;692:13-692:118&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Client Stability:&lt;/strong&gt; Ensures existing client applications continue to function even as the API evolves.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;693:9-714:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Strategies:&lt;/strong&gt;
&lt;ol data-sourcepos=&quot;694:13-714:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;694:13-698:172&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;URI Versioning (Path Versioning):&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;695:17-698:172&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;695:17-695:88&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;How it works:&lt;/strong&gt; Include the version number directly in the API path.&lt;/li&gt;&lt;li data-sourcepos=&quot;696:17-696:63&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Examples:&lt;/strong&gt; &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;/v1/products&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;/api/v2/users&lt;/code&gt;&lt;/li&gt;&lt;li data-sourcepos=&quot;697:17-697:148&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Pros:&lt;/strong&gt; Very clear and explicit. Easy for clients to see and understand the version. Browsable (can just change URL in browser).&lt;/li&gt;&lt;li data-sourcepos=&quot;698:17-698:172&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Cons:&lt;/strong&gt; Pollutes the URI, requires changes to routing logic for every version. Not strictly RESTful (URI should identify the resource, not its version).&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;699:13-703:112&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Header Versioning:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;700:17-703:112&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;700:17-700:97&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;How it works:&lt;/strong&gt; The API version is specified in a custom HTTP request header.&lt;/li&gt;&lt;li data-sourcepos=&quot;701:17-701:120&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Examples:&lt;/strong&gt; &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;X-API-Version: 1&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Accept: application/vnd.myapi.v2+json&lt;/code&gt; (using a custom media type).&lt;/li&gt;&lt;li data-sourcepos=&quot;702:17-702:143&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Pros:&lt;/strong&gt; Keeps URIs clean. More flexible for content negotiation (can have different representations for the same resource).&lt;/li&gt;&lt;li data-sourcepos=&quot;703:17-703:112&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Cons:&lt;/strong&gt; Less discoverable for casual Browse. Requires clients to explicitly send the header.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;704:13-708:175&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Query Parameter Versioning:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;705:17-708:175&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;705:17-705:86&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;How it works:&lt;/strong&gt; The version number is passed as a query parameter.&lt;/li&gt;&lt;li data-sourcepos=&quot;706:17-706:77&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Examples:&lt;/strong&gt; &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;/products?version=1&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;/users?api_version=2&lt;/code&gt;&lt;/li&gt;&lt;li data-sourcepos=&quot;707:17-707:75&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Pros:&lt;/strong&gt; Simple to implement, easy to test in a browser.&lt;/li&gt;&lt;li data-sourcepos=&quot;708:17-708:175&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Cons:&lt;/strong&gt; Can be seen as less &quot;clean&quot; than path versioning for a fundamental aspect like version. If multiple query parameters are used, it can become messy.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;709:13-714:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Content Negotiation / Accept Header Versioning (Media Type Versioning):&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;710:17-714:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;710:17-710:130&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;How it works:&lt;/strong&gt; The client specifies the desired API version in the &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Accept&lt;/code&gt; header using a custom media type.&lt;/li&gt;&lt;li data-sourcepos=&quot;711:17-711:118&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Example:&lt;/strong&gt; &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Accept: application/vnd.mycompany.v1+json&lt;/code&gt; or &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Accept: application/json; version=1.0&lt;/code&gt;.&lt;/li&gt;&lt;li data-sourcepos=&quot;712:17-712:95&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Pros:&lt;/strong&gt; Most RESTful approach as it uses standard HTTP content negotiation.&lt;/li&gt;&lt;li data-sourcepos=&quot;713:17-714:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Cons:&lt;/strong&gt; More complex for clients to implement. Less intuitive for developers than path versioning. Not easily discoverable by just looking at the URL.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ol&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;715:1-745:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;715:5-715:19&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Pagination:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;716:5-745:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;716:5-716:161&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; Why is pagination important for APIs that return large datasets? Describe different pagination strategies (e.g., offset-based, cursor-based).&lt;/li&gt;&lt;li data-sourcepos=&quot;717:5-745:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;718:9-745:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;718:9-722:86&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Why Important:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;719:13-722:86&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;719:13-719:129&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Performance:&lt;/strong&gt; Prevents the server from spending excessive time and memory generating and sending huge responses.&lt;/li&gt;&lt;li data-sourcepos=&quot;720:13-720:100&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Resource Conservation:&lt;/strong&gt; Reduces network bandwidth usage for both client and server.&lt;/li&gt;&lt;li data-sourcepos=&quot;721:13-721:170&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Client Usability:&lt;/strong&gt; Large responses can be slow to download, parse, and display for clients. Pagination allows clients to fetch data in manageable chunks.&lt;/li&gt;&lt;li data-sourcepos=&quot;722:13-722:86&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Scalability:&lt;/strong&gt; Essential for APIs that handle growing amounts of data.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;723:9-745:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Pagination Strategies:&lt;/strong&gt;
&lt;ol data-sourcepos=&quot;724:13-745:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;724:13-730:267&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Offset-Based Pagination (Page Number/Offset &amp;amp; Limit):&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;725:17-730:267&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;725:17-725:184&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;How it works:&lt;/strong&gt; The client sends &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;page_number&lt;/code&gt; (or &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;offset&lt;/code&gt;) and &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;page_size&lt;/code&gt; (or &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;limit&lt;/code&gt;) parameters. The server skips &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;offset&lt;/code&gt; records and returns &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;limit&lt;/code&gt; records.&lt;/li&gt;&lt;li data-sourcepos=&quot;726:17-726:112&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Example:&lt;/strong&gt; &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;GET /products?page=2&amp;amp;page_size=10&lt;/code&gt; or &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;GET /products?offset=10&amp;amp;limit=10&lt;/code&gt;&lt;/li&gt;&lt;li data-sourcepos=&quot;727:17-727:110&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Pros:&lt;/strong&gt; Simple to implement and understand. Easy to jump to specific pages (e.g., page 5).&lt;/li&gt;&lt;li data-sourcepos=&quot;728:17-730:267&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Cons:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;729:21-730:267&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;729:21-729:179&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Performance Issues:&lt;/strong&gt; As &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;offset&lt;/code&gt; increases, the database might have to scan and discard a large number of rows, which can be slow for very large datasets.&lt;/li&gt;&lt;li data-sourcepos=&quot;730:21-730:267&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Data Inconsistency (Drift):&lt;/strong&gt; If items are added or deleted while a client is paginating, the results can &quot;drift.&quot; For example, if an item on page 1 is deleted, page 2 might show an item that was previously on page 3, or skip an item entirely.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;731:13-740:112&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Cursor-Based Pagination (Keyset Pagination / Seek Method):&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;732:17-740:112&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;732:17-732:273&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;How it works:&lt;/strong&gt; Instead of page numbers, the client provides a &quot;cursor&quot; (usually an ID or a unique timestamp of the last item from the previous page) to indicate where the next page should start. The server returns items &quot;after&quot; or &quot;before&quot; that cursor.&lt;/li&gt;&lt;li data-sourcepos=&quot;733:17-733:144&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Example:&lt;/strong&gt; &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;GET /products?since_id=12345&amp;amp;limit=10&lt;/code&gt; or &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;GET /products?last_modified_at=2023-10-26T10:00:00Z&amp;amp;limit=10&lt;/code&gt;&lt;/li&gt;&lt;li data-sourcepos=&quot;734:17-736:141&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Pros:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;735:21-736:141&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;735:21-735:157&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Performance:&lt;/strong&gt; Generally much faster for large datasets because it directly seeks to a point in the index, avoiding full table scans.&lt;/li&gt;&lt;li data-sourcepos=&quot;736:21-736:141&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Consistency:&lt;/strong&gt; More robust against data changes (additions/deletions) because it always continues from a known point.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;737:17-740:112&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Cons:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;738:21-740:112&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;738:21-738:69&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Cannot easily jump to an arbitrary page number.&lt;/li&gt;&lt;li data-sourcepos=&quot;739:21-739:48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;More complex to implement.&lt;/li&gt;&lt;li data-sourcepos=&quot;740:21-740:112&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Requires a stable sorting order and a unique, sequential column (like an ID or timestamp).&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;741:13-745:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Scroll/Token-Based Pagination (Less common for RESTful, more for search engines):&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;742:17-745:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;742:17-742:203&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;How it works:&lt;/strong&gt; The server issues a &quot;scroll ID&quot; or token, which the client uses in subsequent requests to fetch the next batch of results. The server maintains state about the scroll.&lt;/li&gt;&lt;li data-sourcepos=&quot;743:17-743:90&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Pros:&lt;/strong&gt; Very efficient for iterating through extremely large datasets.&lt;/li&gt;&lt;li data-sourcepos=&quot;744:17-745:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Cons:&lt;/strong&gt; Not truly stateless (server maintains scroll state), often has an expiry.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ol&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;746:1-819:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;746:5-746:22&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Rate Limiting:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;747:5-819:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;747:5-747:104&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; What is rate limiting in an API, and why is it necessary? How can it be implemented?&lt;/li&gt;&lt;li data-sourcepos=&quot;748:5-819:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;749:9-819:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;749:9-749:311&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;749:11-749:311&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;What is Rate Limiting:&lt;/strong&gt; Rate limiting is a strategy used by APIs to control the number of requests a user or client can make within a specified timeframe. If a client exceeds the defined limit, further requests are blocked or delayed, typically returning a &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;429 Too Many Requests&lt;/code&gt; HTTP status code.&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;750:9-754:124&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;750:11-750:28&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Why Necessary:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;751:13-754:124&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;751:13-751:155&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Abuse Prevention:&lt;/strong&gt; Prevents malicious activities like brute-force attacks, denial-of-service (DoS) attacks, or excessive scraping of data.&lt;/li&gt;&lt;li data-sourcepos=&quot;752:13-752:189&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Resource Protection:&lt;/strong&gt; Protects the API&#39;s backend resources (database, CPU, memory, network bandwidth) from being overwhelmed by a single client or a small group of clients.&lt;/li&gt;&lt;li data-sourcepos=&quot;753:13-753:143&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Fair Usage:&lt;/strong&gt; Ensures that all legitimate users have fair access to the API by preventing one user from monopolizing resources.&lt;/li&gt;&lt;li data-sourcepos=&quot;754:13-754:124&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Cost Management:&lt;/strong&gt; For cloud-based services, controlling API usage can directly impact infrastructure costs.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;755:9-776:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;755:11-755:40&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;How it can be Implemented:&lt;/strong&gt;&lt;/p&gt;
&lt;ol data-sourcepos=&quot;756:13-776:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;756:13-759:204&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Fixed Window Counter:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;757:17-759:204&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;757:17-757:273&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;How it works:&lt;/strong&gt; A counter is maintained for each client (identified by IP, API key, user ID, etc.) for a fixed time window (e.g., 60 seconds). Each request increments the counter. If the counter exceeds the limit within the window, requests are blocked.&lt;/li&gt;&lt;li data-sourcepos=&quot;758:17-758:48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Pros:&lt;/strong&gt; Simple to implement.&lt;/li&gt;&lt;li data-sourcepos=&quot;759:17-759:204&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Cons:&lt;/strong&gt; Can suffer from &quot;burst&quot; problems at the window edges (e.g., a client makes all allowed requests at the very end of one window and then again at the very beginning of the next).&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;760:13-763:115&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Sliding Window Log:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;761:17-763:115&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;761:17-761:323&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;How it works:&lt;/strong&gt; For each client, a timestamp of every request is stored in a sorted list (e.g., in Redis). When a new request arrives, the server counts how many timestamps in the list fall within the current time window. If the count exceeds the limit, the request is denied. Old timestamps are pruned.&lt;/li&gt;&lt;li data-sourcepos=&quot;762:17-762:62&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Pros:&lt;/strong&gt; Very accurate, no &quot;burst&quot; problem.&lt;/li&gt;&lt;li data-sourcepos=&quot;763:17-763:115&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Cons:&lt;/strong&gt; More memory-intensive (stores all timestamps), computationally more expensive to count.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;764:13-767:81&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Sliding Window Counter:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;765:17-767:81&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;765:17-765:220&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;How it works:&lt;/strong&gt; A hybrid approach. Divides the time into smaller fixed windows and keeps counts for each. For a new request, it calculates a weighted average of the current and previous window counts.&lt;/li&gt;&lt;li data-sourcepos=&quot;766:17-766:100&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Pros:&lt;/strong&gt; Better than fixed window, less memory-intensive than sliding window log.&lt;/li&gt;&lt;li data-sourcepos=&quot;767:17-767:81&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Cons:&lt;/strong&gt; Slightly more complex to implement than fixed window.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;768:13-771:54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Token Bucket Algorithm:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;769:17-771:54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;769:17-769:271&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;How it works:&lt;/strong&gt; Imagine a bucket with a fixed capacity. Tokens are added to the bucket at a constant rate. Each request consumes one token. If the bucket is empty, the request is denied. If it&#39;s not empty, a token is removed, and the request proceeds.&lt;/li&gt;&lt;li data-sourcepos=&quot;770:17-770:118&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Pros:&lt;/strong&gt; Allows for bursts of traffic (up to bucket capacity) while smoothing out the overall rate.&lt;/li&gt;&lt;li data-sourcepos=&quot;771:17-771:54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Cons:&lt;/strong&gt; More complex to implement.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;772:13-776:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Leaky Bucket Algorithm:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;773:17-776:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;773:17-773:182&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;How it works:&lt;/strong&gt; Requests are added to a queue (the bucket). Requests are processed (leak out) at a constant rate. If the bucket is full, new requests are dropped.&lt;/li&gt;&lt;li data-sourcepos=&quot;774:17-774:112&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Pros:&lt;/strong&gt; Controls the rate of processing on the server side, provides a smoother output rate.&lt;/li&gt;&lt;li data-sourcepos=&quot;775:17-776:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Cons:&lt;/strong&gt; Introduces latency for requests if the queue fills up.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ol&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;777:9-819:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;777:11-777:75&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Implementation Details (Python/Flask Example with a library):&lt;/strong&gt;&lt;/p&gt;
&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block ng-tns-c564991203-60 ng-trigger ng-trigger-codeBlockRevealAnimation&quot; style=&quot;display: block; font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c564991203-60 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-60&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Python&lt;/span&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;buttons ng-tns-c564991203-60 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;button _ngcontent-ng-c564991203=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c564991203-60 mat-unthemed ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-focus-indicator&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c564991203-60&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;animated-opacity ng-tns-c564991203-60&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;pre _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-60&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-container formatted ng-tns-c564991203-60&quot; data-sourcepos=&quot;779:13-818:84&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;citation-55&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;flask &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-55&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-55&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; Flask, jsonify, request
&lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-55&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-55&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; flask_limiter &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-55&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-55&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; Limiter
&lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-55&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-55&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; flask_limiter.util &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-55&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-55 citation-end-55&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; get_remote_address

app = Flask(__name__)&lt;/span&gt;

&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Configure Limiter to use Flask app and get IP address for key&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# In a real app, you might use a Redis backend for distributed limiting&lt;/span&gt;
limiter = Limiter(
    get_remote_address,
    app=app,
    default_limits=[&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;200 per day&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;50 per hour&quot;&lt;/span&gt;],
    storage_uri=&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;memory://&quot;&lt;/span&gt; &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# For simplicity; use &quot;redis://localhost:6379&quot; for production&lt;/span&gt;
)

&lt;span class=&quot;hljs-meta&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;@app.route(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;/unlimited&quot;&lt;/span&gt;&lt;/span&gt;)&lt;/span&gt;
&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;unlimited_route&lt;/span&gt;():&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; jsonify({&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;message&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;This route is not rate-limited.&quot;&lt;/span&gt;})

&lt;span class=&quot;hljs-meta&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;@app.route(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;/limited&quot;&lt;/span&gt;&lt;/span&gt;)&lt;/span&gt;
&lt;span class=&quot;hljs-meta&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;@limiter.limit(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;5 per minute&quot;&lt;/span&gt;&lt;/span&gt;) &lt;/span&gt;&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Specific limit for this route&lt;/span&gt;
&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;limited_route&lt;/span&gt;():&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; jsonify({&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;message&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;This route is limited to 5 requests per minute.&quot;&lt;/span&gt;})

&lt;span class=&quot;hljs-meta&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;@app.route(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;/user_specific_limited&quot;&lt;/span&gt;&lt;/span&gt;)&lt;/span&gt;
&lt;span class=&quot;hljs-meta&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;@limiter.limit(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;2 per second&quot;&lt;/span&gt;, key_func=&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;lambda&lt;/span&gt;: request.headers.get(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;X-User-ID&#39;&lt;/span&gt;, get_remote_address(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;)&lt;/span&gt;)&lt;/span&gt;)&lt;/span&gt;
&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;user_specific_limited&lt;/span&gt;():&lt;/span&gt;
    user_id = request.headers.get(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;X-User-ID&#39;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;Anonymous&#39;&lt;/span&gt;)
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; jsonify({&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;message&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;Hello &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{user_id}&lt;/span&gt;, this route is limited to 2 req/sec per user.&quot;&lt;/span&gt;})

&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Example: Apply default limits globally to all routes&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# @limiter.exempt  # Can exempt specific routes from default limits&lt;/span&gt;

&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# To run:&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# pip install Flask Flask-Limiter&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# app.run(debug=True)&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Test:&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# curl http://127.0.0.1:5000/limited (try more than 5 times in a minute)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;820:1-866:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;820:5-820:64&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;HATEOAS (Hypermedia as the Engine of Application State):&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;821:5-866:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;821:5-821:121&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; What is HATEOAS, and how does it contribute to the discoverability and evolvability of a RESTful API?&lt;/li&gt;&lt;li data-sourcepos=&quot;822:5-866:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;823:9-866:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;823:9-823:428&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;823:11-823:428&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;HATEOAS (Hypermedia as the Engine of Application State):&lt;/strong&gt; It&#39;s a constraint of the REST architectural style that states that clients should interact with a RESTful API entirely through hypermedia provided dynamically by the server. Instead of knowing the API&#39;s URI structure beforehand, clients discover the available actions and next possible states by following links embedded in the representations they receive.&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;824:9-824:209&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;824:11-824:209&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;How it Works:&lt;/strong&gt; API responses (e.g., JSON) include not just data but also hypermedia links that describe available actions or related resources. These links guide the client on what it can do next.&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;825:9-827:239&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;825:11-825:46&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Contribution to Discoverability:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;826:13-827:239&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;826:13-826:288&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Self-Documentation:&lt;/strong&gt; The API becomes self-documenting to a degree. A client doesn&#39;t need external documentation to know how to navigate from a &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;product&lt;/code&gt; to its &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;reviews&lt;/code&gt; or how to &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;place_order&lt;/code&gt; for that product; the links are provided within the product&#39;s representation.&lt;/li&gt;&lt;li data-sourcepos=&quot;827:13-827:239&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Dynamic Interaction:&lt;/strong&gt; Clients can dynamically discover capabilities. For example, if a &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;user&lt;/code&gt; resource has an &quot;activate&quot; link, the client knows the user can be activated. If that link is absent, the client knows it cannot.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;828:9-831:219&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;828:11-828:43&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Contribution to Evolvability:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;829:13-831:219&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;829:13-829:348&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Decoupling Client and Server:&lt;/strong&gt; HATEOAS significantly decouples the client from the server&#39;s URI structure. If the server changes a URI path for a resource (e.g., from &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;/v1/products&lt;/code&gt; to &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;/v2/items&lt;/code&gt;), as long as the link is correctly updated in the representation, the client doesn&#39;t need to be updated. It just follows the new link.&lt;/li&gt;&lt;li data-sourcepos=&quot;830:13-830:144&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Reduced Client Maintenance:&lt;/strong&gt; Clients are less brittle to API changes. They don&#39;t hardcode URLs; they follow the provided links.&lt;/li&gt;&lt;li data-sourcepos=&quot;831:13-831:219&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Easier API Evolution:&lt;/strong&gt; API developers can change the underlying URI structure or add new functionality without breaking existing clients, as long as the links are correctly maintained in the hypermedia.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;832:9-866:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;832:11-832:48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Example (JSON with HATEOAS links):&lt;/strong&gt;&lt;/p&gt;
&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block ng-tns-c564991203-61 ng-trigger ng-trigger-codeBlockRevealAnimation&quot; style=&quot;display: block; font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c564991203-61 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-61&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;JSON&lt;/span&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;buttons ng-tns-c564991203-61 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;button _ngcontent-ng-c564991203=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c564991203-61 mat-unthemed ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-focus-indicator&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c564991203-61&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;animated-opacity ng-tns-c564991203-61&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;pre _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-61&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-container formatted ng-tns-c564991203-61&quot; data-sourcepos=&quot;834:13-864:13&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{
    &lt;span class=&quot;hljs-attr&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;order_id&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;ORD_12345&quot;&lt;/span&gt;,
    &lt;span class=&quot;hljs-attr&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;status&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;pending&quot;&lt;/span&gt;,
    &lt;span class=&quot;hljs-attr&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;total_amount&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;99.99&lt;/span&gt;,
    &lt;span class=&quot;hljs-attr&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;customer_id&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;USER_67890&quot;&lt;/span&gt;,
    &lt;span class=&quot;hljs-attr&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;_links&quot;&lt;/span&gt;: {
        &lt;span class=&quot;hljs-attr&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;self&quot;&lt;/span&gt;: {
            &lt;span class=&quot;hljs-attr&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;href&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;/orders/ORD_12345&quot;&lt;/span&gt;,
            &lt;span class=&quot;hljs-attr&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;method&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;GET&quot;&lt;/span&gt;,
            &lt;span class=&quot;hljs-attr&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;title&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Retrieve this order&quot;&lt;/span&gt;
        },
        &lt;span class=&quot;hljs-attr&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;customer&quot;&lt;/span&gt;: {
            &lt;span class=&quot;hljs-attr&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;href&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;/users/USER_67890&quot;&lt;/span&gt;,
            &lt;span class=&quot;hljs-attr&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;method&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;GET&quot;&lt;/span&gt;,
            &lt;span class=&quot;hljs-attr&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;title&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Retrieve customer details&quot;&lt;/span&gt;
        },
        &lt;span class=&quot;hljs-attr&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;cancel&quot;&lt;/span&gt;: {
            &lt;span class=&quot;hljs-attr&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;href&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;/orders/ORD_12345/cancel&quot;&lt;/span&gt;,
            &lt;span class=&quot;hljs-attr&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;method&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;POST&quot;&lt;/span&gt;,
            &lt;span class=&quot;hljs-attr&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;title&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Cancel this order&quot;&lt;/span&gt;,
            &lt;span class=&quot;hljs-attr&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;if_status&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;pending&quot;&lt;/span&gt; # Conditional link
        },
        &lt;span class=&quot;hljs-attr&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;items&quot;&lt;/span&gt;: {
            &lt;span class=&quot;hljs-attr&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;href&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;/orders/ORD_12345/items&quot;&lt;/span&gt;,
            &lt;span class=&quot;hljs-attr&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;method&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;GET&quot;&lt;/span&gt;,
            &lt;span class=&quot;hljs-attr&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;title&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;View order items&quot;&lt;/span&gt;
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p data-sourcepos=&quot;865:13-865:237&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;In this example, the client receives the order details along with instructions (links) on what it can do next (cancel, view customer, view items). It doesn&#39;t need to hardcode &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;/users/{user_id}&lt;/code&gt; or &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;/orders/{order_id}/cancel&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ol&gt;&lt;hr data-sourcepos=&quot;867:1-867:3&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot; /&gt;&lt;h2 data-sourcepos=&quot;869:1-869:43&quot; style=&quot;font-family: Google Sans, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;III. Python API Frameworks and Libraries&lt;/h2&gt;&lt;p data-sourcepos=&quot;871:1-871:93&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;These questions test your practical experience with popular Python tools for API development.&lt;/p&gt;&lt;ol data-sourcepos=&quot;873:1-1354:169&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;873:1-1110:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;873:5-873:42&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Flask/Django REST Framework (DRF):&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;874:5-1110:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;874:5-874:131&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;874:7-874:131&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; Have you worked with Flask or Django REST Framework? Describe a project where you used one of these frameworks.&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;875:5-892:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;875:7-875:169&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt; (This is a personal experience question, so a generic answer is provided as an example. &lt;em style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;You should replace this with your actual project experience.&lt;/em&gt;)&lt;/p&gt;
&lt;ul data-sourcepos=&quot;876:9-892:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;876:9-884:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;876:11-876:278&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Example Answer (Flask):&lt;/strong&gt; &quot;Yes, I have significant experience with Flask for building lightweight, scalable REST APIs. In my previous role at [Company Name], I developed an internal service using Flask to manage and expose inventory data for our e-commerce platform.&lt;/p&gt;
&lt;ul data-sourcepos=&quot;877:13-884:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;877:13-877:205&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Routes &amp;amp; Views:&lt;/strong&gt; I defined routes for &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;/products&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;/products/&amp;lt;id&amp;gt;&lt;/code&gt;, and &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;/products/&amp;lt;id&amp;gt;/stock&lt;/code&gt; using Flask&#39;s &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;@app.route&lt;/code&gt; decorator to handle GET, POST, PUT, and PATCH requests.&lt;/li&gt;&lt;li data-sourcepos=&quot;878:13-878:129&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Request Handling:&lt;/strong&gt; I used &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;request.json&lt;/code&gt; to parse incoming JSON payloads for creating and updating product data.&lt;/li&gt;&lt;li data-sourcepos=&quot;879:13-879:189&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Database Integration:&lt;/strong&gt; The API interacted with a PostgreSQL database using SQLAlchemy. I implemented CRUD operations, ensuring data consistency and transactional integrity.&lt;/li&gt;&lt;li data-sourcepos=&quot;880:13-880:231&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Error Handling:&lt;/strong&gt; I set up custom error handlers (&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;@app.errorhandler&lt;/code&gt;) to return appropriate HTTP status codes (e.g., 400 for bad input, 404 for not found, 500 for server errors) and consistent JSON error responses.&lt;/li&gt;&lt;li data-sourcepos=&quot;881:13-881:196&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Authentication/Authorization:&lt;/strong&gt; I integrated JWT-based authentication using &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;PyJWT&lt;/code&gt; and implemented decorators to protect specific endpoints, checking user roles for authorization.&lt;/li&gt;&lt;li data-sourcepos=&quot;882:13-882:148&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Testing:&lt;/strong&gt; I wrote unit tests for API endpoints and business logic using &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;pytest&lt;/code&gt; and Flask&#39;s test client to simulate HTTP requests.&lt;/li&gt;&lt;li data-sourcepos=&quot;883:13-884:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Deployment:&lt;/strong&gt; The application was containerized with Docker and deployed on Kubernetes.&quot;&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;885:9-892:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;885:11-885:374&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Example Answer (Django REST Framework - DRF):&lt;/strong&gt; &quot;Yes, I&#39;ve extensively used Django REST Framework for building robust and feature-rich REST APIs, particularly for larger applications requiring quick development cycles and built-in ORM features. For instance, in a project at [Company Name], I was part of a team that built an API for a content management system.&lt;/p&gt;
&lt;ul data-sourcepos=&quot;886:13-892:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;886:13-886:258&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Serializers:&lt;/strong&gt; DRF&#39;s &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;ModelSerializer&lt;/code&gt; was invaluable for converting Django models to JSON representations and vice-versa, handling data validation and parsing automatically. I also created custom serializers for more complex data structures.&lt;/li&gt;&lt;li data-sourcepos=&quot;887:13-887:237&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;ViewSets &amp;amp; Routers:&lt;/strong&gt; I leveraged &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;ModelViewSet&lt;/code&gt; and DRF&#39;s default routers to quickly create standard CRUD endpoints for resources like &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;articles&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;categories&lt;/code&gt;, and &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;authors&lt;/code&gt;, significantly reducing boilerplate code.&lt;/li&gt;&lt;li data-sourcepos=&quot;888:13-888:249&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Permissions &amp;amp; Authentication:&lt;/strong&gt; I utilized DRF&#39;s built-in permission classes (e.g., &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;IsAuthenticated&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;IsAdminUser&lt;/code&gt;) and customized them for role-based access control. For authentication, we used &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;djangorestframework-simplejwt&lt;/code&gt;.&lt;/li&gt;&lt;li data-sourcepos=&quot;889:13-889:217&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Filtering, Searching, Pagination:&lt;/strong&gt; DRF&#39;s generic views and filters enabled easy implementation of search, filtering by various criteria, and different pagination styles (e.g., &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;PageNumberPagination&lt;/code&gt;).&lt;/li&gt;&lt;li data-sourcepos=&quot;890:13-890:153&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Custom Endpoints:&lt;/strong&gt; For specific actions that didn&#39;t fit standard CRUD (e.g., publishing an article), I added custom actions to ViewSets.&lt;/li&gt;&lt;li data-sourcepos=&quot;891:13-892:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Testing:&lt;/strong&gt; We used Django&#39;s &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;TestCase&lt;/code&gt; and DRF&#39;s &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;APITestCase&lt;/code&gt; to write comprehensive tests for endpoints, serialization, and permissions.&quot;&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;893:5-893:76&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;893:7-893:76&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; Explain how to define a basic API endpoint in Flask/DRF.&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;894:5-987:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;894:7-894:17&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;895:9-987:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;895:9-919:15&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Flask:&lt;/strong&gt;
&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block ng-tns-c564991203-62 ng-trigger ng-trigger-codeBlockRevealAnimation&quot; style=&quot;display: block; font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c564991203-62 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-62&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Python&lt;/span&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;buttons ng-tns-c564991203-62 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;button _ngcontent-ng-c564991203=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c564991203-62 mat-unthemed ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-focus-indicator&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c564991203-62&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;animated-opacity ng-tns-c564991203-62&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;pre _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-62&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-container formatted ng-tns-c564991203-62&quot; data-sourcepos=&quot;896:13-919:33&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt; flask &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;citation-54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Flask, jsonify, request

app = Flask(__name__)

&lt;/span&gt;&lt;span class=&quot;hljs-meta&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;@app.route(&lt;/span&gt;&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;/hello&#39;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;, methods=[&lt;/span&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;GET&#39;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;hello_world&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;():&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; jsonify({&lt;/span&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;message&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Hello, World!&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;})

&lt;/span&gt;&lt;span class=&quot;hljs-meta&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;@app.route(&lt;/span&gt;&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;/greet/&amp;lt;name&amp;gt;&#39;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-54 citation-end-54&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;,&lt;/span&gt; methods=[&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;GET&#39;&lt;/span&gt;]&lt;/span&gt;)&lt;/span&gt;
&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;greet_user&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;name&lt;/span&gt;):&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; jsonify({&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;message&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;Hello, &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{name}&lt;/span&gt;!&quot;&lt;/span&gt;})

&lt;span class=&quot;hljs-meta&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;@app.route(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;/submit_data&#39;&lt;/span&gt;, methods=[&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;POST&#39;&lt;/span&gt;]&lt;/span&gt;)&lt;/span&gt;
&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;submit_data&lt;/span&gt;():&lt;/span&gt;
    data = request.json &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Get JSON payload from request body&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;not&lt;/span&gt; data &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;value&#39;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;in&lt;/span&gt; data:
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; jsonify({&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;error&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Missing &#39;value&#39; in request body&quot;&lt;/span&gt;}), &lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;400&lt;/span&gt;
    received_value = data[&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;value&#39;&lt;/span&gt;]
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; jsonify({&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;status&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;success&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;received&quot;&lt;/span&gt;: received_value}), &lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;200&lt;/span&gt;

&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# To run:&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# app.run(debug=True)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;920:9-987:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Django REST Framework (DRF):&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;921:13-987:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;921:13-932:19&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;1. Define a Django Model (e.g., &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;myapp/&lt;span class=&quot;citation-53&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;models.py&lt;/span&gt;&lt;/code&gt;&lt;span class=&quot;citation-53&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;):&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;citation-53&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;/span&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block ng-tns-c564991203-63 ng-trigger ng-trigger-codeBlockRevealAnimation&quot; style=&quot;display: block; font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c564991203-63 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-63&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Python&lt;/span&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;buttons ng-tns-c564991203-63 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;button _ngcontent-ng-c564991203=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c564991203-63 mat-unthemed ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-focus-indicator&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c564991203-63&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;animated-opacity ng-tns-c564991203-63&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;pre _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-63&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-container formatted ng-tns-c564991203-63&quot; data-sourcepos=&quot;922:17-932:48&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-53&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-53&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; django.db &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-53&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-53&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; models

&lt;/span&gt;&lt;span class=&quot;hljs-class&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-53&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;class&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-53&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-53&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Product&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-53&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-53&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;models.Model&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-53&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;):&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-53&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
    name = models.&lt;/span&gt;&lt;span class=&quot;citation-52 citation-53&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;CharField(max_length=&lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-52 citation-53&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;100&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-52 citation-53&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;)
    price = models.DecimalField(max_digits=&lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-52 citation-53&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;10&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-52 citation-53 citation-end-53&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;citation-52&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; decimal_places=&lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-52&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-52&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;)
    stock = models.IntegerField(default=&lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-52&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-52&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;)

    &lt;/span&gt;&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-52&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-52&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-52&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;__str__&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-52&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-52&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;self&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-52&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;):&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-52&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-52&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-52 citation-end-52&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt; self.name
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;933:13-942:19&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;2. Create a Serializer (e.g., &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;myapp/serializers.py&lt;/code&gt;):&lt;/strong&gt;
&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block ng-tns-c564991203-64 ng-trigger ng-trigger-codeBlockRevealAnimation&quot; style=&quot;display: block; font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c564991203-64 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-64&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Python&lt;/span&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;buttons ng-tns-c564991203-64 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;button _ngcontent-ng-c564991203=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c564991203-64 mat-unthemed ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-focus-indicator&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c564991203-64&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;animated-opacity ng-tns-c564991203-64&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;pre _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-64&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-container formatted ng-tns-c564991203-64&quot; data-sourcepos=&quot;934:17-942:65&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt; rest_framework &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt; serializers
&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt; .models &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt; Product

&lt;span class=&quot;hljs-class&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;ProductSerializer&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;serializers.ModelSerializer&lt;/span&gt;):&lt;/span&gt;
    &lt;span class=&quot;hljs-class&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Meta&lt;/span&gt;:&lt;/span&gt;
        model = Product
        fields = [&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;id&#39;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;name&#39;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;price&#39;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;stock&#39;&lt;/span&gt;]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;943:13-952:19&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;3. Define a View (e.g., &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;myapp/views.py&lt;/code&gt;):&lt;/strong&gt;
&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block ng-tns-c564991203-65 ng-trigger ng-trigger-codeBlockRevealAnimation&quot; style=&quot;display: block; font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c564991203-65 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-65&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Python&lt;/span&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;buttons ng-tns-c564991203-65 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;button _ngcontent-ng-c564991203=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c564991203-65 mat-unthemed ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-focus-indicator&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c564991203-65&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;animated-opacity ng-tns-c564991203-65&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;pre _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-65&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-container formatted ng-tns-c564991203-65&quot; data-sourcepos=&quot;944:17-952:64&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-51&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-51&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; rest_framework &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-51&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-51&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; viewsets
&lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-51&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-51&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; .models &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-51&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-51&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; Product
&lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-51&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-51&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; .serializers &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-51&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-51&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; ProductSerializer

&lt;/span&gt;&lt;span class=&quot;hljs-class&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-51&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;class&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-51&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-51&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;ProductViewSet&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-51&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-51&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;viewsets.ModelViewSet&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-51&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;):&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-51&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
    queryset = Product.objects.&lt;/span&gt;&lt;span class=&quot;hljs-built_in&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-51&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;all&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-51 citation-end-51&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;()
    serializer_class = ProductSerializer&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;953:13-967:19&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;4. Register the ViewSet in &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;urls.py&lt;/code&gt; (e.g., &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;myproject/urls.py&lt;/code&gt; or &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;myapp/&lt;span class=&quot;citation-50&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;urls.py&lt;/span&gt;&lt;/code&gt;&lt;span class=&quot;citation-50&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;):&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;citation-50&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;/span&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block ng-tns-c564991203-66 ng-trigger ng-trigger-codeBlockRevealAnimation&quot; style=&quot;display: block; font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c564991203-66 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-66&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Python&lt;/span&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;buttons ng-tns-c564991203-66 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;button _ngcontent-ng-c564991203=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c564991203-66 mat-unthemed ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-focus-indicator&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c564991203-66&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;animated-opacity ng-tns-c564991203-66&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;pre _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-66&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-container formatted ng-tns-c564991203-66&quot; data-sourcepos=&quot;954:17-967:17&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-50&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;citation-49 citation-50&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-49 citation-50&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; django.contrib &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-49 citation-50&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-49 citation-50&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; admin
&lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-49 citation-50&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-49 citation-50&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; django.urls &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-49 citation-50&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-49 citation-50&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; path, include
&lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-49 citation-50&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-49 citation-50&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; rest_framework.routers &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-49 citation-50&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-49 citation-50 citation-end-50&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; DefaultRouter&lt;/span&gt;&lt;span class=&quot;citation-49&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-49&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-49 citation-end-49&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt; myapp.views &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt; ProductViewSet &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Assuming myapp is your app name&lt;/span&gt;

router = DefaultRouter()
router.register(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;r&#39;products&#39;&lt;/span&gt;, ProductViewSet) &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Registers CRUD for /products/ and /products/{id}/&lt;/span&gt;

urlpatterns = [
    path(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;admin/&#39;&lt;/span&gt;, admin.site.urls),
    path(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;api/&#39;&lt;/span&gt;, include(router.urls)), &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# All API routes under /api/&lt;/span&gt;
]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;968:13-987:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Basic DRF endpoint (Function-based view for non-model data):&lt;/strong&gt;
&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block ng-tns-c564991203-67 ng-trigger ng-trigger-codeBlockRevealAnimation&quot; style=&quot;display: block; font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c564991203-67 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-67&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Python&lt;/span&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;buttons ng-tns-c564991203-67 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;button _ngcontent-ng-c564991203=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c564991203-67 mat-unthemed ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-focus-indicator&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c564991203-67&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;animated-opacity ng-tns-c564991203-67&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;pre _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-67&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-container formatted ng-tns-c564991203-67&quot; data-sourcepos=&quot;969:17-986:48&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt; rest_framework.decorators &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; api_view
&lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; rest_framework.response &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; Response
&lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; rest_framework &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; status

&lt;/span&gt;&lt;span class=&quot;hljs-meta&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;@api_view(&lt;/span&gt;&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;GET&#39;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;POST&#39;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;hello_drf&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;request&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;):&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-48 citation-end-48&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;if&lt;/span&gt; request.method == &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;GET&#39;&lt;/span&gt;:
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; Response({&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;message&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Hello from DRF!&quot;&lt;/span&gt;})
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;elif&lt;/span&gt; request.method == &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;POST&#39;&lt;/span&gt;:
        data = request.data &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Auto-parses JSON, form data etc.&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;name&#39;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;in&lt;/span&gt; data:
            &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; Response({&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;error&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Name is required&quot;&lt;/span&gt;}, status=status.HTTP_400_BAD_REQUEST)
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; Response({&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;message&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;Received name: &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{data[&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;name&#39;&lt;/span&gt;]}&lt;/span&gt;&quot;&lt;/span&gt;}, status=status.HTTP_201_CREATED)

&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# In urls.py:&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# path(&#39;api/hello/&#39;, hello_drf),&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;988:5-988:83&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;988:7-988:83&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; How do you handle routing and URL patterns in these frameworks?&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;989:5-1031:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;989:7-989:17&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;990:9-1031:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;990:9-1007:15&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Flask:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;991:13-993:147&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;991:13-991:87&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Uses the &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;@app.route()&lt;/code&gt; decorator to map a URL path to a Python function.&lt;/li&gt;&lt;li data-sourcepos=&quot;992:13-992:101&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;HTTP methods are specified in the &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;methods&lt;/code&gt; argument (e.g., &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;methods=[&#39;GET&#39;, &#39;POST&#39;]&lt;/code&gt;).&lt;/li&gt;&lt;li data-sourcepos=&quot;993:13-993:147&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;URL parts can be dynamic using angle brackets (&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&amp;lt;variable_name&amp;gt;&lt;/code&gt;), optionally with converters (&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&amp;lt;int:id&amp;gt;&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&amp;lt;string:name&amp;gt;&lt;/code&gt;).&lt;/li&gt;&lt;/ul&gt;
&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block ng-tns-c564991203-68 ng-trigger ng-trigger-codeBlockRevealAnimation&quot; style=&quot;display: block; font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c564991203-68 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Python&lt;/span&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;buttons ng-tns-c564991203-68 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;button _ngcontent-ng-c564991203=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c564991203-68 mat-unthemed ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-focus-indicator&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c564991203-68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;animated-opacity ng-tns-c564991203-68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;pre _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-68&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-container formatted ng-tns-c564991203-68&quot; data-sourcepos=&quot;994:13-1007:53&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt; flask &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt; Flask, request

app = Flask(__name__)

&lt;span class=&quot;hljs-meta&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;@app.route(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;/users/&amp;lt;int:user_id&amp;gt;&#39;&lt;/span&gt;, methods=[&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;GET&#39;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;PUT&#39;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;DELETE&#39;&lt;/span&gt;]&lt;/span&gt;)&lt;/span&gt;
&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;user_detail&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;user_id&lt;/span&gt;):&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;if&lt;/span&gt; request.method == &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;GET&#39;&lt;/span&gt;:
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;Getting user &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{user_id}&lt;/span&gt;&quot;&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;elif&lt;/span&gt; request.method == &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;PUT&#39;&lt;/span&gt;:
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;Updating user &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{user_id}&lt;/span&gt;&quot;&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;elif&lt;/span&gt; request.method == &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;DELETE&#39;&lt;/span&gt;:
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;Deleting user &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{user_id}&lt;/span&gt;&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;1008:9-1031:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Django REST Framework (DRF):&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;1009:13-1013:222&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;1009:13-1009:62&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Builds upon Django&#39;s &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;urlpatterns&lt;/code&gt; in &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;urls.py&lt;/code&gt;.&lt;/li&gt;&lt;li data-sourcepos=&quot;1010:13-1010:90&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;path()&lt;/code&gt; or &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;re_path()&lt;/code&gt;:&lt;/strong&gt; Standard Django functions to map URLs to views.&lt;/li&gt;&lt;li data-sourcepos=&quot;1011:13-1013:222&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Routers (&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;DefaultRouter&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;SimpleRouter&lt;/code&gt;):&lt;/strong&gt; DRF provides routers to automatically generate URL patterns for &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;ViewSet&lt;/code&gt; classes. This is highly recommended for RESTful APIs as it reduces boilerplate.
&lt;ul data-sourcepos=&quot;1012:17-1013:222&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;1012:17-1012:115&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;A &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;ViewSet&lt;/code&gt; combines the logic for a set of related views (list, detail, create, update, delete).&lt;/li&gt;&lt;li data-sourcepos=&quot;1013:17-1013:222&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;The &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;router.register()&lt;/code&gt; method automatically creates URLs like &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;/products/&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;/products/{id}/&lt;/code&gt;, and maps them to the appropriate &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;list&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;retrieve&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;create&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;update&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;destroy&lt;/code&gt; methods of the &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;ViewSet&lt;/code&gt;.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block ng-tns-c564991203-69 ng-trigger ng-trigger-codeBlockRevealAnimation&quot; style=&quot;display: block; font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c564991203-69 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-69&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Python&lt;/span&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;buttons ng-tns-c564991203-69 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;button _ngcontent-ng-c564991203=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c564991203-69 mat-unthemed ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-focus-indicator&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c564991203-69&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;animated-opacity ng-tns-c564991203-69&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;pre _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-69&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-container formatted ng-tns-c564991203-69&quot; data-sourcepos=&quot;1014:13-1030:50&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# myapp/urls.py (within a Django &lt;span class=&quot;citation-47&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;app)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-47&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-47&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-47&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; django.urls &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-47&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-47&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; path, include
&lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-47&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-47&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; rest_framework.routers &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-47&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-47&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; DefaultRouter
&lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-47&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-47&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; .views &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-47&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-47 citation-end-47&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; ProductViewSet,&lt;/span&gt; hello_drf &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# From previous example&lt;/span&gt;

router = DefaultRouter()
router.register(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;r&#39;products&#39;&lt;/span&gt;, ProductViewSet, basename=&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;product&#39;&lt;/span&gt;) &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# basename is optional but good practice&lt;/span&gt;

urlpatterns = [
    path(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;simple_hello/&#39;&lt;/span&gt;, hello_drf), &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# A simple function-based view&lt;/span&gt;
    path(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;&#39;&lt;/span&gt;, include(router.urls)), &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Include all routes generated by the router&lt;/span&gt;
]

&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# In your project&#39;s main urls.py:&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# path(&#39;api/&#39;, include(&#39;myapp.urls&#39;)),&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;1032:5-1032:109&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;1032:7-1032:109&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; How do you serialize/deserialize data in DRF (e.g., using &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;serializers.ModelSerializer&lt;/code&gt;)?&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;1033:5-1110:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;1033:7-1033:17&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;1034:9-1110:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;1034:9-1034:219&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Serialization:&lt;/strong&gt; The process of converting complex data types (like Django model instances or querysets) into native Python data types that can then be easily rendered into JSON, XML, or other content types.&lt;/li&gt;&lt;li data-sourcepos=&quot;1035:9-1035:238&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Deserialization:&lt;/strong&gt; The process of converting incoming data (e.g., JSON from a request body) into native Python data types (like dictionaries) and then into Django model instances, typically performing validation along the way.&lt;/li&gt;&lt;li data-sourcepos=&quot;1036:9-1092:19&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;serializers.ModelSerializer&lt;/code&gt;:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;1037:13-1092:19&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;1037:13-1037:274&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;1037:15-1037:274&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Purpose:&lt;/strong&gt; A powerful class in DRF that provides a shortcut for creating serializers that map directly to Django models. It automatically generates a set of fields based on the model and provides default implementations for &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;create()&lt;/code&gt; and &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;update()&lt;/code&gt; methods.&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;1038:13-1092:19&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;1038:15-1038:26&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Example:&lt;/strong&gt;&lt;/p&gt;
&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block ng-tns-c564991203-70 ng-trigger ng-trigger-codeBlockRevealAnimation&quot; style=&quot;display: block; font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c564991203-70 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-70&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Python&lt;/span&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;buttons ng-tns-c564991203-70 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;button _ngcontent-ng-c564991203=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c564991203-70 mat-unthemed ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-focus-indicator&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c564991203-70&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;animated-opacity ng-tns-c564991203-70&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;pre _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-70&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-container formatted ng-tns-c564991203-70&quot; data-sourcepos=&quot;1040:17-1092:46&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# &lt;span class=&quot;citation-46&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;myapp/models.py&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-46&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-46&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-46&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; django.db &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-46&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-46&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; models

&lt;/span&gt;&lt;span class=&quot;hljs-class&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-46&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;class&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-46&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-46&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Book&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-46&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-46&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;models.Model&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-46&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;):&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-46&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
    title = models.CharField(max_length=&lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-46&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;200&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-46&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;)
    author = &lt;/span&gt;&lt;span class=&quot;citation-45 citation-46&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;models.CharField(max_length=&lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-45 citation-46&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;100&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-45 citation-46 citation-end-46&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;citation-45&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
    published_date = models.DateField()
    isbn = models.CharField(max_length=&lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-45&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;13&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-45&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;, unique=&lt;/span&gt;&lt;span class=&quot;hljs-literal&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-45&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;True&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-45&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;)

    &lt;/span&gt;&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-45&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-45&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-45&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;__str__&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-45&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-45&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;self&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-45&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;):&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-45&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-45&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-45 citation-end-45&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; self.title&lt;/span&gt;

&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# myapp/serializers.py&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt; rest_framework &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;citation-44&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;serializers
&lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-44&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-44&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; .models &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-44&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-44&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; Book

&lt;/span&gt;&lt;span class=&quot;hljs-class&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-44&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;class&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-44&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-44&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;BookSerializer&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-44&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-44&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;serializers.ModelSerializer&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-44&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;):&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-44&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;hljs-class&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-44&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;class&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-44&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-44&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Meta&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-44&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-44&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
        model = Book
        fields = [&lt;/span&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-44&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;id&#39;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-44&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-44&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;title&#39;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-44&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-44&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;author&#39;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-44&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-44&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;published_date&#39;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-44 citation-end-44&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;isbn&#39;&lt;/span&gt;]
        &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# You can also exclude fields: exclude = [&#39;created_at&#39;]&lt;/span&gt;
        &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Or read-only fields: read_only_fields = [&#39;isbn&#39;]&lt;/span&gt;

&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# --- Usage Examples in a View ---&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# To serialize a single instance (for a GET /books/{id} response):&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# book = Book.objects.get(id=1)&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# serializer = BookSerializer(book)&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# print(serializer.data) # Output: {&#39;id&#39;: 1, &#39;title&#39;: &#39;...&#39;, &#39;author&#39;: &#39;...&#39;, ...}&lt;/span&gt;

&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# To serialize a queryset (for a GET /books/ response):&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# books = Book.objects.all()&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# serializer = BookSerializer(books, many=True) # many=True for a list of objects&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# print(serializer.data) # Output: [{&#39;id&#39;: 1, ...}, {&#39;id&#39;: 2, ...}]&lt;/span&gt;

&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# To deserialize and validate incoming data (for a POST /books/ request):&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# data = {&#39;title&#39;: &#39;New Book&#39;, &#39;author&#39;: &#39;John Doe&#39;, &#39;published_date&#39;: &#39;2023-01-01&#39;, &#39;isbn&#39;: &#39;1234567890123&#39;}&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# serializer = BookSerializer(data=data)&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# if serializer.is_valid():&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;#     book_instance = serializer.save() # Creates a new Book instance in the database&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;#     print(book_instance.title)&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# else:&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;#     print(serializer.errors) # Validation errors&lt;/span&gt;

&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# To deserialize and update an existing instance (for a PUT/PATCH /books/{id} request):&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# book = Book.objects.get(id=1)&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# update_data = {&#39;price&#39;: 25.00} # or {&#39;title&#39;: &#39;Updated Title&#39;}&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# serializer = BookSerializer(book, data=update_data, partial=True) # partial=True for PATCH&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# if serializer.is_valid():&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;#     updated_book = serializer.save() # Updates the existing Book instance&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# else:&lt;/span&gt;
&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;#     print(serializer.errors)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;1093:9-1110:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;serializers.Serializer&lt;/code&gt; (Custom/Non-Model Data):&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;1094:13-1094:131&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;1094:13-1094:131&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;For data that doesn&#39;t directly map to a Django model, or for complex nested structures. You define fields explicitly.&lt;/li&gt;&lt;/ul&gt;
&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block ng-tns-c564991203-71 ng-trigger ng-trigger-codeBlockRevealAnimation&quot; style=&quot;display: block; font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c564991203-71 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-71&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Python&lt;/span&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;buttons ng-tns-c564991203-71 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;button _ngcontent-ng-c564991203=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c564991203-71 mat-unthemed ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-focus-indicator&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c564991203-71&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;animated-opacity ng-tns-c564991203-71&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;pre _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-71&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-container formatted ng-tns-c564991203-71&quot; data-sourcepos=&quot;1095:13-1109:71&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# myapp/&lt;span class=&quot;citation-43&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;serializers.py&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-43&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hljs-class&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-43&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;class&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-43&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-43&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;ContactFormSerializer&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-43&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-43&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;serializers.&lt;/span&gt;&lt;span class=&quot;citation-42 citation-43&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Serializer&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-42 citation-43&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;):&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-42 citation-43&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
    name = serializers.CharField(max_length=&lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-42 citation-43&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;100&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-42 citation-43 citation-end-43&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;)
    email = serializers.EmailField()&lt;/span&gt;&lt;span class=&quot;citation-42&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
    message = serializers.CharField(style={&lt;/span&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-42&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;base_template&#39;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-42&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-42&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;textarea.html&#39;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-42 citation-end-42&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;})&lt;/span&gt;

    &lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;create&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;self, validated_data&lt;/span&gt;):&lt;/span&gt;
        &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Custom logic for saving/processing the contact form data&lt;/span&gt;
        print(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;Contact form received from &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{validated_data[&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;name&#39;&lt;/span&gt;]}&lt;/span&gt; (&lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{validated_data[&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;email&#39;&lt;/span&gt;]}&lt;/span&gt;): &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{validated_data[&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;message&#39;&lt;/span&gt;]}&lt;/span&gt;&quot;&lt;/span&gt;)
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; validated_data &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Return data or a dummy object&lt;/span&gt;

    &lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;update&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;self, instance, validated_data&lt;/span&gt;):&lt;/span&gt;
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;pass&lt;/span&gt; &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Not applicable for a contact form submission&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;1111:1-1241:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;1111:5-1111:25&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Requests Library:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;1112:5-1241:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;1112:5-1112:114&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;1112:7-1112:114&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; How do you make an HTTP GET/POST request to an external API using Python&#39;s &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;requests&lt;/code&gt; library?&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;1113:5-1166:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;1113:7-1113:17&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;1114:9-1166:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;1114:9-1114:147&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;1114:11-1114:147&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;The &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;requests&lt;/code&gt; library is a de facto standard for making HTTP requests in Python due to its user-friendliness and comprehensive features.&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;1115:9-1139:15&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;1115:11-1115:26&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;GET Request:&lt;/strong&gt;&lt;/p&gt;
&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block ng-tns-c564991203-72 ng-trigger ng-trigger-codeBlockRevealAnimation&quot; style=&quot;display: block; font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c564991203-72 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-72&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Python&lt;/span&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;buttons ng-tns-c564991203-72 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;button _ngcontent-ng-c564991203=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c564991203-72 mat-unthemed ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-focus-indicator&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c564991203-72&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;animated-opacity ng-tns-c564991203-72&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;pre _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-72&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-container formatted ng-tns-c564991203-72&quot; data-sourcepos=&quot;1117:13-1139:53&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt; requests

url = &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;https://jsonplaceholder.typicode.com/todos/1&quot;&lt;/span&gt;

&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-41&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;try&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-41&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;:
    response = requests.get(url)
    response.raise_for_status()  &lt;/span&gt;&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-41&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Raise an exception for HTTP errors (4xx or 5xx)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-41 citation-end-41&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;

    data = response.json()&lt;/span&gt;  &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Parse JSON response body&lt;/span&gt;
    print(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;GET Request Successful:&quot;&lt;/span&gt;)
    print(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;Status Code: &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{response.status_code}&lt;/span&gt;&quot;&lt;/span&gt;)
    print(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;Response Data: &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{data}&lt;/span&gt;&quot;&lt;/span&gt;)

&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;except&lt;/span&gt; requests.exceptions.HTTPError &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;as&lt;/span&gt; errh:
    print(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;HTTP Error: &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{errh}&lt;/span&gt;&quot;&lt;/span&gt;)
&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;except&lt;/span&gt; requests.exceptions.ConnectionError &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;as&lt;/span&gt; errc:
    print(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;Error Connecting: &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{errc}&lt;/span&gt;&quot;&lt;/span&gt;)
&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;except&lt;/span&gt; requests.exceptions.Timeout &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-40&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;as&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-40&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; errt:
    print(&lt;/span&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-40&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;Timeout Error: &lt;/span&gt;&lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-40&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{errt}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-40&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-40&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;)
&lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-40&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;except&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-40&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; requests.exceptions.RequestException &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-40&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;as&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-40&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; err:
    print(&lt;/span&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-40&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;Something went wrong: &lt;/span&gt;&lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-40&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{err}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-40&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-40&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class=&quot;citation-40&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;/span&gt;&lt;/li&gt;&lt;span class=&quot;citation-40&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;/span&gt;&lt;li data-sourcepos=&quot;1140:9-1166:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-40&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;/span&gt;&lt;p data-sourcepos=&quot;1140:11-1140:35&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-40 citation-end-40&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;POST&lt;sup _ngcontent-ng-c4096754574=&quot;&quot; class=&quot;superscript&quot; data-turn-source-index=&quot;15&quot; style=&quot;background-color: transparent !important; font-family: Google Sans Text, sans-serif !important; font-size: 16px !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;15&lt;/sup&gt;&lt;/span&gt; Request:&lt;/strong&gt;&lt;/p&gt;
&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block ng-tns-c564991203-73 ng-trigger ng-trigger-codeBlockRevealAnimation&quot; style=&quot;display: block; font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c564991203-73 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-73&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Python&lt;/span&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;buttons ng-tns-c564991203-73 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;button _ngcontent-ng-c564991203=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c564991203-73 mat-unthemed ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-focus-indicator&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c564991203-73&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;animated-opacity ng-tns-c564991203-73&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;pre _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-73&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-container formatted ng-tns-c564991203-73&quot; data-sourcepos=&quot;1142:13-1165:49&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt; requests
&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt; json

url = &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;https://jsonplaceholder.typicode.com/posts&quot;&lt;/span&gt;
payload = {
    &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;title&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;foo&quot;&lt;/span&gt;,
    &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;body&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;bar&quot;&lt;/span&gt;,
    &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;userId&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;1&lt;/span&gt;
}

&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;try&lt;/span&gt;:
    &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# For JSON payload, use the &#39;json&#39; parameter. requests will set Content-Type header automatically.&lt;/span&gt;
    response = requests.post(url, json=payload)
    response.raise_for_status()

    created_post = response.json()
    print(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;\nPOST Request Successful:&quot;&lt;/span&gt;)
    print(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;Status Code: &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{response.status_code}&lt;/span&gt;&quot;&lt;/span&gt;)
    print(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;Created Post: &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{created_post}&lt;/span&gt;&quot;&lt;/span&gt;)

&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;except&lt;/span&gt; requests.exceptions.RequestException &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;as&lt;/span&gt; e:
    print(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;POST Request Error: &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{e}&lt;/span&gt;&quot;&lt;/span&gt;)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;1167:5-1167:82&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;1167:7-1167:82&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; How do you handle JSON responses from an API using &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;requests&lt;/code&gt;?&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;1168:5-1197:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;1168:7-1168:17&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;1169:9-1171:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;1169:9-1169:197&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;The &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;requests&lt;/code&gt; library provides a convenient &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;json()&lt;/code&gt; method on the response object. This method attempts to parse the response body as JSON and returns it as a Python dictionary or list.&lt;/li&gt;&lt;li data-sourcepos=&quot;1170:9-1171:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;It automatically handles the &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Content-Type: application/json&lt;/code&gt; header. If the response is not valid JSON, it will raise a &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;json.JSONDecodeError&lt;/code&gt;.&lt;/li&gt;&lt;/ul&gt;
&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block ng-tns-c564991203-74 ng-trigger ng-trigger-codeBlockRevealAnimation&quot; style=&quot;display: block; font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c564991203-74 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-74&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Python&lt;/span&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;buttons ng-tns-c564991203-74 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;button _ngcontent-ng-c564991203=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c564991203-74 mat-unthemed ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-focus-indicator&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c564991203-74&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;animated-opacity ng-tns-c564991203-74&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;pre _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-74&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-container formatted ng-tns-c564991203-74&quot; data-sourcepos=&quot;1172:9-1196:46&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt; requests

url = &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;https://api.github.com/users/octocat&quot;&lt;/span&gt; &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Example API returning JSON&lt;/span&gt;

&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;try&lt;/span&gt;:
    response = requests.get(url)
    response.raise_for_status() &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Check for HTTP errors&lt;/span&gt;

    &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Safely parse JSON response&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;if&lt;/span&gt; response.headers[&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;Content-Type&#39;&lt;/span&gt;].startswith(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;application/json&#39;&lt;/span&gt;):
        data = response.json()
        print(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Parsed JSON data:&quot;&lt;/span&gt;)
        print(data)
        print(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;User name: &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{data.get(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;name&#39;&lt;/span&gt;)}&lt;/span&gt;&quot;&lt;/span&gt;)
        print(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;Followers: &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{data.get(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;followers&#39;&lt;/span&gt;)}&lt;/span&gt;&quot;&lt;/span&gt;)
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;else&lt;/span&gt;:
        print(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Response is not JSON. Content-Type:&quot;&lt;/span&gt;, response.headers[&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;Content-Type&#39;&lt;/span&gt;])
        print(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Response text:&quot;&lt;/span&gt;, response.text)

&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;except&lt;/span&gt; requests.exceptions.RequestException &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;as&lt;/span&gt; e:
    print(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;Error fetching data: &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{e}&lt;/span&gt;&quot;&lt;/span&gt;)
&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;except&lt;/span&gt; ValueError &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;as&lt;/span&gt; e: &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Catch JSON decoding errors specifically&lt;/span&gt;
    print(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;Error decoding JSON: &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{e}&lt;/span&gt;&quot;&lt;/span&gt;)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;1198:5-1198:97&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;1198:7-1198:97&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; How would you send custom headers or query parameters with a &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;requests&lt;/code&gt; call?&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;1199:5-1241:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;1199:7-1199:17&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;1200:9-1241:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;1200:9-1218:15&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;1200:11-1200:113&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Custom Headers:&lt;/strong&gt; Use the &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;headers&lt;/code&gt; parameter, which expects a dictionary of header names and values.&lt;/p&gt;
&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block ng-tns-c564991203-75 ng-trigger ng-trigger-codeBlockRevealAnimation&quot; style=&quot;display: block; font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c564991203-75 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-75&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Python&lt;/span&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;buttons ng-tns-c564991203-75 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;button _ngcontent-ng-c564991203=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c564991203-75 mat-unthemed ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-focus-indicator&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c564991203-75&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;animated-opacity ng-tns-c564991203-75&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;pre _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-75&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-container formatted ng-tns-c564991203-75&quot; data-sourcepos=&quot;1202:13-1218:36&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt; requests

url = &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;https://api.example.com/data&quot;&lt;/span&gt;
custom_headers = {
    &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;User-Agent&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;MyPythonApp/1.0&quot;&lt;/span&gt;,
    &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;X-API-Key&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;your_secret_key_here&quot;&lt;/span&gt;,
    &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Accept-Language&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;en-US,en;q=0.9&quot;&lt;/span&gt;
}

&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;try&lt;/span&gt;:
    response = requests.get(url, headers=custom_headers)
    response.raise_for_status()
    print(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Response with custom headers:&quot;&lt;/span&gt;, response.json())
&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;except&lt;/span&gt; requests.exceptions.RequestException &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;as&lt;/span&gt; e:
    print(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;Error: &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{e}&lt;/span&gt;&quot;&lt;/span&gt;)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;1219:9-1241:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;1219:11-1219:179&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Query Parameters:&lt;/strong&gt; Use the &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;params&lt;/code&gt; parameter, which expects a dictionary or a list of tuples. &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;requests&lt;/code&gt; will automatically encode these into the URL&#39;s query string.&lt;/p&gt;
&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block ng-tns-c564991203-76 ng-trigger ng-trigger-codeBlockRevealAnimation&quot; style=&quot;display: block; font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c564991203-76 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-76&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Python&lt;/span&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;buttons ng-tns-c564991203-76 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;button _ngcontent-ng-c564991203=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c564991203-76 mat-unthemed ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-focus-indicator&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c564991203-76&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;animated-opacity ng-tns-c564991203-76&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;pre _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-76&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-container formatted ng-tns-c564991203-76&quot; data-sourcepos=&quot;1221:13-1240:36&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt; requests

base_url = &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;https://api.example.com/search&quot;&lt;/span&gt;
query_params = {
    &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;q&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;python api&quot;&lt;/span&gt;,
    &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;category&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;programming&quot;&lt;/span&gt;,
    &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;page&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;1&lt;/span&gt;,
    &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;sort_by&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;relevance&quot;&lt;/span&gt;
}

&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;try&lt;/span&gt;:
    &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# The URL will become: https://api.example.com/search?q=python+api&amp;amp;category=programming&amp;amp;page=1&amp;amp;sort_by=relevance&lt;/span&gt;
    response = requests.get(base_url, params=query_params)
    response.raise_for_status()
    print(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Response with query parameters:&quot;&lt;/span&gt;, response.url) &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Show the full URL&lt;/span&gt;
    print(response.json())
&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;except&lt;/span&gt; requests.exceptions.RequestException &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;as&lt;/span&gt; e:
    print(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;f&quot;Error: &lt;span class=&quot;hljs-subst&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;{e}&lt;/span&gt;&quot;&lt;/span&gt;)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;1242:1-1354:169&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;1242:5-1242:16&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Testing:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;1243:5-1354:169&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;1243:5-1243:125&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;1243:7-1243:125&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; How would you unit test an API endpoint in Python? What tools would you use (e.g., &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;unittest&lt;/code&gt;, &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;pytest&lt;/code&gt;)?&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;1244:5-1337:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;1244:7-1244:17&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;1245:9-1337:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;1245:9-1245:297&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;1245:11-1245:297&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Unit Testing an API Endpoint:&lt;/strong&gt; The goal is to test the individual function or method that handles the API request logic in isolation from external dependencies (like the actual HTTP server, database, or external APIs). We simulate the incoming request and check the returned response.&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;1246:9-1250:253&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;1246:11-1246:20&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Tools:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;1247:13-1250:253&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;1247:13-1247:95&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;unittest&lt;/code&gt; (Python&#39;s built-in testing framework):&lt;/strong&gt; Suitable for basic testing.&lt;/li&gt;&lt;li data-sourcepos=&quot;1248:13-1248:206&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;pytest&lt;/code&gt; (Popular third-party framework):&lt;/strong&gt; Highly recommended for its simplicity, powerful features (fixtures, parameterized tests, rich assertion failures), and extensive plugin ecosystem.&lt;/li&gt;&lt;li data-sourcepos=&quot;1249:13-1249:249&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Framework-specific Test Clients:&lt;/strong&gt; Flask, Django, FastAPI (via &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;httpx&lt;/code&gt;) all provide test clients that simulate HTTP requests without actually starting a server. This is crucial for efficient unit/integration testing of API endpoints.&lt;/li&gt;&lt;li data-sourcepos=&quot;1250:13-1250:253&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Mocking Libraries:&lt;/strong&gt; &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;unittest.mock&lt;/code&gt; (built-in), &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Mocker&lt;/code&gt; (Pytest plugin). Used to replace external dependencies (database calls, external API calls) with controlled mock objects so that the test focuses only on the API endpoint&#39;s logic.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;1251:9-1337:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;1251:11-1251:81&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Example (Flask API Endpoint with &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;pytest&lt;/code&gt; and Flask&#39;s Test Client):&lt;/strong&gt;&lt;/p&gt;
&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block ng-tns-c564991203-77 ng-trigger ng-trigger-codeBlockRevealAnimation&quot; style=&quot;display: block; font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-block-decoration header-formatted gds-title-s ng-tns-c564991203-77 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-77&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Python&lt;/span&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;buttons ng-tns-c564991203-77 ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;button _ngcontent-ng-c564991203=&quot;&quot; aria-label=&quot;Copy code&quot; class=&quot;mdc-icon-button mat-mdc-icon-button mat-mdc-button-base mat-mdc-tooltip-trigger copy-button ng-tns-c564991203-77 mat-unthemed ng-star-inserted&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;mat-mdc-button-persistent-ripple mdc-icon-button__ripple&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-focus-indicator&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mat-mdc-button-touch-target&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/div&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;formatted-code-block-internal-container ng-tns-c564991203-77&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;div _ngcontent-ng-c564991203=&quot;&quot; class=&quot;animated-opacity ng-tns-c564991203-77&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;pre _ngcontent-ng-c564991203=&quot;&quot; class=&quot;ng-tns-c564991203-77&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code _ngcontent-ng-c564991203=&quot;&quot; class=&quot;code-container formatted ng-tns-c564991203-77&quot; data-sourcepos=&quot;1253:13-1332:82&quot; data-test-id=&quot;code-content&quot; role=&quot;text&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# app.py (Your Flask application)&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt; flask &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt; Flask, jsonify, request

app = Flask(__name__)

&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# In a real app, this might interact with a database or service&lt;/span&gt;
&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;get_user_data&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;user_id&lt;/span&gt;):&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;if&lt;/span&gt; user_id == &lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;1&lt;/span&gt;:
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; {&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;id&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;name&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Alice&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;email&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;alice@example.com&quot;&lt;/span&gt;}
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;hljs-literal&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;None&lt;/span&gt;

&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;create_user_data&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;name, email&lt;/span&gt;):&lt;/span&gt;
    &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Simulate adding to DB&lt;/span&gt;
    new_user_id = &lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Dummy ID&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; {&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;id&quot;&lt;/span&gt;: new_user_id, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;name&quot;&lt;/span&gt;: name, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;email&quot;&lt;/span&gt;: email}

&lt;span class=&quot;hljs-meta&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;@app.route(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;/users/&amp;lt;int:user_id&amp;gt;&#39;&lt;/span&gt;, methods=[&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;GET&#39;&lt;/span&gt;]&lt;/span&gt;)&lt;/span&gt;
&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;get_user&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;user_id&lt;/span&gt;):&lt;/span&gt;
    user = get_user_data(user_id)
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;if&lt;/span&gt; user:
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; jsonify(user), &lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;200&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; jsonify({&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;message&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;User not found&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;}), &lt;/span&gt;&lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;404&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;hljs-meta&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;@app.route(&lt;/span&gt;&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;/users&#39;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;, methods=[&lt;/span&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;POST&#39;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;create_user&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;():&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
    data = request.get_json()
    &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;not&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; data &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;or&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;name&#39;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;not&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;in&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt; data &lt;/span&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;citation-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;or&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;citation-39 citation-end-39&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;/span&gt; &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;email&#39;&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;in&lt;/span&gt; data:
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; jsonify({&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;message&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Name and email are required&quot;&lt;/span&gt;}), &lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;400&lt;/span&gt;

    new_user = create_user_data(data[&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;name&#39;&lt;/span&gt;], data[&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;email&#39;&lt;/span&gt;])
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;return&lt;/span&gt; jsonify(new_user), &lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;201&lt;/span&gt;

&lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# test_app.py (Your pytest tests)&lt;/span&gt;
&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt; pytest
&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;from&lt;/span&gt; app &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;import&lt;/span&gt; app, get_user_data, create_user_data &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Import app and helper functions&lt;/span&gt;

&lt;span class=&quot;hljs-meta&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;@pytest.fixture&lt;/span&gt;
&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;client&lt;/span&gt;():&lt;/span&gt;
    &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Configure the Flask app for testing&lt;/span&gt;
    app.config[&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;TESTING&#39;&lt;/span&gt;] = &lt;span class=&quot;hljs-literal&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;True&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;with&lt;/span&gt; app.test_client() &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;as&lt;/span&gt; client:
        &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;yield&lt;/span&gt; client &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# This client is used to make requests to the app&lt;/span&gt;

&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;test_get_existing_user&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;client, mocker&lt;/span&gt;):&lt;/span&gt;
    &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Mock the external dependency (get_user_data) to control its behavior&lt;/span&gt;
    mocker.patch(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;app.get_user_data&#39;&lt;/span&gt;, return_value={&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;id&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;name&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;TestUser&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;email&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;test@example.com&quot;&lt;/span&gt;})

    response = client.get(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;/users/1&#39;&lt;/span&gt;) &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Simulate GET request&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;assert&lt;/span&gt; response.status_code == &lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;200&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;assert&lt;/span&gt; response.json == {&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;id&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;name&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;TestUser&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;email&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;test@example.com&quot;&lt;/span&gt;}

&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;test_get_non_existing_user&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;client, mocker&lt;/span&gt;):&lt;/span&gt;
    mocker.patch(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;app.get_user_data&#39;&lt;/span&gt;, return_value=&lt;span class=&quot;hljs-literal&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;None&lt;/span&gt;)

    response = client.get(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;/users/999&#39;&lt;/span&gt;)
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;assert&lt;/span&gt; response.status_code == &lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;404&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;assert&lt;/span&gt; response.json == {&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;message&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;User not found&quot;&lt;/span&gt;}

&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;test_create_user_success&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;client, mocker&lt;/span&gt;):&lt;/span&gt;
    mocker.patch(&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;app.create_user_data&#39;&lt;/span&gt;, return_value={&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;id&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;name&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;New User&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;email&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;new@example.com&quot;&lt;/span&gt;})

    &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Simulate POST request with JSON data&lt;/span&gt;
    response = client.post(
        &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;/users&#39;&lt;/span&gt;,
        json={&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;name&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;New User&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;email&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;new@example.com&quot;&lt;/span&gt;},
        content_type=&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;application/json&#39;&lt;/span&gt;
    )
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;assert&lt;/span&gt; response.status_code == &lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;201&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;assert&lt;/span&gt; response.json == {&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;id&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;name&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;New User&quot;&lt;/span&gt;, &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;email&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;new@example.com&quot;&lt;/span&gt;}

&lt;span class=&quot;hljs-function&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hljs-title&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;test_create_user_missing_data&lt;/span&gt;(&lt;span class=&quot;hljs-params&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;client&lt;/span&gt;):&lt;/span&gt;
    response = client.post(
        &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;/users&#39;&lt;/span&gt;,
        json={&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;name&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Only Name&quot;&lt;/span&gt;}, &lt;span class=&quot;hljs-comment&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;# Missing email&lt;/span&gt;
        content_type=&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&#39;application/json&#39;&lt;/span&gt;
    )
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;assert&lt;/span&gt; response.status_code == &lt;span class=&quot;hljs-number&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;400&lt;/span&gt;
    &lt;span class=&quot;hljs-keyword&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;assert&lt;/span&gt; response.json == {&lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;message&quot;&lt;/span&gt;: &lt;span class=&quot;hljs-string&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&quot;Name and email are required&quot;&lt;/span&gt;}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;ul data-sourcepos=&quot;1333:13-1337:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;1333:13-1337:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;To run these tests:&lt;/strong&gt;
&lt;ol data-sourcepos=&quot;1334:17-1337:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;1334:17-1334:58&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;pip install Flask pytest pytest-mock&lt;/code&gt;&lt;/li&gt;&lt;li data-sourcepos=&quot;1335:17-1335:74&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Save &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;app.py&lt;/code&gt; and &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;test_app.py&lt;/code&gt; in the same directory.&lt;/li&gt;&lt;li data-sourcepos=&quot;1336:17-1337:0&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Run &lt;code style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;pytest&lt;/code&gt; in your terminal from that directory.&lt;/li&gt;&lt;/ol&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;1338:5-1338:97&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;1338:7-1338:97&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Question:&lt;/strong&gt; What is the difference between unit testing and integration testing for APIs?&lt;/p&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;1339:5-1354:169&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;
&lt;p data-sourcepos=&quot;1339:7-1339:17&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Answer:&lt;/strong&gt;&lt;/p&gt;
&lt;ul data-sourcepos=&quot;1340:9-1354:169&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;1340:9-1345:272&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Unit Testing:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;1341:13-1345:272&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;1341:13-1341:154&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Focus:&lt;/strong&gt; Tests the smallest testable parts of an application (units), typically individual functions, methods, or classes, in &lt;em style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;isolation&lt;/em&gt;.&lt;/li&gt;&lt;li data-sourcepos=&quot;1342:13-1342:86&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Scope:&lt;/strong&gt; Verifies that each unit performs its specific task correctly.&lt;/li&gt;&lt;li data-sourcepos=&quot;1343:13-1343:220&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Dependencies:&lt;/strong&gt; External dependencies (databases, file systems, other APIs, network) are typically &lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;mocked&lt;/strong&gt; or &lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;stubbed&lt;/strong&gt; out. This means replacing real dependencies with controlled, simulated objects.&lt;/li&gt;&lt;li data-sourcepos=&quot;1344:13-1344:138&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Goal:&lt;/strong&gt; To ensure the internal logic of a component is sound, irrespective of how other components behave. Fast execution.&lt;/li&gt;&lt;li data-sourcepos=&quot;1345:13-1345:272&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;API Context:&lt;/strong&gt; Testing a single API endpoint handler function, making sure it processes input correctly, calls internal helper functions as expected, and formats its output, &lt;em style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;without&lt;/em&gt; actually hitting a database or sending an HTTP request over the network.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;1346:9-1351:381&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Integration Testing:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;1347:13-1351:381&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;1347:13-1347:105&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Focus:&lt;/strong&gt; Tests how different units or modules of an application work together as a group.&lt;/li&gt;&lt;li data-sourcepos=&quot;1348:13-1348:141&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Scope:&lt;/strong&gt; Verifies the interactions between components and ensures they integrate correctly to achieve a larger functionality.&lt;/li&gt;&lt;li data-sourcepos=&quot;1349:13-1349:328&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Dependencies:&lt;/strong&gt; Real dependencies are often used. For an API, this might mean connecting to a &lt;em style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;test&lt;/em&gt; database, or making calls to &lt;em style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;other internal services&lt;/em&gt;. External third-party APIs might still be mocked, but the API&#39;s own components (e.g., the web server, routing, database ORM, actual database) are connected.&lt;/li&gt;&lt;li data-sourcepos=&quot;1350:13-1350:124&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Goal:&lt;/strong&gt; To uncover defects that arise from the interaction between integrated units. Slower than unit tests.&lt;/li&gt;&lt;li data-sourcepos=&quot;1351:13-1351:381&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;API Context:&lt;/strong&gt; Making a real HTTP request to a running API endpoint (even if it&#39;s running in a test environment), checking if the request correctly hits the right route, interacts with the database (or other internal services), processes data, and returns the expected HTTP status code and response body. This verifies the &quot;flow&quot; through multiple layers of the API.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li data-sourcepos=&quot;1352:9-1354:169&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Analogy:&lt;/strong&gt;
&lt;ul data-sourcepos=&quot;1353:13-1354:169&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important; padding-inline-start: 32px;&quot;&gt;&lt;li data-sourcepos=&quot;1353:13-1353:163&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Unit Test:&lt;/strong&gt; Testing if a car engine&#39;s spark plugs generate a spark, the fuel pump delivers fuel, and the pistons move correctly, all in isolation.&lt;/li&gt;&lt;li data-sourcepos=&quot;1354:13-1354:169&quot; style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;&lt;strong style=&quot;font-family: Google Sans Text, sans-serif !important; line-height: 1.15 !important; margin-top: 0px !important;&quot;&gt;Integration Test:&lt;/strong&gt; Testing if the entire car engine starts and runs when you turn the key, verifying that all those individual components work together.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;

</content><link rel='replies' type='application/atom+xml' href='http://lertsirikarn.blogspot.com/feeds/5453609439778763527/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lertsirikarn.blogspot.com/2025/05/python-api-interview-questions-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/5453609439778763527'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/5453609439778763527'/><link rel='alternate' type='text/html' href='http://lertsirikarn.blogspot.com/2025/05/python-api-interview-questions-and.html' title='Python API interview questions and answers'/><author><name>saveMightLife</name><uri>http://www.blogger.com/profile/07139052104556306035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6898804038410932940.post-4836854695539532833</id><published>2025-05-21T20:33:00.001-07:00</published><updated>2025-05-21T20:33:10.369-07:00</updated><title type='text'>Analytical quantitative analysis interview practice questions for data engineer position interview </title><content type='html'>&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;These are some of the questions being ask about quantitative analysis during interview for Data Engineer position.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Analytical Questions:&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Question: Your company&#39;s website traffic has suddenly dropped by 20% week-over-week. As a Data Engineer, how would you approach investigating this issue? What data sources would you examine, and what metrics would you prioritize?&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;Solution:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Approach: Start by segmenting the traffic to identify if the drop is uniform across all sources, pages, or user types. Formulate hypotheses about potential causes (e.g., marketing campaign ended, website error, competitor activity, seasonal trend).&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Data Sources:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Web Analytics (e.g., Google Analytics, Adobe Analytics): Overall traffic, traffic sources (organic, paid, direct, referral), landing pages, user demographics, device types, user behavior (bounce rate, time on page).&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Marketing Data: Campaign performance, ad spend, email marketing metrics.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Server Logs: Error codes, latency issues.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Deployment Logs: Recent website changes or deployments.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* External Data: Competitor website traffic (if available), industry trends, news events.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Metrics:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Overall Traffic: Week-over-week, day-over-day changes.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Traffic by Source: Identify if a specific channel is underperforming.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Traffic by Landing Page: See if specific pages are experiencing a drop.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Conversion Rates: Check if the drop in traffic is accompanied by a drop in conversions.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Bounce Rate: A sudden increase might indicate website issues.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Error Rates (Server Logs): Identify any server-side problems.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Investigation Steps:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Verify data accuracy and reporting delays.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Segment traffic by source, page, and user type.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Correlate the drop with any recent website changes or marketing activities.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Analyze user behavior metrics for anomalies.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Check server logs for errors.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Compare with historical data and industry trends.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Question: You have two tables: Orders (order_id, user_id, order_date, amount) and Users (user_id, registration_date, country). How would you determine the average order amount for users who registered in the last quarter, broken down by country? Describe the steps involved in joining the tables and calculating the metric.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;Solution:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* SQL Query:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;SELECT&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; u.country,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; AVG(o.amount) AS average_order_amount&lt;/div&gt;&lt;div&gt;FROM&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; Orders o&lt;/div&gt;&lt;div&gt;JOIN&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; Users u ON o.user_id = u.user_id&lt;/div&gt;&lt;div&gt;WHERE&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; u.registration_date &amp;gt;= DATE(&#39;now&#39;, &#39;-3 months&#39;) -- Assuming &#39;now&#39; is the current date&lt;/div&gt;&lt;div&gt;GROUP BY&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; u.country;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Steps:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Join Tables: Join the Orders and Users tables on the common user_id column.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Filter by Registration Date: Filter the joined data to include only users whose registration_date is within the last three months. The exact date function might vary depending on the SQL dialect.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Group by Country: Group the filtered data by the country column from the Users table.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Calculate Average: Calculate the average of the amount column from the Orders table for each group using the AVG() aggregate function.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Select Results: Select the country and the calculated average_order_amount.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Question: Describe a time when you had to troubleshoot a complex data pipeline issue. What were the key challenges, how did you approach the problem, and what was the resolution?&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;Solution:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* This is open-ended, so the key is to describe a structured approach:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Understand the System: Start by understanding the pipeline&#39;s architecture, components, and data flow.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Identify the Point of Failure: Use monitoring tools, logs, and error messages to pinpoint where the pipeline is failing.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Isolate the Issue: Try to reproduce the error in a smaller environment or with a subset of data.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Examine Logs and Metrics: Analyze logs for specific error messages, stack traces, and relevant timestamps. Monitor resource utilization (CPU, memory, network) of the components involved.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Check Dependencies: Investigate if any upstream or downstream systems are contributing to the problem.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Review Code and Configurations: Examine the code and configurations of the failing component for potential bugs or incorrect settings.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Test Hypotheses: Formulate hypotheses about the root cause and test them systematically.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Implement Fixes: Once the root cause is identified, implement the necessary fixes.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Monitor and Validate: After the fix, monitor the pipeline to ensure it&#39;s running correctly and validate the data output.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Document the Issue and Resolution: Document the problem, the troubleshooting steps, and the final solution for future reference.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Question: Your team needs to choose between two data storage solutions: one is cost-effective but has higher latency for analytical queries, and the other is more expensive but offers low latency. What factors would you consider in making this decision, and how would you weigh the trade-offs?&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;Solution:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Factors to Consider:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Query Latency Requirements: How quickly do analytical queries need to return results?&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Data Volume and Growth: How much data is currently stored and how rapidly is it growing?&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Concurrency: How many users or processes will be querying the data simultaneously?&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Budget: What is the cost difference between the two solutions?&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Maintenance Overhead: How much effort is required to manage and maintain each solution?&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Scalability: How easily can each solution scale to accommodate future growth?&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Data Complexity and Query Patterns: Are the queries simple or complex? Do they involve joins, aggregations, etc.?&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Existing Infrastructure and Skills: Does the team have experience with either of the solutions?&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Weighing Trade-offs:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* If low latency is critical for real-time dashboards or time-sensitive analysis and the budget allows, the more expensive solution might be justified.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* If cost is a major constraint and the latency requirements for most analytical queries are not extremely strict, the cost-effective solution might be acceptable, especially if optimizations can mitigate some latency issues.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* A hybrid approach might be possible, where frequently accessed or critical data is stored in the low-latency solution, and less frequently used data resides in the cost-effective option.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Consider the long-term implications of each choice on scalability and maintainability.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Question: How would you design a system to monitor and ensure the quality of incoming data from various sources? What types of data quality checks would you implement, and how would you handle data quality issues?&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;Solution:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Design: Implement a data quality framework that includes:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Data Profiling: Analyze the structure, content, and relationships within the data to understand its characteristics and identify potential issues.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Data Quality Rules: Define specific rules and constraints based on business requirements and data understanding (e.g., data type validation, range checks, uniqueness constraints, referential integrity).&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Automated Checks: Implement automated processes to continuously monitor data against the defined rules.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Alerting and Notifications: Set up alerts to notify relevant teams when data quality issues are detected.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Data Quality Dashboards: Create dashboards to visualize data quality metrics and trends.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Issue Tracking and Resolution: Establish a process for investigating, resolving, and documenting data quality issues.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Types of Checks:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Completeness: Ensuring all required fields are populated.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Accuracy: Verifying data against known correct values or external sources.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Consistency: Ensuring data is consistent across different systems and datasets.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Validity: Checking if data conforms to defined formats and data types.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Uniqueness: Identifying duplicate records.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Timeliness: Ensuring data is available when expected.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Referential Integrity: Verifying relationships between tables (e.g., foreign key constraints).&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Handling Issues:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Isolation: Identify the source of the data quality issue.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Quarantine: Move problematic data to a separate area for investigation.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Correction: Implement processes to cleanse or correct the erroneous data (if possible).&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Prevention: Identify the root cause of the issue and implement measures to prevent it from recurring.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Communication: Keep stakeholders informed about data quality issues and their resolution.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Question: Your company is experiencing rapid growth, and the current data infrastructure is struggling to keep up with the increasing data volume and query load. How would you approach scaling the data pipelines and storage systems? What are some potential bottlenecks and solutions?&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;Solution:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Potential Bottlenecks:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Data Ingestion: The rate at which data can be ingested into the system.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Data Storage: Capacity limits, read/write performance limitations of the storage system.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Data Processing: Computational limitations of the processing engines.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Query Performance: Slow query execution times due to large data volumes or inefficient queries.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Network Bandwidth: Limitations in transferring large datasets.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Solutions:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Horizontal Scaling: Adding more nodes (servers, instances) to distribute the workload.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Vertical Scaling: Increasing the resources (CPU, memory, storage) of existing nodes.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Distributed Computing: Utilizing frameworks like Spark or Dask for parallel processing.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Cloud-Based Solutions: Leveraging the scalability and elasticity of cloud platforms.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Data Partitioning and Sharding: Dividing large datasets into smaller, more manageable parts.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Data Compression: Reducing the storage footprint of data.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Caching: Storing frequently accessed data in faster storage layers.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Query Optimization: Tuning SQL queries and data models for better performance.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Asynchronous Processing: Decoupling processes to improve responsiveness and handle backlogs.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Choosing the Right Technologies: Selecting technologies that are designed for scalability (e.g., NoSQL databases, distributed message queues).&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Question: Explain the difference between a star schema and a snowflake schema in data warehousing. What are the advantages and disadvantages of each, and when would you choose one over the other?&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;Solution:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Star Schema:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Structure: Consists of one or more dimension tables surrounding a central fact table. Dimension tables are denormalized (fewer joins needed).&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Advantages: Simpler query structure, faster query performance (due to fewer joins), easier to understand and implement.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Disadvantages: Data redundancy (dimension attributes may be repeated across multiple rows).&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* When to Use: Suitable for simpler analytical queries and when query performance is a high priority.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Snowflake Schema:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Structure: Dimension tables are normalized into multiple related tables, forming a snowflake-like structure.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Advantages: Reduced data redundancy, improved data integrity.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Disadvantages: More complex query structure (requires more joins), potentially slower query performance compared to a star schema.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* When to Use: Suitable for complex analytical queries where data integrity and reduced redundancy are more critical, and storage space is a major concern.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Question: You have a SQL query that is taking a very long time to execute. What are some common techniques you would use to identify the performance bottleneck and optimize the query?&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;Solution:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Techniques:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* EXPLAIN Plan: Analyze the query execution plan to identify bottlenecks (e.g., full table scans, missing indexes).&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Indexing: Add appropriate indexes to columns frequently used in WHERE clauses, JOIN conditions, and ORDER BY clauses. Consider the types of indexes (B-tree, hash, etc.).&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Optimize JOINs: Ensure efficient join conditions and consider the order of tables in joins. Avoid unnecessary joins.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* WHERE Clause Optimization: Filter data as early as possible in the query. Use specific conditions instead of LIKE &#39;%value%&#39; if possible.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Avoid SELECT*: Only select the columns you need.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Optimize Subqueries: Rewrite subqueries as joins or use common table expressions (CTEs) for better readability and performance.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Data Type Considerations: Use appropriate data types to minimize storage and improve comparison speed.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Database Statistics: Ensure the database has up-to-date statistics on the data for the query optimizer to make informed decisions.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Partitioning: For very large tables, consider partitioning the data based on a relevant column (e.g., date).&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Caching: Implement caching mechanisms for frequently executed queries or results.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Question: How would you approach implementing data governance policies within a data engineering team? What are some key considerations and challenges?&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;Solution:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Key Considerations:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Stakeholder Involvement: Identify and involve key stakeholders from different business units.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Defining Roles and Responsibilities: Clearly define who is responsible for data quality, security, and compliance.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Data Policies and Standards: Establish clear policies and standards for data collection, storage, processing, and usage.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Data Catalog: Create a central repository of metadata to understand the available data assets.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Data Lineage: Track the origin and movement of data through the systems.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Data Security and Privacy: Implement measures to protect sensitive data and comply with relevant regulations.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Data Quality Management: Establish processes for monitoring, measuring, and improving data quality.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Training and Awareness: Educate users about data governance policies and best practices.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Continuous Improvement: Regularly review and update data governance policies and processes.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Challenges:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Organizational Resistance: Overcoming resistance to new processes and responsibilities.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Data Silos: Integrating data from disparate systems.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Evolving Regulations: Keeping up with changing data privacy and security requirements.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Maintaining Data Quality at Scale: Ensuring data quality across large and complex data environments.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Getting Buy-in from Leadership: Securing executive support and resources for data governance initiatives.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Question: Describe a scenario where real-time data processing is crucial. How would you design a system to ingest, process, and analyze streaming data? What technologies might you consider?&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;Solution:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Scenario: Fraud detection in online transactions. Immediate analysis of transaction details is crucial to identify and prevent fraudulent activities before they are completed.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Design:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Data Ingestion: Use a distributed message queue (e.g., Kafka, Kinesis) to ingest streaming transaction data in real-time.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Stream Processing Engine: Employ a stream processing engine (e.g., Apache Flink, Apache Spark Streaming, Kafka Streams) to process the incoming data continuously.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Feature Engineering: Extract relevant features from the transaction data on the fly (e.g., transaction amount, location, user history, device information).&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Fraud Detection Model: Integrate a pre-trained or continuously learning fraud detection model into the stream processing pipeline.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Alerting and Action: Trigger alerts in real-time when a potentially fraudulent transaction is detected. This could involve blocking the transaction, notifying a fraud analyst, or requiring additional verification.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Data Storage: Persist the raw and processed data in appropriate storage systems (e.g., data lake for historical analysis, low-latency database for recent transactions and model features).&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Technologies: Kafka/Kinesis, Flink/Spark Streaming/Kafka Streams, machine learning models (e.g., logistic regression, random forests, neural networks), alerting systems, databases (e.g., Cassandra, Redis).&lt;/div&gt;&lt;div&gt;Quantitative Analysis Questions:&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Question: Write a SQL query to find the top 5 users with the highest total order amount from the Orders table (order_id, user_id, amount).&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;Solution:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;SELECT&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; user_id,&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; SUM(amount) AS total_order_amount&lt;/div&gt;&lt;div&gt;FROM&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; Orders&lt;/div&gt;&lt;div&gt;GROUP BY&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; user_id&lt;/div&gt;&lt;div&gt;ORDER BY&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; total_order_amount DESC&lt;/div&gt;&lt;div&gt;LIMIT 5;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Question: If the daily active users (DAU) of your application increased from 10,000 on Monday to 12,500 on Tuesday, what is the percentage increase in DAU?&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;Solution:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Percentage Increase = \frac{\text{New Value} - \text{Old Value}}{\text{Old Value}} \times 100\%&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Percentage Increase = \frac{12500 - 10000}{10000} \times 100\% = \frac{2500}{10000} \times 100\% = 0.25 \times 100\% = 25\%&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* The daily active users increased by 25%.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Question: Given a table of website sessions with a column for session duration in seconds, write a SQL query to calculate the average session duration in minutes.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;Solution:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;SELECT&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; AVG(session_duration_seconds) / 60 AS average_session_duration_minutes&lt;/div&gt;&lt;div&gt;FROM&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; website_sessions;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Question: If a data pipeline processes 1 million records in 10 minutes, what is the processing rate in records per second?&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;Solution:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Processing Rate = \frac{\text{Number of Records}}{\text{Time}}&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Processing Rate = $\frac{1,000,&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lertsirikarn.blogspot.com/feeds/4836854695539532833/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lertsirikarn.blogspot.com/2025/05/analytical-quantitative-analysis.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/4836854695539532833'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/4836854695539532833'/><link rel='alternate' type='text/html' href='http://lertsirikarn.blogspot.com/2025/05/analytical-quantitative-analysis.html' title='Analytical quantitative analysis interview practice questions for data engineer position interview '/><author><name>saveMightLife</name><uri>http://www.blogger.com/profile/07139052104556306035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6898804038410932940.post-450019041846209160</id><published>2025-05-18T02:47:00.000-07:00</published><updated>2025-05-18T02:48:43.300-07:00</updated><title type='text'>FIXING ERROR WHILE TRAINING VOCODER MODEL:  Target loss not found in the keep_avg_target. You might be exiting the training loop before it is computed or set the target_loss in the model config incorrectly.</title><content type='html'>&lt;p&gt;&amp;nbsp;I recently ran into this error while training &lt;span style=&quot;color: black;&quot;&gt;Univnet and &lt;/span&gt;&lt;span face=&quot;-apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #1f2328; display: inline; float: none; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;MultibandMelgan vocoder.&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;h4 class=&quot;output_subarea output_text collapsed&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #1f1f1f; display: inline; font-family: Roboto, Noto, sans-serif; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;pre style=&quot;display: inline; margin-bottom: 0px; margin-top: 0px; text-align: left; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;color: darkred; font-weight: 400;&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;font-weight: 400;&quot;&gt;:  [!] Target loss not found in the keep_avg_target. You might be exiting the training loop before it is computed or set the target_loss in the model config incorrectly.&lt;/span&gt;&lt;/pre&gt;&lt;/h4&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;h4 class=&quot;output_subarea output_text collapsed&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #1f1f1f; display: inline; font-family: Roboto, Noto, sans-serif; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;pre style=&quot;display: inline; margin-bottom: 0px; margin-top: 0px; text-align: left; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-weight: 400;&quot;&gt;This &lt;/span&gt;error in UnivNet and MultibandMelGAN arises because the default &lt;code&gt;target_loss&lt;/code&gt; is set to &lt;code&gt;&#39;loss_0&#39;&lt;/code&gt;, which represents the discriminator loss. However, the discriminator is not activated until &lt;code&gt;steps_to_start_discriminator&lt;/code&gt; (defaulting to 200,000), meaning &lt;code&gt;loss_0&lt;/code&gt; is unavailable during the initial training phase. Consequently, the training process cannot find the specified target loss. Setting &lt;code&gt;target_loss=&#39;loss_1&#39;&lt;/code&gt; resolves this issue by instructing the training to track the generator loss (&lt;code&gt;loss_1&lt;/code&gt;), which is active from the beginning of training, thus ensuring a valid target loss is always available, even before the discriminator starts contributing to the learning process.&lt;span style=&quot;font-weight: 400;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;/h4&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;output_subarea output_text collapsed&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #1f1f1f; display: inline; font-family: Roboto, Noto, sans-serif; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;pre style=&quot;display: inline; margin-bottom: 0px; margin-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-weight: 400;&quot;&gt;This is the code to do the vocoder training for coqui/TTS,&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;output_subarea output_text collapsed&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #1f1f1f; display: inline; font-family: Roboto, Noto, sans-serif; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;pre style=&quot;display: inline; margin-bottom: 0px; margin-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-weight: 400;&quot;&gt;Maker sure you have this line: &lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;target_loss=&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&#39;loss_1&#39;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: 400;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;output_subarea output_text collapsed&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #1f1f1f; display: inline; font-family: Roboto, Noto, sans-serif; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div style=&quot;background-color: #f7f7f7; color: black; font-family: monospace, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 14px; font-weight: normal; line-height: 19px; white-space: pre;&quot;&gt;&lt;div&gt;&lt;span style=&quot;color: #9723b4;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; os&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #9723b4;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; trainer &lt;/span&gt;&lt;span style=&quot;color: #9723b4;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; Trainer, TrainerArgs&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: #9723b4;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; TTS.utils.audio &lt;/span&gt;&lt;span style=&quot;color: #9723b4;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; AudioProcessor&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #9723b4;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; TTS.vocoder.configs &lt;/span&gt;&lt;span style=&quot;color: #9723b4;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; UnivnetConfig&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #9723b4;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; TTS.vocoder.datasets.preprocess &lt;/span&gt;&lt;span style=&quot;color: #9723b4;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; load_wav_data&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #9723b4;&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; TTS.vocoder.models.gan &lt;/span&gt;&lt;span style=&quot;color: #9723b4;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; GAN&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;output_path = &lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;/content/drive/MyDrive/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;vocoder_train_run&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #9723b4;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;not&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; os.path.exists(output_path):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; os.makedirs(output_path)&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;#output_path = os.path.dirname(os.path.abspath(__file__))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;config = UnivnetConfig(&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; batch_size=&lt;/span&gt;&lt;span style=&quot;color: #116644;&quot;&gt;64&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; eval_batch_size=&lt;/span&gt;&lt;span style=&quot;color: #116644;&quot;&gt;16&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; num_loader_workers=&lt;/span&gt;&lt;span style=&quot;color: #116644;&quot;&gt;4&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; num_eval_loader_workers=&lt;/span&gt;&lt;span style=&quot;color: #116644;&quot;&gt;4&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; run_eval=&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;True&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; test_delay_epochs=&lt;/span&gt;&lt;span style=&quot;color: #116644;&quot;&gt;-1&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; epochs=&lt;/span&gt;&lt;span style=&quot;color: #116644;&quot;&gt;1000&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; seq_len=&lt;/span&gt;&lt;span style=&quot;color: #116644;&quot;&gt;8192&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; pad_short=&lt;/span&gt;&lt;span style=&quot;color: #116644;&quot;&gt;2000&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; use_noise_augment=&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;True&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; eval_split_size=&lt;/span&gt;&lt;span style=&quot;color: #116644;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; print_step=&lt;/span&gt;&lt;span style=&quot;color: #116644;&quot;&gt;25&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; print_eval=&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;False&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; mixed_precision=&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;False&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; lr_gen=&lt;/span&gt;&lt;span style=&quot;color: #116644;&quot;&gt;1e-4&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; lr_disc=&lt;/span&gt;&lt;span style=&quot;color: #116644;&quot;&gt;1e-4&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; data_path=dataset_config.path,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; output_path=output_path,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; target_loss=&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&#39;loss_1&#39;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;#####&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;# init audio processor&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;ap = AudioProcessor(**config.audio.to_dict())&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;# load training samples&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;eval_samples, train_samples = load_wav_data(config.data_path, config.eval_split_size)&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;# init model&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;model = GAN(config, ap)&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: green;&quot;&gt;# init the trainer&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;trainer = Trainer(&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; TrainerArgs(), config, output_path, model=model, train_samples=train_samples, eval_samples=eval_samples&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;trainer.fit()&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style=&quot;display: inline; margin-bottom: 0px; margin-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-weight: 400;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;output_subarea output_text collapsed&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #1f1f1f; display: inline; font-family: Roboto, Noto, sans-serif; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;pre style=&quot;display: inline; margin-bottom: 0px; margin-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-weight: 400;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;output_subarea output_text collapsed&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #1f1f1f; display: inline; font-family: Roboto, Noto, sans-serif; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;pre style=&quot;display: inline; margin-bottom: 0px; margin-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-weight: 400;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;output_subarea output_text collapsed&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #1f1f1f; display: inline; font-family: Roboto, Noto, sans-serif; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;pre style=&quot;display: inline; margin-bottom: 0px; margin-top: 0px; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-weight: 400;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br class=&quot;Apple-interchange-newline&quot; /&gt;&lt;p&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://lertsirikarn.blogspot.com/feeds/450019041846209160/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lertsirikarn.blogspot.com/2025/05/fixing-error-while-training-vocoder.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/450019041846209160'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/450019041846209160'/><link rel='alternate' type='text/html' href='http://lertsirikarn.blogspot.com/2025/05/fixing-error-while-training-vocoder.html' title='FIXING ERROR WHILE TRAINING VOCODER MODEL:  Target loss not found in the keep_avg_target. You might be exiting the training loop before it is computed or set the target_loss in the model config incorrectly.'/><author><name>saveMightLife</name><uri>http://www.blogger.com/profile/07139052104556306035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6898804038410932940.post-2761230364916339163</id><published>2025-03-23T13:53:00.001-07:00</published><updated>2025-03-23T13:53:10.857-07:00</updated><title type='text'>Paris Baguette coupon code 2025</title><content type='html'>&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Use my code datle6d4543 when you sign up for the Paris Baguette app! Use this link to download: &lt;a href=&quot;https://engagement.punchh.com/b/parisbaguette&quot;&gt;https://engagement.punchh.com/b/parisbaguette&lt;/a&gt;&lt;/div&gt;&lt;div&gt;After signing up you will get free pastry with first purchase.&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEh6h09rU_PEo2UccRWNILMW7Nk33ofiIqIYF9N-6zoQVu8y87L0qq2eki3rzaQLvjZGC1ps9sxDRm9f-meWXhjEqgP6KaNDJoq05W_YUbJrwOTf8kW-aKiRrc1sDkmJa2kWPVduO03YADkUwWl64wogwGXq9Ep5owqDCDgeS3m1vEZiht0j8fcJINpIfm2s&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;
    &lt;img border=&quot;0&quot;   src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEh6h09rU_PEo2UccRWNILMW7Nk33ofiIqIYF9N-6zoQVu8y87L0qq2eki3rzaQLvjZGC1ps9sxDRm9f-meWXhjEqgP6KaNDJoq05W_YUbJrwOTf8kW-aKiRrc1sDkmJa2kWPVduO03YADkUwWl64wogwGXq9Ep5owqDCDgeS3m1vEZiht0j8fcJINpIfm2s&quot; width=&quot;400&quot;&gt;
  &lt;/a&gt;
&lt;/div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;You can also use this code for online and app order: WelcomePastry&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lertsirikarn.blogspot.com/feeds/2761230364916339163/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lertsirikarn.blogspot.com/2025/03/paris-baguette-coupon-code-2025.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/2761230364916339163'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/2761230364916339163'/><link rel='alternate' type='text/html' href='http://lertsirikarn.blogspot.com/2025/03/paris-baguette-coupon-code-2025.html' title='Paris Baguette coupon code 2025'/><author><name>saveMightLife</name><uri>http://www.blogger.com/profile/07139052104556306035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEh6h09rU_PEo2UccRWNILMW7Nk33ofiIqIYF9N-6zoQVu8y87L0qq2eki3rzaQLvjZGC1ps9sxDRm9f-meWXhjEqgP6KaNDJoq05W_YUbJrwOTf8kW-aKiRrc1sDkmJa2kWPVduO03YADkUwWl64wogwGXq9Ep5owqDCDgeS3m1vEZiht0j8fcJINpIfm2s=s72-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6898804038410932940.post-9195157333576706716</id><published>2025-03-21T06:36:00.001-07:00</published><updated>2025-03-21T06:37:23.187-07:00</updated><title type='text'>How to Drive without having to pay for gas and make some extra money</title><content type='html'>&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;UberEats has a new feature, now you can set destination of where you&#39;re going and then it will only give you orders that will be going in that direction.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEh8KgGmUg4MPIRzxk6Do9lWqPRN57ebiZiLOF3UL_9U0L9SdAcA8XFQ2_JMZmpN3lCXci3IqEkNXAQmunplsDQWJgCy4OOIJCeab9aFNZtwL5Wi9-HjB_DTfEHpzzeDqGVnjie4TA026u1W4SqUCKZxsHMPVxpEGdj8n31ZIvzg2i_XXnK1OFDpmpnvzR0O&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;
    &lt;img border=&quot;0&quot;   src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEh8KgGmUg4MPIRzxk6Do9lWqPRN57ebiZiLOF3UL_9U0L9SdAcA8XFQ2_JMZmpN3lCXci3IqEkNXAQmunplsDQWJgCy4OOIJCeab9aFNZtwL5Wi9-HjB_DTfEHpzzeDqGVnjie4TA026u1W4SqUCKZxsHMPVxpEGdj8n31ZIvzg2i_XXnK1OFDpmpnvzR0O&quot; width=&quot;400&quot;&gt;
  &lt;/a&gt;
&lt;/div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Sign up to drive for Ubereats using the link below&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;a href=&quot;https://www.uber.com/signup/drive/deliver/?invite_code=jx7m141&quot;&gt;https://www.uber.com/signup/drive/deliver/?invite_code=jx7m141&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;The &quot;filter direction&quot; feature in the Uber driver app, also known as the &quot;destination filter,&quot; is designed to help drivers receive trip requests that are generally in the direction of a specific location they want to go.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEg9Uv4K5E6zE-Afl-knOpLXtDU1mTXXUXrMOXsT4MGu6_KrZcu3eMy9OMnIYK4YQxvW7d0qud38-qk2YUYO3aWw4-eh4JGeT7YEQCEkhvhd_blRrY7XW5L4dmGF51wOQpkn4Jt7j3tKKHfeWbzAzNUkmo6e3pbXeSM9MMWpNG64wJQigKHkx3pIgk82YdQn&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;
    &lt;img border=&quot;0&quot;   src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEg9Uv4K5E6zE-Afl-knOpLXtDU1mTXXUXrMOXsT4MGu6_KrZcu3eMy9OMnIYK4YQxvW7d0qud38-qk2YUYO3aWw4-eh4JGeT7YEQCEkhvhd_blRrY7XW5L4dmGF51wOQpkn4Jt7j3tKKHfeWbzAzNUkmo6e3pbXeSM9MMWpNG64wJQigKHkx3pIgk82YdQn&quot; width=&quot;400&quot;&gt;
  &lt;/a&gt;
&lt;/div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Here&#39;s a breakdown of how to use it:&lt;/div&gt;&lt;div&gt;Key Points:&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Purpose:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* It allows drivers to aim for trips that move them closer to their desired destination, like home or another specific location.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Limitations:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* It&#39;s important to understand that the app doesn&#39;t guarantee perfectly aligned trips. The drop-off location should be closer to your destination, but the pick-up may not be directly on your route.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Uber typically limits the number of times you can use this feature per day.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;* How to Use It:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Access the Filter:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Open the Uber driver app.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Look for and tap the magnifying glass icon, usually located at the top of the screen.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Set Your Destination:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Enter the address of your desired destination in the search field.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Activate the Filter:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* There will be a toggle switch for the &quot;Destination Filter.&quot; Ensure it&#39;s turned on.&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Go Online:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* If you&#39;re offline, go online. The app will then attempt to match you with trips that fit your direction.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp;* Understanding the Results:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* The app will try to provide trip requests where the drop-off point is closer to your inputted destination.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Important Considerations:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Using the destination filter might reduce the number of trip requests you receive, especially during periods of low demand.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* It is important to remember that this feature is to help guide you in a general direction, and not to provide exact trip matching.&lt;/div&gt;&lt;div&gt;I hope this helps!&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lertsirikarn.blogspot.com/feeds/9195157333576706716/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lertsirikarn.blogspot.com/2025/03/how-to-drive-without-having-pay-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/9195157333576706716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/9195157333576706716'/><link rel='alternate' type='text/html' href='http://lertsirikarn.blogspot.com/2025/03/how-to-drive-without-having-pay-for.html' title='How to Drive without having to pay for gas and make some extra money'/><author><name>saveMightLife</name><uri>http://www.blogger.com/profile/07139052104556306035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEh8KgGmUg4MPIRzxk6Do9lWqPRN57ebiZiLOF3UL_9U0L9SdAcA8XFQ2_JMZmpN3lCXci3IqEkNXAQmunplsDQWJgCy4OOIJCeab9aFNZtwL5Wi9-HjB_DTfEHpzzeDqGVnjie4TA026u1W4SqUCKZxsHMPVxpEGdj8n31ZIvzg2i_XXnK1OFDpmpnvzR0O=s72-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6898804038410932940.post-2071234626081072794</id><published>2025-02-15T21:24:00.001-08:00</published><updated>2025-03-08T13:45:26.649-08:00</updated><title type='text'>TikTok shop new user 8 dollars coupon March 2025</title><content type='html'>New TikTok shop referral program for March 2025.&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;TikTok shop referral program is back.&amp;nbsp;&lt;div&gt;Use the link below to get 8 dollars coupon when you sign up for TikTok shop as new user.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Tap to get your TikTok Shop coupon:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://www.tiktok.com/t/ZP8Y9tHhB/&quot;&gt;&amp;nbsp;https://www.tiktok.com/t/ZP8Y9tHhB/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Expired on March 11th 2025&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lertsirikarn.blogspot.com/feeds/2071234626081072794/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lertsirikarn.blogspot.com/2025/02/tiktok-shop-new-user-8-dollars-coupon.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/2071234626081072794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/2071234626081072794'/><link rel='alternate' type='text/html' href='http://lertsirikarn.blogspot.com/2025/02/tiktok-shop-new-user-8-dollars-coupon.html' title='TikTok shop new user 8 dollars coupon March 2025'/><author><name>saveMightLife</name><uri>http://www.blogger.com/profile/07139052104556306035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6898804038410932940.post-2985363127866233075</id><published>2025-02-12T14:25:00.001-08:00</published><updated>2025-02-12T14:25:28.779-08:00</updated><title type='text'>Supercharge Your Savings with TopCashback</title><content type='html'>&lt;br&gt;&lt;div&gt;Want to save money effortlessly?  Discover TopCashback.com! This free platform lets you earn cashback on purchases you already make.  Partnering with thousands of retailers, TopCashback offers high cashback rates and a user-friendly experience.&lt;/div&gt;&lt;div&gt;How it Works:&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Join Free: Sign up at &lt;a href=&quot;http://www.topcashback.com/ref/savemightlife&quot;&gt;TopCashback.com&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Shop Through TopCashback: Click retailer links on TopCashback before shopping.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Earn Cashback:  Get money back on your purchases!&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Cash Out: Choose your payout method.&lt;/div&gt;&lt;div&gt;Why TopCashback?&lt;/div&gt;&lt;div&gt;&amp;nbsp;* High Rates: Maximize your savings.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Tons of Retailers: Find your favorites.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Easy to Use: Simple and intuitive.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Free to Join: No costs involved.&lt;/div&gt;&lt;div&gt;Start saving today!  Join TopCashback via my link: &lt;a href=&quot;http://www.topcashback.com/ref/savemightlife&quot;&gt;http://www.topcashback.com/ref/savemightlife&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lertsirikarn.blogspot.com/feeds/2985363127866233075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lertsirikarn.blogspot.com/2025/02/supercharge-your-savings-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/2985363127866233075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/2985363127866233075'/><link rel='alternate' type='text/html' href='http://lertsirikarn.blogspot.com/2025/02/supercharge-your-savings-with.html' title='Supercharge Your Savings with TopCashback'/><author><name>saveMightLife</name><uri>http://www.blogger.com/profile/07139052104556306035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6898804038410932940.post-3846159810339335029</id><published>2025-02-11T21:04:00.001-08:00</published><updated>2025-02-11T21:04:51.375-08:00</updated><title type='text'>Unlock the Secrets to Savings with RebatesMe.com</title><content type='html'>&lt;br&gt;&lt;div&gt;How Does it Work?&lt;/div&gt;&lt;div&gt;The process is incredibly straightforward:&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Sign Up (It&#39;s Free!):  Creating an account on RebatesMe is quick and easy.  Simply visit RebatesMe.com and sign up for free. &lt;a href=&quot;https://www.rebatesme.com?referCode=G6FVNV&quot;&gt;https://www.rebatesme.com?referCode=G6FVNV&lt;/a&gt;&lt;/div&gt;&lt;div&gt;Using a referral link often comes with extra perks, so don&#39;t miss out!&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Browse and Shop:  Once you&#39;re a member, you can browse the extensive list of participating retailers.  The platform is user-friendly, allowing you to search for specific stores or browse by category.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Activate the Rebate:  Found a store you want to shop at?  Simply click on the retailer link through RebatesMe to activate the rebate.  This directs you to the retailer&#39;s website, where you can shop as you normally would.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Earn Cash Back:  After you make a purchase, the corresponding rebate amount will be automatically tracked in your RebatesMe account.  The amount you earn varies depending on the retailer and the offer.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Get Paid! Once your rebates are confirmed, you can choose from various payout options, such as PayPal, check, or direct deposit.&lt;/div&gt;&lt;div&gt;Why Choose RebatesMe?&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Huge Selection: The sheer number of participating retailers ensures you&#39;ll likely find rebates for your favorite stores.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Easy to Use: The platform is intuitive and easy to navigate, making earning cash back a breeze.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Automatic Tracking: No need to worry about clipping coupons or submitting forms. RebatesMe automatically tracks your eligible purchases.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Multiple Payout Options: Choose the payout method that works best for you.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Free to Join:  There&#39;s absolutely no cost to become a member of RebatesMe.&lt;/div&gt;&lt;div&gt;Beyond the Basics:&lt;/div&gt;&lt;div&gt;RebatesMe often features exclusive deals and promotions, boosting your earning potential even further.  Keep an eye out for special offers and higher rebate percentages to maximize your savings.&lt;/div&gt;&lt;div&gt;Stop leaving money on the table!  Join RebatesMe today and start earning cash back on your everyday purchases.  It&#39;s a smart and simple way to save money without changing your shopping habits.  Sign up now using my referral link and start your rebate journey: &lt;a href=&quot;https://www.rebatesme.com?referCode=G6FVNV&quot;&gt;https://www.rebatesme.com&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lertsirikarn.blogspot.com/feeds/3846159810339335029/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lertsirikarn.blogspot.com/2025/02/unlock-secrets-to-savings-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/3846159810339335029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/3846159810339335029'/><link rel='alternate' type='text/html' href='http://lertsirikarn.blogspot.com/2025/02/unlock-secrets-to-savings-with.html' title='Unlock the Secrets to Savings with RebatesMe.com'/><author><name>saveMightLife</name><uri>http://www.blogger.com/profile/07139052104556306035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6898804038410932940.post-5100893154174227084</id><published>2025-02-03T18:07:00.000-08:00</published><updated>2025-02-03T18:11:39.278-08:00</updated><title type='text'>Top 10 Python asyncio Interview Questions and Answers</title><content type='html'>&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;o:OfficeDocumentSettings&gt;
  &lt;o:AllowPNG/&gt;
 &lt;/o:OfficeDocumentSettings&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:TrackMoves/&gt;
  &lt;w:TrackFormatting/&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:DoNotPromoteQF/&gt;
  &lt;w:LidThemeOther&gt;EN-US&lt;/w:LidThemeOther&gt;
  &lt;w:LidThemeAsian&gt;X-NONE&lt;/w:LidThemeAsian&gt;
  &lt;w:LidThemeComplexScript&gt;TH&lt;/w:LidThemeComplexScript&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:ApplyBreakingRules/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
   &lt;w:SplitPgBreakAndParaMark/&gt;
   &lt;w:EnableOpenTypeKerning/&gt;
   &lt;w:DontFlipMirrorIndents/&gt;
   &lt;w:OverrideTableStyleHps/&gt;
  &lt;/w:Compatibility&gt;
  &lt;m:mathPr&gt;
   &lt;m:mathFont m:val=&quot;Cambria Math&quot;/&gt;
   &lt;m:brkBin m:val=&quot;before&quot;/&gt;
   &lt;m:brkBinSub m:val=&quot;&amp;#45;-&quot;/&gt;
   &lt;m:smallFrac m:val=&quot;off&quot;/&gt;
   &lt;m:dispDef/&gt;
   &lt;m:lMargin m:val=&quot;0&quot;/&gt;
   &lt;m:rMargin m:val=&quot;0&quot;/&gt;
   &lt;m:defJc m:val=&quot;centerGroup&quot;/&gt;
   &lt;m:wrapIndent m:val=&quot;1440&quot;/&gt;
   &lt;m:intLim m:val=&quot;subSup&quot;/&gt;
   &lt;m:naryLim m:val=&quot;undOvr&quot;/&gt;
  &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState=&quot;false&quot; DefUnhideWhenUsed=&quot;false&quot;
  DefSemiHidden=&quot;false&quot; DefQFormat=&quot;false&quot; DefPriority=&quot;99&quot;
  LatentStyleCount=&quot;376&quot;&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;0&quot; QFormat=&quot;true&quot; Name=&quot;Normal&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; SemiHidden=&quot;true&quot;
   UnhideWhenUsed=&quot;true&quot; QFormat=&quot;true&quot; Name=&quot;heading 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; SemiHidden=&quot;true&quot;
   UnhideWhenUsed=&quot;true&quot; QFormat=&quot;true&quot; Name=&quot;heading 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; SemiHidden=&quot;true&quot;
   UnhideWhenUsed=&quot;true&quot; QFormat=&quot;true&quot; Name=&quot;heading 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; SemiHidden=&quot;true&quot;
   UnhideWhenUsed=&quot;true&quot; QFormat=&quot;true&quot; Name=&quot;heading 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; SemiHidden=&quot;true&quot;
   UnhideWhenUsed=&quot;true&quot; QFormat=&quot;true&quot; Name=&quot;heading 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; SemiHidden=&quot;true&quot;
   UnhideWhenUsed=&quot;true&quot; QFormat=&quot;true&quot; Name=&quot;heading 7&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; SemiHidden=&quot;true&quot;
   UnhideWhenUsed=&quot;true&quot; QFormat=&quot;true&quot; Name=&quot;heading 8&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; SemiHidden=&quot;true&quot;
   UnhideWhenUsed=&quot;true&quot; QFormat=&quot;true&quot; Name=&quot;heading 9&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;index 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;index 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;index 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;index 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;index 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;index 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;index 7&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;index 8&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;index 9&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; SemiHidden=&quot;true&quot;
   UnhideWhenUsed=&quot;true&quot; Name=&quot;toc 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; SemiHidden=&quot;true&quot;
   UnhideWhenUsed=&quot;true&quot; Name=&quot;toc 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; SemiHidden=&quot;true&quot;
   UnhideWhenUsed=&quot;true&quot; Name=&quot;toc 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; SemiHidden=&quot;true&quot;
   UnhideWhenUsed=&quot;true&quot; Name=&quot;toc 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; SemiHidden=&quot;true&quot;
   UnhideWhenUsed=&quot;true&quot; Name=&quot;toc 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; SemiHidden=&quot;true&quot;
   UnhideWhenUsed=&quot;true&quot; Name=&quot;toc 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; SemiHidden=&quot;true&quot;
   UnhideWhenUsed=&quot;true&quot; Name=&quot;toc 7&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; SemiHidden=&quot;true&quot;
   UnhideWhenUsed=&quot;true&quot; Name=&quot;toc 8&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; SemiHidden=&quot;true&quot;
   UnhideWhenUsed=&quot;true&quot; Name=&quot;toc 9&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Normal Indent&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;footnote text&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;annotation text&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;header&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;footer&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;index heading&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;35&quot; SemiHidden=&quot;true&quot;
   UnhideWhenUsed=&quot;true&quot; QFormat=&quot;true&quot; Name=&quot;caption&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;table of figures&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;envelope address&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;envelope return&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;footnote reference&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;annotation reference&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;line number&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;page number&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;endnote reference&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;endnote text&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;table of authorities&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;macro&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;toa heading&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;List&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;List Bullet&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;List Number&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;List 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;List 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;List 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;List 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;List Bullet 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;List Bullet 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;List Bullet 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;List Bullet 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;List Number 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;List Number 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;List Number 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;List Number 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;10&quot; QFormat=&quot;true&quot; Name=&quot;Title&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Closing&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Signature&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;1&quot; SemiHidden=&quot;true&quot;
   UnhideWhenUsed=&quot;true&quot; Name=&quot;Default Paragraph Font&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Body Text&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Body Text Indent&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;List Continue&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;List Continue 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;List Continue 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;List Continue 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;List Continue 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Message Header&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;11&quot; QFormat=&quot;true&quot; Name=&quot;Subtitle&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Salutation&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Date&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Body Text First Indent&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Body Text First Indent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Note Heading&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Body Text 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Body Text 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Body Text Indent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Body Text Indent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Block Text&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Hyperlink&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;FollowedHyperlink&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;22&quot; QFormat=&quot;true&quot; Name=&quot;Strong&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;20&quot; QFormat=&quot;true&quot; Name=&quot;Emphasis&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Document Map&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Plain Text&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;E-mail Signature&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;HTML Top of Form&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;HTML Bottom of Form&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Normal (Web)&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;HTML Acronym&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;HTML Address&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;HTML Cite&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;HTML Code&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;HTML Definition&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;HTML Keyboard&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;HTML Preformatted&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;HTML Sample&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;HTML Typewriter&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;HTML Variable&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Normal Table&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;annotation subject&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;No List&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Outline List 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Outline List 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Outline List 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Simple 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Simple 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Simple 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Classic 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Classic 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Classic 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Classic 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Colorful 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Colorful 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Colorful 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Columns 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Columns 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Columns 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Columns 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Columns 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Grid 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Grid 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Grid 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Grid 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Grid 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Grid 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Grid 7&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Grid 8&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table List 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table List 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table List 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table List 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table List 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table List 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table List 7&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table List 8&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table 3D effects 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table 3D effects 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table 3D effects 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Contemporary&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Elegant&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Professional&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Subtle 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Subtle 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Web 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Web 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Web 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Balloon Text&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;Table Grid&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Table Theme&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; Name=&quot;Placeholder Text&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;1&quot; QFormat=&quot;true&quot; Name=&quot;No Spacing&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; Name=&quot;Light Shading&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; Name=&quot;Light List&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; Name=&quot;Light Grid&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; Name=&quot;Medium Shading 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; Name=&quot;Medium Shading 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; Name=&quot;Medium List 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; Name=&quot;Medium List 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; Name=&quot;Medium Grid 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; Name=&quot;Medium Grid 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; Name=&quot;Medium Grid 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; Name=&quot;Dark List&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; Name=&quot;Colorful Shading&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; Name=&quot;Colorful List&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; Name=&quot;Colorful Grid&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; Name=&quot;Light Shading Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; Name=&quot;Light List Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; Name=&quot;Light Grid Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; Name=&quot;Medium Shading 1 Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; Name=&quot;Medium Shading 2 Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; Name=&quot;Medium List 1 Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; Name=&quot;Revision&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;34&quot; QFormat=&quot;true&quot;
   Name=&quot;List Paragraph&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;29&quot; QFormat=&quot;true&quot; Name=&quot;Quote&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;30&quot; QFormat=&quot;true&quot;
   Name=&quot;Intense Quote&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; Name=&quot;Medium List 2 Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; Name=&quot;Medium Grid 1 Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; Name=&quot;Medium Grid 2 Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; Name=&quot;Medium Grid 3 Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; Name=&quot;Dark List Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; Name=&quot;Colorful Shading Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; Name=&quot;Colorful List Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; Name=&quot;Colorful Grid Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; Name=&quot;Light Shading Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; Name=&quot;Light List Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; Name=&quot;Light Grid Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; Name=&quot;Medium Shading 1 Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; Name=&quot;Medium Shading 2 Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; Name=&quot;Medium List 1 Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; Name=&quot;Medium List 2 Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; Name=&quot;Medium Grid 1 Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; Name=&quot;Medium Grid 2 Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; Name=&quot;Medium Grid 3 Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; Name=&quot;Dark List Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; Name=&quot;Colorful Shading Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; Name=&quot;Colorful List Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; Name=&quot;Colorful Grid Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; Name=&quot;Light Shading Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; Name=&quot;Light List Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; Name=&quot;Light Grid Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; Name=&quot;Medium Shading 1 Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; Name=&quot;Medium Shading 2 Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; Name=&quot;Medium List 1 Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; Name=&quot;Medium List 2 Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; Name=&quot;Medium Grid 1 Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; Name=&quot;Medium Grid 2 Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; Name=&quot;Medium Grid 3 Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; Name=&quot;Dark List Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; Name=&quot;Colorful Shading Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; Name=&quot;Colorful List Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; Name=&quot;Colorful Grid Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; Name=&quot;Light Shading Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; Name=&quot;Light List Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; Name=&quot;Light Grid Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; Name=&quot;Medium Shading 1 Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; Name=&quot;Medium Shading 2 Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; Name=&quot;Medium List 1 Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; Name=&quot;Medium List 2 Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; Name=&quot;Medium Grid 1 Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; Name=&quot;Medium Grid 2 Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; Name=&quot;Medium Grid 3 Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; Name=&quot;Dark List Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; Name=&quot;Colorful Shading Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; Name=&quot;Colorful List Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; Name=&quot;Colorful Grid Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; Name=&quot;Light Shading Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; Name=&quot;Light List Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; Name=&quot;Light Grid Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; Name=&quot;Medium Shading 1 Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; Name=&quot;Medium Shading 2 Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; Name=&quot;Medium List 1 Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; Name=&quot;Medium List 2 Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; Name=&quot;Medium Grid 1 Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; Name=&quot;Medium Grid 2 Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; Name=&quot;Medium Grid 3 Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; Name=&quot;Dark List Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; Name=&quot;Colorful Shading Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; Name=&quot;Colorful List Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; Name=&quot;Colorful Grid Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; Name=&quot;Light Shading Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; Name=&quot;Light List Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; Name=&quot;Light Grid Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; Name=&quot;Medium Shading 1 Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; Name=&quot;Medium Shading 2 Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; Name=&quot;Medium List 1 Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; Name=&quot;Medium List 2 Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; Name=&quot;Medium Grid 1 Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; Name=&quot;Medium Grid 2 Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; Name=&quot;Medium Grid 3 Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; Name=&quot;Dark List Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; Name=&quot;Colorful Shading Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; Name=&quot;Colorful List Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; Name=&quot;Colorful Grid Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;19&quot; QFormat=&quot;true&quot;
   Name=&quot;Subtle Emphasis&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;21&quot; QFormat=&quot;true&quot;
   Name=&quot;Intense Emphasis&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;31&quot; QFormat=&quot;true&quot;
   Name=&quot;Subtle Reference&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;32&quot; QFormat=&quot;true&quot;
   Name=&quot;Intense Reference&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;33&quot; QFormat=&quot;true&quot; Name=&quot;Book Title&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;37&quot; SemiHidden=&quot;true&quot;
   UnhideWhenUsed=&quot;true&quot; Name=&quot;Bibliography&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; SemiHidden=&quot;true&quot;
   UnhideWhenUsed=&quot;true&quot; QFormat=&quot;true&quot; Name=&quot;TOC Heading&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;41&quot; Name=&quot;Plain Table 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;42&quot; Name=&quot;Plain Table 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;43&quot; Name=&quot;Plain Table 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;44&quot; Name=&quot;Plain Table 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;45&quot; Name=&quot;Plain Table 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;40&quot; Name=&quot;Grid Table Light&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;46&quot; Name=&quot;Grid Table 1 Light&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;47&quot; Name=&quot;Grid Table 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;48&quot; Name=&quot;Grid Table 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;49&quot; Name=&quot;Grid Table 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;50&quot; Name=&quot;Grid Table 5 Dark&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;51&quot; Name=&quot;Grid Table 6 Colorful&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;52&quot; Name=&quot;Grid Table 7 Colorful&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;46&quot;
   Name=&quot;Grid Table 1 Light Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;47&quot; Name=&quot;Grid Table 2 Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;48&quot; Name=&quot;Grid Table 3 Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;49&quot; Name=&quot;Grid Table 4 Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;50&quot; Name=&quot;Grid Table 5 Dark Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;51&quot;
   Name=&quot;Grid Table 6 Colorful Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;52&quot;
   Name=&quot;Grid Table 7 Colorful Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;46&quot;
   Name=&quot;Grid Table 1 Light Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;47&quot; Name=&quot;Grid Table 2 Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;48&quot; Name=&quot;Grid Table 3 Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;49&quot; Name=&quot;Grid Table 4 Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;50&quot; Name=&quot;Grid Table 5 Dark Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;51&quot;
   Name=&quot;Grid Table 6 Colorful Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;52&quot;
   Name=&quot;Grid Table 7 Colorful Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;46&quot;
   Name=&quot;Grid Table 1 Light Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;47&quot; Name=&quot;Grid Table 2 Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;48&quot; Name=&quot;Grid Table 3 Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;49&quot; Name=&quot;Grid Table 4 Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;50&quot; Name=&quot;Grid Table 5 Dark Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;51&quot;
   Name=&quot;Grid Table 6 Colorful Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;52&quot;
   Name=&quot;Grid Table 7 Colorful Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;46&quot;
   Name=&quot;Grid Table 1 Light Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;47&quot; Name=&quot;Grid Table 2 Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;48&quot; Name=&quot;Grid Table 3 Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;49&quot; Name=&quot;Grid Table 4 Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;50&quot; Name=&quot;Grid Table 5 Dark Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;51&quot;
   Name=&quot;Grid Table 6 Colorful Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;52&quot;
   Name=&quot;Grid Table 7 Colorful Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;46&quot;
   Name=&quot;Grid Table 1 Light Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;47&quot; Name=&quot;Grid Table 2 Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;48&quot; Name=&quot;Grid Table 3 Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;49&quot; Name=&quot;Grid Table 4 Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;50&quot; Name=&quot;Grid Table 5 Dark Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;51&quot;
   Name=&quot;Grid Table 6 Colorful Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;52&quot;
   Name=&quot;Grid Table 7 Colorful Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;46&quot;
   Name=&quot;Grid Table 1 Light Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;47&quot; Name=&quot;Grid Table 2 Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;48&quot; Name=&quot;Grid Table 3 Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;49&quot; Name=&quot;Grid Table 4 Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;50&quot; Name=&quot;Grid Table 5 Dark Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;51&quot;
   Name=&quot;Grid Table 6 Colorful Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;52&quot;
   Name=&quot;Grid Table 7 Colorful Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;46&quot; Name=&quot;List Table 1 Light&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;47&quot; Name=&quot;List Table 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;48&quot; Name=&quot;List Table 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;49&quot; Name=&quot;List Table 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;50&quot; Name=&quot;List Table 5 Dark&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;51&quot; Name=&quot;List Table 6 Colorful&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;52&quot; Name=&quot;List Table 7 Colorful&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;46&quot;
   Name=&quot;List Table 1 Light Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;47&quot; Name=&quot;List Table 2 Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;48&quot; Name=&quot;List Table 3 Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;49&quot; Name=&quot;List Table 4 Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;50&quot; Name=&quot;List Table 5 Dark Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;51&quot;
   Name=&quot;List Table 6 Colorful Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;52&quot;
   Name=&quot;List Table 7 Colorful Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;46&quot;
   Name=&quot;List Table 1 Light Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;47&quot; Name=&quot;List Table 2 Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;48&quot; Name=&quot;List Table 3 Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;49&quot; Name=&quot;List Table 4 Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;50&quot; Name=&quot;List Table 5 Dark Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;51&quot;
   Name=&quot;List Table 6 Colorful Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;52&quot;
   Name=&quot;List Table 7 Colorful Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;46&quot;
   Name=&quot;List Table 1 Light Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;47&quot; Name=&quot;List Table 2 Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;48&quot; Name=&quot;List Table 3 Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;49&quot; Name=&quot;List Table 4 Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;50&quot; Name=&quot;List Table 5 Dark Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;51&quot;
   Name=&quot;List Table 6 Colorful Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;52&quot;
   Name=&quot;List Table 7 Colorful Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;46&quot;
   Name=&quot;List Table 1 Light Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;47&quot; Name=&quot;List Table 2 Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;48&quot; Name=&quot;List Table 3 Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;49&quot; Name=&quot;List Table 4 Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;50&quot; Name=&quot;List Table 5 Dark Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;51&quot;
   Name=&quot;List Table 6 Colorful Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;52&quot;
   Name=&quot;List Table 7 Colorful Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;46&quot;
   Name=&quot;List Table 1 Light Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;47&quot; Name=&quot;List Table 2 Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;48&quot; Name=&quot;List Table 3 Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;49&quot; Name=&quot;List Table 4 Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;50&quot; Name=&quot;List Table 5 Dark Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;51&quot;
   Name=&quot;List Table 6 Colorful Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;52&quot;
   Name=&quot;List Table 7 Colorful Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;46&quot;
   Name=&quot;List Table 1 Light Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;47&quot; Name=&quot;List Table 2 Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;48&quot; Name=&quot;List Table 3 Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;49&quot; Name=&quot;List Table 4 Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;50&quot; Name=&quot;List Table 5 Dark Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;51&quot;
   Name=&quot;List Table 6 Colorful Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;52&quot;
   Name=&quot;List Table 7 Colorful Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Mention&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Smart Hyperlink&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Hashtag&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Unresolved Mention&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; SemiHidden=&quot;true&quot; UnhideWhenUsed=&quot;true&quot;
   Name=&quot;Smart Link&quot;/&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:&quot;Table Normal&quot;;
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-priority:99;
	mso-style-parent:&quot;&quot;;
	mso-padding-alt:0in 5.4pt 0in 5.4pt;
	mso-para-margin-top:0in;
	mso-para-margin-right:0in;
	mso-para-margin-bottom:8.0pt;
	mso-para-margin-left:0in;
	line-height:107%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	mso-bidi-font-size:14.0pt;
	font-family:&quot;Aptos&quot;,sans-serif;
	mso-ascii-font-family:Aptos;
	mso-ascii-theme-font:minor-latin;
	mso-hansi-font-family:Aptos;
	mso-hansi-theme-font:minor-latin;
	mso-font-kerning:1.0pt;
	mso-ligatures:standardcontextual;}
&lt;/style&gt;
&lt;![endif]--&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br style=&quot;mso-special-character: line-break;&quot; /&gt;
&lt;br style=&quot;mso-special-character: line-break;&quot; /&gt;
&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;Python&#39;s `asyncio` library is a powerful tool for writing
concurrent code using the `async`/`await` syntax. Here are some commonly asked
interview questions on `asyncio` along with their answers to help you prepare:&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
1. Write an asynchronous function using `async def` that prints &quot;Hello,
World!&quot; after a 1-second delay.&lt;br style=&quot;mso-special-character: line-break;&quot; /&gt;
&lt;br style=&quot;mso-special-character: line-break;&quot; /&gt;
&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&amp;nbsp;&amp;nbsp; import asyncio&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; async def greet():&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; await asyncio.sleep(1)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(&quot;Hello, World!&quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; asyncio.run(greet())&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&amp;nbsp;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
2. Create a coroutine that fetches data from a URL using `aiohttp` and prints
the response status.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; import aiohttp&lt;br /&gt;
&amp;nbsp;&amp;nbsp; import asyncio&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; async def fetch_url(url):&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; async with aiohttp.ClientSession() as
session:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; async with
session.get(url) as response:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
print(response.status)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; asyncio.run(fetch_url(&quot;https://www.example.com&quot;))&lt;br /&gt;
&lt;br /&gt;
3. Write a program that uses `asyncio.gather` to run three asynchronous
functions concurrently, each with different sleep durations, and print their
results.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; import asyncio&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; async def task1():&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; await asyncio.sleep(1)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &quot;task1 completed&quot;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; async def task2():&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; await asyncio.sleep(2)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &quot;task2 completed&quot;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; async def task3():&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; await asyncio.sleep(3)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &quot;task3 completed&quot;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; async def main():&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; results = await asyncio.gather(task1(),
task2(), task3())&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(results)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; asyncio.run(main())&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
4. Implement a coroutine that reads from a file asynchronously using
`aiofiles`. Print the contents of the file.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; import aiofiles&lt;br /&gt;
&amp;nbsp;&amp;nbsp; import asyncio&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; async def read_file(file_path):&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; async with aiofiles.open(file_path,
mode=&#39;r&#39;) as file:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; contents = await
file.read()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(contents)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; asyncio.run(read_file(&#39;example.txt&#39;))&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
5. Create an asynchronous context manager using `async with` that handles a
mock resource and prints messages when acquiring and releasing the resource.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; import asyncio&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; class MockResource:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; async def __aenter__(self):&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
print(&quot;Acquiring resource&quot;)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return self&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; async def __aexit__(self, exc_type,
exc_value, traceback):&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
print(&quot;Releasing resource&quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; async def use_resource():&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; async with MockResource():&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(&quot;Using
resource&quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; asyncio.run(use_resource())&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
6. Write a coroutine that catches exceptions during the execution of an
asynchronous function and prints the error message.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; import asyncio&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; async def error_prone_task():&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise ValueError(&quot;An error
occurred&quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; async def main():&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; await
error_prone_task()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; except ValueError as e:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
print(f&quot;Caught an exception: {e}&quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; asyncio.run(main())&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
7. Develop a coroutine that uses `asyncio.sleep()` to simulate a delay and then
prints a message, demonstrating the difference between `asyncio.sleep()` and
`time.sleep()`.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; import asyncio&lt;br /&gt;
&amp;nbsp;&amp;nbsp; import time&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; async def async_sleep_example():&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; await asyncio.sleep(1)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(&quot;Non-blocking sleep
complete&quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; def blocking_sleep_example():&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; time.sleep(1)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(&quot;Blocking sleep complete&quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; asyncio.run(async_sleep_example())&lt;br /&gt;
&amp;nbsp;&amp;nbsp; blocking_sleep_example()&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
8. Create a coroutine that runs multiple asynchronous tasks using
`asyncio.create_task` and prints their results.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; import asyncio&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; async def task1():&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; await asyncio.sleep(1)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &quot;task1 result&quot;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; async def task2():&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; await asyncio.sleep(2)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &quot;task2 result&quot;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; async def main():&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t1 = asyncio.create_task(task1())&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t2 = asyncio.create_task(task2())&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; results = await asyncio.gather(t1, t2)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(results)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; asyncio.run(main())&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
9. Write a coroutine that demonstrates how to cancel an asynchronous task.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; import asyncio&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; async def long_running_task():&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; await
asyncio.sleep(10)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; except asyncio.CancelledError:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(&quot;Task
was cancelled&quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; async def main():&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; task =
asyncio.create_task(long_running_task())&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; await asyncio.sleep(1)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; task.cancel()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; await task&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; asyncio.run(main())&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
10. Implement a simple web server using `aiohttp` that responds with
&quot;Hello, World!&quot; to any GET request.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; import aiohttp&lt;br /&gt;
&amp;nbsp;&amp;nbsp; import aiohttp.web&lt;br /&gt;
&amp;nbsp;&amp;nbsp; import asyncio&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; async def handle(request):&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return
aiohttp.web.Response(text=&quot;Hello, World!&quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; app = aiohttp.web.Application()&lt;br /&gt;
&amp;nbsp;&amp;nbsp; app.router.add_get(&#39;/&#39;, handle)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; aiohttp.web.run_app(app)&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
By the way, some intern position ask easier question such as these:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. What is `asyncio` in Python?&lt;br /&gt;
&amp;nbsp;&amp;nbsp; `asyncio` is a library to write concurrent code using the
`async`/`await` syntax. It is used to handle asynchronous operations and is
included in Python&#39;s standard library from version 3.4 onwards.&lt;br /&gt;
&lt;br /&gt;
2. What is an event loop in `asyncio`?&lt;br /&gt;
&amp;nbsp;&amp;nbsp; An event loop is the core of every `asyncio` application. It runs
in a thread (usually the main thread) and schedules and executes asynchronous
tasks, handling all the asynchronous operations.&lt;br /&gt;
&lt;br /&gt;
3. How do you define an asynchronous function in Python?&lt;br /&gt;
&amp;nbsp;&amp;nbsp; An asynchronous function is defined using the `async def` syntax.
For example:&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; async def my_async_function():&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
4. What are `await` and `async` keywords used for?&lt;br /&gt;
&amp;nbsp;&amp;nbsp; - `async`: Used to define an asynchronous function.&lt;br /&gt;
&amp;nbsp;&amp;nbsp; - `await`: Used to pause the execution of an asynchronous function
until the awaited task completes, freeing up the event loop for other tasks.&lt;br /&gt;
&lt;br /&gt;
5. How do you run an asynchronous function using `asyncio`?&lt;br /&gt;
&amp;nbsp;&amp;nbsp; You can run an asynchronous function using the `asyncio.run()`
function or by running it within an event loop. For example:&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; import asyncio&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; async def main():&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(&quot;Hello, World!&quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; asyncio.run(main())&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
6. What is a coroutine in Python `asyncio`?&lt;br /&gt;
&amp;nbsp;&amp;nbsp; A coroutine is a function that can be paused and resumed, allowing
other tasks to run during the pause. Coroutines are defined with the `async`
keyword and are the building blocks of `asyncio`.&lt;br /&gt;
&lt;br /&gt;
7. How do you handle exceptions in `asyncio` coroutines?&lt;br /&gt;
&amp;nbsp;&amp;nbsp; Exceptions in `asyncio` coroutines can be handled using `try` and
`except` blocks within the asynchronous function:&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; async def example():&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = await
some_coroutine()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; except Exception as e:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(f&quot;An
error occurred: {e}&quot;)&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
8. What is `asyncio.gather` and how is it used?&lt;br /&gt;
&amp;nbsp;&amp;nbsp; `asyncio.gather` is a function that runs multiple asynchronous
tasks concurrently and waits for all of them to complete. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; import asyncio&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; async def task1():&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; await asyncio.sleep(1)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &quot;task1 completed&quot;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; async def task2():&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; await asyncio.sleep(2)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &quot;task2 completed&quot;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; async def main():&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; results = await asyncio.gather(task1(),
task2())&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(results)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; asyncio.run(main())&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. What are the differences between `asyncio.sleep()` and `time.sleep()`?&lt;br /&gt;
&amp;nbsp;&amp;nbsp; - `asyncio.sleep()`: Non-blocking, allows the event loop to run
other tasks while sleeping.&lt;br /&gt;
&amp;nbsp;&amp;nbsp; - `time.sleep()`: Blocking, pauses the entire thread, preventing
other tasks from running.&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
10. How do you use `async with` in `asyncio`?&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; `async with` is used with asynchronous context managers. It
ensures that the resource is properly acquired and released. For example:&lt;br /&gt;
&amp;nbsp;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&amp;nbsp;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; import aiohttp&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; async def fetch(url):&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; async with aiohttp.ClientSession()
as session:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; async with
session.get(url) as response:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
return await response.text()&lt;br /&gt;
&amp;nbsp;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&amp;nbsp;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&amp;nbsp;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&amp;nbsp;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&amp;nbsp;&lt;/p&gt;

</content><link rel='replies' type='application/atom+xml' href='http://lertsirikarn.blogspot.com/feeds/5100893154174227084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lertsirikarn.blogspot.com/2025/02/top-10-python-asyncio-interview.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/5100893154174227084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/5100893154174227084'/><link rel='alternate' type='text/html' href='http://lertsirikarn.blogspot.com/2025/02/top-10-python-asyncio-interview.html' title='Top 10 Python asyncio Interview Questions and Answers'/><author><name>saveMightLife</name><uri>http://www.blogger.com/profile/07139052104556306035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6898804038410932940.post-8766545769521718825</id><published>2025-01-30T12:16:00.001-08:00</published><updated>2025-01-30T12:16:00.234-08:00</updated><title type='text'>You have a sheet of n x m grid paper and you&#39;d like to draw a cool design on it. Python Code Solution </title><content type='html'>&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;You have a sheet of n x m grid paper and you&#39;d like to draw a cool design on it. You&#39;ve decided on a block motif similar to tetris pieces. Specifically, your picture will include the following five types of figures: The array figures contains a list of letters representing the types of figures you&#39;d like to include in your design. Your task is to create a matrix of integers representing the grid paper, and draw the figures on it according to the following rules: - Start with a matrix of all 0 s , and use the 1 -based index of each figure to represent it on the grid. For example, if figures [0] = &#39; E &#39; then the shape added to the grid will Iook like this:&lt;/div&gt;&lt;div&gt;[[0, 1, 0], [1, 1, 1]]&lt;/div&gt;&lt;div&gt;• Place the figures on the grid in the order they appear in figures The figures must not overlap any other figures that have already been placed, and they may not be rotated.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;• Of all the available locations, choose the one with the lowest row index.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;• If there are multiple possible locations with the lowest row index, choose the one among them with the lowest column index.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;• It&#39;s guaranteed that all figures will fit on the grid.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Return a matrix of integers representing the grid paper after all the figures have been drawn.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Note: You are not expected to provide the most optimal solution, but a solution with time&lt;/div&gt;&lt;div&gt;&lt;div&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEizItmrydjltkR_jclC6lreDVw59tEyS2DzhVMBdK_PaxTHR8oQC-sPg0I1bUjevopJBygaeEm75mU-rnvNRxgh2CTMsbdenIh-vJgPHgwmdNNg4qYQoIBTKqTAjzcbkUWS_yzwZft5chuzC3GQOx0YSwrxoUoKAv276xselF4zzJillAp8afCk26uqOS3s&quot;&gt;
    &lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEizItmrydjltkR_jclC6lreDVw59tEyS2DzhVMBdK_PaxTHR8oQC-sPg0I1bUjevopJBygaeEm75mU-rnvNRxgh2CTMsbdenIh-vJgPHgwmdNNg4qYQoIBTKqTAjzcbkUWS_yzwZft5chuzC3GQOx0YSwrxoUoKAv276xselF4zzJillAp8afCk26uqOS3s&quot; width=&quot;400&quot;&gt;
  &lt;/a&gt;
&lt;/div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Here&#39;s the Python code to solve the problem of placing figures on a grid, following the given rules and complexity constraints:&lt;/div&gt;&lt;div&gt;def place_figures(n, m, figures):&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; grid = [[0] * m for _ in range(n)]&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; figure_shapes = {&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;A&quot;: [[1]],&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;B&quot;: [[1, 1]],&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;C&quot;: [[1, 1], [1, 1]],&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;D&quot;: [[1, 0], [1, 1], [1, 1]],&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;E&quot;: [[1, 1, 1], [0, 1, 0]]&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; }&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; for figure in figures:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; shape = figure_shapes[figure]&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; height, width = len(shape), len(shape[0])&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for row in range(n - height + 1):&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for col in range(m - width + 1):&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; valid = True&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for i in range(height):&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for j in range(width):&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if shape[i][j] == 1 and grid[row + i][col + j] != 0:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; valid = False&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if not valid:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if valid:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for i in range(height):&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for j in range(width):&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; grid[row + i][col + j] = figure_shapes[figure][i][j]&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if valid:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; return grid&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;# Example usage&lt;/div&gt;&lt;div&gt;n = 4&lt;/div&gt;&lt;div&gt;m = 4&lt;/div&gt;&lt;div&gt;figures = [&quot;D&quot;, &quot;B&quot;, &quot;A&quot;, &quot;C&quot;]&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;result = place_figures(n, m, figures)&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;for row in result:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; print(row)&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;This code effectively addresses the problem by:&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Grid Initialization: Creates an empty grid of size n x m.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Figure Shapes: Defines the shapes of each figure using a dictionary.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Iterative Placement: Iterates through each figure, checks for valid positions, and places the figure in the best available position.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Valid Position Check: Ensures that the figure can be placed without overlapping existing figures.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Grid Update: Updates the grid with the placed figure.&lt;/div&gt;&lt;div&gt;This solution adheres to the time complexity requirement of O(n * m * figures.length) by efficiently checking for valid positions and placing figures. It provides a clear and well-structured implementation for the given problem.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;# Example usage:&lt;/div&gt;&lt;div&gt;n = 4&lt;/div&gt;&lt;div&gt;m = 4&lt;/div&gt;&lt;div&gt;figures = [&quot;D&quot;, &quot;B&quot;, &quot;A&quot;, &quot;C&quot;]&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;result = place_figures(n, m, figures)&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;for row in result:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; print(row)&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;This example demonstrates how to use the place_figures function:&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Grid Dimensions: We define the grid dimensions n and m as 4x4.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Figure List: We create a list of figures figures containing &quot;D&quot;, &quot;B&quot;, &quot;A&quot;, and &quot;C&quot;.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Function Call: We call the place_figures function with n, m, and figures as arguments.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Output: The function returns the updated grid, and we print each row of the grid to visualize the placement of figures.&lt;/div&gt;&lt;div&gt;The expected output for this example would be:&lt;/div&gt;&lt;div&gt;[1, 2, 2, 2]&lt;/div&gt;&lt;div&gt;[1, 1, 3, 0]&lt;/div&gt;&lt;div&gt;[1, 4, 4, 0]&lt;/div&gt;&lt;div&gt;[0, 4, 4, 0]&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;This output represents the final state of the grid after placing the figures according to the given rules.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lertsirikarn.blogspot.com/feeds/8766545769521718825/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lertsirikarn.blogspot.com/2025/01/you-have-sheet-of-n-x-m-grid-paper-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/8766545769521718825'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/8766545769521718825'/><link rel='alternate' type='text/html' href='http://lertsirikarn.blogspot.com/2025/01/you-have-sheet-of-n-x-m-grid-paper-and.html' title='You have a sheet of n x m grid paper and you&#39;d like to draw a cool design on it. Python Code Solution '/><author><name>saveMightLife</name><uri>http://www.blogger.com/profile/07139052104556306035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEizItmrydjltkR_jclC6lreDVw59tEyS2DzhVMBdK_PaxTHR8oQC-sPg0I1bUjevopJBygaeEm75mU-rnvNRxgh2CTMsbdenIh-vJgPHgwmdNNg4qYQoIBTKqTAjzcbkUWS_yzwZft5chuzC3GQOx0YSwrxoUoKAv276xselF4zzJillAp8afCk26uqOS3s=s72-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6898804038410932940.post-2608076404389820628</id><published>2024-12-29T20:01:00.000-08:00</published><updated>2024-12-29T20:01:56.508-08:00</updated><title type='text'>HOW TO FIX THIS ERROR: pydub\utils.py&quot;, line 16, in      import pyaudioop as audioop ModuleNotFoundError: No module named &#39;pyaudioop&#39;</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;If you get this error after trying to use pydub &lt;br /&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;pydub\utils.py&quot;, line 16, in &amp;lt;module&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; import pyaudioop as audioop&lt;br /&gt;ModuleNotFoundError: No module named &#39;pyaudioop&#39;&lt;/h3&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Then try fixing it by install the missing module:&amp;nbsp;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;pip install audioop-lts&amp;nbsp;&amp;nbsp;&lt;/h3&gt;&lt;p&gt;it works for me, at least for now.&lt;/p&gt;&lt;p&gt;My environment: Python 3.13.1, Windows 10&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://lertsirikarn.blogspot.com/feeds/2608076404389820628/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lertsirikarn.blogspot.com/2024/12/how-to-fix-this-error-pydubutilspy-line.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/2608076404389820628'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/2608076404389820628'/><link rel='alternate' type='text/html' href='http://lertsirikarn.blogspot.com/2024/12/how-to-fix-this-error-pydubutilspy-line.html' title='HOW TO FIX THIS ERROR: pydub\utils.py&quot;, line 16, in &lt;module&gt;     import pyaudioop as audioop ModuleNotFoundError: No module named &#39;pyaudioop&#39;'/><author><name>saveMightLife</name><uri>http://www.blogger.com/profile/07139052104556306035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6898804038410932940.post-6695649673857633296</id><published>2024-12-19T18:17:00.001-08:00</published><updated>2024-12-19T18:18:02.126-08:00</updated><title type='text'>Invitation code for GCX gift card, 5 dollars off first purchase </title><content type='html'>&lt;br&gt;&lt;div&gt;There are many reasons why you should consider buying gift cards from GCX.com:&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Discounted Gift Cards: GCX.com offers gift cards at a discount, so you can save money on your purchases. You can save up to 30% at thousands of your favorite stores!&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Wide Variety of Stores: &lt;a href=&quot;https://gcx.raise.com/gcx-rewards/DLERTSIRIKARN0840&quot;&gt;GCX.com&lt;/a&gt; offers a wide variety of gift cards from a large number of stores, so you&#39;re sure to find the perfect gift for anyone on your list.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Convenience:  Gift cards are a convenient gift option. You can purchase them online and have them delivered electronically, so you don&#39;t have to worry about going to the store or wrapping a physical gift.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Security: GCX.com uses secure transactions to protect your personal information.&lt;/div&gt;&lt;div&gt;Plus, you can earn rewards by referring friends and family!&lt;/div&gt;&lt;div&gt;Here&#39;s how it works:&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Sign Up for a Free Account: Visit &lt;a href=&quot;https://gcx.raise.com/gcx-rewards/DLERTSIRIKARN0840&quot;&gt;GCX.com&lt;/a&gt; and create your free account.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Get Your Referral Link: Once registered, you&#39;ll be provided with a personalized referral link like this one: https://gcx.raise.com/gcx-rewards/DLERTSIRIKARN0840&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Share the Link: Share your referral link with friends, family, colleagues, or anyone who might benefit from buying gift cards at a discount.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Earn Rewards: When someone signs up for GCX.com using your link, you&#39;ll both receive exclusive rewards!&lt;/div&gt;&lt;div&gt;By referring others to GCX.com, you can save them money on their gift purchases and earn rewards for yourself.&lt;/div&gt;&lt;div&gt;Ready to get started? Sign up for a free account at GCX.com today and use my referral link: https://gcx.raise.com/gcx-rewards/DLERTSIRIKARN0840&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lertsirikarn.blogspot.com/feeds/6695649673857633296/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lertsirikarn.blogspot.com/2024/12/invitation-code-for-gcx-gift-card-5.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/6695649673857633296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/6695649673857633296'/><link rel='alternate' type='text/html' href='http://lertsirikarn.blogspot.com/2024/12/invitation-code-for-gcx-gift-card-5.html' title='Invitation code for GCX gift card, 5 dollars off first purchase '/><author><name>saveMightLife</name><uri>http://www.blogger.com/profile/07139052104556306035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6898804038410932940.post-3470145496577141280</id><published>2024-12-19T17:01:00.000-08:00</published><updated>2024-12-19T17:01:00.128-08:00</updated><title type='text'>Discover Card Referral Bonus Link: Get $100!</title><content type='html'>&lt;br&gt;&lt;div&gt;Thinking about getting a Discover Card? You&#39;re in luck!  If you use my referral link, we can both get a $100 statement credit after you make a purchase within the first 3 months of opening your account.  There are some terms and conditions that apply, so be sure to review them before signing up.&lt;/div&gt;&lt;div&gt;Here&#39;s how to get the bonus:&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Click on this referral link: &lt;a href=&quot;https://refer.discover.com/s/qa2rvc?advocate.partner_share_id=6051672948&quot;&gt;https://refer.discover.com/s/qa2rvc?advocate.partner_share_id=6051672948&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Apply for a Discover Card&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Make a purchase within the first 3 months of opening your account&lt;/div&gt;&lt;div&gt;&amp;nbsp;* You and I will each get a $100 statement credit after your purchase is processed&lt;/div&gt;&lt;div&gt;Don&#39;t miss out on this great opportunity to get rewarded for using a Discover Card!&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lertsirikarn.blogspot.com/feeds/3470145496577141280/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lertsirikarn.blogspot.com/2024/12/discover-card-referral-bonus-link-get.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/3470145496577141280'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/3470145496577141280'/><link rel='alternate' type='text/html' href='http://lertsirikarn.blogspot.com/2024/12/discover-card-referral-bonus-link-get.html' title='Discover Card Referral Bonus Link: Get $100!'/><author><name>saveMightLife</name><uri>http://www.blogger.com/profile/07139052104556306035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6898804038410932940.post-2823546899792393816</id><published>2024-12-11T18:33:00.000-08:00</published><updated>2024-12-11T18:33:00.139-08:00</updated><title type='text'>Venmo referral link, sign up and get 5 dollars </title><content type='html'>&lt;div&gt;Did you know you can use Venmo to send money, shop, and even earn rewards? We&#39;ll both earn $5 when you send at least $5 to another person on Venmo using a funding source linked to your account. Expires in 14 days.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Tap this referral link to start: &lt;a href=&quot;https://get.venmo.com/L7DkL0WwdPb&quot;&gt;https://get.venmo.com/L7DkL0WwdPb&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;Join the Venmo Community and Earn $5!&lt;div&gt;Venmo: The Easy Way to Pay&lt;/div&gt;&lt;div&gt;Tired of the hassle of traditional payment methods? Venmo is the simple and secure way to send and receive money with friends and family. Whether you&#39;re splitting a dinner bill, paying rent, or gifting a birthday present, Venmo makes it a breeze.&lt;/div&gt;&lt;div&gt;How It Works:&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Sign Up: Create a free Venmo account in just a few minutes.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Link a Payment Method: Connect your bank account or debit card to your Venmo account.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Send or Request Money: Easily send or request money from your contacts using their phone number or email address.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Pay with Venmo: Use Venmo to pay at millions of merchants nationwide.&lt;/div&gt;&lt;div&gt;Why You&#39;ll Love Venmo:&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Simple and Intuitive: User-friendly interface for hassle-free transactions.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Secure and Reliable: Advanced security measures to protect your financial information.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Social Sharing: Share your payments and purchases with friends on social media.&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Fast and Easy: Send and receive money instantly.&lt;/div&gt;&lt;div&gt;Ready to Get Started?&lt;/div&gt;&lt;div&gt;Click on this referral link to sign up for Venmo and earn a $5 bonus when you send your first payment of $5 or more:&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Tap this referral link to start: &lt;a href=&quot;https://get.venmo.com/L7DkL0WwdPb&quot;&gt;https://get.venmo.com/L7DkL0WwdPb&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Don&#39;t miss out on this fantastic opportunity to simplify your financial life and earn some extra cash. Join the Venmo community today!&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lertsirikarn.blogspot.com/feeds/2823546899792393816/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lertsirikarn.blogspot.com/2024/12/venmo-referral-link-sign-up-and-get-5.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/2823546899792393816'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/2823546899792393816'/><link rel='alternate' type='text/html' href='http://lertsirikarn.blogspot.com/2024/12/venmo-referral-link-sign-up-and-get-5.html' title='Venmo referral link, sign up and get 5 dollars '/><author><name>saveMightLife</name><uri>http://www.blogger.com/profile/07139052104556306035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6898804038410932940.post-1350790774055774449</id><published>2024-12-10T18:29:00.001-08:00</published><updated>2024-12-10T18:29:02.357-08:00</updated><title type='text'>Amazon Prime Video Review: not bad overall.</title><content type='html'>&lt;br&gt;&lt;div&gt;&lt;br&gt;&lt;div&gt;In today&#39;s fast-paced digital age, streaming services have revolutionized the way we consume entertainment. Among the plethora of options available, Amazon Prime Video stands out as a compelling choice for viewers seeking a diverse and high-quality viewing experience.&lt;/div&gt;&lt;div&gt;A Treasure Trove of Content&lt;/div&gt;&lt;div&gt;One of the primary benefits of Amazon Prime Video is its extensive library of movies and TV shows. From critically acclaimed original series like &quot;The Marvelous Mrs. Maisel&quot; and &quot;The Boys&quot; to timeless classics and blockbuster films, there&#39;s something for everyone. The platform&#39;s commitment to producing original content ensures a constant stream of fresh and innovative programming.&lt;/div&gt;&lt;div&gt;Exclusive Originals&lt;/div&gt;&lt;div&gt;Amazon Prime Video has established itself as a major player in the original content space. Their exclusive series and movies offer unique storytelling, captivating performances, and stunning visuals. Whether you&#39;re a fan of drama, comedy, sci-fi, or fantasy, you&#39;ll find a wide range of original content to satisfy your cravings.&lt;/div&gt;&lt;div&gt;Convenient and Flexible&lt;/div&gt;&lt;div&gt;Amazon Prime Video offers a seamless and user-friendly experience. You can stream your favorite shows and movies on a variety of devices, including smart TVs, smartphones, tablets, and computers. With offline downloads, you can enjoy your content even when you&#39;re not connected to the internet.&lt;/div&gt;&lt;div&gt;Additional Perks&lt;/div&gt;&lt;div&gt;As an Amazon Prime member, you&#39;ll gain access to a host of additional benefits beyond streaming. These include free two-day shipping on millions of items, exclusive deals, and access to Prime Music and Prime Reading.&lt;/div&gt;&lt;div&gt;Unleash the Magic of Prime Video&lt;/div&gt;&lt;div&gt;Ready to embark on a cinematic journey?&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://www.amazon.com/Amazon-Video/b?ie=UTF8&amp;amp;node=2858778011&amp;amp;linkCode=ll2&amp;amp;tag=lertsirikarnc-20&amp;amp;linkId=d8272befe591e4f2c6989342f11d052d&amp;amp;language=en_US&amp;amp;ref_=as_li_ss_tl&quot;&gt;Click here to sign up&amp;nbsp;&lt;/a&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://www.amazon.com/Amazon-Video/b?ie=UTF8&amp;amp;node=2858778011&amp;amp;linkCode=ll2&amp;amp;tag=lertsirikarnc-20&amp;amp;linkId=d8272befe591e4f2c6989342f11d052d&amp;amp;language=en_US&amp;amp;ref_=as_li_ss_tl&quot;&gt;Affiliate Link to Amazon Prime Video Website&lt;/a&gt;:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://www.amazon.com/Amazon-Video/b?ie=UTF8&amp;amp;node=2858778011&amp;amp;linkCode=ll2&amp;amp;tag=lertsirikarnc-20&amp;amp;linkId=d8272befe591e4f2c6989342f11d052d&amp;amp;language=en_US&amp;amp;ref_=as_li_ss_tl&quot;&gt;https://www.amazon.com/Amazon-Video/b?ie=UTF8&amp;amp;node=2858778011&amp;amp;linkCode=ll2&amp;amp;tag=lertsirikarnc-20&amp;amp;linkId=d8272befe591e4f2c6989342f11d052d&amp;amp;language=en_US&amp;amp;ref_=as_li_ss_tl&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Disclaimer: This is an affiliate link.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lertsirikarn.blogspot.com/feeds/1350790774055774449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lertsirikarn.blogspot.com/2024/12/amazon-prime-video-review-not-bad.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/1350790774055774449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/1350790774055774449'/><link rel='alternate' type='text/html' href='http://lertsirikarn.blogspot.com/2024/12/amazon-prime-video-review-not-bad.html' title='Amazon Prime Video Review: not bad overall.'/><author><name>saveMightLife</name><uri>http://www.blogger.com/profile/07139052104556306035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6898804038410932940.post-1632300687018394924</id><published>2024-12-06T11:54:00.000-08:00</published><updated>2024-12-06T11:54:00.128-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="baggage storage"/><category scheme="http://www.blogger.com/atom/ns#" term="daily luggage storage"/><title type='text'>Terminal 1 Manila Airport Luggage storage service </title><content type='html'>This information was gathered in 2024.&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;This is how to store your luggage at Terminal 1 of Manila International Airport (NAIA Ninoy Aquino International Airport)&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;First, you have to go to Terminal One Arrival Area where you pick up the luggage from the carousel are.&amp;nbsp;&lt;/div&gt;&lt;div&gt;Then you go to Baggage Assistant Counter. The go to the room on the left, that&#39;s where you store the luggage.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjQPor3G_FWCT7EvKVLx0ctYCkZTO6OOXNxXAIwTSL8lJOqUrcr0M5otYB-cQSvhVPx4Uyf8YV3ubMokXPey008IOixzf0Lx7CuSf5vnQMFzC1jnYh8xTC80Oxn_AwgTB1P4dquDzhbSiQROdmSVubIGJCHjvlCD6jvNrylMd1akBFl-go-j_EISraKA9md&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;
    &lt;img border=&quot;0&quot;   src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjQPor3G_FWCT7EvKVLx0ctYCkZTO6OOXNxXAIwTSL8lJOqUrcr0M5otYB-cQSvhVPx4Uyf8YV3ubMokXPey008IOixzf0Lx7CuSf5vnQMFzC1jnYh8xTC80Oxn_AwgTB1P4dquDzhbSiQROdmSVubIGJCHjvlCD6jvNrylMd1akBFl-go-j_EISraKA9md&quot; width=&quot;400&quot;&gt;
  &lt;/a&gt;
&lt;/div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Hours: 24/7&lt;/div&gt;&lt;div&gt;&amp;nbsp;* Prices: 200 peso per luggage per day, this is the price I was told  in 2024.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lertsirikarn.blogspot.com/feeds/1632300687018394924/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lertsirikarn.blogspot.com/2024/12/terminal-1-manila-airport-luggage.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/1632300687018394924'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/1632300687018394924'/><link rel='alternate' type='text/html' href='http://lertsirikarn.blogspot.com/2024/12/terminal-1-manila-airport-luggage.html' title='Terminal 1 Manila Airport Luggage storage service '/><author><name>saveMightLife</name><uri>http://www.blogger.com/profile/07139052104556306035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEjQPor3G_FWCT7EvKVLx0ctYCkZTO6OOXNxXAIwTSL8lJOqUrcr0M5otYB-cQSvhVPx4Uyf8YV3ubMokXPey008IOixzf0Lx7CuSf5vnQMFzC1jnYh8xTC80Oxn_AwgTB1P4dquDzhbSiQROdmSVubIGJCHjvlCD6jvNrylMd1akBFl-go-j_EISraKA9md=s72-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6898804038410932940.post-6059188396605077328</id><published>2024-10-22T10:46:00.000-07:00</published><updated>2024-10-22T10:47:31.021-07:00</updated><title type='text'>บัญชีออมทรัพย์ที่ต้องมี! เพราะให้อัตราดอกเบี้ยสูงถึง 1.98% จาก LH Bank</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div class=&quot;card p-0&quot; style=&quot;-webkit-text-stroke-width: 0px; background-clip: border-box; background-color: white; border-bottom: 0px; border-image: unset; border-left: unset; border-radius: 0px; border-right: unset; border-top: unset; box-sizing: border-box; color: #333333; display: flex; flex-direction: column; font-family: LHBankHeader; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: 15px; min-width: 0px; orphans: 2; outline: none; overflow-wrap: break-word; overflow: hidden; padding: 2px; position: relative; text-align: left; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div aria-controls=&quot;#about-content&quot; aria-expanded=&quot;false&quot; class=&quot;card-header&quot; data-target=&quot;#about-content&quot; data-toggle=&quot;collapse&quot; id=&quot;about&quot; style=&quot;background-color: transparent; border-radius: 0px; border: medium; box-sizing: border-box; margin-bottom: -1px; outline: none; padding: 0px 0px 19.6px;&quot;&gt;&lt;h1 style=&quot;box-sizing: border-box; color: #333333; font-family: LHBankHeaderBold; font-size: 22px; font-weight: 500; line-height: 1.2; margin-bottom: 15px; margin-top: 0px; outline: none;&quot;&gt;จุดเด่นผลิตภัณฑ์&lt;/h1&gt;&lt;div class=&quot;border-title&quot; style=&quot;border-bottom: 3px solid !important; border-color: currentcolor; border-image-outset: initial; border-image-repeat: initial; border-image-slice: 1; border-image-source: linear-gradient(to right, rgb(206, 214, 41) 3%, rgb(38, 188, 188) 25%, rgb(139, 63, 146) 50%, rgb(237, 128, 104) 75%, rgb(245, 191, 14) 95%); border-image-width: initial; border-left: 0px; border-right: 0px; border-style: none none solid; border-top: 0px; border-width: 0px 0px 3px; box-sizing: border-box; content: &amp;quot;&amp;quot;; margin-top: 0px; outline: none; padding-top: 0px; width: 30px;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div aria-labelledby=&quot;about-header&quot; class=&quot;collapse show&quot; id=&quot;about-content&quot; style=&quot;border-bottom: 1px solid rgb(175, 175, 175); box-sizing: border-box; outline: none;&quot;&gt;&lt;div class=&quot;card-body&quot; style=&quot;box-sizing: border-box; flex: 1 1 auto; min-height: 1px; outline: none; padding: 10.4px 0px 30px;&quot;&gt;&lt;p style=&quot;box-sizing: border-box; color: #666666; font-family: LHBankHeader; font-size: 16px; margin-bottom: 1rem; margin-top: 0px; outline: none;&quot;&gt;บัญชีออมทรัพย์ที่ต้องมี! เพราะให้อัตราดอกเบี้ยสูงสำหรับออมทรัพย์&amp;nbsp;1 ล้านบาท&lt;/p&gt;&lt;ul style=&quot;box-sizing: border-box; font-size: 16px; margin-bottom: 1rem; margin-top: 0px; outline: none;&quot;&gt;&lt;li style=&quot;box-sizing: border-box; outline: none;&quot;&gt;ดอกเบี้ยสูงสุด 5.55% ต่อปี (สำหรับเงินฝากส่วนที่เกิน 9 แสนบาทถึง 1 ล้านบาท)&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; outline: none;&quot;&gt;ดอกเบี้ยเฉลี่ยสูงสุด 1.98% สำหรับเงินฝากยอด 1 ล้านบาท&amp;nbsp;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; outline: none;&quot;&gt;รับดอกเบี้ยรายเดือน ทุกวันที่ 20 ของเดือน&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; outline: none;&quot;&gt;กดเงินไม่ใช้บัตร ฟรี! 4 ครั้งต่อเดือน ที่ตู้ ATM ธ.ไทยพาณิชย์, ธ.กสิกรไทย, ธ.กรุงเทพ, ธ.ก.ส.&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; outline: none;&quot;&gt;สะดวกเปิดบัญชีที่ไหนก็ได้ผ่านแอป LHB You เปิดบัญชีขั้นต่ำเพียง 500 บาท&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; outline: none;&quot;&gt;ฝาก ถอน โอน จ่ายสะดวก พร้อมรับโปรโมชันพิเศษทุกเดือนที่แอป LHB You&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; outline: none;&quot;&gt;สามารถรับสมุดบัญชีเงินฝากได้ที่ทุกสาขาของธนาคาร&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; outline: none;&quot;&gt;เฉพาะลูกค้าใหม่เท่านั้น&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;card p-0&quot; style=&quot;-webkit-text-stroke-width: 0px; background-clip: border-box; background-color: white; border-bottom: 0px; border-image: unset; border-left: unset; border-radius: 0px; border-right: unset; border-top: unset; box-sizing: border-box; color: #333333; display: flex; flex-direction: column; font-family: LHBankHeader; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: 15px; min-width: 0px; orphans: 2; outline: none; overflow-wrap: break-word; overflow: hidden; padding: 2px; position: relative; text-align: left; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div aria-controls=&quot;#interests-content&quot; aria-expanded=&quot;false&quot; class=&quot;card-header&quot; data-target=&quot;#interests-content&quot; data-toggle=&quot;collapse&quot; id=&quot;interests&quot; style=&quot;background-color: transparent; border-radius: 0px; border: medium; box-sizing: border-box; margin-bottom: -1px; outline: none; padding: 0px 0px 19.6px;&quot;&gt;&lt;h1 style=&quot;box-sizing: border-box; color: #333333; font-family: LHBankHeaderBold; font-size: 22px; font-weight: 500; line-height: 1.2; margin-bottom: 15px; margin-top: 0px; outline: none;&quot;&gt;อัตราดอกเบี้ย&lt;/h1&gt;&lt;div class=&quot;border-title&quot; style=&quot;border-bottom: 3px solid !important; border-color: currentcolor; border-image-outset: initial; border-image-repeat: initial; border-image-slice: 1; border-image-source: linear-gradient(to right, rgb(206, 214, 41) 3%, rgb(38, 188, 188) 25%, rgb(139, 63, 146) 50%, rgb(237, 128, 104) 75%, rgb(245, 191, 14) 95%); border-image-width: initial; border-left: 0px; border-right: 0px; border-style: none none solid; border-top: 0px; border-width: 0px 0px 3px; box-sizing: border-box; content: &amp;quot;&amp;quot;; margin-top: 0px; outline: none; padding-top: 0px; width: 30px;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div aria-labelledby=&quot;interests-header&quot; class=&quot;collapse show&quot; id=&quot;interests-content&quot; style=&quot;border-bottom: 1px solid rgb(175, 175, 175); box-sizing: border-box; outline: none;&quot;&gt;&lt;div class=&quot;card-body&quot; style=&quot;box-sizing: border-box; flex: 1 1 auto; min-height: 1px; outline: none; padding: 10.4px 0px 30px;&quot;&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;15&quot; style=&quot;border-collapse: collapse; box-sizing: border-box; font-size: 1.2em; margin-bottom: 0px; outline: none; width: 100%;&quot;&gt;&lt;tbody style=&quot;box-sizing: border-box; outline: none;&quot;&gt;&lt;tr style=&quot;box-sizing: border-box; outline: none;&quot;&gt;&lt;td align=&quot;center&quot; style=&quot;background: rgb(24, 29, 86); border: 2px solid rgb(255, 255, 255); box-sizing: border-box; color: white; font-weight: bold; outline: none;&quot;&gt;วงเงินฝาก&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;background: rgb(150, 136, 98); border: 2px solid rgb(255, 255, 255); box-sizing: border-box; color: white; font-weight: bold; outline: none;&quot;&gt;อัตราดอกเบี้ย (ต่อปี)*&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box; outline: none;&quot;&gt;&lt;td align=&quot;center&quot; style=&quot;background: rgb(239, 239, 239); border: 2px solid rgb(255, 255, 255); box-sizing: border-box; outline: none;&quot;&gt;เงินฝากส่วนที่ไม่เกิน 100,000 บาท&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;background: rgb(239, 239, 239); border: 2px solid rgb(255, 255, 255); box-sizing: border-box; font-weight: bold; outline: none;&quot;&gt;&lt;b style=&quot;box-sizing: border-box; font-weight: bolder; outline: none;&quot;&gt;0.25%&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box; outline: none;&quot;&gt;&lt;td align=&quot;center&quot; style=&quot;background: rgb(222, 222, 222); border: 2px solid rgb(255, 255, 255); box-sizing: border-box; outline: none;&quot;&gt;เงินฝากส่วนที่เกิน 100,000 บาท ถึง 900,000 บาท&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;background: rgb(222, 222, 222); border: 2px solid rgb(255, 255, 255); box-sizing: border-box; font-weight: bold; outline: none;&quot;&gt;&lt;b style=&quot;box-sizing: border-box; font-weight: bolder; outline: none;&quot;&gt;1.75%&lt;/b&gt;&lt;br style=&quot;box-sizing: border-box; outline: none;&quot; /&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: normal; outline: none;&quot;&gt;(เฉลี่ย 0.25% - 1.58%)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box; outline: none;&quot;&gt;&lt;td align=&quot;center&quot; style=&quot;background: rgb(239, 239, 239); border: 2px solid rgb(255, 255, 255); box-sizing: border-box; outline: none;&quot;&gt;เงินฝากส่วนที่เกิน 900,000 บาท ถึง 1 ล้านบาท&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;background: rgb(239, 239, 239); border: 2px solid rgb(255, 255, 255); box-sizing: border-box; font-weight: bold; outline: none;&quot;&gt;&lt;b style=&quot;box-sizing: border-box; font-weight: bolder; outline: none;&quot;&gt;5.55%&lt;/b&gt;&lt;br style=&quot;box-sizing: border-box; outline: none;&quot; /&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: normal; outline: none;&quot;&gt;(เฉลี่ย 1.58% - 1.98%)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box; outline: none;&quot;&gt;&lt;td align=&quot;center&quot; style=&quot;background: rgb(222, 222, 222); border: 2px solid rgb(255, 255, 255); box-sizing: border-box; outline: none;&quot;&gt;เงินฝากส่วนที่เกิน 1 ล้านบาท ถึง 3 ล้านบาท&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;background: rgb(222, 222, 222); border: 2px solid rgb(255, 255, 255); box-sizing: border-box; font-weight: bold; outline: none;&quot;&gt;&lt;b style=&quot;box-sizing: border-box; font-weight: bolder; outline: none;&quot;&gt;1.50%&lt;/b&gt;&lt;br style=&quot;box-sizing: border-box; outline: none;&quot; /&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: normal; outline: none;&quot;&gt;(เฉลี่ย 1.98% - 1.66%)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;box-sizing: border-box; outline: none;&quot;&gt;&lt;td align=&quot;center&quot; style=&quot;background: rgb(239, 239, 239); border: 2px solid rgb(255, 255, 255); box-sizing: border-box; outline: none;&quot;&gt;เงินฝากส่วนที่เกิน 3 ล้านบาท ถึง 100 ล้านบาท&lt;/td&gt;&lt;td align=&quot;center&quot; style=&quot;background: rgb(239, 239, 239); border: 2px solid rgb(255, 255, 255); box-sizing: border-box; font-weight: bold; outline: none;&quot;&gt;&lt;b style=&quot;box-sizing: border-box; font-weight: bolder; outline: none;&quot;&gt;0.25%&lt;/b&gt;&lt;br style=&quot;box-sizing: border-box; outline: none;&quot; /&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: normal; outline: none;&quot;&gt;(เฉลี่ย 1.66% - 0.29%)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;card p-0&quot; style=&quot;-webkit-text-stroke-width: 0px; background-clip: border-box; background-color: white; border-bottom: 0px; border-image: unset; border-left: unset; border-radius: 0px; border-right: unset; border-top: unset; box-sizing: border-box; color: #333333; display: flex; flex-direction: column; font-family: LHBankHeader; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: 15px; min-width: 0px; orphans: 2; outline: none; overflow-wrap: break-word; overflow: hidden; padding: 2px; position: relative; text-align: left; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div aria-controls=&quot;#Conditions-content&quot; aria-expanded=&quot;false&quot; class=&quot;card-header&quot; data-target=&quot;#Conditions-content&quot; data-toggle=&quot;collapse&quot; id=&quot;Conditions&quot; style=&quot;background-color: transparent; border-radius: 0px; border: medium; box-sizing: border-box; margin-bottom: -1px; outline: none; padding: 0px 0px 19.6px;&quot;&gt;&lt;h1 style=&quot;box-sizing: border-box; color: #333333; font-family: LHBankHeaderBold; font-size: 22px; font-weight: 500; line-height: 1.2; margin-bottom: 15px; margin-top: 0px; outline: none;&quot;&gt;หมายเหตุ&lt;/h1&gt;&lt;div class=&quot;border-title&quot; style=&quot;border-bottom: 3px solid !important; border-color: currentcolor; border-image-outset: initial; border-image-repeat: initial; border-image-slice: 1; border-image-source: linear-gradient(to right, rgb(206, 214, 41) 3%, rgb(38, 188, 188) 25%, rgb(139, 63, 146) 50%, rgb(237, 128, 104) 75%, rgb(245, 191, 14) 95%); border-image-width: initial; border-left: 0px; border-right: 0px; border-style: none none solid; border-top: 0px; border-width: 0px 0px 3px; box-sizing: border-box; content: &amp;quot;&amp;quot;; margin-top: 0px; outline: none; padding-top: 0px; width: 30px;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div aria-labelledby=&quot;Conditions-header&quot; class=&quot;collapse show&quot; id=&quot;Conditions-content&quot; style=&quot;border-bottom: 1px solid rgb(175, 175, 175); box-sizing: border-box; outline: none;&quot;&gt;&lt;div class=&quot;card-body&quot; style=&quot;box-sizing: border-box; flex: 1 1 auto; min-height: 1px; outline: none; padding: 10.4px 0px 30px;&quot;&gt;&lt;ol style=&quot;box-sizing: border-box; margin-bottom: 1rem; margin-top: 0px; outline: none;&quot;&gt;&lt;li style=&quot;box-sizing: border-box; color: #666666; font-size: 16px; outline: none;&quot;&gt;สำหรับบุคคลธรรมดา และมีอายุตั้งแต่ 15 ปีขึ้นไป ที่ไม่เคยมีผลิตภัณฑ์ใดๆ กับทางธนาคารมาก่อน (ลูกค้าใหม่ / New CIF) เปิดบัญชีในนามบุคคลธรรมดา (ไม่สามารถเปิดบัญชีร่วมได้)&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; color: #666666; font-size: 16px; outline: none;&quot;&gt;ธนาคารฯ ขอสงวนสิทธิ์รับเปิดบัญชีลูกค้า 1 ราย ต่อ 1 บัญชีเท่านั้น (ทุกสาขา/ทุกช่องทางรวมกัน)&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; color: #666666; font-size: 16px; outline: none;&quot;&gt;จำนวนเงินเปิดบัญชีขั้นต่ำ 500 บาท และไม่มีกำหนดการดำรงเงินฝากขั้นต่ำในบัญชี&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; color: #666666; font-size: 16px; outline: none;&quot;&gt;สามารถใช้ร่วมกับบัตร LH Bank Debit Card ทุกประเภท&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; color: #666666; font-size: 16px; outline: none;&quot;&gt;สามารถสมัครใช้บริการ LHB You (Mobile Banking Application) ได้&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; color: #666666; font-size: 16px; outline: none;&quot;&gt;สามารถผูกบัญชีคู่โอนได้&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; color: #666666; font-size: 16px; outline: none;&quot;&gt;อัตราดอกเบี้ยที่ปรากฏบนสื่ออ้างอิงตามประกาศอัตราดอกเบี้ยของธนาคาร สามารถตรวจสอบอัตราดอกเบี้ย ณ ปัจจุบันได้ที่เว็บไซต์หรือสาขาของธนาคาร&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;box-sizing: border-box; font-weight: bolder; outline: none;&quot;&gt;&lt;a href=&quot;https://www.lhbank.co.th/th/personal/%E0%B9%80%E0%B8%87%E0%B8%B4%E0%B8%99%E0%B8%9D%E0%B8%B2%E0%B8%81/deposit-interest-rates/&quot; style=&quot;background-color: transparent; box-sizing: border-box; color: #39a1cc; outline: none; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;คลิก&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; color: #666666; font-size: 16px; outline: none;&quot;&gt;เงื่อนไขและอัตราดอกเบี้ยเป็นไปตามประกาศของธนาคาร&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; color: #666666; font-size: 16px; outline: none;&quot;&gt;ผลิตภัณฑ์เงินฝากนี้ได้รับความคุ้มครองจากสถาบันคุ้มครองเงินฝากตามจำนวนที่ได้กำหนดไว้ในกฎหมาย&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;card p-0&quot; style=&quot;-webkit-text-stroke-width: 0px; background-clip: border-box; background-color: white; border-bottom: 0px; border-image: unset; border-left: unset; border-radius: 0px; border-right: unset; border-top: unset; box-sizing: border-box; color: #333333; display: flex; flex-direction: column; font-family: LHBankHeader; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: 15px; min-width: 0px; orphans: 2; outline: none; overflow-wrap: break-word; overflow: hidden; padding: 2px; position: relative; text-align: left; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div aria-controls=&quot;#Channels-content&quot; aria-expanded=&quot;false&quot; class=&quot;card-header&quot; data-target=&quot;#Channels-content&quot; data-toggle=&quot;collapse&quot; id=&quot;Channels&quot; style=&quot;background-color: transparent; border-radius: 0px; border: medium; box-sizing: border-box; margin-bottom: -1px; outline: none; padding: 0px 0px 19.6px;&quot;&gt;&lt;h1 style=&quot;box-sizing: border-box; color: #333333; font-family: LHBankHeaderBold; font-size: 22px; font-weight: 500; line-height: 1.2; margin-bottom: 15px; margin-top: 0px; outline: none;&quot;&gt;ช่องทางการเปิดบัญชี&lt;/h1&gt;&lt;div class=&quot;border-title&quot; style=&quot;border-bottom: 3px solid !important; border-color: currentcolor; border-image-outset: initial; border-image-repeat: initial; border-image-slice: 1; border-image-source: linear-gradient(to right, rgb(206, 214, 41) 3%, rgb(38, 188, 188) 25%, rgb(139, 63, 146) 50%, rgb(237, 128, 104) 75%, rgb(245, 191, 14) 95%); border-image-width: initial; border-left: 0px; border-right: 0px; border-style: none none solid; border-top: 0px; border-width: 0px 0px 3px; box-sizing: border-box; content: &amp;quot;&amp;quot;; margin-top: 0px; outline: none; padding-top: 0px; width: 30px;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div aria-labelledby=&quot;Channels-header&quot; class=&quot;collapse show&quot; id=&quot;Channels-content&quot; style=&quot;border-bottom: 1px solid rgb(175, 175, 175); box-sizing: border-box; outline: none;&quot;&gt;&lt;div class=&quot;card-body&quot; style=&quot;box-sizing: border-box; flex: 1 1 auto; min-height: 1px; outline: none; padding: 10.4px 0px 30px;&quot;&gt;&lt;ul class=&quot;pl-0 dashed&quot; style=&quot;box-sizing: border-box; margin-bottom: 1rem; margin-top: 0px; outline: none; padding-left: 0px; text-align: left;&quot;&gt;&lt;li style=&quot;box-sizing: border-box; outline: none;&quot;&gt;&lt;h1&gt;&lt;a href=&quot;https://atth.me/00dswn000l0m&quot; style=&quot;background-color: transparent; box-sizing: border-box; color: #39a1cc; outline: none; text-decoration: none;&quot;&gt;&lt;b&gt;เปิดบัญชีผ่านแอปมือถือ (LHB You)&lt;/b&gt;&lt;/a&gt;&lt;/h1&gt;&lt;div style=&quot;background-color: white; color: black; font-family: Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 14px; font-weight: normal; line-height: 19px; white-space: pre;&quot;&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;a href=&quot;https://atth.me/00dswn000l0m&quot;&gt;https://atth.me/00dswn000l0m&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;h1&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/h1&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; outline: none;&quot;&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;img alt=&quot;B-You Wealth&quot; height=&quot;640&quot; src=&quot;https://www.lhbank.co.th/LH/media/Main/BYouWealth_banner_V2_Web_1.png&quot; width=&quot;388&quot; /&gt; &lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://lertsirikarn.blogspot.com/feeds/6059188396605077328/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lertsirikarn.blogspot.com/2024/10/198-lh-bank.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/6059188396605077328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6898804038410932940/posts/default/6059188396605077328'/><link rel='alternate' type='text/html' href='http://lertsirikarn.blogspot.com/2024/10/198-lh-bank.html' title='บัญชีออมทรัพย์ที่ต้องมี! เพราะให้อัตราดอกเบี้ยสูงถึง 1.98% จาก LH Bank'/><author><name>saveMightLife</name><uri>http://www.blogger.com/profile/07139052104556306035</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>