It is now time for oral questions. I recognize the member for Kiwetnaw. Speaker, my question is with the Premier. We understand clearly that Ontario is working to push mining process, mining access roads to the Ring of Fire area. And has done much of this work while First Nations have been struggling through the pandemic and weren't even able to host meetings to understand how to participate. My question, Speaker, is Ontario prepared to agree that all proposed mines in the Ring of Fire region will be designated to need provincial comprehensive EAs and actually involve the nations who will be impacted? Thank you, Mr. Speaker, and I want to thank the honourable member for his question and welcome his guests to this place today. Mr. Speaker, that's precisely what we're doing. We take our responsibilities through Section 35 of the Charter very seriously. They're affirmed, Mr. Speaker, and they necessarily involve consultation and engagement with Indigenous communities across all of Ontario. In fact, Mr. Speaker, and that's why, for example, with the Far North Act, we heard the communities loud and clear through one of the most extensive consultations in the Far North Act, Mr. Speaker, that was modernized with my colleague at the time, Minister Jakobuski, as he was, and reflected a consensus-based model, Mr. Speaker, on all aspects and any aspects of development in the Treaty 9 area consumed or subsumed by the Nishnabia as well. Mr. Speaker, we'll continue to act in that fashion. Thank you. The supplementary question. I think the same minister said when he answered one of my questions that duty to consult First Nations in Ontario is not law. Speaker, despite the pro-mining posturing, this government hasn't actually set up any real progress in the Ring of Fire. First Nations and mining companies know that nothing is happening there until real partnerships occur. Will Ontario recognize that it has abused the Treaty promises and continued efforts by the Premier to bulldoze the North will lead to conflict, install any real partnerships? Northern Development and Engineering. Mr. Speaker, real partnerships are defined, and some of the leaders are here today, if not all, on various projects across the region, not just of Treaty 9 but Treaty 5, the part that's in Ontario. These are major legacy infrastructure projects, Mr. Speaker, and they reflect a new opportunity, an opportunity for the government to work closely with Indigenous leaders through their economic development corporations, through their political leadership, Mr. Speaker, to ensure that they have the kind of infrastructure they need, the tools that their young people need and want, Mr. Speaker, things like road access, other forms of energy. There are leaders here who represent communities that are still deriving their electricity from diesel. I can't help but think that the honourable member stands against that, Mr. Speaker, the Wattay power connection and other legacy pieces of infrastructure, including companies owned and operated by Indigenous people, Mr. Speaker, stand ready to supply good clean energy to those Northern communities, roads to improve their health, social and economic access to programming, Mr. Speaker, and that's what this government does best, and that's what will continue to work. Final supplementary. Speaker, this government abandoned dialogue on shared decision-making that was under way years ago and is at the heart of the treaty promise to work together and share the land. And right now, Speaker, that is not happening. Well, Ontario commit to negotiating in good faith that First Nations and Canada to develop a new decision-making regime for the North that can actually encourage some development by ensuring First Nations have real authority to say yes or no to major developments in their homelands. Minister. Good news is, Mr. Speaker, that that's actually what's happening on the ground. And as I mentioned earlier, some of the leaders that are here today and some of the projects that we've been working on, some of the major milestones in child welfare, I see my long-standing friend and the leader of Kitchener-Makusa Ben-Anawag here today, Mr. Speaker. These reflect the willingness of this government, the desire to work together on legacy pieces of infrastructure, economic development opportunities, Mr. Speaker, and social and health programming that improve the fortunes of these communities. Now, with respect to any development, Mr. Speaker, the Minister of Environment, for example, the Minister of Mines, we've all gathered together, Mr. Speaker, to ensure that the government's priorities are to support the priorities of the indigenous communities in and around major resource projects, Mr. Speaker, that the legacy requirements to support them are really about the enhancements to those communities. New forms of energy. Response. No to diesel, Mr. Speaker. Yes to clean energy supply. Yes to better access to health and social programs in some of our isolated communities, Mr. Speaker, who still don't have access to those kinds of... Thank you very much. The next question, the member for Scarborough Southwest. Thank you very much, Speaker. My question is to the Premier. The Eglinton LRT has been under construction for 12 years. It has also spiralled beyond its estimated cost from the original $5 billion to nearly $13 billion and it's likely to rise as well. While the consultants building this project keep racking up the bill, we get faulty LRT platforms. In fact, stations that are broken up and taken away in dump trucks. Speaker, taxpayers whose hard-earned dollars are funding this project, long-suffering residents, businesses that actually went bankrupt and had to close down are all looking for answers. They want transparency. So my question to the Premier is, how much more money? How much more of people's hard-earned dollars will your government waste? The Associate Ministry of Transportation. Thank you very much, Speaker. This government shares the frustrations of those residents and businesses that have been affected by this project, which was of course started by the Liberals and we're going to do it better. We're going to make sure we finish the job and learn from their mistakes. In fact, that's the very first thing we did in 2018 by introducing the Building Transit Faster Act, which said, let's simplify the process. You know, I'll give you one example, Speaker. The reason there's years of delay into this process is that every time you want it to break ground on a station, you need to get a different permit for every station down the line. We streamlined that, so one permit would actually clear the process and get it done faster. That's how the Edlington West extension is more than 50% dug a month ahead of schedule on the record transit expansion this government is introducing. Speaker, we wish we could turn back time and fix the Liberals' mistakes from the beginning, but we can't do that. What we can do is learn from them and make sure we do it better. Moving forward, that's exactly what we're going to do. Record transit is coming to the great people of Toronto and this province. Back to the minister. After over a decade of construction with numerous delays and billions of dollars over budget, this government said that the Crosstown was finally going to open in 2023, this year. Now, when the project is supposed to be near completion, it is troubling to see newly built, never used stations being ripped out with absolutely no information. Minister, people across Toronto are wondering what is going on with the Edlington Crosstown LRT project. Will it ever open? Thank you, Speaker. The member asked for information. We're happy to provide that. This government is not only building record transit. We want to make sure that we open it safely. We all see what happens when you rush transit projects to open. Like in the case of the Ottawa LRT, I'm sure the member from Orleans would have a lot to say about that and how not to actually open transit. Speaker, that's why we're taking our time. The Sloan platform was made out of a section of concrete that was identified through a strict and rigorous process that it was not up to the standards that was ready to introduce transit for people to make it safe to ride. Speaker, this government can not only build that record transit. We're going to make sure we do it right so that it's safe and that it's enjoyed for generations to come. We know hundreds of thousands of people are moving here and here. We're increasing the subway grid by 50%. Investing more dollars than any government has ever done, Speaker. That includes the opposition who supported the Liberals while for decades, they simply did nothing to build transit and connect to grid. We're getting it done for commuters in Ontario. Thank you, Speaker. Back to the Premier. You know, we've talked to the neighbours around the solicitation of the Eglinton LRT. Do you know what they tell us, Speaker? There's a smell coming from that station and it's not construction dust. The smell is corruption. So what about some specific questions? Yeah, I'm going to ask the member of the draw. Draw. What about some specific questions? What about Brian Guest, the disgraced consultant who helped build the Auto LRT that this government fired in January and that the Minister of Transportation promised this house there would be an investigation into Mr. Guest? Well, I've FOI'd it, Speaker. There has been no investigation into Brian Guest. The costs keep getting racked up. So the question we need to have answered in this house is how many more consultants like Mr. Guest are going to get rich while cross-town costs go through the roof? How many more deficient projects are they going to build? And more importantly, Speaker, will this government today, as it did when we demanded it from Ottawa, declare a public inquiry into this mess? Simple answer to the question. Yes or no? The Association of Minister of Transportation. Wow, Speaker. The irony from the fiscally-conservative new Democrats of Ontario this morning standing up when the cameras are on and pretending to be the defenders of transit went for decades. They supported the Liberals when they did absolutely nothing to expand the grid or improve rider experience. Speaker, in fact, when the cameras were off, not only did they say that they supported transit when they were on, they actually voted against the Building Transit Fast-Rest. They said no to the Edlington West extension. They said no to the Young North extension. They said no to the fine people of Scarborough and the Shepherd East extension. And, Speaker, they said no to the Ontario line. They said no to transit that runs through their own riding, Speaker. And now they say no to modernizing transit to expanding the grid, Speaker. They say no to more fare options. Speaker, this is a party of no when it comes to transit. This government is getting it done for commuters in Ontario. House will come to order. Thank you. Start the clock. The next question. The member from Raschkegawech James Bay. Thank you, Speaker. Several 3D9 First Nations and their law firm are here to announce their legal case to end unilateral crime decision. For years they have been ignored, denied their decisional making rights, and they have had enough. It is imperative that this government to respect 3D9 and start working with and alongside First Nations to ensure growth and prosperity like the rest of the province. To the Premier, will this government ensure pre-informed consent for equal opportunity and collaboration at the decision making level going forward with all First Nations? Mr. Northern Development and Indigenous Affairs. Thank you, Mr. Speaker. I won't talk to matters that are before the courts, but I will discuss Kenogamasus Economic Development Corporation, the Wabun Tribal Council, Five Nations Energy, Takwatagamu Nation Economic Development. These are just a few of the examples of communities that work in the 3D9 area. Their economic development companies owned and operated in whole or in part by Indigenous business leaders, Mr. Speaker, who are transforming and see the opportunity to ensure that Indigenous communities, particularly those most remote and isolated have access to the kind of infrastructure many people across Ontario have taken for granted. They're interested in consensus, an economic opportunity to improve the economic prosperity of the members of their communities, and to grow their businesses, Mr. Speaker. That's what's going to rally behind all day. I know that the Indigenous leaders support that kind of growth and development and we're going to continue to work together, Mr. Speaker, with common interests and consensus at the heart and soul. Thank you. A supplementary question. Wake up, Premier. These First Nations are suing your government. The First Nations are here and they're saying this government is not collaborating. We've seen it time and time again. Auto up a scat. Extension for reserve. Communities cannot even expand because they're land law. Think about this on their traditional territories. Boilwater advisory for 30 years and it's still happening. Cacheteria and relocation. Not even the road built, nothing has moved forward and yet again they're being evacuated. Not to mention the Boilwater advisories, the opioid crisis, the lack of health services, housing and much more that First Nations are facing. I ask again, will this government respect First Nations rights and get consent? Minister. That question flowed a little more smoothly, Mr. Speaker. It'd be easier to unpack, but first of all, let's just talk about the relocation of Cassatchewan, Mr. Speaker. We were pleased obviously to sign an agreement a couple of years ago to move forward on that. Unfortunately it has faced some delays and we're hopeful that two communities who have a vested interest in that, Cassatchewan and moving and Fort Albany, Mr. Speaker its neighbor, come to some consensus around how and when that will take place so that we can do the appropriate assessments and move that forward. But otherwise, Mr. Speaker, we're going to continue to focus on the economic development projects that the community members and Indigenous business leaders, Mr. Speaker, who want to transform the region, Mr. Speaker, to ensure that their communities and ensure that their businesses thrive. The young people have a job in the line of sight, Mr. Speaker. We're going to support the training. We're doing that all across Northern Ontario and I look forward to the opportunity to work with those communities on specific projects. Thank you. Order. Elgin Middlesex London. Thank you, Speaker. My question is the Minister of Economic Development, Job Creation and Trade. Take a seat. We can't tolerate outbursts from the galleries. That's a true fact. You come to our tradition and planetary get our preconceptions. Yeah, you're not going to move the order. Order. Restart the clock. Member for Elgin Middlesex London Mr. Speaker. Thank you, Speaker. My question is the Minister of Economic Development, Job Creation and Trade. Thanks to this government's efforts. Ontario is ushering in the next boom of its auto manufacturing sector, which will be a continued catalyst for economic growth and development for decades and decades to come. Ontario auto is back, Speaker, and the latest Volkswagen sector in the region. Speaker, in addition to the local benefits, will the Minister please tell us what this means for businesses and workers across the entire supply chain? Minister of Economic Development, Job Creation and Trade. Volkswagen's $7 billion investment will solidify a brighter future for tens of thousands of auto workers. Over 3,000 direct and total. Major suppliers will be required to produce products that we're unfamiliar with in Ontario. Cathode, anode, separators, copper foil, lithium hydroxide. These are all billion-dollar companies that will land in Ontario. We're headed back to Germany to plan a series of supplier days, Speaker, where we're going to match Volkswagen and other Ontario companies. And this will solidify Ontario's position not only as the EV centre, but also as the best place in the world to do business, to invest, to live, and to grow. Speaker, we are building an EV sector that will continue to create good-paying jobs for generations. Supplementary question. Well, thank you, Speaker, and thank you to the Minister for his detailed response. In the last few months, we have seen people like Volkswagen follow on the government's success in attracting a string of landmark auto manufacturing investments. Much like Volkswagen will transform Elgin County, St. Thomas in London for years and years to come. Ford, Honda, GM, next door, Humacors, Stalantis and Magna will do very much the same. Speaker, will the Minister explain why in the last two and a half years we have been able to see investment. Minister of economic development. Since taking office in 2018, we have reduced the cost of doing business in Ontario by $8 billion annually. With our 2019 Driving Prosperity Plan, we committed to building the cars of the future here. Our plan outlined an entire EV value chain from critical minerals in the north to the manufacturing might in the south, a future where we produce clean steel batteries, parts connected in autonomous engineering, cars of the future and recycling of the finished batteries. That was our plan, and that future speaker is now $25 billion in auto investments in just two and a half years. That's the story of Ontario, and that story will continue with Ontario as the global leader in the EV supply chain. Thank you very much, Speaker. My question is to the Premier. This Premier and Minister of Infrastructure are painting the Ontario Science Centre as a tear-down, but it isn't. They've seen record attendance. I encourage folks and families to visit them and explore and enjoy their brilliant exhibits. What is true, Speaker, is that capital repairs and building renewal are years behind. And fun fact, according to the Ontario Science Centre's 2022-2023 business plan, infrastructure Ontario is technically the Science Centre's landlord. The Minister says the Science Centre is falling apart. However, the business plans say nothing of the sort. What the Ontario Science Centre needs is for the government to cough up the needed funds and make the repairs. So my question to this Minister is, will she keep withholding the funding needed or pay up? Thank you, Mr. Speaker, and thanks for my mild support around me and the table. It's a great question, and I appreciate it because I also know you understand that the tourism piece, when we're talking about Ontario Place and specifically the Science Centre, but a broader picture of what's going to happen. Good analogy may be an old car that still runs and does awfully well. Gas mileage is not great, but after a while you have to find a new one. You've had great memories, it can still work, but you have an opportunity to get a newer model, something special, something that is more efficient, something that will carry more people. And when we talk about the movement of the Science Centre, we talk about an opportunity, and I paraphrase our Premier, a world-class destination. We're talking about tourism. We want people to come into Ontario because as they're coming in, they stop and buy gas, they buy lunch, they'll spend longer and greater periods of time in the city around what's going to be built because it will be world-class, Mr. Speaker. So, that's your question. Thank you and again, hopefully to the Premier. According to the Science Centre's 2019-2020 business plan, the 10-year deferred maintenance costs were $147.5 million. $147.5 million is real money, but it is far less than the cost of the Premier's proposed parking garage at Ontario Place. The Minister no doubt realizes that being a better landlord and doing the necessary repairs would be far less costly than building a whole new Science Centre. So unless the Minister is planning to shrink the Science Centre, the Minister knows she can't rebuild a new one for less than the cost of repairs and knows that there isn't money in the budget for this. So my question is, what is the Premier's actual plan for the Ontario Science Centre and what is it going to cost Ontario? Mr. Speaker, we're going to revitalize Ontario Place. We're going to have a world-class destination. We're going to have a Science Centre, state-of-the-art, worldwide. You know, the students up there, they've never experienced Ontario Place because the Liberals and the NDP have closed it for what, so 12 years now, there's weeds growing up, it's decrepit. We're going to build a great live-nation amphitheater. We're going to make sure that Science Centre is there, world-class 300,000 square feet with exhibits. We're going to make sure that Thurmay, wouldn't you love to go to a water park at Ontario Place, have fun. There's going to be public space, there's going to be green space all throughout there. We're a government that gets it done. You guys talk, we make it happen. That's the difference. I have the members to make their comments through the chair. Order. Order. Order. We have a member who is anxiously awaiting the opportunity to ask a question. Order. Start the clock. The member for Peterborough, Coortham. Thank you, Speaker. My question is for the Minister of Northern Development and Indigenous Affairs. The previous Liberal government drove jobs out of our province and failed to unlock Ontario's full economic potential. The negative results of their destructive economic policies left many behind, including those particularly in rural, remote and Indigenous communities across Northern Ontario. In contrast, our government must be focused on solutions so that Ontarians have an opportunity to participate in our growing economy. Many Indigenous businesses are already operating across the north and there are many more opportunities to create and expand businesses. It's vital that our government continues to work with the Indigenous partners to make targeted investments that will help Indigenous entrepreneurs and businesses to thrive. Speaker, can the Minister please explain what actions our government is taking to increase the economic prosperity in partnerships with Indigenous communities? For Northern Development and Indigenous Affairs. Thank you, Mr. Speaker. I've already cited a few examples of some economic development corporations acting on behalf of the collective interests of partner First Nations, Mr. Speaker, but it's in fact not limited to Northern Ontario. My colleague, the Minister of Economic Development, Job Creation and Trade, last week with the Premier and the Prime Minister of Canada, highlighted a world-scale, world-class announcement that's going to involve, Mr. Speaker, the participation of a treaty council in that corridor, Mr. Speaker, that's excited about the opportunity to participate, whether it's developing energy infrastructure, corridor infrastructure in general, Mr. Speaker. Other businesses that in this supply chain, Mr. Speaker, my colleague, the Minister of Energy and I had participated in an exercise with the Sixth Nation of the Grand River Development Corporation. Response? These are all examples of large-scale infrastructure projects that go to the heart and soul of Ontario's capacity for economic development, Mr. Speaker, and they're partly or wholly on fire. Thank you. A supplementary question. Thank you, Speaker. And through you, thank you to the Minister for his response. It demonstrates just a few examples of our government's commitment to reconciliation and creating opportunities to strengthen relationships with Indigenous partners. Businesses are only one part of a vibrant economy, though. There are many other ways to amplify prosperity and build a stronger community in Ontario. Individuals, families, businesses and communities can all succeed when they have the tools, training and supports they need. Investments that help build capacity will go a long way in promoting long-term economic growth. Speaker, can the Minister please explain how our government is supporting growth and prosperity for Indigenous communities? Thank you, Mr. Speaker. Under the leadership of our Premier, we sat down with the Ontario regional chief, Glen Hare, and his economic development team, Mr. Speaker. And we accepted at face value their amazing proposal to do supply chain mapping, Mr. Speaker, to provide loan and grant combinations for Indigenous-owned and operated businesses to move forward on a host of exciting proposals that cover the province of Ontario. Last week, coming closer to home out in Canora Rainy River, the Windenumic Corporation, Mr. Speaker, largely responsible for most of the work that's going on to twin the Trans-Canada Highway, Mr. Speaker, had the full support of this government as we move forward on training 50 more young people, Mr. Speaker, to build our highways. The same opportunity exists into the corridor to prosperity, Mr. Speaker. An opportunity in the central part of Northern Ontario to ensure that they have road access to better programming and services, good jobs, good paying jobs for Indigenous young people, Mr. Speaker. That's what we hear on the ground, and that's what we're responding to in consensus and full partnership with Indigenous business leaders and political leaders. Thank you, Mr. Speaker. Next question, Member for Spadina, Fort York. Thank you, Mr. Speaker. My question is to the Premier. My best friend lives in Minden, Ontario in February that he was in a head-on collision, and the worst injuries were suffered by his wife. She had many broken bones and whiplash. My friend, his wife, and his mother were all rushed to the Minden Emergency Room in separate ambulances. And they said that the first responders and the hospital staff were fantastic. But last week, they found out that this government is closing Minden's emergency room on June 1. Halliburton, the next nearest hospital would have been 45 minutes away. Will this government stop the closure of the Minden ER and the people of Minden have access to life-saving emergency services? Good afternoon, Mr. Premier and Minister of Health. I'm glad that the member opposite's best friend and his family members have excellent service. It is a story, frankly, that I hear regularly when people have to access healthcare services in the province of Ontario. Ontario Health has been, we have been in discussions with them, and I have been assured that the Halliburton Highlands Health Services Board has approached this decision in the best interests of the community. This is a decision made by the hospital with the support of the hospital board. It is independent of any decisions that we make at the ministry level. Thank you. I don't know how closing down an emergency room can be in the best interest of a community. Again, to the Premier, the Halliburton Highlands Health Services said that the Minden ER closure was due to a shortage of nursing and medical staff. For the past five years, this government has been fuelling the staffing shortage and creating a crisis on Ontario's public health system in order to privatise it. They could address the staffing shortage by repealing Bill 124. They could stop promoting private-for-profit clinics that are draining healthcare staff from public hospitals and they could support public, not-for-profit hospitals like the one in Minden. Will this government admit that the Minden Emergency Room and the people of Minden are victims of its quest to create a crisis and privatise public healthcare in Ontario? Minister of Health. Absolutely not. The Halliburton Highlands Health Services budget has actually increased by over 11% since 2018. But I want to remember, I want to remind the member opposite, that these are decisions made by a volunteer community member board that live in the community and are looking out for the best interests of those communities. And for the member opposite to suggest that he knows better that the volunteer base board than the CEO, than the individuals who work in that facility is patently false. I want to remind the member that the actual member from Halliburton Court that likes Brock has been in close contact with the board and the CEO through this entire process and remind the member that this is a local decision that they have made in the best interest to serve their community in the long term. Thank you. Question to the member for Kingston and the Islands. Thank you Mr. Speaker. Yesterday this government announced free tuition at the Ontario Police College. That's great. But what about all the other jobs in the economy where we lack skilled workers? Why isn't there a plan? The Collapse of Laurentian University warned about the fragile finances of colleges and universities. Now Guelph is suddenly pausing 16 programs. A student who is expecting to study medical physics in the fall cannot. Medical physics. The people who run the big machines in hospitals. Why isn't there a plan for education? Is there no plan even in the secret mandate letters? Look at our electricity system. Years lost because this government cut conservation, renewable energy, delayed investing and storage all while we knew since 2017 that demand was going to increase. Their natural gas plan idea will collide with the federal government's plan to fight climate change with clean electricity incentives and regulations.  To reply. House leader. I actually appreciate the question from the Honourable Member because it was literally a calling card for every single failed policy that brought this province to its knees under the previous liberal government. Every single thing he talked about, actually we had to reverse so that we could bring back thousands of jobs. The policies of the previous liberal government created an energy crisis in the province that cost, that cost manufacturers hundreds of millions of dollars that cost homeowners. They had to make the decision between heating and eating. We saw students fleeing the province of Ontario. We saw opportunity fleeing the province of Ontario. They did literally nothing to combat our G. I apologize to the government house leader. A member for Ottawa South must come to order. I can't hear the government house leader. Government house leader has the floor. I'd almost like to seek an enormous consent of the entire house so that he could ask that question again so that the people of the province of Ontario can remember the two elections. They're still only at eight people in the province of Ontario. They're still only at eight people in the province of Ontario. Speaker, does this government really plan last night the Norwich Township Council passed motions having the effect of banning progress and pride flags on municipal property and rejecting Pride Month. Is it discrimination? Well, this government has allowed a backlog of two years to accumulate at the human rights tribunal. It waited for a crisis, waited for thousands of small landlords and tenants to be hurt before putting adequate resources into the landlord and tenant board. Is there a plan for the justice system? The government said it was triple checking the business case for tearing down and moving the sign centre. Then it said there was no business case to release. Then it said the site could be used for other purposes. This government is shooting down the property of the province of Ontario. It's been a long time since it was a long time since there were other purposes. This government is shooting from the hip. With the help of a developer, they have a plan for Ontario place, but there's no plan for Ontario. Who's in charge? I'm a house leader, can reply. I'll tell you who's in charge, Mr. Speaker. I'll tell you who's in charge. It's the Premier of the province of Ontario who's brought back thousands of jobs to the Liberals out of their misery and restored hope and opportunity to the province of Ontario. You remember, you tried to build transit but couldn't get it done. This premier in office for a couple of months and built the biggest transit infrastructure program in the history of the country.  We're going to build 60,000 new and upgraded long-term beds. You also remember that manufacturers were leaving in droves. It was this premier with this economic development minister who brought back $25 billion worth of investment in the auto sector when you were saying we had to transition to a service economy. It was this premier who brought back the energy sector. The member for Ottawa South come to order. I think there's a point that needs to be clarified. For a supplementary question to be valid, it has to have some relationship to the original question. Same subject. And follow and flow from the original question and the original response from the government. But the speaker has to be able to hear the member who has is asking the question to ascertain whether or not it does follow and flow. So it asks the indulgence of the House to assist me in this regard. And we have a member who is awaiting the opportunity to ask a question. We'll start the clock. The member for Chatham Camp Leamington. Thank you speaker. My question is for the Minister of Education. The classroom must always be a safe place for students to focus on the necessary life, job, and critical thinking skills that they need to succeed. Students and staff in Ontario schools need to know that when they go to school they'll be free from physical harm. Students and staff should never be afraid to go to school. And parents must be assured that their children are safe and secure in our schools. In order to do this our province needs to invest in schools and partner closely with community organizations that will support our young people in their everyday lives. Speaker, can the minister please explain what actions our government is taking to protect the safety and well-being of both our students and our staff? Minister of Education. Thank you very much, Mr. Speaker. I want to thank the member from Chatham Camp Leamington for his service as an officer and someone who wore the uniform, keeping families safe. And while we stand with the member from Chatham Camp Leamington, we stand with all law enforcement ensuring children and communities are safe in the rise of violent crime in this country. Mr. Speaker, we just announced on Monday an additional $23 million investment specifically to combat crime and as well as violence bullying happening within our school system. Part of that is a partnership with the Pinball Clemens Foundation, expanded to many school boards across Ontario, designed specifically to offer counseling, leadership and career development for kids at risk. We announced a 38% expansion of the focus on youth program. 28,000 kids are benefitting. This is an investment across school boards to encourage them to get access to jobs and mentorship development. Mr. Speaker, we've also announced a partnership with Sheldon Kennedy's Respect Group to help countering bullying in schools. And most importantly, anchored by a $100 million investment in mental health, a 500% increase from the former Liberals. This is going to help keep kids safe right across Ontario. Supplement question. Thank you, Mr. Speaker. It's very encouraging that our government is to taking decisive measures to promote safety in our schools. Each generation of students faces their own challenges inside and outside the classroom. Physical and online bullying affects students in every part of our province. And the negative effects of bullying can impact students for a lifetime. Students must be protected and supported beyond their classrooms and school property. Our government must take action to address these serious issues that many children will sadly encounter. Ontario must have a plan to combat this severe issue and keep our students safe. Speaker, can the minister please explain what our government is doing to ensure the safety of students inside the classroom and beyond it? Minister of Education. Thank you very much to a member for this important question. The first is the zero tolerance approach we took in the Better Schools and Student Outcomes Act, where we have been, through legislation, ensured that any educator that is convicted of a crime, a very serious crime with respect to sexual exploitation of a child receives a lifetime ban. They will never be able to teach in the province of Ontario. We have also required every educator to have fulfilled a sexual abuse prevention training this past September. That extended to all teachers and all early childhood educators the first province to do so. We were the first province to mandate that every school has an anti-sex trafficking plan to counter the rise of trafficking, particularly in the province of the 400 series highways. It is so prevalent in our communities. We are the first province who have mandated within the curriculum learning specific to cyberbullying, to privacy, to healthy relationships and to consent. This is important as we build a young generation of kids who understand how they themselves be part of the solution of the deterring crime. We are all in this together. We are committed to working with everyone in the college of teachers, the faculties, unions and boards to make sure schools are safe for young people. I really hope that that and I'll read up on this part also. Thank you, Mr Speaker, our question is for the premier. You heard what happened at Minden hospital. Now let's go to Carlton Please Hospital where the local hospital was forced to close its emergency department overnight b cus they weren't enough staff to keep it open. A week before it was months. Ontario had exactly one. One in plan emergency room closure in the last 15 years. But in the last year alone we've now had a hundred and sixty. A hundred and sixty emergency room closure in a single year. This is a normal speaker and we should not pretend that it is. What new measure will the Premier take today to stop the closure of emergency rooms across our province? So one of the really important measures that is embedded in Bill 60 and the your health document I hope the member will seriously consider supporting because it is an as-of-right program that ensures individual clinicians who are practicing in any other Canadian jurisdiction can come to Ontario and immediately start working here in Ontario in communities. You know that is one very specific example where we would have been able to work with the College of Nurses of Ontario to make sure that people who have trained in other jurisdictions are able to quickly get their qualifications assessed and approved if appropriate. You know another important initiative the Minister of Colleges and University has really been a true leader in the learn and stay program where we are able to provide tuition and cover books for students who want to practice those nurses and other critical care health care providers and we've had a historic number of students apply for those programs because they want to participate. 160 emergency room closure in one year under this Minister's watch. Let's go to Chelsea and Chelsea right now if a child's required care on a Saturday they are out of luck. Their local emergency room is now closed evenings and weekend due to staff shortages. People there are worried that this is a sign that the end is near for this hospital. The member of Bruce Grey-Owen Sound said that he wants Chelsea hospital to return to full service but after 10 years on the job it does not look good speaker. What would the Premier agree that the people of Chelsea deserve a full-time emergency room? What will the government do to keep the emergency rooms open in our province? When the member highlights the challenges of making sure that we have sufficient HHR health human resources she doesn't also acknowledge the important work and the ability to support those changes whether it is the as of right ensuring individuals who want to come to Ontario can start practicing immediately whether it is the expansion of the undergraduate and postgraduate positions in post-secondary. An expansion that frankly if I could turn back time we wouldn't have had the Liberals or the NDP when they were in government actually tightening up and removing those residency spots and those postgraduate positions you know we are making the investments whether it is in education whether it is in capital bills whether it is in ensuring that we have as many people as possible who wish to practice in the province of Ontario have that right and ability to do so. Thank you. Next question the member for Algoma Manitoulou. Thank you speaker my question is to the Minister of Health. People across Algoma Manitoulou are struggling to access health care. My office is often hearing from individuals and families who are having to wait two three four or more years to be matched with a family doctor through health care connect. The Ontario College of Physicians reported in February that 2.2 million Ontarians are currently without a family doctor. Rural and Northern communities are especially struggling to ensure residents have access to a physician and primary care. In pre-budget consultations this year Dr. Stephen Cooper from Manitoulou and Island told this government that Northern Ontario is facing a shortfall of 350 family doctors and specialists. Dr. Cooper said in his submission it is hard to overstate the consequences for access to care if this trend continues. Question. Speaker what is this government's plan to stop growing to stop the growing shortage of health care professionals in the north? Minister of Health. Thank you speaker the member opposite raises a very important question and I was so pleased earlier this year through the investments of the Ministry of Finance to be able to announce the Blind River Huron Shores family health team in northeast of an additional 1.1 billion million dollars my apologies and this will ensure that they have the ability to hire two new full-time nurse practitioners, two service workers, two new registered nurses, one RPN, one full-time physiotherapist, a system navigator, all that will support over 5,000 orphan unattached patients along the North Shore corridor. These are the investments that our government is making to ensure that communities across Ontario have access to the health care close to home. Thank you speaker. In order to recruit and retain doctors in rural and northern communities this government needs to ensure that a full continuum of care continues and exists across the north. Dr. Chantel Wilson from Manitoulin Island reached out to my office recently about the struggles she is facing practicing in small communities on Western Manitoulin. She said my area has not had access to a home care nurse for two weeks. Dressing changes etc. are coming to my office adding to my already overflowing plate. I feel that providing care to Western Manitoulin including 45 inpatients at the local nursing home will not be sustainable in the not so distant future. Speaker physicians are trying their best to service their communities but without help from this government they are burning out and are being left no choice but to close their practices. Will this minister and this government immediately introduce measures to recruit and retain health care professionals in northern Ontario before more physicians are forced to leave? Mr. Health. Thank you speaker. You know something that would be a particular interest to this member is an investment that the Minister of Colleges and Universities and Health has made at the Northern Ontario School of Medicine we will in fact have an additional 14 undergraduate positions and 22 postgraduate positions. You know those are some of the concrete examples of how we are ensuring that people have community and access and the other of course is the as of rights so that individuals who wish to practice and live in a beautiful part of Ontario have that ability if they are currently in another Canadian jurisdiction they can come immediately with a job offer and start working without having to wait for those long licensor pieces. It's important work and it's work that we're very proud to be able to do as we continue to expand and shore up our health human resources. Next question. The member for Cambridge. Thank you Mr. Speaker. My question is for the Solicitor General. People in my riding and in the province are very concerned about the safety and welfare of animals. Through media reports we hear about situations of neglect cruelty such as inhumane conditions where animals are kept in cramped enclosures and animals are in distress because they don't have the basics like food and water. Other circumstances where animals can be abused includes include the mistreatment of wildlife and animals that are used for entertainment purposes. Abuse neglect and cruelty of any animal cannot be tolerated. The people of our province expect our government to ensure that Ontario animals are protected and treated in a humane manner. Speaker can the Solicitor General please explain how our government is keeping animals safe in our province. Thank you Mr. Speaker and I want to thank my great friend our colleague from Cambridge. Many of us here in this chamber and in the galleries have pets that are part of our families and in our family we have Hal the Rabbit who's 10. After years of neglect from the previous government we passed our government passed the Provincial Animal Welfare Service Act or the PAWS Act. I want to give a special shout out to our great member from Atobicoke Lakeshore who was a great champion and advocate for this. First of its kind the PAWS Act has established a robust transparent and accountable organization staffed by over a hundred qualified and passionate inspectors. Our animal welfare legislation has one of the most severe punishments in the country but Mr. Speaker over the years our inspectors have rescued thousands of animals have levied thousands of orders and charges against abusers because people in Ontario care. With your help we will always bake Ontario a better place for our pet. Thank you very much. Supplementary question. Thank you Mr. Speaker is reassuring and encouraging to hear about additional powers that have come from Provincial Animal Welfare legislation that will ensure that animals and wildlife are protected. However the residents of Cambridge like many other across the province are interested in what additional measures our government will undertake to provide even greater protection for animals. It is important that our government continues to evaluate the effectiveness of current legislation and take action to strengthen laws that will increase compliance and enforcement. Speaker can the Solicitor General please elaborate on how our government is ensuring animal welfare protection is enforced. Thank you Mr. Speaker and again I thank the member from Cambridge for this important question. Mr. Speaker I'm very happy to share good news that in our strengthening safety and modernization justice act that I just introduced yesterday our legislation is moving forward in proposing amendments to the Protecting Animal Welfare Services Act that will address additional compliances and enforcement. We've consulted with the colleges of veterinarians of Ontario and other experts in the field to make sure that we provide strong protection for our animals and this includes enhancing inspector powers and permitting them to immediately remove an animal if it is in critical condition or distress and we're continuing to strengthen compliance and enforcement. We will always keep our animals safe. Next question, the member for University of Bristol. My question is to the Premier. Residents yesterday were shocked to learn that Ottawa is receiving only $845,100 of the $200 million Ontario is giving municipalities to tackle the homelessness crisis. Ontario's second largest city home to a million people facing one of the biggest homelessness crisis it has ever faced is receiving only enough money to build two affordable homes. Curiously, at the same time the minister's own writing received triple what Ottawa got with less than a fifth of the population. Something seems off. Minister, can you provide a full account of where your government's affordable housing funding is going and why? I'd be happy to, Speaker. You know it's interesting that this member asked the question when the person who sits beside her when he was a regional councillor asked the same thing that the auditor general asked and that was to fix the broken formula from the previous government order in a 2021 value for money audit and you can read it right here. It talks about the inequity of that program. We had Mayor Sutcliffe and officials from Ottawa here. We explained the situation to them but we are responding directly to the 2021 auditor general's report where it said for funding equity. So you know who you need to ask, Member? You need to ask the people from Niagara, the people from London, the people from Windsor who were shortchanged on that previous formula. Ask your colleague. Remind the members that can't use props to illustrate their points. Supplementary question. Thank you. Back to the minister. The minister should read the auditor general's report because in that report the auditor general said this government has no plan to end homelessness. Every city and every town in Ontario is facing a housing affordability crisis and a homelessness crisis which is why it is shocking this government is cutting funding to affordable housing and it is why it is shocking this government is banning municipalities from using and collecting development fees for affordable housing projects. Minister, can your government commit to providing cities with the fair funding they are asking for to build the affordable housing they need? Minister Ms Colfair is in housing. Speaker, you notice how she wiggled away from the auditor general's report and the city of Ottawa? I'm going to go back to it. So the updated formula was developed based on the feedback from the auditor general and municipal stakeholders. The updated model takes into consideration a community's share of homelessness, support of housing unit, low income households, households in deep core housing need, as defined by CMHC and indigenous and youth populations. We are not going to facilitate a funding formula that was outlined in the auditor general's report that forgets about communities like those in Niagara, like those in London, like those in Windsor. You know we're not going to do that we're going to respond to the auditor general's report and have a fair funding formula that treats all of Ontario with fairness and response. The next question. Remember for Cambridge. I was never reading. Speaker, my question is to the Minister of Agriculture, Food and Rural Affairs. The agri-food sector contributes over $47 billion to Ontario's GDP, an amazing number. That is in part because of the thousands of agri-food businesses across the province and in my writing that produce high quality products made right here in Ontario. Businesses like Farm to Table Canada, Grand River Foods, bring world-renowned products to market, meeting the demands of a growing population in an international market. Can the minister explain how our government will continue to expand opportunities for the agri-food businesses in my writing? Mr. Mayor, Culture, Food and Rural Affairs. Very much and I do appreciate the question from the member from Cambridge because, Speaker, our government has set out ambitious growth targets for our agri-food sector through our Grow Ontario strategy and in that strategy we have committed to growing Ontario's agri-food markets and exports by 8% annually by 2030. And I'm pleased to say, Speaker, that we have already taken steps to accomplish just that. Last week we announced our Grow Ontario marketing initiative. And while I was at the Erleton Farm Show, I want to share with you as well that an astute person said, if you don't have the sale nothing else matters and you need good marketing initiatives to secure that sale. And that's what we're doing, Speaker, we're introducing a $6 million Grow Ontario marketing initiative program through the Sustainable Canadian Agricultural Partnership. Mr. Spence. And the supplementary question. Thank you, Minister, for your response. That is great news for the agri-food sector and according to the OMAFRA data, that is great news for over 600 agri-food businesses in my riding and we're continuing to build a strong Ontario economy. As we've seen over the last few years, new markets is essential for our business to prosper and grow. Can the minister explain how Grow Ontario market initiative will help agri-food businesses reach these new markets? To make a culture food and rural affairs. Speaker, the potential for growth in Ontario's agri-food sector is absolutely tremendous and our government through the leadership of Premier Ford and our entire caucus, we are showing our commitment to making sure businesses have the supports that they need. Because we want them to be even more competitive, not only domestically here in Canada but around the world. And through the Grow Ontario marketing initiative, eligible businesses can receive up to 50% cost share for their eligible costs in terms of ramping up their marketing initiatives and that translates into up to $60,000 in funding. And we're also providing out supports for our industry organizations as well and if they have eligible projects they could receive up to $125,000. Speaker, we're committed to building Ontario and it's through Ontario's agri-food sector and the building of our marketing initiatives that we are going to absolutely prevail and show the rest of the. Thank you very much. The next question the member for Ottawa West will hear. Thank you Speaker. Teachers shortage in the francophone education system is endangering the quality of French education in the province but this government is not doing much to solve this issue. Kids are anxious, parents as well, and some schools will have to close their doors because they can't find teachers. Some francophone children have had nine teachers in one single academic year and sometimes they get to they get to school on one day to find out that they have a different teacher from in the day before. It's not fair. The Minister of Education have talked about a program to act. Could the Minister act and act now please? Thank you very much Mr. Speaker. I want to thank the member opposite for this question. I'm very pleased to confirm the French language education funding in Ontario is at the highest levels in Ontario history. In addition to that we introduced legislation in the Better Schools and Suno comes back that is specific to responding to the need to certify French educators quicker. I hope the members opposite will put ideology aside and vote for quicker processing times of new French teachers. In addition in that very bill we allow French educators based on what's called a experience certificate to allow more individuals mid-career with professional competence working with kids in French language to work within our schools a request of school boards to help ensure we attract more. We announced a joint French education recruitment program with education unions with federations and school boards and the French community itself to recruit French educators. We now have 13 million more dollars to do it. I'm proud that we've recruited more French language educators as a result of that with a commitment to do much much more for French schools in Ontario. That concludes the time we have for question period today. Point of order the member for


I just got done reacting to the Batman. I figure I might as well react to the Flash as well, even though I don't have a whole lot to say about the trailer. But you know, I figure might as well kill two bats with one stone. Because Michael Keaton's in this. Really the big takeaway from the teaser is that Michael Keaton's back is Batman. Don't know how much time he's gonna have. We don't actually see him from the front. We just get the back teaser. They even give us the Batmobile reveal without showing it to us. But I know it's there. I know it's that iconic 90s style. Ezra Miller's back is the Flash, aka Barry Allen. Kind of hoping he's worked on his running technique before filming this thing, because holy hell, in the Snyder movies, I don't know how he's running, but it's not like anything I've ever seen before. Granted, maybe that's the idea since he's running at ridiculous speeds. But still, this isn't how people run, Ezra. Fix it. I don't actually think there was any running in the trailer, so maybe he doesn't run at all in this movie. I think it's safe to say he does, though. I think it's safe to say The Flash runs in a Flash movie. It's kind of his superpower. In fact, I'm hard-pressed to say we're gonna see multiple flashes running as we see at the end. There's more than one in this. So the whole multiverse thing is going on in both MCU and DC in tandem right now. From what I can gather, Barry Allen's timeline's kind of been screwed up and he's trying to fix it. Looked like there was a dead Batman that we saw Cowell covered in blood. So he's trying to put this thing back together. Anyway, he knows how. He's eliciting the help from some fellow runners. Maybe we'll get a Sonic cameo in there. He's pretty fast, but we do have Batman and maybe that's enough. Batman seems to be able to fix anything. I, myself, took a brisk walk over to IMDB and it says Ben Affleck's in this movie, too. So multiple Batman's, possibly. It's gonna be wild. I feel like I said more than I even needed to already. It's a very short little tease. We get some nice fan service. Visually, it looks nice. Looks kind of like Shazam. Nothing really wowing me. It's certainly not the Matt Reeves color aesthetic that I like from the Batman. Music also very shazamish. Nothing really wowed me there. Nothing was bad, though. Nothing insulting. Yeah, this was a fine teaser. I am somewhat interested, especially as a person that's not really an Ezra Miller flash fan. Or just, I guess, in general. I don't think I've seen him in anything I was really impressed with so far. End of the day, though. I just want to hear what you had to say. Leave a comment below letting me know your thoughts. Like the video if you want. If you liked it a little. Subscribe if you liked it a lot because I do a ton of movie stuff on this channel. It's Adam Does Movies. That's what I do. And hopefully I'll see you around. Music If you gotta go fast, head on over to patreon.com slash AdamDoesMovies and say, you know what, Adam? Here's a dollar. Here's a dollar a month. Or here's five dollars a month. Love what you're doing. Keep it up. Or you can join right here on YouTube via the join button. You don't have to run as far. It's just a click away.


Okay, so welcome back and Now we are going to have the next speaker and so I'm going to say welcome to Scott Hello, how are you? I'm very good. Welcome to a robot in 2021 Where are you streaming from? I'm streaming from Brooklyn, New York in the United States Cool. So what's time? What time is there? It's quite early for you, right? It's about 815 in the morning Okay, thanks. It's not so bad. Not so bad Cool. Who is the one in New York? Okay, summer like here. Yeah, it's you know, the usual hot and humid Okay Yesterday was about 30 degrees Okay, I I don't miss that. I'm reading in amsterdam, but we don't have that in the summer here So I think that's that's super good. Uh, I really like your t-shirt by the way. Oh, me too Support by ladies. Thank you for that. So Scott is working for Bloomberg and He's a senior engineer and a manager in Bloomberg and he's helping also Of course to develop partner applications and he's also teaching internally in Bloomberg So as I say, it's super good and he's going to be talking about fun tools. That's a lot of fun. So Let's put your screen in the stage Cool So all yours. Good luck. All right. Thank you So as I was introduced, my name is Scott Irwin and I work for Bloomberg engineering And today we're going to talk about a hitchhiker's guide to funk tools and it's kind of interesting that I proposed this talk at the very beginning of June and thank you for the conference organizers for accepting it And about three weeks later martin hines wrote a blog post pretty much about Funk tools and and all of the wonderful features that are in there So there's something sort of in the python zeitgeist that is is generating interest In what has actually been around for a while So this is not going to be in depth in any one aspect of it Several of the aspects you could spend a whole Conference talk just on that one thing but this is more just a An overview to give folks an idea of what's there for further investigation within your own projects So what we're going to cover is we'll talk a little bit about definitions and histories But that's very quick And then we're going to get into The substance of funk tools. We'll talk about simplifying function signatures function wrappers caching We'll touch on order types. We'll touch on reduce and we'll Actually introduce this concept of function overloading in python for those of you who are coming from Maybe a different language and you heard that python doesn't support function overloading. That's Not completely true Python does have a way of supporting function overloading Via the funk tools module and then we'll wrap up and I'll Include some references including a link to martin's blog post So quick definition in history So the python standard library module funk tools contains several higher order functions So what does that mean? What is a higher order function? So they are functions which act on or return other functions So basically they take a function as an input or they return a function as an output um A higher order function that many of us are Familiar with our function decorators there. That is an example of a higher higher order function um Just a quick history on funk tools. It was actually added back in python 2.5 in 2006 and its initial Uh members of the module were wraps update wrapper, which those two are very closely related and partial um additional functionality was added Reduce was added in python 3.0 and back ported to python 2.6 a total ordering and Comp to key which we're not going to talk about at all was back ported to python 2.7 plus lru cash was added 24 brought in partial method and single dispatch and python 3.8 brought in cash property and single dispatch method and Most recently python 3.9 brought in cash. So you can see that this A module is evolving over time and it is continuing to evolve Even in the newer versions of python so Signatures and what that basically means is partial and partial method So partial is a a function that takes a function as an argument And it takes a set of arguments both positional and keyword and those Inputs are essentially locked in arguments to the function And then partial returns what's called a partial object Which behaves like the original function with those arguments already defined and so that's a lot of words Let's look at a quick example just to get a sense of what that is so here In the example below we're taking the function pow and we're essentially pre defining the exponent to be two and so We're taking the return of that and creating a new function called pow two And here in the example we can see if we pass pow two just the single value five that we end up getting five squared or five to the power of two the value 25 And so this is just a quick example But where you would really want to use Partial is to transfer transform multi argument functions into a single argument function in places where it's required So an example here is map map requires Only a one argument function, but what if you have a two argument function or three argument function that you want to use in map It's possible without partial, but it ends up being much more verbose. So here's some At the top here we have the example with partial and uh You can see that it is relatively compact and fairly straightforward to read So i'm doing map on pow with an exponent of three I can just kind of read that across the list here is just because map returns a generator And I just wanted to realize the the results of that generator um, I could do the same thing by It by defining an external function and then using that external function in map but this is like two extra lines of code and and And where it's actually used it's not exactly clear what this pow three is So imagine that the pow three is defined in some other place Distant from where it's actually used now. I don't easily know what this thing is about I could also use a lambda which kind of brings the definition close to the use But there's a lot more typing here and and it's not 100 clear what is going on So the partial just becomes a way of Creating something that is a little cleaner and a little easier to read I can also use partial to simplify code I can use it to define functions that are easier to type read and importantly friendly to code completion So here I'm I'm using partial to Define a function called print standard error Where I'm just using the print the built-in print function, but I'm setting the output to be standard error So now when I want to print something to standard error elsewhere in my code I can use this print under bar standard error And because this is defined as a function I When I'm in my editor, I can I can do Code completion on print under bar standard error It'll be available and it just makes it simpler and easier to use where I could use print open print File equals blah blah blah, but that's a lot more to type in every place. I want to use it And it's not very friendly to code completion related closely related to Partial is partial method and the easiest way to think about this is that it's partial for class methods From the python docs it returns a new partial method descriptor Which behaves like partial except that it's designed to be used as a method definition rather than being directly callable The the function that's in the argument here in partial method must be a descriptor or a callable But all that really means is that if you have a method in your class it it fits the bill So here's a quick. This is lifted directly from the python 3.9 docs. There's nothing very Original here But I have this class cell. I have a property called alive And I have a set state for that property that will take a boolean either true or false to set the State of the cell to be either alive or not alive Now I I can use partial method then to create these two convenience methods set alive and set dead That just basically pre-define the true or false for set state and now inside In this case a repl but also in terms of uh, code completion. I now have this set alive convenience function available to me that I can just you call and use without having to type out The more input more verbose implementation so that's Simplifying function signatures. Now, let's move on to function wrappers Which is wraps and it's closely related update wrapper So wraps takes a function that it's wrapping Or that is to be wrapped. It's a function decorator used when defining a wrapper function It updates the wrapper functions attributes To be the same as the wrapped function and and as I've alluded to it's a convenience decorator factory for defining Defined using update wrapper. So it's basically it's it's syntactic sugar for update wrapper So if we didn't have wraps what we would end up with something like this So I have my decorator. I have an wrapper that's defined within that decorator and I Use that to wrap a function but when I And when I call that function the wrappers called then the functions called then that's fine everything functionally works But when I look at the function name It's it's this function up here wrapper It's not the original fun. So Where this is important is like in stack traces or in error messages It's going to it's going to be confusing as to where the failure actually is also the doc string Is picking up the wrappers doc string and not the original functions doc string So if we use wraps we essentially it just becomes a decorator on the wrapper function itself And it takes as input the original function and so now Functionally everything still works the same the wrappers called the functions called but now the The function name is what I expect it's the original function And the doc string is coming from the original function And so this is just to make my code behave more like what I would expect it to be Update wrapper is rarely used directly It updates the wrapper function attributes to be the same as the wrap function It's useful in situations where the decorator wraps cannot be used Such as wrapping a function after it's defined or wrapping a function you do not own So here's a quick example I'm grabbing From the string library the standard library function cap words And I'm I'm wrapping it in this thing called my cap words And when I call all my cap words it it works like I expect But the the name of the function as well as the doc string the doc string is quite long So I didn't include it here It's not reference. It's referencing mine, but maybe I want it to behave in the context like it It is the standard library cap words So here I can use update wrapper to take my original function and say Those function attributes just make them the same as the original string doc cap words and so now if I look at the name for string doc cap words for The local cap words and my cap words.  Oh Something important to note here is I update wrapper in addition to doing this work will return Essentially a reference to the function that I can then use later, which is what I'm doing here caching so there's a couple of different features of caching in the func tools The first one is lru cache. Um, these are its default arguments It wraps a function with a with a memoizing callable it saves time When an expensive function is sometimes called with the same arguments It caches the results of the most recent max size calls. So in this case the default is 128 So that cache will hold up to 128 entries Lru by the way stands for least recently used so as something more recent comes in the oldest one gets kicked out If typed is set to true The function arguments for different types will be cached separately. So if you have a function that takes a number integer three would be cached differently than the floating point 3.0 Otherwise, they're treated the same because they're equivalent values The l u r cache when you create it has some attributes um It has cache info, which will tell you the current state of the cache like what's in it. How big is Um, it has a cache clear method which allows you to clear out or invalidate the cache And it also has a cache parameters method which will return A a new dict so it's it you you can't use it to modify the value of the cache But it'll basically tell you how it was instantiated. What's it? What was the max size and typed used to create this l r u crash? Here's a quick example. Um, this is a fairly standard example. So I have a Fibonacci and as Those of you that have seen this before know that with bigger and bigger numbers It gets more and more expensive because I'm making all of these recursive calls So what I do is I put an l r u cache on it And what that means is that I can calculate out to fairly large numbers um But Fibonacci to calculate say for the Fibonacci value for 10 I calculate the Fibonacci value for eight and nine Well because of the way we've done this we've calculated it for zero for one for two so on and so forth So by the time we get to these larger numbers, we've pre calculated all the smaller ones and they're now sitting in the cache um so this runs fairly quickly uh, and What we can see is that we have 28 cache hits 16 misses is basically means that The first time it sees each number it doesn't know what the value is so it has to calculate it um The max size we got the default of 128 and it has 16 entries, which is the values for zero through 15 And here we can see what the cache parameters even though we didn't define them up here in the decorator We just got the defaults And we can see what those those values are Some caveats with lru cache. Um, the function's positional and keyword arguments must be hashable Which means that it can't take things like lists or mutable classes The underlying storage for the lru cache is a dictionary. That's and so those Function arguments that are used as a key into that dictionary. So that's where this requirement is coming from Um, it should only be used with pure functions. What that means is that the same inputs always produce the same output Which implicitly means that the function that you're caching should not have side effects. It shouldn't write to a database or or do something That would mutate the system closely related to lru cache is the recently introduced cache and this is just a simple lightweight Unbounded function cache. So it's the same as lru cache with no maximum size Um, because there's no eviction because you never throw anything away from the cache It's it can be written in a way that makes it smaller and faster Compared to lru cache with a size limit because you never need to compare about Have we hit the cache limit? What do I need to do? What's the oldest one? So all of that logic goes away um, the caveat with that is that if you're using it on something that takes a very large variety of inputs You can end up with a very large cache. So Use that one with caution and forethought uh related to these two or is cache property which is um Similar to property with the addition of caching The value is computed once and then cached as a normal attribute for the life of the instance Um, unlike property cache property allows, uh, rights without a setter method being defined Cache property only runs on lookup and only if the attribute doesn't already exist on the object Once the attribute exists subsequent reads and writes work like a normal attribute So quick example here, um We're Taking in a sequence of numbers. We're storing it as a tuple of a sequence of numbers. So now we know that that sequence is immutable um, and then essentially we're going to add a cache property standard deviation And which will return the standard deviation of that sequence of numbers So here, I wanted to give you a sense of like what that Cache property buys bias in terms of time Um, so I'm taking a very large sequence 10 million And I'm calculating that standard deviation on that sequence um The initial one it's a little hard to read here, but you can see that it started at Call it 11 seconds and finished at 39 seconds So it took somewhere on the order of 28 seconds to calculate this standard deviation The very next time I call it I still get the same answer But now it took somewhere in the milliseconds to get that answer. So it's basically just a property lookup So for things that are expensive to Calculate but don't change once they are calculated. This is a very handy thing to have uh, we're going to just briefly touched on order types using total ordering Total ordering is a class decorator. Um, that makes it easy to create well behaved totally ordered types um If a class defines at least one rich comparison operator, it will so the the decorator will supply the rest so what that basically means is that You need to define One of these four less than less than or equal greater than or greater than equal and the class decorator will generate all the rest of them Uh, additionally the class should supply an equal operator though. That is not strictly necessary um One caveat with this is it does come at the cost of slower execution and a more complex stack trace for the derived comparison operators because essentially they get defined in Using the one that you defined as uh, it's implementation So here's a quick example. Um, I created this car class It takes year make a model Um, and I define equal and less than and that's it and these are just relatively simple comparisons uh on year make and model and so What this shows here is though even though I only defined the less than operator I I'm getting the greater than operator for free And I'm getting it because of this class decorator this total ordering One more that we'll touch on is reduce Um reduce takes a function and an iterable and it applies that function of two arguments cumulatively to the items of the iterable to reduce it to a single value That's a lot of words, but if you've ever used the sum function. This is an example of a reducer um Well python has a built-in sum function. It doesn't have a built-in product function. So here we can use to implement A product function. So we take reduce we give it The operator mul or multiplier and it takes an arbitrary iterable and it has an initial value of one um, and so now I can call product on a list A range or any other iterable and it will just multiply them all together in the same way that sum adds them all together And so this can be a handy thing to use Um for for these kinds of situations the last one and this one in particular could Occupy a 25 minute talk all on its own and this is single dispatch. This is where Uh, we get into function overloading single dispatch is a function decorator which Takes a function transforms it into a single dispatch generic function This means that the implementation is chosen based on the type of the single argument. So you have a different function for Say integer versus a string versus a float versus a list versus whatever The overloaded implementations are decorated with a register attribute. So it so that When you call the function it knows where the implement where to find the implementation um If the implementation is annotated with types the decorator will automatically infer the type of the argument Otherwise you have to declare what the type is in the decorator. So what does that look like? So here I have a function fun that takes an argument. This is my generic function. So So This is the in some sense the default implementation So now I register um a function And notice here. I'm not even bothering to name it its name is immaterial It it's going to be an implementation detail for fun When it's called with an integer argument Um I'm going to also register it with a list argument And then just to illustrate These are both using type hints where if I don't use the type in I have to declare the the type up here in the function decorator So now I I've Defined my generic function. I've defined it for an integer type for a list type and a complex type So if I call it with an integer I get the the results of the integer Implementation if I call it with a list I get the implementation of that if I call it with a float I get the default implementation because I haven't provided Uh, essentially a type specific version of the function and if I call it with a complex number I get the the complex implementation Single dispatch method is the same thing But for class methods. It's a function decorator which transforms a method into a single dispatch generic function The dispatch happens on the type of the first non self or non class argument. So that implies that you can use it both on Object methods and on class methods So with that we're going to wrap up So the func tools module contains many higher order functions, which are both useful and powerful And using these functions can result in more readable and more maintainable code some references Of course the python language reference is an excellent place to start These slides are available on github at the link that you see here. It's in my github repo sj urwin As I mentioned before martin hines wrote a blog post Um Pretty much on the same topic Uh called funk tools the power of higher order functions in python um, there's a somewhat more, um, I think This one is from 2020 florian Dalits wrote a blog very similar introduction to python's funk tools module so Between these four pieces this should get you more interested and more Informed on funk tools And with that we're done Okay, thank you scott. That was really really a lot of information. I was learning a lot I know but there was a really important, you know, like I was seeing in the channel like a lot of people saying yeah today I learned something Uh, I I like uh funk tools. It's like a eater tools, right those two Yeah They are really really good um Okay, so I have a few questions um, the first one is um Will using partial method for the examples set alive and set that so that was those two examples that you are using Actually be pythonic Would it be using protection? Um, so I would argue that they would be pythonic because they are lifted directly from the python documentation themselves Um, that's a good answer It it's It's a way if you didn't use that you would end up having to essentially write A little two-line function that implements that I mean it would be relatively straightforward to write But now you're being more of a vote for both than you need to be Yeah per point Okay, so I have one more. I'm checking the tunnel if someone is And this was me. So I'm cheating But yeah, you know, I'm a volunteer. So I have I can I can ask questions. Yeah, what's your favorite funk tools too? um, so Probably based on slide count you can guess that partial is one of my favorites Yeah, um, but in terms of like most useful. I think I use at wraps more than anything If you're writing decorators you pretty much need to use at wraps That's true. That's true um, and then Yeah, we are I think we're okay um Could we define product with reduce to be in the scope and attack or talk? Could we define product with reduce? um, I think I'm a little confused on the question Yeah, me too. I'm I was just Copy pasting that so maybe that person can uh Yeah, I'm happy to answer the question, but I don't think I I fully understand what um, let me see Yeah, maybe Oh, maybe the question is if you can define product using reduce I think Oh, could you use map to achieve the same end result? Yes, you could use map to achieve the same end result um The the main idea behind using reduce is it's just a little cleaner and easier to read what it's doing also, if you're coming from a Uh functional programming background or you've worked with functional programming languages Reduce is going to look very familiar Yeah, that's true Okay, and I think I have one more Oh, no, no, that was just people interacting so So that was the last one Excellent But if you want to keep a talk with scott You have two options. You can go to wonder me scott and see if someone reached you there Or you can just stay in the break up room, uh, brian I'm I'm sure people will will be I'll be more questions And again, thank you very much for being a for being a speaker in the conference Thank you for having me next year See you in Dublin