diff --git a/spaces/1acneusushi/gradio-2dmoleculeeditor/data/Fujio Girls Medical Game Become a Doctor and Save Lives.md b/spaces/1acneusushi/gradio-2dmoleculeeditor/data/Fujio Girls Medical Game Become a Doctor and Save Lives.md
deleted file mode 100644
index 4bb2c65515e4a0d2586fc2b4c2e008249d7f3a97..0000000000000000000000000000000000000000
--- a/spaces/1acneusushi/gradio-2dmoleculeeditor/data/Fujio Girls Medical Game Become a Doctor and Save Lives.md
+++ /dev/null
@@ -1,116 +0,0 @@
-
-
Fujio Girls Medical Game: A Fun and Educational Way to Learn About the Human Body
-Do you love playing games that are both fun and educational? Do you want to learn more about the human body and how it works? Do you want to explore different medical scenarios and challenges that test your knowledge and skills? If you answered yes to any of these questions, then you might want to check out Fujio Girls Medical Game.
-Fujio Girls Medical Game
Download File ————— https://byltly.com/2uKxjT
-What is Fujio Girls Medical Game?
-A brief introduction to the game and its features
-Fujio Girls Medical Game is a game that lets you play as a girl who wants to become a doctor. You can choose from different characters, such as Shizuka, Nobita, Doraemon, or Suneo. Each character has their own personality and abilities that affect their performance in the game.
-The game consists of various mini-games that teach you about different aspects of the human body, such as anatomy, physiology, diseases, disorders, prevention, and treatment. You can also interact with other characters in the game, such as patients, nurses, doctors, or friends. You can earn points and rewards for completing each mini-game successfully.
-The benefits of playing Fujio Girls Medical Game
-Playing Fujio Girls Medical Game can help you improve your knowledge and understanding of the human body. You can learn about the structure and function of different organs and systems, such as the heart, lungs, brain, digestive system, immune system, etc. You can also learn about the common health problems that affect these organs and systems, such as asthma, diabetes, stroke, cancer, etc.
-Fujio Girls Medical Game review
-Fujio Girls Medical Game download
-Fujio Girls Medical Game apk
-Fujio Girls Medical Game mod
-Fujio Girls Medical Game cheats
-Fujio Girls Medical Game hack
-Fujio Girls Medical Game online
-Fujio Girls Medical Game for pc
-Fujio Girls Medical Game for android
-Fujio Girls Medical Game for ios
-Fujio Girls Medical Game walkthrough
-Fujio Girls Medical Game tips
-Fujio Girls Medical Game tricks
-Fujio Girls Medical Game guide
-Fujio Girls Medical Game gameplay
-Fujio Girls Medical Game characters
-Fujio Girls Medical Game story
-Fujio Girls Medical Game plot
-Fujio Girls Medical Game ending
-Fujio Girls Medical Game sequel
-Fujio Girls Medical Game update
-Fujio Girls Medical Game new version
-Fujio Girls Medical Game latest version
-Fujio Girls Medical Game free version
-Fujio Girls Medical Game premium version
-Fujio Girls Medical Game pro version
-Fujio Girls Medical Game full version
-Fujio Girls Medical Game best version
-Fujio Girls Medical Game features
-Fujio Girls Medical Game benefits
-Fujio Girls Medical Game advantages
-Fujio Girls Medical Game disadvantages
-Fujio Girls Medical Game pros and cons
-Fujio Girls Medical Game comparison
-Fujio Girls Medical Game alternatives
-Fujio Girls Medical Game competitors
-Fujio Girls Medical Game similar games
-Fujio Girls Medical Game related games
-Fujio Girls Medical Game genre
-Fujio Girls Medical Game category
-Fujio Girls Medical Game theme
-Fujio Girls Medical Game style
-Fujio Girls Medical Game graphics
-Fujio Girls Medical Game sound
-Fujio Girls Medical Game music
-Fujio Girls Medical Game voice acting
-Fujio Girls Medical Game rating
-Fujio Girls Medical Game feedback
-Fujio Girls Medical Game testimonials
-Fujio Girls Medical Game comments
-Playing Fujio Girls Medical Game can also help you develop your critical thinking and problem-solving skills. You can apply what you have learned to diagnose and treat various medical conditions. You can also use your creativity and imagination to come up with solutions for different scenarios. You can also challenge yourself by choosing different levels of difficulty for each mini-game.
-Playing Fujio Girls Medical Game can also help you have fun and enjoy yourself. You can experience different situations and environments that are related to medicine, such as hospitals, clinics, laboratories, etc. You can also customize your character's appearance and outfit according to your preference. You can also share your progress and achievements with your friends online.
-How to play Fujio Girls Medical Game?
-The basic gameplay and controls
-To play Fujio Girls Medical Game, you need to have a device that supports the game, such as a computer or a smartphone. You can download the game from the official website or from other platforms that offer it. You can also play it online without downloading it.
-To start playing Fujio Girls Medical Game, you need to create an account or log in with your existing account. You can then choose your character and start playing. You can use your mouse or keyboard on a computer or your touch screen on a smartphone to control your character's actions.
-The different modes and levels of difficulty
-Fujio Girls Medical Game has two main modes: story mode and free mode. In story mode, you follow a storyline that involves different characters and events related to medicine. You need to complete each mini-game in order to progress through the story. In free mode, you can choose any mini-game that you want to play without following a storyline.
-Fujio Girls Medical Game also has three levels of difficulty: easy, medium, and hard. You can choose the level of difficulty that suits your skill level and preference. The level of difficulty affects the complexity and duration of each mini-game.
-The various medical scenarios and challenges
-Fujio Girls Medical Game has many mini-games that cover different medical topics and scenarios. Some examples are:
-
-- Anatomy quiz: You need to identify different parts of the human body by clicking on them.
-- Blood pressure test: You need to measure the blood pressure of a patient by using a sphygmomanometer.
-- X-ray scan: You need to interpret an X-ray image of a patient's chest by finding abnormalities.
-- Surgery simulation: You need to perform a surgery on a patient by following instructions.
-- Vaccine injection: You need to administer a vaccine to a patient by choosing the correct syringe size and location.
-- Dental care: You need to clean and fix a patient's teeth by using dental tools.
-- Eye exam: You need to test a patient's vision by using an eye chart.
-- First aid: You need to provide first aid to a patient who has an injury or illness by using bandages or medicines.
-- Nutrition advice: You need to give nutrition advice to a patient who has a dietary problem by choosing healthy foods.
-- Fitness challenge: You need to exercise with your character by following movements on screen.
-
- What can you learn from Fujio Girls Medical Game?
-The anatomy and physiology of the human body
-By playing Fujio Girls Medical Game, you can learn about the anatomy and physiology of the human body. Anatomy is the study of the structure of living organisms. Physiology is the study of how living organisms function. By learning about these topics, you can understand how your body works and what makes it healthy or unhealthy.
-The common diseases and disorders that affect the human body
-By playing Fujio Girls Medical Game, you can also learn about the common diseases and disorders that affect the human body. Diseases are abnormal conditions that impair normal functioning. Disorders are irregularities or abnormalities in structure or function. By learning about these topics, you can recognize the signs and symptoms of various health problems and how they affect your body.
-The prevention and treatment of various health problems
-By playing Fujio Girls Medical Game, you can also learn about the prevention and treatment of various health problems. Prevention is taking steps to avoid getting sick or injured. Treatment is taking steps to cure or improve a health problem. By learning about these topics, you can take care of yourself and others by following healthy habits and seeking medical help when needed.
- Where can you find Fujio Girls Medical Game?
- The official website and social media accounts of the game developer
- If you want to find out more about Fujio Girls Medical Game, you can visit the official website of the game at https://sway.office.com/gCXXlC8NzSJWoPJU. You can also follow their social media accounts on Facebook, Twitter, and Instagram to get the latest updates and news about the game.
-The platforms and devices that support the game
-Fujio Girls Medical Game is compatible with various platforms and devices, such as Windows, Mac, Linux, Android, iOS, etc. You can play the game on your computer or your smartphone. You can also play it online without downloading it. However, you need to have a stable internet connection and a browser that supports HTML5.
-The price and availability of the game
-Fujio Girls Medical Game is available for free for anyone who wants to play it. You can download it from the official website or from other platforms that offer it. You can also play it online without downloading it. However, you may encounter some ads or in-app purchases that may affect your gaming experience.
- Conclusion
-Fujio Girls Medical Game is a fun and educational game that teaches you about the human body and medicine. You can play as a girl who wants to become a doctor and learn about anatomy, physiology, diseases, disorders, prevention, and treatment. You can also enjoy different mini-games that test your knowledge and skills. You can find the game on the official website or on other platforms that support it. You can also follow the game developer on social media to get more information and updates.
-If you are looking for a game that is both entertaining and informative, you should try Fujio Girls Medical Game. It is a game that will make you smarter and happier.
- FAQs
-
-- What is the goal of Fujio Girls Medical Game?
-The goal of Fujio Girls Medical Game is to help you learn about the human body and medicine in a fun and interactive way.
-- Who are the characters in Fujio Girls Medical Game?
-The characters in Fujio Girls Medical Game are based on the popular Japanese manga and anime series Doraemon. You can choose from Shizuka, Nobita, Doraemon, or Suneo as your main character.
-- How many mini-games are there in Fujio Girls Medical Game?
-There are over 50 mini-games in Fujio Girls Medical Game that cover different medical topics and scenarios.
-- How can I play Fujio Girls Medical Game online?
-You can play Fujio Girls Medical Game online by visiting https://sway.office.com/gCXXlC8NzSJWoPJU and clicking on the play button. You need to have a browser that supports HTML5 and a stable internet connection.
-- Is Fujio Girls Medical Game suitable for children?
-Fujio Girls Medical Game is suitable for children who are interested in learning about the human body and medicine. However, some mini-games may contain graphic or sensitive content that may not be appropriate for younger audiences. Parental guidance is advised.
-
- 0a6ba089eb
-
-
\ No newline at end of file
diff --git a/spaces/1gistliPinn/ChatGPT4/Examples/Advanced Serial Port Monitor 4 [EXCLUSIVE] Keygen.md b/spaces/1gistliPinn/ChatGPT4/Examples/Advanced Serial Port Monitor 4 [EXCLUSIVE] Keygen.md
deleted file mode 100644
index 3cb0a2cba0700cb559531c289db9ddc3545607b5..0000000000000000000000000000000000000000
--- a/spaces/1gistliPinn/ChatGPT4/Examples/Advanced Serial Port Monitor 4 [EXCLUSIVE] Keygen.md
+++ /dev/null
@@ -1,6 +0,0 @@
-advanced serial port monitor 4 keygen
Download Zip 🆗 https://imgfil.com/2uy0qo
-
-Software, goal Comfree-serial-port-monitor-downloads. Software, Eltima Ports. ... 0 pro Key Serial 4 numbers serial software Recently 81-Crack 2 1. Serial No Free Serial ... Serial v4. Advanced-usb-port-monitor Pro. Presented ... 4d29de3e1b
-
-
-
diff --git a/spaces/1gistliPinn/ChatGPT4/Examples/DENSO ETSI V4.92 1.8 GB How to Install and Use the Most Advanced Diagnostic Tool for Diesel Engines.md b/spaces/1gistliPinn/ChatGPT4/Examples/DENSO ETSI V4.92 1.8 GB How to Install and Use the Most Advanced Diagnostic Tool for Diesel Engines.md
deleted file mode 100644
index 446e7b66f53998f4626b32785bfe64a0003e7b82..0000000000000000000000000000000000000000
--- a/spaces/1gistliPinn/ChatGPT4/Examples/DENSO ETSI V4.92 1.8 GB How to Install and Use the Most Advanced Diagnostic Tool for Diesel Engines.md
+++ /dev/null
@@ -1,6 +0,0 @@
-DENSO ETSI V4.92 | 1.8 GB
Download Zip ►►► https://imgfil.com/2uxZ2i
-
- aaccfb2cb3
-
-
-
diff --git a/spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Darkrpg - Rpg Quest Magic Amp Origins Download TOP.md b/spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Darkrpg - Rpg Quest Magic Amp Origins Download TOP.md
deleted file mode 100644
index edc6b1feb4eb2d329d4ab9e896db009c975ad0b1..0000000000000000000000000000000000000000
--- a/spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Darkrpg - Rpg Quest Magic Amp Origins Download TOP.md
+++ /dev/null
@@ -1,42 +0,0 @@
-
-DarkRPG - A Minecraft Modpack with RPG, Quest, Magic, and Origins Elements
-If you are looking for a new way to enjoy Minecraft, you might want to check out DarkRPG. DarkRPG is a modpack that adds RPG, quest, magic, and origins elements to the game. You can choose from different races, complete quests for rewards, use magic spells and enchantments, trade with other players, and much more. DarkRPG also comes with a built-in MMO official server where you can play with others online. In this article, we will show you how to download and install DarkRPG, how to play it, and what features and highlights it offers.
- How to Download and Install DarkRPG
-Downloading and installing DarkRPG is very easy. All you need is the CurseForge app and a Minecraft account. Here are the steps:
-darkrpg - rpg quest magic amp; origins download
DOWNLOAD ->->->-> https://urlin.us/2uT1oX
-
-- Download the CurseForge app from [1](https://curseforge.overwolf.com/) and create an account.
-- Open the app and go to the modpacks section. Search for DarkRPG in the search bar. You can choose between the Fabric edition or the Forge edition of DarkRPG. The Fabric edition is more updated and has some mods that Forge doesn't. The Forge edition has some cool mods that Fabric doesn't. Choose the one that suits your preference.
-- Click on the install button and wait for the modpack to download. Once it is done, click on the play button to launch the game.
-- You can join the official MMO server by clicking on the MMO button in the main menu. You can also create your own server by using BisectHosting. BisectHosting is a leading Minecraft server solution that offers one-click installation of DarkRPG. You can get a server for as low as $2.99 per month. Use the code 'gamerpotion' to get 25% off your order. Click [2](https://bisecthosting.com/gamerpotion) to get started.
-
- How to Play DarkRPG
-Playing DarkRPG is very fun and immersive. You can do many things that you can't do in vanilla Minecraft. Here are some tips to get you started:
-
-- Choose your origin and customize your character. When you join the game for the first time, you will be asked to choose your origin. Origins are like races that have different abilities and traits. For example, you can be a vampire, a werewolf, a fairy, a mermaid, or a dragon. Each origin has its own advantages and disadvantages, so choose wisely. You can also customize your character's appearance, name, gender, and skin color.
-- Complete quests and earn rewards by pressing L. Quests are tasks that you can do to earn money, items, experience, and reputation. You can access the quest menu by pressing L. There are different types of quests, such as main quests, side quests, daily quests, and bounty quests. Main quests are the ones that progress the story and unlock new features. Side quests are optional but can give you extra rewards and lore. Daily quests are repeatable and can give you a steady income of money and experience. Bounty quests are hunting missions that require you to kill a specific mob or player.
-- Explore the world and discover new biomes, creatures, and dungeons. The world of DarkRPG is vast and diverse. You can find many new biomes, such as the enchanted forest, the volcanic wasteland, the frozen tundra, and the mushroom island. Each biome has its own unique creatures, plants, and resources. You can also encounter dungeons, which are challenging areas with traps, puzzles, enemies, and bosses. Dungeons can give you rare loot and artifacts if you manage to clear them.
-- Use magic wands, spells, enchantments, and tables to enhance your abilities. Magic is a big part of DarkRPG. You can use magic wands to cast spells that can damage enemies, heal allies, or manipulate the environment. You can learn new spells by finding spell books or buying them from magic shops. You can also use enchantments to improve your weapons, armor, and tools. Enchantments can give you special effects, such as fire resistance, speed boost, or looting. You can apply enchantments by using an enchantment table or an anvil.
-- Trade with other players using the currency system and the auction house. DarkRPG has a currency system that uses coins as the main medium of exchange. You can earn coins by completing quests, selling items, or winning bets. You can use coins to buy items from shops or other players. You can also use the auction house to sell or bid on items online. The auction house is accessible by typing /ah in the chat.
-
- Features and Highlights of DarkRPG
-DarkRPG is not just a modpack that adds RPG elements to Minecraft. It is also a modpack that enhances the overall gameplay experience with many features and highlights. Here are some of them:
-
-- Performance optimization and low-end machine compatibility. DarkRPG is designed to run smoothly on any computer, even if it has low specs. It uses Fabric or Forge as the mod loader, which are both lightweight and fast. It also uses OptiFine as the graphics optimizer, which improves the FPS and reduces lag.
-- Custom main menu, backgrounds, fonts, and cosmetics. DarkRPG has a custom main menu that shows the logo of the modpack and some buttons for accessing different features. It also has custom backgrounds that change depending on the time of day and the season. It also has custom fonts that make the text more readable and stylish. It also has cosmetics that allow you to change your appearance with hats, wings, tails, horns, and more.
-- Extra weapons, armor, blocks, and items. DarkRPG adds many new weapons, armor, blocks, and items to the game. You can find new weapons, such as daggers, hammers, spears, crossbows, and guns. You can also find new armor, such as leather, chainmail, iron, gold, diamond, and netherite. You can also find new blocks, such as marble, basalt, limestone, slate, and quartz. You can also find new items, such as backpacks, rings, amulets, potions, and food.
-- Casino, XP wheel, RTP, world claim, waystones, and more. DarkRPG has many extra features that make the game more fun and convenient. You can visit the casino to play slot machines, roulette, blackjack, and poker. You can spin the XP wheel to get a random reward or penalty. You can use RTP to teleport to a random location in the world. You can use world claim to protect your land from griefers. You can use waystones to fast travel between locations. And there are many more features that you can discover by playing DarkRPG.
-
- Conclusion and FAQs
-DarkRPG is a Minecraft modpack that combines RPG, quest, magic, and origins elements with many other features and highlights. It is a modpack that offers a new and exciting way to play Minecraft. You can download and install DarkRPG easily with the CurseForge app and join the official MMO server or create your own. You can play DarkRPG by choosing your origin, completing quests, exploring the world, using magic, and trading with other players. You can also enjoy the performance optimization, the custom main menu, the extra weapons, armor, blocks, and items, and the casino, XP wheel, RTP, world claim, waystones, and more.
-If you are interested in trying DarkRPG, you can download it from [3](https://www.curseforge.com/minecraft/modpacks/darkrpg) or [4](https://www.curseforge.com/minecraft/modpacks/darkrpg-fabric). You can also watch some gameplay videos on YouTube or Twitch to see how it looks like. DarkRPG is a modpack that will surely give you hours of fun and adventure.
-Here are some FAQs that you might have about DarkRPG:
-
-- What is the difference between the Fabric edition and the Forge edition of DarkRPG?
The Fabric edition is more updated and has some mods that Forge doesn't. The Forge edition has some cool mods that Fabric doesn't. The main difference is in the mod loader that they use. Fabric is faster and lighter than Forge but has fewer mods available. Forge is slower and heavier than Fabric but has more mods available.
-- How can I get a server to play DarkRPG with my friends?
You can get a server from BisectHosting. BisectHosting is a leading Minecraft server solution that offers one-click installation of DarkRPG. You can get a server for as low as $2.99 per month. Use the code 'gamerpotion' to get 25% off your order. Click [5](https://bisecthosting.com/gamerpotion) to get started.
-- How can I report a bug or suggest a feature for DarkRPG?
You can report a bug or suggest a feature by using the issue tracker on GitHub. Click [6](https://github.com/GamerPotion/DarkRPG/issues) to go there.
-- How can I support the development of DarkRPG?
You can support the development of DarkRPG by donating to the developer on Patreon or PayPal. Click [7](https://www.patreon.com/gamerpotion) or [8](https://www.paypal.me/gamerpotion) to do so.
-- Where can I find more information about DarkRPG?
You can find more information about DarkRPG by visiting the official website or joining the Discord server. Click [9](https://darkrpg.net/) or [10](https://discord.gg/gamerpotion) to go there.
-
197e85843d
-
-
\ No newline at end of file
diff --git a/spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Download FIFA 23 Mod 16 and Play Offline with Realistic Graphics and Gameplay on Android (APKOBBDATA).md b/spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Download FIFA 23 Mod 16 and Play Offline with Realistic Graphics and Gameplay on Android (APKOBBDATA).md
deleted file mode 100644
index 898a36a519b267bba27284d0a43443f21d41851c..0000000000000000000000000000000000000000
--- a/spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Download FIFA 23 Mod 16 and Play Offline with Realistic Graphics and Gameplay on Android (APKOBBDATA).md
+++ /dev/null
@@ -1,84 +0,0 @@
-
-FIFA 23 Mod FIFA 16 Ultimate Team Download Android APK+OBB
-If you are a fan of soccer games, you must have heard of the popular FIFA series by EA Sports. The latest version of this game, FIFA 23, is expected to be released in late 2023. However, if you can't wait that long, you can try out the FIFA 23 Mod FIFA 16, which is a modified version of the older FIFA 16 game with updated features and graphics. In this article, we will tell you everything you need to know about this amazing mod, including its features, how to download and install it on your Android device, and some frequently asked questions.
- Introduction
-FIFA is one of the most popular and successful soccer games in the world. It has millions of fans and players who enjoy its realistic and immersive gameplay, stunning graphics, and diverse modes. However, not everyone can afford to buy the latest version of the game or have a compatible device to run it smoothly. That's why some modders have created a modified version of the older FIFA 16 game, which is called FIFA 23 Mod FIFA 16. This mod brings some of the features and improvements of the upcoming FIFA 23 game to the older version, making it more enjoyable and exciting.
-fifa 23 mod fifa 16 ultimate team download android apk+obb
DOWNLOAD ⚙⚙⚙ https://urlin.us/2uT0cB
- What is FIFA 23 Mod FIFA 16?
-FIFA 23 Mod FIFA 16 is a modified version of the original FIFA 16 game by EA Sports. It is not an official product of EA Sports, but a fan-made project that aims to enhance the gameplay and graphics of the older game. The mod includes some of the latest transfers and kits of the players and teams, as well as some new faces and hairstyles. It also improves the graphics quality and performance of the game, making it look more realistic and smooth. The mod also adds some new features and modes to the game, such as offline mode, multiplayer option, customizable controls, and settings.
- Why should you download FIFA 23 Mod FIFA 16?
-There are many reasons why you should download FIFA 23 Mod FIFA 16 on your Android device. Here are some of them:
-
-- You can enjoy some of the features and improvements of the upcoming FIFA 23 game before its official release.
-- You can play with your favorite players and teams with their updated transfers and kits.
-- You can experience a realistic and immersive gameplay with enhanced graphics and physics.
-- You can play offline without an internet connection or online with your friends or other players.
-- You can customize your controls and settings according to your preference.
-- You can save your storage space and battery life as the mod is smaller and lighter than the original game.
-
- Features of FIFA 23 Mod FIFA 16
-FIFA 23 Mod FIFA 16 has many features that make it one of the best soccer games for Android devices. Here are some of them:
- Latest transfers and kits
-The mod includes some of the latest transfers and kits of the players and teams in the world of soccer. For example, you can play with Cristiano Ronaldo in his new club Manchester United, Casemiro in Manchester City, Lionel Messi in Paris Saint-Germain, Kylian Mbappe in Real Madrid, and many more. You can also see their new faces and hairstyles that match their real-life appearance. The mod also updates the logos and names of the teams and leagues to make them more accurate and authentic. You can also choose from various kits and jerseys for your players, such as home, away, third, and special editions.
- Realistic graphics and gameplay
-The mod improves the graphics quality and performance of the game, making it look more realistic and smooth. You can see the details and textures of the players, stadiums, fields, balls, and crowds. You can also notice the shadows, lighting, and weather effects that add to the atmosphere of the game. The mod also enhances the gameplay and physics of the game, making it more responsive and dynamic. You can feel the impact and movement of the players, the ball, and the environment. You can also enjoy the realistic animations and celebrations of the players after scoring a goal or winning a match.
- Offline mode and multiplayer option
-The mod allows you to play offline without an internet connection or online with your friends or other players. You can choose from various modes and challenges to test your skills and have fun. For example, you can play in the Ultimate Team mode, where you can create your own dream team with your favorite players and compete in various tournaments and leagues. You can also play in the Career mode, where you can start as a young player and work your way up to become a soccer legend. You can also play in the Quick Match mode, where you can select any team and play a friendly match. If you want to play online, you can join the Online Seasons mode, where you can play against other players in different divisions and try to rank up. You can also play in the Online Friendlies mode, where you can invite your friends and play a match with them.
-fifa 23 mod 16 android offline apk+obb+data latest version
-fifa 23 mod fifa 16 apk obb data offline with latest transfers and kits
-download fifa 23 mod 16 apk+obb+data offline for android device
-how to install fifa 23 mod fifa 16 apk obb data offline on android
-fifa 23 mod fifa 16 apk obb data offline features and gameplay
-fifa 23 mod fifa 16 apk obb data offline compatible with android and ios
-fifa 23 mod fifa 16 apk obb data offline update face and hair of players
-fifa 23 mod fifa 16 apk obb data offline new real face and transfer of ronaldo
-fifa 23 mod fifa 16 apk obb data offline new kits and minikits of teams
-fifa 23 mod fifa 16 apk obb data offline new background and display of game
-download fifa 23 mod 16 android offline from media fire link
-download fifa 23 mod 16 android offline from gaming scientific website
-download fifa 23 mod 16 android offline from mgamemaxpluss blogspot
-download fifa 23 mod 16 android offline from thesecondgameerpro website
-download zarchiver to extract fifa 23 mod 16 android offline files
-move the obb folder of fifa 23 mod 16 android offline to ../android/obb/
-move the data folder of fifa 23 mod 16 android offline to ../android/data/
-make sure you have enough storage to install fifa 23 mod 16 android offline
-make sure you have at least 1 gb ram to play fifa 23 mod 16 android offline
-enjoy the exciting game of football with fifa 23 mod 16 android offline
- Customizable controls and settings
-The mod gives you the option to customize your controls and settings according to your preference. You can choose from different types of controls, such as classic buttons, touch gestures, or virtual joysticks. You can also adjust the sensitivity and layout of the controls to suit your comfort and style. You can also change the settings of the game, such as the difficulty level, camera angle, sound effects, music, language, and more.
- How to download and install FIFA 23 Mod FIFA 16
-If you want to download and install FIFA 23 Mod FIFA 16 on your Android device, you need to follow some simple steps. Here are they:
- Requirements for FIFA 23 Mod FIFA 16
-Before you download and install FIFA 23 Mod FIFA 16, you need to make sure that your device meets some minimum requirements. Here are they:
-
-- Your device must have Android 4.4 or higher version.
-- Your device must have at least 2 GB of RAM and 4 GB of free storage space.
-- Your device must have a good internet connection to download the files.
-- Your device must allow installation from unknown sources. To enable this option, go to Settings > Security > Unknown Sources and turn it on.
-
- Steps to download and install FIFA 23 Mod FIFA 16
-After you have checked the requirements for FIFA 23 Mod FIFA 16, you can proceed to download and install it on your device. Here are the steps:
- Download the APK, OBB, and DATA files
-The first step is to download the APK, OBB, and DATA files of FIFA 23 Mod FIFA 16 from a reliable source. You can use this link to download them. The files are compressed in ZIP format, so you need to extract them using a file manager app or a ZIP extractor app.
- Install the APK file
-The second step is to install the APK file of FIFA 23 Mod FIFA 16 on your device. To do this, locate the APK file in your file manager app or ZIP extractor app and tap on it. You will see a pop-up window asking for your permission to install the app. Tap on Install and wait for the installation process to complete.
- Move the OBB and DATA folders to the right locations
-The third step is to move the OBB and DATA folders of FIFA 23 Mod FIFA 16 to the right locations on your device. To do this, locate the OBB folder in your file manager app or ZIP extractor app and move it to Android > OBB folder on your device's internal storage. Similarly, locate the DATA folder in your file manager app or ZIP extractor app and move it to Android > DATA folder on your device's internal storage.
- Launch the game and enjoy
-The final step is to launch the game and enjoy playing FIFA 23 Mod FIFA 16 on your Android device. To do this, locate the game icon on your device's home screen or app drawer and tap on it. You will see a loading screen and then a welcome screen. Tap on Start and choose your preferred mode and team. You can also access the settings and options from the main menu. You are now ready to enjoy playing FIFA 23 Mod FIFA 16 on your Android device.
- Conclusion
-FIFA 23 Mod FIFA 16 is a modified version of the original FIFA 16 game by EA Sports that brings some of the features and improvements of the upcoming FIFA 23 game to the older version. It is a fan-made project that is not affiliated with EA Sports, but it is a great way to enjoy some of the latest soccer action on your Android device. The mod includes some of the latest transfers and kits of the players and teams, realistic graphics and gameplay, offline mode and multiplayer option, customizable controls and settings, and more. To download and install FIFA 23 Mod FIFA 16 on your Android device, you need to follow some simple steps that we have explained in this article. We hope you found this article helpful and informative. If you have any questions or feedback, feel free to leave them in the comments section below.
- FAQs
-Here are some of the frequently asked questions about FIFA 23 Mod FIFA 16:
- Is FIFA 23 Mod FIFA 16 safe to download and install?
-Yes, FIFA 23 Mod FIFA 16 is safe to download and install on your Android device. However, you need to make sure that you download it from a reliable source, such as the link we have provided in this article. You also need to enable installation from unknown sources on your device before installing the APK file.
- Is FIFA 23 Mod FIFA 16 compatible with my device?
-FIFA 23 Mod FIFA 16 is compatible with most Android devices that have Android 4.4 or higher version, at least 2 GB of RAM and 4 GB of free storage space, and a good internet connection. However, some devices may experience some lag or glitches due to their hardware or software limitations. If you encounter any problems while playing the game, you can try lowering the graphics quality or closing other apps running in the background.
- How can I update FIFA 23 Mod FIFA 16?
-FIFA 23 Mod FIFA 16 is updated regularly by the modders to fix any bugs or errors and add new features and content. To update the game, you need to download the latest version of the APK, OBB, and DATA files from the same source you downloaded them before. Then, you need to uninstall the previous version of the game from your device and install the new version following the same steps we have explained in this article.
- How can I contact the modders of FIFA 23 Mod FIFA 16?
-If you want to contact the modders of FIFA 23 Mod FIFA 16, you can visit their official website or their social media pages. You can also leave a comment on their YouTube videos or blog posts. The modders are very friendly and responsive, and they will try to answer your questions or feedback as soon as possible.
- Can I play FIFA 23 Mod FIFA 16 with a controller?
-Yes, you can play FIFA 23 Mod FIFA 16 with a controller if your device supports it. You can connect your controller via Bluetooth or USB cable and configure it in the settings menu of the game. You can also use an app like Octopus or Panda Gamepad Pro to map your controller buttons to the game controls.
197e85843d
-
-
\ No newline at end of file
diff --git a/spaces/2-2/blockchain.ai/style.css b/spaces/2-2/blockchain.ai/style.css
deleted file mode 100644
index 114adf441e9032febb46bc056b2a8bb651075f0d..0000000000000000000000000000000000000000
--- a/spaces/2-2/blockchain.ai/style.css
+++ /dev/null
@@ -1,28 +0,0 @@
-body {
- padding: 2rem;
- font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
-}
-
-h1 {
- font-size: 16px;
- margin-top: 0;
-}
-
-p {
- color: rgb(107, 114, 128);
- font-size: 15px;
- margin-bottom: 10px;
- margin-top: 5px;
-}
-
-.card {
- max-width: 620px;
- margin: 0 auto;
- padding: 16px;
- border: 1px solid lightgray;
- border-radius: 16px;
-}
-
-.card p:last-child {
- margin-bottom: 0;
-}
diff --git a/spaces/2ndelement/voicevox/engine_manifest_assets/terms_of_service.md b/spaces/2ndelement/voicevox/engine_manifest_assets/terms_of_service.md
deleted file mode 100644
index c97bb512c679e98b7685a3b3d7013497ca280954..0000000000000000000000000000000000000000
--- a/spaces/2ndelement/voicevox/engine_manifest_assets/terms_of_service.md
+++ /dev/null
@@ -1 +0,0 @@
-dummy teams of service
\ No newline at end of file
diff --git a/spaces/4RiZ4/stabilityai-stable-diffusion-2/README.md b/spaces/4RiZ4/stabilityai-stable-diffusion-2/README.md
deleted file mode 100644
index 518c8a4a7a5a5c9e6ae7a1ee14267510b7c93511..0000000000000000000000000000000000000000
--- a/spaces/4RiZ4/stabilityai-stable-diffusion-2/README.md
+++ /dev/null
@@ -1,13 +0,0 @@
----
-title: Stabilityai Stable Diffusion 2
-emoji: 🌍
-colorFrom: purple
-colorTo: blue
-sdk: gradio
-sdk_version: 3.29.0
-app_file: app.py
-pinned: false
-license: unknown
----
-
-Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
diff --git a/spaces/AIGC-Audio/AudioGPT/NeuralSeq/data_gen/tts/emotion/audio.py b/spaces/AIGC-Audio/AudioGPT/NeuralSeq/data_gen/tts/emotion/audio.py
deleted file mode 100644
index 2a5eed96f08995c4f7e872a0f28a02bf0f0ad4ab..0000000000000000000000000000000000000000
--- a/spaces/AIGC-Audio/AudioGPT/NeuralSeq/data_gen/tts/emotion/audio.py
+++ /dev/null
@@ -1,107 +0,0 @@
-from scipy.ndimage.morphology import binary_dilation
-from data_gen.tts.emotion.params_data import *
-from pathlib import Path
-from typing import Optional, Union
-import numpy as np
-import webrtcvad
-import librosa
-import struct
-
-int16_max = (2 ** 15) - 1
-
-
-def preprocess_wav(fpath_or_wav: Union[str, Path, np.ndarray],
- source_sr: Optional[int] = None):
- """
- Applies the preprocessing operations used in training the Speaker Encoder to a waveform
- either on disk or in memory. The waveform will be resampled to match the data hyperparameters.
-
- :param fpath_or_wav: either a filepath to an audio file (many extensions are supported, not
- just .wav), either the waveform as a numpy array of floats.
- :param source_sr: if passing an audio waveform, the sampling rate of the waveform before
- preprocessing. After preprocessing, the waveform's sampling rate will match the data
- hyperparameters. If passing a filepath, the sampling rate will be automatically detected and
- this argument will be ignored.
- """
- # Load the wav from disk if needed
- if isinstance(fpath_or_wav, str) or isinstance(fpath_or_wav, Path):
- wav, source_sr = librosa.load(str(fpath_or_wav), sr=None)
- else:
- wav = fpath_or_wav
-
- # Resample the wav if needed
- if source_sr is not None and source_sr != sampling_rate:
- wav = librosa.resample(wav, source_sr, sampling_rate)
-
- # Apply the preprocessing: normalize volume and shorten long silences
- wav = normalize_volume(wav, audio_norm_target_dBFS, increase_only=True)
- wav = trim_long_silences(wav)
-
- return wav
-
-
-def wav_to_mel_spectrogram(wav):
- """
- Derives a mel spectrogram ready to be used by the encoder from a preprocessed audio waveform.
- Note: this not a log-mel spectrogram.
- """
- frames = librosa.feature.melspectrogram(
- wav,
- sampling_rate,
- n_fft=int(sampling_rate * mel_window_length / 1000),
- hop_length=int(sampling_rate * mel_window_step / 1000),
- n_mels=mel_n_channels
- )
- return frames.astype(np.float32).T
-
-
-def trim_long_silences(wav):
- """
- Ensures that segments without voice in the waveform remain no longer than a
- threshold determined by the VAD parameters in params.py.
-
- :param wav: the raw waveform as a numpy array of floats
- :return: the same waveform with silences trimmed away (length <= original wav length)
- """
- # Compute the voice detection window size
- samples_per_window = (vad_window_length * sampling_rate) // 1000
-
- # Trim the end of the audio to have a multiple of the window size
- wav = wav[:len(wav) - (len(wav) % samples_per_window)]
-
- # Convert the float waveform to 16-bit mono PCM
- pcm_wave = struct.pack("%dh" % len(wav), *(np.round(wav * int16_max)).astype(np.int16))
-
- # Perform voice activation detection
- voice_flags = []
- vad = webrtcvad.Vad(mode=3)
- for window_start in range(0, len(wav), samples_per_window):
- window_end = window_start + samples_per_window
- voice_flags.append(vad.is_speech(pcm_wave[window_start * 2:window_end * 2],
- sample_rate=sampling_rate))
- voice_flags = np.array(voice_flags)
-
- # Smooth the voice detection with a moving average
- def moving_average(array, width):
- array_padded = np.concatenate((np.zeros((width - 1) // 2), array, np.zeros(width // 2)))
- ret = np.cumsum(array_padded, dtype=float)
- ret[width:] = ret[width:] - ret[:-width]
- return ret[width - 1:] / width
-
- audio_mask = moving_average(voice_flags, vad_moving_average_width)
- audio_mask = np.round(audio_mask).astype(np.bool)
-
- # Dilate the voiced regions
- audio_mask = binary_dilation(audio_mask, np.ones(vad_max_silence_length + 1))
- audio_mask = np.repeat(audio_mask, samples_per_window)
-
- return wav[audio_mask == True]
-
-
-def normalize_volume(wav, target_dBFS, increase_only=False, decrease_only=False):
- if increase_only and decrease_only:
- raise ValueError("Both increase only and decrease only are set")
- dBFS_change = target_dBFS - 10 * np.log10(np.mean(wav ** 2))
- if (dBFS_change < 0 and increase_only) or (dBFS_change > 0 and decrease_only):
- return wav
- return wav * (10 ** (dBFS_change / 20))
diff --git a/spaces/AIGC-Audio/AudioGPT/NeuralSeq/tasks/tts/ps_flow.py b/spaces/AIGC-Audio/AudioGPT/NeuralSeq/tasks/tts/ps_flow.py
deleted file mode 100644
index 311c1cbf27dd90ac0bd929e2a5d17c928e2dce94..0000000000000000000000000000000000000000
--- a/spaces/AIGC-Audio/AudioGPT/NeuralSeq/tasks/tts/ps_flow.py
+++ /dev/null
@@ -1,135 +0,0 @@
-import torch
-from modules.portaspeech.portaspeech_flow import PortaSpeechFlow
-from tasks.tts.fs2 import FastSpeech2Task
-from tasks.tts.ps import PortaSpeechTask
-from utils.pitch_utils import denorm_f0
-from utils.hparams import hparams
-
-
-class PortaSpeechFlowTask(PortaSpeechTask):
- def __init__(self):
- super().__init__()
- self.training_post_glow = False
-
- def build_tts_model(self):
- ph_dict_size = len(self.token_encoder)
- word_dict_size = len(self.word_encoder)
- self.model = PortaSpeechFlow(ph_dict_size, word_dict_size, hparams)
-
- def _training_step(self, sample, batch_idx, opt_idx):
- self.training_post_glow = self.global_step >= hparams['post_glow_training_start'] \
- and hparams['use_post_flow']
- if hparams['two_stage'] and \
- ((opt_idx == 0 and self.training_post_glow) or (opt_idx == 1 and not self.training_post_glow)):
- return None
- loss_output, _ = self.run_model(sample)
- total_loss = sum([v for v in loss_output.values() if isinstance(v, torch.Tensor) and v.requires_grad])
- loss_output['batch_size'] = sample['txt_tokens'].size()[0]
- if 'postflow' in loss_output and loss_output['postflow'] is None:
- return None
- return total_loss, loss_output
-
- def run_model(self, sample, infer=False, *args, **kwargs):
- if not infer:
- training_post_glow = self.training_post_glow
- spk_embed = sample.get('spk_embed')
- spk_id = sample.get('spk_ids')
- output = self.model(sample['txt_tokens'],
- sample['word_tokens'],
- ph2word=sample['ph2word'],
- mel2word=sample['mel2word'],
- mel2ph=sample['mel2ph'],
- word_len=sample['word_lengths'].max(),
- tgt_mels=sample['mels'],
- pitch=sample.get('pitch'),
- spk_embed=spk_embed,
- spk_id=spk_id,
- infer=False,
- forward_post_glow=training_post_glow,
- two_stage=hparams['two_stage'],
- global_step=self.global_step,
- bert_feats=sample.get('bert_feats'))
- losses = {}
- self.add_mel_loss(output['mel_out'], sample['mels'], losses)
- if (training_post_glow or not hparams['two_stage']) and hparams['use_post_flow']:
- losses['postflow'] = output['postflow']
- losses['l1'] = losses['l1'].detach()
- losses['ssim'] = losses['ssim'].detach()
- if not training_post_glow or not hparams['two_stage'] or not self.training:
- losses['kl'] = output['kl']
- if self.global_step < hparams['kl_start_steps']:
- losses['kl'] = losses['kl'].detach()
- else:
- losses['kl'] = torch.clamp(losses['kl'], min=hparams['kl_min'])
- losses['kl'] = losses['kl'] * hparams['lambda_kl']
- if hparams['dur_level'] == 'word':
- self.add_dur_loss(
- output['dur'], sample['mel2word'], sample['word_lengths'], sample['txt_tokens'], losses)
- self.get_attn_stats(output['attn'], sample, losses)
- else:
- super().add_dur_loss(output['dur'], sample['mel2ph'], sample['txt_tokens'], losses)
- return losses, output
- else:
- use_gt_dur = kwargs.get('infer_use_gt_dur', hparams['use_gt_dur'])
- forward_post_glow = self.global_step >= hparams['post_glow_training_start'] + 1000 \
- and hparams['use_post_flow']
- spk_embed = sample.get('spk_embed')
- spk_id = sample.get('spk_ids')
- output = self.model(
- sample['txt_tokens'],
- sample['word_tokens'],
- ph2word=sample['ph2word'],
- word_len=sample['word_lengths'].max(),
- pitch=sample.get('pitch'),
- mel2ph=sample['mel2ph'] if use_gt_dur else None,
- mel2word=sample['mel2word'] if hparams['profile_infer'] or hparams['use_gt_dur'] else None,
- infer=True,
- forward_post_glow=forward_post_glow,
- spk_embed=spk_embed,
- spk_id=spk_id,
- two_stage=hparams['two_stage'],
- bert_feats=sample.get('bert_feats'))
- return output
-
- def validation_step(self, sample, batch_idx):
- self.training_post_glow = self.global_step >= hparams['post_glow_training_start'] \
- and hparams['use_post_flow']
- return super().validation_step(sample, batch_idx)
-
- def save_valid_result(self, sample, batch_idx, model_out):
- super(PortaSpeechFlowTask, self).save_valid_result(sample, batch_idx, model_out)
- sr = hparams['audio_sample_rate']
- f0_gt = None
- if sample.get('f0') is not None:
- f0_gt = denorm_f0(sample['f0'][0].cpu(), sample['uv'][0].cpu())
- if self.global_step > 0:
- # save FVAE result
- if hparams['use_post_flow']:
- wav_pred = self.vocoder.spec2wav(model_out['mel_out_fvae'][0].cpu(), f0=f0_gt)
- self.logger.add_audio(f'wav_fvae_{batch_idx}', wav_pred, self.global_step, sr)
- self.plot_mel(batch_idx, sample['mels'], model_out['mel_out_fvae'][0],
- f'mel_fvae_{batch_idx}', f0s=f0_gt)
-
- def build_optimizer(self, model):
- if hparams['two_stage'] and hparams['use_post_flow']:
- self.optimizer = torch.optim.AdamW(
- [p for name, p in self.model.named_parameters() if 'post_flow' not in name],
- lr=hparams['lr'],
- betas=(hparams['optimizer_adam_beta1'], hparams['optimizer_adam_beta2']),
- weight_decay=hparams['weight_decay'])
- self.post_flow_optimizer = torch.optim.AdamW(
- self.model.post_flow.parameters(),
- lr=hparams['post_flow_lr'],
- betas=(hparams['optimizer_adam_beta1'], hparams['optimizer_adam_beta2']),
- weight_decay=hparams['weight_decay'])
- return [self.optimizer, self.post_flow_optimizer]
- else:
- self.optimizer = torch.optim.AdamW(
- self.model.parameters(),
- lr=hparams['lr'],
- betas=(hparams['optimizer_adam_beta1'], hparams['optimizer_adam_beta2']),
- weight_decay=hparams['weight_decay'])
- return [self.optimizer]
-
- def build_scheduler(self, optimizer):
- return FastSpeech2Task.build_scheduler(self, optimizer[0])
\ No newline at end of file
diff --git a/spaces/AIGC-Audio/Make_An_Audio_inpaint/ldm/models/autoencoder.py b/spaces/AIGC-Audio/Make_An_Audio_inpaint/ldm/models/autoencoder.py
deleted file mode 100644
index cd4529dfcc23562632fa9b059a87fa5af50f014d..0000000000000000000000000000000000000000
--- a/spaces/AIGC-Audio/Make_An_Audio_inpaint/ldm/models/autoencoder.py
+++ /dev/null
@@ -1,474 +0,0 @@
-import os
-import torch
-import pytorch_lightning as pl
-import torch.nn.functional as F
-from contextlib import contextmanager
-from packaging import version
-import numpy as np
-from ldm.modules.diffusionmodules.model import Encoder, Decoder
-from ldm.modules.distributions.distributions import DiagonalGaussianDistribution
-from torch.optim.lr_scheduler import LambdaLR
-from ldm.util import instantiate_from_config
-# from icecream import ic
-
-class VQModel(pl.LightningModule):
- def __init__(self,
- ddconfig,
- lossconfig,
- n_embed,
- embed_dim,
- ckpt_path=None,
- ignore_keys=[],
- image_key="image",
- colorize_nlabels=None,
- monitor=None,
- batch_resize_range=None,
- scheduler_config=None,
- lr_g_factor=1.0,
- remap=None,
- sane_index_shape=False, # tell vector quantizer to return indices as bhw
- use_ema=False
- ):
- super().__init__()
- self.embed_dim = embed_dim
- self.n_embed = n_embed
- self.image_key = image_key
- self.encoder = Encoder(**ddconfig)
- self.decoder = Decoder(**ddconfig)
- self.loss = instantiate_from_config(lossconfig)
- self.quantize = VectorQuantizer(n_embed, embed_dim, beta=0.25,
- remap=remap,
- sane_index_shape=sane_index_shape)
- self.quant_conv = torch.nn.Conv2d(ddconfig["z_channels"], embed_dim, 1)
- self.post_quant_conv = torch.nn.Conv2d(embed_dim, ddconfig["z_channels"], 1)
- if colorize_nlabels is not None:
- assert type(colorize_nlabels)==int
- self.register_buffer("colorize", torch.randn(3, colorize_nlabels, 1, 1))
- if monitor is not None:
- self.monitor = monitor
- self.batch_resize_range = batch_resize_range
- if self.batch_resize_range is not None:
- print(f"{self.__class__.__name__}: Using per-batch resizing in range {batch_resize_range}.")
-
- self.use_ema = use_ema
- if self.use_ema:
- self.model_ema = LitEma(self)
- print(f"Keeping EMAs of {len(list(self.model_ema.buffers()))}.")
-
- if ckpt_path is not None:
- self.init_from_ckpt(ckpt_path, ignore_keys=ignore_keys)
- self.scheduler_config = scheduler_config
- self.lr_g_factor = lr_g_factor
-
- @contextmanager
- def ema_scope(self, context=None):
- if self.use_ema:
- self.model_ema.store(self.parameters())
- self.model_ema.copy_to(self)
- if context is not None:
- print(f"{context}: Switched to EMA weights")
- try:
- yield None
- finally:
- if self.use_ema:
- self.model_ema.restore(self.parameters())
- if context is not None:
- print(f"{context}: Restored training weights")
-
- def init_from_ckpt(self, path, ignore_keys=list()):
- sd = torch.load(path, map_location="cpu")["state_dict"]
- keys = list(sd.keys())
- for k in keys:
- for ik in ignore_keys:
- if k.startswith(ik):
- print("Deleting key {} from state_dict.".format(k))
- del sd[k]
- missing, unexpected = self.load_state_dict(sd, strict=False)
- print(f"Restored from {path} with {len(missing)} missing and {len(unexpected)} unexpected keys")
- if len(missing) > 0:
- print(f"Missing Keys: {missing}")
- print(f"Unexpected Keys: {unexpected}")
-
- def on_train_batch_end(self, *args, **kwargs):
- if self.use_ema:
- self.model_ema(self)
-
- def encode(self, x):
- h = self.encoder(x)
- h = self.quant_conv(h)
- quant, emb_loss, info = self.quantize(h)
- return quant, emb_loss, info
-
- def encode_to_prequant(self, x):
- h = self.encoder(x)
- h = self.quant_conv(h)
- return h
-
- def decode(self, quant):
- quant = self.post_quant_conv(quant)
- dec = self.decoder(quant)
- return dec
-
- def decode_code(self, code_b):
- quant_b = self.quantize.embed_code(code_b)
- dec = self.decode(quant_b)
- return dec
-
- def forward(self, input, return_pred_indices=False):
- quant, diff, (_,_,ind) = self.encode(input)
- dec = self.decode(quant)
- if return_pred_indices:
- return dec, diff, ind
- return dec, diff
-
- def get_input(self, batch, k):
- x = batch[k]
- if len(x.shape) == 3:
- x = x[..., None]
- x = x.permute(0, 3, 1, 2).to(memory_format=torch.contiguous_format).float()
- if self.batch_resize_range is not None:
- lower_size = self.batch_resize_range[0]
- upper_size = self.batch_resize_range[1]
- if self.global_step <= 4:
- # do the first few batches with max size to avoid later oom
- new_resize = upper_size
- else:
- new_resize = np.random.choice(np.arange(lower_size, upper_size+16, 16))
- if new_resize != x.shape[2]:
- x = F.interpolate(x, size=new_resize, mode="bicubic")
- x = x.detach()
- return x
-
- def training_step(self, batch, batch_idx, optimizer_idx):
- # https://github.com/pytorch/pytorch/issues/37142
- # try not to fool the heuristics
- x = self.get_input(batch, self.image_key)
- xrec, qloss, ind = self(x, return_pred_indices=True)
-
- if optimizer_idx == 0:
- # autoencode
- aeloss, log_dict_ae = self.loss(qloss, x, xrec, optimizer_idx, self.global_step,
- last_layer=self.get_last_layer(), split="train",
- predicted_indices=ind)
-
- self.log_dict(log_dict_ae, prog_bar=False, logger=True, on_step=True, on_epoch=True)
- return aeloss
-
- if optimizer_idx == 1:
- # discriminator
- discloss, log_dict_disc = self.loss(qloss, x, xrec, optimizer_idx, self.global_step,
- last_layer=self.get_last_layer(), split="train")
- self.log_dict(log_dict_disc, prog_bar=False, logger=True, on_step=True, on_epoch=True)
- return discloss
-
- def validation_step(self, batch, batch_idx):
- log_dict = self._validation_step(batch, batch_idx)
- with self.ema_scope():
- log_dict_ema = self._validation_step(batch, batch_idx, suffix="_ema")
- return log_dict
-
- def _validation_step(self, batch, batch_idx, suffix=""):
- x = self.get_input(batch, self.image_key)
- xrec, qloss, ind = self(x, return_pred_indices=True)
- aeloss, log_dict_ae = self.loss(qloss, x, xrec, 0,
- self.global_step,
- last_layer=self.get_last_layer(),
- split="val"+suffix,
- predicted_indices=ind
- )
-
- discloss, log_dict_disc = self.loss(qloss, x, xrec, 1,
- self.global_step,
- last_layer=self.get_last_layer(),
- split="val"+suffix,
- predicted_indices=ind
- )
- rec_loss = log_dict_ae[f"val{suffix}/rec_loss"]
- self.log(f"val{suffix}/rec_loss", rec_loss,
- prog_bar=True, logger=True, on_step=False, on_epoch=True, sync_dist=True)
- self.log(f"val{suffix}/aeloss", aeloss,
- prog_bar=True, logger=True, on_step=False, on_epoch=True, sync_dist=True)
- if version.parse(pl.__version__) >= version.parse('1.4.0'):
- del log_dict_ae[f"val{suffix}/rec_loss"]
- self.log_dict(log_dict_ae)
- self.log_dict(log_dict_disc)
- return self.log_dict
-
- def test_step(self, batch, batch_idx):
- x = self.get_input(batch, self.image_key)
- xrec, qloss, ind = self(x, return_pred_indices=True)
- reconstructions = (xrec + 1)/2 # to mel scale
- test_ckpt_path = os.path.basename(self.trainer.tested_ckpt_path)
- savedir = os.path.join(self.trainer.log_dir,f'output_imgs_{test_ckpt_path}','fake_class')
- if not os.path.exists(savedir):
- os.makedirs(savedir)
-
- file_names = batch['f_name']
- # print(f"reconstructions.shape:{reconstructions.shape}",file_names)
- reconstructions = reconstructions.cpu().numpy().squeeze(1) # squuze channel dim
- for b in range(reconstructions.shape[0]):
- vname_num_split_index = file_names[b].rfind('_')# file_names[b]:video_name+'_'+num
- v_n,num = file_names[b][:vname_num_split_index],file_names[b][vname_num_split_index+1:]
- save_img_path = os.path.join(savedir,f'{v_n}_sample_{num}.npy')
- np.save(save_img_path,reconstructions[b])
-
- return None
-
- def configure_optimizers(self):
- lr_d = self.learning_rate
- lr_g = self.lr_g_factor*self.learning_rate
- print("lr_d", lr_d)
- print("lr_g", lr_g)
- opt_ae = torch.optim.Adam(list(self.encoder.parameters())+
- list(self.decoder.parameters())+
- list(self.quantize.parameters())+
- list(self.quant_conv.parameters())+
- list(self.post_quant_conv.parameters()),
- lr=lr_g, betas=(0.5, 0.9))
- opt_disc = torch.optim.Adam(self.loss.discriminator.parameters(),
- lr=lr_d, betas=(0.5, 0.9))
-
- if self.scheduler_config is not None:
- scheduler = instantiate_from_config(self.scheduler_config)
-
- print("Setting up LambdaLR scheduler...")
- scheduler = [
- {
- 'scheduler': LambdaLR(opt_ae, lr_lambda=scheduler.schedule),
- 'interval': 'step',
- 'frequency': 1
- },
- {
- 'scheduler': LambdaLR(opt_disc, lr_lambda=scheduler.schedule),
- 'interval': 'step',
- 'frequency': 1
- },
- ]
- return [opt_ae, opt_disc], scheduler
- return [opt_ae, opt_disc], []
-
- def get_last_layer(self):
- return self.decoder.conv_out.weight
-
- def log_images(self, batch, only_inputs=False, plot_ema=False, **kwargs):
- log = dict()
- x = self.get_input(batch, self.image_key)
- x = x.to(self.device)
- if only_inputs:
- log["inputs"] = x
- return log
- xrec, _ = self(x)
- if x.shape[1] > 3:
- # colorize with random projection
- assert xrec.shape[1] > 3
- x = self.to_rgb(x)
- xrec = self.to_rgb(xrec)
- log["inputs"] = x
- log["reconstructions"] = xrec
- if plot_ema:
- with self.ema_scope():
- xrec_ema, _ = self(x)
- if x.shape[1] > 3: xrec_ema = self.to_rgb(xrec_ema)
- log["reconstructions_ema"] = xrec_ema
- return log
-
- def to_rgb(self, x):
- assert self.image_key == "segmentation"
- if not hasattr(self, "colorize"):
- self.register_buffer("colorize", torch.randn(3, x.shape[1], 1, 1).to(x))
- x = F.conv2d(x, weight=self.colorize)
- x = 2.*(x-x.min())/(x.max()-x.min()) - 1.
- return x
-
-
-class VQModelInterface(VQModel):
- def __init__(self, embed_dim, *args, **kwargs):
- super().__init__(embed_dim=embed_dim, *args, **kwargs)
- self.embed_dim = embed_dim
-
- def encode(self, x):# VQModel的quantize写在encoder里,VQModelInterface则将其写在decoder里
- h = self.encoder(x)
- h = self.quant_conv(h)
- return h
-
- def decode(self, h, force_not_quantize=False):
- # also go through quantization layer
- if not force_not_quantize:
- quant, emb_loss, info = self.quantize(h)
- else:
- quant = h
- quant = self.post_quant_conv(quant)
- dec = self.decoder(quant)
- return dec
-
-
-class AutoencoderKL(pl.LightningModule):
- def __init__(self,
- ddconfig,
- lossconfig,
- embed_dim,
- ckpt_path=None,
- ignore_keys=[],
- image_key="image",
- colorize_nlabels=None,
- monitor=None,
- ):
- super().__init__()
- self.image_key = image_key
- self.encoder = Encoder(**ddconfig)
- self.decoder = Decoder(**ddconfig)
- self.loss = instantiate_from_config(lossconfig)
- assert ddconfig["double_z"]
- self.quant_conv = torch.nn.Conv2d(2*ddconfig["z_channels"], 2*embed_dim, 1)
- self.post_quant_conv = torch.nn.Conv2d(embed_dim, ddconfig["z_channels"], 1)
- self.embed_dim = embed_dim
- if colorize_nlabels is not None:
- assert type(colorize_nlabels)==int
- self.register_buffer("colorize", torch.randn(3, colorize_nlabels, 1, 1))
- if monitor is not None:
- self.monitor = monitor
- if ckpt_path is not None:
- self.init_from_ckpt(ckpt_path, ignore_keys=ignore_keys)
- # self.automatic_optimization = False # hjw for debug
-
- def init_from_ckpt(self, path, ignore_keys=list()):
- sd = torch.load(path, map_location="cpu")["state_dict"]
- keys = list(sd.keys())
- for k in keys:
- for ik in ignore_keys:
- if k.startswith(ik):
- print("Deleting key {} from state_dict.".format(k))
- del sd[k]
- self.load_state_dict(sd, strict=False)
- print(f"Restored from {path}")
-
- def encode(self, x):
- h = self.encoder(x)
- moments = self.quant_conv(h)
- posterior = DiagonalGaussianDistribution(moments)
- return posterior
-
- def decode(self, z):
- z = self.post_quant_conv(z)
- dec = self.decoder(z)
- return dec
-
- def forward(self, input, sample_posterior=True):
- posterior = self.encode(input)
- if sample_posterior:
- z = posterior.sample()
- else:
- z = posterior.mode()
- dec = self.decode(z)
- return dec, posterior
-
- def get_input(self, batch, k):
- x = batch[k]
- if len(x.shape) == 3:
- x = x[..., None]
- x = x.permute(0, 3, 1, 2).to(memory_format=torch.contiguous_format).float()
- return x
-
- def training_step(self, batch, batch_idx, optimizer_idx):
- inputs = self.get_input(batch, self.image_key)
- reconstructions, posterior = self(inputs)
-
- if optimizer_idx == 0:
- # train encoder+decoder+logvar
- aeloss, log_dict_ae = self.loss(inputs, reconstructions, posterior, optimizer_idx, self.global_step,
- last_layer=self.get_last_layer(), split="train")
- self.log("aeloss", aeloss, prog_bar=True, logger=True, on_step=True, on_epoch=True)
- self.log_dict(log_dict_ae, prog_bar=False, logger=True, on_step=True, on_epoch=False)
- return aeloss
-
- if optimizer_idx == 1:
- # train the discriminator
- discloss, log_dict_disc = self.loss(inputs, reconstructions, posterior, optimizer_idx, self.global_step,
- last_layer=self.get_last_layer(), split="train")
-
- self.log("discloss", discloss, prog_bar=True, logger=True, on_step=True, on_epoch=True)
- self.log_dict(log_dict_disc, prog_bar=False, logger=True, on_step=True, on_epoch=False)
- return discloss
-
- def validation_step(self, batch, batch_idx):
- # self.log_images(batch,only_inputs=False,save_dir='mel_result_ae13_26/fake_class')
- return self.log_dict
-
- def test_step(self, batch, batch_idx):
- test_ckpt_path = os.path.basename(self.trainer.tested_ckpt_path)
- savedir = os.path.join(self.trainer.log_dir,f'output_imgs_{test_ckpt_path}','fake_class')
- os.makedirs(savedir,exist_ok=True)
- inputs = self.get_input(batch, self.image_key)# inputs shape:(b,c,mel_len,T) or (b,c,h,w)
- # ic(inputs.shape)
- # inputs = inputs[...,:624]
- # ic(inputs.shape)
- xrec, posterior = self(inputs)# reconstructions:(b,c,mel_len,T) or (b,c,h,w)
- file_names = batch['f_name']
- # print(f"reconstructions.shape:{reconstructions.shape}",file_names)
- for b in range(len(file_names)):
- rcon = (xrec[b].squeeze().detach().cpu().numpy() + 1) / 2 # to mel scale,squeeze channel dim
- vname_num_split_index = file_names[b].rfind('_')# file_names[b]:video_name+'_'+num
- v_n,num = file_names[b][:vname_num_split_index],file_names[b][vname_num_split_index+1:]
- save_img_path = os.path.join(savedir,f'{v_n}_sample_{num}.npy')
- np.save(save_img_path,rcon)
-
- return None
-
- def configure_optimizers(self):
- lr = self.learning_rate
- opt_ae = torch.optim.Adam(list(self.encoder.parameters())+
- list(self.decoder.parameters())+
- list(self.quant_conv.parameters())+
- list(self.post_quant_conv.parameters()),
- lr=lr, betas=(0.5, 0.9))
- opt_disc = torch.optim.Adam(self.loss.discriminator.parameters(),
- lr=lr, betas=(0.5, 0.9))
- return [opt_ae, opt_disc], []
-
- def get_last_layer(self):
- return self.decoder.conv_out.weight
-
- @torch.no_grad()
- def log_images(self, batch, only_inputs=False,save_dir = 'mel_result_ae13_26_debug/fake_class', **kwargs): # 在main.py的on_validation_batch_end中调用
- log = dict()
- x = self.get_input(batch, self.image_key)
- x = x.to(self.device)
- if not only_inputs:
- xrec, posterior = self(x)
- if x.shape[1] > 3:
- # colorize with random projection
- assert xrec.shape[1] > 3
- x = self.to_rgb(x)
- xrec = self.to_rgb(xrec)
- log["samples"] = self.decode(torch.randn_like(posterior.sample()))
- log["reconstructions"] = xrec
- log["inputs"] = x
- return log
-
- def to_rgb(self, x):
- assert self.image_key == "segmentation"
- if not hasattr(self, "colorize"):
- self.register_buffer("colorize", torch.randn(3, x.shape[1], 1, 1).to(x))
- x = F.conv2d(x, weight=self.colorize)
- x = 2.*(x-x.min())/(x.max()-x.min()) - 1.
- return x
-
-
-class IdentityFirstStage(torch.nn.Module):
- def __init__(self, *args, vq_interface=False, **kwargs):
- self.vq_interface = vq_interface # TODO: Should be true by default but check to not break older stuff
- super().__init__()
-
- def encode(self, x, *args, **kwargs):
- return x
-
- def decode(self, x, *args, **kwargs):
- return x
-
- def quantize(self, x, *args, **kwargs):
- if self.vq_interface:
- return x, None, [None, None, None]
- return x
-
- def forward(self, x, *args, **kwargs):
- return x
diff --git a/spaces/AIWaves/Software_Company/src/agents/Component/__init__.py b/spaces/AIWaves/Software_Company/src/agents/Component/__init__.py
deleted file mode 100644
index 61d0e26fcc092bfe6da96fdb5696586ec7d30045..0000000000000000000000000000000000000000
--- a/spaces/AIWaves/Software_Company/src/agents/Component/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-from .ExtraComponent import *
-from .PromptComponent import *
-from .ToolComponent import *
\ No newline at end of file
diff --git a/spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/plugins/eventpromise-plugin.js b/spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/plugins/eventpromise-plugin.js
deleted file mode 100644
index e4c14f9af5524ecb8853b5724e2a88cfbe8f51b6..0000000000000000000000000000000000000000
--- a/spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/plugins/eventpromise-plugin.js
+++ /dev/null
@@ -1,22 +0,0 @@
-import { WaitEvent, WaitComplete, Delay } from './eventpromise.js'
-
-class EventPromisePlugin extends Phaser.Plugins.BasePlugin {
-
- constructor(pluginManager) {
- super(pluginManager);
- }
-}
-
-var methods = {
- waitEvent: WaitEvent,
- waitComplete: WaitComplete,
- delay: Delay,
-}
-
-// mixin
-Object.assign(
- EventPromisePlugin.prototype,
- methods
-);
-
-export default EventPromisePlugin;
\ No newline at end of file
diff --git a/spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/dialog-quest/DialogQuest.d.ts b/spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/dialog-quest/DialogQuest.d.ts
deleted file mode 100644
index be65378dd2beb8a83c9bb3a42891a7b4251a21d9..0000000000000000000000000000000000000000
--- a/spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/dialog-quest/DialogQuest.d.ts
+++ /dev/null
@@ -1,74 +0,0 @@
-import { Dialog } from '../ui/ui-components';
-import QuestManager from '../../plugins/quest'
-
-export default DialogQuest;
-
-declare namespace DialogQuest {
- interface IConfig extends QuestManager.IConfig {
- dialog: Dialog,
- }
-
- namespace Events {
- type UpdateChoiceCallbackType = (
- choice: Phaser.GameObjects.GameObject,
- option: QuestManager.QuestionType,
- quest: QuestManager.Quest
- ) => void;
-
- type UpdateDialogCallbackType = (
- dialog: Dialog,
- question: QuestManager.QuestionType,
- quest: QuestManager.Quest
- ) => void;
-
- type ClickChoiceCallbackType = (
- choice: Phaser.GameObjects.GameObject,
- dialog: Dialog,
- quest: QuestManager.Quest
- ) => void;
-
- type ClickActionCallbackType = (
- action: Phaser.GameObjects.GameObject,
- dialog: Dialog,
- quest: QuestManager.Quest
- ) => void;
- }
-}
-
-declare class DialogQuest extends Phaser.Events.EventEmitter {
- constructor(
- config?: DialogQuest.IConfig
- );
-
- start(): this;
-
- next(key?: string): this;
-
- isLast(): boolean;
-
- getData(
- key: string,
- defaultValue?: any
- ): any;
-
- getData(): any[];
-
- setData(
- key: string,
- value: any
- ): this;
-
- incData(
- key: string,
- inc: number,
- defaultValue?: number
- ): this;
-
- mulData(
- key: string,
- mul: number,
- defaultValue?: number
- ): this;
-
- clearData(): this;
-}
\ No newline at end of file
diff --git a/spaces/Andy1621/uniformer_image_detection/configs/dcn/cascade_mask_rcnn_x101_32x4d_fpn_dconv_c3-c5_1x_coco.py b/spaces/Andy1621/uniformer_image_detection/configs/dcn/cascade_mask_rcnn_x101_32x4d_fpn_dconv_c3-c5_1x_coco.py
deleted file mode 100644
index daaa4729c8280107b19107607ec399230713cf93..0000000000000000000000000000000000000000
--- a/spaces/Andy1621/uniformer_image_detection/configs/dcn/cascade_mask_rcnn_x101_32x4d_fpn_dconv_c3-c5_1x_coco.py
+++ /dev/null
@@ -1,5 +0,0 @@
-_base_ = '../cascade_rcnn/cascade_mask_rcnn_x101_32x4d_fpn_1x_coco.py'
-model = dict(
- backbone=dict(
- dcn=dict(type='DCN', deform_groups=1, fallback_on_stride=False),
- stage_with_dcn=(False, True, True, True)))
diff --git a/spaces/Andy1621/uniformer_image_detection/configs/faster_rcnn/faster_rcnn_r50_caffe_fpn_mstrain_3x_coco.py b/spaces/Andy1621/uniformer_image_detection/configs/faster_rcnn/faster_rcnn_r50_caffe_fpn_mstrain_3x_coco.py
deleted file mode 100644
index a0ba54d4a8524d0c55f4270feeaf3be7e81069e7..0000000000000000000000000000000000000000
--- a/spaces/Andy1621/uniformer_image_detection/configs/faster_rcnn/faster_rcnn_r50_caffe_fpn_mstrain_3x_coco.py
+++ /dev/null
@@ -1,4 +0,0 @@
-_base_ = './faster_rcnn_r50_caffe_fpn_mstrain_1x_coco.py'
-# learning policy
-lr_config = dict(step=[28, 34])
-runner = dict(type='EpochBasedRunner', max_epochs=36)
diff --git a/spaces/Andy1621/uniformer_image_segmentation/configs/_base_/schedules/schedule_40k.py b/spaces/Andy1621/uniformer_image_segmentation/configs/_base_/schedules/schedule_40k.py
deleted file mode 100644
index cdbf841abcb26eed87bf76ab816aff4bae0630ee..0000000000000000000000000000000000000000
--- a/spaces/Andy1621/uniformer_image_segmentation/configs/_base_/schedules/schedule_40k.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# optimizer
-optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005)
-optimizer_config = dict()
-# learning policy
-lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=False)
-# runtime settings
-runner = dict(type='IterBasedRunner', max_iters=40000)
-checkpoint_config = dict(by_epoch=False, interval=4000)
-evaluation = dict(interval=4000, metric='mIoU')
diff --git a/spaces/AnishKumbhar/ChatBot/text-generation-webui-main/extensions/multimodal/pipelines/llava/README.md b/spaces/AnishKumbhar/ChatBot/text-generation-webui-main/extensions/multimodal/pipelines/llava/README.md
deleted file mode 100644
index aff64faaae07d2f4da6c24e8ea03693326313139..0000000000000000000000000000000000000000
--- a/spaces/AnishKumbhar/ChatBot/text-generation-webui-main/extensions/multimodal/pipelines/llava/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-## LLaVA pipeline
-
-This module provides 2 pipelines:
-- `llava-7b` - for use with LLaVA v0 7B model (finetuned LLaMa 7B)
-- `llava-13b` - for use with LLaVA v0 13B model (finetuned LLaMa 13B)
-
-[LLaVA](https://github.com/haotian-liu/LLaVA) uses CLIP `openai/clip-vit-large-patch14` as the vision model, and then a single linear layer. For 13B the projector weights are in `liuhaotian/LLaVA-13b-delta-v0`, and for 7B they are in `liuhaotian/LLaVA-7b-delta-v0`.
-
-The supported parameter combinations for both the vision model, and the projector are: CUDA/32bit, CUDA/16bit, CPU/32bit
diff --git a/spaces/Apex-X/GODROOP/roop/processors/frame/core.py b/spaces/Apex-X/GODROOP/roop/processors/frame/core.py
deleted file mode 100644
index c225f9de483a2914a98392ce9de5bd03f2013a2d..0000000000000000000000000000000000000000
--- a/spaces/Apex-X/GODROOP/roop/processors/frame/core.py
+++ /dev/null
@@ -1,88 +0,0 @@
-import os
-import importlib
-import psutil
-from concurrent.futures import ThreadPoolExecutor, as_completed
-from queue import Queue
-from types import ModuleType
-from typing import Any, List, Callable
-from tqdm import tqdm
-
-import roop
-
-FRAME_PROCESSORS_MODULES: List[ModuleType] = []
-FRAME_PROCESSORS_INTERFACE = [
- 'pre_check',
- 'pre_start',
- 'process_frame',
- 'process_frames',
- 'process_image',
- 'process_video',
- 'post_process'
-]
-
-
-def load_frame_processor_module(frame_processor: str) -> Any:
- try:
- frame_processor_module = importlib.import_module(f'roop.processors.frame.{frame_processor}')
- for method_name in FRAME_PROCESSORS_INTERFACE:
- if not hasattr(frame_processor_module, method_name):
- raise NotImplementedError
- except (ImportError, NotImplementedError):
- quit(f'Frame processor {frame_processor} crashed.')
- return frame_processor_module
-
-
-def get_frame_processors_modules(frame_processors: List[str]) -> List[ModuleType]:
- global FRAME_PROCESSORS_MODULES
-
- if not FRAME_PROCESSORS_MODULES:
- for frame_processor in frame_processors:
- frame_processor_module = load_frame_processor_module(frame_processor)
- FRAME_PROCESSORS_MODULES.append(frame_processor_module)
- return FRAME_PROCESSORS_MODULES
-
-
-def multi_process_frame(source_path: str, temp_frame_paths: List[str], process_frames: Callable[[str, List[str], Any], None], update: Callable[[], None]) -> None:
- with ThreadPoolExecutor(max_workers=roop.globals.execution_threads) as executor:
- futures = []
- queue = create_queue(temp_frame_paths)
- queue_per_future = len(temp_frame_paths) // roop.globals.execution_threads
- while not queue.empty():
- future = executor.submit(process_frames, source_path, pick_queue(queue, queue_per_future), update)
- futures.append(future)
- for future in as_completed(futures):
- future.result()
-
-
-def create_queue(temp_frame_paths: List[str]) -> Queue[str]:
- queue: Queue[str] = Queue()
- for frame_path in temp_frame_paths:
- queue.put(frame_path)
- return queue
-
-
-def pick_queue(queue: Queue[str], queue_per_future: int) -> List[str]:
- queues = []
- for _ in range(queue_per_future):
- if not queue.empty():
- queues.append(queue.get())
- return queues
-
-
-def process_video(source_path: str, frame_paths: list[str], process_frames: Callable[[str, List[str], Any], None]) -> None:
- progress_bar_format = '{l_bar}{bar}| {n_fmt}/{total_fmt} [{elapsed}<{remaining}, {rate_fmt}{postfix}]'
- total = len(frame_paths)
- with tqdm(total=total, desc='Processing', unit='frame', dynamic_ncols=True, bar_format=progress_bar_format) as progress:
- multi_process_frame(source_path, frame_paths, process_frames, lambda: update_progress(progress))
-
-
-def update_progress(progress: Any = None) -> None:
- process = psutil.Process(os.getpid())
- memory_usage = process.memory_info().rss / 1024 / 1024 / 1024
- progress.set_postfix({
- 'memory_usage': '{:.2f}'.format(memory_usage).zfill(5) + 'GB',
- 'execution_providers': roop.globals.execution_providers,
- 'execution_threads': roop.globals.execution_threads
- })
- progress.refresh()
- progress.update(1)
diff --git a/spaces/Artrajz/vits-simple-api/vits/models.py b/spaces/Artrajz/vits-simple-api/vits/models.py
deleted file mode 100644
index 52cb03775c002454b4efea07deca88bf39b96df0..0000000000000000000000000000000000000000
--- a/spaces/Artrajz/vits-simple-api/vits/models.py
+++ /dev/null
@@ -1,419 +0,0 @@
-import math
-import torch
-from torch import nn
-from torch.nn import functional as F
-
-from vits import commons
-from vits import modules
-from vits import attentions
-
-from torch.nn import Conv1d, ConvTranspose1d
-from torch.nn.utils import weight_norm
-from vits.commons import init_weights
-
-
-class StochasticDurationPredictor(nn.Module):
- def __init__(self, in_channels, filter_channels, kernel_size, p_dropout, n_flows=4, gin_channels=0):
- super().__init__()
- filter_channels = in_channels # it needs to be removed from future version.
- self.in_channels = in_channels
- self.filter_channels = filter_channels
- self.kernel_size = kernel_size
- self.p_dropout = p_dropout
- self.n_flows = n_flows
- self.gin_channels = gin_channels
-
- self.log_flow = modules.Log()
- self.flows = nn.ModuleList()
- self.flows.append(modules.ElementwiseAffine(2))
- for i in range(n_flows):
- self.flows.append(modules.ConvFlow(2, filter_channels, kernel_size, n_layers=3))
- self.flows.append(modules.Flip())
-
- self.post_pre = nn.Conv1d(1, filter_channels, 1)
- self.post_proj = nn.Conv1d(filter_channels, filter_channels, 1)
- self.post_convs = modules.DDSConv(filter_channels, kernel_size, n_layers=3, p_dropout=p_dropout)
- self.post_flows = nn.ModuleList()
- self.post_flows.append(modules.ElementwiseAffine(2))
- for i in range(4):
- self.post_flows.append(modules.ConvFlow(2, filter_channels, kernel_size, n_layers=3))
- self.post_flows.append(modules.Flip())
-
- self.pre = nn.Conv1d(in_channels, filter_channels, 1)
- self.proj = nn.Conv1d(filter_channels, filter_channels, 1)
- self.convs = modules.DDSConv(filter_channels, kernel_size, n_layers=3, p_dropout=p_dropout)
- if gin_channels != 0:
- self.cond = nn.Conv1d(gin_channels, filter_channels, 1)
-
- def forward(self, x, x_mask, w=None, g=None, reverse=False, noise_scale=1.0):
- x = torch.detach(x)
- x = self.pre(x)
- if g is not None:
- g = torch.detach(g)
- x = x + self.cond(g)
- x = self.convs(x, x_mask)
- x = self.proj(x) * x_mask
-
- if not reverse:
- flows = self.flows
- assert w is not None
-
- logdet_tot_q = 0
- h_w = self.post_pre(w)
- h_w = self.post_convs(h_w, x_mask)
- h_w = self.post_proj(h_w) * x_mask
- e_q = torch.randn(w.size(0), 2, w.size(2)).to(device=x.device, dtype=x.dtype) * x_mask
- z_q = e_q
- for flow in self.post_flows:
- z_q, logdet_q = flow(z_q, x_mask, g=(x + h_w))
- logdet_tot_q += logdet_q
- z_u, z1 = torch.split(z_q, [1, 1], 1)
- u = torch.sigmoid(z_u) * x_mask
- z0 = (w - u) * x_mask
- logdet_tot_q += torch.sum((F.logsigmoid(z_u) + F.logsigmoid(-z_u)) * x_mask, [1, 2])
- logq = torch.sum(-0.5 * (math.log(2 * math.pi) + (e_q ** 2)) * x_mask, [1, 2]) - logdet_tot_q
-
- logdet_tot = 0
- z0, logdet = self.log_flow(z0, x_mask)
- logdet_tot += logdet
- z = torch.cat([z0, z1], 1)
- for flow in flows:
- z, logdet = flow(z, x_mask, g=x, reverse=reverse)
- logdet_tot = logdet_tot + logdet
- nll = torch.sum(0.5 * (math.log(2 * math.pi) + (z ** 2)) * x_mask, [1, 2]) - logdet_tot
- return nll + logq # [b]
- else:
- flows = list(reversed(self.flows))
- flows = flows[:-2] + [flows[-1]] # remove a useless vflow
- z = torch.randn(x.size(0), 2, x.size(2)).to(device=x.device, dtype=x.dtype) * noise_scale
- for flow in flows:
- z = flow(z, x_mask, g=x, reverse=reverse)
- z0, z1 = torch.split(z, [1, 1], 1)
- logw = z0
- return logw
-
-
-class DurationPredictor(nn.Module):
- def __init__(self, in_channels, filter_channels, kernel_size, p_dropout, gin_channels=0):
- super().__init__()
-
- self.in_channels = in_channels
- self.filter_channels = filter_channels
- self.kernel_size = kernel_size
- self.p_dropout = p_dropout
- self.gin_channels = gin_channels
-
- self.drop = nn.Dropout(p_dropout)
- self.conv_1 = nn.Conv1d(in_channels, filter_channels, kernel_size, padding=kernel_size // 2)
- self.norm_1 = modules.LayerNorm(filter_channels)
- self.conv_2 = nn.Conv1d(filter_channels, filter_channels, kernel_size, padding=kernel_size // 2)
- self.norm_2 = modules.LayerNorm(filter_channels)
- self.proj = nn.Conv1d(filter_channels, 1, 1)
-
- if gin_channels != 0:
- self.cond = nn.Conv1d(gin_channels, in_channels, 1)
-
- def forward(self, x, x_mask, g=None):
- x = torch.detach(x)
- if g is not None:
- g = torch.detach(g)
- x = x + self.cond(g)
- x = self.conv_1(x * x_mask)
- x = torch.relu(x)
- x = self.norm_1(x)
- x = self.drop(x)
- x = self.conv_2(x * x_mask)
- x = torch.relu(x)
- x = self.norm_2(x)
- x = self.drop(x)
- x = self.proj(x * x_mask)
- return x * x_mask
-
-
-class TextEncoder(nn.Module):
- def __init__(self,
- n_vocab,
- out_channels,
- hidden_channels,
- filter_channels,
- n_heads,
- n_layers,
- kernel_size,
- p_dropout,
- emotion_embedding,
- bert_embedding):
- super().__init__()
- self.n_vocab = n_vocab
- self.out_channels = out_channels
- self.hidden_channels = hidden_channels
- self.filter_channels = filter_channels
- self.n_heads = n_heads
- self.n_layers = n_layers
- self.kernel_size = kernel_size
- self.p_dropout = p_dropout
- self.emotion_embedding = emotion_embedding
-
- if self.n_vocab != 0:
- self.emb = nn.Embedding(n_vocab, hidden_channels)
- if emotion_embedding:
- self.emo_proj = nn.Linear(1024, hidden_channels)
- if bert_embedding:
- self.emb_bert = nn.Linear(256, hidden_channels)
- nn.init.normal_(self.emb.weight, 0.0, hidden_channels ** -0.5)
-
- self.encoder = attentions.Encoder(
- hidden_channels,
- filter_channels,
- n_heads,
- n_layers,
- kernel_size,
- p_dropout)
- self.proj = nn.Conv1d(hidden_channels, out_channels * 2, 1)
-
- def forward(self, x, x_lengths, emotion_embedding=None, bert=None):
- if self.n_vocab != 0:
- x = self.emb(x) * math.sqrt(self.hidden_channels) # [b, t, h]
- if emotion_embedding is not None:
- x = x + self.emo_proj(emotion_embedding.unsqueeze(1))
-
- if bert is not None:
- x = x + self.emb_bert(bert)
- x = torch.transpose(x, 1, -1) # [b, h, t]
- x_mask = torch.unsqueeze(commons.sequence_mask(x_lengths, x.size(2)), 1).to(x.dtype)
-
- x = self.encoder(x * x_mask, x_mask)
- stats = self.proj(x) * x_mask
-
- m, logs = torch.split(stats, self.out_channels, dim=1)
- return x, m, logs, x_mask
-
-
-class ResidualCouplingBlock(nn.Module):
- def __init__(self,
- channels,
- hidden_channels,
- kernel_size,
- dilation_rate,
- n_layers,
- n_flows=4,
- gin_channels=0):
- super().__init__()
- self.channels = channels
- self.hidden_channels = hidden_channels
- self.kernel_size = kernel_size
- self.dilation_rate = dilation_rate
- self.n_layers = n_layers
- self.n_flows = n_flows
- self.gin_channels = gin_channels
-
- self.flows = nn.ModuleList()
- for i in range(n_flows):
- self.flows.append(
- modules.ResidualCouplingLayer(channels, hidden_channels, kernel_size, dilation_rate, n_layers,
- gin_channels=gin_channels, mean_only=True))
- self.flows.append(modules.Flip())
-
- def forward(self, x, x_mask, g=None, reverse=False):
- if not reverse:
- for flow in self.flows:
- x, _ = flow(x, x_mask, g=g, reverse=reverse)
- else:
- for flow in reversed(self.flows):
- x = flow(x, x_mask, g=g, reverse=reverse)
- return x
-
-
-class PosteriorEncoder(nn.Module):
- def __init__(self,
- in_channels,
- out_channels,
- hidden_channels,
- kernel_size,
- dilation_rate,
- n_layers,
- gin_channels=0):
- super().__init__()
- self.in_channels = in_channels
- self.out_channels = out_channels
- self.hidden_channels = hidden_channels
- self.kernel_size = kernel_size
- self.dilation_rate = dilation_rate
- self.n_layers = n_layers
- self.gin_channels = gin_channels
-
- self.pre = nn.Conv1d(in_channels, hidden_channels, 1)
- self.enc = modules.WN(hidden_channels, kernel_size, dilation_rate, n_layers, gin_channels=gin_channels)
- self.proj = nn.Conv1d(hidden_channels, out_channels * 2, 1)
-
- def forward(self, x, x_lengths, g=None):
- x_mask = torch.unsqueeze(commons.sequence_mask(x_lengths, x.size(2)), 1).to(x.dtype)
- x = self.pre(x) * x_mask
- x = self.enc(x, x_mask, g=g)
- stats = self.proj(x) * x_mask
- m, logs = torch.split(stats, self.out_channels, dim=1)
- z = (m + torch.randn_like(m) * torch.exp(logs)) * x_mask
- return z, m, logs, x_mask
-
-
-class Generator(torch.nn.Module):
- def __init__(self, initial_channel, resblock, resblock_kernel_sizes, resblock_dilation_sizes, upsample_rates,
- upsample_initial_channel, upsample_kernel_sizes, gin_channels=0):
- super(Generator, self).__init__()
- self.num_kernels = len(resblock_kernel_sizes)
- self.num_upsamples = len(upsample_rates)
- self.conv_pre = Conv1d(initial_channel, upsample_initial_channel, 7, 1, padding=3)
- resblock = modules.ResBlock1 if resblock == '1' else modules.ResBlock2
-
- self.ups = nn.ModuleList()
- for i, (u, k) in enumerate(zip(upsample_rates, upsample_kernel_sizes)):
- self.ups.append(weight_norm(
- ConvTranspose1d(upsample_initial_channel // (2 ** i), upsample_initial_channel // (2 ** (i + 1)),
- k, u, padding=(k - u) // 2)))
-
- self.resblocks = nn.ModuleList()
- for i in range(len(self.ups)):
- ch = upsample_initial_channel // (2 ** (i + 1))
- for j, (k, d) in enumerate(zip(resblock_kernel_sizes, resblock_dilation_sizes)):
- self.resblocks.append(resblock(ch, k, d))
-
- self.conv_post = Conv1d(ch, 1, 7, 1, padding=3, bias=False)
- self.ups.apply(init_weights)
-
- if gin_channels != 0:
- self.cond = nn.Conv1d(gin_channels, upsample_initial_channel, 1)
-
- def forward(self, x, g=None):
- x = self.conv_pre(x)
- if g is not None:
- x = x + self.cond(g)
-
- for i in range(self.num_upsamples):
- x = F.leaky_relu(x, modules.LRELU_SLOPE)
- x = self.ups[i](x)
- xs = None
- for j in range(self.num_kernels):
- if xs is None:
- xs = self.resblocks[i * self.num_kernels + j](x)
- else:
- xs += self.resblocks[i * self.num_kernels + j](x)
- x = xs / self.num_kernels
- x = F.leaky_relu(x)
- x = self.conv_post(x)
- x = torch.tanh(x)
-
- return x
-
-
-class SynthesizerTrn(nn.Module):
- """
- Synthesizer for Training
- """
-
- def __init__(self,
- n_vocab,
- spec_channels,
- segment_size,
- inter_channels,
- hidden_channels,
- filter_channels,
- n_heads,
- n_layers,
- kernel_size,
- p_dropout,
- resblock,
- resblock_kernel_sizes,
- resblock_dilation_sizes,
- upsample_rates,
- upsample_initial_channel,
- upsample_kernel_sizes,
- n_speakers=0,
- gin_channels=0,
- use_sdp=True,
- emotion_embedding=False,
- bert_embedding=False,
- **kwargs):
-
- super().__init__()
- self.n_vocab = n_vocab
- self.spec_channels = spec_channels
- self.inter_channels = inter_channels
- self.hidden_channels = hidden_channels
- self.filter_channels = filter_channels
- self.n_heads = n_heads
- self.n_layers = n_layers
- self.kernel_size = kernel_size
- self.p_dropout = p_dropout
- self.resblock = resblock
- self.resblock_kernel_sizes = resblock_kernel_sizes
- self.resblock_dilation_sizes = resblock_dilation_sizes
- self.upsample_rates = upsample_rates
- self.upsample_initial_channel = upsample_initial_channel
- self.upsample_kernel_sizes = upsample_kernel_sizes
- self.segment_size = segment_size
- self.n_speakers = n_speakers
- self.gin_channels = gin_channels
- self.use_sdp = use_sdp
- self.emotion_embedding = emotion_embedding
- self.bert_embedding = bert_embedding
-
- self.enc_p = TextEncoder(n_vocab,
- inter_channels,
- hidden_channels,
- filter_channels,
- n_heads,
- n_layers,
- kernel_size,
- p_dropout,
- emotion_embedding,
- bert_embedding)
- self.dec = Generator(inter_channels, resblock, resblock_kernel_sizes, resblock_dilation_sizes, upsample_rates,
- upsample_initial_channel, upsample_kernel_sizes, gin_channels=gin_channels)
- self.enc_q = PosteriorEncoder(spec_channels, inter_channels, hidden_channels, 5, 1, 16,
- gin_channels=gin_channels)
- self.flow = ResidualCouplingBlock(inter_channels, hidden_channels, 5, 1, 4, gin_channels=gin_channels)
-
- if self.use_sdp:
- self.dp = StochasticDurationPredictor(hidden_channels, 192, 3, 0.5, 4, gin_channels=gin_channels)
- else:
- self.dp = DurationPredictor(hidden_channels, 256, 3, 0.5, gin_channels=gin_channels)
-
- if n_speakers >= 1:
- self.emb_g = nn.Embedding(n_speakers, gin_channels)
-
- def infer(self, x, x_lengths, sid=None, noise_scale=1, length_scale=1, noise_scale_w=1., max_len=None,
- emotion_embedding=None, bert=None):
- x, m_p, logs_p, x_mask = self.enc_p(x, x_lengths, emotion_embedding, bert)
- if self.n_speakers > 0:
- g = self.emb_g(sid).unsqueeze(-1) # [b, h, 1]
- else:
- g = None
-
- if self.use_sdp:
- logw = self.dp(x, x_mask, g=g, reverse=True, noise_scale=noise_scale_w)
- else:
- logw = self.dp(x, x_mask, g=g)
- w = torch.exp(logw) * x_mask * length_scale
- w_ceil = torch.ceil(w)
- y_lengths = torch.clamp_min(torch.sum(w_ceil, [1, 2]), 1).long()
- y_mask = torch.unsqueeze(commons.sequence_mask(y_lengths, None), 1).to(x_mask.dtype)
- attn_mask = torch.unsqueeze(x_mask, 2) * torch.unsqueeze(y_mask, -1)
- attn = commons.generate_path(w_ceil, attn_mask)
-
- m_p = torch.matmul(attn.squeeze(1), m_p.transpose(1, 2)).transpose(1, 2) # [b, t', t], [b, t, d] -> [b, d, t']
- logs_p = torch.matmul(attn.squeeze(1), logs_p.transpose(1, 2)).transpose(1,
- 2) # [b, t', t], [b, t, d] -> [b, d, t']
-
- z_p = m_p + torch.randn_like(m_p) * torch.exp(logs_p) * noise_scale
- z = self.flow(z_p, y_mask, g=g, reverse=True)
- o = self.dec((z * y_mask)[:, :, :max_len], g=g)
- return o, attn, y_mask, (z, z_p, m_p, logs_p)
-
- def voice_conversion(self, y, y_lengths, sid_src, sid_tgt):
- assert self.n_speakers > 0, "n_speakers have to be larger than 0."
- g_src = self.emb_g(sid_src).unsqueeze(-1)
- g_tgt = self.emb_g(sid_tgt).unsqueeze(-1)
- z, m_q, logs_q, y_mask = self.enc_q(y, y_lengths, g=g_src)
- z_p = self.flow(z, y_mask, g=g_src)
- z_hat = self.flow(z_p, y_mask, g=g_tgt, reverse=True)
- o_hat = self.dec(z_hat * y_mask, g=g_tgt)
- return o_hat, y_mask, (z, z_p, z_hat)
diff --git a/spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/tenacity/stop.py b/spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/tenacity/stop.py
deleted file mode 100644
index bb23effdf865b007756451f61fcbd7635f15b5d5..0000000000000000000000000000000000000000
--- a/spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/tenacity/stop.py
+++ /dev/null
@@ -1,103 +0,0 @@
-# Copyright 2016–2021 Julien Danjou
-# Copyright 2016 Joshua Harlow
-# Copyright 2013-2014 Ray Holder
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-import abc
-import typing
-
-from pip._vendor.tenacity import _utils
-
-if typing.TYPE_CHECKING:
- import threading
-
- from pip._vendor.tenacity import RetryCallState
-
-
-class stop_base(abc.ABC):
- """Abstract base class for stop strategies."""
-
- @abc.abstractmethod
- def __call__(self, retry_state: "RetryCallState") -> bool:
- pass
-
- def __and__(self, other: "stop_base") -> "stop_all":
- return stop_all(self, other)
-
- def __or__(self, other: "stop_base") -> "stop_any":
- return stop_any(self, other)
-
-
-StopBaseT = typing.Union[stop_base, typing.Callable[["RetryCallState"], bool]]
-
-
-class stop_any(stop_base):
- """Stop if any of the stop condition is valid."""
-
- def __init__(self, *stops: stop_base) -> None:
- self.stops = stops
-
- def __call__(self, retry_state: "RetryCallState") -> bool:
- return any(x(retry_state) for x in self.stops)
-
-
-class stop_all(stop_base):
- """Stop if all the stop conditions are valid."""
-
- def __init__(self, *stops: stop_base) -> None:
- self.stops = stops
-
- def __call__(self, retry_state: "RetryCallState") -> bool:
- return all(x(retry_state) for x in self.stops)
-
-
-class _stop_never(stop_base):
- """Never stop."""
-
- def __call__(self, retry_state: "RetryCallState") -> bool:
- return False
-
-
-stop_never = _stop_never()
-
-
-class stop_when_event_set(stop_base):
- """Stop when the given event is set."""
-
- def __init__(self, event: "threading.Event") -> None:
- self.event = event
-
- def __call__(self, retry_state: "RetryCallState") -> bool:
- return self.event.is_set()
-
-
-class stop_after_attempt(stop_base):
- """Stop when the previous attempt >= max_attempt."""
-
- def __init__(self, max_attempt_number: int) -> None:
- self.max_attempt_number = max_attempt_number
-
- def __call__(self, retry_state: "RetryCallState") -> bool:
- return retry_state.attempt_number >= self.max_attempt_number
-
-
-class stop_after_delay(stop_base):
- """Stop when the time from the first attempt >= limit."""
-
- def __init__(self, max_delay: _utils.time_unit_type) -> None:
- self.max_delay = _utils.to_seconds(max_delay)
-
- def __call__(self, retry_state: "RetryCallState") -> bool:
- if retry_state.seconds_since_start is None:
- raise RuntimeError("__call__() called but seconds_since_start is not set")
- return retry_state.seconds_since_start >= self.max_delay
diff --git a/spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/setuptools/_vendor/importlib_resources/__init__.py b/spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/setuptools/_vendor/importlib_resources/__init__.py
deleted file mode 100644
index 34e3a9950cc557879af8d797f9382b18a870fb56..0000000000000000000000000000000000000000
--- a/spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/setuptools/_vendor/importlib_resources/__init__.py
+++ /dev/null
@@ -1,36 +0,0 @@
-"""Read resources contained within a package."""
-
-from ._common import (
- as_file,
- files,
- Package,
-)
-
-from ._legacy import (
- contents,
- open_binary,
- read_binary,
- open_text,
- read_text,
- is_resource,
- path,
- Resource,
-)
-
-from .abc import ResourceReader
-
-
-__all__ = [
- 'Package',
- 'Resource',
- 'ResourceReader',
- 'as_file',
- 'contents',
- 'files',
- 'is_resource',
- 'open_binary',
- 'open_text',
- 'path',
- 'read_binary',
- 'read_text',
-]
diff --git a/spaces/Atualli/yoloxTeste/configs/yolox_s.py b/spaces/Atualli/yoloxTeste/configs/yolox_s.py
deleted file mode 100644
index abb6a8bbbe4fd1c6aff71596621aaeec2a6a15d8..0000000000000000000000000000000000000000
--- a/spaces/Atualli/yoloxTeste/configs/yolox_s.py
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding:utf-8 -*-
-# Copyright (c) Megvii, Inc. and its affiliates.
-
-import os
-
-from yolox.exp import Exp as MyExp
-
-
-class Exp(MyExp):
- def __init__(self):
- super(Exp, self).__init__()
- self.depth = 0.33
- self.width = 0.50
- self.exp_name = os.path.split(os.path.realpath(__file__))[1].split(".")[0]
diff --git a/spaces/BaitMan/abroader-otters/README.md b/spaces/BaitMan/abroader-otters/README.md
deleted file mode 100644
index 9bc8d0024e5c65bc4243959bf4d4564f64f5f51e..0000000000000000000000000000000000000000
--- a/spaces/BaitMan/abroader-otters/README.md
+++ /dev/null
@@ -1,10 +0,0 @@
----
-title: Abroader Otters
-emoji: 💻
-colorFrom: blue
-colorTo: indigo
-sdk: docker
-pinned: false
----
-
-Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
diff --git a/spaces/Bart92/RVC_HF/tools/app.py b/spaces/Bart92/RVC_HF/tools/app.py
deleted file mode 100644
index 602fbb71a49f2537295337cdcecf501abdd74153..0000000000000000000000000000000000000000
--- a/spaces/Bart92/RVC_HF/tools/app.py
+++ /dev/null
@@ -1,148 +0,0 @@
-import logging
-import os
-
-# os.system("wget -P cvec/ https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/hubert_base.pt")
-import gradio as gr
-from dotenv import load_dotenv
-
-from configs.config import Config
-from i18n import I18nAuto
-from infer.modules.vc.pipeline import Pipeline
-VC = Pipeline
-
-logging.getLogger("numba").setLevel(logging.WARNING)
-logging.getLogger("markdown_it").setLevel(logging.WARNING)
-logging.getLogger("urllib3").setLevel(logging.WARNING)
-logging.getLogger("matplotlib").setLevel(logging.WARNING)
-logger = logging.getLogger(__name__)
-
-i18n = I18nAuto()
-#(i18n)
-
-load_dotenv()
-config = Config()
-vc = VC(config)
-
-weight_root = os.getenv("weight_root")
-weight_uvr5_root = os.getenv("weight_uvr5_root")
-index_root = os.getenv("index_root")
-names = []
-hubert_model = None
-for name in os.listdir(weight_root):
- if name.endswith(".pth"):
- names.append(name)
-index_paths = []
-for root, dirs, files in os.walk(index_root, topdown=False):
- for name in files:
- if name.endswith(".index") and "trained" not in name:
- index_paths.append("%s/%s" % (root, name))
-
-
-app = gr.Blocks()
-with app:
- with gr.Tabs():
- with gr.TabItem("在线demo"):
- gr.Markdown(
- value="""
- RVC 在线demo
- """
- )
- sid = gr.Dropdown(label=i18n("推理音色"), choices=sorted(names))
- with gr.Column():
- spk_item = gr.Slider(
- minimum=0,
- maximum=2333,
- step=1,
- label=i18n("请选择说话人id"),
- value=0,
- visible=False,
- interactive=True,
- )
- sid.change(fn=vc.get_vc, inputs=[sid], outputs=[spk_item])
- gr.Markdown(
- value=i18n("男转女推荐+12key, 女转男推荐-12key, 如果音域爆炸导致音色失真也可以自己调整到合适音域. ")
- )
- vc_input3 = gr.Audio(label="上传音频(长度小于90秒)")
- vc_transform0 = gr.Number(label=i18n("变调(整数, 半音数量, 升八度12降八度-12)"), value=0)
- f0method0 = gr.Radio(
- label=i18n("选择音高提取算法,输入歌声可用pm提速,harvest低音好但巨慢无比,crepe效果好但吃GPU"),
- choices=["pm", "harvest", "crepe", "rmvpe"],
- value="pm",
- interactive=True,
- )
- filter_radius0 = gr.Slider(
- minimum=0,
- maximum=7,
- label=i18n(">=3则使用对harvest音高识别的结果使用中值滤波,数值为滤波半径,使用可以削弱哑音"),
- value=3,
- step=1,
- interactive=True,
- )
- with gr.Column():
- file_index1 = gr.Textbox(
- label=i18n("特征检索库文件路径,为空则使用下拉的选择结果"),
- value="",
- interactive=False,
- visible=False,
- )
- file_index2 = gr.Dropdown(
- label=i18n("自动检测index路径,下拉式选择(dropdown)"),
- choices=sorted(index_paths),
- interactive=True,
- )
- index_rate1 = gr.Slider(
- minimum=0,
- maximum=1,
- label=i18n("检索特征占比"),
- value=0.88,
- interactive=True,
- )
- resample_sr0 = gr.Slider(
- minimum=0,
- maximum=48000,
- label=i18n("后处理重采样至最终采样率,0为不进行重采样"),
- value=0,
- step=1,
- interactive=True,
- )
- rms_mix_rate0 = gr.Slider(
- minimum=0,
- maximum=1,
- label=i18n("输入源音量包络替换输出音量包络融合比例,越靠近1越使用输出包络"),
- value=1,
- interactive=True,
- )
- protect0 = gr.Slider(
- minimum=0,
- maximum=0.5,
- label=i18n("保护清辅音和呼吸声,防止电音撕裂等artifact,拉满0.5不开启,调低加大保护力度但可能降低索引效果"),
- value=0.33,
- step=0.01,
- interactive=True,
- )
- f0_file = gr.File(label=i18n("F0曲线文件, 可选, 一行一个音高, 代替默认F0及升降调"))
- but0 = gr.Button(i18n("转换"), variant="primary")
- vc_output1 = gr.Textbox(label=i18n("输出信息"))
- vc_output2 = gr.Audio(label=i18n("输出音频(右下角三个点,点了可以下载)"))
- but0.click(
- vc.vc_single,
- [
- spk_item,
- vc_input3,
- vc_transform0,
- f0_file,
- f0method0,
- file_index1,
- file_index2,
- # file_big_npy1,
- index_rate1,
- filter_radius0,
- resample_sr0,
- rms_mix_rate0,
- protect0,
- ],
- [vc_output1, vc_output2],
- )
-
-
-app.launch()
diff --git a/spaces/Benson/text-generation/Examples/Como Bajar La Llamada Del Deber Warzone Mvil En Iphone.md b/spaces/Benson/text-generation/Examples/Como Bajar La Llamada Del Deber Warzone Mvil En Iphone.md
deleted file mode 100644
index 4887ad208addd45138de38ee6b95995d691c2caf..0000000000000000000000000000000000000000
--- a/spaces/Benson/text-generation/Examples/Como Bajar La Llamada Del Deber Warzone Mvil En Iphone.md
+++ /dev/null
@@ -1,44 +0,0 @@
-
-Call of Duty: Warzone Mobile - Todo lo que necesitas saber
-Si eres un fan de los juegos de Call of Duty y Battle Royale, te espera una sorpresa. Call of Duty: Warzone Mobile es la última incorporación a la franquicia Call of Duty, que trae lo mejor de ambos mundos a tu dispositivo móvil. En este artículo, te contaremos todo lo que necesitas saber sobre este emocionante nuevo juego, incluyendo qué es, cómo descargarlo y jugarlo, y cuáles son sus características y beneficios. Vamos a bucear en!
- ¿Qué es Call of Duty: Warzone Mobile?
-Call of Duty: Warzone Mobile es una versión móvil del popular juego Call of Duty: Warzone, que es un juego de battle royale gratuito que forma parte de la serie Call of Duty: Modern Warfare II. Está desarrollado por Activision Publishing, Inc. y se espera que se lance en todo el mundo en 2023. Estos son algunos de los aspectos principales del juego:
-Como bajar la llamada del deber warzone móvil en iphone
DOWNLOAD ····· https://bltlly.com/2v6LH7
- Una nueva era de batalla móvil Royale
-Call of Duty: Warzone Mobile no es solo un puerto del juego existente, sino un nuevo juego construido desde cero para dispositivos móviles. Cuenta con un auténtico modo de juego Call of Duty, armas, movimiento y vehículos, así como modos únicos y divertidos que permiten hasta 120 jugadores en vivo en un partido. Gracias a la tecnología unificada Call of Duty, los jugadores pueden usar funciones sociales como amigos, canales de chat y Battle Pass en todas las plataformas para disfrutar de una experiencia de juego multijugador FPS verdaderamente conectada.
- El regreso de Verdansk
-¡El mapa de battle royale favorito de los fans ha vuelto! Verdansk es un mapa masivo con docenas de puntos de interés para desplegar, saquear y luchar. El mapa también cuenta con eventos dinámicos, como caídas de suministro, ataques aéreos y fugas de la cárcel, que añaden más emoción e imprevisibilidad a los partidos. Y si te eliminan, ¡puedes tener una segunda oportunidad de sobrevivir ganando un duelo en el Gulag!
- Más competencia, más diversión
-
- Cómo descargar y jugar Call of Duty: Warzone Mobile?
-Si estás ansioso por jugar Call of Duty: Warzone Mobile, aquí hay algunos pasos que debes seguir:
- Pre-registro y pre-orden en Google Play y App Store
-Lo primero que tienes que hacer es pre-registrarse en Google Play o pre-ordenar en la App Store. De esta manera, puedes recibir notificaciones cuando el juego esté disponible para su descarga e instalación. También puede escanear el código QR en el sitio web oficial para pre-registrarse o pre-ordenar directamente.
- Gana recompensas alcanzando hitos globales
-Al pre-registrar o pre-ordenar, también puedes ganar recompensas que puedes usar cuando el juego se lanza en todo el mundo. Las recompensas incluyen pieles exclusivas, armas, emblemas, e incluso un nuevo mapa! Las recompensas se basan en hitos globales que se logran por el número de pre-registros o pre-pedidos. Puede consultar el progreso y los detalles en el sitio web oficial .
-
- elegir tu punto de aterrizaje, saquear, luchar o esconderse. Con tantas opciones y posibilidades, nunca te cansarás de jugar a este juego.
- Impresionantes gráficos y controles intuitivos
-
Call of Duty: Warzone Mobile no solo es divertido de jugar, sino también hermoso para mirar. El juego cuenta con impresionantes gráficos que muestran los detalles y el realismo del mapa, las armas y los personajes. El juego también funciona sin problemas en la mayoría de los dispositivos móviles, gracias al rendimiento optimizado y la compatibilidad. Además, el juego tiene controles intuitivos que son fáciles de aprender y usar. También puede personalizar su diseño, sensibilidad y configuración para adaptarse a sus preferencias.
- Conclusión
-
- Preguntas frecuentes
-Aquí hay algunas preguntas frecuentes sobre Call of Duty: Warzone Mobile:
- P: ¿Call of Duty: Warzone Mobile es libre de jugar?
-A: Sí, Call of Duty: Warzone Mobile es gratis para jugar. No necesitas pagar nada para descargar y jugar el juego. Sin embargo, puedes comprar objetos del juego y divisas con dinero real si quieres.
- Q: ¿Cuáles son los requisitos mínimos para jugar Call of Duty: Warzone Mobile?
-A: Los requisitos mínimos para jugar Call of Duty: Warzone Mobile son los siguientes:
-
-OS | Android 5.0 o iOS 10.0 o superior |
-RAM | 2 GB o más |
-Almacenamiento | 4 GB o más |
-Internet | Wi-Fi o datos celulares (4G o superior) |
-
- Q: ¿Puedo jugar Call of Duty: Warzone Mobile sin conexión?
-A: No, no puedes jugar sin conexión a Call of Duty: Warzone Mobile. Necesitas una conexión a Internet para jugar, ya que es un juego multijugador en línea.
- Q: ¿Puedo jugar Call of Duty: Warzone Mobile con un controlador?
-A: Sí, puedes jugar Call of Duty: Warzone Mobile con un controlador. El juego es compatible con la mayoría de los controladores Bluetooth compatibles con tu dispositivo. También puedes ajustar la configuración del mando en el menú del juego.
- Q: ¿Cómo puedo contactar al servicio de atención al cliente para Call of Duty: Warzone Mobile?
-A: Puede ponerse en contacto con el servicio de atención al cliente para Call of Duty: Warzone Mobile visitando el sitio web oficial y haciendo clic en el botón "Support". También puedes acceder a la página de soporte desde dentro del juego pulsando en el icono "Configuración" y luego en el botón "Ayuda".
64aa2da5cf
-
-
\ No newline at end of file
diff --git a/spaces/Benson/text-generation/Examples/Descarga Gratuita Multijugador En Lnea De Picas.md b/spaces/Benson/text-generation/Examples/Descarga Gratuita Multijugador En Lnea De Picas.md
deleted file mode 100644
index 1afec18fa809d98ccb563b9b05539f64c630e7a4..0000000000000000000000000000000000000000
--- a/spaces/Benson/text-generation/Examples/Descarga Gratuita Multijugador En Lnea De Picas.md
+++ /dev/null
@@ -1,62 +0,0 @@
-
-Picas en línea multijugador descarga gratuita: Cómo jugar el juego de cartas clásico con amigos
- Spades es un popular juego de cartas que se puede jugar en línea o fuera de línea con amigos o extraños. Es un juego de estrategia, habilidad y suerte que requiere trabajo en equipo y comunicación. Si usted está buscando una manera divertida y desafiante de pasar su tiempo, picas en línea de descarga gratuita multijugador es una gran opción. En este artículo, explicaremos qué es una pala y cómo jugarla, dónde descargar picas en línea gratis, y algunos consejos y trucos para mejorar tus habilidades de picas.
- ¿Qué es espadas y cómo jugarlo
- Spades es un juego de cartas que se originó en los Estados Unidos en la década de 1930. Se juega con una baraja estándar de 52 cartas, dividida en cuatro palos: picas, corazones, diamantes y tréboles. Las picas son siempre el traje de triunfo, lo que significa que pueden vencer a cualquier otro traje en un truco. El juego puede ser jugado por dos o cuatro jugadores, ya sea individualmente o en parejas.
-descarga gratuita multijugador en línea de picas
DOWNLOAD ↔ https://bltlly.com/2v6Mme
- Los fundamentos de las picas
- El juego consta de varias rondas, llamadas manos, cada una con 13 trucos. Un truco es una ronda de juego donde cada jugador juega una carta de su mano, siguiendo el palo de la primera carta jugada si es posible. El jugador que juega la carta más alta del palo principal o la pala más alta gana el truco y lidera el siguiente.
- El juego comienza con cada jugador recibiendo 13 cartas. Luego, cada jugador hace una puja, que es una estimación de cuántos trucos puede ganar en esa mano. Las ofertas se suman para formar el contrato del equipo, que es el número mínimo de trucos que deben ganar para evitar una penalización. El equipo que puje más alto tiene el privilegio de nombrar la primera carta a jugar.
- El sistema de puja y puntuación
-
- Si haces tu contrato, obtienes 10 puntos por cada truco en tu oferta. Por ejemplo, si haces 5 y ganas 5 trucos, obtienes 50 puntos. Si tomas más trucos que tu oferta, obtienes un punto por cada truco extra, llamado bolsa. Por ejemplo, si haces 5 y ganas 7 trucos, obtienes 52 puntos (50 por tu oferta y 2 por tus maletas). Sin embargo, si acumulas 10 bolsas en el transcurso del juego, pierdes 100 puntos como penalización.
- Si no cumples con tu contrato, pierdes 10 puntos por cada truco en tu oferta. Por ejemplo, si haces 5 y ganas solo 4 trucos, pierdes 50 puntos. El número de trucos adicionales o menos que tomes no importa en este caso.
- También hay algunas ofertas especiales que pueden aumentar o disminuir su puntuación significativamente. Una oferta nula es cuando haces cero trucos, lo que significa que intentarás no ganar ningún truco en esa mano. Si tienes éxito, obtienes 100 puntos. Si fallas, pierdes 100 puntos. Una apuesta ciega a cero es cuando haces una oferta a cero antes de mirar tus cartas. Si tienes éxito, obtienes 200 puntos. Si fallas, pierdes 200 puntos.
- Los diferentes modos de juego y variaciones
-
- Si quieres jugar picas en línea con tus amigos u otros jugadores de todo el mundo, tienes muchas opciones para elegir. Aquí están algunas de las mejores picas en línea aplicaciones de descarga gratuita multijugador y sitios web que se pueden probar:
Picas: Juegos de cartas clásicas por MobilityWare
- Esta es una de las aplicaciones de picas más populares y altamente calificadas en la App Store y Google Play. Ofrece una interfaz suave y fácil de usar, con ajustes y temas personalizables. Puedes jugar online con jugadores reales o offline con bots, en diferentes modos de juego y niveles de dificultad. También puedes chatear con tus oponentes, rastrear tus estadísticas y ganar logros y recompensas.
- Puedes descargar Spades: Classic Card Games by MobilityWare gratis desde [aquí] para dispositivos iOS y [aquí] para dispositivos Android.
-
- Espadas en línea gratis por VIPSpades.com
- Este es uno de los mejores sitios web de picas que se puede acceder desde cualquier navegador. Ofrece un diseño elegante y moderno, con gráficos y sonidos de alta calidad. Puedes jugar online con miles de jugadores de diferentes países, en diferentes modos de juego y variaciones. También puedes chatear con tus amigos, unirte a clubes, participar en torneos y ganar monedas y gemas.
- Puedes jugar Spades Online gratis por VIPSpades.com gratis desde [aquí].
- Espadas por Karmangames
- Esta es otra gran aplicación de picas que puede descargar en su dispositivo móvil o tableta. Ofrece una interfaz sencilla e intuitiva, con animaciones y efectos realistas. Puedes jugar online con otros jugadores o offline con inteligencia artificial, en diferentes modos de juego y niveles de dificultad. También puedes chatear con tu pareja, ver tu historial y ajustar tu configuración.
- Puedes descargar Spades by Karmangames gratis desde [aquí] para dispositivos iOS y [aquí] para dispositivos Android.
- Consejos y trucos para mejorar tus habilidades de picas
-
- Una de las habilidades más importantes en picas es estimar su oferta con precisión. Esto significa que tienes que considerar la fuerza de tu mano, el número de picas que tienes, la probabilidad de ganar trucos y las ofertas de tus oponentes. Estas son algunas pautas que pueden ayudarte: - Si tienes muchas cartas altas (Ases, Reyes, Reinas), especialmente en picas, puedes pujar más alto de lo habitual. - Si tienes muchas cartas bajas (2s, 3s, 4s), especialmente en trajes que no sean de pádel, puedes pujar más bajo de lo habitual. - Si tienes una mano equilibrada (una mezcla de cartas altas y bajas en diferentes palos), puedes pujar alrededor de 4 o 5 trucos. - Si tienes un palo largo (cuatro o más cartas en un palo), especialmente en picas, puedes contar con ganar al menos un truco por carta en ese palo. - Si usted tiene un traje corto (una o dos cartas en un palo), especialmente en trajes de no-pade, puede tratar de deshacerse de ellos temprano y esperar ganar algunos trucos con picas más tarde. - Si tienes comodines (si juegas con ellos), puedes contarlos como picas y pujar en consecuencia. - Si tienes una oferta de cero o cero ciega, puedes tratar de evitar jugar cartas altas o picas, y esperar que tu pareja o oponentes tomen los trucos por ti. - Si usted tiene un socio, usted puede intentar coordinar sus ofertas con ellos, basados en las señales que le dan o las cartas que juegan.
Cómo comunicarse con su pareja efectivamente
-
- Un desafío común es evitar tener demasiadas o muy pocas bolsas. Las bolsas son trucos adicionales que se hacen cargo de su oferta, que puede sumar una pena de 100 puntos si se obtiene 10 de ellos. Por otro lado, si tomas muy pocos trucos, corres el riesgo de fallar tu contrato y perder puntos. Aquí hay algunas estrategias que pueden ayudarle a evitar conseguir demasiadas o muy pocas bolsas: - Si está cerca de conseguir 10 bolsas, puede intentar pujar más alto de lo habitual o jugar más agresivamente para evitar tomar trucos adicionales. - Si estás lejos de conseguir 10 bolsas, puedes intentar pujar más bajo de lo habitual o jugar de forma más conservadora para evitar perder trucos. - Si no está seguro de cuántas bolsas tiene, puede consultar el tablero de puntuación o preguntar a su pareja antes de hacer su oferta o jugar su carta. - Si tienes muchas cartas altas o picas, puedes intentar jugarlas temprano o empezar con ellas para evitar quedarte atascado con ellas al final y hacer trucos no deseados. - Si tienes muchas cartas bajas o trajes que no sean de pádel, puedes intentar guardarlos para más tarde o seguirlos para evitar perder trucos que podrías haber ganado con picas.
Conclusión
- Spades es un juego de cartas divertido y emocionante que se puede jugar en línea con amigos o extraños. Es un juego de estrategia, habilidad y suerte que requiere trabajo en equipo y comunicación. Para jugar a las picas en línea de descarga gratuita multijugador, es necesario saber qué es picas y cómo jugarlo, dónde descargar picas en línea de forma gratuita, y algunos consejos y trucos para mejorar sus habilidades de picas. Esperamos que este artículo te haya ayudado a aprender más sobre picas y cómo disfrutarlo en línea.
- Preguntas frecuentes
- Aquí hay algunas preguntas frecuentes sobre picas en línea multijugador gratis descargar:
-
-
-Pregunta |
-Respuesta |
-
-
-¿Cuántos jugadores pueden jugar picas online? |
-Puedes jugar picas online con dos o cuatro jugadores, ya sea individualmente o en parejas. |
-
-
-¿Cómo puedo encontrar otros jugadores online? |
-
-
-
-¿Puedo chatear con otros jugadores en línea? |
-Sí, la mayoría de las aplicaciones y sitios web en línea te permiten chatear con otros jugadores en línea. Puedes usar la función de chat para comunicarte con tu pareja, burlarte de tus oponentes o hacer nuevos amigos. |
-
-
-¿Puedo jugar espadas en línea gratis? |
-Sí, la mayoría de las aplicaciones en línea y sitios web son gratis para descargar y jugar. Sin embargo, algunos de ellos pueden ofrecer compras en la aplicación o anuncios para apoyar su desarrollo y mantenimiento. |
-
-
-¿Puedo jugar espadas en línea sin conexión? |
-Sí, algunas aplicaciones en línea de picas y sitios web le permiten jugar picas sin conexión con bots o jugadores locales. Puedes usar esta función para practicar tus habilidades, jugar sin conexión a Internet o divertirte con tu familia y amigos. |
-
- 64aa2da5cf
-
-
\ No newline at end of file
diff --git a/spaces/Big-Web/MMSD/env/Lib/site-packages/boto3/utils.py b/spaces/Big-Web/MMSD/env/Lib/site-packages/boto3/utils.py
deleted file mode 100644
index 27561adc90367e225eafb5a27ce9d090513f8a81..0000000000000000000000000000000000000000
--- a/spaces/Big-Web/MMSD/env/Lib/site-packages/boto3/utils.py
+++ /dev/null
@@ -1,100 +0,0 @@
-# Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"). You
-# may not use this file except in compliance with the License. A copy of
-# the License is located at
-#
-# https://aws.amazon.com/apache2.0/
-#
-# or in the "license" file accompanying this file. This file is
-# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
-# ANY KIND, either express or implied. See the License for the specific
-# language governing permissions and limitations under the License.
-import sys
-from collections import namedtuple
-
-_ServiceContext = namedtuple(
- 'ServiceContext',
- [
- 'service_name',
- 'service_model',
- 'service_waiter_model',
- 'resource_json_definitions',
- ],
-)
-
-
-class ServiceContext(_ServiceContext):
- """Provides important service-wide, read-only information about a service
-
- :type service_name: str
- :param service_name: The name of the service
-
- :type service_model: :py:class:`botocore.model.ServiceModel`
- :param service_model: The model of the service.
-
- :type service_waiter_model: :py:class:`botocore.waiter.WaiterModel` or
- a waiter model-like object such as
- :py:class:`boto3.utils.LazyLoadedWaiterModel`
- :param service_waiter_model: The waiter model of the service.
-
- :type resource_json_definitions: dict
- :param resource_json_definitions: The loaded json models of all resource
- shapes for a service. It is equivalient of loading a
- ``resource-1.json`` and retrieving the value at the key "resources".
- """
-
- pass
-
-
-def import_module(name):
- """Import module given a name.
-
- Does not support relative imports.
-
- """
- __import__(name)
- return sys.modules[name]
-
-
-def lazy_call(full_name, **kwargs):
- parent_kwargs = kwargs
-
- def _handler(**kwargs):
- module, function_name = full_name.rsplit('.', 1)
- module = import_module(module)
- kwargs.update(parent_kwargs)
- return getattr(module, function_name)(**kwargs)
-
- return _handler
-
-
-def inject_attribute(class_attributes, name, value):
- if name in class_attributes:
- raise RuntimeError(
- f'Cannot inject class attribute "{name}", attribute '
- f'already exists in class dict.'
- )
- else:
- class_attributes[name] = value
-
-
-class LazyLoadedWaiterModel:
- """A lazily loaded waiter model
-
- This does not load the service waiter model until an attempt is made
- to retrieve the waiter model for a specific waiter. This is helpful
- in docstring generation where we do not need to actually need to grab
- the waiter-2.json until it is accessed through a ``get_waiter`` call
- when the docstring is generated/accessed.
- """
-
- def __init__(self, bc_session, service_name, api_version):
- self._session = bc_session
- self._service_name = service_name
- self._api_version = api_version
-
- def get_waiter(self, waiter_name):
- return self._session.get_waiter_model(
- self._service_name, self._api_version
- ).get_waiter(waiter_name)
diff --git a/spaces/Big-Web/MMSD/env/Lib/site-packages/setuptools/_distutils/cmd.py b/spaces/Big-Web/MMSD/env/Lib/site-packages/setuptools/_distutils/cmd.py
deleted file mode 100644
index 68a9267c65babd799cec04213c20ad4f3289e109..0000000000000000000000000000000000000000
--- a/spaces/Big-Web/MMSD/env/Lib/site-packages/setuptools/_distutils/cmd.py
+++ /dev/null
@@ -1,436 +0,0 @@
-"""distutils.cmd
-
-Provides the Command class, the base class for the command classes
-in the distutils.command package.
-"""
-
-import sys
-import os
-import re
-from distutils.errors import DistutilsOptionError
-from distutils import util, dir_util, file_util, archive_util, dep_util
-from distutils import log
-
-
-class Command:
- """Abstract base class for defining command classes, the "worker bees"
- of the Distutils. A useful analogy for command classes is to think of
- them as subroutines with local variables called "options". The options
- are "declared" in 'initialize_options()' and "defined" (given their
- final values, aka "finalized") in 'finalize_options()', both of which
- must be defined by every command class. The distinction between the
- two is necessary because option values might come from the outside
- world (command line, config file, ...), and any options dependent on
- other options must be computed *after* these outside influences have
- been processed -- hence 'finalize_options()'. The "body" of the
- subroutine, where it does all its work based on the values of its
- options, is the 'run()' method, which must also be implemented by every
- command class.
- """
-
- # 'sub_commands' formalizes the notion of a "family" of commands,
- # eg. "install" as the parent with sub-commands "install_lib",
- # "install_headers", etc. The parent of a family of commands
- # defines 'sub_commands' as a class attribute; it's a list of
- # (command_name : string, predicate : unbound_method | string | None)
- # tuples, where 'predicate' is a method of the parent command that
- # determines whether the corresponding command is applicable in the
- # current situation. (Eg. we "install_headers" is only applicable if
- # we have any C header files to install.) If 'predicate' is None,
- # that command is always applicable.
- #
- # 'sub_commands' is usually defined at the *end* of a class, because
- # predicates can be unbound methods, so they must already have been
- # defined. The canonical example is the "install" command.
- sub_commands = []
-
- # -- Creation/initialization methods -------------------------------
-
- def __init__(self, dist):
- """Create and initialize a new Command object. Most importantly,
- invokes the 'initialize_options()' method, which is the real
- initializer and depends on the actual command being
- instantiated.
- """
- # late import because of mutual dependence between these classes
- from distutils.dist import Distribution
-
- if not isinstance(dist, Distribution):
- raise TypeError("dist must be a Distribution instance")
- if self.__class__ is Command:
- raise RuntimeError("Command is an abstract class")
-
- self.distribution = dist
- self.initialize_options()
-
- # Per-command versions of the global flags, so that the user can
- # customize Distutils' behaviour command-by-command and let some
- # commands fall back on the Distribution's behaviour. None means
- # "not defined, check self.distribution's copy", while 0 or 1 mean
- # false and true (duh). Note that this means figuring out the real
- # value of each flag is a touch complicated -- hence "self._dry_run"
- # will be handled by __getattr__, below.
- # XXX This needs to be fixed.
- self._dry_run = None
-
- # verbose is largely ignored, but needs to be set for
- # backwards compatibility (I think)?
- self.verbose = dist.verbose
-
- # Some commands define a 'self.force' option to ignore file
- # timestamps, but methods defined *here* assume that
- # 'self.force' exists for all commands. So define it here
- # just to be safe.
- self.force = None
-
- # The 'help' flag is just used for command-line parsing, so
- # none of that complicated bureaucracy is needed.
- self.help = 0
-
- # 'finalized' records whether or not 'finalize_options()' has been
- # called. 'finalize_options()' itself should not pay attention to
- # this flag: it is the business of 'ensure_finalized()', which
- # always calls 'finalize_options()', to respect/update it.
- self.finalized = 0
-
- # XXX A more explicit way to customize dry_run would be better.
- def __getattr__(self, attr):
- if attr == 'dry_run':
- myval = getattr(self, "_" + attr)
- if myval is None:
- return getattr(self.distribution, attr)
- else:
- return myval
- else:
- raise AttributeError(attr)
-
- def ensure_finalized(self):
- if not self.finalized:
- self.finalize_options()
- self.finalized = 1
-
- # Subclasses must define:
- # initialize_options()
- # provide default values for all options; may be customized by
- # setup script, by options from config file(s), or by command-line
- # options
- # finalize_options()
- # decide on the final values for all options; this is called
- # after all possible intervention from the outside world
- # (command-line, option file, etc.) has been processed
- # run()
- # run the command: do whatever it is we're here to do,
- # controlled by the command's various option values
-
- def initialize_options(self):
- """Set default values for all the options that this command
- supports. Note that these defaults may be overridden by other
- commands, by the setup script, by config files, or by the
- command-line. Thus, this is not the place to code dependencies
- between options; generally, 'initialize_options()' implementations
- are just a bunch of "self.foo = None" assignments.
-
- This method must be implemented by all command classes.
- """
- raise RuntimeError(
- "abstract method -- subclass %s must override" % self.__class__
- )
-
- def finalize_options(self):
- """Set final values for all the options that this command supports.
- This is always called as late as possible, ie. after any option
- assignments from the command-line or from other commands have been
- done. Thus, this is the place to code option dependencies: if
- 'foo' depends on 'bar', then it is safe to set 'foo' from 'bar' as
- long as 'foo' still has the same value it was assigned in
- 'initialize_options()'.
-
- This method must be implemented by all command classes.
- """
- raise RuntimeError(
- "abstract method -- subclass %s must override" % self.__class__
- )
-
- def dump_options(self, header=None, indent=""):
- from distutils.fancy_getopt import longopt_xlate
-
- if header is None:
- header = "command options for '%s':" % self.get_command_name()
- self.announce(indent + header, level=log.INFO)
- indent = indent + " "
- for (option, _, _) in self.user_options:
- option = option.translate(longopt_xlate)
- if option[-1] == "=":
- option = option[:-1]
- value = getattr(self, option)
- self.announce(indent + "{} = {}".format(option, value), level=log.INFO)
-
- def run(self):
- """A command's raison d'etre: carry out the action it exists to
- perform, controlled by the options initialized in
- 'initialize_options()', customized by other commands, the setup
- script, the command-line, and config files, and finalized in
- 'finalize_options()'. All terminal output and filesystem
- interaction should be done by 'run()'.
-
- This method must be implemented by all command classes.
- """
- raise RuntimeError(
- "abstract method -- subclass %s must override" % self.__class__
- )
-
- def announce(self, msg, level=1):
- """If the current verbosity level is of greater than or equal to
- 'level' print 'msg' to stdout.
- """
- log.log(level, msg)
-
- def debug_print(self, msg):
- """Print 'msg' to stdout if the global DEBUG (taken from the
- DISTUTILS_DEBUG environment variable) flag is true.
- """
- from distutils.debug import DEBUG
-
- if DEBUG:
- print(msg)
- sys.stdout.flush()
-
- # -- Option validation methods -------------------------------------
- # (these are very handy in writing the 'finalize_options()' method)
- #
- # NB. the general philosophy here is to ensure that a particular option
- # value meets certain type and value constraints. If not, we try to
- # force it into conformance (eg. if we expect a list but have a string,
- # split the string on comma and/or whitespace). If we can't force the
- # option into conformance, raise DistutilsOptionError. Thus, command
- # classes need do nothing more than (eg.)
- # self.ensure_string_list('foo')
- # and they can be guaranteed that thereafter, self.foo will be
- # a list of strings.
-
- def _ensure_stringlike(self, option, what, default=None):
- val = getattr(self, option)
- if val is None:
- setattr(self, option, default)
- return default
- elif not isinstance(val, str):
- raise DistutilsOptionError(
- "'{}' must be a {} (got `{}`)".format(option, what, val)
- )
- return val
-
- def ensure_string(self, option, default=None):
- """Ensure that 'option' is a string; if not defined, set it to
- 'default'.
- """
- self._ensure_stringlike(option, "string", default)
-
- def ensure_string_list(self, option):
- r"""Ensure that 'option' is a list of strings. If 'option' is
- currently a string, we split it either on /,\s*/ or /\s+/, so
- "foo bar baz", "foo,bar,baz", and "foo, bar baz" all become
- ["foo", "bar", "baz"].
- """
- val = getattr(self, option)
- if val is None:
- return
- elif isinstance(val, str):
- setattr(self, option, re.split(r',\s*|\s+', val))
- else:
- if isinstance(val, list):
- ok = all(isinstance(v, str) for v in val)
- else:
- ok = False
- if not ok:
- raise DistutilsOptionError(
- "'{}' must be a list of strings (got {!r})".format(option, val)
- )
-
- def _ensure_tested_string(self, option, tester, what, error_fmt, default=None):
- val = self._ensure_stringlike(option, what, default)
- if val is not None and not tester(val):
- raise DistutilsOptionError(
- ("error in '%s' option: " + error_fmt) % (option, val)
- )
-
- def ensure_filename(self, option):
- """Ensure that 'option' is the name of an existing file."""
- self._ensure_tested_string(
- option, os.path.isfile, "filename", "'%s' does not exist or is not a file"
- )
-
- def ensure_dirname(self, option):
- self._ensure_tested_string(
- option,
- os.path.isdir,
- "directory name",
- "'%s' does not exist or is not a directory",
- )
-
- # -- Convenience methods for commands ------------------------------
-
- def get_command_name(self):
- if hasattr(self, 'command_name'):
- return self.command_name
- else:
- return self.__class__.__name__
-
- def set_undefined_options(self, src_cmd, *option_pairs):
- """Set the values of any "undefined" options from corresponding
- option values in some other command object. "Undefined" here means
- "is None", which is the convention used to indicate that an option
- has not been changed between 'initialize_options()' and
- 'finalize_options()'. Usually called from 'finalize_options()' for
- options that depend on some other command rather than another
- option of the same command. 'src_cmd' is the other command from
- which option values will be taken (a command object will be created
- for it if necessary); the remaining arguments are
- '(src_option,dst_option)' tuples which mean "take the value of
- 'src_option' in the 'src_cmd' command object, and copy it to
- 'dst_option' in the current command object".
- """
- # Option_pairs: list of (src_option, dst_option) tuples
- src_cmd_obj = self.distribution.get_command_obj(src_cmd)
- src_cmd_obj.ensure_finalized()
- for (src_option, dst_option) in option_pairs:
- if getattr(self, dst_option) is None:
- setattr(self, dst_option, getattr(src_cmd_obj, src_option))
-
- def get_finalized_command(self, command, create=1):
- """Wrapper around Distribution's 'get_command_obj()' method: find
- (create if necessary and 'create' is true) the command object for
- 'command', call its 'ensure_finalized()' method, and return the
- finalized command object.
- """
- cmd_obj = self.distribution.get_command_obj(command, create)
- cmd_obj.ensure_finalized()
- return cmd_obj
-
- # XXX rename to 'get_reinitialized_command()'? (should do the
- # same in dist.py, if so)
- def reinitialize_command(self, command, reinit_subcommands=0):
- return self.distribution.reinitialize_command(command, reinit_subcommands)
-
- def run_command(self, command):
- """Run some other command: uses the 'run_command()' method of
- Distribution, which creates and finalizes the command object if
- necessary and then invokes its 'run()' method.
- """
- self.distribution.run_command(command)
-
- def get_sub_commands(self):
- """Determine the sub-commands that are relevant in the current
- distribution (ie., that need to be run). This is based on the
- 'sub_commands' class attribute: each tuple in that list may include
- a method that we call to determine if the subcommand needs to be
- run for the current distribution. Return a list of command names.
- """
- commands = []
- for (cmd_name, method) in self.sub_commands:
- if method is None or method(self):
- commands.append(cmd_name)
- return commands
-
- # -- External world manipulation -----------------------------------
-
- def warn(self, msg):
- log.warn("warning: %s: %s\n", self.get_command_name(), msg)
-
- def execute(self, func, args, msg=None, level=1):
- util.execute(func, args, msg, dry_run=self.dry_run)
-
- def mkpath(self, name, mode=0o777):
- dir_util.mkpath(name, mode, dry_run=self.dry_run)
-
- def copy_file(
- self, infile, outfile, preserve_mode=1, preserve_times=1, link=None, level=1
- ):
- """Copy a file respecting verbose, dry-run and force flags. (The
- former two default to whatever is in the Distribution object, and
- the latter defaults to false for commands that don't define it.)"""
- return file_util.copy_file(
- infile,
- outfile,
- preserve_mode,
- preserve_times,
- not self.force,
- link,
- dry_run=self.dry_run,
- )
-
- def copy_tree(
- self,
- infile,
- outfile,
- preserve_mode=1,
- preserve_times=1,
- preserve_symlinks=0,
- level=1,
- ):
- """Copy an entire directory tree respecting verbose, dry-run,
- and force flags.
- """
- return dir_util.copy_tree(
- infile,
- outfile,
- preserve_mode,
- preserve_times,
- preserve_symlinks,
- not self.force,
- dry_run=self.dry_run,
- )
-
- def move_file(self, src, dst, level=1):
- """Move a file respecting dry-run flag."""
- return file_util.move_file(src, dst, dry_run=self.dry_run)
-
- def spawn(self, cmd, search_path=1, level=1):
- """Spawn an external command respecting dry-run flag."""
- from distutils.spawn import spawn
-
- spawn(cmd, search_path, dry_run=self.dry_run)
-
- def make_archive(
- self, base_name, format, root_dir=None, base_dir=None, owner=None, group=None
- ):
- return archive_util.make_archive(
- base_name,
- format,
- root_dir,
- base_dir,
- dry_run=self.dry_run,
- owner=owner,
- group=group,
- )
-
- def make_file(
- self, infiles, outfile, func, args, exec_msg=None, skip_msg=None, level=1
- ):
- """Special case of 'execute()' for operations that process one or
- more input files and generate one output file. Works just like
- 'execute()', except the operation is skipped and a different
- message printed if 'outfile' already exists and is newer than all
- files listed in 'infiles'. If the command defined 'self.force',
- and it is true, then the command is unconditionally run -- does no
- timestamp checks.
- """
- if skip_msg is None:
- skip_msg = "skipping %s (inputs unchanged)" % outfile
-
- # Allow 'infiles' to be a single string
- if isinstance(infiles, str):
- infiles = (infiles,)
- elif not isinstance(infiles, (list, tuple)):
- raise TypeError("'infiles' must be a string, or a list or tuple of strings")
-
- if exec_msg is None:
- exec_msg = "generating {} from {}".format(outfile, ', '.join(infiles))
-
- # If 'outfile' must be regenerated (either because it doesn't
- # exist, is out-of-date, or the 'force' flag is true) then
- # perform the action that presumably regenerates it
- if self.force or dep_util.newer_group(infiles, outfile):
- self.execute(func, args, exec_msg, level)
- # Otherwise, print the "skip" message
- else:
- log.debug(skip_msg)
diff --git a/spaces/CVPR/Dual-Key_Backdoor_Attacks/datagen/detectron2/projects/DensePose/dev/README.md b/spaces/CVPR/Dual-Key_Backdoor_Attacks/datagen/detectron2/projects/DensePose/dev/README.md
deleted file mode 100644
index e3a94b67ed4b4d0c2934f074802cd00f3660f9a9..0000000000000000000000000000000000000000
--- a/spaces/CVPR/Dual-Key_Backdoor_Attacks/datagen/detectron2/projects/DensePose/dev/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-
-## Some scripts for developers to use, include:
-
-- `run_instant_tests.sh`: run training for a few iterations.
-- `run_inference_tests.sh`: run inference on a small dataset.
-- `../../dev/linter.sh`: lint the codebase before commit
-- `../../dev/parse_results.sh`: parse results from log file.
diff --git a/spaces/CVPR/LIVE/thrust/dependencies/cub/cub/cmake/cub-config-version.cmake b/spaces/CVPR/LIVE/thrust/dependencies/cub/cub/cmake/cub-config-version.cmake
deleted file mode 100644
index 4260ba66f57769d96f8cb8dbe9ab3ac543a35075..0000000000000000000000000000000000000000
--- a/spaces/CVPR/LIVE/thrust/dependencies/cub/cub/cmake/cub-config-version.cmake
+++ /dev/null
@@ -1,33 +0,0 @@
-# Parse version information from version.cuh:
-file(READ "${CMAKE_CURRENT_LIST_DIR}/../version.cuh" CUB_VERSION_HEADER)
-string(REGEX MATCH "#define[ \t]+CUB_VERSION[ \t]+([0-9]+)" DUMMY "${CUB_VERSION_HEADER}")
-set(CUB_VERSION_FLAT ${CMAKE_MATCH_1})
-# Note that CUB calls this the PATCH number, CMake calls it the TWEAK number:
-string(REGEX MATCH "#define[ \t]+CUB_PATCH_NUMBER[ \t]+([0-9]+)" DUMMY "${CUB_VERSION_HEADER}")
-set(CUB_VERSION_TWEAK ${CMAKE_MATCH_1})
-
-math(EXPR CUB_VERSION_MAJOR "${CUB_VERSION_FLAT} / 100000")
-math(EXPR CUB_VERSION_MINOR "(${CUB_VERSION_FLAT} / 100) % 1000")
-math(EXPR CUB_VERSION_PATCH "${CUB_VERSION_FLAT} % 100") # CUB: "subminor" CMake: "patch"
-
-# Build comparison versions:
-set(CUB_COMPAT "${CUB_VERSION_MAJOR}.${CUB_VERSION_MINOR}.${CUB_VERSION_PATCH}")
-set(CUB_EXACT "${CUB_COMPAT}.${CUB_VERSION_TWEAK}")
-set(FIND_COMPAT "${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR}.${PACKAGE_FIND_VERSION_PATCH}")
-set(FIND_EXACT "${FIND_COMPAT}.${PACKAGE_FIND_VERSION_TWEAK}")
-
-# Set default results
-set(PACKAGE_VERSION ${CUB_EXACT})
-set(PACKAGE_VERSION_UNSUITABLE FALSE)
-set(PACKAGE_VERSION_COMPATIBLE FALSE)
-set(PACKAGE_VERSION_EXACT FALSE)
-
-# Test for compatibility (ignores tweak)
-if (FIND_COMPAT VERSION_EQUAL CUB_COMPAT)
- set(PACKAGE_VERSION_COMPATIBLE TRUE)
-endif()
-
-# Test for exact (does not ignore tweak)
-if (FIND_EXACT VERSION_EQUAL CUB_EXACT)
- set(PACKAGE_VERSION_EXACT TRUE)
-endif()
diff --git a/spaces/CVPR/WALT/mmdet/models/roi_heads/mask_heads/global_context_head.py b/spaces/CVPR/WALT/mmdet/models/roi_heads/mask_heads/global_context_head.py
deleted file mode 100644
index d8e8cbca95d69e86ec7a2a1e7ed7f158be1b5753..0000000000000000000000000000000000000000
--- a/spaces/CVPR/WALT/mmdet/models/roi_heads/mask_heads/global_context_head.py
+++ /dev/null
@@ -1,102 +0,0 @@
-import torch.nn as nn
-from mmcv.cnn import ConvModule
-from mmcv.runner import auto_fp16, force_fp32
-
-from mmdet.models.builder import HEADS
-from mmdet.models.utils import ResLayer, SimplifiedBasicBlock
-
-
-@HEADS.register_module()
-class GlobalContextHead(nn.Module):
- """Global context head used in `SCNet `_.
-
- Args:
- num_convs (int, optional): number of convolutional layer in GlbCtxHead.
- Default: 4.
- in_channels (int, optional): number of input channels. Default: 256.
- conv_out_channels (int, optional): number of output channels before
- classification layer. Default: 256.
- num_classes (int, optional): number of classes. Default: 80.
- loss_weight (float, optional): global context loss weight. Default: 1.
- conv_cfg (dict, optional): config to init conv layer. Default: None.
- norm_cfg (dict, optional): config to init norm layer. Default: None.
- conv_to_res (bool, optional): if True, 2 convs will be grouped into
- 1 `SimplifiedBasicBlock` using a skip connection. Default: False.
- """
-
- def __init__(self,
- num_convs=4,
- in_channels=256,
- conv_out_channels=256,
- num_classes=80,
- loss_weight=1.0,
- conv_cfg=None,
- norm_cfg=None,
- conv_to_res=False):
- super(GlobalContextHead, self).__init__()
- self.num_convs = num_convs
- self.in_channels = in_channels
- self.conv_out_channels = conv_out_channels
- self.num_classes = num_classes
- self.loss_weight = loss_weight
- self.conv_cfg = conv_cfg
- self.norm_cfg = norm_cfg
- self.conv_to_res = conv_to_res
- self.fp16_enabled = False
-
- if self.conv_to_res:
- num_res_blocks = num_convs // 2
- self.convs = ResLayer(
- SimplifiedBasicBlock,
- in_channels,
- self.conv_out_channels,
- num_res_blocks,
- conv_cfg=self.conv_cfg,
- norm_cfg=self.norm_cfg)
- self.num_convs = num_res_blocks
- else:
- self.convs = nn.ModuleList()
- for i in range(self.num_convs):
- in_channels = self.in_channels if i == 0 else conv_out_channels
- self.convs.append(
- ConvModule(
- in_channels,
- conv_out_channels,
- 3,
- padding=1,
- conv_cfg=self.conv_cfg,
- norm_cfg=self.norm_cfg))
-
- self.pool = nn.AdaptiveAvgPool2d(1)
- self.fc = nn.Linear(conv_out_channels, num_classes)
-
- self.criterion = nn.BCEWithLogitsLoss()
-
- def init_weights(self):
- """Init weights for the head."""
- nn.init.normal_(self.fc.weight, 0, 0.01)
- nn.init.constant_(self.fc.bias, 0)
-
- @auto_fp16()
- def forward(self, feats):
- """Forward function."""
- x = feats[-1]
- for i in range(self.num_convs):
- x = self.convs[i](x)
- x = self.pool(x)
-
- # multi-class prediction
- mc_pred = x.reshape(x.size(0), -1)
- mc_pred = self.fc(mc_pred)
-
- return mc_pred, x
-
- @force_fp32(apply_to=('pred', ))
- def loss(self, pred, labels):
- """Loss function."""
- labels = [lbl.unique() for lbl in labels]
- targets = pred.new_zeros(pred.size())
- for i, label in enumerate(labels):
- targets[i, label] = 1.0
- loss = self.loss_weight * self.criterion(pred, targets)
- return loss
diff --git a/spaces/CVPR/WALT/mmdet/models/roi_heads/roi_extractors/single_level_roi_extractor.py b/spaces/CVPR/WALT/mmdet/models/roi_heads/roi_extractors/single_level_roi_extractor.py
deleted file mode 100644
index cfc838f23270a1ae4d70f90059b67a890850e981..0000000000000000000000000000000000000000
--- a/spaces/CVPR/WALT/mmdet/models/roi_heads/roi_extractors/single_level_roi_extractor.py
+++ /dev/null
@@ -1,108 +0,0 @@
-import torch
-from mmcv.runner import force_fp32
-
-from mmdet.models.builder import ROI_EXTRACTORS
-from .base_roi_extractor import BaseRoIExtractor
-
-
-@ROI_EXTRACTORS.register_module()
-class SingleRoIExtractor(BaseRoIExtractor):
- """Extract RoI features from a single level feature map.
-
- If there are multiple input feature levels, each RoI is mapped to a level
- according to its scale. The mapping rule is proposed in
- `FPN `_.
-
- Args:
- roi_layer (dict): Specify RoI layer type and arguments.
- out_channels (int): Output channels of RoI layers.
- featmap_strides (List[int]): Strides of input feature maps.
- finest_scale (int): Scale threshold of mapping to level 0. Default: 56.
- """
-
- def __init__(self,
- roi_layer,
- out_channels,
- featmap_strides,
- finest_scale=56):
- super(SingleRoIExtractor, self).__init__(roi_layer, out_channels,
- featmap_strides)
- self.finest_scale = finest_scale
-
- def map_roi_levels(self, rois, num_levels):
- """Map rois to corresponding feature levels by scales.
-
- - scale < finest_scale * 2: level 0
- - finest_scale * 2 <= scale < finest_scale * 4: level 1
- - finest_scale * 4 <= scale < finest_scale * 8: level 2
- - scale >= finest_scale * 8: level 3
-
- Args:
- rois (Tensor): Input RoIs, shape (k, 5).
- num_levels (int): Total level number.
-
- Returns:
- Tensor: Level index (0-based) of each RoI, shape (k, )
- """
- scale = torch.sqrt(
- (rois[:, 3] - rois[:, 1]) * (rois[:, 4] - rois[:, 2]))
- target_lvls = torch.floor(torch.log2(scale / self.finest_scale + 1e-6))
- target_lvls = target_lvls.clamp(min=0, max=num_levels - 1).long()
- return target_lvls
-
- @force_fp32(apply_to=('feats', ), out_fp16=True)
- def forward(self, feats, rois, roi_scale_factor=None):
- """Forward function."""
- out_size = self.roi_layers[0].output_size
- num_levels = len(feats)
- expand_dims = (-1, self.out_channels * out_size[0] * out_size[1])
- if torch.onnx.is_in_onnx_export():
- # Work around to export mask-rcnn to onnx
- roi_feats = rois[:, :1].clone().detach()
- roi_feats = roi_feats.expand(*expand_dims)
- roi_feats = roi_feats.reshape(-1, self.out_channels, *out_size)
- roi_feats = roi_feats * 0
- else:
- roi_feats = feats[0].new_zeros(
- rois.size(0), self.out_channels, *out_size)
- # TODO: remove this when parrots supports
- if torch.__version__ == 'parrots':
- roi_feats.requires_grad = True
-
- if num_levels == 1:
- if len(rois) == 0:
- return roi_feats
- return self.roi_layers[0](feats[0], rois)
-
- target_lvls = self.map_roi_levels(rois, num_levels)
-
- if roi_scale_factor is not None:
- rois = self.roi_rescale(rois, roi_scale_factor)
-
- for i in range(num_levels):
- mask = target_lvls == i
- if torch.onnx.is_in_onnx_export():
- # To keep all roi_align nodes exported to onnx
- # and skip nonzero op
- mask = mask.float().unsqueeze(-1).expand(*expand_dims).reshape(
- roi_feats.shape)
- roi_feats_t = self.roi_layers[i](feats[i], rois)
- roi_feats_t *= mask
- roi_feats += roi_feats_t
- continue
- inds = mask.nonzero(as_tuple=False).squeeze(1)
- if inds.numel() > 0:
- rois_ = rois[inds]
- roi_feats_t = self.roi_layers[i](feats[i], rois_)
- roi_feats[inds] = roi_feats_t
- else:
- # Sometimes some pyramid levels will not be used for RoI
- # feature extraction and this will cause an incomplete
- # computation graph in one GPU, which is different from those
- # in other GPUs and will cause a hanging error.
- # Therefore, we add it to ensure each feature pyramid is
- # included in the computation graph to avoid runtime bugs.
- roi_feats += sum(
- x.view(-1)[0]
- for x in self.parameters()) * 0. + feats[i].sum() * 0.
- return roi_feats
diff --git a/spaces/Cloudfeng/anime-remove-background/app.py b/spaces/Cloudfeng/anime-remove-background/app.py
deleted file mode 100644
index 230a0d5f8a3da6ab18ecb8db1cd90016a489b96a..0000000000000000000000000000000000000000
--- a/spaces/Cloudfeng/anime-remove-background/app.py
+++ /dev/null
@@ -1,52 +0,0 @@
-import gradio as gr
-import huggingface_hub
-import onnxruntime as rt
-import numpy as np
-import cv2
-
-
-def get_mask(img, s=1024):
- img = (img / 255).astype(np.float32)
- h, w = h0, w0 = img.shape[:-1]
- h, w = (s, int(s * w / h)) if h > w else (int(s * h / w), s)
- ph, pw = s - h, s - w
- img_input = np.zeros([s, s, 3], dtype=np.float32)
- img_input[ph // 2:ph // 2 + h, pw // 2:pw // 2 + w] = cv2.resize(img, (w, h))
- img_input = np.transpose(img_input, (2, 0, 1))
- img_input = img_input[np.newaxis, :]
- mask = rmbg_model.run(None, {'img': img_input})[0][0]
- mask = np.transpose(mask, (1, 2, 0))
- mask = mask[ph // 2:ph // 2 + h, pw // 2:pw // 2 + w]
- mask = cv2.resize(mask, (w0, h0))[:, :, np.newaxis]
- return mask
-
-
-def rmbg_fn(img):
- mask = get_mask(img)
- img = (mask * img + 255 * (1 - mask)).astype(np.uint8)
- mask = (mask * 255).astype(np.uint8)
- img = np.concatenate([img, mask], axis=2, dtype=np.uint8)
- mask = mask.repeat(3, axis=2)
- return mask, img
-
-
-if __name__ == "__main__":
- providers = ['CUDAExecutionProvider', 'CPUExecutionProvider']
- model_path = huggingface_hub.hf_hub_download("skytnt/anime-seg", "isnetis.onnx")
- rmbg_model = rt.InferenceSession(model_path, providers=providers)
- app = gr.Blocks()
- with app:
- gr.Markdown("# Anime Remove Background\n\n"
- "\n\n"
- "demo for [https://github.com/SkyTNT/anime-segmentation/](https://github.com/SkyTNT/anime-segmentation/)")
- with gr.Row():
- with gr.Column():
- input_img = gr.Image(label="input image")
- examples_data = [[f"examples/{x:02d}.jpg"] for x in range(1, 4)]
- examples = gr.Dataset(components=[input_img], samples=examples_data)
- run_btn = gr.Button(variant="primary")
- output_mask = gr.Image(label="mask")
- output_img = gr.Image(label="result", image_mode="RGBA")
- examples.click(lambda x: x[0], [examples], [input_img])
- run_btn.click(rmbg_fn, [input_img], [output_mask, output_img])
- app.launch()
diff --git a/spaces/CofAI/chat/g4f/__init__.py b/spaces/CofAI/chat/g4f/__init__.py
deleted file mode 100644
index a0b4bac6aa4de9c0449095a3874c2cb9716169d7..0000000000000000000000000000000000000000
--- a/spaces/CofAI/chat/g4f/__init__.py
+++ /dev/null
@@ -1,39 +0,0 @@
-import sys
-from . import Provider
-from g4f.models import Model, ModelUtils
-
-
-class ChatCompletion:
- @staticmethod
- def create(model: Model.model or str, messages: list, provider: Provider.Provider = None, stream: bool = False, auth: str = False, **kwargs):
- kwargs['auth'] = auth
-
- if provider and provider.needs_auth and not auth:
- print(
- f'ValueError: {provider.__name__} requires authentication (use auth="cookie or token or jwt ..." param)', file=sys.stderr)
- sys.exit(1)
-
- try:
- if isinstance(model, str):
- try:
- model = ModelUtils.convert[model]
- except KeyError:
- raise Exception(f'The model: {model} does not exist')
-
- engine = model.best_provider if not provider else provider
-
- if not engine.supports_stream and stream == True:
- print(
- f"ValueError: {engine.__name__} does not support 'stream' argument", file=sys.stderr)
- sys.exit(1)
-
- print(f'Using {engine.__name__} provider')
-
- return (engine._create_completion(model.name, messages, stream, **kwargs)
- if stream else ''.join(engine._create_completion(model.name, messages, stream, **kwargs)))
- except TypeError as e:
- print(e)
- arg: str = str(e).split("'")[1]
- print(
- f"ValueError: {engine.__name__} does not support '{arg}' argument", file=sys.stderr)
- sys.exit(1)
diff --git a/spaces/CorvaeOboro/gen_ability_icon/torch_utils/ops/grid_sample_gradfix.py b/spaces/CorvaeOboro/gen_ability_icon/torch_utils/ops/grid_sample_gradfix.py
deleted file mode 100644
index ca6b3413ea72a734703c34382c023b84523601fd..0000000000000000000000000000000000000000
--- a/spaces/CorvaeOboro/gen_ability_icon/torch_utils/ops/grid_sample_gradfix.py
+++ /dev/null
@@ -1,83 +0,0 @@
-# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
-#
-# NVIDIA CORPORATION and its licensors retain all intellectual property
-# and proprietary rights in and to this software, related documentation
-# and any modifications thereto. Any use, reproduction, disclosure or
-# distribution of this software and related documentation without an express
-# license agreement from NVIDIA CORPORATION is strictly prohibited.
-
-"""Custom replacement for `torch.nn.functional.grid_sample` that
-supports arbitrarily high order gradients between the input and output.
-Only works on 2D images and assumes
-`mode='bilinear'`, `padding_mode='zeros'`, `align_corners=False`."""
-
-import warnings
-import torch
-
-# pylint: disable=redefined-builtin
-# pylint: disable=arguments-differ
-# pylint: disable=protected-access
-
-#----------------------------------------------------------------------------
-
-enabled = False # Enable the custom op by setting this to true.
-
-#----------------------------------------------------------------------------
-
-def grid_sample(input, grid):
- if _should_use_custom_op():
- return _GridSample2dForward.apply(input, grid)
- return torch.nn.functional.grid_sample(input=input, grid=grid, mode='bilinear', padding_mode='zeros', align_corners=False)
-
-#----------------------------------------------------------------------------
-
-def _should_use_custom_op():
- if not enabled:
- return False
- if any(torch.__version__.startswith(x) for x in ['1.7.', '1.8.', '1.9']):
- return True
- warnings.warn(f'grid_sample_gradfix not supported on PyTorch {torch.__version__}. Falling back to torch.nn.functional.grid_sample().')
- return False
-
-#----------------------------------------------------------------------------
-
-class _GridSample2dForward(torch.autograd.Function):
- @staticmethod
- def forward(ctx, input, grid):
- assert input.ndim == 4
- assert grid.ndim == 4
- output = torch.nn.functional.grid_sample(input=input, grid=grid, mode='bilinear', padding_mode='zeros', align_corners=False)
- ctx.save_for_backward(input, grid)
- return output
-
- @staticmethod
- def backward(ctx, grad_output):
- input, grid = ctx.saved_tensors
- grad_input, grad_grid = _GridSample2dBackward.apply(grad_output, input, grid)
- return grad_input, grad_grid
-
-#----------------------------------------------------------------------------
-
-class _GridSample2dBackward(torch.autograd.Function):
- @staticmethod
- def forward(ctx, grad_output, input, grid):
- op = torch._C._jit_get_operation('aten::grid_sampler_2d_backward')
- grad_input, grad_grid = op(grad_output, input, grid, 0, 0, False)
- ctx.save_for_backward(grid)
- return grad_input, grad_grid
-
- @staticmethod
- def backward(ctx, grad2_grad_input, grad2_grad_grid):
- _ = grad2_grad_grid # unused
- grid, = ctx.saved_tensors
- grad2_grad_output = None
- grad2_input = None
- grad2_grid = None
-
- if ctx.needs_input_grad[0]:
- grad2_grad_output = _GridSample2dForward.apply(grad2_grad_input, grid)
-
- assert not ctx.needs_input_grad[2]
- return grad2_grad_output, grad2_input, grad2_grid
-
-#----------------------------------------------------------------------------
diff --git a/spaces/Cpp4App/Cpp4App/CDM/run_online_demo.py b/spaces/Cpp4App/Cpp4App/CDM/run_online_demo.py
deleted file mode 100644
index aa55fedbb40be8d61a87d9dbbbda4aaebe66c0c5..0000000000000000000000000000000000000000
--- a/spaces/Cpp4App/Cpp4App/CDM/run_online_demo.py
+++ /dev/null
@@ -1,52 +0,0 @@
-import sys
-import os
-
-sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'scrutinizing_alexa'))
-# from run_single_sem import run_single_pp
-
-sys.path.append(os.path.join(os.path.dirname(__file__)))
-from run_single import run_single_img
-
-import cv2
-
-def run_demo(img_root, output_root, segment_root, file):
- # run_single_pp(file)
-
- output_board, output_data = run_single_img(img_root, output_root, segment_root)
-
- # cv2.imshow("result", output_board)
- # cv2.waitKey(0)
-
- return output_board, output_data
-
-if __name__ == '__main__':
-
- input_img_root = "./input_examples/1-1.jpg"
- output_root = "./result_classification"
- segment_root = '../scrutinizing_alexa/txt'
- img_root = "./input_examples/1-1-write.jpg"
- pp_root = "../scrutinizing_alexa/pp_example/1.html"
-
- # run_single_pp(file)
- #
- # img = cv2.imread(input_img_root)
- #
- # cv2.imwrite(input_img, img)
- #
- # output_board, output_data = run_single_img("./input_examples/1-1-write.jpg", output_root, segment_root)
- #
- # # cv2.imshow("result", output_board)
- # # cv2.waitKey(0)
-
- img = cv2.imread(input_img_root)
- cv2.imwrite(img_root, img)
-
- file = open('../scrutinizing_alexa/pp_example/1.html', encoding='utf-8')
-
- output_board, output_data = run_demo(img_root, output_root, segment_root, file)
-
- # cv2.imshow("result", output_board)
- # cv2.waitKey(0)
-
- print(output_data)
-
diff --git a/spaces/Crow34/Joi/app.py b/spaces/Crow34/Joi/app.py
deleted file mode 100644
index 0b9558fcdfdffabbe3f8cef8d6976e9a2e8e2168..0000000000000000000000000000000000000000
--- a/spaces/Crow34/Joi/app.py
+++ /dev/null
@@ -1,3 +0,0 @@
-import gradio as gr
-
-gr.Interface.load("models/EleutherAI/gpt-neo-125m").launch()
\ No newline at end of file
diff --git a/spaces/DEEMOSTECH/ChatAvatar/static/css/main.46e5a5fa.css b/spaces/DEEMOSTECH/ChatAvatar/static/css/main.46e5a5fa.css
deleted file mode 100644
index 6dd641e12ae4a6386ef42021edc87520333ebcb8..0000000000000000000000000000000000000000
--- a/spaces/DEEMOSTECH/ChatAvatar/static/css/main.46e5a5fa.css
+++ /dev/null
@@ -1,2 +0,0 @@
-html{overflow-x:hidden;overflow-y:overlay}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;box-sizing:border-box;color:#cfcfcf;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;margin:0}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}.root{display:flex;justify-content:center;width:100%}.container{height:100vh;width:100%}.\!container{width:100%!important}@media (min-width:640px){.container{max-width:640px}.\!container{max-width:640px!important}}@media (min-width:768px){.container{max-width:768px}.\!container{max-width:768px!important}}@media (min-width:1024px){.container{max-width:1024px}.\!container{max-width:1024px!important}}@media (min-width:1280px){.container{max-width:1280px}.\!container{max-width:1280px!important}}@media (min-width:1536px){.container{max-width:1536px}.\!container{max-width:1536px!important}}.App{--theme-color:#4a00e0;--font-dark-color:#434343;--font-gray-color:#aaa;--font-light-color:#cfcfcf;--bg-light-color:#fff;--bg-gray0-color:#f8f8f8;--bg-gray1-color:#ececec;--bg-gray2-color:#7c7c7c;--bg-gray3-color:#373737;--bg-theme-color:#e7e3f1;--bg-dark-color:#121317;--side-gap:5rem;--radius:0.5rem;--shadow:-10px 0px 12px 1px hsla(0,0%,53%,.16);display:flex;justify-content:space-between;padding:16px;text-align:center}.App *{box-sizing:border-box;transition:all .3s}.App ::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.2)}textarea{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;border:1px solid transparent;color:var(--font-dark-color);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:1rem;line-height:1.5rem;outline:none;padding:0;resize:none}textarea:focus{border-color:var(--theme-color)}img{-webkit-user-drag:none;-webkit-user-select:none;user-select:none}.gallery_con__Y2mej{align-items:flex-start;display:flex;justify-content:center;margin-top:3rem;padding:0 1.25rem;width:100%}.gallery_menuCon__fVdFJ{margin-right:2rem;width:-webkit-max-content;width:max-content}.gallery_menu__U2btD{align-items:center;background-color:initial;border:2px solid transparent;border-radius:1.5rem;cursor:pointer;display:flex;height:3rem;justify-content:center;line-height:1rem;margin-bottom:1rem;text-align:center;width:6rem}.gallery_menu__U2btD.gallery_selected__T2qcs,.gallery_menu__U2btD:hover{background-color:var(--bg-gray3-color);color:#fff}.gallery_menu__U2btD.gallery_selected__T2qcs{border-color:#fff}.gallery_cardsCon__wAfcp{align-items:flex-start;display:flex;flex-grow:1;flex-shrink:1;flex-wrap:wrap;justify-content:space-between;max-height:100vh;max-width:calc(1600px + 9rem)}.gallery_cardsCon__wAfcp::-webkit-scrollbar-thumb{background-color:hsla(0,0%,100%,.2);border:5px solid #121317;border-radius:8px}.gallery_card__noUoL{background-color:var(--bg-gray3-color);border-radius:var(--radius);cursor:pointer;font-size:.75rem;height:260px;margin-bottom:1rem;overflow:hidden;position:relative;width:200px}.gallery_coverImg__BYj-o,.gallery_coverImg__BYj-o img{height:100%;width:100%}.gallery_prompt__9PEmb{background-color:#f8f8f880;border-radius:var(--radius);bottom:1rem;color:var(--font-dark-color);height:0;left:1rem;overflow:hidden;padding:0 .5rem;position:absolute;right:1rem;text-align:left;white-space:pre-wrap;word-break:break-all}.gallery_prompt__9PEmb.gallery_show__c2k50{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;padding:.5rem}.gallery_infoCon__E8oLy{align-items:center;bottom:1rem;color:var(--font-dark-color);display:flex;justify-content:flex-start;left:1rem;position:absolute;right:1rem}.gallery_avatar__KWBmI,.gallery_avatar__KWBmI img{border-radius:12px;height:24px;overflow:hidden;width:24px}.gallery_avatar__KWBmI{margin-right:1rem}.gallery_spaceholder__xJwYU{flex-grow:1;flex-shrink:1}.header_con__M\+u1W{align-items:center;display:flex;justify-content:center;padding:0 var(--side-gap);width:100vw}.header_header__Y7CqP{align-items:center;border-bottom:1px solid hsla(0,0%,100%,.1);display:flex;justify-content:space-between;padding:1rem 0;width:100%}.header_logoCon__MIdGL{align-items:flex-start;display:flex;height:3rem;justify-content:center}.header_logo__90zuC{height:3rem;margin-right:1rem}.header_logoCon__MIdGL>div{font-size:2rem;font-weight:700;line-height:2rem;margin-top:5px}.header_avatar__B3zXB{background:var(--bg-gray2-color);border-radius:50%;overflow:hidden}.header_avatar__B3zXB,.header_avatar__B3zXB img{height:3rem;width:3rem}.result_con__gHOU1{align-items:center;color:var(--font-dark-color);justify-content:center;width:50%;z-index:999}.result_con__gHOU1 *{flex-shrink:0}.result_board__PCvVJ{background-color:var(--bg-light-color);border-radius:var(--radius);display:flex;flex-flow:column;height:100%;width:100%}.result_colHead__k0Mk-{background:#f9fafb;border:0 solid #e5e7eb;border-radius:8px;flex:0 1 auto;padding:8px}.result_colInner__9FccK{background:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 1px 2px 0 rgba(0,0,0,.05);flex-wrap:wrap;gap:1px;margin-bottom:1rem;overflow:hidden;padding:10px 12px}.result_colDetail__jggqg,.result_colInner__9FccK{align-items:center;flex-direction:column;justify-content:flex-start}.result_colDetail__jggqg{background:#f9fafb;border:0 solid #e5e7eb;border-radius:8px;display:flex;flex:1 1 auto;margin-top:1rem;padding:8px 8px 24px}.result_colContent__FYZno{background:#fff;border:1px solid #e5e7eb;border-radius:8px;height:100%;width:100%}.result_colTitle__R8k\+A{align-items:flex-end;color:#6b7280;display:flex;font-size:.875rem;justify-content:space-between;line-height:1.2rem;margin-bottom:8px;width:100%}.result_passwordCon__OjFSI{border-top:1px solid #e5e7eb;padding:8px 12px 2px}.result_emailCon__eEqXk{padding-bottom:10px;padding-left:12px;padding-right:12px}.result_colTitle__R8k\+A>div{margin-bottom:.5rem}.result_colTitle__R8k\+A>div.result_restart__fLq8E{border-radius:5px;cursor:pointer;font-size:1rem;font-weight:400;margin-bottom:0;margin-left:1rem;padding:.5rem;-webkit-user-select:none;user-select:none}.result_restart__fLq8E:hover{background-color:var(--bg-gray0-color);color:var(--font-dark-color)}.result_spaceholder__GAxGZ{flex-grow:1;flex-shrink:1}.result_lang__85-De{cursor:pointer;font-weight:400;margin-right:1rem;-webkit-user-select:none;user-select:none}.result_lang__85-De.result_en__n-Jo7{margin-left:1rem;margin-right:0;width:4rem}.result_lang__85-De:hover{font-weight:700}.result_lang__85-De.result_selected__kDzD1{color:var(--font-dark-color);font-weight:700}.result_regene__yKazF{color:var(--theme-color);cursor:pointer;font-weight:400;-webkit-user-select:none;user-select:none}.result_chatCon__Hm\+zJ{background-color:var(--bg-gray0-color);border-radius:var(--radius);height:calc(100% - 4rem);padding:1rem}.result_chatCon__Hm\+zJ,.result_chatMsgCon__x8UTP{align-items:center;display:flex;flex-direction:column;flex-grow:1;flex-shrink:1;justify-content:flex-start;width:100%}.result_chatMsgCon__x8UTP{overflow-y:overlay;text-align:left}.result_chatMsgCon__x8UTP::-webkit-scrollbar-thumb{border:none;border-radius:3px}.result_chatMsgCon__x8UTP::-webkit-scrollbar{width:6px}.result_chatMsgRow__dr9Qg{align-items:flex-start;display:flex;flex-direction:row;justify-content:flex-start;margin-bottom:1rem;width:100%}.result_chatMsgRow__dr9Qg.result_user__bUuRg{flex-direction:row-reverse}.result_avatar__B2zOp{background:var(--bg-gray2-color);border-radius:1.5rem;margin-left:0;margin-right:1rem;overflow:hidden}.result_avatar__B2zOp,.result_avatar__B2zOp img{height:3rem;width:3rem}.result_user__bUuRg .result_avatar__B2zOp{margin-left:1rem;margin-right:0}.result_bubble__GexXm{background:var(--bg-theme-color);border-radius:var(--radius);flex-shrink:1;line-height:1.5rem;padding:.75rem 1rem;white-space:pre-wrap;word-break:break-all}.result_bubble__GexXm.result_unactive__zyVF2{background:var(--bg-gray1-color)}.result_user__bUuRg .result_bubble__GexXm{background:var(--bg-light-color)}.result_chatIptCon__LXDF-{align-items:center;display:flex;flex-direction:column;justify-content:flex-start;width:100%}.result_chatTipsCon__w4uUf{align-items:flex-end;display:flex;flex-direction:row;justify-content:flex-start;margin-top:1rem;max-width:100%;overflow-x:auto;overflow-y:hidden;width:100%}.result_chatTipsCon__w4uUf::-webkit-scrollbar-thumb{border-color:var(--bg-gray0-color)}.result_chatTips__6b9zJ{background:var(--bg-light-color);border-radius:var(--radius);cursor:pointer;margin-right:1rem;padding:1rem;text-align:left;white-space:pre-wrap;width:15.5rem;word-break:break-all}.result_chatTips__6b9zJ:last-child{margin-right:0}.result_chatRowCon__jLGk3{align-items:flex-start;display:flex;flex-direction:row;justify-content:space-between;margin-top:1rem;width:100%}.result_iptLineCon__nLuWa{flex-grow:1;flex-shrink:1;line-height:1.5rem;margin-right:1rem;position:relative;text-align:left}.result_iptSpaceholder__hAkD5{border:1px solid transparent;max-height:calc(9rem + 2px);visibility:hidden}.result_iptSpaceholder__hAkD5,.result_ipt__tA\+g4{padding:.75rem 1rem;white-space:pre-wrap;word-break:break-all}.result_ipt__tA\+g4{background:var(--bg-light-color);border-radius:var(--radius);bottom:0;left:0;overflow-y:auto;position:absolute;right:0;top:0}.result_ipt__tA\+g4::-webkit-scrollbar-thumb{border-color:var(--bg-light-color)}.result_btn__h5tQr{align-items:center;background-color:var(--theme-color);border:1px solid var(--theme-color);border-radius:1.5rem;color:#fff;cursor:pointer;display:flex;font-weight:700;height:calc(3rem - 2px);justify-content:center;line-height:1rem;padding:0 1.5rem;-webkit-user-select:none;user-select:none}.result_con__gHOU1 .result_btn__h5tQr.result_disabled__lB61-{background:var(--bg-gray2-color);border-color:var(--bg-gray2-color);color:var(--font-light-color);cursor:not-allowed}.result_iptArea__23TZc{background:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 0 0 3px transparent,inset 0 2px 4px 0 rgba(0,0,0,.05);color:#1f2937;display:block;font-size:14px;height:42px;line-height:1.4;outline:none!important;padding:10px;position:relative;width:100%}.result_iptArea__23TZc:focus{border-color:#93c5fd;box-shadow:0 0 0 3px #dfedfe,inset 0 2px 4px 0 transparent}.result_iptArea__23TZc::-webkit-scrollbar-thumb{border-color:var(--bg-gray0-color)}.result_clearBtn__r6e0y{background:linear-gradient(to bottom right,#f3f4f6,#e5e7eb);border:1px solid #e5e7eb;border-radius:8px;color:#374151;cursor:pointer;font-size:16px;font-weight:600;height:42px;min-width:max(160px,48%);padding:8px 16px}.result_clearBtn__r6e0y:hover{background:linear-gradient(to bottom right,#f3f4f6,#f3f4f6);border:1px solid #e5e7eb}.result_clearBtnLogin__LOsgV{background:linear-gradient(to bottom right,#f3f4f6,#e5e7eb);border:1px solid #e5e7eb;border-radius:8px;color:#374151;cursor:pointer;font-size:16px;font-weight:700;height:42px;min-width:max(160px,48%);padding:8px 16px}.result_inputError__qtPTq{border-color:#f56565;box-shadow:0 0 0 3px #fed7d7,inset 0 2px 4px 0 transparent}.result_clearBtnLogin__LOsgV:hover{background:linear-gradient(to bottom right,#f3f4f6,#f3f4f6);border:1px solid #e5e7eb}.result_btnCon__LEoi5{display:flex;justify-content:space-between}.result_generateBtn__UGmBG{background:linear-gradient(to bottom right,#ffedd5,#fdba74);border:1px solid #fed7aa;border-radius:8px;color:#ea580c;cursor:pointer;font-size:16px;font-weight:600;height:42px;min-width:max(160px,48%);padding:8px 16px}.result_generateBtn__UGmBG:hover{background:linear-gradient(to bottom right,#ffecd3,#fed7ab);border:1px solid #ffd8b4}.result_generateBtnLogin__nkLOj{background:linear-gradient(to bottom right,#ffedd5,#fdba74);border:1px solid #fed7aa;border-radius:8px;color:#ea580c;cursor:pointer;font-size:16px;font-weight:700;height:42px;min-width:max(160px,48%);padding:8px 16px}.result_generateBtnLogin__nkLOj:hover{background:linear-gradient(to bottom right,#ffecd3,#fed7ab);border:1px solid #ffd8b4}.result_candidateCon__x9kyB{align-items:flex-start;background-color:var(--bg-gray0-color);border-radius:var(--radius);display:flex;flex-direction:row;flex-grow:1;flex-shrink:1;height:100%;justify-content:space-between;max-height:45rem;overflow-y:auto;padding:1rem;position:relative;width:100%}.result_candidateCon__x9kyB::-webkit-scrollbar-thumb{border-color:var(--bg-gray0-color)}.result_candidateCol__eoHna{margin-right:1rem;position:relative;width:calc(33.33333% - .66667rem)}.result_candidateCol__eoHna:last-child{margin-right:0}.result_candidateCol__eoHna img{border-radius:var(--radius);cursor:pointer;margin-bottom:.5rem}.result_creatorCon__tIm3e{align-items:flex-end;color:var(--font-gray-color);display:flex;font-size:1.2rem;font-weight:700;justify-content:flex-start;line-height:1.2rem;margin-bottom:1rem;width:100%}.result_creatorInfoCon__pET8h{text-align:left}.result_creatorName__VLTXL{color:var(--font-dark-color);font-size:1.2rem;font-weight:700;line-height:1.8rem}.result_creatorInfo__CkbWU{color:var(--font-gray-color);font-size:1rem;line-height:1.2rem}.result_modelView__Y25w5{background:var(--bg-gray0-color);border-radius:var(--radius);flex-grow:1;flex-shrink:1;height:100%;overflow:hidden;width:100%}.result_modelInfoCon__bXw5O{align-items:center;display:flex;flex-direction:column;justify-content:flex-end;text-align:left}.result_progressInfo__g9iwR{margin-bottom:.5rem;width:100%}.result_progressTrack__I6zDn{background:var(--bg-light-color);border-radius:2px;height:4px;position:relative;width:100%}.result_progressThumb__mbBQj{background-color:var(--theme-color);border-radius:2px;height:4px;left:0;position:absolute;top:0}.result_modelPrompt__DzUbD{background:var(--bg-light-color);border-radius:var(--radius);margin-top:1rem;min-height:3rem;padding:1rem;width:100%}.result_progressCon__O57XA{font-size:14px;position:absolute;top:calc(50% - 10px)}.result_loadingCon__XVvXD{font-size:14px;position:absolute;top:55%;z-index:-111}.result_icon__dFKnM{height:20px;position:absolute;top:calc(50% - 10px)}.result_hideModel__3phD0{display:none}.result_descriptionLogin__xi7Yx{text-align:start}.login_con__\+RJgQ{background:#000;box-shadow:-5px 0 20px 0 hsla(0,0%,100%,.2);height:100vh;padding:var(--side-gap);position:fixed;right:0;top:0;z-index:9}.login_close__JulM-{cursor:pointer;-webkit-user-select:none;user-select:none}.welcome_con__o1kmf{align-items:center;background:#121317;border-radius:.5rem;display:flex;flex-direction:column;justify-content:flex-start;padding-bottom:1rem;padding-top:2rem;position:relative;width:45%}.welcome_con__o1kmf>img{position:absolute;top:0;width:100%}.welcome_mainCon__H1gv\+{margin-top:.5rem;z-index:999}.welcome_title__Gd8m4{color:#fff;font-family:Courier New;font-size:5rem;font-weight:700;line-height:5rem}.welcome_ioCon__PQZXU{background-color:#fff;border-radius:1rem;border-style:solid;margin-left:8rem;margin-right:8rem;margin-top:24rem;padding:2rem;width:calc(100% - 16rem)}.welcome_iptCon__KpWEL{align-items:center;background:#ededf2;border-radius:1rem;display:flex;height:4rem;justify-content:space-between;margin-bottom:2rem;width:100%}.welcome_iptCon__KpWEL>img{height:2rem;margin-right:1rem;position:static;width:2rem}.welcome_ipt__ayi9Z{background:#ededf2;border:none;border-radius:1rem;color:var(--font-dark-color);flex-grow:1;font-size:1rem;height:100%;outline:none;padding:0 2rem}.welcome_ipt__ayi9Z::-webkit-input-placeholder{font-size:1rem}.welcome_ipt__ayi9Z::placeholder{font-size:1rem}.welcome_btnCon__Mx-ta,.welcome_btn__jCuoG{align-items:center;display:flex;justify-content:center}.welcome_btn__jCuoG{border:1px solid #8f8f8f;border-radius:1rem;cursor:pointer;height:3rem;line-height:1rem;-webkit-user-select:none;user-select:none;width:100%}.welcome_btn__jCuoG:last-child{background:#4a00e0;border:none;font-weight:700}.welcome_btn__jCuoG.welcome_disabled__pcSzv{cursor:not-allowed}.welcome_btn__jCuoG:hover{color:#fff}
-/*# sourceMappingURL=main.46e5a5fa.css.map*/
\ No newline at end of file
diff --git a/spaces/DQChoi/gpt-demo/venv/lib/python3.11/site-packages/fontTools/varLib/iup.c b/spaces/DQChoi/gpt-demo/venv/lib/python3.11/site-packages/fontTools/varLib/iup.c
deleted file mode 100644
index 8fa5a8bfc43750232c56b34ab7ef265d893a42fa..0000000000000000000000000000000000000000
--- a/spaces/DQChoi/gpt-demo/venv/lib/python3.11/site-packages/fontTools/varLib/iup.c
+++ /dev/null
@@ -1,15721 +0,0 @@
-/* Generated by Cython 0.29.36 */
-
-/* BEGIN: Cython Metadata
-{
- "distutils": {
- "name": "fontTools.varLib.iup",
- "sources": [
- "Lib/fontTools/varLib/iup.py"
- ]
- },
- "module_name": "fontTools.varLib.iup"
-}
-END: Cython Metadata */
-
-#ifndef PY_SSIZE_T_CLEAN
-#define PY_SSIZE_T_CLEAN
-#endif /* PY_SSIZE_T_CLEAN */
-#include "Python.h"
-#ifndef Py_PYTHON_H
- #error Python headers needed to compile C extensions, please install development version of Python.
-#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
- #error Cython requires Python 2.6+ or Python 3.3+.
-#else
-#define CYTHON_ABI "0_29_36"
-#define CYTHON_HEX_VERSION 0x001D24F0
-#define CYTHON_FUTURE_DIVISION 1
-#include
-#ifndef offsetof
- #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
-#endif
-#if !defined(WIN32) && !defined(MS_WINDOWS)
- #ifndef __stdcall
- #define __stdcall
- #endif
- #ifndef __cdecl
- #define __cdecl
- #endif
- #ifndef __fastcall
- #define __fastcall
- #endif
-#endif
-#ifndef DL_IMPORT
- #define DL_IMPORT(t) t
-#endif
-#ifndef DL_EXPORT
- #define DL_EXPORT(t) t
-#endif
-#define __PYX_COMMA ,
-#ifndef HAVE_LONG_LONG
- #if PY_VERSION_HEX >= 0x02070000
- #define HAVE_LONG_LONG
- #endif
-#endif
-#ifndef PY_LONG_LONG
- #define PY_LONG_LONG LONG_LONG
-#endif
-#ifndef Py_HUGE_VAL
- #define Py_HUGE_VAL HUGE_VAL
-#endif
-#ifdef PYPY_VERSION
- #define CYTHON_COMPILING_IN_PYPY 1
- #define CYTHON_COMPILING_IN_PYSTON 0
- #define CYTHON_COMPILING_IN_CPYTHON 0
- #define CYTHON_COMPILING_IN_NOGIL 0
- #undef CYTHON_USE_TYPE_SLOTS
- #define CYTHON_USE_TYPE_SLOTS 0
- #undef CYTHON_USE_PYTYPE_LOOKUP
- #define CYTHON_USE_PYTYPE_LOOKUP 0
- #if PY_VERSION_HEX < 0x03050000
- #undef CYTHON_USE_ASYNC_SLOTS
- #define CYTHON_USE_ASYNC_SLOTS 0
- #elif !defined(CYTHON_USE_ASYNC_SLOTS)
- #define CYTHON_USE_ASYNC_SLOTS 1
- #endif
- #undef CYTHON_USE_PYLIST_INTERNALS
- #define CYTHON_USE_PYLIST_INTERNALS 0
- #undef CYTHON_USE_UNICODE_INTERNALS
- #define CYTHON_USE_UNICODE_INTERNALS 0
- #undef CYTHON_USE_UNICODE_WRITER
- #define CYTHON_USE_UNICODE_WRITER 0
- #undef CYTHON_USE_PYLONG_INTERNALS
- #define CYTHON_USE_PYLONG_INTERNALS 0
- #undef CYTHON_AVOID_BORROWED_REFS
- #define CYTHON_AVOID_BORROWED_REFS 1
- #undef CYTHON_ASSUME_SAFE_MACROS
- #define CYTHON_ASSUME_SAFE_MACROS 0
- #undef CYTHON_UNPACK_METHODS
- #define CYTHON_UNPACK_METHODS 0
- #undef CYTHON_FAST_THREAD_STATE
- #define CYTHON_FAST_THREAD_STATE 0
- #undef CYTHON_FAST_PYCALL
- #define CYTHON_FAST_PYCALL 0
- #if PY_VERSION_HEX < 0x03090000
- #undef CYTHON_PEP489_MULTI_PHASE_INIT
- #define CYTHON_PEP489_MULTI_PHASE_INIT 0
- #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
- #define CYTHON_PEP489_MULTI_PHASE_INIT 1
- #endif
- #undef CYTHON_USE_TP_FINALIZE
- #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
- #undef CYTHON_USE_DICT_VERSIONS
- #define CYTHON_USE_DICT_VERSIONS 0
- #undef CYTHON_USE_EXC_INFO_STACK
- #define CYTHON_USE_EXC_INFO_STACK 0
- #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
- #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
- #endif
-#elif defined(PYSTON_VERSION)
- #define CYTHON_COMPILING_IN_PYPY 0
- #define CYTHON_COMPILING_IN_PYSTON 1
- #define CYTHON_COMPILING_IN_CPYTHON 0
- #define CYTHON_COMPILING_IN_NOGIL 0
- #ifndef CYTHON_USE_TYPE_SLOTS
- #define CYTHON_USE_TYPE_SLOTS 1
- #endif
- #undef CYTHON_USE_PYTYPE_LOOKUP
- #define CYTHON_USE_PYTYPE_LOOKUP 0
- #undef CYTHON_USE_ASYNC_SLOTS
- #define CYTHON_USE_ASYNC_SLOTS 0
- #undef CYTHON_USE_PYLIST_INTERNALS
- #define CYTHON_USE_PYLIST_INTERNALS 0
- #ifndef CYTHON_USE_UNICODE_INTERNALS
- #define CYTHON_USE_UNICODE_INTERNALS 1
- #endif
- #undef CYTHON_USE_UNICODE_WRITER
- #define CYTHON_USE_UNICODE_WRITER 0
- #undef CYTHON_USE_PYLONG_INTERNALS
- #define CYTHON_USE_PYLONG_INTERNALS 0
- #ifndef CYTHON_AVOID_BORROWED_REFS
- #define CYTHON_AVOID_BORROWED_REFS 0
- #endif
- #ifndef CYTHON_ASSUME_SAFE_MACROS
- #define CYTHON_ASSUME_SAFE_MACROS 1
- #endif
- #ifndef CYTHON_UNPACK_METHODS
- #define CYTHON_UNPACK_METHODS 1
- #endif
- #undef CYTHON_FAST_THREAD_STATE
- #define CYTHON_FAST_THREAD_STATE 0
- #undef CYTHON_FAST_PYCALL
- #define CYTHON_FAST_PYCALL 0
- #undef CYTHON_PEP489_MULTI_PHASE_INIT
- #define CYTHON_PEP489_MULTI_PHASE_INIT 0
- #undef CYTHON_USE_TP_FINALIZE
- #define CYTHON_USE_TP_FINALIZE 0
- #undef CYTHON_USE_DICT_VERSIONS
- #define CYTHON_USE_DICT_VERSIONS 0
- #undef CYTHON_USE_EXC_INFO_STACK
- #define CYTHON_USE_EXC_INFO_STACK 0
- #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
- #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
- #endif
-#elif defined(PY_NOGIL)
- #define CYTHON_COMPILING_IN_PYPY 0
- #define CYTHON_COMPILING_IN_PYSTON 0
- #define CYTHON_COMPILING_IN_CPYTHON 0
- #define CYTHON_COMPILING_IN_NOGIL 1
- #ifndef CYTHON_USE_TYPE_SLOTS
- #define CYTHON_USE_TYPE_SLOTS 1
- #endif
- #undef CYTHON_USE_PYTYPE_LOOKUP
- #define CYTHON_USE_PYTYPE_LOOKUP 0
- #ifndef CYTHON_USE_ASYNC_SLOTS
- #define CYTHON_USE_ASYNC_SLOTS 1
- #endif
- #undef CYTHON_USE_PYLIST_INTERNALS
- #define CYTHON_USE_PYLIST_INTERNALS 0
- #ifndef CYTHON_USE_UNICODE_INTERNALS
- #define CYTHON_USE_UNICODE_INTERNALS 1
- #endif
- #undef CYTHON_USE_UNICODE_WRITER
- #define CYTHON_USE_UNICODE_WRITER 0
- #undef CYTHON_USE_PYLONG_INTERNALS
- #define CYTHON_USE_PYLONG_INTERNALS 0
- #ifndef CYTHON_AVOID_BORROWED_REFS
- #define CYTHON_AVOID_BORROWED_REFS 0
- #endif
- #ifndef CYTHON_ASSUME_SAFE_MACROS
- #define CYTHON_ASSUME_SAFE_MACROS 1
- #endif
- #ifndef CYTHON_UNPACK_METHODS
- #define CYTHON_UNPACK_METHODS 1
- #endif
- #undef CYTHON_FAST_THREAD_STATE
- #define CYTHON_FAST_THREAD_STATE 0
- #undef CYTHON_FAST_PYCALL
- #define CYTHON_FAST_PYCALL 0
- #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
- #define CYTHON_PEP489_MULTI_PHASE_INIT 1
- #endif
- #ifndef CYTHON_USE_TP_FINALIZE
- #define CYTHON_USE_TP_FINALIZE 1
- #endif
- #undef CYTHON_USE_DICT_VERSIONS
- #define CYTHON_USE_DICT_VERSIONS 0
- #undef CYTHON_USE_EXC_INFO_STACK
- #define CYTHON_USE_EXC_INFO_STACK 0
-#else
- #define CYTHON_COMPILING_IN_PYPY 0
- #define CYTHON_COMPILING_IN_PYSTON 0
- #define CYTHON_COMPILING_IN_CPYTHON 1
- #define CYTHON_COMPILING_IN_NOGIL 0
- #ifndef CYTHON_USE_TYPE_SLOTS
- #define CYTHON_USE_TYPE_SLOTS 1
- #endif
- #if PY_VERSION_HEX < 0x02070000
- #undef CYTHON_USE_PYTYPE_LOOKUP
- #define CYTHON_USE_PYTYPE_LOOKUP 0
- #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
- #define CYTHON_USE_PYTYPE_LOOKUP 1
- #endif
- #if PY_MAJOR_VERSION < 3
- #undef CYTHON_USE_ASYNC_SLOTS
- #define CYTHON_USE_ASYNC_SLOTS 0
- #elif !defined(CYTHON_USE_ASYNC_SLOTS)
- #define CYTHON_USE_ASYNC_SLOTS 1
- #endif
- #if PY_VERSION_HEX < 0x02070000
- #undef CYTHON_USE_PYLONG_INTERNALS
- #define CYTHON_USE_PYLONG_INTERNALS 0
- #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
- #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5)
- #endif
- #ifndef CYTHON_USE_PYLIST_INTERNALS
- #define CYTHON_USE_PYLIST_INTERNALS 1
- #endif
- #ifndef CYTHON_USE_UNICODE_INTERNALS
- #define CYTHON_USE_UNICODE_INTERNALS 1
- #endif
- #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
- #undef CYTHON_USE_UNICODE_WRITER
- #define CYTHON_USE_UNICODE_WRITER 0
- #elif !defined(CYTHON_USE_UNICODE_WRITER)
- #define CYTHON_USE_UNICODE_WRITER 1
- #endif
- #ifndef CYTHON_AVOID_BORROWED_REFS
- #define CYTHON_AVOID_BORROWED_REFS 0
- #endif
- #ifndef CYTHON_ASSUME_SAFE_MACROS
- #define CYTHON_ASSUME_SAFE_MACROS 1
- #endif
- #ifndef CYTHON_UNPACK_METHODS
- #define CYTHON_UNPACK_METHODS 1
- #endif
- #if PY_VERSION_HEX >= 0x030B00A4
- #undef CYTHON_FAST_THREAD_STATE
- #define CYTHON_FAST_THREAD_STATE 0
- #elif !defined(CYTHON_FAST_THREAD_STATE)
- #define CYTHON_FAST_THREAD_STATE 1
- #endif
- #ifndef CYTHON_FAST_PYCALL
- #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
- #endif
- #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
- #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
- #endif
- #ifndef CYTHON_USE_TP_FINALIZE
- #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
- #endif
- #ifndef CYTHON_USE_DICT_VERSIONS
- #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5))
- #endif
- #if PY_VERSION_HEX >= 0x030B00A4
- #undef CYTHON_USE_EXC_INFO_STACK
- #define CYTHON_USE_EXC_INFO_STACK 0
- #elif !defined(CYTHON_USE_EXC_INFO_STACK)
- #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
- #endif
- #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
- #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
- #endif
-#endif
-#if !defined(CYTHON_FAST_PYCCALL)
-#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
-#endif
-#if CYTHON_USE_PYLONG_INTERNALS
- #if PY_MAJOR_VERSION < 3
- #include "longintrepr.h"
- #endif
- #undef SHIFT
- #undef BASE
- #undef MASK
- #ifdef SIZEOF_VOID_P
- enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
- #endif
-#endif
-#ifndef __has_attribute
- #define __has_attribute(x) 0
-#endif
-#ifndef __has_cpp_attribute
- #define __has_cpp_attribute(x) 0
-#endif
-#ifndef CYTHON_RESTRICT
- #if defined(__GNUC__)
- #define CYTHON_RESTRICT __restrict__
- #elif defined(_MSC_VER) && _MSC_VER >= 1400
- #define CYTHON_RESTRICT __restrict
- #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
- #define CYTHON_RESTRICT restrict
- #else
- #define CYTHON_RESTRICT
- #endif
-#endif
-#ifndef CYTHON_UNUSED
-# if defined(__GNUC__)
-# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-# define CYTHON_UNUSED __attribute__ ((__unused__))
-# else
-# define CYTHON_UNUSED
-# endif
-# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
-# define CYTHON_UNUSED __attribute__ ((__unused__))
-# else
-# define CYTHON_UNUSED
-# endif
-#endif
-#ifndef CYTHON_MAYBE_UNUSED_VAR
-# if defined(__cplusplus)
- template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
-# else
-# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
-# endif
-#endif
-#ifndef CYTHON_NCP_UNUSED
-# if CYTHON_COMPILING_IN_CPYTHON
-# define CYTHON_NCP_UNUSED
-# else
-# define CYTHON_NCP_UNUSED CYTHON_UNUSED
-# endif
-#endif
-#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
-#ifdef _MSC_VER
- #ifndef _MSC_STDINT_H_
- #if _MSC_VER < 1300
- typedef unsigned char uint8_t;
- typedef unsigned int uint32_t;
- #else
- typedef unsigned __int8 uint8_t;
- typedef unsigned __int32 uint32_t;
- #endif
- #endif
-#else
- #include
-#endif
-#ifndef CYTHON_FALLTHROUGH
- #if defined(__cplusplus) && __cplusplus >= 201103L
- #if __has_cpp_attribute(fallthrough)
- #define CYTHON_FALLTHROUGH [[fallthrough]]
- #elif __has_cpp_attribute(clang::fallthrough)
- #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
- #elif __has_cpp_attribute(gnu::fallthrough)
- #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
- #endif
- #endif
- #ifndef CYTHON_FALLTHROUGH
- #if __has_attribute(fallthrough)
- #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
- #else
- #define CYTHON_FALLTHROUGH
- #endif
- #endif
- #if defined(__clang__ ) && defined(__apple_build_version__)
- #if __apple_build_version__ < 7000000
- #undef CYTHON_FALLTHROUGH
- #define CYTHON_FALLTHROUGH
- #endif
- #endif
-#endif
-
-#ifndef CYTHON_INLINE
- #if defined(__clang__)
- #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
- #elif defined(__GNUC__)
- #define CYTHON_INLINE __inline__
- #elif defined(_MSC_VER)
- #define CYTHON_INLINE __inline
- #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
- #define CYTHON_INLINE inline
- #else
- #define CYTHON_INLINE
- #endif
-#endif
-
-#define __PYX_BUILD_PY_SSIZE_T "n"
-#define CYTHON_FORMAT_SSIZE_T "z"
-#if PY_MAJOR_VERSION < 3
- #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
- #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
- PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
- #define __Pyx_DefaultClassType PyClass_Type
-#else
- #define __Pyx_BUILTIN_MODULE_NAME "builtins"
- #define __Pyx_DefaultClassType PyType_Type
-#if PY_VERSION_HEX >= 0x030B00A1
- static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f,
- PyObject *code, PyObject *c, PyObject* n, PyObject *v,
- PyObject *fv, PyObject *cell, PyObject* fn,
- PyObject *name, int fline, PyObject *lnos) {
- PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
- PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
- const char *fn_cstr=NULL;
- const char *name_cstr=NULL;
- PyCodeObject* co=NULL;
- PyObject *type, *value, *traceback;
- PyErr_Fetch(&type, &value, &traceback);
- if (!(kwds=PyDict_New())) goto end;
- if (!(argcount=PyLong_FromLong(a))) goto end;
- if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
- if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
- if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
- if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
- if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
- if (!(nlocals=PyLong_FromLong(l))) goto end;
- if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
- if (!(stacksize=PyLong_FromLong(s))) goto end;
- if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
- if (!(flags=PyLong_FromLong(f))) goto end;
- if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
- if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
- if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
- if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
- if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
- if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
- if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
- if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
- if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
- if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
- if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
- if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
- if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
- if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
- Py_XDECREF((PyObject*)co);
- co = (PyCodeObject*)call_result;
- call_result = NULL;
- if (0) {
- cleanup_code_too:
- Py_XDECREF((PyObject*)co);
- co = NULL;
- }
- end:
- Py_XDECREF(kwds);
- Py_XDECREF(argcount);
- Py_XDECREF(posonlyargcount);
- Py_XDECREF(kwonlyargcount);
- Py_XDECREF(nlocals);
- Py_XDECREF(stacksize);
- Py_XDECREF(replace);
- Py_XDECREF(call_result);
- Py_XDECREF(empty);
- if (type) {
- PyErr_Restore(type, value, traceback);
- }
- return co;
- }
-#else
- #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
- PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
-#endif
- #define __Pyx_DefaultClassType PyType_Type
-#endif
-#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
- #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
-#else
- #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
-#endif
-#ifndef Py_TPFLAGS_CHECKTYPES
- #define Py_TPFLAGS_CHECKTYPES 0
-#endif
-#ifndef Py_TPFLAGS_HAVE_INDEX
- #define Py_TPFLAGS_HAVE_INDEX 0
-#endif
-#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
- #define Py_TPFLAGS_HAVE_NEWBUFFER 0
-#endif
-#ifndef Py_TPFLAGS_HAVE_FINALIZE
- #define Py_TPFLAGS_HAVE_FINALIZE 0
-#endif
-#ifndef METH_STACKLESS
- #define METH_STACKLESS 0
-#endif
-#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
- #ifndef METH_FASTCALL
- #define METH_FASTCALL 0x80
- #endif
- typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
- typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
- Py_ssize_t nargs, PyObject *kwnames);
-#else
- #define __Pyx_PyCFunctionFast _PyCFunctionFast
- #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
-#endif
-#if CYTHON_FAST_PYCCALL
-#define __Pyx_PyFastCFunction_Check(func)\
- ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
-#else
-#define __Pyx_PyFastCFunction_Check(func) 0
-#endif
-#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
- #define PyObject_Malloc(s) PyMem_Malloc(s)
- #define PyObject_Free(p) PyMem_Free(p)
- #define PyObject_Realloc(p) PyMem_Realloc(p)
-#endif
-#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
- #define PyMem_RawMalloc(n) PyMem_Malloc(n)
- #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
- #define PyMem_RawFree(p) PyMem_Free(p)
-#endif
-#if CYTHON_COMPILING_IN_PYSTON
- #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
- #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
-#else
- #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
- #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
-#endif
-#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
- #define __Pyx_PyThreadState_Current PyThreadState_GET()
-#elif PY_VERSION_HEX >= 0x03060000
- #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
-#elif PY_VERSION_HEX >= 0x03000000
- #define __Pyx_PyThreadState_Current PyThreadState_GET()
-#else
- #define __Pyx_PyThreadState_Current _PyThreadState_Current
-#endif
-#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
-#include "pythread.h"
-#define Py_tss_NEEDS_INIT 0
-typedef int Py_tss_t;
-static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
- *key = PyThread_create_key();
- return 0;
-}
-static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
- Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
- *key = Py_tss_NEEDS_INIT;
- return key;
-}
-static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
- PyObject_Free(key);
-}
-static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
- return *key != Py_tss_NEEDS_INIT;
-}
-static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
- PyThread_delete_key(*key);
- *key = Py_tss_NEEDS_INIT;
-}
-static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
- return PyThread_set_key_value(*key, value);
-}
-static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
- return PyThread_get_key_value(*key);
-}
-#endif
-#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
-#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
-#else
-#define __Pyx_PyDict_NewPresized(n) PyDict_New()
-#endif
-#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
- #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
- #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
-#else
- #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
- #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
-#endif
-#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
-#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
-#else
-#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
-#endif
-#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
- #define CYTHON_PEP393_ENABLED 1
- #if PY_VERSION_HEX >= 0x030C0000
- #define __Pyx_PyUnicode_READY(op) (0)
- #else
- #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
- 0 : _PyUnicode_Ready((PyObject *)(op)))
- #endif
- #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
- #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
- #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
- #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
- #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
- #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
- #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
- #if PY_VERSION_HEX >= 0x030C0000
- #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
- #else
- #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
- #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
- #else
- #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
- #endif
- #endif
-#else
- #define CYTHON_PEP393_ENABLED 0
- #define PyUnicode_1BYTE_KIND 1
- #define PyUnicode_2BYTE_KIND 2
- #define PyUnicode_4BYTE_KIND 4
- #define __Pyx_PyUnicode_READY(op) (0)
- #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
- #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
- #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
- #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
- #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
- #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
- #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
- #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
-#endif
-#if CYTHON_COMPILING_IN_PYPY
- #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
- #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
-#else
- #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
- #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
- PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
-#endif
-#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
- #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
-#endif
-#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
- #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
-#endif
-#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
- #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
-#endif
-#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
-#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
-#if PY_MAJOR_VERSION >= 3
- #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
-#else
- #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
-#endif
-#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
- #define PyObject_ASCII(o) PyObject_Repr(o)
-#endif
-#if PY_MAJOR_VERSION >= 3
- #define PyBaseString_Type PyUnicode_Type
- #define PyStringObject PyUnicodeObject
- #define PyString_Type PyUnicode_Type
- #define PyString_Check PyUnicode_Check
- #define PyString_CheckExact PyUnicode_CheckExact
-#ifndef PyObject_Unicode
- #define PyObject_Unicode PyObject_Str
-#endif
-#endif
-#if PY_MAJOR_VERSION >= 3
- #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
- #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
-#else
- #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
- #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
-#endif
-#ifndef PySet_CheckExact
- #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
-#endif
-#if PY_VERSION_HEX >= 0x030900A4
- #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
- #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
-#else
- #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
- #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
-#endif
-#if CYTHON_ASSUME_SAFE_MACROS
- #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
-#else
- #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
-#endif
-#if PY_MAJOR_VERSION >= 3
- #define PyIntObject PyLongObject
- #define PyInt_Type PyLong_Type
- #define PyInt_Check(op) PyLong_Check(op)
- #define PyInt_CheckExact(op) PyLong_CheckExact(op)
- #define PyInt_FromString PyLong_FromString
- #define PyInt_FromUnicode PyLong_FromUnicode
- #define PyInt_FromLong PyLong_FromLong
- #define PyInt_FromSize_t PyLong_FromSize_t
- #define PyInt_FromSsize_t PyLong_FromSsize_t
- #define PyInt_AsLong PyLong_AsLong
- #define PyInt_AS_LONG PyLong_AS_LONG
- #define PyInt_AsSsize_t PyLong_AsSsize_t
- #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
- #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
- #define PyNumber_Int PyNumber_Long
-#endif
-#if PY_MAJOR_VERSION >= 3
- #define PyBoolObject PyLongObject
-#endif
-#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
- #ifndef PyUnicode_InternFromString
- #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
- #endif
-#endif
-#if PY_VERSION_HEX < 0x030200A4
- typedef long Py_hash_t;
- #define __Pyx_PyInt_FromHash_t PyInt_FromLong
- #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
-#else
- #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
- #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
-#endif
-#if PY_MAJOR_VERSION >= 3
- #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
-#else
- #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
-#endif
-#if CYTHON_USE_ASYNC_SLOTS
- #if PY_VERSION_HEX >= 0x030500B1
- #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
- #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
- #else
- #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
- #endif
-#else
- #define __Pyx_PyType_AsAsync(obj) NULL
-#endif
-#ifndef __Pyx_PyAsyncMethodsStruct
- typedef struct {
- unaryfunc am_await;
- unaryfunc am_aiter;
- unaryfunc am_anext;
- } __Pyx_PyAsyncMethodsStruct;
-#endif
-
-#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
- #if !defined(_USE_MATH_DEFINES)
- #define _USE_MATH_DEFINES
- #endif
-#endif
-#include
-#ifdef NAN
-#define __PYX_NAN() ((float) NAN)
-#else
-static CYTHON_INLINE float __PYX_NAN() {
- float value;
- memset(&value, 0xFF, sizeof(value));
- return value;
-}
-#endif
-#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
-#define __Pyx_truncl trunc
-#else
-#define __Pyx_truncl truncl
-#endif
-
-#define __PYX_MARK_ERR_POS(f_index, lineno) \
- { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
-#define __PYX_ERR(f_index, lineno, Ln_error) \
- { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
-
-#ifndef __PYX_EXTERN_C
- #ifdef __cplusplus
- #define __PYX_EXTERN_C extern "C"
- #else
- #define __PYX_EXTERN_C extern
- #endif
-#endif
-
-#define __PYX_HAVE__fontTools__varLib__iup
-#define __PYX_HAVE_API__fontTools__varLib__iup
-/* Early includes */
-#ifdef _OPENMP
-#include
-#endif /* _OPENMP */
-
-#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
-#define CYTHON_WITHOUT_ASSERTIONS
-#endif
-
-typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
- const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
-
-#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
-#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
-#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
-#define __PYX_DEFAULT_STRING_ENCODING ""
-#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
-#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
-#define __Pyx_uchar_cast(c) ((unsigned char)c)
-#define __Pyx_long_cast(x) ((long)x)
-#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
- (sizeof(type) < sizeof(Py_ssize_t)) ||\
- (sizeof(type) > sizeof(Py_ssize_t) &&\
- likely(v < (type)PY_SSIZE_T_MAX ||\
- v == (type)PY_SSIZE_T_MAX) &&\
- (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
- v == (type)PY_SSIZE_T_MIN))) ||\
- (sizeof(type) == sizeof(Py_ssize_t) &&\
- (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
- v == (type)PY_SSIZE_T_MAX))) )
-static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
- return (size_t) i < (size_t) limit;
-}
-#if defined (__cplusplus) && __cplusplus >= 201103L
- #include
- #define __Pyx_sst_abs(value) std::abs(value)
-#elif SIZEOF_INT >= SIZEOF_SIZE_T
- #define __Pyx_sst_abs(value) abs(value)
-#elif SIZEOF_LONG >= SIZEOF_SIZE_T
- #define __Pyx_sst_abs(value) labs(value)
-#elif defined (_MSC_VER)
- #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
-#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
- #define __Pyx_sst_abs(value) llabs(value)
-#elif defined (__GNUC__)
- #define __Pyx_sst_abs(value) __builtin_llabs(value)
-#else
- #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
-#endif
-static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
-static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
-#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
-#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
-#define __Pyx_PyBytes_FromString PyBytes_FromString
-#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
-#if PY_MAJOR_VERSION < 3
- #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
- #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
-#else
- #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
- #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
-#endif
-#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
-#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
-#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
-#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
-#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
-#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
-#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
-#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
-#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
-#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
-#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
-#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
-#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
-#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
-#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
-#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
-static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
- const Py_UNICODE *u_end = u;
- while (*u_end++) ;
- return (size_t)(u_end - u - 1);
-}
-#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
-#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
-#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
-#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
-#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
-static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
-static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
-static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
-static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
-#define __Pyx_PySequence_Tuple(obj)\
- (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
-static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
-static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
-#if CYTHON_ASSUME_SAFE_MACROS
-#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
-#else
-#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
-#endif
-#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
-#if PY_MAJOR_VERSION >= 3
-#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
-#else
-#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
-#endif
-#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-static int __Pyx_sys_getdefaultencoding_not_ascii;
-static int __Pyx_init_sys_getdefaultencoding_params(void) {
- PyObject* sys;
- PyObject* default_encoding = NULL;
- PyObject* ascii_chars_u = NULL;
- PyObject* ascii_chars_b = NULL;
- const char* default_encoding_c;
- sys = PyImport_ImportModule("sys");
- if (!sys) goto bad;
- default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
- Py_DECREF(sys);
- if (!default_encoding) goto bad;
- default_encoding_c = PyBytes_AsString(default_encoding);
- if (!default_encoding_c) goto bad;
- if (strcmp(default_encoding_c, "ascii") == 0) {
- __Pyx_sys_getdefaultencoding_not_ascii = 0;
- } else {
- char ascii_chars[128];
- int c;
- for (c = 0; c < 128; c++) {
- ascii_chars[c] = c;
- }
- __Pyx_sys_getdefaultencoding_not_ascii = 1;
- ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
- if (!ascii_chars_u) goto bad;
- ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
- if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
- PyErr_Format(
- PyExc_ValueError,
- "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
- default_encoding_c);
- goto bad;
- }
- Py_DECREF(ascii_chars_u);
- Py_DECREF(ascii_chars_b);
- }
- Py_DECREF(default_encoding);
- return 0;
-bad:
- Py_XDECREF(default_encoding);
- Py_XDECREF(ascii_chars_u);
- Py_XDECREF(ascii_chars_b);
- return -1;
-}
-#endif
-#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
-#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
-#else
-#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
-#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
-static char* __PYX_DEFAULT_STRING_ENCODING;
-static int __Pyx_init_sys_getdefaultencoding_params(void) {
- PyObject* sys;
- PyObject* default_encoding = NULL;
- char* default_encoding_c;
- sys = PyImport_ImportModule("sys");
- if (!sys) goto bad;
- default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
- Py_DECREF(sys);
- if (!default_encoding) goto bad;
- default_encoding_c = PyBytes_AsString(default_encoding);
- if (!default_encoding_c) goto bad;
- __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
- if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
- strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
- Py_DECREF(default_encoding);
- return 0;
-bad:
- Py_XDECREF(default_encoding);
- return -1;
-}
-#endif
-#endif
-
-
-/* Test for GCC > 2.95 */
-#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
- #define likely(x) __builtin_expect(!!(x), 1)
- #define unlikely(x) __builtin_expect(!!(x), 0)
-#else /* !__GNUC__ or GCC < 2.95 */
- #define likely(x) (x)
- #define unlikely(x) (x)
-#endif /* __GNUC__ */
-static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
-
-static PyObject *__pyx_m = NULL;
-static PyObject *__pyx_d;
-static PyObject *__pyx_b;
-static PyObject *__pyx_cython_runtime = NULL;
-static PyObject *__pyx_empty_tuple;
-static PyObject *__pyx_empty_bytes;
-static PyObject *__pyx_empty_unicode;
-static int __pyx_lineno;
-static int __pyx_clineno = 0;
-static const char * __pyx_cfilenm= __FILE__;
-static const char *__pyx_filename;
-
-
-static const char *__pyx_f[] = {
- "Lib/fontTools/varLib/iup.py",
-};
-
-/*--- Type declarations ---*/
-struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between;
-struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr;
-struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize;
-struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr;
-struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr;
-struct __pyx_defaults;
-typedef struct __pyx_defaults __pyx_defaults;
-struct __pyx_defaults {
- PyObject *__pyx_arg_forced;
-};
-
-/* "fontTools/varLib/iup.py":187
- * )
- * @cython.returns(int)
- * def can_iup_in_between( # <<<<<<<<<<<<<<
- * deltas: _DeltaSegment,
- * coords: _PointSegment,
- */
-struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between {
- PyObject_HEAD
- PyObject *__pyx_v_deltas;
- PyObject *__pyx_v_interp;
-};
-
-
-/* "fontTools/varLib/iup.py":203
- *
- * return all(
- * abs(complex(x - p, y - q)) <= tolerance # <<<<<<<<<<<<<<
- * for (x, y), (p, q) in zip(deltas, interp)
- * )
- */
-struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr {
- PyObject_HEAD
- struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between *__pyx_outer_scope;
- int __pyx_v_i;
- int __pyx_v_j;
- double __pyx_v_p;
- double __pyx_v_q;
- double __pyx_v_tolerance;
- double __pyx_v_x;
- double __pyx_v_y;
-};
-
-
-/* "fontTools/varLib/iup.py":369
- *
- *
- * def iup_contour_optimize( # <<<<<<<<<<<<<<
- * deltas: _DeltaSegment, coords: _PointSegment, tolerance: Real = 0.0
- * ) -> _DeltaOrNoneSegment:
- */
-struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize {
- PyObject_HEAD
- PyObject *__pyx_v_d0;
- PyObject *__pyx_v_deltas;
- PyObject *__pyx_v_tolerance;
-};
-
-
-/* "fontTools/varLib/iup.py":384
- *
- * # If all are within tolerance distance of 0, encode nothing:
- * if all(abs(complex(*p)) <= tolerance for p in deltas): # <<<<<<<<<<<<<<
- * return [None] * n
- *
- */
-struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr {
- PyObject_HEAD
- struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize *__pyx_outer_scope;
- PyObject *__pyx_v_p;
-};
-
-
-/* "fontTools/varLib/iup.py":393
- * # If all deltas are exactly the same, return just one (the first one):
- * d0 = deltas[0]
- * if all(d0 == d for d in deltas): # <<<<<<<<<<<<<<
- * return [d0] + [None] * (n - 1)
- *
- */
-struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr {
- PyObject_HEAD
- struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize *__pyx_outer_scope;
- PyObject *__pyx_v_d;
-};
-
-
-/* --- Runtime support code (head) --- */
-/* Refnanny.proto */
-#ifndef CYTHON_REFNANNY
- #define CYTHON_REFNANNY 0
-#endif
-#if CYTHON_REFNANNY
- typedef struct {
- void (*INCREF)(void*, PyObject*, int);
- void (*DECREF)(void*, PyObject*, int);
- void (*GOTREF)(void*, PyObject*, int);
- void (*GIVEREF)(void*, PyObject*, int);
- void* (*SetupContext)(const char*, int, const char*);
- void (*FinishContext)(void**);
- } __Pyx_RefNannyAPIStruct;
- static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
- static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
- #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
-#ifdef WITH_THREAD
- #define __Pyx_RefNannySetupContext(name, acquire_gil)\
- if (acquire_gil) {\
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
- __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
- PyGILState_Release(__pyx_gilstate_save);\
- } else {\
- __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
- }
-#else
- #define __Pyx_RefNannySetupContext(name, acquire_gil)\
- __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
-#endif
- #define __Pyx_RefNannyFinishContext()\
- __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
- #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
- #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
- #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
- #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
- #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
- #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
- #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
- #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
-#else
- #define __Pyx_RefNannyDeclarations
- #define __Pyx_RefNannySetupContext(name, acquire_gil)
- #define __Pyx_RefNannyFinishContext()
- #define __Pyx_INCREF(r) Py_INCREF(r)
- #define __Pyx_DECREF(r) Py_DECREF(r)
- #define __Pyx_GOTREF(r)
- #define __Pyx_GIVEREF(r)
- #define __Pyx_XINCREF(r) Py_XINCREF(r)
- #define __Pyx_XDECREF(r) Py_XDECREF(r)
- #define __Pyx_XGOTREF(r)
- #define __Pyx_XGIVEREF(r)
-#endif
-#define __Pyx_XDECREF_SET(r, v) do {\
- PyObject *tmp = (PyObject *) r;\
- r = v; __Pyx_XDECREF(tmp);\
- } while (0)
-#define __Pyx_DECREF_SET(r, v) do {\
- PyObject *tmp = (PyObject *) r;\
- r = v; __Pyx_DECREF(tmp);\
- } while (0)
-#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
-#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
-
-/* PyObjectGetAttrStr.proto */
-#if CYTHON_USE_TYPE_SLOTS
-static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
-#else
-#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
-#endif
-
-/* GetBuiltinName.proto */
-static PyObject *__Pyx_GetBuiltinName(PyObject *name);
-
-/* SetItemInt.proto */
-#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
- (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
- __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
- (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
- __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
-static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
-static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
- int is_list, int wraparound, int boundscheck);
-
-/* GetItemInt.proto */
-#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
- (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
- __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
- (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
- __Pyx_GetItemInt_Generic(o, to_py_func(i))))
-#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
- (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
- __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
- (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
- int wraparound, int boundscheck);
-#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
- (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
- __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
- (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
- int wraparound, int boundscheck);
-static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
- int is_list, int wraparound, int boundscheck);
-
-/* ListExtend.proto */
-static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyObject* none = _PyList_Extend((PyListObject*)L, v);
- if (unlikely(!none))
- return -1;
- Py_DECREF(none);
- return 0;
-#else
- return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
-#endif
-}
-
-/* ListAppend.proto */
-#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
-static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
- PyListObject* L = (PyListObject*) list;
- Py_ssize_t len = Py_SIZE(list);
- if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
- Py_INCREF(x);
- PyList_SET_ITEM(list, len, x);
- __Pyx_SET_SIZE(list, len + 1);
- return 0;
- }
- return PyList_Append(list, x);
-}
-#else
-#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
-#endif
-
-/* PyObjectCall.proto */
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
-#else
-#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
-#endif
-
-/* RaiseArgTupleInvalid.proto */
-static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
- Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
-
-/* RaiseDoubleKeywords.proto */
-static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
-
-/* ParseKeywords.proto */
-static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
- PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
- const char* function_name);
-
-/* AssertionsEnabled.proto */
-#define __Pyx_init_assertions_enabled()
-#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
- #define __pyx_assertions_enabled() (1)
-#elif PY_VERSION_HEX < 0x03080000 || CYTHON_COMPILING_IN_PYPY || defined(Py_LIMITED_API)
- #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
-#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030900A6
- static int __pyx_assertions_enabled_flag;
- #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
- #undef __Pyx_init_assertions_enabled
- static void __Pyx_init_assertions_enabled(void) {
- __pyx_assertions_enabled_flag = ! _PyInterpreterState_GetConfig(__Pyx_PyThreadState_Current->interp)->optimization_level;
- }
-#else
- #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
-#endif
-
-/* PySequenceContains.proto */
-static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
- int result = PySequence_Contains(seq, item);
- return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
-}
-
-/* PyIntBinop.proto */
-#if !CYTHON_COMPILING_IN_PYPY
-static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
-#else
-#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
- (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
-#endif
-
-/* ListCompAppend.proto */
-#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
-static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
- PyListObject* L = (PyListObject*) list;
- Py_ssize_t len = Py_SIZE(list);
- if (likely(L->allocated > len)) {
- Py_INCREF(x);
- PyList_SET_ITEM(list, len, x);
- __Pyx_SET_SIZE(list, len + 1);
- return 0;
- }
- return PyList_Append(list, x);
-}
-#else
-#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
-#endif
-
-/* PyThreadStateGet.proto */
-#if CYTHON_FAST_THREAD_STATE
-#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
-#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
-#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
-#else
-#define __Pyx_PyThreadState_declare
-#define __Pyx_PyThreadState_assign
-#define __Pyx_PyErr_Occurred() PyErr_Occurred()
-#endif
-
-/* PyErrFetchRestore.proto */
-#if CYTHON_FAST_THREAD_STATE
-#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
-#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
-#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
-#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
-#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
-static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
-static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
-#else
-#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
-#endif
-#else
-#define __Pyx_PyErr_Clear() PyErr_Clear()
-#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
-#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
-#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
-#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
-#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
-#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
-#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
-#endif
-
-/* IterNext.proto */
-#define __Pyx_PyIter_Next(obj) __Pyx_PyIter_Next2(obj, NULL)
-static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject *, PyObject *);
-
-/* PyIntCompare.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
-
-/* SliceObject.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
- PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
- PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
- int has_cstart, int has_cstop, int wraparound);
-
-/* ObjectGetItem.proto */
-#if CYTHON_USE_TYPE_SLOTS
-static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
-#else
-#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
-#endif
-
-/* PyIntBinop.proto */
-#if !CYTHON_COMPILING_IN_PYPY
-static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
-#else
-#define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\
- (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
-#endif
-
-/* PyDictVersioning.proto */
-#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
-#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
-#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
-#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
- (version_var) = __PYX_GET_DICT_VERSION(dict);\
- (cache_var) = (value);
-#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
- static PY_UINT64_T __pyx_dict_version = 0;\
- static PyObject *__pyx_dict_cached_value = NULL;\
- if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
- (VAR) = __pyx_dict_cached_value;\
- } else {\
- (VAR) = __pyx_dict_cached_value = (LOOKUP);\
- __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
- }\
-}
-static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
-static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
-static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
-#else
-#define __PYX_GET_DICT_VERSION(dict) (0)
-#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
-#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
-#endif
-
-/* GetModuleGlobalName.proto */
-#if CYTHON_USE_DICT_VERSIONS
-#define __Pyx_GetModuleGlobalName(var, name) do {\
- static PY_UINT64_T __pyx_dict_version = 0;\
- static PyObject *__pyx_dict_cached_value = NULL;\
- (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
- (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
- __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
-} while(0)
-#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
- PY_UINT64_T __pyx_dict_version;\
- PyObject *__pyx_dict_cached_value;\
- (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
-} while(0)
-static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
-#else
-#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
-#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
-static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
-#endif
-
-/* PyFunctionFastCall.proto */
-#if CYTHON_FAST_PYCALL
-#define __Pyx_PyFunction_FastCall(func, args, nargs)\
- __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
-#if 1 || PY_VERSION_HEX < 0x030600B1
-static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
-#else
-#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
-#endif
-#define __Pyx_BUILD_ASSERT_EXPR(cond)\
- (sizeof(char [1 - 2*!(cond)]) - 1)
-#ifndef Py_MEMBER_SIZE
-#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
-#endif
-#if CYTHON_FAST_PYCALL
- static size_t __pyx_pyframe_localsplus_offset = 0;
- #include "frameobject.h"
-#if PY_VERSION_HEX >= 0x030b00a6
- #ifndef Py_BUILD_CORE
- #define Py_BUILD_CORE 1
- #endif
- #include "internal/pycore_frame.h"
-#endif
- #define __Pxy_PyFrame_Initialize_Offsets()\
- ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
- (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
- #define __Pyx_PyFrame_GetLocalsplus(frame)\
- (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
-#endif // CYTHON_FAST_PYCALL
-#endif
-
-/* PyCFunctionFastCall.proto */
-#if CYTHON_FAST_PYCCALL
-static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
-#else
-#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
-#endif
-
-/* None.proto */
-static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);
-
-/* RaiseTooManyValuesToUnpack.proto */
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
-
-/* RaiseNeedMoreValuesToUnpack.proto */
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
-
-/* IterFinish.proto */
-static CYTHON_INLINE int __Pyx_IterFinish(void);
-
-/* UnpackItemEndCheck.proto */
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
-
-/* py_abs.proto */
-#if CYTHON_USE_PYLONG_INTERNALS
-static PyObject *__Pyx_PyLong_AbsNeg(PyObject *num);
-#define __Pyx_PyNumber_Absolute(x)\
- ((likely(PyLong_CheckExact(x))) ?\
- (likely(Py_SIZE(x) >= 0) ? (Py_INCREF(x), (x)) : __Pyx_PyLong_AbsNeg(x)) :\
- PyNumber_Absolute(x))
-#else
-#define __Pyx_PyNumber_Absolute(x) PyNumber_Absolute(x)
-#endif
-
-/* WriteUnraisableException.proto */
-static void __Pyx_WriteUnraisable(const char *name, int clineno,
- int lineno, const char *filename,
- int full_traceback, int nogil);
-
-/* ArgTypeTest.proto */
-#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
- ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
- __Pyx__ArgTypeTest(obj, type, name, exact))
-static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
-
-/* DictGetItem.proto */
-#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
-static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
-#define __Pyx_PyObject_Dict_GetItem(obj, name)\
- (likely(PyDict_CheckExact(obj)) ?\
- __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
-#else
-#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
-#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
-#endif
-
-/* pyfrozenset_new.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it);
-
-/* PySetContains.proto */
-static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq);
-
-/* SliceTupleAndList.proto */
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop);
-static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop);
-#else
-#define __Pyx_PyList_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop)
-#define __Pyx_PyTuple_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop)
-#endif
-
-/* set_iter.proto */
-static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable, int is_set,
- Py_ssize_t* p_orig_length, int* p_source_is_set);
-static CYTHON_INLINE int __Pyx_set_iter_next(
- PyObject* iter_obj, Py_ssize_t orig_length,
- Py_ssize_t* ppos, PyObject **value,
- int source_is_set);
-
-/* PyIntCompare.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
-
-/* PyObjectCallMethO.proto */
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
-#endif
-
-/* PyObjectCallOneArg.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
-
-/* py_set_remove.proto */
-static CYTHON_INLINE int __Pyx_PySet_Remove(PyObject *set, PyObject *key);
-
-/* IncludeStringH.proto */
-#include
-
-/* PyObject_GenericGetAttrNoDict.proto */
-#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
-static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
-#else
-#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
-#endif
-
-/* GetTopmostException.proto */
-#if CYTHON_USE_EXC_INFO_STACK
-static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
-#endif
-
-/* SaveResetException.proto */
-#if CYTHON_FAST_THREAD_STATE
-#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
-static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
-#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
-static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
-#else
-#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
-#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
-#endif
-
-/* PyErrExceptionMatches.proto */
-#if CYTHON_FAST_THREAD_STATE
-#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
-static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
-#else
-#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
-#endif
-
-/* GetException.proto */
-#if CYTHON_FAST_THREAD_STATE
-#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
-static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
-#else
-static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
-#endif
-
-/* Import.proto */
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
-
-/* ImportFrom.proto */
-static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
-
-/* FetchCommonType.proto */
-static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
-
-/* CythonFunctionShared.proto */
-#define __Pyx_CyFunction_USED 1
-#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
-#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
-#define __Pyx_CYFUNCTION_CCLASS 0x04
-#define __Pyx_CyFunction_GetClosure(f)\
- (((__pyx_CyFunctionObject *) (f))->func_closure)
-#define __Pyx_CyFunction_GetClassObj(f)\
- (((__pyx_CyFunctionObject *) (f))->func_classobj)
-#define __Pyx_CyFunction_Defaults(type, f)\
- ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
-#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
- ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
-typedef struct {
- PyCFunctionObject func;
-#if PY_VERSION_HEX < 0x030500A0
- PyObject *func_weakreflist;
-#endif
- PyObject *func_dict;
- PyObject *func_name;
- PyObject *func_qualname;
- PyObject *func_doc;
- PyObject *func_globals;
- PyObject *func_code;
- PyObject *func_closure;
- PyObject *func_classobj;
- void *defaults;
- int defaults_pyobjects;
- size_t defaults_size; // used by FusedFunction for copying defaults
- int flags;
- PyObject *defaults_tuple;
- PyObject *defaults_kwdict;
- PyObject *(*defaults_getter)(PyObject *);
- PyObject *func_annotations;
-} __pyx_CyFunctionObject;
-static PyTypeObject *__pyx_CyFunctionType = 0;
-#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
-static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
- int flags, PyObject* qualname,
- PyObject *self,
- PyObject *module, PyObject *globals,
- PyObject* code);
-static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
- size_t size,
- int pyobjects);
-static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
- PyObject *tuple);
-static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
- PyObject *dict);
-static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
- PyObject *dict);
-static int __pyx_CyFunction_init(void);
-
-/* CythonFunction.proto */
-static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
- int flags, PyObject* qualname,
- PyObject *closure,
- PyObject *module, PyObject *globals,
- PyObject* code);
-
-/* CLineInTraceback.proto */
-#ifdef CYTHON_CLINE_IN_TRACEBACK
-#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
-#else
-static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
-#endif
-
-/* CodeObjectCache.proto */
-typedef struct {
- PyCodeObject* code_object;
- int code_line;
-} __Pyx_CodeObjectCacheEntry;
-struct __Pyx_CodeObjectCache {
- int count;
- int max_count;
- __Pyx_CodeObjectCacheEntry* entries;
-};
-static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
-static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
-static PyCodeObject *__pyx_find_code_object(int code_line);
-static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
-
-/* AddTraceback.proto */
-static void __Pyx_AddTraceback(const char *funcname, int c_line,
- int py_line, const char *filename);
-
-/* GCCDiagnostics.proto */
-#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
-#define __Pyx_HAS_GCC_DIAGNOSTIC
-#endif
-
-/* CIntFromPy.proto */
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
-
-/* CIntToPy.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
-
-/* CIntToPy.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
-
-/* CIntFromPy.proto */
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
-
-/* FastTypeChecks.proto */
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
-static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
-static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
-static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
-#else
-#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
-#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
-#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
-#endif
-#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
-
-/* RaiseException.proto */
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
-
-/* SwapException.proto */
-#if CYTHON_FAST_THREAD_STATE
-#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
-static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
-#else
-static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
-#endif
-
-/* PyObjectCall2Args.proto */
-static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
-
-/* PyObjectGetMethod.proto */
-static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
-
-/* PyObjectCallMethod1.proto */
-static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
-
-/* CoroutineBase.proto */
-typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
-#if CYTHON_USE_EXC_INFO_STACK
-#define __Pyx_ExcInfoStruct _PyErr_StackItem
-#else
-typedef struct {
- PyObject *exc_type;
- PyObject *exc_value;
- PyObject *exc_traceback;
-} __Pyx_ExcInfoStruct;
-#endif
-typedef struct {
- PyObject_HEAD
- __pyx_coroutine_body_t body;
- PyObject *closure;
- __Pyx_ExcInfoStruct gi_exc_state;
- PyObject *gi_weakreflist;
- PyObject *classobj;
- PyObject *yieldfrom;
- PyObject *gi_name;
- PyObject *gi_qualname;
- PyObject *gi_modulename;
- PyObject *gi_code;
- PyObject *gi_frame;
- int resume_label;
- char is_running;
-} __pyx_CoroutineObject;
-static __pyx_CoroutineObject *__Pyx__Coroutine_New(
- PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
- PyObject *name, PyObject *qualname, PyObject *module_name);
-static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
- __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
- PyObject *name, PyObject *qualname, PyObject *module_name);
-static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
-static int __Pyx_Coroutine_clear(PyObject *self);
-static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
-static PyObject *__Pyx_Coroutine_Close(PyObject *self);
-static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
-#if CYTHON_USE_EXC_INFO_STACK
-#define __Pyx_Coroutine_SwapException(self)
-#define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
-#else
-#define __Pyx_Coroutine_SwapException(self) {\
- __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
- __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
- }
-#define __Pyx_Coroutine_ResetAndClearException(self) {\
- __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
- (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
- }
-#endif
-#if CYTHON_FAST_THREAD_STATE
-#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
- __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
-#else
-#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
- __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
-#endif
-static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
-static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);
-
-/* PatchModuleWithCoroutine.proto */
-static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);
-
-/* PatchGeneratorABC.proto */
-static int __Pyx_patch_abc(void);
-
-/* Generator.proto */
-#define __Pyx_Generator_USED
-static PyTypeObject *__pyx_GeneratorType = 0;
-#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
-#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
- __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
-static PyObject *__Pyx_Generator_Next(PyObject *self);
-static int __pyx_Generator_init(void);
-
-/* CheckBinaryVersion.proto */
-static int __Pyx_check_binary_version(void);
-
-/* InitStrings.proto */
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
-
-
-/* Module declarations from 'cython' */
-
-/* Module declarations from 'fontTools.varLib.iup' */
-static PyTypeObject *__pyx_ptype_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between = 0;
-static PyTypeObject *__pyx_ptype_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr = 0;
-static PyTypeObject *__pyx_ptype_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize = 0;
-static PyTypeObject *__pyx_ptype_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr = 0;
-static PyTypeObject *__pyx_ptype_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr = 0;
-static PyObject *__pyx_f_9fontTools_6varLib_3iup_iup_segment(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
-static CYTHON_INLINE int __pyx_f_9fontTools_6varLib_3iup_can_iup_in_between(PyObject *, PyObject *, int, int, double); /*proto*/
-#define __Pyx_MODULE_NAME "fontTools.varLib.iup"
-extern int __pyx_module_is_main_fontTools__varLib__iup;
-int __pyx_module_is_main_fontTools__varLib__iup = 0;
-
-/* Implementation of 'fontTools.varLib.iup' */
-static PyObject *__pyx_builtin_AttributeError;
-static PyObject *__pyx_builtin_ImportError;
-static PyObject *__pyx_builtin_zip;
-static PyObject *__pyx_builtin_enumerate;
-static PyObject *__pyx_builtin_range;
-static PyObject *__pyx_builtin_max;
-static const char __pyx_k_c[] = "c";
-static const char __pyx_k_d[] = "d";
-static const char __pyx_k_i[] = "i";
-static const char __pyx_k_j[] = "j";
-static const char __pyx_k_k[] = "k";
-static const char __pyx_k_l[] = "l";
-static const char __pyx_k_n[] = "n";
-static const char __pyx_k_s[] = "s";
-static const char __pyx_k_v[] = "v";
-static const char __pyx_k_c1[] = "c1";
-static const char __pyx_k_c2[] = "c2";
-static const char __pyx_k_cj[] = "cj";
-static const char __pyx_k_d0[] = "d0";
-static const char __pyx_k_d1[] = "d1";
-static const char __pyx_k_d2[] = "d2";
-static const char __pyx_k_dj[] = "dj";
-static const char __pyx_k_i1[] = "i1";
-static const char __pyx_k_i2[] = "i2";
-static const char __pyx_k_it[] = "it";
-static const char __pyx_k_lc[] = "lc";
-static const char __pyx_k_ld[] = "ld";
-static const char __pyx_k_nc[] = "nc";
-static const char __pyx_k_nd[] = "nd";
-static const char __pyx_k_end[] = "end";
-static const char __pyx_k_int[] = "int";
-static const char __pyx_k_lcj[] = "lcj";
-static const char __pyx_k_ldj[] = "ldj";
-static const char __pyx_k_max[] = "max";
-static const char __pyx_k_ncj[] = "ncj";
-static const char __pyx_k_ndj[] = "ndj";
-static const char __pyx_k_out[] = "out";
-static const char __pyx_k_ri1[] = "ri1";
-static const char __pyx_k_ri2[] = "ri2";
-static const char __pyx_k_set[] = "set";
-static const char __pyx_k_zip[] = "zip";
-static const char __pyx_k_Real[] = "Real";
-static const char __pyx_k_args[] = "args";
-static const char __pyx_k_cost[] = "cost";
-static const char __pyx_k_ends[] = "ends";
-static const char __pyx_k_list[] = "list";
-static const char __pyx_k_main[] = "__main__";
-static const char __pyx_k_name[] = "__name__";
-static const char __pyx_k_send[] = "send";
-static const char __pyx_k_test[] = "__test__";
-static const char __pyx_k_Delta[] = "_Delta";
-static const char __pyx_k_Point[] = "_Point";
-static const char __pyx_k_Tuple[] = "Tuple";
-static const char __pyx_k_Union[] = "Union";
-static const char __pyx_k_chain[] = "chain";
-static const char __pyx_k_close[] = "close";
-static const char __pyx_k_costs[] = "costs";
-static const char __pyx_k_force[] = "force";
-static const char __pyx_k_range[] = "range";
-static const char __pyx_k_start[] = "start";
-static const char __pyx_k_throw[] = "throw";
-static const char __pyx_k_best_j[] = "best_j";
-static const char __pyx_k_coords[] = "coords";
-static const char __pyx_k_cython[] = "cython";
-static const char __pyx_k_deltas[] = "deltas";
-static const char __pyx_k_forced[] = "forced";
-static const char __pyx_k_import[] = "__import__";
-static const char __pyx_k_return[] = "return";
-static const char __pyx_k_typing[] = "typing";
-static const char __pyx_k_contour[] = "contour";
-static const char __pyx_k_genexpr[] = "genexpr";
-static const char __pyx_k_indices[] = "indices";
-static const char __pyx_k_numbers[] = "numbers";
-static const char __pyx_k_rot_set[] = "_rot_set";
-static const char __pyx_k_COMPILED[] = "COMPILED";
-static const char __pyx_k_Integral[] = "Integral";
-static const char __pyx_k_Sequence[] = "Sequence";
-static const char __pyx_k_best_sol[] = "best_sol";
-static const char __pyx_k_lookback[] = "lookback";
-static const char __pyx_k_rot_list[] = "_rot_list";
-static const char __pyx_k_solution[] = "solution";
-static const char __pyx_k_Endpoints[] = "_Endpoints";
-static const char __pyx_k_best_cost[] = "best_cost";
-static const char __pyx_k_enumerate[] = "enumerate";
-static const char __pyx_k_iup_delta[] = "iup_delta";
-static const char __pyx_k_tolerance[] = "tolerance";
-static const char __pyx_k_DeltaOrNone[] = "_DeltaOrNone";
-static const char __pyx_k_ImportError[] = "ImportError";
-static const char __pyx_k_iup_contour[] = "iup_contour";
-static const char __pyx_k_DeltaSegment[] = "_DeltaSegment";
-static const char __pyx_k_MAX_LOOKBACK[] = "MAX_LOOKBACK";
-static const char __pyx_k_PointSegment[] = "_PointSegment";
-static const char __pyx_k_AttributeError[] = "AttributeError";
-static const char __pyx_k_fontTools_misc[] = "fontTools.misc";
-static const char __pyx_k_DeltaOrNoneSegment[] = "_DeltaOrNoneSegment";
-static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
-static const char __pyx_k_iup_delta_optimize[] = "iup_delta_optimize";
-static const char __pyx_k_fontTools_varLib_iup[] = "fontTools.varLib.iup";
-static const char __pyx_k_iup_contour_optimize[] = "iup_contour_optimize";
-static const char __pyx_k_iup_contour_optimize_dp[] = "_iup_contour_optimize_dp";
-static const char __pyx_k_Lib_fontTools_varLib_iup_py[] = "Lib/fontTools/varLib/iup.py";
-static const char __pyx_k_iup_contour_bound_forced_set[] = "_iup_contour_bound_forced_set";
-static const char __pyx_k_can_iup_in_between_locals_genexp[] = "can_iup_in_between..genexpr";
-static const char __pyx_k_iup_contour_optimize_locals_gene[] = "iup_contour_optimize..genexpr";
-static PyObject *__pyx_n_s_AttributeError;
-static PyObject *__pyx_n_s_COMPILED;
-static PyObject *__pyx_n_s_Delta;
-static PyObject *__pyx_n_s_DeltaOrNone;
-static PyObject *__pyx_n_s_DeltaOrNoneSegment;
-static PyObject *__pyx_n_s_DeltaSegment;
-static PyObject *__pyx_n_s_Endpoints;
-static PyObject *__pyx_n_s_ImportError;
-static PyObject *__pyx_n_s_Integral;
-static PyObject *__pyx_kp_s_Lib_fontTools_varLib_iup_py;
-static PyObject *__pyx_n_s_MAX_LOOKBACK;
-static PyObject *__pyx_n_s_Point;
-static PyObject *__pyx_n_s_PointSegment;
-static PyObject *__pyx_n_s_Real;
-static PyObject *__pyx_n_s_Sequence;
-static PyObject *__pyx_n_s_Tuple;
-static PyObject *__pyx_n_s_Union;
-static PyObject *__pyx_n_s_args;
-static PyObject *__pyx_n_s_best_cost;
-static PyObject *__pyx_n_s_best_j;
-static PyObject *__pyx_n_s_best_sol;
-static PyObject *__pyx_n_s_c;
-static PyObject *__pyx_n_s_c1;
-static PyObject *__pyx_n_s_c2;
-static PyObject *__pyx_n_s_can_iup_in_between_locals_genexp;
-static PyObject *__pyx_n_s_chain;
-static PyObject *__pyx_n_s_cj;
-static PyObject *__pyx_n_s_cline_in_traceback;
-static PyObject *__pyx_n_s_close;
-static PyObject *__pyx_n_s_contour;
-static PyObject *__pyx_n_s_coords;
-static PyObject *__pyx_n_s_cost;
-static PyObject *__pyx_n_s_costs;
-static PyObject *__pyx_n_s_cython;
-static PyObject *__pyx_n_s_d;
-static PyObject *__pyx_n_s_d0;
-static PyObject *__pyx_n_s_d1;
-static PyObject *__pyx_n_s_d2;
-static PyObject *__pyx_n_s_deltas;
-static PyObject *__pyx_n_s_dj;
-static PyObject *__pyx_n_s_end;
-static PyObject *__pyx_n_s_ends;
-static PyObject *__pyx_n_s_enumerate;
-static PyObject *__pyx_n_s_fontTools_misc;
-static PyObject *__pyx_n_s_fontTools_varLib_iup;
-static PyObject *__pyx_n_s_force;
-static PyObject *__pyx_n_s_forced;
-static PyObject *__pyx_n_s_genexpr;
-static PyObject *__pyx_n_s_i;
-static PyObject *__pyx_n_s_i1;
-static PyObject *__pyx_n_s_i2;
-static PyObject *__pyx_n_s_import;
-static PyObject *__pyx_n_s_indices;
-static PyObject *__pyx_n_u_int;
-static PyObject *__pyx_n_s_it;
-static PyObject *__pyx_n_s_iup_contour;
-static PyObject *__pyx_n_s_iup_contour_bound_forced_set;
-static PyObject *__pyx_n_s_iup_contour_optimize;
-static PyObject *__pyx_n_s_iup_contour_optimize_dp;
-static PyObject *__pyx_n_s_iup_contour_optimize_locals_gene;
-static PyObject *__pyx_n_s_iup_delta;
-static PyObject *__pyx_n_s_iup_delta_optimize;
-static PyObject *__pyx_n_s_j;
-static PyObject *__pyx_n_s_k;
-static PyObject *__pyx_n_s_l;
-static PyObject *__pyx_n_s_lc;
-static PyObject *__pyx_n_s_lcj;
-static PyObject *__pyx_n_s_ld;
-static PyObject *__pyx_n_s_ldj;
-static PyObject *__pyx_n_u_list;
-static PyObject *__pyx_n_s_lookback;
-static PyObject *__pyx_n_s_main;
-static PyObject *__pyx_n_s_max;
-static PyObject *__pyx_n_s_n;
-static PyObject *__pyx_n_s_name;
-static PyObject *__pyx_n_s_nc;
-static PyObject *__pyx_n_s_ncj;
-static PyObject *__pyx_n_s_nd;
-static PyObject *__pyx_n_s_ndj;
-static PyObject *__pyx_n_s_numbers;
-static PyObject *__pyx_n_s_out;
-static PyObject *__pyx_n_s_range;
-static PyObject *__pyx_n_s_return;
-static PyObject *__pyx_n_s_ri1;
-static PyObject *__pyx_n_s_ri2;
-static PyObject *__pyx_n_s_rot_list;
-static PyObject *__pyx_n_s_rot_set;
-static PyObject *__pyx_n_s_s;
-static PyObject *__pyx_n_s_send;
-static PyObject *__pyx_n_u_set;
-static PyObject *__pyx_n_s_solution;
-static PyObject *__pyx_n_s_start;
-static PyObject *__pyx_n_s_test;
-static PyObject *__pyx_n_s_throw;
-static PyObject *__pyx_n_s_tolerance;
-static PyObject *__pyx_n_s_typing;
-static PyObject *__pyx_n_s_v;
-static PyObject *__pyx_n_s_zip;
-static PyObject *__pyx_pf_9fontTools_6varLib_3iup_iup_contour(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_deltas, PyObject *__pyx_v_coords); /* proto */
-static PyObject *__pyx_pf_9fontTools_6varLib_3iup_2iup_delta(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_deltas, PyObject *__pyx_v_coords, PyObject *__pyx_v_ends); /* proto */
-static PyObject *__pyx_pf_9fontTools_6varLib_3iup_18can_iup_in_between_genexpr(PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_pf_9fontTools_6varLib_3iup_4_iup_contour_bound_forced_set(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_deltas, PyObject *__pyx_v_coords, PyObject *__pyx_v_tolerance); /* proto */
-static PyObject *__pyx_pf_9fontTools_6varLib_3iup_16__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_pf_9fontTools_6varLib_3iup_6_iup_contour_optimize_dp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_deltas, PyObject *__pyx_v_coords, PyObject *__pyx_v_forced, double __pyx_v_tolerance, PyObject *__pyx_v_lookback); /* proto */
-static PyObject *__pyx_pf_9fontTools_6varLib_3iup_8_rot_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_l, PyObject *__pyx_v_k); /* proto */
-static PyObject *__pyx_pf_9fontTools_6varLib_3iup_10_rot_set(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s, PyObject *__pyx_v_k, PyObject *__pyx_v_n); /* proto */
-static PyObject *__pyx_pf_9fontTools_6varLib_3iup_20iup_contour_optimize_genexpr(PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_pf_9fontTools_6varLib_3iup_20iup_contour_optimize_3genexpr(PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_pf_9fontTools_6varLib_3iup_12iup_contour_optimize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_deltas, PyObject *__pyx_v_coords, PyObject *__pyx_v_tolerance); /* proto */
-static PyObject *__pyx_pf_9fontTools_6varLib_3iup_14iup_delta_optimize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_deltas, PyObject *__pyx_v_coords, PyObject *__pyx_v_ends, PyObject *__pyx_v_tolerance); /* proto */
-static PyObject *__pyx_tp_new_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_float_0_0;
-static PyObject *__pyx_int_0;
-static PyObject *__pyx_int_1;
-static PyObject *__pyx_int_2;
-static PyObject *__pyx_int_3;
-static PyObject *__pyx_int_4;
-static PyObject *__pyx_int_8;
-static PyObject *__pyx_int_neg_1;
-static PyObject *__pyx_tuple_;
-static PyObject *__pyx_tuple__2;
-static PyObject *__pyx_tuple__3;
-static PyObject *__pyx_tuple__5;
-static PyObject *__pyx_tuple__7;
-static PyObject *__pyx_tuple__9;
-static PyObject *__pyx_tuple__10;
-static PyObject *__pyx_tuple__12;
-static PyObject *__pyx_tuple__14;
-static PyObject *__pyx_tuple__16;
-static PyObject *__pyx_tuple__18;
-static PyObject *__pyx_tuple__19;
-static PyObject *__pyx_tuple__21;
-static PyObject *__pyx_codeobj__4;
-static PyObject *__pyx_codeobj__6;
-static PyObject *__pyx_codeobj__8;
-static PyObject *__pyx_codeobj__11;
-static PyObject *__pyx_codeobj__13;
-static PyObject *__pyx_codeobj__15;
-static PyObject *__pyx_codeobj__17;
-static PyObject *__pyx_codeobj__20;
-/* Late includes */
-
-/* "fontTools/varLib/iup.py":53
- * d=cython.double,
- * )
- * def iup_segment( # <<<<<<<<<<<<<<
- * coords: _PointSegment, rc1: _Point, rd1: _Delta, rc2: _Point, rd2: _Delta
- * ): # -> _DeltaSegment:
- */
-
-static PyObject *__pyx_f_9fontTools_6varLib_3iup_iup_segment(PyObject *__pyx_v_coords, PyObject *__pyx_v_rc1, PyObject *__pyx_v_rd1, PyObject *__pyx_v_rc2, PyObject *__pyx_v_rd2) {
- int __pyx_v_j;
- int __pyx_v_n;
- double __pyx_v_x1;
- double __pyx_v_x2;
- double __pyx_v_d1;
- double __pyx_v_d2;
- double __pyx_v_scale;
- double __pyx_v_x;
- double __pyx_v_d;
- PyObject *__pyx_v_out_arrays = NULL;
- PyObject *__pyx_v_out = NULL;
- PyObject *__pyx_v_pair = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- Py_ssize_t __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_t_4;
- double __pyx_t_5;
- double __pyx_t_6;
- double __pyx_t_7;
- double __pyx_t_8;
- int __pyx_t_9;
- Py_ssize_t __pyx_t_10;
- PyObject *__pyx_t_11 = NULL;
- int __pyx_t_12;
- PyObject *(*__pyx_t_13)(PyObject *);
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("iup_segment", 0);
-
- /* "fontTools/varLib/iup.py":62
- * # rc1 = reference coord 1
- * # rd1 = reference delta 1
- * out_arrays = [None, None] # <<<<<<<<<<<<<<
- * for j in 0, 1:
- * out_arrays[j] = out = []
- */
- __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(Py_None);
- __Pyx_GIVEREF(Py_None);
- PyList_SET_ITEM(__pyx_t_1, 0, Py_None);
- __Pyx_INCREF(Py_None);
- __Pyx_GIVEREF(Py_None);
- PyList_SET_ITEM(__pyx_t_1, 1, Py_None);
- __pyx_v_out_arrays = ((PyObject*)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "fontTools/varLib/iup.py":63
- * # rd1 = reference delta 1
- * out_arrays = [None, None]
- * for j in 0, 1: # <<<<<<<<<<<<<<
- * out_arrays[j] = out = []
- * x1, x2, d1, d2 = rc1[j], rc2[j], rd1[j], rd2[j]
- */
- __pyx_t_1 = __pyx_tuple_; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
- for (;;) {
- if (__pyx_t_2 >= 2) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 63, __pyx_L1_error)
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 63, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- #endif
- __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_j = __pyx_t_4;
-
- /* "fontTools/varLib/iup.py":64
- * out_arrays = [None, None]
- * for j in 0, 1:
- * out_arrays[j] = out = [] # <<<<<<<<<<<<<<
- * x1, x2, d1, d2 = rc1[j], rc2[j], rd1[j], rd2[j]
- *
- */
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- if (unlikely(__Pyx_SetItemInt(__pyx_v_out_arrays, __pyx_v_j, __pyx_t_3, int, 1, __Pyx_PyInt_From_int, 1, 1, 1) < 0)) __PYX_ERR(0, 64, __pyx_L1_error)
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_XDECREF_SET(__pyx_v_out, __pyx_t_3);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "fontTools/varLib/iup.py":65
- * for j in 0, 1:
- * out_arrays[j] = out = []
- * x1, x2, d1, d2 = rc1[j], rc2[j], rd1[j], rd2[j] # <<<<<<<<<<<<<<
- *
- * if x1 == x2:
- */
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_rc1, __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_rc2, __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_rd1, __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_rd2, __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_x1 = __pyx_t_5;
- __pyx_v_x2 = __pyx_t_6;
- __pyx_v_d1 = __pyx_t_7;
- __pyx_v_d2 = __pyx_t_8;
-
- /* "fontTools/varLib/iup.py":67
- * x1, x2, d1, d2 = rc1[j], rc2[j], rd1[j], rd2[j]
- *
- * if x1 == x2: # <<<<<<<<<<<<<<
- * n = len(coords)
- * if d1 == d2:
- */
- __pyx_t_9 = ((__pyx_v_x1 == __pyx_v_x2) != 0);
- if (__pyx_t_9) {
-
- /* "fontTools/varLib/iup.py":68
- *
- * if x1 == x2:
- * n = len(coords) # <<<<<<<<<<<<<<
- * if d1 == d2:
- * out.extend([d1] * n)
- */
- __pyx_t_10 = PyObject_Length(__pyx_v_coords); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 68, __pyx_L1_error)
- __pyx_v_n = __pyx_t_10;
-
- /* "fontTools/varLib/iup.py":69
- * if x1 == x2:
- * n = len(coords)
- * if d1 == d2: # <<<<<<<<<<<<<<
- * out.extend([d1] * n)
- * else:
- */
- __pyx_t_9 = ((__pyx_v_d1 == __pyx_v_d2) != 0);
- if (__pyx_t_9) {
-
- /* "fontTools/varLib/iup.py":70
- * n = len(coords)
- * if d1 == d2:
- * out.extend([d1] * n) # <<<<<<<<<<<<<<
- * else:
- * out.extend([0] * n)
- */
- __pyx_t_3 = PyFloat_FromDouble(__pyx_v_d1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_11 = PyList_New(1 * ((__pyx_v_n<0) ? 0:__pyx_v_n)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 70, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- { Py_ssize_t __pyx_temp;
- for (__pyx_temp=0; __pyx_temp < __pyx_v_n; __pyx_temp++) {
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- PyList_SET_ITEM(__pyx_t_11, __pyx_temp, __pyx_t_3);
- }
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_12 = __Pyx_PyList_Extend(__pyx_v_out, __pyx_t_11); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 70, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "fontTools/varLib/iup.py":69
- * if x1 == x2:
- * n = len(coords)
- * if d1 == d2: # <<<<<<<<<<<<<<
- * out.extend([d1] * n)
- * else:
- */
- goto __pyx_L6;
- }
-
- /* "fontTools/varLib/iup.py":72
- * out.extend([d1] * n)
- * else:
- * out.extend([0] * n) # <<<<<<<<<<<<<<
- * continue
- *
- */
- /*else*/ {
- __pyx_t_11 = PyList_New(1 * ((__pyx_v_n<0) ? 0:__pyx_v_n)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 72, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- { Py_ssize_t __pyx_temp;
- for (__pyx_temp=0; __pyx_temp < __pyx_v_n; __pyx_temp++) {
- __Pyx_INCREF(__pyx_int_0);
- __Pyx_GIVEREF(__pyx_int_0);
- PyList_SET_ITEM(__pyx_t_11, __pyx_temp, __pyx_int_0);
- }
- }
- __pyx_t_12 = __Pyx_PyList_Extend(__pyx_v_out, __pyx_t_11); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 72, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- }
- __pyx_L6:;
-
- /* "fontTools/varLib/iup.py":73
- * else:
- * out.extend([0] * n)
- * continue # <<<<<<<<<<<<<<
- *
- * if x1 > x2:
- */
- goto __pyx_L3_continue;
-
- /* "fontTools/varLib/iup.py":67
- * x1, x2, d1, d2 = rc1[j], rc2[j], rd1[j], rd2[j]
- *
- * if x1 == x2: # <<<<<<<<<<<<<<
- * n = len(coords)
- * if d1 == d2:
- */
- }
-
- /* "fontTools/varLib/iup.py":75
- * continue
- *
- * if x1 > x2: # <<<<<<<<<<<<<<
- * x1, x2 = x2, x1
- * d1, d2 = d2, d1
- */
- __pyx_t_9 = ((__pyx_v_x1 > __pyx_v_x2) != 0);
- if (__pyx_t_9) {
-
- /* "fontTools/varLib/iup.py":76
- *
- * if x1 > x2:
- * x1, x2 = x2, x1 # <<<<<<<<<<<<<<
- * d1, d2 = d2, d1
- *
- */
- __pyx_t_8 = __pyx_v_x2;
- __pyx_t_7 = __pyx_v_x1;
- __pyx_v_x1 = __pyx_t_8;
- __pyx_v_x2 = __pyx_t_7;
-
- /* "fontTools/varLib/iup.py":77
- * if x1 > x2:
- * x1, x2 = x2, x1
- * d1, d2 = d2, d1 # <<<<<<<<<<<<<<
- *
- * # x1 < x2
- */
- __pyx_t_7 = __pyx_v_d2;
- __pyx_t_8 = __pyx_v_d1;
- __pyx_v_d1 = __pyx_t_7;
- __pyx_v_d2 = __pyx_t_8;
-
- /* "fontTools/varLib/iup.py":75
- * continue
- *
- * if x1 > x2: # <<<<<<<<<<<<<<
- * x1, x2 = x2, x1
- * d1, d2 = d2, d1
- */
- }
-
- /* "fontTools/varLib/iup.py":80
- *
- * # x1 < x2
- * scale = (d2 - d1) / (x2 - x1) # <<<<<<<<<<<<<<
- * for pair in coords:
- * x = pair[j]
- */
- __pyx_t_8 = (__pyx_v_d2 - __pyx_v_d1);
- __pyx_t_7 = (__pyx_v_x2 - __pyx_v_x1);
- if (unlikely(__pyx_t_7 == 0)) {
- PyErr_SetString(PyExc_ZeroDivisionError, "float division");
- __PYX_ERR(0, 80, __pyx_L1_error)
- }
- __pyx_v_scale = (__pyx_t_8 / __pyx_t_7);
-
- /* "fontTools/varLib/iup.py":81
- * # x1 < x2
- * scale = (d2 - d1) / (x2 - x1)
- * for pair in coords: # <<<<<<<<<<<<<<
- * x = pair[j]
- *
- */
- if (likely(PyList_CheckExact(__pyx_v_coords)) || PyTuple_CheckExact(__pyx_v_coords)) {
- __pyx_t_11 = __pyx_v_coords; __Pyx_INCREF(__pyx_t_11); __pyx_t_10 = 0;
- __pyx_t_13 = NULL;
- } else {
- __pyx_t_10 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_v_coords); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 81, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_13 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 81, __pyx_L1_error)
- }
- for (;;) {
- if (likely(!__pyx_t_13)) {
- if (likely(PyList_CheckExact(__pyx_t_11))) {
- if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_11)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 81, __pyx_L1_error)
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_11, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- #endif
- } else {
- if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 81, __pyx_L1_error)
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_11, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- #endif
- }
- } else {
- __pyx_t_3 = __pyx_t_13(__pyx_t_11);
- if (unlikely(!__pyx_t_3)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 81, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_3);
- }
- __Pyx_XDECREF_SET(__pyx_v_pair, __pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "fontTools/varLib/iup.py":82
- * scale = (d2 - d1) / (x2 - x1)
- * for pair in coords:
- * x = pair[j] # <<<<<<<<<<<<<<
- *
- * if x <= x1:
- */
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pair, __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_x = __pyx_t_7;
-
- /* "fontTools/varLib/iup.py":84
- * x = pair[j]
- *
- * if x <= x1: # <<<<<<<<<<<<<<
- * d = d1
- * elif x >= x2:
- */
- __pyx_t_9 = ((__pyx_v_x <= __pyx_v_x1) != 0);
- if (__pyx_t_9) {
-
- /* "fontTools/varLib/iup.py":85
- *
- * if x <= x1:
- * d = d1 # <<<<<<<<<<<<<<
- * elif x >= x2:
- * d = d2
- */
- __pyx_v_d = __pyx_v_d1;
-
- /* "fontTools/varLib/iup.py":84
- * x = pair[j]
- *
- * if x <= x1: # <<<<<<<<<<<<<<
- * d = d1
- * elif x >= x2:
- */
- goto __pyx_L10;
- }
-
- /* "fontTools/varLib/iup.py":86
- * if x <= x1:
- * d = d1
- * elif x >= x2: # <<<<<<<<<<<<<<
- * d = d2
- * else:
- */
- __pyx_t_9 = ((__pyx_v_x >= __pyx_v_x2) != 0);
- if (__pyx_t_9) {
-
- /* "fontTools/varLib/iup.py":87
- * d = d1
- * elif x >= x2:
- * d = d2 # <<<<<<<<<<<<<<
- * else:
- * # Interpolate
- */
- __pyx_v_d = __pyx_v_d2;
-
- /* "fontTools/varLib/iup.py":86
- * if x <= x1:
- * d = d1
- * elif x >= x2: # <<<<<<<<<<<<<<
- * d = d2
- * else:
- */
- goto __pyx_L10;
- }
-
- /* "fontTools/varLib/iup.py":90
- * else:
- * # Interpolate
- * d = d1 + (x - x1) * scale # <<<<<<<<<<<<<<
- *
- * out.append(d)
- */
- /*else*/ {
- __pyx_v_d = (__pyx_v_d1 + ((__pyx_v_x - __pyx_v_x1) * __pyx_v_scale));
- }
- __pyx_L10:;
-
- /* "fontTools/varLib/iup.py":92
- * d = d1 + (x - x1) * scale
- *
- * out.append(d) # <<<<<<<<<<<<<<
- *
- * return zip(*out_arrays)
- */
- __pyx_t_3 = PyFloat_FromDouble(__pyx_v_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_out, __pyx_t_3); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 92, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "fontTools/varLib/iup.py":81
- * # x1 < x2
- * scale = (d2 - d1) / (x2 - x1)
- * for pair in coords: # <<<<<<<<<<<<<<
- * x = pair[j]
- *
- */
- }
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "fontTools/varLib/iup.py":63
- * # rd1 = reference delta 1
- * out_arrays = [None, None]
- * for j in 0, 1: # <<<<<<<<<<<<<<
- * out_arrays[j] = out = []
- * x1, x2, d1, d2 = rc1[j], rc2[j], rd1[j], rd2[j]
- */
- __pyx_L3_continue:;
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "fontTools/varLib/iup.py":94
- * out.append(d)
- *
- * return zip(*out_arrays) # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PySequence_Tuple(__pyx_v_out_arrays); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 94, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_r = __pyx_t_11;
- __pyx_t_11 = 0;
- goto __pyx_L0;
-
- /* "fontTools/varLib/iup.py":53
- * d=cython.double,
- * )
- * def iup_segment( # <<<<<<<<<<<<<<
- * coords: _PointSegment, rc1: _Point, rd1: _Delta, rc2: _Point, rd2: _Delta
- * ): # -> _DeltaSegment:
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_11);
- __Pyx_AddTraceback("fontTools.varLib.iup.iup_segment", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_out_arrays);
- __Pyx_XDECREF(__pyx_v_out);
- __Pyx_XDECREF(__pyx_v_pair);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "fontTools/varLib/iup.py":97
- *
- *
- * def iup_contour(deltas: _DeltaOrNoneSegment, coords: _PointSegment) -> _DeltaSegment: # <<<<<<<<<<<<<<
- * """For the contour given in `coords`, interpolate any missing
- * delta values in delta vector `deltas`.
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_9fontTools_6varLib_3iup_1iup_contour(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9fontTools_6varLib_3iup_iup_contour[] = "iup_contour(deltas: _DeltaOrNoneSegment, coords: _PointSegment) -> _DeltaSegment\nFor the contour given in `coords`, interpolate any missing\n delta values in delta vector `deltas`.\n\n Returns fully filled-out delta vector.";
-static PyMethodDef __pyx_mdef_9fontTools_6varLib_3iup_1iup_contour = {"iup_contour", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9fontTools_6varLib_3iup_1iup_contour, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9fontTools_6varLib_3iup_iup_contour};
-static PyObject *__pyx_pw_9fontTools_6varLib_3iup_1iup_contour(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_deltas = 0;
- PyObject *__pyx_v_coords = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("iup_contour (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_deltas,&__pyx_n_s_coords,0};
- PyObject* values[2] = {0,0};
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- CYTHON_FALLTHROUGH;
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- CYTHON_FALLTHROUGH;
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_deltas)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- CYTHON_FALLTHROUGH;
- case 1:
- if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("iup_contour", 1, 2, 2, 1); __PYX_ERR(0, 97, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iup_contour") < 0)) __PYX_ERR(0, 97, __pyx_L3_error)
- }
- } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
- goto __pyx_L5_argtuple_error;
- } else {
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- }
- __pyx_v_deltas = values[0];
- __pyx_v_coords = values[1];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("iup_contour", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 97, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("fontTools.varLib.iup.iup_contour", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9fontTools_6varLib_3iup_iup_contour(__pyx_self, __pyx_v_deltas, __pyx_v_coords);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_9fontTools_6varLib_3iup_iup_contour(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_deltas, PyObject *__pyx_v_coords) {
- PyObject *__pyx_v_n = NULL;
- PyObject *__pyx_v_indices = NULL;
- PyObject *__pyx_v_out = NULL;
- PyObject *__pyx_v_it = NULL;
- PyObject *__pyx_v_start = NULL;
- PyObject *__pyx_v_i1 = NULL;
- PyObject *__pyx_v_i2 = NULL;
- PyObject *__pyx_v_ri1 = NULL;
- PyObject *__pyx_v_ri2 = NULL;
- PyObject *__pyx_v_end = NULL;
- PyObject *__pyx_7genexpr__pyx_v_i = NULL;
- PyObject *__pyx_7genexpr__pyx_v_v = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- Py_ssize_t __pyx_t_1;
- Py_ssize_t __pyx_t_2;
- int __pyx_t_3;
- int __pyx_t_4;
- PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
- PyObject *(*__pyx_t_8)(PyObject *);
- PyObject *__pyx_t_9 = NULL;
- PyObject *__pyx_t_10 = NULL;
- PyObject *__pyx_t_11 = NULL;
- int __pyx_t_12;
- PyObject *__pyx_t_13 = NULL;
- Py_ssize_t __pyx_t_14;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("iup_contour", 0);
-
- /* "fontTools/varLib/iup.py":103
- * Returns fully filled-out delta vector."""
- *
- * assert len(deltas) == len(coords) # <<<<<<<<<<<<<<
- * if None not in deltas:
- * return deltas
- */
- #ifndef CYTHON_WITHOUT_ASSERTIONS
- if (unlikely(__pyx_assertions_enabled())) {
- __pyx_t_1 = PyObject_Length(__pyx_v_deltas); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 103, __pyx_L1_error)
- __pyx_t_2 = PyObject_Length(__pyx_v_coords); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 103, __pyx_L1_error)
- if (unlikely(!((__pyx_t_1 == __pyx_t_2) != 0))) {
- PyErr_SetNone(PyExc_AssertionError);
- __PYX_ERR(0, 103, __pyx_L1_error)
- }
- }
- #endif
-
- /* "fontTools/varLib/iup.py":104
- *
- * assert len(deltas) == len(coords)
- * if None not in deltas: # <<<<<<<<<<<<<<
- * return deltas
- *
- */
- __pyx_t_3 = (__Pyx_PySequence_ContainsTF(Py_None, __pyx_v_deltas, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 104, __pyx_L1_error)
- __pyx_t_4 = (__pyx_t_3 != 0);
- if (__pyx_t_4) {
-
- /* "fontTools/varLib/iup.py":105
- * assert len(deltas) == len(coords)
- * if None not in deltas:
- * return deltas # <<<<<<<<<<<<<<
- *
- * n = len(deltas)
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_deltas);
- __pyx_r = __pyx_v_deltas;
- goto __pyx_L0;
-
- /* "fontTools/varLib/iup.py":104
- *
- * assert len(deltas) == len(coords)
- * if None not in deltas: # <<<<<<<<<<<<<<
- * return deltas
- *
- */
- }
-
- /* "fontTools/varLib/iup.py":107
- * return deltas
- *
- * n = len(deltas) # <<<<<<<<<<<<<<
- * # indices of points with explicit deltas
- * indices = [i for i, v in enumerate(deltas) if v is not None]
- */
- __pyx_t_2 = PyObject_Length(__pyx_v_deltas); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 107, __pyx_L1_error)
- __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_v_n = __pyx_t_5;
- __pyx_t_5 = 0;
-
- /* "fontTools/varLib/iup.py":109
- * n = len(deltas)
- * # indices of points with explicit deltas
- * indices = [i for i, v in enumerate(deltas) if v is not None] # <<<<<<<<<<<<<<
- * if not indices:
- * # All deltas are None. Return 0,0 for all.
- */
- { /* enter inner scope */
- __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 109, __pyx_L6_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(__pyx_int_0);
- __pyx_t_6 = __pyx_int_0;
- if (likely(PyList_CheckExact(__pyx_v_deltas)) || PyTuple_CheckExact(__pyx_v_deltas)) {
- __pyx_t_7 = __pyx_v_deltas; __Pyx_INCREF(__pyx_t_7); __pyx_t_2 = 0;
- __pyx_t_8 = NULL;
- } else {
- __pyx_t_2 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_deltas); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 109, __pyx_L6_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 109, __pyx_L6_error)
- }
- for (;;) {
- if (likely(!__pyx_t_8)) {
- if (likely(PyList_CheckExact(__pyx_t_7))) {
- if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_7)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_9 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_2); __Pyx_INCREF(__pyx_t_9); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 109, __pyx_L6_error)
- #else
- __pyx_t_9 = PySequence_ITEM(__pyx_t_7, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 109, __pyx_L6_error)
- __Pyx_GOTREF(__pyx_t_9);
- #endif
- } else {
- if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_2); __Pyx_INCREF(__pyx_t_9); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 109, __pyx_L6_error)
- #else
- __pyx_t_9 = PySequence_ITEM(__pyx_t_7, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 109, __pyx_L6_error)
- __Pyx_GOTREF(__pyx_t_9);
- #endif
- }
- } else {
- __pyx_t_9 = __pyx_t_8(__pyx_t_7);
- if (unlikely(!__pyx_t_9)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 109, __pyx_L6_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_9);
- }
- __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_v, __pyx_t_9);
- __pyx_t_9 = 0;
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_i, __pyx_t_6);
- __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_6, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 109, __pyx_L6_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_6);
- __pyx_t_6 = __pyx_t_9;
- __pyx_t_9 = 0;
- __pyx_t_4 = (__pyx_7genexpr__pyx_v_v != Py_None);
- __pyx_t_3 = (__pyx_t_4 != 0);
- if (__pyx_t_3) {
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_7genexpr__pyx_v_i))) __PYX_ERR(0, 109, __pyx_L6_error)
- }
- }
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_XDECREF(__pyx_7genexpr__pyx_v_i); __pyx_7genexpr__pyx_v_i = 0;
- __Pyx_XDECREF(__pyx_7genexpr__pyx_v_v); __pyx_7genexpr__pyx_v_v = 0;
- goto __pyx_L10_exit_scope;
- __pyx_L6_error:;
- __Pyx_XDECREF(__pyx_7genexpr__pyx_v_i); __pyx_7genexpr__pyx_v_i = 0;
- __Pyx_XDECREF(__pyx_7genexpr__pyx_v_v); __pyx_7genexpr__pyx_v_v = 0;
- goto __pyx_L1_error;
- __pyx_L10_exit_scope:;
- } /* exit inner scope */
- __pyx_v_indices = ((PyObject*)__pyx_t_5);
- __pyx_t_5 = 0;
-
- /* "fontTools/varLib/iup.py":110
- * # indices of points with explicit deltas
- * indices = [i for i, v in enumerate(deltas) if v is not None]
- * if not indices: # <<<<<<<<<<<<<<
- * # All deltas are None. Return 0,0 for all.
- * return [(0, 0)] * n
- */
- __pyx_t_3 = (PyList_GET_SIZE(__pyx_v_indices) != 0);
- __pyx_t_4 = ((!__pyx_t_3) != 0);
- if (__pyx_t_4) {
-
- /* "fontTools/varLib/iup.py":112
- * if not indices:
- * # All deltas are None. Return 0,0 for all.
- * return [(0, 0)] * n # <<<<<<<<<<<<<<
- *
- * out = []
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(__pyx_tuple__2);
- __Pyx_GIVEREF(__pyx_tuple__2);
- PyList_SET_ITEM(__pyx_t_5, 0, __pyx_tuple__2);
- { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_5, __pyx_v_n); if (unlikely(!__pyx_temp)) __PYX_ERR(0, 112, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_temp);
- __Pyx_DECREF(__pyx_t_5);
- __pyx_t_5 = __pyx_temp;
- }
- __pyx_r = __pyx_t_5;
- __pyx_t_5 = 0;
- goto __pyx_L0;
-
- /* "fontTools/varLib/iup.py":110
- * # indices of points with explicit deltas
- * indices = [i for i, v in enumerate(deltas) if v is not None]
- * if not indices: # <<<<<<<<<<<<<<
- * # All deltas are None. Return 0,0 for all.
- * return [(0, 0)] * n
- */
- }
-
- /* "fontTools/varLib/iup.py":114
- * return [(0, 0)] * n
- *
- * out = [] # <<<<<<<<<<<<<<
- * it = iter(indices)
- * start = next(it)
- */
- __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 114, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_v_out = ((PyObject*)__pyx_t_5);
- __pyx_t_5 = 0;
-
- /* "fontTools/varLib/iup.py":115
- *
- * out = []
- * it = iter(indices) # <<<<<<<<<<<<<<
- * start = next(it)
- * if start != 0:
- */
- __pyx_t_5 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 115, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_v_it = __pyx_t_5;
- __pyx_t_5 = 0;
-
- /* "fontTools/varLib/iup.py":116
- * out = []
- * it = iter(indices)
- * start = next(it) # <<<<<<<<<<<<<<
- * if start != 0:
- * # Initial segment that wraps around
- */
- __pyx_t_5 = __Pyx_PyIter_Next(__pyx_v_it); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 116, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_v_start = __pyx_t_5;
- __pyx_t_5 = 0;
-
- /* "fontTools/varLib/iup.py":117
- * it = iter(indices)
- * start = next(it)
- * if start != 0: # <<<<<<<<<<<<<<
- * # Initial segment that wraps around
- * i1, i2, ri1, ri2 = 0, start, start, indices[-1]
- */
- __pyx_t_5 = __Pyx_PyInt_NeObjC(__pyx_v_start, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 117, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 117, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_4) {
-
- /* "fontTools/varLib/iup.py":119
- * if start != 0:
- * # Initial segment that wraps around
- * i1, i2, ri1, ri2 = 0, start, start, indices[-1] # <<<<<<<<<<<<<<
- * out.extend(
- * iup_segment(
- */
- __pyx_t_5 = __pyx_int_0;
- __Pyx_INCREF(__pyx_t_5);
- __pyx_t_6 = __pyx_v_start;
- __Pyx_INCREF(__pyx_t_6);
- __pyx_t_7 = __pyx_v_start;
- __Pyx_INCREF(__pyx_t_7);
- __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_indices, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 119, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_v_i1 = __pyx_t_5;
- __pyx_t_5 = 0;
- __pyx_v_i2 = __pyx_t_6;
- __pyx_t_6 = 0;
- __pyx_v_ri1 = __pyx_t_7;
- __pyx_t_7 = 0;
- __pyx_v_ri2 = __pyx_t_9;
- __pyx_t_9 = 0;
-
- /* "fontTools/varLib/iup.py":122
- * out.extend(
- * iup_segment(
- * coords[i1:i2], coords[ri1], deltas[ri1], coords[ri2], deltas[ri2] # <<<<<<<<<<<<<<
- * )
- * )
- */
- __pyx_t_9 = __Pyx_PyObject_GetSlice(__pyx_v_coords, 0, 0, &__pyx_v_i1, &__pyx_v_i2, NULL, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 122, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_coords, __pyx_v_ri1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 122, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_deltas, __pyx_v_ri1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 122, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_coords, __pyx_v_ri2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_v_deltas, __pyx_v_ri2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 122, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
-
- /* "fontTools/varLib/iup.py":121
- * i1, i2, ri1, ri2 = 0, start, start, indices[-1]
- * out.extend(
- * iup_segment( # <<<<<<<<<<<<<<
- * coords[i1:i2], coords[ri1], deltas[ri1], coords[ri2], deltas[ri2]
- * )
- */
- __pyx_t_11 = __pyx_f_9fontTools_6varLib_3iup_iup_segment(__pyx_t_9, __pyx_t_7, __pyx_t_6, __pyx_t_5, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 121, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-
- /* "fontTools/varLib/iup.py":120
- * # Initial segment that wraps around
- * i1, i2, ri1, ri2 = 0, start, start, indices[-1]
- * out.extend( # <<<<<<<<<<<<<<
- * iup_segment(
- * coords[i1:i2], coords[ri1], deltas[ri1], coords[ri2], deltas[ri2]
- */
- __pyx_t_12 = __Pyx_PyList_Extend(__pyx_v_out, __pyx_t_11); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 120, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "fontTools/varLib/iup.py":117
- * it = iter(indices)
- * start = next(it)
- * if start != 0: # <<<<<<<<<<<<<<
- * # Initial segment that wraps around
- * i1, i2, ri1, ri2 = 0, start, start, indices[-1]
- */
- }
-
- /* "fontTools/varLib/iup.py":125
- * )
- * )
- * out.append(deltas[start]) # <<<<<<<<<<<<<<
- * for end in it:
- * if end - start > 1:
- */
- __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_v_deltas, __pyx_v_start); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 125, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_out, __pyx_t_11); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 125, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "fontTools/varLib/iup.py":126
- * )
- * out.append(deltas[start])
- * for end in it: # <<<<<<<<<<<<<<
- * if end - start > 1:
- * i1, i2, ri1, ri2 = start + 1, end, start, end
- */
- if (likely(PyList_CheckExact(__pyx_v_it)) || PyTuple_CheckExact(__pyx_v_it)) {
- __pyx_t_11 = __pyx_v_it; __Pyx_INCREF(__pyx_t_11); __pyx_t_2 = 0;
- __pyx_t_8 = NULL;
- } else {
- __pyx_t_2 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_v_it); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 126, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_8 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 126, __pyx_L1_error)
- }
- for (;;) {
- if (likely(!__pyx_t_8)) {
- if (likely(PyList_CheckExact(__pyx_t_11))) {
- if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_11)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_10 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_2); __Pyx_INCREF(__pyx_t_10); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 126, __pyx_L1_error)
- #else
- __pyx_t_10 = PySequence_ITEM(__pyx_t_11, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 126, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- #endif
- } else {
- if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_2); __Pyx_INCREF(__pyx_t_10); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 126, __pyx_L1_error)
- #else
- __pyx_t_10 = PySequence_ITEM(__pyx_t_11, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 126, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- #endif
- }
- } else {
- __pyx_t_10 = __pyx_t_8(__pyx_t_11);
- if (unlikely(!__pyx_t_10)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 126, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_10);
- }
- __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_10);
- __pyx_t_10 = 0;
-
- /* "fontTools/varLib/iup.py":127
- * out.append(deltas[start])
- * for end in it:
- * if end - start > 1: # <<<<<<<<<<<<<<
- * i1, i2, ri1, ri2 = start + 1, end, start, end
- * out.extend(
- */
- __pyx_t_10 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 127, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_5 = PyObject_RichCompare(__pyx_t_10, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 127, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 127, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_4) {
-
- /* "fontTools/varLib/iup.py":128
- * for end in it:
- * if end - start > 1:
- * i1, i2, ri1, ri2 = start + 1, end, start, end # <<<<<<<<<<<<<<
- * out.extend(
- * iup_segment(
- */
- __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_start, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 128, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_10 = __pyx_v_end;
- __Pyx_INCREF(__pyx_t_10);
- __pyx_t_6 = __pyx_v_start;
- __Pyx_INCREF(__pyx_t_6);
- __pyx_t_7 = __pyx_v_end;
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_XDECREF_SET(__pyx_v_i1, __pyx_t_5);
- __pyx_t_5 = 0;
- __Pyx_XDECREF_SET(__pyx_v_i2, __pyx_t_10);
- __pyx_t_10 = 0;
- __Pyx_XDECREF_SET(__pyx_v_ri1, __pyx_t_6);
- __pyx_t_6 = 0;
- __Pyx_XDECREF_SET(__pyx_v_ri2, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "fontTools/varLib/iup.py":131
- * out.extend(
- * iup_segment(
- * coords[i1:i2], coords[ri1], deltas[ri1], coords[ri2], deltas[ri2] # <<<<<<<<<<<<<<
- * )
- * )
- */
- __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_coords, 0, 0, &__pyx_v_i1, &__pyx_v_i2, NULL, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 131, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_coords, __pyx_v_ri1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 131, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_v_deltas, __pyx_v_ri1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 131, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_coords, __pyx_v_ri2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 131, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_deltas, __pyx_v_ri2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 131, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
-
- /* "fontTools/varLib/iup.py":130
- * i1, i2, ri1, ri2 = start + 1, end, start, end
- * out.extend(
- * iup_segment( # <<<<<<<<<<<<<<
- * coords[i1:i2], coords[ri1], deltas[ri1], coords[ri2], deltas[ri2]
- * )
- */
- __pyx_t_13 = __pyx_f_9fontTools_6varLib_3iup_iup_segment(__pyx_t_7, __pyx_t_6, __pyx_t_10, __pyx_t_5, __pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 130, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-
- /* "fontTools/varLib/iup.py":129
- * if end - start > 1:
- * i1, i2, ri1, ri2 = start + 1, end, start, end
- * out.extend( # <<<<<<<<<<<<<<
- * iup_segment(
- * coords[i1:i2], coords[ri1], deltas[ri1], coords[ri2], deltas[ri2]
- */
- __pyx_t_12 = __Pyx_PyList_Extend(__pyx_v_out, __pyx_t_13); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 129, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-
- /* "fontTools/varLib/iup.py":127
- * out.append(deltas[start])
- * for end in it:
- * if end - start > 1: # <<<<<<<<<<<<<<
- * i1, i2, ri1, ri2 = start + 1, end, start, end
- * out.extend(
- */
- }
-
- /* "fontTools/varLib/iup.py":134
- * )
- * )
- * out.append(deltas[end]) # <<<<<<<<<<<<<<
- * start = end
- * if start != n - 1:
- */
- __pyx_t_13 = __Pyx_PyObject_GetItem(__pyx_v_deltas, __pyx_v_end); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 134, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_out, __pyx_t_13); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 134, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-
- /* "fontTools/varLib/iup.py":135
- * )
- * out.append(deltas[end])
- * start = end # <<<<<<<<<<<<<<
- * if start != n - 1:
- * # Final segment that wraps around
- */
- __Pyx_INCREF(__pyx_v_end);
- __Pyx_DECREF_SET(__pyx_v_start, __pyx_v_end);
-
- /* "fontTools/varLib/iup.py":126
- * )
- * out.append(deltas[start])
- * for end in it: # <<<<<<<<<<<<<<
- * if end - start > 1:
- * i1, i2, ri1, ri2 = start + 1, end, start, end
- */
- }
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
- /* "fontTools/varLib/iup.py":136
- * out.append(deltas[end])
- * start = end
- * if start != n - 1: # <<<<<<<<<<<<<<
- * # Final segment that wraps around
- * i1, i2, ri1, ri2 = start + 1, n, start, indices[0]
- */
- __pyx_t_11 = __Pyx_PyInt_SubtractObjC(__pyx_v_n, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 136, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_13 = PyObject_RichCompare(__pyx_v_start, __pyx_t_11, Py_NE); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 136, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 136, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- if (__pyx_t_4) {
-
- /* "fontTools/varLib/iup.py":138
- * if start != n - 1:
- * # Final segment that wraps around
- * i1, i2, ri1, ri2 = start + 1, n, start, indices[0] # <<<<<<<<<<<<<<
- * out.extend(
- * iup_segment(
- */
- __pyx_t_13 = __Pyx_PyInt_AddObjC(__pyx_v_start, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 138, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_11 = __pyx_v_n;
- __Pyx_INCREF(__pyx_t_11);
- __pyx_t_9 = __pyx_v_start;
- __Pyx_INCREF(__pyx_t_9);
- __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_indices, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 138, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_XDECREF_SET(__pyx_v_i1, __pyx_t_13);
- __pyx_t_13 = 0;
- __Pyx_XDECREF_SET(__pyx_v_i2, __pyx_t_11);
- __pyx_t_11 = 0;
- __Pyx_XDECREF_SET(__pyx_v_ri1, __pyx_t_9);
- __pyx_t_9 = 0;
- __Pyx_XDECREF_SET(__pyx_v_ri2, __pyx_t_5);
- __pyx_t_5 = 0;
-
- /* "fontTools/varLib/iup.py":141
- * out.extend(
- * iup_segment(
- * coords[i1:i2], coords[ri1], deltas[ri1], coords[ri2], deltas[ri2] # <<<<<<<<<<<<<<
- * )
- * )
- */
- __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_coords, 0, 0, &__pyx_v_i1, &__pyx_v_i2, NULL, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_coords, __pyx_v_ri1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 141, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_v_deltas, __pyx_v_ri1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 141, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_13 = __Pyx_PyObject_GetItem(__pyx_v_coords, __pyx_v_ri2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 141, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_v_deltas, __pyx_v_ri2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 141, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
-
- /* "fontTools/varLib/iup.py":140
- * i1, i2, ri1, ri2 = start + 1, n, start, indices[0]
- * out.extend(
- * iup_segment( # <<<<<<<<<<<<<<
- * coords[i1:i2], coords[ri1], deltas[ri1], coords[ri2], deltas[ri2]
- * )
- */
- __pyx_t_6 = __pyx_f_9fontTools_6varLib_3iup_iup_segment(__pyx_t_5, __pyx_t_9, __pyx_t_11, __pyx_t_13, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 140, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-
- /* "fontTools/varLib/iup.py":139
- * # Final segment that wraps around
- * i1, i2, ri1, ri2 = start + 1, n, start, indices[0]
- * out.extend( # <<<<<<<<<<<<<<
- * iup_segment(
- * coords[i1:i2], coords[ri1], deltas[ri1], coords[ri2], deltas[ri2]
- */
- __pyx_t_12 = __Pyx_PyList_Extend(__pyx_v_out, __pyx_t_6); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 139, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "fontTools/varLib/iup.py":136
- * out.append(deltas[end])
- * start = end
- * if start != n - 1: # <<<<<<<<<<<<<<
- * # Final segment that wraps around
- * i1, i2, ri1, ri2 = start + 1, n, start, indices[0]
- */
- }
-
- /* "fontTools/varLib/iup.py":145
- * )
- *
- * assert len(deltas) == len(out), (len(deltas), len(out)) # <<<<<<<<<<<<<<
- * return out
- *
- */
- #ifndef CYTHON_WITHOUT_ASSERTIONS
- if (unlikely(__pyx_assertions_enabled())) {
- __pyx_t_2 = PyObject_Length(__pyx_v_deltas); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 145, __pyx_L1_error)
- __pyx_t_1 = PyList_GET_SIZE(__pyx_v_out); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 145, __pyx_L1_error)
- if (unlikely(!((__pyx_t_2 == __pyx_t_1) != 0))) {
- __pyx_t_14 = PyObject_Length(__pyx_v_deltas); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 145, __pyx_L1_error)
- __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 145, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_14 = PyList_GET_SIZE(__pyx_v_out); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 145, __pyx_L1_error)
- __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 145, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 145, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_10);
- __pyx_t_6 = 0;
- __pyx_t_10 = 0;
- __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 145, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_13);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13);
- __pyx_t_13 = 0;
- PyErr_SetObject(PyExc_AssertionError, __pyx_t_10);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __PYX_ERR(0, 145, __pyx_L1_error)
- }
- }
- #endif
-
- /* "fontTools/varLib/iup.py":146
- *
- * assert len(deltas) == len(out), (len(deltas), len(out))
- * return out # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_out);
- __pyx_r = __pyx_v_out;
- goto __pyx_L0;
-
- /* "fontTools/varLib/iup.py":97
- *
- *
- * def iup_contour(deltas: _DeltaOrNoneSegment, coords: _PointSegment) -> _DeltaSegment: # <<<<<<<<<<<<<<
- * """For the contour given in `coords`, interpolate any missing
- * delta values in delta vector `deltas`.
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_9);
- __Pyx_XDECREF(__pyx_t_10);
- __Pyx_XDECREF(__pyx_t_11);
- __Pyx_XDECREF(__pyx_t_13);
- __Pyx_AddTraceback("fontTools.varLib.iup.iup_contour", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_n);
- __Pyx_XDECREF(__pyx_v_indices);
- __Pyx_XDECREF(__pyx_v_out);
- __Pyx_XDECREF(__pyx_v_it);
- __Pyx_XDECREF(__pyx_v_start);
- __Pyx_XDECREF(__pyx_v_i1);
- __Pyx_XDECREF(__pyx_v_i2);
- __Pyx_XDECREF(__pyx_v_ri1);
- __Pyx_XDECREF(__pyx_v_ri2);
- __Pyx_XDECREF(__pyx_v_end);
- __Pyx_XDECREF(__pyx_7genexpr__pyx_v_i);
- __Pyx_XDECREF(__pyx_7genexpr__pyx_v_v);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "fontTools/varLib/iup.py":149
- *
- *
- * def iup_delta( # <<<<<<<<<<<<<<
- * deltas: _DeltaOrNoneSegment, coords: _PointSegment, ends: _Endpoints
- * ) -> _DeltaSegment:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_9fontTools_6varLib_3iup_3iup_delta(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9fontTools_6varLib_3iup_2iup_delta[] = "iup_delta(deltas: _DeltaOrNoneSegment, coords: _PointSegment, ends: _Endpoints) -> _DeltaSegment\nFor the outline given in `coords`, with contour endpoints given\n in sorted increasing order in `ends`, interpolate any missing\n delta values in delta vector `deltas`.\n\n Returns fully filled-out delta vector.";
-static PyMethodDef __pyx_mdef_9fontTools_6varLib_3iup_3iup_delta = {"iup_delta", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9fontTools_6varLib_3iup_3iup_delta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9fontTools_6varLib_3iup_2iup_delta};
-static PyObject *__pyx_pw_9fontTools_6varLib_3iup_3iup_delta(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_deltas = 0;
- PyObject *__pyx_v_coords = 0;
- PyObject *__pyx_v_ends = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("iup_delta (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_deltas,&__pyx_n_s_coords,&__pyx_n_s_ends,0};
- PyObject* values[3] = {0,0,0};
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- CYTHON_FALLTHROUGH;
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- CYTHON_FALLTHROUGH;
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- CYTHON_FALLTHROUGH;
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_deltas)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- CYTHON_FALLTHROUGH;
- case 1:
- if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("iup_delta", 1, 3, 3, 1); __PYX_ERR(0, 149, __pyx_L3_error)
- }
- CYTHON_FALLTHROUGH;
- case 2:
- if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ends)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("iup_delta", 1, 3, 3, 2); __PYX_ERR(0, 149, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iup_delta") < 0)) __PYX_ERR(0, 149, __pyx_L3_error)
- }
- } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
- goto __pyx_L5_argtuple_error;
- } else {
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- }
- __pyx_v_deltas = values[0];
- __pyx_v_coords = values[1];
- __pyx_v_ends = values[2];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("iup_delta", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 149, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("fontTools.varLib.iup.iup_delta", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9fontTools_6varLib_3iup_2iup_delta(__pyx_self, __pyx_v_deltas, __pyx_v_coords, __pyx_v_ends);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_9fontTools_6varLib_3iup_2iup_delta(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_deltas, PyObject *__pyx_v_coords, PyObject *__pyx_v_ends) {
- PyObject *__pyx_v_n = NULL;
- PyObject *__pyx_v_out = NULL;
- PyObject *__pyx_v_start = NULL;
- PyObject *__pyx_v_end = NULL;
- PyObject *__pyx_v_contour = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_t_4;
- int __pyx_t_5;
- Py_ssize_t __pyx_t_6;
- PyObject *__pyx_t_7 = NULL;
- PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
- PyObject *(*__pyx_t_10)(PyObject *);
- PyObject *__pyx_t_11 = NULL;
- int __pyx_t_12;
- PyObject *__pyx_t_13 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("iup_delta", 0);
- __Pyx_INCREF(__pyx_v_ends);
-
- /* "fontTools/varLib/iup.py":158
- * Returns fully filled-out delta vector."""
- *
- * assert sorted(ends) == ends and len(coords) == (ends[-1] + 1 if ends else 0) + 4 # <<<<<<<<<<<<<<
- * n = len(coords)
- * ends = ends + [n - 4, n - 3, n - 2, n - 1]
- */
- #ifndef CYTHON_WITHOUT_ASSERTIONS
- if (unlikely(__pyx_assertions_enabled())) {
- __pyx_t_3 = PySequence_List(__pyx_v_ends); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_4 = PyList_Sort(__pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 158, __pyx_L1_error)
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_v_ends, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 158, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_5) {
- } else {
- __pyx_t_1 = __pyx_t_5;
- goto __pyx_L3_bool_binop_done;
- }
- __pyx_t_6 = PyObject_Length(__pyx_v_coords); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 158, __pyx_L1_error)
- __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_ends); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 158, __pyx_L1_error)
- if (__pyx_t_5) {
- __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_ends, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 158, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 158, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_2 = __pyx_t_8;
- __pyx_t_8 = 0;
- } else {
- __Pyx_INCREF(__pyx_int_0);
- __pyx_t_2 = __pyx_int_0;
- }
- __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_4, 4, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 158, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 158, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_1 = __pyx_t_5;
- __pyx_L3_bool_binop_done:;
- if (unlikely(!__pyx_t_1)) {
- PyErr_SetNone(PyExc_AssertionError);
- __PYX_ERR(0, 158, __pyx_L1_error)
- }
- }
- #endif
-
- /* "fontTools/varLib/iup.py":159
- *
- * assert sorted(ends) == ends and len(coords) == (ends[-1] + 1 if ends else 0) + 4
- * n = len(coords) # <<<<<<<<<<<<<<
- * ends = ends + [n - 4, n - 3, n - 2, n - 1]
- * out = []
- */
- __pyx_t_6 = PyObject_Length(__pyx_v_coords); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 159, __pyx_L1_error)
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_v_n = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "fontTools/varLib/iup.py":160
- * assert sorted(ends) == ends and len(coords) == (ends[-1] + 1 if ends else 0) + 4
- * n = len(coords)
- * ends = ends + [n - 4, n - 3, n - 2, n - 1] # <<<<<<<<<<<<<<
- * out = []
- * start = 0
- */
- __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_n, __pyx_int_4, 4, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_8 = __Pyx_PyInt_SubtractObjC(__pyx_v_n, __pyx_int_3, 3, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 160, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_n, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = __Pyx_PyInt_SubtractObjC(__pyx_v_n, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 160, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_9 = PyList_New(4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 160, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_2);
- PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_8);
- PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_3);
- PyList_SET_ITEM(__pyx_t_9, 2, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_7);
- PyList_SET_ITEM(__pyx_t_9, 3, __pyx_t_7);
- __pyx_t_2 = 0;
- __pyx_t_8 = 0;
- __pyx_t_3 = 0;
- __pyx_t_7 = 0;
- __pyx_t_7 = PyNumber_Add(__pyx_v_ends, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 160, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF_SET(__pyx_v_ends, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "fontTools/varLib/iup.py":161
- * n = len(coords)
- * ends = ends + [n - 4, n - 3, n - 2, n - 1]
- * out = [] # <<<<<<<<<<<<<<
- * start = 0
- * for end in ends:
- */
- __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 161, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_v_out = ((PyObject*)__pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "fontTools/varLib/iup.py":162
- * ends = ends + [n - 4, n - 3, n - 2, n - 1]
- * out = []
- * start = 0 # <<<<<<<<<<<<<<
- * for end in ends:
- * end += 1
- */
- __Pyx_INCREF(__pyx_int_0);
- __pyx_v_start = __pyx_int_0;
-
- /* "fontTools/varLib/iup.py":163
- * out = []
- * start = 0
- * for end in ends: # <<<<<<<<<<<<<<
- * end += 1
- * contour = iup_contour(deltas[start:end], coords[start:end])
- */
- if (likely(PyList_CheckExact(__pyx_v_ends)) || PyTuple_CheckExact(__pyx_v_ends)) {
- __pyx_t_7 = __pyx_v_ends; __Pyx_INCREF(__pyx_t_7); __pyx_t_6 = 0;
- __pyx_t_10 = NULL;
- } else {
- __pyx_t_6 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_ends); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 163, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_10 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 163, __pyx_L1_error)
- }
- for (;;) {
- if (likely(!__pyx_t_10)) {
- if (likely(PyList_CheckExact(__pyx_t_7))) {
- if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_7)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_9 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 163, __pyx_L1_error)
- #else
- __pyx_t_9 = PySequence_ITEM(__pyx_t_7, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 163, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- #endif
- } else {
- if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 163, __pyx_L1_error)
- #else
- __pyx_t_9 = PySequence_ITEM(__pyx_t_7, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 163, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- #endif
- }
- } else {
- __pyx_t_9 = __pyx_t_10(__pyx_t_7);
- if (unlikely(!__pyx_t_9)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 163, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_9);
- }
- __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_9);
- __pyx_t_9 = 0;
-
- /* "fontTools/varLib/iup.py":164
- * start = 0
- * for end in ends:
- * end += 1 # <<<<<<<<<<<<<<
- * contour = iup_contour(deltas[start:end], coords[start:end])
- * out.extend(contour)
- */
- __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_v_end, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 164, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF_SET(__pyx_v_end, __pyx_t_9);
- __pyx_t_9 = 0;
-
- /* "fontTools/varLib/iup.py":165
- * for end in ends:
- * end += 1
- * contour = iup_contour(deltas[start:end], coords[start:end]) # <<<<<<<<<<<<<<
- * out.extend(contour)
- * start = end
- */
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_iup_contour); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_v_deltas, 0, 0, &__pyx_v_start, &__pyx_v_end, NULL, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 165, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_coords, 0, 0, &__pyx_v_start, &__pyx_v_end, NULL, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_11 = NULL;
- __pyx_t_12 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_11)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_11);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_3, function);
- __pyx_t_12 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_8, __pyx_t_2};
- __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 165, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_8, __pyx_t_2};
- __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 165, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- } else
- #endif
- {
- __pyx_t_13 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 165, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- if (__pyx_t_11) {
- __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, __pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, __pyx_t_2);
- __pyx_t_8 = 0;
- __pyx_t_2 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 165, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_XDECREF_SET(__pyx_v_contour, __pyx_t_9);
- __pyx_t_9 = 0;
-
- /* "fontTools/varLib/iup.py":166
- * end += 1
- * contour = iup_contour(deltas[start:end], coords[start:end])
- * out.extend(contour) # <<<<<<<<<<<<<<
- * start = end
- *
- */
- __pyx_t_4 = __Pyx_PyList_Extend(__pyx_v_out, __pyx_v_contour); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 166, __pyx_L1_error)
-
- /* "fontTools/varLib/iup.py":167
- * contour = iup_contour(deltas[start:end], coords[start:end])
- * out.extend(contour)
- * start = end # <<<<<<<<<<<<<<
- *
- * return out
- */
- __Pyx_INCREF(__pyx_v_end);
- __Pyx_DECREF_SET(__pyx_v_start, __pyx_v_end);
-
- /* "fontTools/varLib/iup.py":163
- * out = []
- * start = 0
- * for end in ends: # <<<<<<<<<<<<<<
- * end += 1
- * contour = iup_contour(deltas[start:end], coords[start:end])
- */
- }
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "fontTools/varLib/iup.py":169
- * start = end
- *
- * return out # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_out);
- __pyx_r = __pyx_v_out;
- goto __pyx_L0;
-
- /* "fontTools/varLib/iup.py":149
- *
- *
- * def iup_delta( # <<<<<<<<<<<<<<
- * deltas: _DeltaOrNoneSegment, coords: _PointSegment, ends: _Endpoints
- * ) -> _DeltaSegment:
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_9);
- __Pyx_XDECREF(__pyx_t_11);
- __Pyx_XDECREF(__pyx_t_13);
- __Pyx_AddTraceback("fontTools.varLib.iup.iup_delta", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_n);
- __Pyx_XDECREF(__pyx_v_out);
- __Pyx_XDECREF(__pyx_v_start);
- __Pyx_XDECREF(__pyx_v_end);
- __Pyx_XDECREF(__pyx_v_contour);
- __Pyx_XDECREF(__pyx_v_ends);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-static PyObject *__pyx_gb_9fontTools_6varLib_3iup_18can_iup_in_between_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
-
-/* "fontTools/varLib/iup.py":203
- *
- * return all(
- * abs(complex(x - p, y - q)) <= tolerance # <<<<<<<<<<<<<<
- * for (x, y), (p, q) in zip(deltas, interp)
- * )
- */
-
-static PyObject *__pyx_pf_9fontTools_6varLib_3iup_18can_iup_in_between_genexpr(PyObject *__pyx_self) {
- struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr *__pyx_cur_scope;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("genexpr", 0);
- __pyx_cur_scope = (struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr *)__pyx_tp_new_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr(__pyx_ptype_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL);
- if (unlikely(!__pyx_cur_scope)) {
- __pyx_cur_scope = ((struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr *)Py_None);
- __Pyx_INCREF(Py_None);
- __PYX_ERR(0, 203, __pyx_L1_error)
- } else {
- __Pyx_GOTREF(__pyx_cur_scope);
- }
- __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between *) __pyx_self;
- __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
- __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
- {
- __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_9fontTools_6varLib_3iup_18can_iup_in_between_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_can_iup_in_between_locals_genexp, __pyx_n_s_fontTools_varLib_iup); if (unlikely(!gen)) __PYX_ERR(0, 203, __pyx_L1_error)
- __Pyx_DECREF(__pyx_cur_scope);
- __Pyx_RefNannyFinishContext();
- return (PyObject *) gen;
- }
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_AddTraceback("fontTools.varLib.iup.can_iup_in_between.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_gb_9fontTools_6varLib_3iup_18can_iup_in_between_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
-{
- struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr *)__pyx_generator->closure);
- PyObject *__pyx_r = NULL;
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- Py_ssize_t __pyx_t_3;
- PyObject *(*__pyx_t_4)(PyObject *);
- PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
- PyObject *(*__pyx_t_8)(PyObject *);
- PyObject *__pyx_t_9 = NULL;
- PyObject *__pyx_t_10 = NULL;
- double __pyx_t_11;
- double __pyx_t_12;
- int __pyx_t_13;
- int __pyx_t_14;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("genexpr", 0);
- switch (__pyx_generator->resume_label) {
- case 0: goto __pyx_L3_first_run;
- default: /* CPython raises the right error here */
- __Pyx_RefNannyFinishContext();
- return NULL;
- }
- __pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 203, __pyx_L1_error)
-
- /* "fontTools/varLib/iup.py":204
- * return all(
- * abs(complex(x - p, y - q)) <= tolerance
- * for (x, y), (p, q) in zip(deltas, interp) # <<<<<<<<<<<<<<
- * )
- *
- */
- if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_deltas)) { __Pyx_RaiseClosureNameError("deltas"); __PYX_ERR(0, 204, __pyx_L1_error) }
- if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_interp)) { __Pyx_RaiseClosureNameError("interp"); __PYX_ERR(0, 204, __pyx_L1_error) }
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_deltas);
- __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_deltas);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_deltas);
- __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_interp);
- __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_interp);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_interp);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
- __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
- __pyx_t_4 = NULL;
- } else {
- __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- for (;;) {
- if (likely(!__pyx_t_4)) {
- if (likely(PyList_CheckExact(__pyx_t_1))) {
- if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 204, __pyx_L1_error)
- #else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- #endif
- } else {
- if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 204, __pyx_L1_error)
- #else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- #endif
- }
- } else {
- __pyx_t_2 = __pyx_t_4(__pyx_t_1);
- if (unlikely(!__pyx_t_2)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 204, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_2);
- }
- if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
- PyObject* sequence = __pyx_t_2;
- Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
- if (unlikely(size != 2)) {
- if (size > 2) __Pyx_RaiseTooManyValuesError(2);
- else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- __PYX_ERR(0, 204, __pyx_L1_error)
- }
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_5 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_6);
- #else
- __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 204, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- #endif
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 204, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
- index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_5);
- index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_6);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 204, __pyx_L1_error)
- __pyx_t_8 = NULL;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- goto __pyx_L7_unpacking_done;
- __pyx_L6_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_8 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 204, __pyx_L1_error)
- __pyx_L7_unpacking_done:;
- }
- if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
- PyObject* sequence = __pyx_t_5;
- Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
- if (unlikely(size != 2)) {
- if (size > 2) __Pyx_RaiseTooManyValuesError(2);
- else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- __PYX_ERR(0, 204, __pyx_L1_error)
- }
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_7 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_9 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(__pyx_t_9);
- #else
- __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 204, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 204, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- #endif
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_10 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 204, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_8 = Py_TYPE(__pyx_t_10)->tp_iternext;
- index = 0; __pyx_t_7 = __pyx_t_8(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L8_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_7);
- index = 1; __pyx_t_9 = __pyx_t_8(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L8_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_9);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_10), 2) < 0) __PYX_ERR(0, 204, __pyx_L1_error)
- __pyx_t_8 = NULL;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- goto __pyx_L9_unpacking_done;
- __pyx_L8_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_8 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 204, __pyx_L1_error)
- __pyx_L9_unpacking_done:;
- }
- __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_cur_scope->__pyx_v_x = __pyx_t_11;
- __pyx_cur_scope->__pyx_v_y = __pyx_t_12;
- if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
- PyObject* sequence = __pyx_t_6;
- Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
- if (unlikely(size != 2)) {
- if (size > 2) __Pyx_RaiseTooManyValuesError(2);
- else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- __PYX_ERR(0, 204, __pyx_L1_error)
- }
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_9 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_9);
- __Pyx_INCREF(__pyx_t_7);
- #else
- __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 204, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 204, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- #endif
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_10 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 204, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_8 = Py_TYPE(__pyx_t_10)->tp_iternext;
- index = 0; __pyx_t_9 = __pyx_t_8(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L10_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_9);
- index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L10_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_7);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_10), 2) < 0) __PYX_ERR(0, 204, __pyx_L1_error)
- __pyx_t_8 = NULL;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- goto __pyx_L11_unpacking_done;
- __pyx_L10_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_8 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 204, __pyx_L1_error)
- __pyx_L11_unpacking_done:;
- }
- __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_cur_scope->__pyx_v_p = __pyx_t_12;
- __pyx_cur_scope->__pyx_v_q = __pyx_t_11;
-
- /* "fontTools/varLib/iup.py":203
- *
- * return all(
- * abs(complex(x - p, y - q)) <= tolerance # <<<<<<<<<<<<<<
- * for (x, y), (p, q) in zip(deltas, interp)
- * )
- */
- __pyx_t_2 = PyFloat_FromDouble((__pyx_cur_scope->__pyx_v_x - __pyx_cur_scope->__pyx_v_p)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = PyFloat_FromDouble((__pyx_cur_scope->__pyx_v_y - __pyx_cur_scope->__pyx_v_q)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 203, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 203, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
- __pyx_t_2 = 0;
- __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyComplex_Type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 203, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyNumber_Absolute(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 203, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_tolerance); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 203, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 203, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_14 = ((!__pyx_t_13) != 0);
- if (__pyx_t_14) {
-
- /* "fontTools/varLib/iup.py":202
- * deltas = deltas[i + 1 : j]
- *
- * return all( # <<<<<<<<<<<<<<
- * abs(complex(x - p, y - q)) <= tolerance
- * for (x, y), (p, q) in zip(deltas, interp)
- */
- __Pyx_XDECREF(__pyx_r);
-
- /* "fontTools/varLib/iup.py":203
- *
- * return all(
- * abs(complex(x - p, y - q)) <= tolerance # <<<<<<<<<<<<<<
- * for (x, y), (p, q) in zip(deltas, interp)
- * )
- */
- __Pyx_INCREF(Py_False);
- __pyx_r = Py_False;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- goto __pyx_L0;
- }
-
- /* "fontTools/varLib/iup.py":204
- * return all(
- * abs(complex(x - p, y - q)) <= tolerance
- * for (x, y), (p, q) in zip(deltas, interp) # <<<<<<<<<<<<<<
- * )
- *
- */
- }
- /*else*/ {
-
- /* "fontTools/varLib/iup.py":202
- * deltas = deltas[i + 1 : j]
- *
- * return all( # <<<<<<<<<<<<<<
- * abs(complex(x - p, y - q)) <= tolerance
- * for (x, y), (p, q) in zip(deltas, interp)
- */
- __Pyx_XDECREF(__pyx_r);
-
- /* "fontTools/varLib/iup.py":203
- *
- * return all(
- * abs(complex(x - p, y - q)) <= tolerance # <<<<<<<<<<<<<<
- * for (x, y), (p, q) in zip(deltas, interp)
- * )
- */
- __Pyx_INCREF(Py_True);
- __pyx_r = Py_True;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- goto __pyx_L0;
- }
-
- /* "fontTools/varLib/iup.py":204
- * return all(
- * abs(complex(x - p, y - q)) <= tolerance
- * for (x, y), (p, q) in zip(deltas, interp) # <<<<<<<<<<<<<<
- * )
- *
- */
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
-
- /* "fontTools/varLib/iup.py":203
- *
- * return all(
- * abs(complex(x - p, y - q)) <= tolerance # <<<<<<<<<<<<<<
- * for (x, y), (p, q) in zip(deltas, interp)
- * )
- */
-
- /* function exit code */
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_9);
- __Pyx_XDECREF(__pyx_t_10);
- __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- #if !CYTHON_USE_EXC_INFO_STACK
- __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
- #endif
- __pyx_generator->resume_label = -1;
- __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "fontTools/varLib/iup.py":187
- * )
- * @cython.returns(int)
- * def can_iup_in_between( # <<<<<<<<<<<<<<
- * deltas: _DeltaSegment,
- * coords: _PointSegment,
- */
-
-static CYTHON_INLINE int __pyx_f_9fontTools_6varLib_3iup_can_iup_in_between(PyObject *__pyx_v_deltas, PyObject *__pyx_v_coords, int __pyx_v_i, int __pyx_v_j, CYTHON_UNUSED double __pyx_v_tolerance) {
- struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between *__pyx_cur_scope;
- PyObject *__pyx_gb_9fontTools_6varLib_3iup_18can_iup_in_between_2generator = 0;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- int __pyx_t_7;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("can_iup_in_between", 0);
- __pyx_cur_scope = (struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between *)__pyx_tp_new_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between(__pyx_ptype_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between, __pyx_empty_tuple, NULL);
- if (unlikely(!__pyx_cur_scope)) {
- __pyx_cur_scope = ((struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between *)Py_None);
- __Pyx_INCREF(Py_None);
- __PYX_ERR(0, 187, __pyx_L1_error)
- } else {
- __Pyx_GOTREF(__pyx_cur_scope);
- }
- __pyx_cur_scope->__pyx_v_deltas = __pyx_v_deltas;
- __Pyx_INCREF(__pyx_cur_scope->__pyx_v_deltas);
- __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_deltas);
-
- /* "fontTools/varLib/iup.py":198
- * provided error tolerance."""
- *
- * assert j - i >= 2 # <<<<<<<<<<<<<<
- * interp = iup_segment(coords[i + 1 : j], coords[i], deltas[i], coords[j], deltas[j])
- * deltas = deltas[i + 1 : j]
- */
- #ifndef CYTHON_WITHOUT_ASSERTIONS
- if (unlikely(__pyx_assertions_enabled())) {
- if (unlikely(!(((__pyx_v_j - __pyx_v_i) >= 2) != 0))) {
- PyErr_SetNone(PyExc_AssertionError);
- __PYX_ERR(0, 198, __pyx_L1_error)
- }
- }
- #endif
-
- /* "fontTools/varLib/iup.py":199
- *
- * assert j - i >= 2
- * interp = iup_segment(coords[i + 1 : j], coords[i], deltas[i], coords[j], deltas[j]) # <<<<<<<<<<<<<<
- * deltas = deltas[i + 1 : j]
- *
- */
- __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_coords, (__pyx_v_i + 1), __pyx_v_j, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_coords, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_deltas, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 199, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_coords, __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 199, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_deltas, __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 199, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __pyx_f_9fontTools_6varLib_3iup_iup_segment(__pyx_t_1, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 199, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GIVEREF(__pyx_t_6);
- __pyx_cur_scope->__pyx_v_interp = __pyx_t_6;
- __pyx_t_6 = 0;
-
- /* "fontTools/varLib/iup.py":200
- * assert j - i >= 2
- * interp = iup_segment(coords[i + 1 : j], coords[i], deltas[i], coords[j], deltas[j])
- * deltas = deltas[i + 1 : j] # <<<<<<<<<<<<<<
- *
- * return all(
- */
- __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_deltas, (__pyx_v_i + 1), __pyx_v_j, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 200, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_deltas);
- __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_deltas, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- __pyx_t_6 = 0;
-
- /* "fontTools/varLib/iup.py":203
- *
- * return all(
- * abs(complex(x - p, y - q)) <= tolerance # <<<<<<<<<<<<<<
- * for (x, y), (p, q) in zip(deltas, interp)
- * )
- */
- __pyx_t_6 = __pyx_pf_9fontTools_6varLib_3iup_18can_iup_in_between_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 203, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = __Pyx_Generator_Next(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 203, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 203, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_r = __pyx_t_7;
- goto __pyx_L0;
-
- /* "fontTools/varLib/iup.py":187
- * )
- * @cython.returns(int)
- * def can_iup_in_between( # <<<<<<<<<<<<<<
- * deltas: _DeltaSegment,
- * coords: _PointSegment,
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_WriteUnraisable("fontTools.varLib.iup.can_iup_in_between", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_gb_9fontTools_6varLib_3iup_18can_iup_in_between_2generator);
- __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "fontTools/varLib/iup.py":218
- * forced=set,
- * )
- * def _iup_contour_bound_forced_set( # <<<<<<<<<<<<<<
- * deltas: _DeltaSegment, coords: _PointSegment, tolerance: Real = 0
- * ) -> set:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_9fontTools_6varLib_3iup_5_iup_contour_bound_forced_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9fontTools_6varLib_3iup_4_iup_contour_bound_forced_set[] = "_iup_contour_bound_forced_set(deltas: _DeltaSegment, coords: _PointSegment, tolerance: Real = 0) -> set\nThe forced set is a conservative set of points on the contour that must be encoded\n explicitly (ie. cannot be interpolated). Calculating this set allows for significantly\n speeding up the dynamic-programming, as well as resolve circularity in DP.\n\n The set is precise; that is, if an index is in the returned set, then there is no way\n that IUP can generate delta for that point, given `coords` and `deltas`.\n ";
-static PyMethodDef __pyx_mdef_9fontTools_6varLib_3iup_5_iup_contour_bound_forced_set = {"_iup_contour_bound_forced_set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9fontTools_6varLib_3iup_5_iup_contour_bound_forced_set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9fontTools_6varLib_3iup_4_iup_contour_bound_forced_set};
-static PyObject *__pyx_pw_9fontTools_6varLib_3iup_5_iup_contour_bound_forced_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_deltas = 0;
- PyObject *__pyx_v_coords = 0;
- PyObject *__pyx_v_tolerance = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("_iup_contour_bound_forced_set (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_deltas,&__pyx_n_s_coords,&__pyx_n_s_tolerance,0};
- PyObject* values[3] = {0,0,0};
- values[2] = ((PyObject *)((PyObject *)__pyx_int_0));
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- CYTHON_FALLTHROUGH;
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- CYTHON_FALLTHROUGH;
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- CYTHON_FALLTHROUGH;
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_deltas)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- CYTHON_FALLTHROUGH;
- case 1:
- if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("_iup_contour_bound_forced_set", 0, 2, 3, 1); __PYX_ERR(0, 218, __pyx_L3_error)
- }
- CYTHON_FALLTHROUGH;
- case 2:
- if (kw_args > 0) {
- PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tolerance);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_iup_contour_bound_forced_set") < 0)) __PYX_ERR(0, 218, __pyx_L3_error)
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- CYTHON_FALLTHROUGH;
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_deltas = values[0];
- __pyx_v_coords = values[1];
- __pyx_v_tolerance = values[2];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_iup_contour_bound_forced_set", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 218, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("fontTools.varLib.iup._iup_contour_bound_forced_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9fontTools_6varLib_3iup_4_iup_contour_bound_forced_set(__pyx_self, __pyx_v_deltas, __pyx_v_coords, __pyx_v_tolerance);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_9fontTools_6varLib_3iup_4_iup_contour_bound_forced_set(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_deltas, PyObject *__pyx_v_coords, PyObject *__pyx_v_tolerance) {
- double __pyx_v_cj;
- double __pyx_v_dj;
- double __pyx_v_lcj;
- double __pyx_v_ldj;
- double __pyx_v_ncj;
- double __pyx_v_ndj;
- int __pyx_v_force;
- PyObject *__pyx_v_forced = 0;
- PyObject *__pyx_v_n = NULL;
- PyObject *__pyx_v_i = NULL;
- PyObject *__pyx_v_ld = NULL;
- PyObject *__pyx_v_lc = NULL;
- PyObject *__pyx_v_d = NULL;
- PyObject *__pyx_v_c = NULL;
- PyObject *__pyx_v_nd = NULL;
- PyObject *__pyx_v_nc = NULL;
- PyObject *__pyx_v_j = NULL;
- double __pyx_v_c1;
- double __pyx_v_c2;
- double __pyx_v_d1;
- double __pyx_v_d2;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- Py_ssize_t __pyx_t_1;
- Py_ssize_t __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *(*__pyx_t_5)(PyObject *);
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
- double __pyx_t_8;
- int __pyx_t_9;
- double __pyx_t_10;
- int __pyx_t_11;
- double __pyx_t_12;
- PyObject *__pyx_t_13 = NULL;
- PyObject *__pyx_t_14 = NULL;
- PyObject *__pyx_t_15 = NULL;
- int __pyx_t_16;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("_iup_contour_bound_forced_set", 0);
-
- /* "fontTools/varLib/iup.py":228
- * that IUP can generate delta for that point, given `coords` and `deltas`.
- * """
- * assert len(deltas) == len(coords) # <<<<<<<<<<<<<<
- *
- * n = len(deltas)
- */
- #ifndef CYTHON_WITHOUT_ASSERTIONS
- if (unlikely(__pyx_assertions_enabled())) {
- __pyx_t_1 = PyObject_Length(__pyx_v_deltas); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 228, __pyx_L1_error)
- __pyx_t_2 = PyObject_Length(__pyx_v_coords); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 228, __pyx_L1_error)
- if (unlikely(!((__pyx_t_1 == __pyx_t_2) != 0))) {
- PyErr_SetNone(PyExc_AssertionError);
- __PYX_ERR(0, 228, __pyx_L1_error)
- }
- }
- #endif
-
- /* "fontTools/varLib/iup.py":230
- * assert len(deltas) == len(coords)
- *
- * n = len(deltas) # <<<<<<<<<<<<<<
- * forced = set()
- * # Track "last" and "next" points on the contour as we sweep.
- */
- __pyx_t_2 = PyObject_Length(__pyx_v_deltas); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 230, __pyx_L1_error)
- __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_v_n = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "fontTools/varLib/iup.py":231
- *
- * n = len(deltas)
- * forced = set() # <<<<<<<<<<<<<<
- * # Track "last" and "next" points on the contour as we sweep.
- * for i in range(len(deltas) - 1, -1, -1):
- */
- __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_v_forced = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "fontTools/varLib/iup.py":233
- * forced = set()
- * # Track "last" and "next" points on the contour as we sweep.
- * for i in range(len(deltas) - 1, -1, -1): # <<<<<<<<<<<<<<
- * ld, lc = deltas[i - 1], coords[i - 1]
- * d, c = deltas[i], coords[i]
- */
- __pyx_t_2 = PyObject_Length(__pyx_v_deltas); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 233, __pyx_L1_error)
- __pyx_t_3 = PyInt_FromSsize_t((__pyx_t_2 - 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
- __Pyx_INCREF(__pyx_int_neg_1);
- __Pyx_GIVEREF(__pyx_int_neg_1);
- PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_neg_1);
- __Pyx_INCREF(__pyx_int_neg_1);
- __Pyx_GIVEREF(__pyx_int_neg_1);
- PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_int_neg_1);
- __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
- __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
- __pyx_t_5 = NULL;
- } else {
- __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 233, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- for (;;) {
- if (likely(!__pyx_t_5)) {
- if (likely(PyList_CheckExact(__pyx_t_4))) {
- if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 233, __pyx_L1_error)
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- #endif
- } else {
- if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 233, __pyx_L1_error)
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- #endif
- }
- } else {
- __pyx_t_3 = __pyx_t_5(__pyx_t_4);
- if (unlikely(!__pyx_t_3)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 233, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_3);
- }
- __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "fontTools/varLib/iup.py":234
- * # Track "last" and "next" points on the contour as we sweep.
- * for i in range(len(deltas) - 1, -1, -1):
- * ld, lc = deltas[i - 1], coords[i - 1] # <<<<<<<<<<<<<<
- * d, c = deltas[i], coords[i]
- * nd, nc = deltas[i - n + 1], coords[i - n + 1]
- */
- __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_deltas, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_coords, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_XDECREF_SET(__pyx_v_ld, __pyx_t_6);
- __pyx_t_6 = 0;
- __Pyx_XDECREF_SET(__pyx_v_lc, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "fontTools/varLib/iup.py":235
- * for i in range(len(deltas) - 1, -1, -1):
- * ld, lc = deltas[i - 1], coords[i - 1]
- * d, c = deltas[i], coords[i] # <<<<<<<<<<<<<<
- * nd, nc = deltas[i - n + 1], coords[i - n + 1]
- *
- */
- __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_deltas, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_coords, __pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_7);
- __pyx_t_7 = 0;
- __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_6);
- __pyx_t_6 = 0;
-
- /* "fontTools/varLib/iup.py":236
- * ld, lc = deltas[i - 1], coords[i - 1]
- * d, c = deltas[i], coords[i]
- * nd, nc = deltas[i - n + 1], coords[i - n + 1] # <<<<<<<<<<<<<<
- *
- * for j in (0, 1): # For X and for Y
- */
- __pyx_t_6 = PyNumber_Subtract(__pyx_v_i, __pyx_v_n); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_6, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_deltas, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = PyNumber_Subtract(__pyx_v_i, __pyx_v_n); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_coords, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_XDECREF_SET(__pyx_v_nd, __pyx_t_6);
- __pyx_t_6 = 0;
- __Pyx_XDECREF_SET(__pyx_v_nc, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "fontTools/varLib/iup.py":238
- * nd, nc = deltas[i - n + 1], coords[i - n + 1]
- *
- * for j in (0, 1): # For X and for Y # <<<<<<<<<<<<<<
- * cj = c[j]
- * dj = d[j]
- */
- __pyx_t_7 = __pyx_tuple_; __Pyx_INCREF(__pyx_t_7); __pyx_t_1 = 0;
- for (;;) {
- if (__pyx_t_1 >= 2) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 238, __pyx_L1_error)
- #else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- #endif
- __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_6);
- __pyx_t_6 = 0;
-
- /* "fontTools/varLib/iup.py":239
- *
- * for j in (0, 1): # For X and for Y
- * cj = c[j] # <<<<<<<<<<<<<<
- * dj = d[j]
- * lcj = lc[j]
- */
- __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_c, __pyx_v_j); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 239, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_cj = __pyx_t_8;
-
- /* "fontTools/varLib/iup.py":240
- * for j in (0, 1): # For X and for Y
- * cj = c[j]
- * dj = d[j] # <<<<<<<<<<<<<<
- * lcj = lc[j]
- * ldj = ld[j]
- */
- __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_d, __pyx_v_j); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 240, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_dj = __pyx_t_8;
-
- /* "fontTools/varLib/iup.py":241
- * cj = c[j]
- * dj = d[j]
- * lcj = lc[j] # <<<<<<<<<<<<<<
- * ldj = ld[j]
- * ncj = nc[j]
- */
- __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_lc, __pyx_v_j); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 241, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 241, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_lcj = __pyx_t_8;
-
- /* "fontTools/varLib/iup.py":242
- * dj = d[j]
- * lcj = lc[j]
- * ldj = ld[j] # <<<<<<<<<<<<<<
- * ncj = nc[j]
- * ndj = nd[j]
- */
- __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_ld, __pyx_v_j); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 242, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_ldj = __pyx_t_8;
-
- /* "fontTools/varLib/iup.py":243
- * lcj = lc[j]
- * ldj = ld[j]
- * ncj = nc[j] # <<<<<<<<<<<<<<
- * ndj = nd[j]
- *
- */
- __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_nc, __pyx_v_j); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 243, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_ncj = __pyx_t_8;
-
- /* "fontTools/varLib/iup.py":244
- * ldj = ld[j]
- * ncj = nc[j]
- * ndj = nd[j] # <<<<<<<<<<<<<<
- *
- * if lcj <= ncj:
- */
- __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_nd, __pyx_v_j); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 244, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 244, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_ndj = __pyx_t_8;
-
- /* "fontTools/varLib/iup.py":246
- * ndj = nd[j]
- *
- * if lcj <= ncj: # <<<<<<<<<<<<<<
- * c1, c2 = lcj, ncj
- * d1, d2 = ldj, ndj
- */
- __pyx_t_9 = ((__pyx_v_lcj <= __pyx_v_ncj) != 0);
- if (__pyx_t_9) {
-
- /* "fontTools/varLib/iup.py":247
- *
- * if lcj <= ncj:
- * c1, c2 = lcj, ncj # <<<<<<<<<<<<<<
- * d1, d2 = ldj, ndj
- * else:
- */
- __pyx_t_8 = __pyx_v_lcj;
- __pyx_t_10 = __pyx_v_ncj;
- __pyx_v_c1 = __pyx_t_8;
- __pyx_v_c2 = __pyx_t_10;
-
- /* "fontTools/varLib/iup.py":248
- * if lcj <= ncj:
- * c1, c2 = lcj, ncj
- * d1, d2 = ldj, ndj # <<<<<<<<<<<<<<
- * else:
- * c1, c2 = ncj, lcj
- */
- __pyx_t_10 = __pyx_v_ldj;
- __pyx_t_8 = __pyx_v_ndj;
- __pyx_v_d1 = __pyx_t_10;
- __pyx_v_d2 = __pyx_t_8;
-
- /* "fontTools/varLib/iup.py":246
- * ndj = nd[j]
- *
- * if lcj <= ncj: # <<<<<<<<<<<<<<
- * c1, c2 = lcj, ncj
- * d1, d2 = ldj, ndj
- */
- goto __pyx_L7;
- }
-
- /* "fontTools/varLib/iup.py":250
- * d1, d2 = ldj, ndj
- * else:
- * c1, c2 = ncj, lcj # <<<<<<<<<<<<<<
- * d1, d2 = ndj, ldj
- *
- */
- /*else*/ {
- __pyx_t_8 = __pyx_v_ncj;
- __pyx_t_10 = __pyx_v_lcj;
- __pyx_v_c1 = __pyx_t_8;
- __pyx_v_c2 = __pyx_t_10;
-
- /* "fontTools/varLib/iup.py":251
- * else:
- * c1, c2 = ncj, lcj
- * d1, d2 = ndj, ldj # <<<<<<<<<<<<<<
- *
- * force = False
- */
- __pyx_t_10 = __pyx_v_ndj;
- __pyx_t_8 = __pyx_v_ldj;
- __pyx_v_d1 = __pyx_t_10;
- __pyx_v_d2 = __pyx_t_8;
- }
- __pyx_L7:;
-
- /* "fontTools/varLib/iup.py":253
- * d1, d2 = ndj, ldj
- *
- * force = False # <<<<<<<<<<<<<<
- *
- * # If the two coordinates are the same, then the interpolation
- */
- __pyx_v_force = 0;
-
- /* "fontTools/varLib/iup.py":260
- * #
- * # This test has to be before the next one.
- * if c1 == c2: # <<<<<<<<<<<<<<
- * if abs(d1 - d2) > tolerance and abs(dj) > tolerance:
- * force = True
- */
- __pyx_t_9 = ((__pyx_v_c1 == __pyx_v_c2) != 0);
- if (__pyx_t_9) {
-
- /* "fontTools/varLib/iup.py":261
- * # This test has to be before the next one.
- * if c1 == c2:
- * if abs(d1 - d2) > tolerance and abs(dj) > tolerance: # <<<<<<<<<<<<<<
- * force = True
- *
- */
- __pyx_t_6 = PyFloat_FromDouble(fabs((__pyx_v_d1 - __pyx_v_d2))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 261, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_v_tolerance, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 261, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_11) {
- } else {
- __pyx_t_9 = __pyx_t_11;
- goto __pyx_L10_bool_binop_done;
- }
- __pyx_t_3 = PyFloat_FromDouble(fabs(__pyx_v_dj)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_v_tolerance, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 261, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 261, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_9 = __pyx_t_11;
- __pyx_L10_bool_binop_done:;
- if (__pyx_t_9) {
-
- /* "fontTools/varLib/iup.py":262
- * if c1 == c2:
- * if abs(d1 - d2) > tolerance and abs(dj) > tolerance:
- * force = True # <<<<<<<<<<<<<<
- *
- * # If coordinate for current point is between coordinate of adjacent
- */
- __pyx_v_force = 1;
-
- /* "fontTools/varLib/iup.py":261
- * # This test has to be before the next one.
- * if c1 == c2:
- * if abs(d1 - d2) > tolerance and abs(dj) > tolerance: # <<<<<<<<<<<<<<
- * force = True
- *
- */
- }
-
- /* "fontTools/varLib/iup.py":260
- * #
- * # This test has to be before the next one.
- * if c1 == c2: # <<<<<<<<<<<<<<
- * if abs(d1 - d2) > tolerance and abs(dj) > tolerance:
- * force = True
- */
- goto __pyx_L8;
- }
-
- /* "fontTools/varLib/iup.py":269
- * # allowance), then there is no way that current point can be IUP-ed.
- * # Mark it forced.
- * elif c1 <= cj <= c2: # and c1 != c2 # <<<<<<<<<<<<<<
- * if not (min(d1, d2) - tolerance <= dj <= max(d1, d2) + tolerance):
- * force = True
- */
- __pyx_t_9 = (__pyx_v_c1 <= __pyx_v_cj);
- if (__pyx_t_9) {
- __pyx_t_9 = (__pyx_v_cj <= __pyx_v_c2);
- }
- __pyx_t_11 = (__pyx_t_9 != 0);
- if (__pyx_t_11) {
-
- /* "fontTools/varLib/iup.py":270
- * # Mark it forced.
- * elif c1 <= cj <= c2: # and c1 != c2
- * if not (min(d1, d2) - tolerance <= dj <= max(d1, d2) + tolerance): # <<<<<<<<<<<<<<
- * force = True
- *
- */
- __pyx_t_8 = __pyx_v_d2;
- __pyx_t_10 = __pyx_v_d1;
- if (((__pyx_t_8 < __pyx_t_10) != 0)) {
- __pyx_t_12 = __pyx_t_8;
- } else {
- __pyx_t_12 = __pyx_t_10;
- }
- __pyx_t_6 = PyFloat_FromDouble(__pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 270, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = PyNumber_Subtract(__pyx_t_6, __pyx_v_tolerance); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyFloat_FromDouble(__pyx_v_dj); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 270, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_13 = PyObject_RichCompare(__pyx_t_3, __pyx_t_6, Py_LE); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 270, __pyx_L1_error)
- if (__Pyx_PyObject_IsTrue(__pyx_t_13)) {
- __Pyx_DECREF(__pyx_t_13);
- __pyx_t_12 = __pyx_v_d2;
- __pyx_t_8 = __pyx_v_d1;
- if (((__pyx_t_12 > __pyx_t_8) != 0)) {
- __pyx_t_10 = __pyx_t_12;
- } else {
- __pyx_t_10 = __pyx_t_8;
- }
- __pyx_t_14 = PyFloat_FromDouble(__pyx_t_10); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 270, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_14);
- __pyx_t_15 = PyNumber_Add(__pyx_t_14, __pyx_v_tolerance); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 270, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __pyx_t_13 = PyObject_RichCompare(__pyx_t_6, __pyx_t_15, Py_LE); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 270, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 270, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_9 = ((!__pyx_t_11) != 0);
- if (__pyx_t_9) {
-
- /* "fontTools/varLib/iup.py":271
- * elif c1 <= cj <= c2: # and c1 != c2
- * if not (min(d1, d2) - tolerance <= dj <= max(d1, d2) + tolerance):
- * force = True # <<<<<<<<<<<<<<
- *
- * # Otherwise, the delta should either match the closest, or have the
- */
- __pyx_v_force = 1;
-
- /* "fontTools/varLib/iup.py":270
- * # Mark it forced.
- * elif c1 <= cj <= c2: # and c1 != c2
- * if not (min(d1, d2) - tolerance <= dj <= max(d1, d2) + tolerance): # <<<<<<<<<<<<<<
- * force = True
- *
- */
- }
-
- /* "fontTools/varLib/iup.py":269
- * # allowance), then there is no way that current point can be IUP-ed.
- * # Mark it forced.
- * elif c1 <= cj <= c2: # and c1 != c2 # <<<<<<<<<<<<<<
- * if not (min(d1, d2) - tolerance <= dj <= max(d1, d2) + tolerance):
- * force = True
- */
- goto __pyx_L8;
- }
-
- /* "fontTools/varLib/iup.py":276
- * # same sign as the interpolation of the two deltas.
- * else: # cj < c1 or c2 < cj
- * if d1 != d2: # <<<<<<<<<<<<<<
- * if cj < c1:
- * if (
- */
- /*else*/ {
- __pyx_t_9 = ((__pyx_v_d1 != __pyx_v_d2) != 0);
- if (__pyx_t_9) {
-
- /* "fontTools/varLib/iup.py":277
- * else: # cj < c1 or c2 < cj
- * if d1 != d2:
- * if cj < c1: # <<<<<<<<<<<<<<
- * if (
- * abs(dj) > tolerance
- */
- __pyx_t_9 = ((__pyx_v_cj < __pyx_v_c1) != 0);
- if (__pyx_t_9) {
-
- /* "fontTools/varLib/iup.py":279
- * if cj < c1:
- * if (
- * abs(dj) > tolerance # <<<<<<<<<<<<<<
- * and abs(dj - d1) > tolerance
- * and ((dj - tolerance < d1) != (d1 < d2))
- */
- __pyx_t_13 = PyFloat_FromDouble(fabs(__pyx_v_dj)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 279, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_6 = PyObject_RichCompare(__pyx_t_13, __pyx_v_tolerance, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 279, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 279, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (__pyx_t_11) {
- } else {
- __pyx_t_9 = __pyx_t_11;
- goto __pyx_L16_bool_binop_done;
- }
-
- /* "fontTools/varLib/iup.py":280
- * if (
- * abs(dj) > tolerance
- * and abs(dj - d1) > tolerance # <<<<<<<<<<<<<<
- * and ((dj - tolerance < d1) != (d1 < d2))
- * ):
- */
- __pyx_t_6 = PyFloat_FromDouble(fabs((__pyx_v_dj - __pyx_v_d1))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 280, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_13 = PyObject_RichCompare(__pyx_t_6, __pyx_v_tolerance, Py_GT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 280, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 280, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- if (__pyx_t_11) {
- } else {
- __pyx_t_9 = __pyx_t_11;
- goto __pyx_L16_bool_binop_done;
- }
-
- /* "fontTools/varLib/iup.py":281
- * abs(dj) > tolerance
- * and abs(dj - d1) > tolerance
- * and ((dj - tolerance < d1) != (d1 < d2)) # <<<<<<<<<<<<<<
- * ):
- * force = True
- */
- __pyx_t_13 = PyFloat_FromDouble(__pyx_v_dj); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 281, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_6 = PyNumber_Subtract(__pyx_t_13, __pyx_v_tolerance); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 281, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_13 = PyFloat_FromDouble(__pyx_v_d1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 281, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_13, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_13 = __Pyx_PyBool_FromLong((__pyx_v_d1 < __pyx_v_d2)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 281, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_13, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 281, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 281, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_9 = __pyx_t_11;
- __pyx_L16_bool_binop_done:;
-
- /* "fontTools/varLib/iup.py":278
- * if d1 != d2:
- * if cj < c1:
- * if ( # <<<<<<<<<<<<<<
- * abs(dj) > tolerance
- * and abs(dj - d1) > tolerance
- */
- if (__pyx_t_9) {
-
- /* "fontTools/varLib/iup.py":283
- * and ((dj - tolerance < d1) != (d1 < d2))
- * ):
- * force = True # <<<<<<<<<<<<<<
- * else: # c2 < cj
- * if (
- */
- __pyx_v_force = 1;
-
- /* "fontTools/varLib/iup.py":278
- * if d1 != d2:
- * if cj < c1:
- * if ( # <<<<<<<<<<<<<<
- * abs(dj) > tolerance
- * and abs(dj - d1) > tolerance
- */
- }
-
- /* "fontTools/varLib/iup.py":277
- * else: # cj < c1 or c2 < cj
- * if d1 != d2:
- * if cj < c1: # <<<<<<<<<<<<<<
- * if (
- * abs(dj) > tolerance
- */
- goto __pyx_L14;
- }
-
- /* "fontTools/varLib/iup.py":285
- * force = True
- * else: # c2 < cj
- * if ( # <<<<<<<<<<<<<<
- * abs(dj) > tolerance
- * and abs(dj - d2) > tolerance
- */
- /*else*/ {
-
- /* "fontTools/varLib/iup.py":286
- * else: # c2 < cj
- * if (
- * abs(dj) > tolerance # <<<<<<<<<<<<<<
- * and abs(dj - d2) > tolerance
- * and ((d2 < dj + tolerance) != (d1 < d2))
- */
- __pyx_t_6 = PyFloat_FromDouble(fabs(__pyx_v_dj)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 286, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_13 = PyObject_RichCompare(__pyx_t_6, __pyx_v_tolerance, Py_GT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 286, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 286, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- if (__pyx_t_11) {
- } else {
- __pyx_t_9 = __pyx_t_11;
- goto __pyx_L20_bool_binop_done;
- }
-
- /* "fontTools/varLib/iup.py":287
- * if (
- * abs(dj) > tolerance
- * and abs(dj - d2) > tolerance # <<<<<<<<<<<<<<
- * and ((d2 < dj + tolerance) != (d1 < d2))
- * ):
- */
- __pyx_t_13 = PyFloat_FromDouble(fabs((__pyx_v_dj - __pyx_v_d2))); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 287, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_6 = PyObject_RichCompare(__pyx_t_13, __pyx_v_tolerance, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 287, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 287, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (__pyx_t_11) {
- } else {
- __pyx_t_9 = __pyx_t_11;
- goto __pyx_L20_bool_binop_done;
- }
-
- /* "fontTools/varLib/iup.py":288
- * abs(dj) > tolerance
- * and abs(dj - d2) > tolerance
- * and ((d2 < dj + tolerance) != (d1 < d2)) # <<<<<<<<<<<<<<
- * ):
- * force = True
- */
- __pyx_t_6 = PyFloat_FromDouble(__pyx_v_d2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_13 = PyFloat_FromDouble(__pyx_v_dj); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 288, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_3 = PyNumber_Add(__pyx_t_13, __pyx_v_tolerance); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_13 = PyObject_RichCompare(__pyx_t_6, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 288, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyBool_FromLong((__pyx_v_d1 < __pyx_v_d2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = PyObject_RichCompare(__pyx_t_13, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 288, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_9 = __pyx_t_11;
- __pyx_L20_bool_binop_done:;
-
- /* "fontTools/varLib/iup.py":285
- * force = True
- * else: # c2 < cj
- * if ( # <<<<<<<<<<<<<<
- * abs(dj) > tolerance
- * and abs(dj - d2) > tolerance
- */
- if (__pyx_t_9) {
-
- /* "fontTools/varLib/iup.py":290
- * and ((d2 < dj + tolerance) != (d1 < d2))
- * ):
- * force = True # <<<<<<<<<<<<<<
- *
- * if force:
- */
- __pyx_v_force = 1;
-
- /* "fontTools/varLib/iup.py":285
- * force = True
- * else: # c2 < cj
- * if ( # <<<<<<<<<<<<<<
- * abs(dj) > tolerance
- * and abs(dj - d2) > tolerance
- */
- }
- }
- __pyx_L14:;
-
- /* "fontTools/varLib/iup.py":276
- * # same sign as the interpolation of the two deltas.
- * else: # cj < c1 or c2 < cj
- * if d1 != d2: # <<<<<<<<<<<<<<
- * if cj < c1:
- * if (
- */
- }
- }
- __pyx_L8:;
-
- /* "fontTools/varLib/iup.py":292
- * force = True
- *
- * if force: # <<<<<<<<<<<<<<
- * forced.add(i)
- * break
- */
- __pyx_t_9 = (__pyx_v_force != 0);
- if (__pyx_t_9) {
-
- /* "fontTools/varLib/iup.py":293
- *
- * if force:
- * forced.add(i) # <<<<<<<<<<<<<<
- * break
- *
- */
- __pyx_t_16 = PySet_Add(__pyx_v_forced, __pyx_v_i); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 293, __pyx_L1_error)
-
- /* "fontTools/varLib/iup.py":294
- * if force:
- * forced.add(i)
- * break # <<<<<<<<<<<<<<
- *
- * return forced
- */
- goto __pyx_L6_break;
-
- /* "fontTools/varLib/iup.py":292
- * force = True
- *
- * if force: # <<<<<<<<<<<<<<
- * forced.add(i)
- * break
- */
- }
-
- /* "fontTools/varLib/iup.py":238
- * nd, nc = deltas[i - n + 1], coords[i - n + 1]
- *
- * for j in (0, 1): # For X and for Y # <<<<<<<<<<<<<<
- * cj = c[j]
- * dj = d[j]
- */
- }
- __pyx_L6_break:;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "fontTools/varLib/iup.py":233
- * forced = set()
- * # Track "last" and "next" points on the contour as we sweep.
- * for i in range(len(deltas) - 1, -1, -1): # <<<<<<<<<<<<<<
- * ld, lc = deltas[i - 1], coords[i - 1]
- * d, c = deltas[i], coords[i]
- */
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "fontTools/varLib/iup.py":296
- * break
- *
- * return forced # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_forced);
- __pyx_r = __pyx_v_forced;
- goto __pyx_L0;
-
- /* "fontTools/varLib/iup.py":218
- * forced=set,
- * )
- * def _iup_contour_bound_forced_set( # <<<<<<<<<<<<<<
- * deltas: _DeltaSegment, coords: _PointSegment, tolerance: Real = 0
- * ) -> set:
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_13);
- __Pyx_XDECREF(__pyx_t_14);
- __Pyx_XDECREF(__pyx_t_15);
- __Pyx_AddTraceback("fontTools.varLib.iup._iup_contour_bound_forced_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_forced);
- __Pyx_XDECREF(__pyx_v_n);
- __Pyx_XDECREF(__pyx_v_i);
- __Pyx_XDECREF(__pyx_v_ld);
- __Pyx_XDECREF(__pyx_v_lc);
- __Pyx_XDECREF(__pyx_v_d);
- __Pyx_XDECREF(__pyx_v_c);
- __Pyx_XDECREF(__pyx_v_nd);
- __Pyx_XDECREF(__pyx_v_nc);
- __Pyx_XDECREF(__pyx_v_j);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "fontTools/varLib/iup.py":308
- * tolerance=cython.double,
- * )
- * def _iup_contour_optimize_dp( # <<<<<<<<<<<<<<
- * deltas: _DeltaSegment,
- * coords: _PointSegment,
- */
-
-static PyObject *__pyx_pf_9fontTools_6varLib_3iup_16__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__defaults__", 0);
- __Pyx_XDECREF(__pyx_r);
-
- /* "fontTools/varLib/iup.py":312
- * coords: _PointSegment,
- * forced=set(),
- * tolerance: Real = 0, # <<<<<<<<<<<<<<
- * lookback: Integral = None,
- * ):
- */
- __pyx_t_1 = PyFloat_FromDouble(((double)0.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
-
- /* "fontTools/varLib/iup.py":308
- * tolerance=cython.double,
- * )
- * def _iup_contour_optimize_dp( # <<<<<<<<<<<<<<
- * deltas: _DeltaSegment,
- * coords: _PointSegment,
- */
- __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_forced);
- __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_forced);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_forced);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
- __Pyx_INCREF(((PyObject *)Py_None));
- __Pyx_GIVEREF(((PyObject *)Py_None));
- PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)Py_None));
- __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
- __Pyx_INCREF(Py_None);
- __Pyx_GIVEREF(Py_None);
- PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
- __pyx_t_2 = 0;
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("fontTools.varLib.iup.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_9fontTools_6varLib_3iup_7_iup_contour_optimize_dp(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9fontTools_6varLib_3iup_6_iup_contour_optimize_dp[] = "_iup_contour_optimize_dp(deltas: _DeltaSegment, coords: _PointSegment, set forced=set(), double tolerance: Real = 0, lookback: Integral = None)\nStraightforward Dynamic-Programming. For each index i, find least-costly encoding of\n points 0 to i where i is explicitly encoded. We find this by considering all previous\n explicit points j and check whether interpolation can fill points between j and i.\n\n Note that solution always encodes last point explicitly. Higher-level is responsible\n for removing that restriction.\n\n As major speedup, we stop looking further whenever we see a \"forced\" point.";
-static PyMethodDef __pyx_mdef_9fontTools_6varLib_3iup_7_iup_contour_optimize_dp = {"_iup_contour_optimize_dp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9fontTools_6varLib_3iup_7_iup_contour_optimize_dp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9fontTools_6varLib_3iup_6_iup_contour_optimize_dp};
-static PyObject *__pyx_pw_9fontTools_6varLib_3iup_7_iup_contour_optimize_dp(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_deltas = 0;
- PyObject *__pyx_v_coords = 0;
- PyObject *__pyx_v_forced = 0;
- double __pyx_v_tolerance;
- PyObject *__pyx_v_lookback = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("_iup_contour_optimize_dp (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_deltas,&__pyx_n_s_coords,&__pyx_n_s_forced,&__pyx_n_s_tolerance,&__pyx_n_s_lookback,0};
- PyObject* values[5] = {0,0,0,0,0};
- __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
- values[2] = __pyx_dynamic_args->__pyx_arg_forced;
- values[4] = ((PyObject *)((PyObject *)Py_None));
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
- CYTHON_FALLTHROUGH;
- case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
- CYTHON_FALLTHROUGH;
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- CYTHON_FALLTHROUGH;
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- CYTHON_FALLTHROUGH;
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- CYTHON_FALLTHROUGH;
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_deltas)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- CYTHON_FALLTHROUGH;
- case 1:
- if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("_iup_contour_optimize_dp", 0, 2, 5, 1); __PYX_ERR(0, 308, __pyx_L3_error)
- }
- CYTHON_FALLTHROUGH;
- case 2:
- if (kw_args > 0) {
- PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_forced);
- if (value) { values[2] = value; kw_args--; }
- }
- CYTHON_FALLTHROUGH;
- case 3:
- if (kw_args > 0) {
- PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tolerance);
- if (value) { values[3] = value; kw_args--; }
- }
- CYTHON_FALLTHROUGH;
- case 4:
- if (kw_args > 0) {
- PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lookback);
- if (value) { values[4] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_iup_contour_optimize_dp") < 0)) __PYX_ERR(0, 308, __pyx_L3_error)
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
- CYTHON_FALLTHROUGH;
- case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
- CYTHON_FALLTHROUGH;
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- CYTHON_FALLTHROUGH;
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_deltas = values[0];
- __pyx_v_coords = values[1];
- __pyx_v_forced = ((PyObject*)values[2]);
- if (values[3]) {
- __pyx_v_tolerance = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_tolerance == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L3_error)
- } else {
- __pyx_v_tolerance = ((double)((double)0.0));
- }
- __pyx_v_lookback = values[4];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_iup_contour_optimize_dp", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 308, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("fontTools.varLib.iup._iup_contour_optimize_dp", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_forced), (&PySet_Type), 1, "forced", 1))) __PYX_ERR(0, 311, __pyx_L1_error)
- __pyx_r = __pyx_pf_9fontTools_6varLib_3iup_6_iup_contour_optimize_dp(__pyx_self, __pyx_v_deltas, __pyx_v_coords, __pyx_v_forced, __pyx_v_tolerance, __pyx_v_lookback);
-
- /* function exit code */
- goto __pyx_L0;
- __pyx_L1_error:;
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_9fontTools_6varLib_3iup_6_iup_contour_optimize_dp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_deltas, PyObject *__pyx_v_coords, PyObject *__pyx_v_forced, double __pyx_v_tolerance, PyObject *__pyx_v_lookback) {
- int __pyx_v_i;
- int __pyx_v_j;
- double __pyx_v_best_cost;
- double __pyx_v_cost;
- Py_ssize_t __pyx_v_n;
- PyObject *__pyx_v_costs = NULL;
- PyObject *__pyx_v_chain = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- Py_ssize_t __pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
- Py_ssize_t __pyx_t_8;
- int __pyx_t_9;
- double __pyx_t_10;
- long __pyx_t_11;
- long __pyx_t_12;
- int __pyx_t_13;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("_iup_contour_optimize_dp", 0);
- __Pyx_INCREF(__pyx_v_lookback);
-
- /* "fontTools/varLib/iup.py":324
- * As major speedup, we stop looking further whenever we see a "forced" point."""
- *
- * n = len(deltas) # <<<<<<<<<<<<<<
- * if lookback is None:
- * lookback = n
- */
- __pyx_t_1 = PyObject_Length(__pyx_v_deltas); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 324, __pyx_L1_error)
- __pyx_v_n = __pyx_t_1;
-
- /* "fontTools/varLib/iup.py":325
- *
- * n = len(deltas)
- * if lookback is None: # <<<<<<<<<<<<<<
- * lookback = n
- * lookback = min(lookback, MAX_LOOKBACK)
- */
- __pyx_t_2 = (__pyx_v_lookback == Py_None);
- __pyx_t_3 = (__pyx_t_2 != 0);
- if (__pyx_t_3) {
-
- /* "fontTools/varLib/iup.py":326
- * n = len(deltas)
- * if lookback is None:
- * lookback = n # <<<<<<<<<<<<<<
- * lookback = min(lookback, MAX_LOOKBACK)
- * costs = {-1: 0}
- */
- __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 326, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF_SET(__pyx_v_lookback, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "fontTools/varLib/iup.py":325
- *
- * n = len(deltas)
- * if lookback is None: # <<<<<<<<<<<<<<
- * lookback = n
- * lookback = min(lookback, MAX_LOOKBACK)
- */
- }
-
- /* "fontTools/varLib/iup.py":327
- * if lookback is None:
- * lookback = n
- * lookback = min(lookback, MAX_LOOKBACK) # <<<<<<<<<<<<<<
- * costs = {-1: 0}
- * chain = {-1: None}
- */
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MAX_LOOKBACK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 327, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_v_lookback);
- __pyx_t_5 = __pyx_v_lookback;
- __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 327, __pyx_L1_error)
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 327, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (__pyx_t_3) {
- __Pyx_INCREF(__pyx_t_4);
- __pyx_t_6 = __pyx_t_4;
- } else {
- __Pyx_INCREF(__pyx_t_5);
- __pyx_t_6 = __pyx_t_5;
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __pyx_t_6;
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF_SET(__pyx_v_lookback, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "fontTools/varLib/iup.py":328
- * lookback = n
- * lookback = min(lookback, MAX_LOOKBACK)
- * costs = {-1: 0} # <<<<<<<<<<<<<<
- * chain = {-1: None}
- * for i in range(0, n):
- */
- __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 328, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_t_4, __pyx_int_neg_1, __pyx_int_0) < 0) __PYX_ERR(0, 328, __pyx_L1_error)
- __pyx_v_costs = ((PyObject*)__pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "fontTools/varLib/iup.py":329
- * lookback = min(lookback, MAX_LOOKBACK)
- * costs = {-1: 0}
- * chain = {-1: None} # <<<<<<<<<<<<<<
- * for i in range(0, n):
- * best_cost = costs[i - 1] + 1
- */
- __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 329, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_t_4, __pyx_int_neg_1, Py_None) < 0) __PYX_ERR(0, 329, __pyx_L1_error)
- __pyx_v_chain = ((PyObject*)__pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "fontTools/varLib/iup.py":330
- * costs = {-1: 0}
- * chain = {-1: None}
- * for i in range(0, n): # <<<<<<<<<<<<<<
- * best_cost = costs[i - 1] + 1
- *
- */
- __pyx_t_1 = __pyx_v_n;
- __pyx_t_8 = __pyx_t_1;
- for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
- __pyx_v_i = __pyx_t_9;
-
- /* "fontTools/varLib/iup.py":331
- * chain = {-1: None}
- * for i in range(0, n):
- * best_cost = costs[i - 1] + 1 # <<<<<<<<<<<<<<
- *
- * costs[i] = best_cost
- */
- __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_v_i - 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_costs, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 331, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_6, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 331, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_best_cost = __pyx_t_10;
-
- /* "fontTools/varLib/iup.py":333
- * best_cost = costs[i - 1] + 1
- *
- * costs[i] = best_cost # <<<<<<<<<<<<<<
- * chain[i] = i - 1
- *
- */
- __pyx_t_4 = PyFloat_FromDouble(__pyx_v_best_cost); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 333, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (unlikely(PyDict_SetItem(__pyx_v_costs, __pyx_t_6, __pyx_t_4) < 0)) __PYX_ERR(0, 333, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "fontTools/varLib/iup.py":334
- *
- * costs[i] = best_cost
- * chain[i] = i - 1 # <<<<<<<<<<<<<<
- *
- * if i - 1 in forced:
- */
- __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_v_i - 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (unlikely(PyDict_SetItem(__pyx_v_chain, __pyx_t_6, __pyx_t_4) < 0)) __PYX_ERR(0, 334, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "fontTools/varLib/iup.py":336
- * chain[i] = i - 1
- *
- * if i - 1 in forced: # <<<<<<<<<<<<<<
- * continue
- *
- */
- __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_v_i - 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- if (unlikely(__pyx_v_forced == Py_None)) {
- PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
- __PYX_ERR(0, 336, __pyx_L1_error)
- }
- __pyx_t_3 = (__Pyx_PySet_ContainsTF(__pyx_t_4, __pyx_v_forced, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 336, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_2 = (__pyx_t_3 != 0);
- if (__pyx_t_2) {
-
- /* "fontTools/varLib/iup.py":337
- *
- * if i - 1 in forced:
- * continue # <<<<<<<<<<<<<<
- *
- * for j in range(i - 2, max(i - lookback, -2), -1):
- */
- goto __pyx_L4_continue;
-
- /* "fontTools/varLib/iup.py":336
- * chain[i] = i - 1
- *
- * if i - 1 in forced: # <<<<<<<<<<<<<<
- * continue
- *
- */
- }
-
- /* "fontTools/varLib/iup.py":339
- * continue
- *
- * for j in range(i - 2, max(i - lookback, -2), -1): # <<<<<<<<<<<<<<
- * cost = costs[j] + 1
- *
- */
- __pyx_t_11 = -2L;
- __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 339, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = PyNumber_Subtract(__pyx_t_4, __pyx_v_lookback); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 339, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 339, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 339, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 339, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (__pyx_t_2) {
- __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 339, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_4 = __pyx_t_7;
- __pyx_t_7 = 0;
- } else {
- __Pyx_INCREF(__pyx_t_6);
- __pyx_t_4 = __pyx_t_6;
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_11 = __Pyx_PyInt_As_long(__pyx_t_4); if (unlikely((__pyx_t_11 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_12 = __pyx_t_11;
- for (__pyx_t_13 = (__pyx_v_i - 2); __pyx_t_13 > __pyx_t_12; __pyx_t_13-=1) {
- __pyx_v_j = __pyx_t_13;
-
- /* "fontTools/varLib/iup.py":340
- *
- * for j in range(i - 2, max(i - lookback, -2), -1):
- * cost = costs[j] + 1 # <<<<<<<<<<<<<<
- *
- * if cost < best_cost and can_iup_in_between(deltas, coords, j, i, tolerance):
- */
- __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_costs, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 340, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_6, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_cost = __pyx_t_10;
-
- /* "fontTools/varLib/iup.py":342
- * cost = costs[j] + 1
- *
- * if cost < best_cost and can_iup_in_between(deltas, coords, j, i, tolerance): # <<<<<<<<<<<<<<
- * costs[i] = best_cost = cost
- * chain[i] = j
- */
- __pyx_t_3 = ((__pyx_v_cost < __pyx_v_best_cost) != 0);
- if (__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L10_bool_binop_done;
- }
- __pyx_t_3 = (__pyx_f_9fontTools_6varLib_3iup_can_iup_in_between(__pyx_v_deltas, __pyx_v_coords, __pyx_v_j, __pyx_v_i, __pyx_v_tolerance) != 0);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L10_bool_binop_done:;
- if (__pyx_t_2) {
-
- /* "fontTools/varLib/iup.py":343
- *
- * if cost < best_cost and can_iup_in_between(deltas, coords, j, i, tolerance):
- * costs[i] = best_cost = cost # <<<<<<<<<<<<<<
- * chain[i] = j
- *
- */
- __pyx_t_4 = PyFloat_FromDouble(__pyx_v_cost); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 343, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 343, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (unlikely(PyDict_SetItem(__pyx_v_costs, __pyx_t_6, __pyx_t_4) < 0)) __PYX_ERR(0, 343, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_best_cost = __pyx_v_cost;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "fontTools/varLib/iup.py":344
- * if cost < best_cost and can_iup_in_between(deltas, coords, j, i, tolerance):
- * costs[i] = best_cost = cost
- * chain[i] = j # <<<<<<<<<<<<<<
- *
- * if j in forced:
- */
- __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 344, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (unlikely(PyDict_SetItem(__pyx_v_chain, __pyx_t_6, __pyx_t_4) < 0)) __PYX_ERR(0, 344, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "fontTools/varLib/iup.py":342
- * cost = costs[j] + 1
- *
- * if cost < best_cost and can_iup_in_between(deltas, coords, j, i, tolerance): # <<<<<<<<<<<<<<
- * costs[i] = best_cost = cost
- * chain[i] = j
- */
- }
-
- /* "fontTools/varLib/iup.py":346
- * chain[i] = j
- *
- * if j in forced: # <<<<<<<<<<<<<<
- * break
- *
- */
- __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 346, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- if (unlikely(__pyx_v_forced == Py_None)) {
- PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
- __PYX_ERR(0, 346, __pyx_L1_error)
- }
- __pyx_t_2 = (__Pyx_PySet_ContainsTF(__pyx_t_4, __pyx_v_forced, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 346, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_3 = (__pyx_t_2 != 0);
- if (__pyx_t_3) {
-
- /* "fontTools/varLib/iup.py":347
- *
- * if j in forced:
- * break # <<<<<<<<<<<<<<
- *
- * return chain, costs
- */
- goto __pyx_L8_break;
-
- /* "fontTools/varLib/iup.py":346
- * chain[i] = j
- *
- * if j in forced: # <<<<<<<<<<<<<<
- * break
- *
- */
- }
- }
- __pyx_L8_break:;
- __pyx_L4_continue:;
- }
-
- /* "fontTools/varLib/iup.py":349
- * break
- *
- * return chain, costs # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 349, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_v_chain);
- __Pyx_GIVEREF(__pyx_v_chain);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_chain);
- __Pyx_INCREF(__pyx_v_costs);
- __Pyx_GIVEREF(__pyx_v_costs);
- PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_costs);
- __pyx_r = __pyx_t_4;
- __pyx_t_4 = 0;
- goto __pyx_L0;
-
- /* "fontTools/varLib/iup.py":308
- * tolerance=cython.double,
- * )
- * def _iup_contour_optimize_dp( # <<<<<<<<<<<<<<
- * deltas: _DeltaSegment,
- * coords: _PointSegment,
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_AddTraceback("fontTools.varLib.iup._iup_contour_optimize_dp", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_costs);
- __Pyx_XDECREF(__pyx_v_chain);
- __Pyx_XDECREF(__pyx_v_lookback);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "fontTools/varLib/iup.py":352
- *
- *
- * def _rot_list(l: list, k: int): # <<<<<<<<<<<<<<
- * """Rotate list by k items forward. Ie. item at position 0 will be
- * at position k in returned list. Negative k is allowed."""
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_9fontTools_6varLib_3iup_9_rot_list(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9fontTools_6varLib_3iup_8_rot_list[] = "_rot_list(list l: list, k: int)\nRotate list by k items forward. Ie. item at position 0 will be\n at position k in returned list. Negative k is allowed.";
-static PyMethodDef __pyx_mdef_9fontTools_6varLib_3iup_9_rot_list = {"_rot_list", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9fontTools_6varLib_3iup_9_rot_list, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9fontTools_6varLib_3iup_8_rot_list};
-static PyObject *__pyx_pw_9fontTools_6varLib_3iup_9_rot_list(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_l = 0;
- PyObject *__pyx_v_k = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("_rot_list (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_l,&__pyx_n_s_k,0};
- PyObject* values[2] = {0,0};
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- CYTHON_FALLTHROUGH;
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- CYTHON_FALLTHROUGH;
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_l)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- CYTHON_FALLTHROUGH;
- case 1:
- if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("_rot_list", 1, 2, 2, 1); __PYX_ERR(0, 352, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_rot_list") < 0)) __PYX_ERR(0, 352, __pyx_L3_error)
- }
- } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
- goto __pyx_L5_argtuple_error;
- } else {
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- }
- __pyx_v_l = ((PyObject*)values[0]);
- __pyx_v_k = values[1];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_rot_list", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 352, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("fontTools.varLib.iup._rot_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_l), (&PyList_Type), 1, "l", 1))) __PYX_ERR(0, 352, __pyx_L1_error)
- __pyx_r = __pyx_pf_9fontTools_6varLib_3iup_8_rot_list(__pyx_self, __pyx_v_l, __pyx_v_k);
-
- /* function exit code */
- goto __pyx_L0;
- __pyx_L1_error:;
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_9fontTools_6varLib_3iup_8_rot_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_l, PyObject *__pyx_v_k) {
- PyObject *__pyx_v_n = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- Py_ssize_t __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_t_3;
- int __pyx_t_4;
- Py_ssize_t __pyx_t_5;
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("_rot_list", 0);
- __Pyx_INCREF(__pyx_v_k);
-
- /* "fontTools/varLib/iup.py":355
- * """Rotate list by k items forward. Ie. item at position 0 will be
- * at position k in returned list. Negative k is allowed."""
- * n = len(l) # <<<<<<<<<<<<<<
- * k %= n
- * if not k:
- */
- if (unlikely(__pyx_v_l == Py_None)) {
- PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
- __PYX_ERR(0, 355, __pyx_L1_error)
- }
- __pyx_t_1 = PyList_GET_SIZE(__pyx_v_l); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 355, __pyx_L1_error)
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 355, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_v_n = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "fontTools/varLib/iup.py":356
- * at position k in returned list. Negative k is allowed."""
- * n = len(l)
- * k %= n # <<<<<<<<<<<<<<
- * if not k:
- * return l
- */
- __pyx_t_2 = PyNumber_InPlaceRemainder(__pyx_v_k, __pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF_SET(__pyx_v_k, __pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "fontTools/varLib/iup.py":357
- * n = len(l)
- * k %= n
- * if not k: # <<<<<<<<<<<<<<
- * return l
- * return l[n - k :] + l[: n - k]
- */
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_k); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 357, __pyx_L1_error)
- __pyx_t_4 = ((!__pyx_t_3) != 0);
- if (__pyx_t_4) {
-
- /* "fontTools/varLib/iup.py":358
- * k %= n
- * if not k:
- * return l # <<<<<<<<<<<<<<
- * return l[n - k :] + l[: n - k]
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_l);
- __pyx_r = __pyx_v_l;
- goto __pyx_L0;
-
- /* "fontTools/varLib/iup.py":357
- * n = len(l)
- * k %= n
- * if not k: # <<<<<<<<<<<<<<
- * return l
- * return l[n - k :] + l[: n - k]
- */
- }
-
- /* "fontTools/varLib/iup.py":359
- * if not k:
- * return l
- * return l[n - k :] + l[: n - k] # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- if (unlikely(__pyx_v_l == Py_None)) {
- PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
- __PYX_ERR(0, 359, __pyx_L1_error)
- }
- __pyx_t_2 = PyNumber_Subtract(__pyx_v_n, __pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = (__pyx_t_2 == Py_None);
- if (__pyx_t_4) {
- __pyx_t_1 = 0;
- } else {
- __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 359, __pyx_L1_error)
- __pyx_t_1 = __pyx_t_5;
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyList_GetSlice(__pyx_v_l, __pyx_t_1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (unlikely(__pyx_v_l == Py_None)) {
- PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
- __PYX_ERR(0, 359, __pyx_L1_error)
- }
- __pyx_t_6 = PyNumber_Subtract(__pyx_v_n, __pyx_v_k); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 359, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = (__pyx_t_6 == Py_None);
- if (__pyx_t_4) {
- __pyx_t_1 = PY_SSIZE_T_MAX;
- } else {
- __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 359, __pyx_L1_error)
- __pyx_t_1 = __pyx_t_5;
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyList_GetSlice(__pyx_v_l, 0, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 359, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = PyNumber_Add(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 359, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_r = __pyx_t_7;
- __pyx_t_7 = 0;
- goto __pyx_L0;
-
- /* "fontTools/varLib/iup.py":352
- *
- *
- * def _rot_list(l: list, k: int): # <<<<<<<<<<<<<<
- * """Rotate list by k items forward. Ie. item at position 0 will be
- * at position k in returned list. Negative k is allowed."""
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_AddTraceback("fontTools.varLib.iup._rot_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_n);
- __Pyx_XDECREF(__pyx_v_k);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "fontTools/varLib/iup.py":362
- *
- *
- * def _rot_set(s: set, k: int, n: int): # <<<<<<<<<<<<<<
- * k %= n
- * if not k:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_9fontTools_6varLib_3iup_11_rot_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9fontTools_6varLib_3iup_10_rot_set[] = "_rot_set(set s: set, k: int, n: int)";
-static PyMethodDef __pyx_mdef_9fontTools_6varLib_3iup_11_rot_set = {"_rot_set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9fontTools_6varLib_3iup_11_rot_set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9fontTools_6varLib_3iup_10_rot_set};
-static PyObject *__pyx_pw_9fontTools_6varLib_3iup_11_rot_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_s = 0;
- PyObject *__pyx_v_k = 0;
- PyObject *__pyx_v_n = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("_rot_set (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_s,&__pyx_n_s_k,&__pyx_n_s_n,0};
- PyObject* values[3] = {0,0,0};
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- CYTHON_FALLTHROUGH;
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- CYTHON_FALLTHROUGH;
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- CYTHON_FALLTHROUGH;
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_s)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- CYTHON_FALLTHROUGH;
- case 1:
- if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("_rot_set", 1, 3, 3, 1); __PYX_ERR(0, 362, __pyx_L3_error)
- }
- CYTHON_FALLTHROUGH;
- case 2:
- if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("_rot_set", 1, 3, 3, 2); __PYX_ERR(0, 362, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_rot_set") < 0)) __PYX_ERR(0, 362, __pyx_L3_error)
- }
- } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
- goto __pyx_L5_argtuple_error;
- } else {
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- }
- __pyx_v_s = ((PyObject*)values[0]);
- __pyx_v_k = values[1];
- __pyx_v_n = values[2];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_rot_set", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 362, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("fontTools.varLib.iup._rot_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_s), (&PySet_Type), 1, "s", 1))) __PYX_ERR(0, 362, __pyx_L1_error)
- __pyx_r = __pyx_pf_9fontTools_6varLib_3iup_10_rot_set(__pyx_self, __pyx_v_s, __pyx_v_k, __pyx_v_n);
-
- /* function exit code */
- goto __pyx_L0;
- __pyx_L1_error:;
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_9fontTools_6varLib_3iup_10_rot_set(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s, PyObject *__pyx_v_k, PyObject *__pyx_v_n) {
- PyObject *__pyx_8genexpr2__pyx_v_v = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_t_2;
- int __pyx_t_3;
- PyObject *__pyx_t_4 = NULL;
- Py_ssize_t __pyx_t_5;
- Py_ssize_t __pyx_t_6;
- int __pyx_t_7;
- PyObject *__pyx_t_8 = NULL;
- int __pyx_t_9;
- PyObject *__pyx_t_10 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("_rot_set", 0);
- __Pyx_INCREF(__pyx_v_k);
-
- /* "fontTools/varLib/iup.py":363
- *
- * def _rot_set(s: set, k: int, n: int):
- * k %= n # <<<<<<<<<<<<<<
- * if not k:
- * return s
- */
- __pyx_t_1 = PyNumber_InPlaceRemainder(__pyx_v_k, __pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF_SET(__pyx_v_k, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "fontTools/varLib/iup.py":364
- * def _rot_set(s: set, k: int, n: int):
- * k %= n
- * if not k: # <<<<<<<<<<<<<<
- * return s
- * return {(v + k) % n for v in s}
- */
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_k); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 364, __pyx_L1_error)
- __pyx_t_3 = ((!__pyx_t_2) != 0);
- if (__pyx_t_3) {
-
- /* "fontTools/varLib/iup.py":365
- * k %= n
- * if not k:
- * return s # <<<<<<<<<<<<<<
- * return {(v + k) % n for v in s}
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_s);
- __pyx_r = __pyx_v_s;
- goto __pyx_L0;
-
- /* "fontTools/varLib/iup.py":364
- * def _rot_set(s: set, k: int, n: int):
- * k %= n
- * if not k: # <<<<<<<<<<<<<<
- * return s
- * return {(v + k) % n for v in s}
- */
- }
-
- /* "fontTools/varLib/iup.py":366
- * if not k:
- * return s
- * return {(v + k) % n for v in s} # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- { /* enter inner scope */
- __pyx_t_1 = PySet_New(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L6_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = 0;
- __pyx_t_8 = __Pyx_set_iterator(__pyx_v_s, 1, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 366, __pyx_L6_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_4);
- __pyx_t_4 = __pyx_t_8;
- __pyx_t_8 = 0;
- while (1) {
- __pyx_t_9 = __Pyx_set_iter_next(__pyx_t_4, __pyx_t_6, &__pyx_t_5, &__pyx_t_8, __pyx_t_7);
- if (unlikely(__pyx_t_9 == 0)) break;
- if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 366, __pyx_L6_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_v, __pyx_t_8);
- __pyx_t_8 = 0;
- __pyx_t_8 = PyNumber_Add(__pyx_8genexpr2__pyx_v_v, __pyx_v_k); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 366, __pyx_L6_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_10 = PyNumber_Remainder(__pyx_t_8, __pyx_v_n); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 366, __pyx_L6_error)
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (unlikely(PySet_Add(__pyx_t_1, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 366, __pyx_L6_error)
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_v); __pyx_8genexpr2__pyx_v_v = 0;
- goto __pyx_L9_exit_scope;
- __pyx_L6_error:;
- __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_v); __pyx_8genexpr2__pyx_v_v = 0;
- goto __pyx_L1_error;
- __pyx_L9_exit_scope:;
- } /* exit inner scope */
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- /* "fontTools/varLib/iup.py":362
- *
- *
- * def _rot_set(s: set, k: int, n: int): # <<<<<<<<<<<<<<
- * k %= n
- * if not k:
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_10);
- __Pyx_AddTraceback("fontTools.varLib.iup._rot_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_v);
- __Pyx_XDECREF(__pyx_v_k);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "fontTools/varLib/iup.py":369
- *
- *
- * def iup_contour_optimize( # <<<<<<<<<<<<<<
- * deltas: _DeltaSegment, coords: _PointSegment, tolerance: Real = 0.0
- * ) -> _DeltaOrNoneSegment:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_9fontTools_6varLib_3iup_13iup_contour_optimize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9fontTools_6varLib_3iup_12iup_contour_optimize[] = "iup_contour_optimize(deltas: _DeltaSegment, coords: _PointSegment, tolerance: Real = 0.0) -> _DeltaOrNoneSegment\nFor contour with coordinates `coords`, optimize a set of delta\n values `deltas` within error `tolerance`.\n\n Returns delta vector that has most number of None items instead of\n the input delta.\n ";
-static PyMethodDef __pyx_mdef_9fontTools_6varLib_3iup_13iup_contour_optimize = {"iup_contour_optimize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9fontTools_6varLib_3iup_13iup_contour_optimize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9fontTools_6varLib_3iup_12iup_contour_optimize};
-static PyObject *__pyx_pw_9fontTools_6varLib_3iup_13iup_contour_optimize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_deltas = 0;
- PyObject *__pyx_v_coords = 0;
- PyObject *__pyx_v_tolerance = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("iup_contour_optimize (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_deltas,&__pyx_n_s_coords,&__pyx_n_s_tolerance,0};
- PyObject* values[3] = {0,0,0};
- values[2] = ((PyObject *)((PyObject*)__pyx_float_0_0));
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- CYTHON_FALLTHROUGH;
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- CYTHON_FALLTHROUGH;
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- CYTHON_FALLTHROUGH;
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_deltas)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- CYTHON_FALLTHROUGH;
- case 1:
- if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("iup_contour_optimize", 0, 2, 3, 1); __PYX_ERR(0, 369, __pyx_L3_error)
- }
- CYTHON_FALLTHROUGH;
- case 2:
- if (kw_args > 0) {
- PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tolerance);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iup_contour_optimize") < 0)) __PYX_ERR(0, 369, __pyx_L3_error)
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- CYTHON_FALLTHROUGH;
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_deltas = values[0];
- __pyx_v_coords = values[1];
- __pyx_v_tolerance = values[2];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("iup_contour_optimize", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 369, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("fontTools.varLib.iup.iup_contour_optimize", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9fontTools_6varLib_3iup_12iup_contour_optimize(__pyx_self, __pyx_v_deltas, __pyx_v_coords, __pyx_v_tolerance);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-static PyObject *__pyx_gb_9fontTools_6varLib_3iup_20iup_contour_optimize_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
-
-/* "fontTools/varLib/iup.py":384
- *
- * # If all are within tolerance distance of 0, encode nothing:
- * if all(abs(complex(*p)) <= tolerance for p in deltas): # <<<<<<<<<<<<<<
- * return [None] * n
- *
- */
-
-static PyObject *__pyx_pf_9fontTools_6varLib_3iup_20iup_contour_optimize_genexpr(PyObject *__pyx_self) {
- struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr *__pyx_cur_scope;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("genexpr", 0);
- __pyx_cur_scope = (struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr *)__pyx_tp_new_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr(__pyx_ptype_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL);
- if (unlikely(!__pyx_cur_scope)) {
- __pyx_cur_scope = ((struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr *)Py_None);
- __Pyx_INCREF(Py_None);
- __PYX_ERR(0, 384, __pyx_L1_error)
- } else {
- __Pyx_GOTREF(__pyx_cur_scope);
- }
- __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize *) __pyx_self;
- __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
- __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
- {
- __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_9fontTools_6varLib_3iup_20iup_contour_optimize_2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_iup_contour_optimize_locals_gene, __pyx_n_s_fontTools_varLib_iup); if (unlikely(!gen)) __PYX_ERR(0, 384, __pyx_L1_error)
- __Pyx_DECREF(__pyx_cur_scope);
- __Pyx_RefNannyFinishContext();
- return (PyObject *) gen;
- }
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_AddTraceback("fontTools.varLib.iup.iup_contour_optimize.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_gb_9fontTools_6varLib_3iup_20iup_contour_optimize_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
-{
- struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr *)__pyx_generator->closure);
- PyObject *__pyx_r = NULL;
- PyObject *__pyx_t_1 = NULL;
- Py_ssize_t __pyx_t_2;
- PyObject *(*__pyx_t_3)(PyObject *);
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("genexpr", 0);
- switch (__pyx_generator->resume_label) {
- case 0: goto __pyx_L3_first_run;
- default: /* CPython raises the right error here */
- __Pyx_RefNannyFinishContext();
- return NULL;
- }
- __pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 384, __pyx_L1_error)
- if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_deltas)) { __Pyx_RaiseClosureNameError("deltas"); __PYX_ERR(0, 384, __pyx_L1_error) }
- if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_deltas)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_deltas)) {
- __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_deltas; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
- __pyx_t_3 = NULL;
- } else {
- __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_deltas); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 384, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 384, __pyx_L1_error)
- }
- for (;;) {
- if (likely(!__pyx_t_3)) {
- if (likely(PyList_CheckExact(__pyx_t_1))) {
- if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 384, __pyx_L1_error)
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 384, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- #endif
- } else {
- if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 384, __pyx_L1_error)
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 384, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- #endif
- }
- } else {
- __pyx_t_4 = __pyx_t_3(__pyx_t_1);
- if (unlikely(!__pyx_t_4)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 384, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_4);
- }
- __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_p);
- __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_p, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_p); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 384, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyComplex_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 384, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 384, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_tolerance)) { __Pyx_RaiseClosureNameError("tolerance"); __PYX_ERR(0, 384, __pyx_L1_error) }
- __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_tolerance, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 384, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 384, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = ((!__pyx_t_6) != 0);
- if (__pyx_t_7) {
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(Py_False);
- __pyx_r = Py_False;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- goto __pyx_L0;
- }
- }
- /*else*/ {
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(Py_True);
- __pyx_r = Py_True;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- goto __pyx_L0;
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
-
- /* function exit code */
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- #if !CYTHON_USE_EXC_INFO_STACK
- __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
- #endif
- __pyx_generator->resume_label = -1;
- __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-static PyObject *__pyx_gb_9fontTools_6varLib_3iup_20iup_contour_optimize_5generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
-
-/* "fontTools/varLib/iup.py":393
- * # If all deltas are exactly the same, return just one (the first one):
- * d0 = deltas[0]
- * if all(d0 == d for d in deltas): # <<<<<<<<<<<<<<
- * return [d0] + [None] * (n - 1)
- *
- */
-
-static PyObject *__pyx_pf_9fontTools_6varLib_3iup_20iup_contour_optimize_3genexpr(PyObject *__pyx_self) {
- struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr *__pyx_cur_scope;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("genexpr", 0);
- __pyx_cur_scope = (struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr *)__pyx_tp_new_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr(__pyx_ptype_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr, __pyx_empty_tuple, NULL);
- if (unlikely(!__pyx_cur_scope)) {
- __pyx_cur_scope = ((struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr *)Py_None);
- __Pyx_INCREF(Py_None);
- __PYX_ERR(0, 393, __pyx_L1_error)
- } else {
- __Pyx_GOTREF(__pyx_cur_scope);
- }
- __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize *) __pyx_self;
- __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
- __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
- {
- __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_9fontTools_6varLib_3iup_20iup_contour_optimize_5generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_iup_contour_optimize_locals_gene, __pyx_n_s_fontTools_varLib_iup); if (unlikely(!gen)) __PYX_ERR(0, 393, __pyx_L1_error)
- __Pyx_DECREF(__pyx_cur_scope);
- __Pyx_RefNannyFinishContext();
- return (PyObject *) gen;
- }
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_AddTraceback("fontTools.varLib.iup.iup_contour_optimize.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_gb_9fontTools_6varLib_3iup_20iup_contour_optimize_5generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
-{
- struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr *__pyx_cur_scope = ((struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr *)__pyx_generator->closure);
- PyObject *__pyx_r = NULL;
- PyObject *__pyx_t_1 = NULL;
- Py_ssize_t __pyx_t_2;
- PyObject *(*__pyx_t_3)(PyObject *);
- PyObject *__pyx_t_4 = NULL;
- int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("genexpr", 0);
- switch (__pyx_generator->resume_label) {
- case 0: goto __pyx_L3_first_run;
- default: /* CPython raises the right error here */
- __Pyx_RefNannyFinishContext();
- return NULL;
- }
- __pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 393, __pyx_L1_error)
- if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_deltas)) { __Pyx_RaiseClosureNameError("deltas"); __PYX_ERR(0, 393, __pyx_L1_error) }
- if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_deltas)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_deltas)) {
- __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_deltas; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
- __pyx_t_3 = NULL;
- } else {
- __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_deltas); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 393, __pyx_L1_error)
- }
- for (;;) {
- if (likely(!__pyx_t_3)) {
- if (likely(PyList_CheckExact(__pyx_t_1))) {
- if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 393, __pyx_L1_error)
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 393, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- #endif
- } else {
- if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 393, __pyx_L1_error)
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 393, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- #endif
- }
- } else {
- __pyx_t_4 = __pyx_t_3(__pyx_t_1);
- if (unlikely(!__pyx_t_4)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 393, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_4);
- }
- __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_d);
- __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_d, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_d0)) { __Pyx_RaiseClosureNameError("d0"); __PYX_ERR(0, 393, __pyx_L1_error) }
- __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_d0, __pyx_cur_scope->__pyx_v_d, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 393, __pyx_L1_error)
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 393, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_6 = ((!__pyx_t_5) != 0);
- if (__pyx_t_6) {
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(Py_False);
- __pyx_r = Py_False;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- goto __pyx_L0;
- }
- }
- /*else*/ {
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(Py_True);
- __pyx_r = Py_True;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- goto __pyx_L0;
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
-
- /* function exit code */
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- #if !CYTHON_USE_EXC_INFO_STACK
- __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
- #endif
- __pyx_generator->resume_label = -1;
- __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "fontTools/varLib/iup.py":369
- *
- *
- * def iup_contour_optimize( # <<<<<<<<<<<<<<
- * deltas: _DeltaSegment, coords: _PointSegment, tolerance: Real = 0.0
- * ) -> _DeltaOrNoneSegment:
- */
-
-static PyObject *__pyx_pf_9fontTools_6varLib_3iup_12iup_contour_optimize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_deltas, PyObject *__pyx_v_coords, PyObject *__pyx_v_tolerance) {
- struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize *__pyx_cur_scope;
- PyObject *__pyx_v_n = NULL;
- PyObject *__pyx_v_forced = NULL;
- PyObject *__pyx_v_k = NULL;
- PyObject *__pyx_v_chain = NULL;
- PyObject *__pyx_v_costs = NULL;
- PyObject *__pyx_v_solution = NULL;
- PyObject *__pyx_v_i = NULL;
- PyObject *__pyx_v_best_sol = NULL;
- PyObject *__pyx_v_best_cost = NULL;
- PyObject *__pyx_v_start = NULL;
- PyObject *__pyx_v_cost = NULL;
- PyObject *__pyx_gb_9fontTools_6varLib_3iup_20iup_contour_optimize_2generator1 = 0;
- PyObject *__pyx_gb_9fontTools_6varLib_3iup_20iup_contour_optimize_5generator2 = 0;
- PyObject *__pyx_8genexpr5__pyx_v_i = NULL;
- PyObject *__pyx_8genexpr6__pyx_v_i = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- Py_ssize_t __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_t_4;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_t_6;
- PyObject *__pyx_t_7 = NULL;
- PyObject *(*__pyx_t_8)(PyObject *);
- int __pyx_t_9;
- int __pyx_t_10;
- PyObject *(*__pyx_t_11)(PyObject *);
- PyObject *__pyx_t_12 = NULL;
- PyObject *__pyx_t_13 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("iup_contour_optimize", 0);
- __pyx_cur_scope = (struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize *)__pyx_tp_new_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize(__pyx_ptype_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize, __pyx_empty_tuple, NULL);
- if (unlikely(!__pyx_cur_scope)) {
- __pyx_cur_scope = ((struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize *)Py_None);
- __Pyx_INCREF(Py_None);
- __PYX_ERR(0, 369, __pyx_L1_error)
- } else {
- __Pyx_GOTREF(__pyx_cur_scope);
- }
- __pyx_cur_scope->__pyx_v_deltas = __pyx_v_deltas;
- __Pyx_INCREF(__pyx_cur_scope->__pyx_v_deltas);
- __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_deltas);
- __pyx_cur_scope->__pyx_v_tolerance = __pyx_v_tolerance;
- __Pyx_INCREF(__pyx_cur_scope->__pyx_v_tolerance);
- __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_tolerance);
- __Pyx_INCREF(__pyx_v_coords);
-
- /* "fontTools/varLib/iup.py":379
- * """
- *
- * n = len(deltas) # <<<<<<<<<<<<<<
- *
- * # Get the easy cases out of the way:
- */
- __pyx_t_1 = __pyx_cur_scope->__pyx_v_deltas;
- __Pyx_INCREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 379, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_n = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "fontTools/varLib/iup.py":384
- *
- * # If all are within tolerance distance of 0, encode nothing:
- * if all(abs(complex(*p)) <= tolerance for p in deltas): # <<<<<<<<<<<<<<
- * return [None] * n
- *
- */
- __pyx_t_1 = __pyx_pf_9fontTools_6varLib_3iup_20iup_contour_optimize_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 384, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 384, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 384, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_4) {
-
- /* "fontTools/varLib/iup.py":385
- * # If all are within tolerance distance of 0, encode nothing:
- * if all(abs(complex(*p)) <= tolerance for p in deltas):
- * return [None] * n # <<<<<<<<<<<<<<
- *
- * # If there's exactly one point, return it:
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 385, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(Py_None);
- __Pyx_GIVEREF(Py_None);
- PyList_SET_ITEM(__pyx_t_3, 0, Py_None);
- { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_3, __pyx_v_n); if (unlikely(!__pyx_temp)) __PYX_ERR(0, 385, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_temp);
- __Pyx_DECREF(__pyx_t_3);
- __pyx_t_3 = __pyx_temp;
- }
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- /* "fontTools/varLib/iup.py":384
- *
- * # If all are within tolerance distance of 0, encode nothing:
- * if all(abs(complex(*p)) <= tolerance for p in deltas): # <<<<<<<<<<<<<<
- * return [None] * n
- *
- */
- }
-
- /* "fontTools/varLib/iup.py":388
- *
- * # If there's exactly one point, return it:
- * if n == 1: # <<<<<<<<<<<<<<
- * return deltas
- *
- */
- __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 388, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 388, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_4) {
-
- /* "fontTools/varLib/iup.py":389
- * # If there's exactly one point, return it:
- * if n == 1:
- * return deltas # <<<<<<<<<<<<<<
- *
- * # If all deltas are exactly the same, return just one (the first one):
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_cur_scope->__pyx_v_deltas);
- __pyx_r = __pyx_cur_scope->__pyx_v_deltas;
- goto __pyx_L0;
-
- /* "fontTools/varLib/iup.py":388
- *
- * # If there's exactly one point, return it:
- * if n == 1: # <<<<<<<<<<<<<<
- * return deltas
- *
- */
- }
-
- /* "fontTools/varLib/iup.py":392
- *
- * # If all deltas are exactly the same, return just one (the first one):
- * d0 = deltas[0] # <<<<<<<<<<<<<<
- * if all(d0 == d for d in deltas):
- * return [d0] + [None] * (n - 1)
- */
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_deltas, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 392, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_cur_scope->__pyx_v_d0 = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "fontTools/varLib/iup.py":393
- * # If all deltas are exactly the same, return just one (the first one):
- * d0 = deltas[0]
- * if all(d0 == d for d in deltas): # <<<<<<<<<<<<<<
- * return [d0] + [None] * (n - 1)
- *
- */
- __pyx_t_3 = __pyx_pf_9fontTools_6varLib_3iup_20iup_contour_optimize_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 393, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 393, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_4) {
-
- /* "fontTools/varLib/iup.py":394
- * d0 = deltas[0]
- * if all(d0 == d for d in deltas):
- * return [d0] + [None] * (n - 1) # <<<<<<<<<<<<<<
- *
- * # Else, solve the general problem using Dynamic Programming.
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 394, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_cur_scope->__pyx_v_d0);
- __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_d0);
- PyList_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_d0);
- __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_n, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 394, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(Py_None);
- __Pyx_GIVEREF(Py_None);
- PyList_SET_ITEM(__pyx_t_5, 0, Py_None);
- { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_temp)) __PYX_ERR(0, 394, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_temp);
- __Pyx_DECREF(__pyx_t_5);
- __pyx_t_5 = __pyx_temp;
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- /* "fontTools/varLib/iup.py":393
- * # If all deltas are exactly the same, return just one (the first one):
- * d0 = deltas[0]
- * if all(d0 == d for d in deltas): # <<<<<<<<<<<<<<
- * return [d0] + [None] * (n - 1)
- *
- */
- }
-
- /* "fontTools/varLib/iup.py":398
- * # Else, solve the general problem using Dynamic Programming.
- *
- * forced = _iup_contour_bound_forced_set(deltas, coords, tolerance) # <<<<<<<<<<<<<<
- * # The _iup_contour_optimize_dp() routine returns the optimal encoding
- * # solution given the constraint that the last point is always encoded.
- */
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_iup_contour_bound_forced_set); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 398, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = NULL;
- __pyx_t_6 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_1)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
- __pyx_t_6 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_5)) {
- PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_cur_scope->__pyx_v_deltas, __pyx_v_coords, __pyx_cur_scope->__pyx_v_tolerance};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_3);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
- PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_cur_scope->__pyx_v_deltas, __pyx_v_coords, __pyx_cur_scope->__pyx_v_tolerance};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_3);
- } else
- #endif
- {
- __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 398, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (__pyx_t_1) {
- __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL;
- }
- __Pyx_INCREF(__pyx_cur_scope->__pyx_v_deltas);
- __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_deltas);
- PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_cur_scope->__pyx_v_deltas);
- __Pyx_INCREF(__pyx_v_coords);
- __Pyx_GIVEREF(__pyx_v_coords);
- PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_coords);
- __Pyx_INCREF(__pyx_cur_scope->__pyx_v_tolerance);
- __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_tolerance);
- PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_cur_scope->__pyx_v_tolerance);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_v_forced = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "fontTools/varLib/iup.py":407
- * # if the font size changes (reduced); that would mean the forced-set
- * # has members it should not have.
- * if forced: # <<<<<<<<<<<<<<
- * # Forced set is non-empty: rotate the contour start point
- * # such that the last point in the list is a forced point.
- */
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_forced); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 407, __pyx_L1_error)
- if (__pyx_t_4) {
-
- /* "fontTools/varLib/iup.py":410
- * # Forced set is non-empty: rotate the contour start point
- * # such that the last point in the list is a forced point.
- * k = (n - 1) - max(forced) # <<<<<<<<<<<<<<
- * assert k >= 0
- *
- */
- __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_n, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 410, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_v_forced); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 410, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = PyNumber_Subtract(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 410, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_v_k = __pyx_t_7;
- __pyx_t_7 = 0;
-
- /* "fontTools/varLib/iup.py":411
- * # such that the last point in the list is a forced point.
- * k = (n - 1) - max(forced)
- * assert k >= 0 # <<<<<<<<<<<<<<
- *
- * deltas = _rot_list(deltas, k)
- */
- #ifndef CYTHON_WITHOUT_ASSERTIONS
- if (unlikely(__pyx_assertions_enabled())) {
- __pyx_t_7 = PyObject_RichCompare(__pyx_v_k, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 411, __pyx_L1_error)
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 411, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(!__pyx_t_4)) {
- PyErr_SetNone(PyExc_AssertionError);
- __PYX_ERR(0, 411, __pyx_L1_error)
- }
- }
- #endif
-
- /* "fontTools/varLib/iup.py":413
- * assert k >= 0
- *
- * deltas = _rot_list(deltas, k) # <<<<<<<<<<<<<<
- * coords = _rot_list(coords, k)
- * forced = _rot_set(forced, k, n)
- */
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_rot_list); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 413, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = NULL;
- __pyx_t_6 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_3)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
- __pyx_t_6 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_5)) {
- PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_deltas, __pyx_v_k};
- __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 413, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
- PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_deltas, __pyx_v_k};
- __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 413, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- } else
- #endif
- {
- __pyx_t_1 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (__pyx_t_3) {
- __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL;
- }
- __Pyx_INCREF(__pyx_cur_scope->__pyx_v_deltas);
- __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_deltas);
- PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_6, __pyx_cur_scope->__pyx_v_deltas);
- __Pyx_INCREF(__pyx_v_k);
- __Pyx_GIVEREF(__pyx_v_k);
- PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_6, __pyx_v_k);
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 413, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_deltas);
- __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_deltas, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "fontTools/varLib/iup.py":414
- *
- * deltas = _rot_list(deltas, k)
- * coords = _rot_list(coords, k) # <<<<<<<<<<<<<<
- * forced = _rot_set(forced, k, n)
- *
- */
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_rot_list); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 414, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = NULL;
- __pyx_t_6 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_1)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
- __pyx_t_6 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_5)) {
- PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_coords, __pyx_v_k};
- __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 414, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
- PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_coords, __pyx_v_k};
- __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 414, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- } else
- #endif
- {
- __pyx_t_3 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 414, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- if (__pyx_t_1) {
- __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = NULL;
- }
- __Pyx_INCREF(__pyx_v_coords);
- __Pyx_GIVEREF(__pyx_v_coords);
- PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_v_coords);
- __Pyx_INCREF(__pyx_v_k);
- __Pyx_GIVEREF(__pyx_v_k);
- PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_v_k);
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 414, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF_SET(__pyx_v_coords, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "fontTools/varLib/iup.py":415
- * deltas = _rot_list(deltas, k)
- * coords = _rot_list(coords, k)
- * forced = _rot_set(forced, k, n) # <<<<<<<<<<<<<<
- *
- * # Debugging: Pass a set() instead of forced variable to the next call
- */
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_rot_set); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 415, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = NULL;
- __pyx_t_6 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_3)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
- __pyx_t_6 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_5)) {
- PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_forced, __pyx_v_k, __pyx_v_n};
- __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 415, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
- PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_forced, __pyx_v_k, __pyx_v_n};
- __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 415, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- } else
- #endif
- {
- __pyx_t_1 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (__pyx_t_3) {
- __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL;
- }
- __Pyx_INCREF(__pyx_v_forced);
- __Pyx_GIVEREF(__pyx_v_forced);
- PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_6, __pyx_v_forced);
- __Pyx_INCREF(__pyx_v_k);
- __Pyx_GIVEREF(__pyx_v_k);
- PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_6, __pyx_v_k);
- __Pyx_INCREF(__pyx_v_n);
- __Pyx_GIVEREF(__pyx_v_n);
- PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_6, __pyx_v_n);
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 415, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF_SET(__pyx_v_forced, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "fontTools/varLib/iup.py":419
- * # Debugging: Pass a set() instead of forced variable to the next call
- * # to exercise forced-set computation for under-counting.
- * chain, costs = _iup_contour_optimize_dp(deltas, coords, forced, tolerance) # <<<<<<<<<<<<<<
- *
- * # Assemble solution.
- */
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_iup_contour_optimize_dp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 419, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = NULL;
- __pyx_t_6 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_1)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
- __pyx_t_6 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_5)) {
- PyObject *__pyx_temp[5] = {__pyx_t_1, __pyx_cur_scope->__pyx_v_deltas, __pyx_v_coords, __pyx_v_forced, __pyx_cur_scope->__pyx_v_tolerance};
- __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 419, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
- PyObject *__pyx_temp[5] = {__pyx_t_1, __pyx_cur_scope->__pyx_v_deltas, __pyx_v_coords, __pyx_v_forced, __pyx_cur_scope->__pyx_v_tolerance};
- __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 419, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_7);
- } else
- #endif
- {
- __pyx_t_3 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 419, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- if (__pyx_t_1) {
- __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = NULL;
- }
- __Pyx_INCREF(__pyx_cur_scope->__pyx_v_deltas);
- __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_deltas);
- PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_cur_scope->__pyx_v_deltas);
- __Pyx_INCREF(__pyx_v_coords);
- __Pyx_GIVEREF(__pyx_v_coords);
- PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_v_coords);
- __Pyx_INCREF(__pyx_v_forced);
- __Pyx_GIVEREF(__pyx_v_forced);
- PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_6, __pyx_v_forced);
- __Pyx_INCREF(__pyx_cur_scope->__pyx_v_tolerance);
- __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_tolerance);
- PyTuple_SET_ITEM(__pyx_t_3, 3+__pyx_t_6, __pyx_cur_scope->__pyx_v_tolerance);
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 419, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
- PyObject* sequence = __pyx_t_7;
- Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
- if (unlikely(size != 2)) {
- if (size > 2) __Pyx_RaiseTooManyValuesError(2);
- else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- __PYX_ERR(0, 419, __pyx_L1_error)
- }
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_5 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_3);
- #else
- __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 419, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 419, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- #endif
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_1 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 419, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext;
- index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_5);
- index = 1; __pyx_t_3 = __pyx_t_8(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_3);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_1), 2) < 0) __PYX_ERR(0, 419, __pyx_L1_error)
- __pyx_t_8 = NULL;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- goto __pyx_L8_unpacking_done;
- __pyx_L7_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_8 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 419, __pyx_L1_error)
- __pyx_L8_unpacking_done:;
- }
- __pyx_v_chain = __pyx_t_5;
- __pyx_t_5 = 0;
- __pyx_v_costs = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "fontTools/varLib/iup.py":422
- *
- * # Assemble solution.
- * solution = set() # <<<<<<<<<<<<<<
- * i = n - 1
- * while i is not None:
- */
- __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 422, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_v_solution = ((PyObject*)__pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "fontTools/varLib/iup.py":423
- * # Assemble solution.
- * solution = set()
- * i = n - 1 # <<<<<<<<<<<<<<
- * while i is not None:
- * solution.add(i)
- */
- __pyx_t_7 = __Pyx_PyInt_SubtractObjC(__pyx_v_n, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 423, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_v_i = __pyx_t_7;
- __pyx_t_7 = 0;
-
- /* "fontTools/varLib/iup.py":424
- * solution = set()
- * i = n - 1
- * while i is not None: # <<<<<<<<<<<<<<
- * solution.add(i)
- * i = chain[i]
- */
- while (1) {
- __pyx_t_4 = (__pyx_v_i != Py_None);
- __pyx_t_9 = (__pyx_t_4 != 0);
- if (!__pyx_t_9) break;
-
- /* "fontTools/varLib/iup.py":425
- * i = n - 1
- * while i is not None:
- * solution.add(i) # <<<<<<<<<<<<<<
- * i = chain[i]
- * solution.remove(-1)
- */
- __pyx_t_10 = PySet_Add(__pyx_v_solution, __pyx_v_i); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 425, __pyx_L1_error)
-
- /* "fontTools/varLib/iup.py":426
- * while i is not None:
- * solution.add(i)
- * i = chain[i] # <<<<<<<<<<<<<<
- * solution.remove(-1)
- *
- */
- __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_chain, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 426, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_7);
- __pyx_t_7 = 0;
- }
-
- /* "fontTools/varLib/iup.py":427
- * solution.add(i)
- * i = chain[i]
- * solution.remove(-1) # <<<<<<<<<<<<<<
- *
- * # if not forced <= solution:
- */
- __pyx_t_10 = __Pyx_PySet_Remove(__pyx_v_solution, __pyx_int_neg_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 427, __pyx_L1_error)
-
- /* "fontTools/varLib/iup.py":433
- * # print("deltas", deltas)
- * # print("len", len(deltas))
- * assert forced <= solution, (forced, solution) # <<<<<<<<<<<<<<
- *
- * deltas = [deltas[i] if i in solution else None for i in range(n)]
- */
- #ifndef CYTHON_WITHOUT_ASSERTIONS
- if (unlikely(__pyx_assertions_enabled())) {
- __pyx_t_7 = PyObject_RichCompare(__pyx_v_forced, __pyx_v_solution, Py_LE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 433, __pyx_L1_error)
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 433, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (unlikely(!__pyx_t_9)) {
- __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 433, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_INCREF(__pyx_v_forced);
- __Pyx_GIVEREF(__pyx_v_forced);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_forced);
- __Pyx_INCREF(__pyx_v_solution);
- __Pyx_GIVEREF(__pyx_v_solution);
- PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_solution);
- __pyx_t_3 = PyTuple_Pack(1, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 433, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- PyErr_SetObject(PyExc_AssertionError, __pyx_t_3);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(0, 433, __pyx_L1_error)
- }
- }
- #endif
-
- /* "fontTools/varLib/iup.py":435
- * assert forced <= solution, (forced, solution)
- *
- * deltas = [deltas[i] if i in solution else None for i in range(n)] # <<<<<<<<<<<<<<
- *
- * deltas = _rot_list(deltas, -k)
- */
- { /* enter inner scope */
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 435, __pyx_L13_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_n); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 435, __pyx_L13_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
- __pyx_t_5 = __pyx_t_7; __Pyx_INCREF(__pyx_t_5); __pyx_t_2 = 0;
- __pyx_t_11 = NULL;
- } else {
- __pyx_t_2 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 435, __pyx_L13_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 435, __pyx_L13_error)
- }
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- for (;;) {
- if (likely(!__pyx_t_11)) {
- if (likely(PyList_CheckExact(__pyx_t_5))) {
- if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_5)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_7 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 435, __pyx_L13_error)
- #else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 435, __pyx_L13_error)
- __Pyx_GOTREF(__pyx_t_7);
- #endif
- } else {
- if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 435, __pyx_L13_error)
- #else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 435, __pyx_L13_error)
- __Pyx_GOTREF(__pyx_t_7);
- #endif
- }
- } else {
- __pyx_t_7 = __pyx_t_11(__pyx_t_5);
- if (unlikely(!__pyx_t_7)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 435, __pyx_L13_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_7);
- }
- __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_i, __pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_9 = (__Pyx_PySet_ContainsTF(__pyx_8genexpr5__pyx_v_i, __pyx_v_solution, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 435, __pyx_L13_error)
- if ((__pyx_t_9 != 0)) {
- __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_deltas, __pyx_8genexpr5__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L13_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = __pyx_t_1;
- __pyx_t_1 = 0;
- } else {
- __Pyx_INCREF(Py_None);
- __pyx_t_7 = Py_None;
- }
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 435, __pyx_L13_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_i); __pyx_8genexpr5__pyx_v_i = 0;
- goto __pyx_L16_exit_scope;
- __pyx_L13_error:;
- __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_i); __pyx_8genexpr5__pyx_v_i = 0;
- goto __pyx_L1_error;
- __pyx_L16_exit_scope:;
- } /* exit inner scope */
- __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_deltas);
- __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_deltas, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "fontTools/varLib/iup.py":437
- * deltas = [deltas[i] if i in solution else None for i in range(n)]
- *
- * deltas = _rot_list(deltas, -k) # <<<<<<<<<<<<<<
- * else:
- * # Repeat the contour an extra time, solve the new case, then look for solutions of the
- */
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_rot_list); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 437, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = PyNumber_Negative(__pyx_v_k); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 437, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_1 = NULL;
- __pyx_t_6 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_1)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
- __pyx_t_6 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_5)) {
- PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_cur_scope->__pyx_v_deltas, __pyx_t_7};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
- PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_cur_scope->__pyx_v_deltas, __pyx_t_7};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else
- #endif
- {
- __pyx_t_12 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 437, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- if (__pyx_t_1) {
- __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1); __pyx_t_1 = NULL;
- }
- __Pyx_INCREF(__pyx_cur_scope->__pyx_v_deltas);
- __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_deltas);
- PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_6, __pyx_cur_scope->__pyx_v_deltas);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_6, __pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_deltas);
- __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_deltas, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "fontTools/varLib/iup.py":407
- * # if the font size changes (reduced); that would mean the forced-set
- * # has members it should not have.
- * if forced: # <<<<<<<<<<<<<<
- * # Forced set is non-empty: rotate the contour start point
- * # such that the last point in the list is a forced point.
- */
- goto __pyx_L6;
- }
-
- /* "fontTools/varLib/iup.py":442
- * # circular n-length problem in the solution for new linear case. I cannot prove that
- * # this always produces the optimal solution...
- * chain, costs = _iup_contour_optimize_dp( # <<<<<<<<<<<<<<
- * deltas + deltas, coords + coords, forced, tolerance, n
- * )
- */
- /*else*/ {
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_iup_contour_optimize_dp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 442, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
-
- /* "fontTools/varLib/iup.py":443
- * # this always produces the optimal solution...
- * chain, costs = _iup_contour_optimize_dp(
- * deltas + deltas, coords + coords, forced, tolerance, n # <<<<<<<<<<<<<<
- * )
- * best_sol, best_cost = None, n + 1
- */
- __pyx_t_12 = PyNumber_Add(__pyx_cur_scope->__pyx_v_deltas, __pyx_cur_scope->__pyx_v_deltas); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 443, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_7 = PyNumber_Add(__pyx_v_coords, __pyx_v_coords); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 443, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_1 = NULL;
- __pyx_t_6 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_1)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
- __pyx_t_6 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_5)) {
- PyObject *__pyx_temp[6] = {__pyx_t_1, __pyx_t_12, __pyx_t_7, __pyx_v_forced, __pyx_cur_scope->__pyx_v_tolerance, __pyx_v_n};
- __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 5+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
- PyObject *__pyx_temp[6] = {__pyx_t_1, __pyx_t_12, __pyx_t_7, __pyx_v_forced, __pyx_cur_scope->__pyx_v_tolerance, __pyx_v_n};
- __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 5+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- } else
- #endif
- {
- __pyx_t_13 = PyTuple_New(5+__pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 442, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- if (__pyx_t_1) {
- __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1); __pyx_t_1 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_12);
- PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_6, __pyx_t_12);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_6, __pyx_t_7);
- __Pyx_INCREF(__pyx_v_forced);
- __Pyx_GIVEREF(__pyx_v_forced);
- PyTuple_SET_ITEM(__pyx_t_13, 2+__pyx_t_6, __pyx_v_forced);
- __Pyx_INCREF(__pyx_cur_scope->__pyx_v_tolerance);
- __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_tolerance);
- PyTuple_SET_ITEM(__pyx_t_13, 3+__pyx_t_6, __pyx_cur_scope->__pyx_v_tolerance);
- __Pyx_INCREF(__pyx_v_n);
- __Pyx_GIVEREF(__pyx_v_n);
- PyTuple_SET_ITEM(__pyx_t_13, 4+__pyx_t_6, __pyx_v_n);
- __pyx_t_12 = 0;
- __pyx_t_7 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
- PyObject* sequence = __pyx_t_3;
- Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
- if (unlikely(size != 2)) {
- if (size > 2) __Pyx_RaiseTooManyValuesError(2);
- else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- __PYX_ERR(0, 442, __pyx_L1_error)
- }
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_5 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_13 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_13);
- #else
- __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 442, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 442, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- #endif
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else {
- Py_ssize_t index = -1;
- __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 442, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
- index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L17_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_5);
- index = 1; __pyx_t_13 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_13)) goto __pyx_L17_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_13);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 442, __pyx_L1_error)
- __pyx_t_8 = NULL;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- goto __pyx_L18_unpacking_done;
- __pyx_L17_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_8 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- __PYX_ERR(0, 442, __pyx_L1_error)
- __pyx_L18_unpacking_done:;
- }
-
- /* "fontTools/varLib/iup.py":442
- * # circular n-length problem in the solution for new linear case. I cannot prove that
- * # this always produces the optimal solution...
- * chain, costs = _iup_contour_optimize_dp( # <<<<<<<<<<<<<<
- * deltas + deltas, coords + coords, forced, tolerance, n
- * )
- */
- __pyx_v_chain = __pyx_t_5;
- __pyx_t_5 = 0;
- __pyx_v_costs = __pyx_t_13;
- __pyx_t_13 = 0;
-
- /* "fontTools/varLib/iup.py":445
- * deltas + deltas, coords + coords, forced, tolerance, n
- * )
- * best_sol, best_cost = None, n + 1 # <<<<<<<<<<<<<<
- *
- * for start in range(n - 1, len(costs) - 1):
- */
- __pyx_t_3 = Py_None;
- __Pyx_INCREF(__pyx_t_3);
- __pyx_t_13 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 445, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_v_best_sol = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_v_best_cost = __pyx_t_13;
- __pyx_t_13 = 0;
-
- /* "fontTools/varLib/iup.py":447
- * best_sol, best_cost = None, n + 1
- *
- * for start in range(n - 1, len(costs) - 1): # <<<<<<<<<<<<<<
- * # Assemble solution.
- * solution = set()
- */
- __pyx_t_13 = __Pyx_PyInt_SubtractObjC(__pyx_v_n, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 447, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_2 = PyObject_Length(__pyx_v_costs); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 447, __pyx_L1_error)
- __pyx_t_3 = PyInt_FromSsize_t((__pyx_t_2 - 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 447, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_13);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_13);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
- __pyx_t_13 = 0;
- __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
- __pyx_t_5 = __pyx_t_3; __Pyx_INCREF(__pyx_t_5); __pyx_t_2 = 0;
- __pyx_t_11 = NULL;
- } else {
- __pyx_t_2 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 447, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 447, __pyx_L1_error)
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- for (;;) {
- if (likely(!__pyx_t_11)) {
- if (likely(PyList_CheckExact(__pyx_t_5))) {
- if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_5)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 447, __pyx_L1_error)
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- #endif
- } else {
- if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 447, __pyx_L1_error)
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- #endif
- }
- } else {
- __pyx_t_3 = __pyx_t_11(__pyx_t_5);
- if (unlikely(!__pyx_t_3)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 447, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_3);
- }
- __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "fontTools/varLib/iup.py":449
- * for start in range(n - 1, len(costs) - 1):
- * # Assemble solution.
- * solution = set() # <<<<<<<<<<<<<<
- * i = start
- * while i > start - n:
- */
- __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 449, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_XDECREF_SET(__pyx_v_solution, ((PyObject*)__pyx_t_3));
- __pyx_t_3 = 0;
-
- /* "fontTools/varLib/iup.py":450
- * # Assemble solution.
- * solution = set()
- * i = start # <<<<<<<<<<<<<<
- * while i > start - n:
- * solution.add(i % n)
- */
- __Pyx_INCREF(__pyx_v_start);
- __Pyx_XDECREF_SET(__pyx_v_i, __pyx_v_start);
-
- /* "fontTools/varLib/iup.py":451
- * solution = set()
- * i = start
- * while i > start - n: # <<<<<<<<<<<<<<
- * solution.add(i % n)
- * i = chain[i]
- */
- while (1) {
- __pyx_t_3 = PyNumber_Subtract(__pyx_v_start, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_13 = PyObject_RichCompare(__pyx_v_i, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 451, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 451, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- if (!__pyx_t_9) break;
-
- /* "fontTools/varLib/iup.py":452
- * i = start
- * while i > start - n:
- * solution.add(i % n) # <<<<<<<<<<<<<<
- * i = chain[i]
- * if i == start - n:
- */
- __pyx_t_13 = PyNumber_Remainder(__pyx_v_i, __pyx_v_n); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 452, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_10 = PySet_Add(__pyx_v_solution, __pyx_t_13); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 452, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-
- /* "fontTools/varLib/iup.py":453
- * while i > start - n:
- * solution.add(i % n)
- * i = chain[i] # <<<<<<<<<<<<<<
- * if i == start - n:
- * cost = costs[start] - costs[start - n]
- */
- __pyx_t_13 = __Pyx_PyObject_GetItem(__pyx_v_chain, __pyx_v_i); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 453, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_13);
- __pyx_t_13 = 0;
- }
-
- /* "fontTools/varLib/iup.py":454
- * solution.add(i % n)
- * i = chain[i]
- * if i == start - n: # <<<<<<<<<<<<<<
- * cost = costs[start] - costs[start - n]
- * if cost <= best_cost:
- */
- __pyx_t_13 = PyNumber_Subtract(__pyx_v_start, __pyx_v_n); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 454, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_i, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 454, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_9) {
-
- /* "fontTools/varLib/iup.py":455
- * i = chain[i]
- * if i == start - n:
- * cost = costs[start] - costs[start - n] # <<<<<<<<<<<<<<
- * if cost <= best_cost:
- * best_sol, best_cost = solution, cost
- */
- __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_costs, __pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 455, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_13 = PyNumber_Subtract(__pyx_v_start, __pyx_v_n); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 455, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_costs, __pyx_t_13); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 455, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_13 = PyNumber_Subtract(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 455, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_XDECREF_SET(__pyx_v_cost, __pyx_t_13);
- __pyx_t_13 = 0;
-
- /* "fontTools/varLib/iup.py":456
- * if i == start - n:
- * cost = costs[start] - costs[start - n]
- * if cost <= best_cost: # <<<<<<<<<<<<<<
- * best_sol, best_cost = solution, cost
- *
- */
- __pyx_t_13 = PyObject_RichCompare(__pyx_v_cost, __pyx_v_best_cost, Py_LE); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 456, __pyx_L1_error)
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 456, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- if (__pyx_t_9) {
-
- /* "fontTools/varLib/iup.py":457
- * cost = costs[start] - costs[start - n]
- * if cost <= best_cost:
- * best_sol, best_cost = solution, cost # <<<<<<<<<<<<<<
- *
- * # if not forced <= best_sol:
- */
- __pyx_t_13 = __pyx_v_solution;
- __Pyx_INCREF(__pyx_t_13);
- __pyx_t_7 = __pyx_v_cost;
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_DECREF_SET(__pyx_v_best_sol, ((PyObject*)__pyx_t_13));
- __pyx_t_13 = 0;
- __Pyx_DECREF_SET(__pyx_v_best_cost, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "fontTools/varLib/iup.py":456
- * if i == start - n:
- * cost = costs[start] - costs[start - n]
- * if cost <= best_cost: # <<<<<<<<<<<<<<
- * best_sol, best_cost = solution, cost
- *
- */
- }
-
- /* "fontTools/varLib/iup.py":454
- * solution.add(i % n)
- * i = chain[i]
- * if i == start - n: # <<<<<<<<<<<<<<
- * cost = costs[start] - costs[start - n]
- * if cost <= best_cost:
- */
- }
-
- /* "fontTools/varLib/iup.py":447
- * best_sol, best_cost = None, n + 1
- *
- * for start in range(n - 1, len(costs) - 1): # <<<<<<<<<<<<<<
- * # Assemble solution.
- * solution = set()
- */
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
- /* "fontTools/varLib/iup.py":463
- * # print("deltas", deltas)
- * # print("len", len(deltas))
- * assert forced <= best_sol, (forced, best_sol) # <<<<<<<<<<<<<<
- *
- * deltas = [deltas[i] if i in best_sol else None for i in range(n)]
- */
- #ifndef CYTHON_WITHOUT_ASSERTIONS
- if (unlikely(__pyx_assertions_enabled())) {
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_forced, __pyx_v_best_sol, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 463, __pyx_L1_error)
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 463, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (unlikely(!__pyx_t_9)) {
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 463, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(__pyx_v_forced);
- __Pyx_GIVEREF(__pyx_v_forced);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_forced);
- __Pyx_INCREF(__pyx_v_best_sol);
- __Pyx_GIVEREF(__pyx_v_best_sol);
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_best_sol);
- __pyx_t_7 = PyTuple_Pack(1, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 463, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- PyErr_SetObject(PyExc_AssertionError, __pyx_t_7);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __PYX_ERR(0, 463, __pyx_L1_error)
- }
- }
- #endif
-
- /* "fontTools/varLib/iup.py":465
- * assert forced <= best_sol, (forced, best_sol)
- *
- * deltas = [deltas[i] if i in best_sol else None for i in range(n)] # <<<<<<<<<<<<<<
- *
- * return deltas
- */
- { /* enter inner scope */
- __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 465, __pyx_L27_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 465, __pyx_L27_error)
- __Pyx_GOTREF(__pyx_t_5);
- if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
- __pyx_t_13 = __pyx_t_5; __Pyx_INCREF(__pyx_t_13); __pyx_t_2 = 0;
- __pyx_t_11 = NULL;
- } else {
- __pyx_t_2 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 465, __pyx_L27_error)
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_11 = Py_TYPE(__pyx_t_13)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 465, __pyx_L27_error)
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- for (;;) {
- if (likely(!__pyx_t_11)) {
- if (likely(PyList_CheckExact(__pyx_t_13))) {
- if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_13)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_5 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 465, __pyx_L27_error)
- #else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_13, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 465, __pyx_L27_error)
- __Pyx_GOTREF(__pyx_t_5);
- #endif
- } else {
- if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_13)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 465, __pyx_L27_error)
- #else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_13, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 465, __pyx_L27_error)
- __Pyx_GOTREF(__pyx_t_5);
- #endif
- }
- } else {
- __pyx_t_5 = __pyx_t_11(__pyx_t_13);
- if (unlikely(!__pyx_t_5)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 465, __pyx_L27_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_5);
- }
- __Pyx_XDECREF_SET(__pyx_8genexpr6__pyx_v_i, __pyx_t_5);
- __pyx_t_5 = 0;
- if (unlikely(__pyx_v_best_sol == Py_None)) {
- PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
- __PYX_ERR(0, 465, __pyx_L27_error)
- }
- __pyx_t_9 = (__Pyx_PySet_ContainsTF(__pyx_8genexpr6__pyx_v_i, __pyx_v_best_sol, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 465, __pyx_L27_error)
- if ((__pyx_t_9 != 0)) {
- __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_deltas, __pyx_8genexpr6__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L27_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __pyx_t_3;
- __pyx_t_3 = 0;
- } else {
- __Pyx_INCREF(Py_None);
- __pyx_t_5 = Py_None;
- }
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 465, __pyx_L27_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- }
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_i); __pyx_8genexpr6__pyx_v_i = 0;
- goto __pyx_L30_exit_scope;
- __pyx_L27_error:;
- __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_i); __pyx_8genexpr6__pyx_v_i = 0;
- goto __pyx_L1_error;
- __pyx_L30_exit_scope:;
- } /* exit inner scope */
- __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_deltas);
- __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_deltas, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_7 = 0;
- }
- __pyx_L6:;
-
- /* "fontTools/varLib/iup.py":467
- * deltas = [deltas[i] if i in best_sol else None for i in range(n)]
- *
- * return deltas # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_cur_scope->__pyx_v_deltas);
- __pyx_r = __pyx_cur_scope->__pyx_v_deltas;
- goto __pyx_L0;
-
- /* "fontTools/varLib/iup.py":369
- *
- *
- * def iup_contour_optimize( # <<<<<<<<<<<<<<
- * deltas: _DeltaSegment, coords: _PointSegment, tolerance: Real = 0.0
- * ) -> _DeltaOrNoneSegment:
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_12);
- __Pyx_XDECREF(__pyx_t_13);
- __Pyx_AddTraceback("fontTools.varLib.iup.iup_contour_optimize", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_n);
- __Pyx_XDECREF(__pyx_v_forced);
- __Pyx_XDECREF(__pyx_v_k);
- __Pyx_XDECREF(__pyx_v_chain);
- __Pyx_XDECREF(__pyx_v_costs);
- __Pyx_XDECREF(__pyx_v_solution);
- __Pyx_XDECREF(__pyx_v_i);
- __Pyx_XDECREF(__pyx_v_best_sol);
- __Pyx_XDECREF(__pyx_v_best_cost);
- __Pyx_XDECREF(__pyx_v_start);
- __Pyx_XDECREF(__pyx_v_cost);
- __Pyx_XDECREF(__pyx_gb_9fontTools_6varLib_3iup_20iup_contour_optimize_2generator1);
- __Pyx_XDECREF(__pyx_gb_9fontTools_6varLib_3iup_20iup_contour_optimize_5generator2);
- __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_i);
- __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_i);
- __Pyx_XDECREF(__pyx_v_coords);
- __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "fontTools/varLib/iup.py":470
- *
- *
- * def iup_delta_optimize( # <<<<<<<<<<<<<<
- * deltas: _DeltaSegment,
- * coords: _PointSegment,
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_9fontTools_6varLib_3iup_15iup_delta_optimize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9fontTools_6varLib_3iup_14iup_delta_optimize[] = "iup_delta_optimize(deltas: _DeltaSegment, coords: _PointSegment, ends: _Endpoints, tolerance: Real = 0.0) -> _DeltaOrNoneSegment\nFor the outline given in `coords`, with contour endpoints given\n in sorted increasing order in `ends`, optimize a set of delta\n values `deltas` within error `tolerance`.\n\n Returns delta vector that has most number of None items instead of\n the input delta.\n ";
-static PyMethodDef __pyx_mdef_9fontTools_6varLib_3iup_15iup_delta_optimize = {"iup_delta_optimize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9fontTools_6varLib_3iup_15iup_delta_optimize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9fontTools_6varLib_3iup_14iup_delta_optimize};
-static PyObject *__pyx_pw_9fontTools_6varLib_3iup_15iup_delta_optimize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_deltas = 0;
- PyObject *__pyx_v_coords = 0;
- PyObject *__pyx_v_ends = 0;
- PyObject *__pyx_v_tolerance = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("iup_delta_optimize (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_deltas,&__pyx_n_s_coords,&__pyx_n_s_ends,&__pyx_n_s_tolerance,0};
- PyObject* values[4] = {0,0,0,0};
- values[3] = ((PyObject *)((PyObject*)__pyx_float_0_0));
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
- CYTHON_FALLTHROUGH;
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- CYTHON_FALLTHROUGH;
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- CYTHON_FALLTHROUGH;
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- CYTHON_FALLTHROUGH;
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_deltas)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- CYTHON_FALLTHROUGH;
- case 1:
- if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("iup_delta_optimize", 0, 3, 4, 1); __PYX_ERR(0, 470, __pyx_L3_error)
- }
- CYTHON_FALLTHROUGH;
- case 2:
- if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ends)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("iup_delta_optimize", 0, 3, 4, 2); __PYX_ERR(0, 470, __pyx_L3_error)
- }
- CYTHON_FALLTHROUGH;
- case 3:
- if (kw_args > 0) {
- PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tolerance);
- if (value) { values[3] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iup_delta_optimize") < 0)) __PYX_ERR(0, 470, __pyx_L3_error)
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
- CYTHON_FALLTHROUGH;
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_deltas = values[0];
- __pyx_v_coords = values[1];
- __pyx_v_ends = values[2];
- __pyx_v_tolerance = values[3];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("iup_delta_optimize", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 470, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("fontTools.varLib.iup.iup_delta_optimize", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9fontTools_6varLib_3iup_14iup_delta_optimize(__pyx_self, __pyx_v_deltas, __pyx_v_coords, __pyx_v_ends, __pyx_v_tolerance);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_9fontTools_6varLib_3iup_14iup_delta_optimize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_deltas, PyObject *__pyx_v_coords, PyObject *__pyx_v_ends, PyObject *__pyx_v_tolerance) {
- PyObject *__pyx_v_n = NULL;
- PyObject *__pyx_v_out = NULL;
- PyObject *__pyx_v_start = NULL;
- PyObject *__pyx_v_end = NULL;
- PyObject *__pyx_v_contour = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_t_4;
- int __pyx_t_5;
- Py_ssize_t __pyx_t_6;
- PyObject *__pyx_t_7 = NULL;
- PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
- PyObject *(*__pyx_t_10)(PyObject *);
- PyObject *__pyx_t_11 = NULL;
- int __pyx_t_12;
- PyObject *__pyx_t_13 = NULL;
- Py_ssize_t __pyx_t_14;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("iup_delta_optimize", 0);
- __Pyx_INCREF(__pyx_v_ends);
-
- /* "fontTools/varLib/iup.py":483
- * the input delta.
- * """
- * assert sorted(ends) == ends and len(coords) == (ends[-1] + 1 if ends else 0) + 4 # <<<<<<<<<<<<<<
- * n = len(coords)
- * ends = ends + [n - 4, n - 3, n - 2, n - 1]
- */
- #ifndef CYTHON_WITHOUT_ASSERTIONS
- if (unlikely(__pyx_assertions_enabled())) {
- __pyx_t_3 = PySequence_List(__pyx_v_ends); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 483, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_4 = PyList_Sort(__pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 483, __pyx_L1_error)
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_v_ends, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 483, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 483, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_5) {
- } else {
- __pyx_t_1 = __pyx_t_5;
- goto __pyx_L3_bool_binop_done;
- }
- __pyx_t_6 = PyObject_Length(__pyx_v_coords); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 483, __pyx_L1_error)
- __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 483, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_ends); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 483, __pyx_L1_error)
- if (__pyx_t_5) {
- __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_ends, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 483, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 483, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_2 = __pyx_t_8;
- __pyx_t_8 = 0;
- } else {
- __Pyx_INCREF(__pyx_int_0);
- __pyx_t_2 = __pyx_int_0;
- }
- __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_4, 4, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 483, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 483, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_1 = __pyx_t_5;
- __pyx_L3_bool_binop_done:;
- if (unlikely(!__pyx_t_1)) {
- PyErr_SetNone(PyExc_AssertionError);
- __PYX_ERR(0, 483, __pyx_L1_error)
- }
- }
- #endif
-
- /* "fontTools/varLib/iup.py":484
- * """
- * assert sorted(ends) == ends and len(coords) == (ends[-1] + 1 if ends else 0) + 4
- * n = len(coords) # <<<<<<<<<<<<<<
- * ends = ends + [n - 4, n - 3, n - 2, n - 1]
- * out = []
- */
- __pyx_t_6 = PyObject_Length(__pyx_v_coords); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 484, __pyx_L1_error)
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_v_n = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "fontTools/varLib/iup.py":485
- * assert sorted(ends) == ends and len(coords) == (ends[-1] + 1 if ends else 0) + 4
- * n = len(coords)
- * ends = ends + [n - 4, n - 3, n - 2, n - 1] # <<<<<<<<<<<<<<
- * out = []
- * start = 0
- */
- __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_n, __pyx_int_4, 4, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 485, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_8 = __Pyx_PyInt_SubtractObjC(__pyx_v_n, __pyx_int_3, 3, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 485, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_n, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 485, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = __Pyx_PyInt_SubtractObjC(__pyx_v_n, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 485, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_9 = PyList_New(4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 485, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_2);
- PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_8);
- PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_3);
- PyList_SET_ITEM(__pyx_t_9, 2, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_7);
- PyList_SET_ITEM(__pyx_t_9, 3, __pyx_t_7);
- __pyx_t_2 = 0;
- __pyx_t_8 = 0;
- __pyx_t_3 = 0;
- __pyx_t_7 = 0;
- __pyx_t_7 = PyNumber_Add(__pyx_v_ends, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 485, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF_SET(__pyx_v_ends, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "fontTools/varLib/iup.py":486
- * n = len(coords)
- * ends = ends + [n - 4, n - 3, n - 2, n - 1]
- * out = [] # <<<<<<<<<<<<<<
- * start = 0
- * for end in ends:
- */
- __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 486, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_v_out = ((PyObject*)__pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "fontTools/varLib/iup.py":487
- * ends = ends + [n - 4, n - 3, n - 2, n - 1]
- * out = []
- * start = 0 # <<<<<<<<<<<<<<
- * for end in ends:
- * contour = iup_contour_optimize(
- */
- __Pyx_INCREF(__pyx_int_0);
- __pyx_v_start = __pyx_int_0;
-
- /* "fontTools/varLib/iup.py":488
- * out = []
- * start = 0
- * for end in ends: # <<<<<<<<<<<<<<
- * contour = iup_contour_optimize(
- * deltas[start : end + 1], coords[start : end + 1], tolerance
- */
- if (likely(PyList_CheckExact(__pyx_v_ends)) || PyTuple_CheckExact(__pyx_v_ends)) {
- __pyx_t_7 = __pyx_v_ends; __Pyx_INCREF(__pyx_t_7); __pyx_t_6 = 0;
- __pyx_t_10 = NULL;
- } else {
- __pyx_t_6 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_ends); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 488, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_10 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 488, __pyx_L1_error)
- }
- for (;;) {
- if (likely(!__pyx_t_10)) {
- if (likely(PyList_CheckExact(__pyx_t_7))) {
- if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_7)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_9 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 488, __pyx_L1_error)
- #else
- __pyx_t_9 = PySequence_ITEM(__pyx_t_7, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 488, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- #endif
- } else {
- if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 488, __pyx_L1_error)
- #else
- __pyx_t_9 = PySequence_ITEM(__pyx_t_7, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 488, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- #endif
- }
- } else {
- __pyx_t_9 = __pyx_t_10(__pyx_t_7);
- if (unlikely(!__pyx_t_9)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(0, 488, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_9);
- }
- __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_9);
- __pyx_t_9 = 0;
-
- /* "fontTools/varLib/iup.py":489
- * start = 0
- * for end in ends:
- * contour = iup_contour_optimize( # <<<<<<<<<<<<<<
- * deltas[start : end + 1], coords[start : end + 1], tolerance
- * )
- */
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_iup_contour_optimize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 489, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
-
- /* "fontTools/varLib/iup.py":490
- * for end in ends:
- * contour = iup_contour_optimize(
- * deltas[start : end + 1], coords[start : end + 1], tolerance # <<<<<<<<<<<<<<
- * )
- * assert len(contour) == end - start + 1
- */
- __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_v_end, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 490, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_deltas, 0, 0, &__pyx_v_start, &__pyx_t_8, NULL, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 490, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_v_end, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 490, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_11 = __Pyx_PyObject_GetSlice(__pyx_v_coords, 0, 0, &__pyx_v_start, &__pyx_t_8, NULL, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 490, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = NULL;
- __pyx_t_12 = 0;
- if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_8)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_8);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_3, function);
- __pyx_t_12 = 1;
- }
- }
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_2, __pyx_t_11, __pyx_v_tolerance};
- __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 489, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- } else
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
- PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_2, __pyx_t_11, __pyx_v_tolerance};
- __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 489, __pyx_L1_error)
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- } else
- #endif
- {
- __pyx_t_13 = PyTuple_New(3+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 489, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- if (__pyx_t_8) {
- __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_8); __pyx_t_8 = NULL;
- }
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, __pyx_t_11);
- __Pyx_INCREF(__pyx_v_tolerance);
- __Pyx_GIVEREF(__pyx_v_tolerance);
- PyTuple_SET_ITEM(__pyx_t_13, 2+__pyx_t_12, __pyx_v_tolerance);
- __pyx_t_2 = 0;
- __pyx_t_11 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 489, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_XDECREF_SET(__pyx_v_contour, __pyx_t_9);
- __pyx_t_9 = 0;
-
- /* "fontTools/varLib/iup.py":492
- * deltas[start : end + 1], coords[start : end + 1], tolerance
- * )
- * assert len(contour) == end - start + 1 # <<<<<<<<<<<<<<
- * out.extend(contour)
- * start = end + 1
- */
- #ifndef CYTHON_WITHOUT_ASSERTIONS
- if (unlikely(__pyx_assertions_enabled())) {
- __pyx_t_14 = PyObject_Length(__pyx_v_contour); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 492, __pyx_L1_error)
- __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 492, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_3 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 492, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_13 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 492, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_9, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 492, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 492, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(!__pyx_t_1)) {
- PyErr_SetNone(PyExc_AssertionError);
- __PYX_ERR(0, 492, __pyx_L1_error)
- }
- }
- #endif
-
- /* "fontTools/varLib/iup.py":493
- * )
- * assert len(contour) == end - start + 1
- * out.extend(contour) # <<<<<<<<<<<<<<
- * start = end + 1
- *
- */
- __pyx_t_4 = __Pyx_PyList_Extend(__pyx_v_out, __pyx_v_contour); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 493, __pyx_L1_error)
-
- /* "fontTools/varLib/iup.py":494
- * assert len(contour) == end - start + 1
- * out.extend(contour)
- * start = end + 1 # <<<<<<<<<<<<<<
- *
- * return out
- */
- __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_end, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF_SET(__pyx_v_start, __pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "fontTools/varLib/iup.py":488
- * out = []
- * start = 0
- * for end in ends: # <<<<<<<<<<<<<<
- * contour = iup_contour_optimize(
- * deltas[start : end + 1], coords[start : end + 1], tolerance
- */
- }
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "fontTools/varLib/iup.py":496
- * start = end + 1
- *
- * return out # <<<<<<<<<<<<<<
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_out);
- __pyx_r = __pyx_v_out;
- goto __pyx_L0;
-
- /* "fontTools/varLib/iup.py":470
- *
- *
- * def iup_delta_optimize( # <<<<<<<<<<<<<<
- * deltas: _DeltaSegment,
- * coords: _PointSegment,
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_9);
- __Pyx_XDECREF(__pyx_t_11);
- __Pyx_XDECREF(__pyx_t_13);
- __Pyx_AddTraceback("fontTools.varLib.iup.iup_delta_optimize", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_n);
- __Pyx_XDECREF(__pyx_v_out);
- __Pyx_XDECREF(__pyx_v_start);
- __Pyx_XDECREF(__pyx_v_end);
- __Pyx_XDECREF(__pyx_v_contour);
- __Pyx_XDECREF(__pyx_v_ends);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between *__pyx_freelist_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between[8];
-static int __pyx_freecount_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between = 0;
-
-static PyObject *__pyx_tp_new_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- PyObject *o;
- if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between)))) {
- o = (PyObject*)__pyx_freelist_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between[--__pyx_freecount_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between];
- memset(o, 0, sizeof(struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between));
- (void) PyObject_INIT(o, t);
- PyObject_GC_Track(o);
- } else {
- o = (*t->tp_alloc)(t, 0);
- if (unlikely(!o)) return 0;
- }
- return o;
-}
-
-static void __pyx_tp_dealloc_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between(PyObject *o) {
- struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between *p = (struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between *)o;
- PyObject_GC_UnTrack(o);
- Py_CLEAR(p->__pyx_v_deltas);
- Py_CLEAR(p->__pyx_v_interp);
- if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between)))) {
- __pyx_freelist_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between[__pyx_freecount_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between++] = ((struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between *)o);
- } else {
- (*Py_TYPE(o)->tp_free)(o);
- }
-}
-
-static int __pyx_tp_traverse_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between(PyObject *o, visitproc v, void *a) {
- int e;
- struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between *p = (struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between *)o;
- if (p->__pyx_v_deltas) {
- e = (*v)(p->__pyx_v_deltas, a); if (e) return e;
- }
- if (p->__pyx_v_interp) {
- e = (*v)(p->__pyx_v_interp, a); if (e) return e;
- }
- return 0;
-}
-
-static int __pyx_tp_clear_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between(PyObject *o) {
- PyObject* tmp;
- struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between *p = (struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between *)o;
- tmp = ((PyObject*)p->__pyx_v_deltas);
- p->__pyx_v_deltas = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->__pyx_v_interp);
- p->__pyx_v_interp = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- return 0;
-}
-
-static PyTypeObject __pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between = {
- PyVarObject_HEAD_INIT(0, 0)
- "fontTools.varLib.iup.__pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between", /*tp_name*/
- sizeof(struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between, /*tp_dealloc*/
- #if PY_VERSION_HEX < 0x030800b4
- 0, /*tp_print*/
- #endif
- #if PY_VERSION_HEX >= 0x030800b4
- 0, /*tp_vectorcall_offset*/
- #endif
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #endif
- #if PY_MAJOR_VERSION >= 3
- 0, /*tp_as_async*/
- #endif
- 0, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
- 0, /*tp_doc*/
- __pyx_tp_traverse_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between, /*tp_traverse*/
- __pyx_tp_clear_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- 0, /*tp_methods*/
- 0, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- 0, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- 0, /*tp_version_tag*/
- #if PY_VERSION_HEX >= 0x030400a1
- 0, /*tp_finalize*/
- #endif
- #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
- 0, /*tp_vectorcall*/
- #endif
- #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
- 0, /*tp_print*/
- #endif
- #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
- 0, /*tp_pypy_flags*/
- #endif
-};
-
-static struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr *__pyx_freelist_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr[8];
-static int __pyx_freecount_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr = 0;
-
-static PyObject *__pyx_tp_new_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- PyObject *o;
- if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr)))) {
- o = (PyObject*)__pyx_freelist_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr[--__pyx_freecount_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr];
- memset(o, 0, sizeof(struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr));
- (void) PyObject_INIT(o, t);
- PyObject_GC_Track(o);
- } else {
- o = (*t->tp_alloc)(t, 0);
- if (unlikely(!o)) return 0;
- }
- return o;
-}
-
-static void __pyx_tp_dealloc_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr(PyObject *o) {
- struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr *)o;
- PyObject_GC_UnTrack(o);
- Py_CLEAR(p->__pyx_outer_scope);
- if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr)))) {
- __pyx_freelist_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr[__pyx_freecount_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr *)o);
- } else {
- (*Py_TYPE(o)->tp_free)(o);
- }
-}
-
-static int __pyx_tp_traverse_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) {
- int e;
- struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr *)o;
- if (p->__pyx_outer_scope) {
- e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
- }
- return 0;
-}
-
-static PyTypeObject __pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr = {
- PyVarObject_HEAD_INIT(0, 0)
- "fontTools.varLib.iup.__pyx_scope_struct_1_genexpr", /*tp_name*/
- sizeof(struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr, /*tp_dealloc*/
- #if PY_VERSION_HEX < 0x030800b4
- 0, /*tp_print*/
- #endif
- #if PY_VERSION_HEX >= 0x030800b4
- 0, /*tp_vectorcall_offset*/
- #endif
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #endif
- #if PY_MAJOR_VERSION >= 3
- 0, /*tp_as_async*/
- #endif
- 0, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
- 0, /*tp_doc*/
- __pyx_tp_traverse_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr, /*tp_traverse*/
- 0, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- 0, /*tp_methods*/
- 0, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- 0, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- 0, /*tp_version_tag*/
- #if PY_VERSION_HEX >= 0x030400a1
- 0, /*tp_finalize*/
- #endif
- #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
- 0, /*tp_vectorcall*/
- #endif
- #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
- 0, /*tp_print*/
- #endif
- #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
- 0, /*tp_pypy_flags*/
- #endif
-};
-
-static struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize *__pyx_freelist_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize[8];
-static int __pyx_freecount_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize = 0;
-
-static PyObject *__pyx_tp_new_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- PyObject *o;
- if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize)))) {
- o = (PyObject*)__pyx_freelist_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize[--__pyx_freecount_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize];
- memset(o, 0, sizeof(struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize));
- (void) PyObject_INIT(o, t);
- PyObject_GC_Track(o);
- } else {
- o = (*t->tp_alloc)(t, 0);
- if (unlikely(!o)) return 0;
- }
- return o;
-}
-
-static void __pyx_tp_dealloc_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize(PyObject *o) {
- struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize *p = (struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize *)o;
- PyObject_GC_UnTrack(o);
- Py_CLEAR(p->__pyx_v_d0);
- Py_CLEAR(p->__pyx_v_deltas);
- Py_CLEAR(p->__pyx_v_tolerance);
- if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize)))) {
- __pyx_freelist_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize[__pyx_freecount_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize++] = ((struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize *)o);
- } else {
- (*Py_TYPE(o)->tp_free)(o);
- }
-}
-
-static int __pyx_tp_traverse_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize(PyObject *o, visitproc v, void *a) {
- int e;
- struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize *p = (struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize *)o;
- if (p->__pyx_v_d0) {
- e = (*v)(p->__pyx_v_d0, a); if (e) return e;
- }
- if (p->__pyx_v_deltas) {
- e = (*v)(p->__pyx_v_deltas, a); if (e) return e;
- }
- if (p->__pyx_v_tolerance) {
- e = (*v)(p->__pyx_v_tolerance, a); if (e) return e;
- }
- return 0;
-}
-
-static int __pyx_tp_clear_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize(PyObject *o) {
- PyObject* tmp;
- struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize *p = (struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize *)o;
- tmp = ((PyObject*)p->__pyx_v_d0);
- p->__pyx_v_d0 = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->__pyx_v_deltas);
- p->__pyx_v_deltas = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->__pyx_v_tolerance);
- p->__pyx_v_tolerance = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- return 0;
-}
-
-static PyTypeObject __pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize = {
- PyVarObject_HEAD_INIT(0, 0)
- "fontTools.varLib.iup.__pyx_scope_struct_2_iup_contour_optimize", /*tp_name*/
- sizeof(struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize, /*tp_dealloc*/
- #if PY_VERSION_HEX < 0x030800b4
- 0, /*tp_print*/
- #endif
- #if PY_VERSION_HEX >= 0x030800b4
- 0, /*tp_vectorcall_offset*/
- #endif
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #endif
- #if PY_MAJOR_VERSION >= 3
- 0, /*tp_as_async*/
- #endif
- 0, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
- 0, /*tp_doc*/
- __pyx_tp_traverse_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize, /*tp_traverse*/
- __pyx_tp_clear_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- 0, /*tp_methods*/
- 0, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- 0, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- 0, /*tp_version_tag*/
- #if PY_VERSION_HEX >= 0x030400a1
- 0, /*tp_finalize*/
- #endif
- #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
- 0, /*tp_vectorcall*/
- #endif
- #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
- 0, /*tp_print*/
- #endif
- #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
- 0, /*tp_pypy_flags*/
- #endif
-};
-
-static struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr *__pyx_freelist_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr[8];
-static int __pyx_freecount_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr = 0;
-
-static PyObject *__pyx_tp_new_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- PyObject *o;
- if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr)))) {
- o = (PyObject*)__pyx_freelist_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr[--__pyx_freecount_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr];
- memset(o, 0, sizeof(struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr));
- (void) PyObject_INIT(o, t);
- PyObject_GC_Track(o);
- } else {
- o = (*t->tp_alloc)(t, 0);
- if (unlikely(!o)) return 0;
- }
- return o;
-}
-
-static void __pyx_tp_dealloc_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr(PyObject *o) {
- struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr *)o;
- PyObject_GC_UnTrack(o);
- Py_CLEAR(p->__pyx_outer_scope);
- Py_CLEAR(p->__pyx_v_p);
- if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr)))) {
- __pyx_freelist_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr[__pyx_freecount_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr *)o);
- } else {
- (*Py_TYPE(o)->tp_free)(o);
- }
-}
-
-static int __pyx_tp_traverse_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) {
- int e;
- struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr *)o;
- if (p->__pyx_outer_scope) {
- e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
- }
- if (p->__pyx_v_p) {
- e = (*v)(p->__pyx_v_p, a); if (e) return e;
- }
- return 0;
-}
-
-static PyTypeObject __pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr = {
- PyVarObject_HEAD_INIT(0, 0)
- "fontTools.varLib.iup.__pyx_scope_struct_3_genexpr", /*tp_name*/
- sizeof(struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr, /*tp_dealloc*/
- #if PY_VERSION_HEX < 0x030800b4
- 0, /*tp_print*/
- #endif
- #if PY_VERSION_HEX >= 0x030800b4
- 0, /*tp_vectorcall_offset*/
- #endif
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #endif
- #if PY_MAJOR_VERSION >= 3
- 0, /*tp_as_async*/
- #endif
- 0, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
- 0, /*tp_doc*/
- __pyx_tp_traverse_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr, /*tp_traverse*/
- 0, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- 0, /*tp_methods*/
- 0, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- 0, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- 0, /*tp_version_tag*/
- #if PY_VERSION_HEX >= 0x030400a1
- 0, /*tp_finalize*/
- #endif
- #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
- 0, /*tp_vectorcall*/
- #endif
- #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
- 0, /*tp_print*/
- #endif
- #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
- 0, /*tp_pypy_flags*/
- #endif
-};
-
-static struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr *__pyx_freelist_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr[8];
-static int __pyx_freecount_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr = 0;
-
-static PyObject *__pyx_tp_new_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- PyObject *o;
- if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr)))) {
- o = (PyObject*)__pyx_freelist_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr[--__pyx_freecount_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr];
- memset(o, 0, sizeof(struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr));
- (void) PyObject_INIT(o, t);
- PyObject_GC_Track(o);
- } else {
- o = (*t->tp_alloc)(t, 0);
- if (unlikely(!o)) return 0;
- }
- return o;
-}
-
-static void __pyx_tp_dealloc_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr(PyObject *o) {
- struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr *)o;
- PyObject_GC_UnTrack(o);
- Py_CLEAR(p->__pyx_outer_scope);
- Py_CLEAR(p->__pyx_v_d);
- if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr)))) {
- __pyx_freelist_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr[__pyx_freecount_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr++] = ((struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr *)o);
- } else {
- (*Py_TYPE(o)->tp_free)(o);
- }
-}
-
-static int __pyx_tp_traverse_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) {
- int e;
- struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr *)o;
- if (p->__pyx_outer_scope) {
- e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
- }
- if (p->__pyx_v_d) {
- e = (*v)(p->__pyx_v_d, a); if (e) return e;
- }
- return 0;
-}
-
-static PyTypeObject __pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr = {
- PyVarObject_HEAD_INIT(0, 0)
- "fontTools.varLib.iup.__pyx_scope_struct_4_genexpr", /*tp_name*/
- sizeof(struct __pyx_obj_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr, /*tp_dealloc*/
- #if PY_VERSION_HEX < 0x030800b4
- 0, /*tp_print*/
- #endif
- #if PY_VERSION_HEX >= 0x030800b4
- 0, /*tp_vectorcall_offset*/
- #endif
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #endif
- #if PY_MAJOR_VERSION >= 3
- 0, /*tp_as_async*/
- #endif
- 0, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
- 0, /*tp_doc*/
- __pyx_tp_traverse_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr, /*tp_traverse*/
- 0, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- 0, /*tp_methods*/
- 0, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- 0, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- 0, /*tp_version_tag*/
- #if PY_VERSION_HEX >= 0x030400a1
- 0, /*tp_finalize*/
- #endif
- #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
- 0, /*tp_vectorcall*/
- #endif
- #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
- 0, /*tp_print*/
- #endif
- #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
- 0, /*tp_pypy_flags*/
- #endif
-};
-
-static PyMethodDef __pyx_methods[] = {
- {0, 0, 0, 0}
-};
-
-#if PY_MAJOR_VERSION >= 3
-#if CYTHON_PEP489_MULTI_PHASE_INIT
-static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
-static int __pyx_pymod_exec_iup(PyObject* module); /*proto*/
-static PyModuleDef_Slot __pyx_moduledef_slots[] = {
- {Py_mod_create, (void*)__pyx_pymod_create},
- {Py_mod_exec, (void*)__pyx_pymod_exec_iup},
- {0, NULL}
-};
-#endif
-
-static struct PyModuleDef __pyx_moduledef = {
- PyModuleDef_HEAD_INIT,
- "iup",
- 0, /* m_doc */
- #if CYTHON_PEP489_MULTI_PHASE_INIT
- 0, /* m_size */
- #else
- -1, /* m_size */
- #endif
- __pyx_methods /* m_methods */,
- #if CYTHON_PEP489_MULTI_PHASE_INIT
- __pyx_moduledef_slots, /* m_slots */
- #else
- NULL, /* m_reload */
- #endif
- NULL, /* m_traverse */
- NULL, /* m_clear */
- NULL /* m_free */
-};
-#endif
-#ifndef CYTHON_SMALL_CODE
-#if defined(__clang__)
- #define CYTHON_SMALL_CODE
-#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
- #define CYTHON_SMALL_CODE __attribute__((cold))
-#else
- #define CYTHON_SMALL_CODE
-#endif
-#endif
-
-static __Pyx_StringTabEntry __pyx_string_tab[] = {
- {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
- {&__pyx_n_s_COMPILED, __pyx_k_COMPILED, sizeof(__pyx_k_COMPILED), 0, 0, 1, 1},
- {&__pyx_n_s_Delta, __pyx_k_Delta, sizeof(__pyx_k_Delta), 0, 0, 1, 1},
- {&__pyx_n_s_DeltaOrNone, __pyx_k_DeltaOrNone, sizeof(__pyx_k_DeltaOrNone), 0, 0, 1, 1},
- {&__pyx_n_s_DeltaOrNoneSegment, __pyx_k_DeltaOrNoneSegment, sizeof(__pyx_k_DeltaOrNoneSegment), 0, 0, 1, 1},
- {&__pyx_n_s_DeltaSegment, __pyx_k_DeltaSegment, sizeof(__pyx_k_DeltaSegment), 0, 0, 1, 1},
- {&__pyx_n_s_Endpoints, __pyx_k_Endpoints, sizeof(__pyx_k_Endpoints), 0, 0, 1, 1},
- {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
- {&__pyx_n_s_Integral, __pyx_k_Integral, sizeof(__pyx_k_Integral), 0, 0, 1, 1},
- {&__pyx_kp_s_Lib_fontTools_varLib_iup_py, __pyx_k_Lib_fontTools_varLib_iup_py, sizeof(__pyx_k_Lib_fontTools_varLib_iup_py), 0, 0, 1, 0},
- {&__pyx_n_s_MAX_LOOKBACK, __pyx_k_MAX_LOOKBACK, sizeof(__pyx_k_MAX_LOOKBACK), 0, 0, 1, 1},
- {&__pyx_n_s_Point, __pyx_k_Point, sizeof(__pyx_k_Point), 0, 0, 1, 1},
- {&__pyx_n_s_PointSegment, __pyx_k_PointSegment, sizeof(__pyx_k_PointSegment), 0, 0, 1, 1},
- {&__pyx_n_s_Real, __pyx_k_Real, sizeof(__pyx_k_Real), 0, 0, 1, 1},
- {&__pyx_n_s_Sequence, __pyx_k_Sequence, sizeof(__pyx_k_Sequence), 0, 0, 1, 1},
- {&__pyx_n_s_Tuple, __pyx_k_Tuple, sizeof(__pyx_k_Tuple), 0, 0, 1, 1},
- {&__pyx_n_s_Union, __pyx_k_Union, sizeof(__pyx_k_Union), 0, 0, 1, 1},
- {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
- {&__pyx_n_s_best_cost, __pyx_k_best_cost, sizeof(__pyx_k_best_cost), 0, 0, 1, 1},
- {&__pyx_n_s_best_j, __pyx_k_best_j, sizeof(__pyx_k_best_j), 0, 0, 1, 1},
- {&__pyx_n_s_best_sol, __pyx_k_best_sol, sizeof(__pyx_k_best_sol), 0, 0, 1, 1},
- {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
- {&__pyx_n_s_c1, __pyx_k_c1, sizeof(__pyx_k_c1), 0, 0, 1, 1},
- {&__pyx_n_s_c2, __pyx_k_c2, sizeof(__pyx_k_c2), 0, 0, 1, 1},
- {&__pyx_n_s_can_iup_in_between_locals_genexp, __pyx_k_can_iup_in_between_locals_genexp, sizeof(__pyx_k_can_iup_in_between_locals_genexp), 0, 0, 1, 1},
- {&__pyx_n_s_chain, __pyx_k_chain, sizeof(__pyx_k_chain), 0, 0, 1, 1},
- {&__pyx_n_s_cj, __pyx_k_cj, sizeof(__pyx_k_cj), 0, 0, 1, 1},
- {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
- {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
- {&__pyx_n_s_contour, __pyx_k_contour, sizeof(__pyx_k_contour), 0, 0, 1, 1},
- {&__pyx_n_s_coords, __pyx_k_coords, sizeof(__pyx_k_coords), 0, 0, 1, 1},
- {&__pyx_n_s_cost, __pyx_k_cost, sizeof(__pyx_k_cost), 0, 0, 1, 1},
- {&__pyx_n_s_costs, __pyx_k_costs, sizeof(__pyx_k_costs), 0, 0, 1, 1},
- {&__pyx_n_s_cython, __pyx_k_cython, sizeof(__pyx_k_cython), 0, 0, 1, 1},
- {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1},
- {&__pyx_n_s_d0, __pyx_k_d0, sizeof(__pyx_k_d0), 0, 0, 1, 1},
- {&__pyx_n_s_d1, __pyx_k_d1, sizeof(__pyx_k_d1), 0, 0, 1, 1},
- {&__pyx_n_s_d2, __pyx_k_d2, sizeof(__pyx_k_d2), 0, 0, 1, 1},
- {&__pyx_n_s_deltas, __pyx_k_deltas, sizeof(__pyx_k_deltas), 0, 0, 1, 1},
- {&__pyx_n_s_dj, __pyx_k_dj, sizeof(__pyx_k_dj), 0, 0, 1, 1},
- {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
- {&__pyx_n_s_ends, __pyx_k_ends, sizeof(__pyx_k_ends), 0, 0, 1, 1},
- {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
- {&__pyx_n_s_fontTools_misc, __pyx_k_fontTools_misc, sizeof(__pyx_k_fontTools_misc), 0, 0, 1, 1},
- {&__pyx_n_s_fontTools_varLib_iup, __pyx_k_fontTools_varLib_iup, sizeof(__pyx_k_fontTools_varLib_iup), 0, 0, 1, 1},
- {&__pyx_n_s_force, __pyx_k_force, sizeof(__pyx_k_force), 0, 0, 1, 1},
- {&__pyx_n_s_forced, __pyx_k_forced, sizeof(__pyx_k_forced), 0, 0, 1, 1},
- {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
- {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
- {&__pyx_n_s_i1, __pyx_k_i1, sizeof(__pyx_k_i1), 0, 0, 1, 1},
- {&__pyx_n_s_i2, __pyx_k_i2, sizeof(__pyx_k_i2), 0, 0, 1, 1},
- {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
- {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1},
- {&__pyx_n_u_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 1, 0, 1},
- {&__pyx_n_s_it, __pyx_k_it, sizeof(__pyx_k_it), 0, 0, 1, 1},
- {&__pyx_n_s_iup_contour, __pyx_k_iup_contour, sizeof(__pyx_k_iup_contour), 0, 0, 1, 1},
- {&__pyx_n_s_iup_contour_bound_forced_set, __pyx_k_iup_contour_bound_forced_set, sizeof(__pyx_k_iup_contour_bound_forced_set), 0, 0, 1, 1},
- {&__pyx_n_s_iup_contour_optimize, __pyx_k_iup_contour_optimize, sizeof(__pyx_k_iup_contour_optimize), 0, 0, 1, 1},
- {&__pyx_n_s_iup_contour_optimize_dp, __pyx_k_iup_contour_optimize_dp, sizeof(__pyx_k_iup_contour_optimize_dp), 0, 0, 1, 1},
- {&__pyx_n_s_iup_contour_optimize_locals_gene, __pyx_k_iup_contour_optimize_locals_gene, sizeof(__pyx_k_iup_contour_optimize_locals_gene), 0, 0, 1, 1},
- {&__pyx_n_s_iup_delta, __pyx_k_iup_delta, sizeof(__pyx_k_iup_delta), 0, 0, 1, 1},
- {&__pyx_n_s_iup_delta_optimize, __pyx_k_iup_delta_optimize, sizeof(__pyx_k_iup_delta_optimize), 0, 0, 1, 1},
- {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
- {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
- {&__pyx_n_s_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 0, 1, 1},
- {&__pyx_n_s_lc, __pyx_k_lc, sizeof(__pyx_k_lc), 0, 0, 1, 1},
- {&__pyx_n_s_lcj, __pyx_k_lcj, sizeof(__pyx_k_lcj), 0, 0, 1, 1},
- {&__pyx_n_s_ld, __pyx_k_ld, sizeof(__pyx_k_ld), 0, 0, 1, 1},
- {&__pyx_n_s_ldj, __pyx_k_ldj, sizeof(__pyx_k_ldj), 0, 0, 1, 1},
- {&__pyx_n_u_list, __pyx_k_list, sizeof(__pyx_k_list), 0, 1, 0, 1},
- {&__pyx_n_s_lookback, __pyx_k_lookback, sizeof(__pyx_k_lookback), 0, 0, 1, 1},
- {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
- {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1},
- {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
- {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
- {&__pyx_n_s_nc, __pyx_k_nc, sizeof(__pyx_k_nc), 0, 0, 1, 1},
- {&__pyx_n_s_ncj, __pyx_k_ncj, sizeof(__pyx_k_ncj), 0, 0, 1, 1},
- {&__pyx_n_s_nd, __pyx_k_nd, sizeof(__pyx_k_nd), 0, 0, 1, 1},
- {&__pyx_n_s_ndj, __pyx_k_ndj, sizeof(__pyx_k_ndj), 0, 0, 1, 1},
- {&__pyx_n_s_numbers, __pyx_k_numbers, sizeof(__pyx_k_numbers), 0, 0, 1, 1},
- {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1},
- {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
- {&__pyx_n_s_return, __pyx_k_return, sizeof(__pyx_k_return), 0, 0, 1, 1},
- {&__pyx_n_s_ri1, __pyx_k_ri1, sizeof(__pyx_k_ri1), 0, 0, 1, 1},
- {&__pyx_n_s_ri2, __pyx_k_ri2, sizeof(__pyx_k_ri2), 0, 0, 1, 1},
- {&__pyx_n_s_rot_list, __pyx_k_rot_list, sizeof(__pyx_k_rot_list), 0, 0, 1, 1},
- {&__pyx_n_s_rot_set, __pyx_k_rot_set, sizeof(__pyx_k_rot_set), 0, 0, 1, 1},
- {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1},
- {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
- {&__pyx_n_u_set, __pyx_k_set, sizeof(__pyx_k_set), 0, 1, 0, 1},
- {&__pyx_n_s_solution, __pyx_k_solution, sizeof(__pyx_k_solution), 0, 0, 1, 1},
- {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
- {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
- {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
- {&__pyx_n_s_tolerance, __pyx_k_tolerance, sizeof(__pyx_k_tolerance), 0, 0, 1, 1},
- {&__pyx_n_s_typing, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1},
- {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1},
- {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1},
- {0, 0, 0, 0, 0, 0, 0}
-};
-static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
- __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 5, __pyx_L1_error)
- __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 5, __pyx_L1_error)
- __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 94, __pyx_L1_error)
- __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 109, __pyx_L1_error)
- __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 233, __pyx_L1_error)
- __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) __PYX_ERR(0, 410, __pyx_L1_error)
- return 0;
- __pyx_L1_error:;
- return -1;
-}
-
-static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
-
- /* "fontTools/varLib/iup.py":63
- * # rd1 = reference delta 1
- * out_arrays = [None, None]
- * for j in 0, 1: # <<<<<<<<<<<<<<
- * out_arrays[j] = out = []
- * x1, x2, d1, d2 = rc1[j], rc2[j], rd1[j], rd2[j]
- */
- __pyx_tuple_ = PyTuple_Pack(2, __pyx_int_0, __pyx_int_1); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 63, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple_);
- __Pyx_GIVEREF(__pyx_tuple_);
-
- /* "fontTools/varLib/iup.py":112
- * if not indices:
- * # All deltas are None. Return 0,0 for all.
- * return [(0, 0)] * n # <<<<<<<<<<<<<<
- *
- * out = []
- */
- __pyx_tuple__2 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 112, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__2);
- __Pyx_GIVEREF(__pyx_tuple__2);
-
- /* "fontTools/varLib/iup.py":97
- *
- *
- * def iup_contour(deltas: _DeltaOrNoneSegment, coords: _PointSegment) -> _DeltaSegment: # <<<<<<<<<<<<<<
- * """For the contour given in `coords`, interpolate any missing
- * delta values in delta vector `deltas`.
- */
- __pyx_tuple__3 = PyTuple_Pack(14, __pyx_n_s_deltas, __pyx_n_s_coords, __pyx_n_s_n, __pyx_n_s_indices, __pyx_n_s_out, __pyx_n_s_it, __pyx_n_s_start, __pyx_n_s_i1, __pyx_n_s_i2, __pyx_n_s_ri1, __pyx_n_s_ri2, __pyx_n_s_end, __pyx_n_s_i, __pyx_n_s_v); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 97, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__3);
- __Pyx_GIVEREF(__pyx_tuple__3);
- __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Lib_fontTools_varLib_iup_py, __pyx_n_s_iup_contour, 97, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 97, __pyx_L1_error)
-
- /* "fontTools/varLib/iup.py":149
- *
- *
- * def iup_delta( # <<<<<<<<<<<<<<
- * deltas: _DeltaOrNoneSegment, coords: _PointSegment, ends: _Endpoints
- * ) -> _DeltaSegment:
- */
- __pyx_tuple__5 = PyTuple_Pack(8, __pyx_n_s_deltas, __pyx_n_s_coords, __pyx_n_s_ends, __pyx_n_s_n, __pyx_n_s_out, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_contour); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 149, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__5);
- __Pyx_GIVEREF(__pyx_tuple__5);
- __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Lib_fontTools_varLib_iup_py, __pyx_n_s_iup_delta, 149, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 149, __pyx_L1_error)
-
- /* "fontTools/varLib/iup.py":218
- * forced=set,
- * )
- * def _iup_contour_bound_forced_set( # <<<<<<<<<<<<<<
- * deltas: _DeltaSegment, coords: _PointSegment, tolerance: Real = 0
- * ) -> set:
- */
- __pyx_tuple__7 = PyTuple_Pack(24, __pyx_n_s_deltas, __pyx_n_s_coords, __pyx_n_s_tolerance, __pyx_n_s_cj, __pyx_n_s_dj, __pyx_n_s_lcj, __pyx_n_s_ldj, __pyx_n_s_ncj, __pyx_n_s_ndj, __pyx_n_s_force, __pyx_n_s_forced, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_ld, __pyx_n_s_lc, __pyx_n_s_d, __pyx_n_s_c, __pyx_n_s_nd, __pyx_n_s_nc, __pyx_n_s_j, __pyx_n_s_c1, __pyx_n_s_c2, __pyx_n_s_d1, __pyx_n_s_d2); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 218, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__7);
- __Pyx_GIVEREF(__pyx_tuple__7);
- __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(3, 0, 24, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Lib_fontTools_varLib_iup_py, __pyx_n_s_iup_contour_bound_forced_set, 218, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 218, __pyx_L1_error)
- __pyx_tuple__9 = PyTuple_Pack(1, ((PyObject *)__pyx_int_0)); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 218, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__9);
- __Pyx_GIVEREF(__pyx_tuple__9);
-
- /* "fontTools/varLib/iup.py":308
- * tolerance=cython.double,
- * )
- * def _iup_contour_optimize_dp( # <<<<<<<<<<<<<<
- * deltas: _DeltaSegment,
- * coords: _PointSegment,
- */
- __pyx_tuple__10 = PyTuple_Pack(13, __pyx_n_s_deltas, __pyx_n_s_coords, __pyx_n_s_forced, __pyx_n_s_tolerance, __pyx_n_s_lookback, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_best_cost, __pyx_n_s_best_j, __pyx_n_s_cost, __pyx_n_s_n, __pyx_n_s_costs, __pyx_n_s_chain); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 308, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__10);
- __Pyx_GIVEREF(__pyx_tuple__10);
- __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(5, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Lib_fontTools_varLib_iup_py, __pyx_n_s_iup_contour_optimize_dp, 308, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 308, __pyx_L1_error)
-
- /* "fontTools/varLib/iup.py":352
- *
- *
- * def _rot_list(l: list, k: int): # <<<<<<<<<<<<<<
- * """Rotate list by k items forward. Ie. item at position 0 will be
- * at position k in returned list. Negative k is allowed."""
- */
- __pyx_tuple__12 = PyTuple_Pack(3, __pyx_n_s_l, __pyx_n_s_k, __pyx_n_s_n); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 352, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__12);
- __Pyx_GIVEREF(__pyx_tuple__12);
- __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Lib_fontTools_varLib_iup_py, __pyx_n_s_rot_list, 352, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 352, __pyx_L1_error)
-
- /* "fontTools/varLib/iup.py":362
- *
- *
- * def _rot_set(s: set, k: int, n: int): # <<<<<<<<<<<<<<
- * k %= n
- * if not k:
- */
- __pyx_tuple__14 = PyTuple_Pack(4, __pyx_n_s_s, __pyx_n_s_k, __pyx_n_s_n, __pyx_n_s_v); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 362, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__14);
- __Pyx_GIVEREF(__pyx_tuple__14);
- __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Lib_fontTools_varLib_iup_py, __pyx_n_s_rot_set, 362, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 362, __pyx_L1_error)
-
- /* "fontTools/varLib/iup.py":369
- *
- *
- * def iup_contour_optimize( # <<<<<<<<<<<<<<
- * deltas: _DeltaSegment, coords: _PointSegment, tolerance: Real = 0.0
- * ) -> _DeltaOrNoneSegment:
- */
- __pyx_tuple__16 = PyTuple_Pack(20, __pyx_n_s_deltas, __pyx_n_s_coords, __pyx_n_s_tolerance, __pyx_n_s_n, __pyx_n_s_d0, __pyx_n_s_forced, __pyx_n_s_k, __pyx_n_s_chain, __pyx_n_s_costs, __pyx_n_s_solution, __pyx_n_s_i, __pyx_n_s_best_sol, __pyx_n_s_best_cost, __pyx_n_s_start, __pyx_n_s_cost, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_i, __pyx_n_s_i); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 369, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__16);
- __Pyx_GIVEREF(__pyx_tuple__16);
- __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(3, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Lib_fontTools_varLib_iup_py, __pyx_n_s_iup_contour_optimize, 369, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 369, __pyx_L1_error)
- __pyx_tuple__18 = PyTuple_Pack(1, ((PyObject*)__pyx_float_0_0)); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 369, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__18);
- __Pyx_GIVEREF(__pyx_tuple__18);
-
- /* "fontTools/varLib/iup.py":470
- *
- *
- * def iup_delta_optimize( # <<<<<<<<<<<<<<
- * deltas: _DeltaSegment,
- * coords: _PointSegment,
- */
- __pyx_tuple__19 = PyTuple_Pack(9, __pyx_n_s_deltas, __pyx_n_s_coords, __pyx_n_s_ends, __pyx_n_s_tolerance, __pyx_n_s_n, __pyx_n_s_out, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_contour); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 470, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__19);
- __Pyx_GIVEREF(__pyx_tuple__19);
- __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Lib_fontTools_varLib_iup_py, __pyx_n_s_iup_delta_optimize, 470, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 470, __pyx_L1_error)
- __pyx_tuple__21 = PyTuple_Pack(1, ((PyObject*)__pyx_float_0_0)); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 470, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_tuple__21);
- __Pyx_GIVEREF(__pyx_tuple__21);
- __Pyx_RefNannyFinishContext();
- return 0;
- __pyx_L1_error:;
- __Pyx_RefNannyFinishContext();
- return -1;
-}
-
-static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
- /* AssertionsEnabled.init */
- __Pyx_init_assertions_enabled();
-
-if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
-
- if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_float_0_0 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
- return 0;
- __pyx_L1_error:;
- return -1;
-}
-
-static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
-static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
-static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
-static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
-static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
-static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
-static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
-
-static int __Pyx_modinit_global_init_code(void) {
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
- /*--- Global init code ---*/
- __Pyx_RefNannyFinishContext();
- return 0;
-}
-
-static int __Pyx_modinit_variable_export_code(void) {
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
- /*--- Variable export code ---*/
- __Pyx_RefNannyFinishContext();
- return 0;
-}
-
-static int __Pyx_modinit_function_export_code(void) {
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
- /*--- Function export code ---*/
- __Pyx_RefNannyFinishContext();
- return 0;
-}
-
-static int __Pyx_modinit_type_init_code(void) {
- __Pyx_RefNannyDeclarations
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
- /*--- Type init code ---*/
- if (PyType_Ready(&__pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between) < 0) __PYX_ERR(0, 187, __pyx_L1_error)
- #if PY_VERSION_HEX < 0x030800B1
- __pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between.tp_print = 0;
- #endif
- if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between.tp_dictoffset && __pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between.tp_getattro == PyObject_GenericGetAttr)) {
- __pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
- }
- __pyx_ptype_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between = &__pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct____pyx_f_9fontTools_6varLib_3iup_can_iup_in_between;
- if (PyType_Ready(&__pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 203, __pyx_L1_error)
- #if PY_VERSION_HEX < 0x030800B1
- __pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr.tp_print = 0;
- #endif
- if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr.tp_dictoffset && __pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
- __pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
- }
- __pyx_ptype_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr = &__pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct_1_genexpr;
- if (PyType_Ready(&__pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize) < 0) __PYX_ERR(0, 369, __pyx_L1_error)
- #if PY_VERSION_HEX < 0x030800B1
- __pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize.tp_print = 0;
- #endif
- if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize.tp_dictoffset && __pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize.tp_getattro == PyObject_GenericGetAttr)) {
- __pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
- }
- __pyx_ptype_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize = &__pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct_2_iup_contour_optimize;
- if (PyType_Ready(&__pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 384, __pyx_L1_error)
- #if PY_VERSION_HEX < 0x030800B1
- __pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr.tp_print = 0;
- #endif
- if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr.tp_dictoffset && __pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
- __pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
- }
- __pyx_ptype_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr = &__pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct_3_genexpr;
- if (PyType_Ready(&__pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 393, __pyx_L1_error)
- #if PY_VERSION_HEX < 0x030800B1
- __pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr.tp_print = 0;
- #endif
- if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr.tp_dictoffset && __pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
- __pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
- }
- __pyx_ptype_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr = &__pyx_type_9fontTools_6varLib_3iup___pyx_scope_struct_4_genexpr;
- __Pyx_RefNannyFinishContext();
- return 0;
- __pyx_L1_error:;
- __Pyx_RefNannyFinishContext();
- return -1;
-}
-
-static int __Pyx_modinit_type_import_code(void) {
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
- /*--- Type import code ---*/
- __Pyx_RefNannyFinishContext();
- return 0;
-}
-
-static int __Pyx_modinit_variable_import_code(void) {
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
- /*--- Variable import code ---*/
- __Pyx_RefNannyFinishContext();
- return 0;
-}
-
-static int __Pyx_modinit_function_import_code(void) {
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
- /*--- Function import code ---*/
- __Pyx_RefNannyFinishContext();
- return 0;
-}
-
-
-#ifndef CYTHON_NO_PYINIT_EXPORT
-#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
-#elif PY_MAJOR_VERSION < 3
-#ifdef __cplusplus
-#define __Pyx_PyMODINIT_FUNC extern "C" void
-#else
-#define __Pyx_PyMODINIT_FUNC void
-#endif
-#else
-#ifdef __cplusplus
-#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
-#else
-#define __Pyx_PyMODINIT_FUNC PyObject *
-#endif
-#endif
-
-
-#if PY_MAJOR_VERSION < 3
-__Pyx_PyMODINIT_FUNC initiup(void) CYTHON_SMALL_CODE; /*proto*/
-__Pyx_PyMODINIT_FUNC initiup(void)
-#else
-__Pyx_PyMODINIT_FUNC PyInit_iup(void) CYTHON_SMALL_CODE; /*proto*/
-__Pyx_PyMODINIT_FUNC PyInit_iup(void)
-#if CYTHON_PEP489_MULTI_PHASE_INIT
-{
- return PyModuleDef_Init(&__pyx_moduledef);
-}
-static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
- #if PY_VERSION_HEX >= 0x030700A1
- static PY_INT64_T main_interpreter_id = -1;
- PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
- if (main_interpreter_id == -1) {
- main_interpreter_id = current_id;
- return (unlikely(current_id == -1)) ? -1 : 0;
- } else if (unlikely(main_interpreter_id != current_id))
- #else
- static PyInterpreterState *main_interpreter = NULL;
- PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
- if (!main_interpreter) {
- main_interpreter = current_interpreter;
- } else if (unlikely(main_interpreter != current_interpreter))
- #endif
- {
- PyErr_SetString(
- PyExc_ImportError,
- "Interpreter change detected - this module can only be loaded into one interpreter per process.");
- return -1;
- }
- return 0;
-}
-static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
- PyObject *value = PyObject_GetAttrString(spec, from_name);
- int result = 0;
- if (likely(value)) {
- if (allow_none || value != Py_None) {
- result = PyDict_SetItemString(moddict, to_name, value);
- }
- Py_DECREF(value);
- } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
- PyErr_Clear();
- } else {
- result = -1;
- }
- return result;
-}
-static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
- PyObject *module = NULL, *moddict, *modname;
- if (__Pyx_check_single_interpreter())
- return NULL;
- if (__pyx_m)
- return __Pyx_NewRef(__pyx_m);
- modname = PyObject_GetAttrString(spec, "name");
- if (unlikely(!modname)) goto bad;
- module = PyModule_NewObject(modname);
- Py_DECREF(modname);
- if (unlikely(!module)) goto bad;
- moddict = PyModule_GetDict(module);
- if (unlikely(!moddict)) goto bad;
- if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
- if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
- if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
- if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
- return module;
-bad:
- Py_XDECREF(module);
- return NULL;
-}
-
-
-static CYTHON_SMALL_CODE int __pyx_pymod_exec_iup(PyObject *__pyx_pyinit_module)
-#endif
-#endif
-{
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_t_4;
- PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
- PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannyDeclarations
- #if CYTHON_PEP489_MULTI_PHASE_INIT
- if (__pyx_m) {
- if (__pyx_m == __pyx_pyinit_module) return 0;
- PyErr_SetString(PyExc_RuntimeError, "Module 'iup' has already been imported. Re-initialisation is not supported.");
- return -1;
- }
- #elif PY_MAJOR_VERSION >= 3
- if (__pyx_m) return __Pyx_NewRef(__pyx_m);
- #endif
- #if CYTHON_REFNANNY
-__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
-if (!__Pyx_RefNanny) {
- PyErr_Clear();
- __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
- if (!__Pyx_RefNanny)
- Py_FatalError("failed to import 'refnanny' module");
-}
-#endif
- __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_iup(void)", 0);
- if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- #ifdef __Pxy_PyFrame_Initialize_Offsets
- __Pxy_PyFrame_Initialize_Offsets();
- #endif
- __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
- __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
- #ifdef __Pyx_CyFunction_USED
- if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- #endif
- #ifdef __Pyx_FusedFunction_USED
- if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- #endif
- #ifdef __Pyx_Coroutine_USED
- if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- #endif
- #ifdef __Pyx_Generator_USED
- if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- #endif
- #ifdef __Pyx_AsyncGen_USED
- if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- #endif
- #ifdef __Pyx_StopAsyncIteration_USED
- if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- #endif
- /*--- Library function declarations ---*/
- /*--- Threads initialization code ---*/
- #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
- PyEval_InitThreads();
- #endif
- /*--- Module creation code ---*/
- #if CYTHON_PEP489_MULTI_PHASE_INIT
- __pyx_m = __pyx_pyinit_module;
- Py_INCREF(__pyx_m);
- #else
- #if PY_MAJOR_VERSION < 3
- __pyx_m = Py_InitModule4("iup", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
- #else
- __pyx_m = PyModule_Create(&__pyx_moduledef);
- #endif
- if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
- #endif
- __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
- Py_INCREF(__pyx_d);
- __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
- Py_INCREF(__pyx_b);
- __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
- Py_INCREF(__pyx_cython_runtime);
- if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- /*--- Initialize various global constants etc. ---*/
- if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
- if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- #endif
- if (__pyx_module_is_main_fontTools__varLib__iup) {
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- }
- #if PY_MAJOR_VERSION >= 3
- {
- PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
- if (!PyDict_GetItemString(modules, "fontTools.varLib.iup")) {
- if (unlikely(PyDict_SetItemString(modules, "fontTools.varLib.iup", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
- }
- }
- #endif
- /*--- Builtin init code ---*/
- if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- /*--- Constants init code ---*/
- if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- /*--- Global type/function init code ---*/
- (void)__Pyx_modinit_global_init_code();
- (void)__Pyx_modinit_variable_export_code();
- (void)__Pyx_modinit_function_export_code();
- if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
- (void)__Pyx_modinit_type_import_code();
- (void)__Pyx_modinit_variable_import_code();
- (void)__Pyx_modinit_function_import_code();
- /*--- Execution code ---*/
- #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
- if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- #endif
-
- /* "fontTools/varLib/iup.py":1
- * try: # <<<<<<<<<<<<<<
- * import cython
- *
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
- __Pyx_XGOTREF(__pyx_t_1);
- __Pyx_XGOTREF(__pyx_t_2);
- __Pyx_XGOTREF(__pyx_t_3);
- /*try:*/ {
-
- /* "fontTools/varLib/iup.py":4
- * import cython
- *
- * COMPILED = cython.compiled # <<<<<<<<<<<<<<
- * except (AttributeError, ImportError):
- * # if cython not installed, use mock module with no-op decorators and types
- */
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_COMPILED, Py_True) < 0) __PYX_ERR(0, 4, __pyx_L2_error)
-
- /* "fontTools/varLib/iup.py":1
- * try: # <<<<<<<<<<<<<<
- * import cython
- *
- */
- }
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- goto __pyx_L7_try_end;
- __pyx_L2_error:;
-
- /* "fontTools/varLib/iup.py":5
- *
- * COMPILED = cython.compiled
- * except (AttributeError, ImportError): # <<<<<<<<<<<<<<
- * # if cython not installed, use mock module with no-op decorators and types
- * from fontTools.misc import cython
- */
- __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
- if (__pyx_t_4) {
- __Pyx_AddTraceback("fontTools.varLib.iup", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 5, __pyx_L4_except_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GOTREF(__pyx_t_7);
-
- /* "fontTools/varLib/iup.py":7
- * except (AttributeError, ImportError):
- * # if cython not installed, use mock module with no-op decorators and types
- * from fontTools.misc import cython # <<<<<<<<<<<<<<
- *
- * COMPILED = False
- */
- __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 7, __pyx_L4_except_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_INCREF(__pyx_n_s_cython);
- __Pyx_GIVEREF(__pyx_n_s_cython);
- PyList_SET_ITEM(__pyx_t_8, 0, __pyx_n_s_cython);
- __pyx_t_9 = __Pyx_Import(__pyx_n_s_fontTools_misc, __pyx_t_8, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 7, __pyx_L4_except_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s_cython); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 7, __pyx_L4_except_error)
- __Pyx_GOTREF(__pyx_t_8);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_cython, __pyx_t_8) < 0) __PYX_ERR(0, 7, __pyx_L4_except_error)
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-
- /* "fontTools/varLib/iup.py":9
- * from fontTools.misc import cython
- *
- * COMPILED = False # <<<<<<<<<<<<<<
- *
- * from typing import (
- */
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_COMPILED, Py_False) < 0) __PYX_ERR(0, 9, __pyx_L4_except_error)
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- goto __pyx_L3_exception_handled;
- }
- goto __pyx_L4_except_error;
- __pyx_L4_except_error:;
-
- /* "fontTools/varLib/iup.py":1
- * try: # <<<<<<<<<<<<<<
- * import cython
- *
- */
- __Pyx_XGIVEREF(__pyx_t_1);
- __Pyx_XGIVEREF(__pyx_t_2);
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
- goto __pyx_L1_error;
- __pyx_L3_exception_handled:;
- __Pyx_XGIVEREF(__pyx_t_1);
- __Pyx_XGIVEREF(__pyx_t_2);
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
- __pyx_L7_try_end:;
- }
-
- /* "fontTools/varLib/iup.py":12
- *
- * from typing import (
- * Sequence, # <<<<<<<<<<<<<<
- * Tuple,
- * Union,
- */
- __pyx_t_7 = PyList_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 12, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_INCREF(__pyx_n_s_Sequence);
- __Pyx_GIVEREF(__pyx_n_s_Sequence);
- PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_Sequence);
- __Pyx_INCREF(__pyx_n_s_Tuple);
- __Pyx_GIVEREF(__pyx_n_s_Tuple);
- PyList_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_Tuple);
- __Pyx_INCREF(__pyx_n_s_Union);
- __Pyx_GIVEREF(__pyx_n_s_Union);
- PyList_SET_ITEM(__pyx_t_7, 2, __pyx_n_s_Union);
-
- /* "fontTools/varLib/iup.py":11
- * COMPILED = False
- *
- * from typing import ( # <<<<<<<<<<<<<<
- * Sequence,
- * Tuple,
- */
- __pyx_t_6 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_7, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 11, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_6, __pyx_n_s_Sequence); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 11, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_Sequence, __pyx_t_7) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_6, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 11, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_Tuple, __pyx_t_7) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_6, __pyx_n_s_Union); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 11, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_Union, __pyx_t_7) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "fontTools/varLib/iup.py":16
- * Union,
- * )
- * from numbers import Integral, Real # <<<<<<<<<<<<<<
- *
- * try:
- */
- __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 16, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_INCREF(__pyx_n_s_Integral);
- __Pyx_GIVEREF(__pyx_n_s_Integral);
- PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_Integral);
- __Pyx_INCREF(__pyx_n_s_Real);
- __Pyx_GIVEREF(__pyx_n_s_Real);
- PyList_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_Real);
- __pyx_t_7 = __Pyx_Import(__pyx_n_s_numbers, __pyx_t_6, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 16, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_Integral); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 16, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_Integral, __pyx_t_6) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_Real); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 16, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_Real, __pyx_t_6) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "fontTools/varLib/iup.py":18
- * from numbers import Integral, Real
- *
- * try: # <<<<<<<<<<<<<<
- * import cython
- *
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
- __Pyx_XGOTREF(__pyx_t_3);
- __Pyx_XGOTREF(__pyx_t_2);
- __Pyx_XGOTREF(__pyx_t_1);
- /*try:*/ {
-
- /* "fontTools/varLib/iup.py":21
- * import cython
- *
- * COMPILED = cython.compiled # <<<<<<<<<<<<<<
- * except (AttributeError, ImportError):
- * # if cython not installed, use mock module with no-op decorators and types
- */
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_COMPILED, Py_True) < 0) __PYX_ERR(0, 21, __pyx_L10_error)
-
- /* "fontTools/varLib/iup.py":18
- * from numbers import Integral, Real
- *
- * try: # <<<<<<<<<<<<<<
- * import cython
- *
- */
- }
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- goto __pyx_L15_try_end;
- __pyx_L10_error:;
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-
- /* "fontTools/varLib/iup.py":22
- *
- * COMPILED = cython.compiled
- * except (AttributeError, ImportError): # <<<<<<<<<<<<<<
- * # if cython not installed, use mock module with no-op decorators and types
- * from fontTools.misc import cython
- */
- __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
- if (__pyx_t_4) {
- __Pyx_AddTraceback("fontTools.varLib.iup", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 22, __pyx_L12_except_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GOTREF(__pyx_t_5);
-
- /* "fontTools/varLib/iup.py":24
- * except (AttributeError, ImportError):
- * # if cython not installed, use mock module with no-op decorators and types
- * from fontTools.misc import cython # <<<<<<<<<<<<<<
- *
- * COMPILED = False
- */
- __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 24, __pyx_L12_except_error)
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_INCREF(__pyx_n_s_cython);
- __Pyx_GIVEREF(__pyx_n_s_cython);
- PyList_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_cython);
- __pyx_t_8 = __Pyx_Import(__pyx_n_s_fontTools_misc, __pyx_t_9, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 24, __pyx_L12_except_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_ImportFrom(__pyx_t_8, __pyx_n_s_cython); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 24, __pyx_L12_except_error)
- __Pyx_GOTREF(__pyx_t_9);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_cython, __pyx_t_9) < 0) __PYX_ERR(0, 24, __pyx_L12_except_error)
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-
- /* "fontTools/varLib/iup.py":26
- * from fontTools.misc import cython
- *
- * COMPILED = False # <<<<<<<<<<<<<<
- *
- *
- */
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_COMPILED, Py_False) < 0) __PYX_ERR(0, 26, __pyx_L12_except_error)
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- goto __pyx_L11_exception_handled;
- }
- goto __pyx_L12_except_error;
- __pyx_L12_except_error:;
-
- /* "fontTools/varLib/iup.py":18
- * from numbers import Integral, Real
- *
- * try: # <<<<<<<<<<<<<<
- * import cython
- *
- */
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_XGIVEREF(__pyx_t_2);
- __Pyx_XGIVEREF(__pyx_t_1);
- __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
- goto __pyx_L1_error;
- __pyx_L11_exception_handled:;
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_XGIVEREF(__pyx_t_2);
- __Pyx_XGIVEREF(__pyx_t_1);
- __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
- __pyx_L15_try_end:;
- }
-
- /* "fontTools/varLib/iup.py":29
- *
- *
- * _Point = Tuple[Real, Real] # <<<<<<<<<<<<<<
- * _Delta = Tuple[Real, Real]
- * _PointSegment = Sequence[_Point]
- */
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 29, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Real); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 29, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Real); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 29, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 29, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
- __pyx_t_6 = 0;
- __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 29, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_Point, __pyx_t_7) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "fontTools/varLib/iup.py":30
- *
- * _Point = Tuple[Real, Real]
- * _Delta = Tuple[Real, Real] # <<<<<<<<<<<<<<
- * _PointSegment = Sequence[_Point]
- * _DeltaSegment = Sequence[_Delta]
- */
- __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 30, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Real); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 30, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Real); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 30, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 30, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
- __pyx_t_8 = 0;
- __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 30, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_Delta, __pyx_t_5) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
- /* "fontTools/varLib/iup.py":31
- * _Point = Tuple[Real, Real]
- * _Delta = Tuple[Real, Real]
- * _PointSegment = Sequence[_Point] # <<<<<<<<<<<<<<
- * _DeltaSegment = Sequence[_Delta]
- * _DeltaOrNone = Union[_Delta, None]
- */
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Sequence); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 31, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Point); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 31, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 31, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_PointSegment, __pyx_t_7) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "fontTools/varLib/iup.py":32
- * _Delta = Tuple[Real, Real]
- * _PointSegment = Sequence[_Point]
- * _DeltaSegment = Sequence[_Delta] # <<<<<<<<<<<<<<
- * _DeltaOrNone = Union[_Delta, None]
- * _DeltaOrNoneSegment = Sequence[_DeltaOrNone]
- */
- __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Sequence); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 32, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Delta); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 32, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 32, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_DeltaSegment, __pyx_t_5) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
- /* "fontTools/varLib/iup.py":33
- * _PointSegment = Sequence[_Point]
- * _DeltaSegment = Sequence[_Delta]
- * _DeltaOrNone = Union[_Delta, None] # <<<<<<<<<<<<<<
- * _DeltaOrNoneSegment = Sequence[_DeltaOrNone]
- * _Endpoints = Sequence[Integral]
- */
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Union); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 33, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Delta); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 33, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 33, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
- __Pyx_INCREF(Py_None);
- __Pyx_GIVEREF(Py_None);
- PyTuple_SET_ITEM(__pyx_t_7, 1, Py_None);
- __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 33, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_DeltaOrNone, __pyx_t_6) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "fontTools/varLib/iup.py":34
- * _DeltaSegment = Sequence[_Delta]
- * _DeltaOrNone = Union[_Delta, None]
- * _DeltaOrNoneSegment = Sequence[_DeltaOrNone] # <<<<<<<<<<<<<<
- * _Endpoints = Sequence[Integral]
- *
- */
- __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Sequence); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 34, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_DeltaOrNone); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 34, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 34, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_DeltaOrNoneSegment, __pyx_t_5) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
- /* "fontTools/varLib/iup.py":35
- * _DeltaOrNone = Union[_Delta, None]
- * _DeltaOrNoneSegment = Sequence[_DeltaOrNone]
- * _Endpoints = Sequence[Integral] # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Sequence); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 35, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Integral); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 35, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 35, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_Endpoints, __pyx_t_6) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "fontTools/varLib/iup.py":38
- *
- *
- * MAX_LOOKBACK = 8 # <<<<<<<<<<<<<<
- *
- *
- */
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAX_LOOKBACK, __pyx_int_8) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
-
- /* "fontTools/varLib/iup.py":97
- *
- *
- * def iup_contour(deltas: _DeltaOrNoneSegment, coords: _PointSegment) -> _DeltaSegment: # <<<<<<<<<<<<<<
- * """For the contour given in `coords`, interpolate any missing
- * delta values in delta vector `deltas`.
- */
- __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 97, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_DeltaOrNoneSegment); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 97, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_deltas, __pyx_t_7) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_PointSegment); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 97, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_coords, __pyx_t_7) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_DeltaSegment); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 97, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_t_7) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9fontTools_6varLib_3iup_1iup_contour, 0, __pyx_n_s_iup_contour, NULL, __pyx_n_s_fontTools_varLib_iup, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 97, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_6);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_iup_contour, __pyx_t_7) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "fontTools/varLib/iup.py":149
- *
- *
- * def iup_delta( # <<<<<<<<<<<<<<
- * deltas: _DeltaOrNoneSegment, coords: _PointSegment, ends: _Endpoints
- * ) -> _DeltaSegment:
- */
- __pyx_t_7 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 149, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
-
- /* "fontTools/varLib/iup.py":150
- *
- * def iup_delta(
- * deltas: _DeltaOrNoneSegment, coords: _PointSegment, ends: _Endpoints # <<<<<<<<<<<<<<
- * ) -> _DeltaSegment:
- * """For the outline given in `coords`, with contour endpoints given
- */
- __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_DeltaOrNoneSegment); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 150, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_deltas, __pyx_t_6) < 0) __PYX_ERR(0, 149, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PointSegment); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 150, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_coords, __pyx_t_6) < 0) __PYX_ERR(0, 149, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Endpoints); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 150, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_ends, __pyx_t_6) < 0) __PYX_ERR(0, 149, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "fontTools/varLib/iup.py":151
- * def iup_delta(
- * deltas: _DeltaOrNoneSegment, coords: _PointSegment, ends: _Endpoints
- * ) -> _DeltaSegment: # <<<<<<<<<<<<<<
- * """For the outline given in `coords`, with contour endpoints given
- * in sorted increasing order in `ends`, interpolate any missing
- */
- __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_DeltaSegment); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 151, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_t_6) < 0) __PYX_ERR(0, 149, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "fontTools/varLib/iup.py":149
- *
- *
- * def iup_delta( # <<<<<<<<<<<<<<
- * deltas: _DeltaOrNoneSegment, coords: _PointSegment, ends: _Endpoints
- * ) -> _DeltaSegment:
- */
- __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9fontTools_6varLib_3iup_3iup_delta, 0, __pyx_n_s_iup_delta, NULL, __pyx_n_s_fontTools_varLib_iup, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_7);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_iup_delta, __pyx_t_6) < 0) __PYX_ERR(0, 149, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "fontTools/varLib/iup.py":218
- * forced=set,
- * )
- * def _iup_contour_bound_forced_set( # <<<<<<<<<<<<<<
- * deltas: _DeltaSegment, coords: _PointSegment, tolerance: Real = 0
- * ) -> set:
- */
- __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 218, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
-
- /* "fontTools/varLib/iup.py":219
- * )
- * def _iup_contour_bound_forced_set(
- * deltas: _DeltaSegment, coords: _PointSegment, tolerance: Real = 0 # <<<<<<<<<<<<<<
- * ) -> set:
- * """The forced set is a conservative set of points on the contour that must be encoded
- */
- __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_DeltaSegment); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 219, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_deltas, __pyx_t_7) < 0) __PYX_ERR(0, 218, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_PointSegment); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 219, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_coords, __pyx_t_7) < 0) __PYX_ERR(0, 218, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Real); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 219, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_tolerance, __pyx_t_7) < 0) __PYX_ERR(0, 218, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_n_u_set) < 0) __PYX_ERR(0, 218, __pyx_L1_error)
-
- /* "fontTools/varLib/iup.py":218
- * forced=set,
- * )
- * def _iup_contour_bound_forced_set( # <<<<<<<<<<<<<<
- * deltas: _DeltaSegment, coords: _PointSegment, tolerance: Real = 0
- * ) -> set:
- */
- __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9fontTools_6varLib_3iup_5_iup_contour_bound_forced_set, 0, __pyx_n_s_iup_contour_bound_forced_set, NULL, __pyx_n_s_fontTools_varLib_iup, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 218, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__9);
- __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_6);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_iup_contour_bound_forced_set, __pyx_t_7) < 0) __PYX_ERR(0, 218, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "fontTools/varLib/iup.py":308
- * tolerance=cython.double,
- * )
- * def _iup_contour_optimize_dp( # <<<<<<<<<<<<<<
- * deltas: _DeltaSegment,
- * coords: _PointSegment,
- */
- __pyx_t_7 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 308, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
-
- /* "fontTools/varLib/iup.py":309
- * )
- * def _iup_contour_optimize_dp(
- * deltas: _DeltaSegment, # <<<<<<<<<<<<<<
- * coords: _PointSegment,
- * forced=set(),
- */
- __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_DeltaSegment); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_deltas, __pyx_t_6) < 0) __PYX_ERR(0, 308, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "fontTools/varLib/iup.py":310
- * def _iup_contour_optimize_dp(
- * deltas: _DeltaSegment,
- * coords: _PointSegment, # <<<<<<<<<<<<<<
- * forced=set(),
- * tolerance: Real = 0,
- */
- __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PointSegment); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 310, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_coords, __pyx_t_6) < 0) __PYX_ERR(0, 308, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "fontTools/varLib/iup.py":312
- * coords: _PointSegment,
- * forced=set(),
- * tolerance: Real = 0, # <<<<<<<<<<<<<<
- * lookback: Integral = None,
- * ):
- */
- __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Real); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_tolerance, __pyx_t_6) < 0) __PYX_ERR(0, 308, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "fontTools/varLib/iup.py":313
- * forced=set(),
- * tolerance: Real = 0,
- * lookback: Integral = None, # <<<<<<<<<<<<<<
- * ):
- * """Straightforward Dynamic-Programming. For each index i, find least-costly encoding of
- */
- __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Integral); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_lookback, __pyx_t_6) < 0) __PYX_ERR(0, 308, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "fontTools/varLib/iup.py":308
- * tolerance=cython.double,
- * )
- * def _iup_contour_optimize_dp( # <<<<<<<<<<<<<<
- * deltas: _DeltaSegment,
- * coords: _PointSegment,
- */
- __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9fontTools_6varLib_3iup_7_iup_contour_optimize_dp, 0, __pyx_n_s_iup_contour_optimize_dp, NULL, __pyx_n_s_fontTools_varLib_iup, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 308, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (!__Pyx_CyFunction_InitDefaults(__pyx_t_6, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 308, __pyx_L1_error)
- __pyx_t_5 = PySet_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 311, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_6)->__pyx_arg_forced = ((PyObject*)__pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_6, __pyx_pf_9fontTools_6varLib_3iup_16__defaults__);
- __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_7);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_iup_contour_optimize_dp, __pyx_t_6) < 0) __PYX_ERR(0, 308, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "fontTools/varLib/iup.py":352
- *
- *
- * def _rot_list(l: list, k: int): # <<<<<<<<<<<<<<
- * """Rotate list by k items forward. Ie. item at position 0 will be
- * at position k in returned list. Negative k is allowed."""
- */
- __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 352, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_l, __pyx_n_u_list) < 0) __PYX_ERR(0, 352, __pyx_L1_error)
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_k, __pyx_n_u_int) < 0) __PYX_ERR(0, 352, __pyx_L1_error)
- __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9fontTools_6varLib_3iup_9_rot_list, 0, __pyx_n_s_rot_list, NULL, __pyx_n_s_fontTools_varLib_iup, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 352, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_6);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_rot_list, __pyx_t_7) < 0) __PYX_ERR(0, 352, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "fontTools/varLib/iup.py":362
- *
- *
- * def _rot_set(s: set, k: int, n: int): # <<<<<<<<<<<<<<
- * k %= n
- * if not k:
- */
- __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 362, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_s, __pyx_n_u_set) < 0) __PYX_ERR(0, 362, __pyx_L1_error)
- if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_k, __pyx_n_u_int) < 0) __PYX_ERR(0, 362, __pyx_L1_error)
- if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_n, __pyx_n_u_int) < 0) __PYX_ERR(0, 362, __pyx_L1_error)
- __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9fontTools_6varLib_3iup_11_rot_set, 0, __pyx_n_s_rot_set, NULL, __pyx_n_s_fontTools_varLib_iup, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 362, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_7);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_rot_set, __pyx_t_6) < 0) __PYX_ERR(0, 362, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "fontTools/varLib/iup.py":369
- *
- *
- * def iup_contour_optimize( # <<<<<<<<<<<<<<
- * deltas: _DeltaSegment, coords: _PointSegment, tolerance: Real = 0.0
- * ) -> _DeltaOrNoneSegment:
- */
- __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 369, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
-
- /* "fontTools/varLib/iup.py":370
- *
- * def iup_contour_optimize(
- * deltas: _DeltaSegment, coords: _PointSegment, tolerance: Real = 0.0 # <<<<<<<<<<<<<<
- * ) -> _DeltaOrNoneSegment:
- * """For contour with coordinates `coords`, optimize a set of delta
- */
- __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_DeltaSegment); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 370, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_deltas, __pyx_t_7) < 0) __PYX_ERR(0, 369, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_PointSegment); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 370, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_coords, __pyx_t_7) < 0) __PYX_ERR(0, 369, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Real); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 370, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_tolerance, __pyx_t_7) < 0) __PYX_ERR(0, 369, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "fontTools/varLib/iup.py":371
- * def iup_contour_optimize(
- * deltas: _DeltaSegment, coords: _PointSegment, tolerance: Real = 0.0
- * ) -> _DeltaOrNoneSegment: # <<<<<<<<<<<<<<
- * """For contour with coordinates `coords`, optimize a set of delta
- * values `deltas` within error `tolerance`.
- */
- __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_DeltaOrNoneSegment); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 371, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_t_7) < 0) __PYX_ERR(0, 369, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "fontTools/varLib/iup.py":369
- *
- *
- * def iup_contour_optimize( # <<<<<<<<<<<<<<
- * deltas: _DeltaSegment, coords: _PointSegment, tolerance: Real = 0.0
- * ) -> _DeltaOrNoneSegment:
- */
- __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9fontTools_6varLib_3iup_13iup_contour_optimize, 0, __pyx_n_s_iup_contour_optimize, NULL, __pyx_n_s_fontTools_varLib_iup, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 369, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__18);
- __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_6);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_iup_contour_optimize, __pyx_t_7) < 0) __PYX_ERR(0, 369, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "fontTools/varLib/iup.py":470
- *
- *
- * def iup_delta_optimize( # <<<<<<<<<<<<<<
- * deltas: _DeltaSegment,
- * coords: _PointSegment,
- */
- __pyx_t_7 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 470, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
-
- /* "fontTools/varLib/iup.py":471
- *
- * def iup_delta_optimize(
- * deltas: _DeltaSegment, # <<<<<<<<<<<<<<
- * coords: _PointSegment,
- * ends: _Endpoints,
- */
- __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_DeltaSegment); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 471, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_deltas, __pyx_t_6) < 0) __PYX_ERR(0, 470, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "fontTools/varLib/iup.py":472
- * def iup_delta_optimize(
- * deltas: _DeltaSegment,
- * coords: _PointSegment, # <<<<<<<<<<<<<<
- * ends: _Endpoints,
- * tolerance: Real = 0.0,
- */
- __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PointSegment); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 472, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_coords, __pyx_t_6) < 0) __PYX_ERR(0, 470, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "fontTools/varLib/iup.py":473
- * deltas: _DeltaSegment,
- * coords: _PointSegment,
- * ends: _Endpoints, # <<<<<<<<<<<<<<
- * tolerance: Real = 0.0,
- * ) -> _DeltaOrNoneSegment:
- */
- __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Endpoints); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 473, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_ends, __pyx_t_6) < 0) __PYX_ERR(0, 470, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "fontTools/varLib/iup.py":474
- * coords: _PointSegment,
- * ends: _Endpoints,
- * tolerance: Real = 0.0, # <<<<<<<<<<<<<<
- * ) -> _DeltaOrNoneSegment:
- * """For the outline given in `coords`, with contour endpoints given
- */
- __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Real); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 474, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_tolerance, __pyx_t_6) < 0) __PYX_ERR(0, 470, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "fontTools/varLib/iup.py":475
- * ends: _Endpoints,
- * tolerance: Real = 0.0,
- * ) -> _DeltaOrNoneSegment: # <<<<<<<<<<<<<<
- * """For the outline given in `coords`, with contour endpoints given
- * in sorted increasing order in `ends`, optimize a set of delta
- */
- __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_DeltaOrNoneSegment); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 475, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_t_6) < 0) __PYX_ERR(0, 470, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "fontTools/varLib/iup.py":470
- *
- *
- * def iup_delta_optimize( # <<<<<<<<<<<<<<
- * deltas: _DeltaSegment,
- * coords: _PointSegment,
- */
- __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9fontTools_6varLib_3iup_15iup_delta_optimize, 0, __pyx_n_s_iup_delta_optimize, NULL, __pyx_n_s_fontTools_varLib_iup, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 470, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__21);
- __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_7);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_iup_delta_optimize, __pyx_t_6) < 0) __PYX_ERR(0, 470, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "fontTools/varLib/iup.py":1
- * try: # <<<<<<<<<<<<<<
- * import cython
- *
- */
- __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_6) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /*--- Wrapped vars code ---*/
-
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_9);
- if (__pyx_m) {
- if (__pyx_d) {
- __Pyx_AddTraceback("init fontTools.varLib.iup", __pyx_clineno, __pyx_lineno, __pyx_filename);
- }
- Py_CLEAR(__pyx_m);
- } else if (!PyErr_Occurred()) {
- PyErr_SetString(PyExc_ImportError, "init fontTools.varLib.iup");
- }
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- #if CYTHON_PEP489_MULTI_PHASE_INIT
- return (__pyx_m != NULL) ? 0 : -1;
- #elif PY_MAJOR_VERSION >= 3
- return __pyx_m;
- #else
- return;
- #endif
-}
-
-/* --- Runtime support code --- */
-/* Refnanny */
-#if CYTHON_REFNANNY
-static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
- PyObject *m = NULL, *p = NULL;
- void *r = NULL;
- m = PyImport_ImportModule(modname);
- if (!m) goto end;
- p = PyObject_GetAttrString(m, "RefNannyAPI");
- if (!p) goto end;
- r = PyLong_AsVoidPtr(p);
-end:
- Py_XDECREF(p);
- Py_XDECREF(m);
- return (__Pyx_RefNannyAPIStruct *)r;
-}
-#endif
-
-/* PyObjectGetAttrStr */
-#if CYTHON_USE_TYPE_SLOTS
-static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
- PyTypeObject* tp = Py_TYPE(obj);
- if (likely(tp->tp_getattro))
- return tp->tp_getattro(obj, attr_name);
-#if PY_MAJOR_VERSION < 3
- if (likely(tp->tp_getattr))
- return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
-#endif
- return PyObject_GetAttr(obj, attr_name);
-}
-#endif
-
-/* GetBuiltinName */
-static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
- PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
- if (unlikely(!result)) {
- PyErr_Format(PyExc_NameError,
-#if PY_MAJOR_VERSION >= 3
- "name '%U' is not defined", name);
-#else
- "name '%.200s' is not defined", PyString_AS_STRING(name));
-#endif
- }
- return result;
-}
-
-/* SetItemInt */
-static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
- int r;
- if (!j) return -1;
- r = PyObject_SetItem(o, j, v);
- Py_DECREF(j);
- return r;
-}
-static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
- CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
-#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
- if (is_list || PyList_CheckExact(o)) {
- Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
- if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
- PyObject* old = PyList_GET_ITEM(o, n);
- Py_INCREF(v);
- PyList_SET_ITEM(o, n, v);
- Py_DECREF(old);
- return 1;
- }
- } else {
- PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
- if (likely(m && m->sq_ass_item)) {
- if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
- Py_ssize_t l = m->sq_length(o);
- if (likely(l >= 0)) {
- i += l;
- } else {
- if (!PyErr_ExceptionMatches(PyExc_OverflowError))
- return -1;
- PyErr_Clear();
- }
- }
- return m->sq_ass_item(o, i, v);
- }
- }
-#else
-#if CYTHON_COMPILING_IN_PYPY
- if (is_list || (PySequence_Check(o) && !PyDict_Check(o)))
-#else
- if (is_list || PySequence_Check(o))
-#endif
- {
- return PySequence_SetItem(o, i, v);
- }
-#endif
- return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
-}
-
-/* GetItemInt */
-static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
- PyObject *r;
- if (!j) return NULL;
- r = PyObject_GetItem(o, j);
- Py_DECREF(j);
- return r;
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
- CYTHON_NCP_UNUSED int wraparound,
- CYTHON_NCP_UNUSED int boundscheck) {
-#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- Py_ssize_t wrapped_i = i;
- if (wraparound & unlikely(i < 0)) {
- wrapped_i += PyList_GET_SIZE(o);
- }
- if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
- PyObject *r = PyList_GET_ITEM(o, wrapped_i);
- Py_INCREF(r);
- return r;
- }
- return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
- return PySequence_GetItem(o, i);
-#endif
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
- CYTHON_NCP_UNUSED int wraparound,
- CYTHON_NCP_UNUSED int boundscheck) {
-#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- Py_ssize_t wrapped_i = i;
- if (wraparound & unlikely(i < 0)) {
- wrapped_i += PyTuple_GET_SIZE(o);
- }
- if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
- PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
- Py_INCREF(r);
- return r;
- }
- return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
- return PySequence_GetItem(o, i);
-#endif
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
- CYTHON_NCP_UNUSED int wraparound,
- CYTHON_NCP_UNUSED int boundscheck) {
-#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
- if (is_list || PyList_CheckExact(o)) {
- Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
- if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
- PyObject *r = PyList_GET_ITEM(o, n);
- Py_INCREF(r);
- return r;
- }
- }
- else if (PyTuple_CheckExact(o)) {
- Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
- if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
- PyObject *r = PyTuple_GET_ITEM(o, n);
- Py_INCREF(r);
- return r;
- }
- } else {
- PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
- if (likely(m && m->sq_item)) {
- if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
- Py_ssize_t l = m->sq_length(o);
- if (likely(l >= 0)) {
- i += l;
- } else {
- if (!PyErr_ExceptionMatches(PyExc_OverflowError))
- return NULL;
- PyErr_Clear();
- }
- }
- return m->sq_item(o, i);
- }
- }
-#else
- if (is_list || PySequence_Check(o)) {
- return PySequence_GetItem(o, i);
- }
-#endif
- return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-}
-
-/* PyObjectCall */
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
- PyObject *result;
- ternaryfunc call = Py_TYPE(func)->tp_call;
- if (unlikely(!call))
- return PyObject_Call(func, arg, kw);
- if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
- return NULL;
- result = (*call)(func, arg, kw);
- Py_LeaveRecursiveCall();
- if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
- PyErr_SetString(
- PyExc_SystemError,
- "NULL result without error in PyObject_Call");
- }
- return result;
-}
-#endif
-
-/* RaiseArgTupleInvalid */
-static void __Pyx_RaiseArgtupleInvalid(
- const char* func_name,
- int exact,
- Py_ssize_t num_min,
- Py_ssize_t num_max,
- Py_ssize_t num_found)
-{
- Py_ssize_t num_expected;
- const char *more_or_less;
- if (num_found < num_min) {
- num_expected = num_min;
- more_or_less = "at least";
- } else {
- num_expected = num_max;
- more_or_less = "at most";
- }
- if (exact) {
- more_or_less = "exactly";
- }
- PyErr_Format(PyExc_TypeError,
- "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
- func_name, more_or_less, num_expected,
- (num_expected == 1) ? "" : "s", num_found);
-}
-
-/* RaiseDoubleKeywords */
-static void __Pyx_RaiseDoubleKeywordsError(
- const char* func_name,
- PyObject* kw_name)
-{
- PyErr_Format(PyExc_TypeError,
- #if PY_MAJOR_VERSION >= 3
- "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
- #else
- "%s() got multiple values for keyword argument '%s'", func_name,
- PyString_AsString(kw_name));
- #endif
-}
-
-/* ParseKeywords */
-static int __Pyx_ParseOptionalKeywords(
- PyObject *kwds,
- PyObject **argnames[],
- PyObject *kwds2,
- PyObject *values[],
- Py_ssize_t num_pos_args,
- const char* function_name)
-{
- PyObject *key = 0, *value = 0;
- Py_ssize_t pos = 0;
- PyObject*** name;
- PyObject*** first_kw_arg = argnames + num_pos_args;
- while (PyDict_Next(kwds, &pos, &key, &value)) {
- name = first_kw_arg;
- while (*name && (**name != key)) name++;
- if (*name) {
- values[name-argnames] = value;
- continue;
- }
- name = first_kw_arg;
- #if PY_MAJOR_VERSION < 3
- if (likely(PyString_Check(key))) {
- while (*name) {
- if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
- && _PyString_Eq(**name, key)) {
- values[name-argnames] = value;
- break;
- }
- name++;
- }
- if (*name) continue;
- else {
- PyObject*** argname = argnames;
- while (argname != first_kw_arg) {
- if ((**argname == key) || (
- (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
- && _PyString_Eq(**argname, key))) {
- goto arg_passed_twice;
- }
- argname++;
- }
- }
- } else
- #endif
- if (likely(PyUnicode_Check(key))) {
- while (*name) {
- int cmp = (**name == key) ? 0 :
- #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
- (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
- #endif
- PyUnicode_Compare(**name, key);
- if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
- if (cmp == 0) {
- values[name-argnames] = value;
- break;
- }
- name++;
- }
- if (*name) continue;
- else {
- PyObject*** argname = argnames;
- while (argname != first_kw_arg) {
- int cmp = (**argname == key) ? 0 :
- #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
- (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
- #endif
- PyUnicode_Compare(**argname, key);
- if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
- if (cmp == 0) goto arg_passed_twice;
- argname++;
- }
- }
- } else
- goto invalid_keyword_type;
- if (kwds2) {
- if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
- } else {
- goto invalid_keyword;
- }
- }
- return 0;
-arg_passed_twice:
- __Pyx_RaiseDoubleKeywordsError(function_name, key);
- goto bad;
-invalid_keyword_type:
- PyErr_Format(PyExc_TypeError,
- "%.200s() keywords must be strings", function_name);
- goto bad;
-invalid_keyword:
- PyErr_Format(PyExc_TypeError,
- #if PY_MAJOR_VERSION < 3
- "%.200s() got an unexpected keyword argument '%.200s'",
- function_name, PyString_AsString(key));
- #else
- "%s() got an unexpected keyword argument '%U'",
- function_name, key);
- #endif
-bad:
- return -1;
-}
-
-/* PyIntBinop */
-#if !CYTHON_COMPILING_IN_PYPY
-static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
- (void)inplace;
- (void)zerodivision_check;
- #if PY_MAJOR_VERSION < 3
- if (likely(PyInt_CheckExact(op1))) {
- const long b = intval;
- long x;
- long a = PyInt_AS_LONG(op1);
- x = (long)((unsigned long)a + b);
- if (likely((x^a) >= 0 || (x^b) >= 0))
- return PyInt_FromLong(x);
- return PyLong_Type.tp_as_number->nb_add(op1, op2);
- }
- #endif
- #if CYTHON_USE_PYLONG_INTERNALS
- if (likely(PyLong_CheckExact(op1))) {
- const long b = intval;
- long a, x;
-#ifdef HAVE_LONG_LONG
- const PY_LONG_LONG llb = intval;
- PY_LONG_LONG lla, llx;
-#endif
- const digit* digits = ((PyLongObject*)op1)->ob_digit;
- const Py_ssize_t size = Py_SIZE(op1);
- if (likely(__Pyx_sst_abs(size) <= 1)) {
- a = likely(size) ? digits[0] : 0;
- if (size == -1) a = -a;
- } else {
- switch (size) {
- case -2:
- if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
- lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- CYTHON_FALLTHROUGH;
- case 2:
- if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
- lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- CYTHON_FALLTHROUGH;
- case -3:
- if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
- lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- CYTHON_FALLTHROUGH;
- case 3:
- if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
- lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- CYTHON_FALLTHROUGH;
- case -4:
- if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
- lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- CYTHON_FALLTHROUGH;
- case 4:
- if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
- lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- CYTHON_FALLTHROUGH;
- default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
- }
- }
- x = a + b;
- return PyLong_FromLong(x);
-#ifdef HAVE_LONG_LONG
- long_long:
- llx = lla + llb;
- return PyLong_FromLongLong(llx);
-#endif
-
-
- }
- #endif
- if (PyFloat_CheckExact(op1)) {
- const long b = intval;
- double a = PyFloat_AS_DOUBLE(op1);
- double result;
- PyFPE_START_PROTECT("add", return NULL)
- result = ((double)a) + (double)b;
- PyFPE_END_PROTECT(result)
- return PyFloat_FromDouble(result);
- }
- return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
-}
-#endif
-
-/* PyErrFetchRestore */
-#if CYTHON_FAST_THREAD_STATE
-static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
- PyObject *tmp_type, *tmp_value, *tmp_tb;
- tmp_type = tstate->curexc_type;
- tmp_value = tstate->curexc_value;
- tmp_tb = tstate->curexc_traceback;
- tstate->curexc_type = type;
- tstate->curexc_value = value;
- tstate->curexc_traceback = tb;
- Py_XDECREF(tmp_type);
- Py_XDECREF(tmp_value);
- Py_XDECREF(tmp_tb);
-}
-static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
- *type = tstate->curexc_type;
- *value = tstate->curexc_value;
- *tb = tstate->curexc_traceback;
- tstate->curexc_type = 0;
- tstate->curexc_value = 0;
- tstate->curexc_traceback = 0;
-}
-#endif
-
-/* IterNext */
-static PyObject *__Pyx_PyIter_Next2Default(PyObject* defval) {
- PyObject* exc_type;
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- exc_type = __Pyx_PyErr_Occurred();
- if (unlikely(exc_type)) {
- if (!defval || unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
- return NULL;
- __Pyx_PyErr_Clear();
- Py_INCREF(defval);
- return defval;
- }
- if (defval) {
- Py_INCREF(defval);
- return defval;
- }
- __Pyx_PyErr_SetNone(PyExc_StopIteration);
- return NULL;
-}
-static void __Pyx_PyIter_Next_ErrorNoIterator(PyObject *iterator) {
- PyErr_Format(PyExc_TypeError,
- "%.200s object is not an iterator", Py_TYPE(iterator)->tp_name);
-}
-static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) {
- PyObject* next;
- iternextfunc iternext = Py_TYPE(iterator)->tp_iternext;
- if (likely(iternext)) {
-#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
- next = iternext(iterator);
- if (likely(next))
- return next;
- #if PY_VERSION_HEX >= 0x02070000 && CYTHON_COMPILING_IN_CPYTHON
- if (unlikely(iternext == &_PyObject_NextNotImplemented))
- return NULL;
- #endif
-#else
- next = PyIter_Next(iterator);
- if (likely(next))
- return next;
-#endif
- } else if (CYTHON_USE_TYPE_SLOTS || unlikely(!PyIter_Check(iterator))) {
- __Pyx_PyIter_Next_ErrorNoIterator(iterator);
- return NULL;
- }
-#if !CYTHON_USE_TYPE_SLOTS
- else {
- next = PyIter_Next(iterator);
- if (likely(next))
- return next;
- }
-#endif
- return __Pyx_PyIter_Next2Default(defval);
-}
-
-/* PyIntCompare */
-static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
- if (op1 == op2) {
- Py_RETURN_FALSE;
- }
- #if PY_MAJOR_VERSION < 3
- if (likely(PyInt_CheckExact(op1))) {
- const long b = intval;
- long a = PyInt_AS_LONG(op1);
- if (a != b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
- }
- #endif
- #if CYTHON_USE_PYLONG_INTERNALS
- if (likely(PyLong_CheckExact(op1))) {
- int unequal;
- unsigned long uintval;
- Py_ssize_t size = Py_SIZE(op1);
- const digit* digits = ((PyLongObject*)op1)->ob_digit;
- if (intval == 0) {
- if (size != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
- } else if (intval < 0) {
- if (size >= 0)
- Py_RETURN_TRUE;
- intval = -intval;
- size = -size;
- } else {
- if (size <= 0)
- Py_RETURN_TRUE;
- }
- uintval = (unsigned long) intval;
-#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
- if (uintval >> (PyLong_SHIFT * 4)) {
- unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
- | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
- } else
-#endif
-#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
- if (uintval >> (PyLong_SHIFT * 3)) {
- unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
- | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
- } else
-#endif
-#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
- if (uintval >> (PyLong_SHIFT * 2)) {
- unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
- | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
- } else
-#endif
-#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
- if (uintval >> (PyLong_SHIFT * 1)) {
- unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
- | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
- } else
-#endif
- unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
- if (unequal != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
- }
- #endif
- if (PyFloat_CheckExact(op1)) {
- const long b = intval;
- double a = PyFloat_AS_DOUBLE(op1);
- if ((double)a != (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
- }
- return (
- PyObject_RichCompare(op1, op2, Py_NE));
-}
-
-/* SliceObject */
-static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
- Py_ssize_t cstart, Py_ssize_t cstop,
- PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
- int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
-#if CYTHON_USE_TYPE_SLOTS
- PyMappingMethods* mp;
-#if PY_MAJOR_VERSION < 3
- PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
- if (likely(ms && ms->sq_slice)) {
- if (!has_cstart) {
- if (_py_start && (*_py_start != Py_None)) {
- cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
- if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
- } else
- cstart = 0;
- }
- if (!has_cstop) {
- if (_py_stop && (*_py_stop != Py_None)) {
- cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
- if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
- } else
- cstop = PY_SSIZE_T_MAX;
- }
- if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
- Py_ssize_t l = ms->sq_length(obj);
- if (likely(l >= 0)) {
- if (cstop < 0) {
- cstop += l;
- if (cstop < 0) cstop = 0;
- }
- if (cstart < 0) {
- cstart += l;
- if (cstart < 0) cstart = 0;
- }
- } else {
- if (!PyErr_ExceptionMatches(PyExc_OverflowError))
- goto bad;
- PyErr_Clear();
- }
- }
- return ms->sq_slice(obj, cstart, cstop);
- }
-#endif
- mp = Py_TYPE(obj)->tp_as_mapping;
- if (likely(mp && mp->mp_subscript))
-#endif
- {
- PyObject* result;
- PyObject *py_slice, *py_start, *py_stop;
- if (_py_slice) {
- py_slice = *_py_slice;
- } else {
- PyObject* owned_start = NULL;
- PyObject* owned_stop = NULL;
- if (_py_start) {
- py_start = *_py_start;
- } else {
- if (has_cstart) {
- owned_start = py_start = PyInt_FromSsize_t(cstart);
- if (unlikely(!py_start)) goto bad;
- } else
- py_start = Py_None;
- }
- if (_py_stop) {
- py_stop = *_py_stop;
- } else {
- if (has_cstop) {
- owned_stop = py_stop = PyInt_FromSsize_t(cstop);
- if (unlikely(!py_stop)) {
- Py_XDECREF(owned_start);
- goto bad;
- }
- } else
- py_stop = Py_None;
- }
- py_slice = PySlice_New(py_start, py_stop, Py_None);
- Py_XDECREF(owned_start);
- Py_XDECREF(owned_stop);
- if (unlikely(!py_slice)) goto bad;
- }
-#if CYTHON_USE_TYPE_SLOTS
- result = mp->mp_subscript(obj, py_slice);
-#else
- result = PyObject_GetItem(obj, py_slice);
-#endif
- if (!_py_slice) {
- Py_DECREF(py_slice);
- }
- return result;
- }
- PyErr_Format(PyExc_TypeError,
- "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
-bad:
- return NULL;
-}
-
-/* ObjectGetItem */
-#if CYTHON_USE_TYPE_SLOTS
-static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
- PyObject *runerr = NULL;
- Py_ssize_t key_value;
- PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
- if (unlikely(!(m && m->sq_item))) {
- PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
- return NULL;
- }
- key_value = __Pyx_PyIndex_AsSsize_t(index);
- if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
- return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
- }
- if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
- PyErr_Clear();
- PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
- }
- return NULL;
-}
-static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
- PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
- if (likely(m && m->mp_subscript)) {
- return m->mp_subscript(obj, key);
- }
- return __Pyx_PyObject_GetIndex(obj, key);
-}
-#endif
-
-/* PyIntBinop */
-#if !CYTHON_COMPILING_IN_PYPY
-static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
- (void)inplace;
- (void)zerodivision_check;
- #if PY_MAJOR_VERSION < 3
- if (likely(PyInt_CheckExact(op1))) {
- const long b = intval;
- long x;
- long a = PyInt_AS_LONG(op1);
- x = (long)((unsigned long)a - b);
- if (likely((x^a) >= 0 || (x^~b) >= 0))
- return PyInt_FromLong(x);
- return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
- }
- #endif
- #if CYTHON_USE_PYLONG_INTERNALS
- if (likely(PyLong_CheckExact(op1))) {
- const long b = intval;
- long a, x;
-#ifdef HAVE_LONG_LONG
- const PY_LONG_LONG llb = intval;
- PY_LONG_LONG lla, llx;
-#endif
- const digit* digits = ((PyLongObject*)op1)->ob_digit;
- const Py_ssize_t size = Py_SIZE(op1);
- if (likely(__Pyx_sst_abs(size) <= 1)) {
- a = likely(size) ? digits[0] : 0;
- if (size == -1) a = -a;
- } else {
- switch (size) {
- case -2:
- if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
- lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- CYTHON_FALLTHROUGH;
- case 2:
- if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
- lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- CYTHON_FALLTHROUGH;
- case -3:
- if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
- lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- CYTHON_FALLTHROUGH;
- case 3:
- if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
- lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- CYTHON_FALLTHROUGH;
- case -4:
- if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
- lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- CYTHON_FALLTHROUGH;
- case 4:
- if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
- break;
-#ifdef HAVE_LONG_LONG
- } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
- lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
- goto long_long;
-#endif
- }
- CYTHON_FALLTHROUGH;
- default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
- }
- }
- x = a - b;
- return PyLong_FromLong(x);
-#ifdef HAVE_LONG_LONG
- long_long:
- llx = lla - llb;
- return PyLong_FromLongLong(llx);
-#endif
-
-
- }
- #endif
- if (PyFloat_CheckExact(op1)) {
- const long b = intval;
- double a = PyFloat_AS_DOUBLE(op1);
- double result;
- PyFPE_START_PROTECT("subtract", return NULL)
- result = ((double)a) - (double)b;
- PyFPE_END_PROTECT(result)
- return PyFloat_FromDouble(result);
- }
- return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
-}
-#endif
-
-/* PyDictVersioning */
-#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
-static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
- PyObject *dict = Py_TYPE(obj)->tp_dict;
- return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
-}
-static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
- PyObject **dictptr = NULL;
- Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
- if (offset) {
-#if CYTHON_COMPILING_IN_CPYTHON
- dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
-#else
- dictptr = _PyObject_GetDictPtr(obj);
-#endif
- }
- return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
-}
-static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
- PyObject *dict = Py_TYPE(obj)->tp_dict;
- if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
- return 0;
- return obj_dict_version == __Pyx_get_object_dict_version(obj);
-}
-#endif
-
-/* GetModuleGlobalName */
-#if CYTHON_USE_DICT_VERSIONS
-static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
-#else
-static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
-#endif
-{
- PyObject *result;
-#if !CYTHON_AVOID_BORROWED_REFS
-#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
- result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
- __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
- if (likely(result)) {
- return __Pyx_NewRef(result);
- } else if (unlikely(PyErr_Occurred())) {
- return NULL;
- }
-#else
- result = PyDict_GetItem(__pyx_d, name);
- __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
- if (likely(result)) {
- return __Pyx_NewRef(result);
- }
-#endif
-#else
- result = PyObject_GetItem(__pyx_d, name);
- __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
- if (likely(result)) {
- return __Pyx_NewRef(result);
- }
- PyErr_Clear();
-#endif
- return __Pyx_GetBuiltinName(name);
-}
-
-/* PyFunctionFastCall */
-#if CYTHON_FAST_PYCALL
-static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
- PyObject *globals) {
- PyFrameObject *f;
- PyThreadState *tstate = __Pyx_PyThreadState_Current;
- PyObject **fastlocals;
- Py_ssize_t i;
- PyObject *result;
- assert(globals != NULL);
- /* XXX Perhaps we should create a specialized
- PyFrame_New() that doesn't take locals, but does
- take builtins without sanity checking them.
- */
- assert(tstate != NULL);
- f = PyFrame_New(tstate, co, globals, NULL);
- if (f == NULL) {
- return NULL;
- }
- fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
- for (i = 0; i < na; i++) {
- Py_INCREF(*args);
- fastlocals[i] = *args++;
- }
- result = PyEval_EvalFrameEx(f,0);
- ++tstate->recursion_depth;
- Py_DECREF(f);
- --tstate->recursion_depth;
- return result;
-}
-#if 1 || PY_VERSION_HEX < 0x030600B1
-static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
- PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
- PyObject *globals = PyFunction_GET_GLOBALS(func);
- PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
- PyObject *closure;
-#if PY_MAJOR_VERSION >= 3
- PyObject *kwdefs;
-#endif
- PyObject *kwtuple, **k;
- PyObject **d;
- Py_ssize_t nd;
- Py_ssize_t nk;
- PyObject *result;
- assert(kwargs == NULL || PyDict_Check(kwargs));
- nk = kwargs ? PyDict_Size(kwargs) : 0;
- if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
- return NULL;
- }
- if (
-#if PY_MAJOR_VERSION >= 3
- co->co_kwonlyargcount == 0 &&
-#endif
- likely(kwargs == NULL || nk == 0) &&
- co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
- if (argdefs == NULL && co->co_argcount == nargs) {
- result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
- goto done;
- }
- else if (nargs == 0 && argdefs != NULL
- && co->co_argcount == Py_SIZE(argdefs)) {
- /* function called with no arguments, but all parameters have
- a default value: use default values as arguments .*/
- args = &PyTuple_GET_ITEM(argdefs, 0);
- result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
- goto done;
- }
- }
- if (kwargs != NULL) {
- Py_ssize_t pos, i;
- kwtuple = PyTuple_New(2 * nk);
- if (kwtuple == NULL) {
- result = NULL;
- goto done;
- }
- k = &PyTuple_GET_ITEM(kwtuple, 0);
- pos = i = 0;
- while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
- Py_INCREF(k[i]);
- Py_INCREF(k[i+1]);
- i += 2;
- }
- nk = i / 2;
- }
- else {
- kwtuple = NULL;
- k = NULL;
- }
- closure = PyFunction_GET_CLOSURE(func);
-#if PY_MAJOR_VERSION >= 3
- kwdefs = PyFunction_GET_KW_DEFAULTS(func);
-#endif
- if (argdefs != NULL) {
- d = &PyTuple_GET_ITEM(argdefs, 0);
- nd = Py_SIZE(argdefs);
- }
- else {
- d = NULL;
- nd = 0;
- }
-#if PY_MAJOR_VERSION >= 3
- result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
- args, (int)nargs,
- k, (int)nk,
- d, (int)nd, kwdefs, closure);
-#else
- result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
- args, (int)nargs,
- k, (int)nk,
- d, (int)nd, closure);
-#endif
- Py_XDECREF(kwtuple);
-done:
- Py_LeaveRecursiveCall();
- return result;
-}
-#endif
-#endif
-
-/* PyCFunctionFastCall */
-#if CYTHON_FAST_PYCCALL
-static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
- PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
- PyCFunction meth = PyCFunction_GET_FUNCTION(func);
- PyObject *self = PyCFunction_GET_SELF(func);
- int flags = PyCFunction_GET_FLAGS(func);
- assert(PyCFunction_Check(func));
- assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
- assert(nargs >= 0);
- assert(nargs == 0 || args != NULL);
- /* _PyCFunction_FastCallDict() must not be called with an exception set,
- because it may clear it (directly or indirectly) and so the
- caller loses its exception */
- assert(!PyErr_Occurred());
- if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
- return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
- } else {
- return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
- }
-}
-#endif
-
-/* None */
-static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
- PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
-}
-
-/* RaiseTooManyValuesToUnpack */
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
- PyErr_Format(PyExc_ValueError,
- "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
-}
-
-/* RaiseNeedMoreValuesToUnpack */
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
- PyErr_Format(PyExc_ValueError,
- "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
- index, (index == 1) ? "" : "s");
-}
-
-/* IterFinish */
-static CYTHON_INLINE int __Pyx_IterFinish(void) {
-#if CYTHON_FAST_THREAD_STATE
- PyThreadState *tstate = __Pyx_PyThreadState_Current;
- PyObject* exc_type = tstate->curexc_type;
- if (unlikely(exc_type)) {
- if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
- PyObject *exc_value, *exc_tb;
- exc_value = tstate->curexc_value;
- exc_tb = tstate->curexc_traceback;
- tstate->curexc_type = 0;
- tstate->curexc_value = 0;
- tstate->curexc_traceback = 0;
- Py_DECREF(exc_type);
- Py_XDECREF(exc_value);
- Py_XDECREF(exc_tb);
- return 0;
- } else {
- return -1;
- }
- }
- return 0;
-#else
- if (unlikely(PyErr_Occurred())) {
- if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
- PyErr_Clear();
- return 0;
- } else {
- return -1;
- }
- }
- return 0;
-#endif
-}
-
-/* UnpackItemEndCheck */
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
- if (unlikely(retval)) {
- Py_DECREF(retval);
- __Pyx_RaiseTooManyValuesError(expected);
- return -1;
- }
- return __Pyx_IterFinish();
-}
-
-/* py_abs */
-#if CYTHON_USE_PYLONG_INTERNALS
-static PyObject *__Pyx_PyLong_AbsNeg(PyObject *n) {
- if (likely(Py_SIZE(n) == -1)) {
- return PyLong_FromLong(((PyLongObject*)n)->ob_digit[0]);
- }
-#if CYTHON_COMPILING_IN_CPYTHON
- {
- PyObject *copy = _PyLong_Copy((PyLongObject*)n);
- if (likely(copy)) {
- __Pyx_SET_SIZE(copy, -Py_SIZE(copy));
- }
- return copy;
- }
-#else
- return PyNumber_Negative(n);
-#endif
-}
-#endif
-
-/* WriteUnraisableException */
-static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
- CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
- int full_traceback, CYTHON_UNUSED int nogil) {
- PyObject *old_exc, *old_val, *old_tb;
- PyObject *ctx;
- __Pyx_PyThreadState_declare
-#ifdef WITH_THREAD
- PyGILState_STATE state;
- if (nogil)
- state = PyGILState_Ensure();
- else state = (PyGILState_STATE)0;
-#endif
- __Pyx_PyThreadState_assign
- __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
- if (full_traceback) {
- Py_XINCREF(old_exc);
- Py_XINCREF(old_val);
- Py_XINCREF(old_tb);
- __Pyx_ErrRestore(old_exc, old_val, old_tb);
- PyErr_PrintEx(1);
- }
- #if PY_MAJOR_VERSION < 3
- ctx = PyString_FromString(name);
- #else
- ctx = PyUnicode_FromString(name);
- #endif
- __Pyx_ErrRestore(old_exc, old_val, old_tb);
- if (!ctx) {
- PyErr_WriteUnraisable(Py_None);
- } else {
- PyErr_WriteUnraisable(ctx);
- Py_DECREF(ctx);
- }
-#ifdef WITH_THREAD
- if (nogil)
- PyGILState_Release(state);
-#endif
-}
-
-/* ArgTypeTest */
-static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
-{
- if (unlikely(!type)) {
- PyErr_SetString(PyExc_SystemError, "Missing type object");
- return 0;
- }
- else if (exact) {
- #if PY_MAJOR_VERSION == 2
- if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
- #endif
- }
- else {
- if (likely(__Pyx_TypeCheck(obj, type))) return 1;
- }
- PyErr_Format(PyExc_TypeError,
- "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
- name, type->tp_name, Py_TYPE(obj)->tp_name);
- return 0;
-}
-
-/* DictGetItem */
-#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
-static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
- PyObject *value;
- value = PyDict_GetItemWithError(d, key);
- if (unlikely(!value)) {
- if (!PyErr_Occurred()) {
- if (unlikely(PyTuple_Check(key))) {
- PyObject* args = PyTuple_Pack(1, key);
- if (likely(args)) {
- PyErr_SetObject(PyExc_KeyError, args);
- Py_DECREF(args);
- }
- } else {
- PyErr_SetObject(PyExc_KeyError, key);
- }
- }
- return NULL;
- }
- Py_INCREF(value);
- return value;
-}
-#endif
-
-/* pyfrozenset_new */
-static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) {
- if (it) {
- PyObject* result;
-#if CYTHON_COMPILING_IN_PYPY
- PyObject* args;
- args = PyTuple_Pack(1, it);
- if (unlikely(!args))
- return NULL;
- result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL);
- Py_DECREF(args);
- return result;
-#else
- if (PyFrozenSet_CheckExact(it)) {
- Py_INCREF(it);
- return it;
- }
- result = PyFrozenSet_New(it);
- if (unlikely(!result))
- return NULL;
- if ((PY_VERSION_HEX >= 0x031000A1) || likely(PySet_GET_SIZE(result)))
- return result;
- Py_DECREF(result);
-#endif
- }
-#if CYTHON_USE_TYPE_SLOTS
- return PyFrozenSet_Type.tp_new(&PyFrozenSet_Type, __pyx_empty_tuple, NULL);
-#else
- return PyObject_Call((PyObject*)&PyFrozenSet_Type, __pyx_empty_tuple, NULL);
-#endif
-}
-
-/* PySetContains */
-static int __Pyx_PySet_ContainsUnhashable(PyObject *set, PyObject *key) {
- int result = -1;
- if (PySet_Check(key) && PyErr_ExceptionMatches(PyExc_TypeError)) {
- PyObject *tmpkey;
- PyErr_Clear();
- tmpkey = __Pyx_PyFrozenSet_New(key);
- if (tmpkey != NULL) {
- result = PySet_Contains(set, tmpkey);
- Py_DECREF(tmpkey);
- }
- }
- return result;
-}
-static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq) {
- int result = PySet_Contains(set, key);
- if (unlikely(result < 0)) {
- result = __Pyx_PySet_ContainsUnhashable(set, key);
- }
- return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
-}
-
-/* SliceTupleAndList */
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop, Py_ssize_t* _length) {
- Py_ssize_t start = *_start, stop = *_stop, length = *_length;
- if (start < 0) {
- start += length;
- if (start < 0)
- start = 0;
- }
- if (stop < 0)
- stop += length;
- else if (stop > length)
- stop = length;
- *_length = stop - start;
- *_start = start;
- *_stop = stop;
-}
-static CYTHON_INLINE void __Pyx_copy_object_array(PyObject** CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
- PyObject *v;
- Py_ssize_t i;
- for (i = 0; i < length; i++) {
- v = dest[i] = src[i];
- Py_INCREF(v);
- }
-}
-static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(
- PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
- PyObject* dest;
- Py_ssize_t length = PyList_GET_SIZE(src);
- __Pyx_crop_slice(&start, &stop, &length);
- if (unlikely(length <= 0))
- return PyList_New(0);
- dest = PyList_New(length);
- if (unlikely(!dest))
- return NULL;
- __Pyx_copy_object_array(
- ((PyListObject*)src)->ob_item + start,
- ((PyListObject*)dest)->ob_item,
- length);
- return dest;
-}
-static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(
- PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
- PyObject* dest;
- Py_ssize_t length = PyTuple_GET_SIZE(src);
- __Pyx_crop_slice(&start, &stop, &length);
- if (unlikely(length <= 0))
- return PyTuple_New(0);
- dest = PyTuple_New(length);
- if (unlikely(!dest))
- return NULL;
- __Pyx_copy_object_array(
- ((PyTupleObject*)src)->ob_item + start,
- ((PyTupleObject*)dest)->ob_item,
- length);
- return dest;
-}
-#endif
-
-/* set_iter */
-static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable, int is_set,
- Py_ssize_t* p_orig_length, int* p_source_is_set) {
-#if CYTHON_COMPILING_IN_CPYTHON
- is_set = is_set || likely(PySet_CheckExact(iterable) || PyFrozenSet_CheckExact(iterable));
- *p_source_is_set = is_set;
- if (likely(is_set)) {
- *p_orig_length = PySet_Size(iterable);
- Py_INCREF(iterable);
- return iterable;
- }
-#else
- (void)is_set;
- *p_source_is_set = 0;
-#endif
- *p_orig_length = 0;
- return PyObject_GetIter(iterable);
-}
-static CYTHON_INLINE int __Pyx_set_iter_next(
- PyObject* iter_obj, Py_ssize_t orig_length,
- Py_ssize_t* ppos, PyObject **value,
- int source_is_set) {
- if (!CYTHON_COMPILING_IN_CPYTHON || unlikely(!source_is_set)) {
- *value = PyIter_Next(iter_obj);
- if (unlikely(!*value)) {
- return __Pyx_IterFinish();
- }
- (void)orig_length;
- (void)ppos;
- return 1;
- }
-#if CYTHON_COMPILING_IN_CPYTHON
- if (unlikely(PySet_GET_SIZE(iter_obj) != orig_length)) {
- PyErr_SetString(
- PyExc_RuntimeError,
- "set changed size during iteration");
- return -1;
- }
- {
- Py_hash_t hash;
- int ret = _PySet_NextEntry(iter_obj, ppos, value, &hash);
- assert (ret != -1);
- if (likely(ret)) {
- Py_INCREF(*value);
- return 1;
- }
- }
-#endif
- return 0;
-}
-
-/* PyIntCompare */
-static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
- if (op1 == op2) {
- Py_RETURN_TRUE;
- }
- #if PY_MAJOR_VERSION < 3
- if (likely(PyInt_CheckExact(op1))) {
- const long b = intval;
- long a = PyInt_AS_LONG(op1);
- if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
- }
- #endif
- #if CYTHON_USE_PYLONG_INTERNALS
- if (likely(PyLong_CheckExact(op1))) {
- int unequal;
- unsigned long uintval;
- Py_ssize_t size = Py_SIZE(op1);
- const digit* digits = ((PyLongObject*)op1)->ob_digit;
- if (intval == 0) {
- if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
- } else if (intval < 0) {
- if (size >= 0)
- Py_RETURN_FALSE;
- intval = -intval;
- size = -size;
- } else {
- if (size <= 0)
- Py_RETURN_FALSE;
- }
- uintval = (unsigned long) intval;
-#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
- if (uintval >> (PyLong_SHIFT * 4)) {
- unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
- | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
- } else
-#endif
-#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
- if (uintval >> (PyLong_SHIFT * 3)) {
- unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
- | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
- } else
-#endif
-#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
- if (uintval >> (PyLong_SHIFT * 2)) {
- unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
- | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
- } else
-#endif
-#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
- if (uintval >> (PyLong_SHIFT * 1)) {
- unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
- | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
- } else
-#endif
- unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
- if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
- }
- #endif
- if (PyFloat_CheckExact(op1)) {
- const long b = intval;
- double a = PyFloat_AS_DOUBLE(op1);
- if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
- }
- return (
- PyObject_RichCompare(op1, op2, Py_EQ));
-}
-
-/* PyObjectCallMethO */
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
- PyObject *self, *result;
- PyCFunction cfunc;
- cfunc = PyCFunction_GET_FUNCTION(func);
- self = PyCFunction_GET_SELF(func);
- if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
- return NULL;
- result = cfunc(self, arg);
- Py_LeaveRecursiveCall();
- if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
- PyErr_SetString(
- PyExc_SystemError,
- "NULL result without error in PyObject_Call");
- }
- return result;
-}
-#endif
-
-/* PyObjectCallOneArg */
-#if CYTHON_COMPILING_IN_CPYTHON
-static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
- PyObject *result;
- PyObject *args = PyTuple_New(1);
- if (unlikely(!args)) return NULL;
- Py_INCREF(arg);
- PyTuple_SET_ITEM(args, 0, arg);
- result = __Pyx_PyObject_Call(func, args, NULL);
- Py_DECREF(args);
- return result;
-}
-static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
-#if CYTHON_FAST_PYCALL
- if (PyFunction_Check(func)) {
- return __Pyx_PyFunction_FastCall(func, &arg, 1);
- }
-#endif
- if (likely(PyCFunction_Check(func))) {
- if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
- return __Pyx_PyObject_CallMethO(func, arg);
-#if CYTHON_FAST_PYCCALL
- } else if (__Pyx_PyFastCFunction_Check(func)) {
- return __Pyx_PyCFunction_FastCall(func, &arg, 1);
-#endif
- }
- }
- return __Pyx__PyObject_CallOneArg(func, arg);
-}
-#else
-static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
- PyObject *result;
- PyObject *args = PyTuple_Pack(1, arg);
- if (unlikely(!args)) return NULL;
- result = __Pyx_PyObject_Call(func, args, NULL);
- Py_DECREF(args);
- return result;
-}
-#endif
-
-/* py_set_discard_unhashable */
-static int __Pyx_PySet_DiscardUnhashable(PyObject *set, PyObject *key) {
- PyObject *tmpkey;
- int rv;
- if (likely(!PySet_Check(key) || !PyErr_ExceptionMatches(PyExc_TypeError)))
- return -1;
- PyErr_Clear();
- tmpkey = __Pyx_PyFrozenSet_New(key);
- if (tmpkey == NULL)
- return -1;
- rv = PySet_Discard(set, tmpkey);
- Py_DECREF(tmpkey);
- return rv;
-}
-
-/* py_set_remove */
-static int __Pyx_PySet_RemoveNotFound(PyObject *set, PyObject *key, int found) {
- if (unlikely(found < 0)) {
- found = __Pyx_PySet_DiscardUnhashable(set, key);
- }
- if (likely(found == 0)) {
- PyObject *tup;
- tup = PyTuple_Pack(1, key);
- if (!tup)
- return -1;
- PyErr_SetObject(PyExc_KeyError, tup);
- Py_DECREF(tup);
- return -1;
- }
- return found;
-}
-static CYTHON_INLINE int __Pyx_PySet_Remove(PyObject *set, PyObject *key) {
- int found = PySet_Discard(set, key);
- if (unlikely(found != 1)) {
- return __Pyx_PySet_RemoveNotFound(set, key, found);
- }
- return 0;
-}
-
-/* PyObject_GenericGetAttrNoDict */
-#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
-static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
- PyErr_Format(PyExc_AttributeError,
-#if PY_MAJOR_VERSION >= 3
- "'%.50s' object has no attribute '%U'",
- tp->tp_name, attr_name);
-#else
- "'%.50s' object has no attribute '%.400s'",
- tp->tp_name, PyString_AS_STRING(attr_name));
-#endif
- return NULL;
-}
-static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
- PyObject *descr;
- PyTypeObject *tp = Py_TYPE(obj);
- if (unlikely(!PyString_Check(attr_name))) {
- return PyObject_GenericGetAttr(obj, attr_name);
- }
- assert(!tp->tp_dictoffset);
- descr = _PyType_Lookup(tp, attr_name);
- if (unlikely(!descr)) {
- return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
- }
- Py_INCREF(descr);
- #if PY_MAJOR_VERSION < 3
- if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
- #endif
- {
- descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
- if (unlikely(f)) {
- PyObject *res = f(descr, obj, (PyObject *)tp);
- Py_DECREF(descr);
- return res;
- }
- }
- return descr;
-}
-#endif
-
-/* GetTopmostException */
-#if CYTHON_USE_EXC_INFO_STACK
-static _PyErr_StackItem *
-__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
-{
- _PyErr_StackItem *exc_info = tstate->exc_info;
- while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
- exc_info->previous_item != NULL)
- {
- exc_info = exc_info->previous_item;
- }
- return exc_info;
-}
-#endif
-
-/* SaveResetException */
-#if CYTHON_FAST_THREAD_STATE
-static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
- #if CYTHON_USE_EXC_INFO_STACK
- _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
- *type = exc_info->exc_type;
- *value = exc_info->exc_value;
- *tb = exc_info->exc_traceback;
- #else
- *type = tstate->exc_type;
- *value = tstate->exc_value;
- *tb = tstate->exc_traceback;
- #endif
- Py_XINCREF(*type);
- Py_XINCREF(*value);
- Py_XINCREF(*tb);
-}
-static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
- PyObject *tmp_type, *tmp_value, *tmp_tb;
- #if CYTHON_USE_EXC_INFO_STACK
- _PyErr_StackItem *exc_info = tstate->exc_info;
- tmp_type = exc_info->exc_type;
- tmp_value = exc_info->exc_value;
- tmp_tb = exc_info->exc_traceback;
- exc_info->exc_type = type;
- exc_info->exc_value = value;
- exc_info->exc_traceback = tb;
- #else
- tmp_type = tstate->exc_type;
- tmp_value = tstate->exc_value;
- tmp_tb = tstate->exc_traceback;
- tstate->exc_type = type;
- tstate->exc_value = value;
- tstate->exc_traceback = tb;
- #endif
- Py_XDECREF(tmp_type);
- Py_XDECREF(tmp_value);
- Py_XDECREF(tmp_tb);
-}
-#endif
-
-/* PyErrExceptionMatches */
-#if CYTHON_FAST_THREAD_STATE
-static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
- Py_ssize_t i, n;
- n = PyTuple_GET_SIZE(tuple);
-#if PY_MAJOR_VERSION >= 3
- for (i=0; icurexc_type;
- if (exc_type == err) return 1;
- if (unlikely(!exc_type)) return 0;
- if (unlikely(PyTuple_Check(err)))
- return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
- return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
-}
-#endif
-
-/* GetException */
-#if CYTHON_FAST_THREAD_STATE
-static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
-#else
-static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
-#endif
-{
- PyObject *local_type, *local_value, *local_tb;
-#if CYTHON_FAST_THREAD_STATE
- PyObject *tmp_type, *tmp_value, *tmp_tb;
- local_type = tstate->curexc_type;
- local_value = tstate->curexc_value;
- local_tb = tstate->curexc_traceback;
- tstate->curexc_type = 0;
- tstate->curexc_value = 0;
- tstate->curexc_traceback = 0;
-#else
- PyErr_Fetch(&local_type, &local_value, &local_tb);
-#endif
- PyErr_NormalizeException(&local_type, &local_value, &local_tb);
-#if CYTHON_FAST_THREAD_STATE
- if (unlikely(tstate->curexc_type))
-#else
- if (unlikely(PyErr_Occurred()))
-#endif
- goto bad;
- #if PY_MAJOR_VERSION >= 3
- if (local_tb) {
- if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
- goto bad;
- }
- #endif
- Py_XINCREF(local_tb);
- Py_XINCREF(local_type);
- Py_XINCREF(local_value);
- *type = local_type;
- *value = local_value;
- *tb = local_tb;
-#if CYTHON_FAST_THREAD_STATE
- #if CYTHON_USE_EXC_INFO_STACK
- {
- _PyErr_StackItem *exc_info = tstate->exc_info;
- tmp_type = exc_info->exc_type;
- tmp_value = exc_info->exc_value;
- tmp_tb = exc_info->exc_traceback;
- exc_info->exc_type = local_type;
- exc_info->exc_value = local_value;
- exc_info->exc_traceback = local_tb;
- }
- #else
- tmp_type = tstate->exc_type;
- tmp_value = tstate->exc_value;
- tmp_tb = tstate->exc_traceback;
- tstate->exc_type = local_type;
- tstate->exc_value = local_value;
- tstate->exc_traceback = local_tb;
- #endif
- Py_XDECREF(tmp_type);
- Py_XDECREF(tmp_value);
- Py_XDECREF(tmp_tb);
-#else
- PyErr_SetExcInfo(local_type, local_value, local_tb);
-#endif
- return 0;
-bad:
- *type = 0;
- *value = 0;
- *tb = 0;
- Py_XDECREF(local_type);
- Py_XDECREF(local_value);
- Py_XDECREF(local_tb);
- return -1;
-}
-
-/* Import */
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
- PyObject *empty_list = 0;
- PyObject *module = 0;
- PyObject *global_dict = 0;
- PyObject *empty_dict = 0;
- PyObject *list;
- #if PY_MAJOR_VERSION < 3
- PyObject *py_import;
- py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
- if (!py_import)
- goto bad;
- #endif
- if (from_list)
- list = from_list;
- else {
- empty_list = PyList_New(0);
- if (!empty_list)
- goto bad;
- list = empty_list;
- }
- global_dict = PyModule_GetDict(__pyx_m);
- if (!global_dict)
- goto bad;
- empty_dict = PyDict_New();
- if (!empty_dict)
- goto bad;
- {
- #if PY_MAJOR_VERSION >= 3
- if (level == -1) {
- if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
- module = PyImport_ImportModuleLevelObject(
- name, global_dict, empty_dict, list, 1);
- if (!module) {
- if (!PyErr_ExceptionMatches(PyExc_ImportError))
- goto bad;
- PyErr_Clear();
- }
- }
- level = 0;
- }
- #endif
- if (!module) {
- #if PY_MAJOR_VERSION < 3
- PyObject *py_level = PyInt_FromLong(level);
- if (!py_level)
- goto bad;
- module = PyObject_CallFunctionObjArgs(py_import,
- name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
- Py_DECREF(py_level);
- #else
- module = PyImport_ImportModuleLevelObject(
- name, global_dict, empty_dict, list, level);
- #endif
- }
- }
-bad:
- #if PY_MAJOR_VERSION < 3
- Py_XDECREF(py_import);
- #endif
- Py_XDECREF(empty_list);
- Py_XDECREF(empty_dict);
- return module;
-}
-
-/* ImportFrom */
-static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
- PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
- if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
- PyErr_Format(PyExc_ImportError,
- #if PY_MAJOR_VERSION < 3
- "cannot import name %.230s", PyString_AS_STRING(name));
- #else
- "cannot import name %S", name);
- #endif
- }
- return value;
-}
-
-/* FetchCommonType */
-static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
- PyObject* fake_module;
- PyTypeObject* cached_type = NULL;
- fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
- if (!fake_module) return NULL;
- Py_INCREF(fake_module);
- cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
- if (cached_type) {
- if (!PyType_Check((PyObject*)cached_type)) {
- PyErr_Format(PyExc_TypeError,
- "Shared Cython type %.200s is not a type object",
- type->tp_name);
- goto bad;
- }
- if (cached_type->tp_basicsize != type->tp_basicsize) {
- PyErr_Format(PyExc_TypeError,
- "Shared Cython type %.200s has the wrong size, try recompiling",
- type->tp_name);
- goto bad;
- }
- } else {
- if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
- PyErr_Clear();
- if (PyType_Ready(type) < 0) goto bad;
- if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
- goto bad;
- Py_INCREF(type);
- cached_type = type;
- }
-done:
- Py_DECREF(fake_module);
- return cached_type;
-bad:
- Py_XDECREF(cached_type);
- cached_type = NULL;
- goto done;
-}
-
-/* CythonFunctionShared */
-#include
-static PyObject *
-__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
-{
- if (unlikely(op->func_doc == NULL)) {
- if (op->func.m_ml->ml_doc) {
-#if PY_MAJOR_VERSION >= 3
- op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
-#else
- op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
-#endif
- if (unlikely(op->func_doc == NULL))
- return NULL;
- } else {
- Py_INCREF(Py_None);
- return Py_None;
- }
- }
- Py_INCREF(op->func_doc);
- return op->func_doc;
-}
-static int
-__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
-{
- PyObject *tmp = op->func_doc;
- if (value == NULL) {
- value = Py_None;
- }
- Py_INCREF(value);
- op->func_doc = value;
- Py_XDECREF(tmp);
- return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
-{
- if (unlikely(op->func_name == NULL)) {
-#if PY_MAJOR_VERSION >= 3
- op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
-#else
- op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
-#endif
- if (unlikely(op->func_name == NULL))
- return NULL;
- }
- Py_INCREF(op->func_name);
- return op->func_name;
-}
-static int
-__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
-{
- PyObject *tmp;
-#if PY_MAJOR_VERSION >= 3
- if (unlikely(value == NULL || !PyUnicode_Check(value)))
-#else
- if (unlikely(value == NULL || !PyString_Check(value)))
-#endif
- {
- PyErr_SetString(PyExc_TypeError,
- "__name__ must be set to a string object");
- return -1;
- }
- tmp = op->func_name;
- Py_INCREF(value);
- op->func_name = value;
- Py_XDECREF(tmp);
- return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
-{
- Py_INCREF(op->func_qualname);
- return op->func_qualname;
-}
-static int
-__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
-{
- PyObject *tmp;
-#if PY_MAJOR_VERSION >= 3
- if (unlikely(value == NULL || !PyUnicode_Check(value)))
-#else
- if (unlikely(value == NULL || !PyString_Check(value)))
-#endif
- {
- PyErr_SetString(PyExc_TypeError,
- "__qualname__ must be set to a string object");
- return -1;
- }
- tmp = op->func_qualname;
- Py_INCREF(value);
- op->func_qualname = value;
- Py_XDECREF(tmp);
- return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
-{
- PyObject *self;
- self = m->func_closure;
- if (self == NULL)
- self = Py_None;
- Py_INCREF(self);
- return self;
-}
-static PyObject *
-__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
-{
- if (unlikely(op->func_dict == NULL)) {
- op->func_dict = PyDict_New();
- if (unlikely(op->func_dict == NULL))
- return NULL;
- }
- Py_INCREF(op->func_dict);
- return op->func_dict;
-}
-static int
-__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
-{
- PyObject *tmp;
- if (unlikely(value == NULL)) {
- PyErr_SetString(PyExc_TypeError,
- "function's dictionary may not be deleted");
- return -1;
- }
- if (unlikely(!PyDict_Check(value))) {
- PyErr_SetString(PyExc_TypeError,
- "setting function's dictionary to a non-dict");
- return -1;
- }
- tmp = op->func_dict;
- Py_INCREF(value);
- op->func_dict = value;
- Py_XDECREF(tmp);
- return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
-{
- Py_INCREF(op->func_globals);
- return op->func_globals;
-}
-static PyObject *
-__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
-{
- Py_INCREF(Py_None);
- return Py_None;
-}
-static PyObject *
-__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
-{
- PyObject* result = (op->func_code) ? op->func_code : Py_None;
- Py_INCREF(result);
- return result;
-}
-static int
-__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
- int result = 0;
- PyObject *res = op->defaults_getter((PyObject *) op);
- if (unlikely(!res))
- return -1;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
- Py_INCREF(op->defaults_tuple);
- op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
- Py_INCREF(op->defaults_kwdict);
- #else
- op->defaults_tuple = PySequence_ITEM(res, 0);
- if (unlikely(!op->defaults_tuple)) result = -1;
- else {
- op->defaults_kwdict = PySequence_ITEM(res, 1);
- if (unlikely(!op->defaults_kwdict)) result = -1;
- }
- #endif
- Py_DECREF(res);
- return result;
-}
-static int
-__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
- PyObject* tmp;
- if (!value) {
- value = Py_None;
- } else if (value != Py_None && !PyTuple_Check(value)) {
- PyErr_SetString(PyExc_TypeError,
- "__defaults__ must be set to a tuple object");
- return -1;
- }
- Py_INCREF(value);
- tmp = op->defaults_tuple;
- op->defaults_tuple = value;
- Py_XDECREF(tmp);
- return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
- PyObject* result = op->defaults_tuple;
- if (unlikely(!result)) {
- if (op->defaults_getter) {
- if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
- result = op->defaults_tuple;
- } else {
- result = Py_None;
- }
- }
- Py_INCREF(result);
- return result;
-}
-static int
-__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
- PyObject* tmp;
- if (!value) {
- value = Py_None;
- } else if (value != Py_None && !PyDict_Check(value)) {
- PyErr_SetString(PyExc_TypeError,
- "__kwdefaults__ must be set to a dict object");
- return -1;
- }
- Py_INCREF(value);
- tmp = op->defaults_kwdict;
- op->defaults_kwdict = value;
- Py_XDECREF(tmp);
- return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
- PyObject* result = op->defaults_kwdict;
- if (unlikely(!result)) {
- if (op->defaults_getter) {
- if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
- result = op->defaults_kwdict;
- } else {
- result = Py_None;
- }
- }
- Py_INCREF(result);
- return result;
-}
-static int
-__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
- PyObject* tmp;
- if (!value || value == Py_None) {
- value = NULL;
- } else if (!PyDict_Check(value)) {
- PyErr_SetString(PyExc_TypeError,
- "__annotations__ must be set to a dict object");
- return -1;
- }
- Py_XINCREF(value);
- tmp = op->func_annotations;
- op->func_annotations = value;
- Py_XDECREF(tmp);
- return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
- PyObject* result = op->func_annotations;
- if (unlikely(!result)) {
- result = PyDict_New();
- if (unlikely(!result)) return NULL;
- op->func_annotations = result;
- }
- Py_INCREF(result);
- return result;
-}
-static PyGetSetDef __pyx_CyFunction_getsets[] = {
- {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
- {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
- {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
- {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
- {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
- {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
- {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
- {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
- {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
- {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
- {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
- {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
- {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
- {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
- {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
- {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
- {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
- {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
- {0, 0, 0, 0, 0}
-};
-static PyMemberDef __pyx_CyFunction_members[] = {
- {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
- {0, 0, 0, 0, 0}
-};
-static PyObject *
-__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
-{
-#if PY_MAJOR_VERSION >= 3
- Py_INCREF(m->func_qualname);
- return m->func_qualname;
-#else
- return PyString_FromString(m->func.m_ml->ml_name);
-#endif
-}
-static PyMethodDef __pyx_CyFunction_methods[] = {
- {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
- {0, 0, 0, 0}
-};
-#if PY_VERSION_HEX < 0x030500A0
-#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
-#else
-#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
-#endif
-static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
- PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
- if (unlikely(op == NULL))
- return NULL;
- op->flags = flags;
- __Pyx_CyFunction_weakreflist(op) = NULL;
- op->func.m_ml = ml;
- op->func.m_self = (PyObject *) op;
- Py_XINCREF(closure);
- op->func_closure = closure;
- Py_XINCREF(module);
- op->func.m_module = module;
- op->func_dict = NULL;
- op->func_name = NULL;
- Py_INCREF(qualname);
- op->func_qualname = qualname;
- op->func_doc = NULL;
- op->func_classobj = NULL;
- op->func_globals = globals;
- Py_INCREF(op->func_globals);
- Py_XINCREF(code);
- op->func_code = code;
- op->defaults_pyobjects = 0;
- op->defaults_size = 0;
- op->defaults = NULL;
- op->defaults_tuple = NULL;
- op->defaults_kwdict = NULL;
- op->defaults_getter = NULL;
- op->func_annotations = NULL;
- return (PyObject *) op;
-}
-static int
-__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
-{
- Py_CLEAR(m->func_closure);
- Py_CLEAR(m->func.m_module);
- Py_CLEAR(m->func_dict);
- Py_CLEAR(m->func_name);
- Py_CLEAR(m->func_qualname);
- Py_CLEAR(m->func_doc);
- Py_CLEAR(m->func_globals);
- Py_CLEAR(m->func_code);
- Py_CLEAR(m->func_classobj);
- Py_CLEAR(m->defaults_tuple);
- Py_CLEAR(m->defaults_kwdict);
- Py_CLEAR(m->func_annotations);
- if (m->defaults) {
- PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
- int i;
- for (i = 0; i < m->defaults_pyobjects; i++)
- Py_XDECREF(pydefaults[i]);
- PyObject_Free(m->defaults);
- m->defaults = NULL;
- }
- return 0;
-}
-static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
-{
- if (__Pyx_CyFunction_weakreflist(m) != NULL)
- PyObject_ClearWeakRefs((PyObject *) m);
- __Pyx_CyFunction_clear(m);
- PyObject_GC_Del(m);
-}
-static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
-{
- PyObject_GC_UnTrack(m);
- __Pyx__CyFunction_dealloc(m);
-}
-static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
-{
- Py_VISIT(m->func_closure);
- Py_VISIT(m->func.m_module);
- Py_VISIT(m->func_dict);
- Py_VISIT(m->func_name);
- Py_VISIT(m->func_qualname);
- Py_VISIT(m->func_doc);
- Py_VISIT(m->func_globals);
- Py_VISIT(m->func_code);
- Py_VISIT(m->func_classobj);
- Py_VISIT(m->defaults_tuple);
- Py_VISIT(m->defaults_kwdict);
- if (m->defaults) {
- PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
- int i;
- for (i = 0; i < m->defaults_pyobjects; i++)
- Py_VISIT(pydefaults[i]);
- }
- return 0;
-}
-static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
-{
-#if PY_MAJOR_VERSION < 3
- __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
- if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
- Py_INCREF(func);
- return func;
- }
- if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
- if (type == NULL)
- type = (PyObject *)(Py_TYPE(obj));
- return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
- }
- if (obj == Py_None)
- obj = NULL;
-#endif
- return __Pyx_PyMethod_New(func, obj, type);
-}
-static PyObject*
-__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
-{
-#if PY_MAJOR_VERSION >= 3
- return PyUnicode_FromFormat("",
- op->func_qualname, (void *)op);
-#else
- return PyString_FromFormat("",
- PyString_AsString(op->func_qualname), (void *)op);
-#endif
-}
-static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
- PyCFunctionObject* f = (PyCFunctionObject*)func;
- PyCFunction meth = f->m_ml->ml_meth;
- Py_ssize_t size;
- switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
- case METH_VARARGS:
- if (likely(kw == NULL || PyDict_Size(kw) == 0))
- return (*meth)(self, arg);
- break;
- case METH_VARARGS | METH_KEYWORDS:
- return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
- case METH_NOARGS:
- if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
- size = PyTuple_GET_SIZE(arg);
- if (likely(size == 0))
- return (*meth)(self, NULL);
- PyErr_Format(PyExc_TypeError,
- "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
- f->m_ml->ml_name, size);
- return NULL;
- }
- break;
- case METH_O:
- if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
- size = PyTuple_GET_SIZE(arg);
- if (likely(size == 1)) {
- PyObject *result, *arg0;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- arg0 = PyTuple_GET_ITEM(arg, 0);
- #else
- arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
- #endif
- result = (*meth)(self, arg0);
- #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
- Py_DECREF(arg0);
- #endif
- return result;
- }
- PyErr_Format(PyExc_TypeError,
- "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
- f->m_ml->ml_name, size);
- return NULL;
- }
- break;
- default:
- PyErr_SetString(PyExc_SystemError, "Bad call flags in "
- "__Pyx_CyFunction_Call. METH_OLDARGS is no "
- "longer supported!");
- return NULL;
- }
- PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
- f->m_ml->ml_name);
- return NULL;
-}
-static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
- return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
-}
-static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
- PyObject *result;
- __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
- if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
- Py_ssize_t argc;
- PyObject *new_args;
- PyObject *self;
- argc = PyTuple_GET_SIZE(args);
- new_args = PyTuple_GetSlice(args, 1, argc);
- if (unlikely(!new_args))
- return NULL;
- self = PyTuple_GetItem(args, 0);
- if (unlikely(!self)) {
- Py_DECREF(new_args);
-#if PY_MAJOR_VERSION > 2
- PyErr_Format(PyExc_TypeError,
- "unbound method %.200S() needs an argument",
- cyfunc->func_qualname);
-#else
- PyErr_SetString(PyExc_TypeError,
- "unbound method needs an argument");
-#endif
- return NULL;
- }
- result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
- Py_DECREF(new_args);
- } else {
- result = __Pyx_CyFunction_Call(func, args, kw);
- }
- return result;
-}
-static PyTypeObject __pyx_CyFunctionType_type = {
- PyVarObject_HEAD_INIT(0, 0)
- "cython_function_or_method",
- sizeof(__pyx_CyFunctionObject),
- 0,
- (destructor) __Pyx_CyFunction_dealloc,
- 0,
- 0,
- 0,
-#if PY_MAJOR_VERSION < 3
- 0,
-#else
- 0,
-#endif
- (reprfunc) __Pyx_CyFunction_repr,
- 0,
- 0,
- 0,
- 0,
- __Pyx_CyFunction_CallAsMethod,
- 0,
- 0,
- 0,
- 0,
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
- 0,
- (traverseproc) __Pyx_CyFunction_traverse,
- (inquiry) __Pyx_CyFunction_clear,
- 0,
-#if PY_VERSION_HEX < 0x030500A0
- offsetof(__pyx_CyFunctionObject, func_weakreflist),
-#else
- offsetof(PyCFunctionObject, m_weakreflist),
-#endif
- 0,
- 0,
- __pyx_CyFunction_methods,
- __pyx_CyFunction_members,
- __pyx_CyFunction_getsets,
- 0,
- 0,
- __Pyx_CyFunction_descr_get,
- 0,
- offsetof(__pyx_CyFunctionObject, func_dict),
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
-#if PY_VERSION_HEX >= 0x030400a1
- 0,
-#endif
-#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
- 0,
-#endif
-#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
- 0,
-#endif
-#if PY_VERSION_HEX >= 0x030C0000
- 0,
-#endif
-#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
- 0,
-#endif
-};
-static int __pyx_CyFunction_init(void) {
- __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
- if (unlikely(__pyx_CyFunctionType == NULL)) {
- return -1;
- }
- return 0;
-}
-static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
- __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
- m->defaults = PyObject_Malloc(size);
- if (unlikely(!m->defaults))
- return PyErr_NoMemory();
- memset(m->defaults, 0, size);
- m->defaults_pyobjects = pyobjects;
- m->defaults_size = size;
- return m->defaults;
-}
-static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
- __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
- m->defaults_tuple = tuple;
- Py_INCREF(tuple);
-}
-static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
- __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
- m->defaults_kwdict = dict;
- Py_INCREF(dict);
-}
-static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
- __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
- m->func_annotations = dict;
- Py_INCREF(dict);
-}
-
-/* CythonFunction */
-static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
- PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
- PyObject *op = __Pyx_CyFunction_Init(
- PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
- ml, flags, qualname, closure, module, globals, code
- );
- if (likely(op)) {
- PyObject_GC_Track(op);
- }
- return op;
-}
-
-/* CLineInTraceback */
-#ifndef CYTHON_CLINE_IN_TRACEBACK
-static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
- PyObject *use_cline;
- PyObject *ptype, *pvalue, *ptraceback;
-#if CYTHON_COMPILING_IN_CPYTHON
- PyObject **cython_runtime_dict;
-#endif
- if (unlikely(!__pyx_cython_runtime)) {
- return c_line;
- }
- __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
-#if CYTHON_COMPILING_IN_CPYTHON
- cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
- if (likely(cython_runtime_dict)) {
- __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
- use_cline, *cython_runtime_dict,
- __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
- } else
-#endif
- {
- PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
- if (use_cline_obj) {
- use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
- Py_DECREF(use_cline_obj);
- } else {
- PyErr_Clear();
- use_cline = NULL;
- }
- }
- if (!use_cline) {
- c_line = 0;
- (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
- }
- else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
- c_line = 0;
- }
- __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
- return c_line;
-}
-#endif
-
-/* CodeObjectCache */
-static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
- int start = 0, mid = 0, end = count - 1;
- if (end >= 0 && code_line > entries[end].code_line) {
- return count;
- }
- while (start < end) {
- mid = start + (end - start) / 2;
- if (code_line < entries[mid].code_line) {
- end = mid;
- } else if (code_line > entries[mid].code_line) {
- start = mid + 1;
- } else {
- return mid;
- }
- }
- if (code_line <= entries[mid].code_line) {
- return mid;
- } else {
- return mid + 1;
- }
-}
-static PyCodeObject *__pyx_find_code_object(int code_line) {
- PyCodeObject* code_object;
- int pos;
- if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
- return NULL;
- }
- pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
- if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
- return NULL;
- }
- code_object = __pyx_code_cache.entries[pos].code_object;
- Py_INCREF(code_object);
- return code_object;
-}
-static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
- int pos, i;
- __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
- if (unlikely(!code_line)) {
- return;
- }
- if (unlikely(!entries)) {
- entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
- if (likely(entries)) {
- __pyx_code_cache.entries = entries;
- __pyx_code_cache.max_count = 64;
- __pyx_code_cache.count = 1;
- entries[0].code_line = code_line;
- entries[0].code_object = code_object;
- Py_INCREF(code_object);
- }
- return;
- }
- pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
- if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
- PyCodeObject* tmp = entries[pos].code_object;
- entries[pos].code_object = code_object;
- Py_DECREF(tmp);
- return;
- }
- if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
- int new_max = __pyx_code_cache.max_count + 64;
- entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
- __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
- if (unlikely(!entries)) {
- return;
- }
- __pyx_code_cache.entries = entries;
- __pyx_code_cache.max_count = new_max;
- }
- for (i=__pyx_code_cache.count; i>pos; i--) {
- entries[i] = entries[i-1];
- }
- entries[pos].code_line = code_line;
- entries[pos].code_object = code_object;
- __pyx_code_cache.count++;
- Py_INCREF(code_object);
-}
-
-/* AddTraceback */
-#include "compile.h"
-#include "frameobject.h"
-#include "traceback.h"
-#if PY_VERSION_HEX >= 0x030b00a6
- #ifndef Py_BUILD_CORE
- #define Py_BUILD_CORE 1
- #endif
- #include "internal/pycore_frame.h"
-#endif
-static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
- const char *funcname, int c_line,
- int py_line, const char *filename) {
- PyCodeObject *py_code = NULL;
- PyObject *py_funcname = NULL;
- #if PY_MAJOR_VERSION < 3
- PyObject *py_srcfile = NULL;
- py_srcfile = PyString_FromString(filename);
- if (!py_srcfile) goto bad;
- #endif
- if (c_line) {
- #if PY_MAJOR_VERSION < 3
- py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
- if (!py_funcname) goto bad;
- #else
- py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
- if (!py_funcname) goto bad;
- funcname = PyUnicode_AsUTF8(py_funcname);
- if (!funcname) goto bad;
- #endif
- }
- else {
- #if PY_MAJOR_VERSION < 3
- py_funcname = PyString_FromString(funcname);
- if (!py_funcname) goto bad;
- #endif
- }
- #if PY_MAJOR_VERSION < 3
- py_code = __Pyx_PyCode_New(
- 0,
- 0,
- 0,
- 0,
- 0,
- __pyx_empty_bytes, /*PyObject *code,*/
- __pyx_empty_tuple, /*PyObject *consts,*/
- __pyx_empty_tuple, /*PyObject *names,*/
- __pyx_empty_tuple, /*PyObject *varnames,*/
- __pyx_empty_tuple, /*PyObject *freevars,*/
- __pyx_empty_tuple, /*PyObject *cellvars,*/
- py_srcfile, /*PyObject *filename,*/
- py_funcname, /*PyObject *name,*/
- py_line,
- __pyx_empty_bytes /*PyObject *lnotab*/
- );
- Py_DECREF(py_srcfile);
- #else
- py_code = PyCode_NewEmpty(filename, funcname, py_line);
- #endif
- Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
- return py_code;
-bad:
- Py_XDECREF(py_funcname);
- #if PY_MAJOR_VERSION < 3
- Py_XDECREF(py_srcfile);
- #endif
- return NULL;
-}
-static void __Pyx_AddTraceback(const char *funcname, int c_line,
- int py_line, const char *filename) {
- PyCodeObject *py_code = 0;
- PyFrameObject *py_frame = 0;
- PyThreadState *tstate = __Pyx_PyThreadState_Current;
- PyObject *ptype, *pvalue, *ptraceback;
- if (c_line) {
- c_line = __Pyx_CLineForTraceback(tstate, c_line);
- }
- py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
- if (!py_code) {
- __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
- py_code = __Pyx_CreateCodeObjectForTraceback(
- funcname, c_line, py_line, filename);
- if (!py_code) {
- /* If the code object creation fails, then we should clear the
- fetched exception references and propagate the new exception */
- Py_XDECREF(ptype);
- Py_XDECREF(pvalue);
- Py_XDECREF(ptraceback);
- goto bad;
- }
- __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
- __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
- }
- py_frame = PyFrame_New(
- tstate, /*PyThreadState *tstate,*/
- py_code, /*PyCodeObject *code,*/
- __pyx_d, /*PyObject *globals,*/
- 0 /*PyObject *locals*/
- );
- if (!py_frame) goto bad;
- __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
- PyTraceBack_Here(py_frame);
-bad:
- Py_XDECREF(py_code);
- Py_XDECREF(py_frame);
-}
-
-/* CIntFromPyVerify */
-#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
- __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
-#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
- __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
-#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
- {\
- func_type value = func_value;\
- if (sizeof(target_type) < sizeof(func_type)) {\
- if (unlikely(value != (func_type) (target_type) value)) {\
- func_type zero = 0;\
- if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
- return (target_type) -1;\
- if (is_unsigned && unlikely(value < zero))\
- goto raise_neg_overflow;\
- else\
- goto raise_overflow;\
- }\
- }\
- return (target_type) value;\
- }
-
-/* CIntFromPy */
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
-#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wconversion"
-#endif
- const int neg_one = (int) -1, const_zero = (int) 0;
-#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
-#pragma GCC diagnostic pop
-#endif
- const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x))) {
- if (sizeof(int) < sizeof(long)) {
- __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
- } else {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- goto raise_neg_overflow;
- }
- return (int) val;
- }
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
-#if CYTHON_USE_PYLONG_INTERNALS
- const digit* digits = ((PyLongObject*)x)->ob_digit;
- switch (Py_SIZE(x)) {
- case 0: return (int) 0;
- case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
- case 2:
- if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
- return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
- }
- }
- break;
- case 3:
- if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
- return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
- }
- }
- break;
- case 4:
- if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
- return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
- }
- }
- break;
- }
-#endif
-#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
- if (unlikely(Py_SIZE(x) < 0)) {
- goto raise_neg_overflow;
- }
-#else
- {
- int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
- if (unlikely(result < 0))
- return (int) -1;
- if (unlikely(result == 1))
- goto raise_neg_overflow;
- }
-#endif
- if (sizeof(int) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
-#ifdef HAVE_LONG_LONG
- } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
- __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
-#endif
- }
- } else {
-#if CYTHON_USE_PYLONG_INTERNALS
- const digit* digits = ((PyLongObject*)x)->ob_digit;
- switch (Py_SIZE(x)) {
- case 0: return (int) 0;
- case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
- case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
- case -2:
- if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
- return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
- }
- }
- break;
- case 2:
- if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
- return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
- }
- }
- break;
- case -3:
- if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
- return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
- }
- }
- break;
- case 3:
- if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
- return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
- }
- }
- break;
- case -4:
- if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
- return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
- }
- }
- break;
- case 4:
- if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
- return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
- }
- }
- break;
- }
-#endif
- if (sizeof(int) <= sizeof(long)) {
- __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
-#ifdef HAVE_LONG_LONG
- } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
- __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
-#endif
- }
- }
- {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
- PyErr_SetString(PyExc_RuntimeError,
- "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
- int val;
- PyObject *v = __Pyx_PyNumber_IntOrLong(x);
- #if PY_MAJOR_VERSION < 3
- if (likely(v) && !PyLong_Check(v)) {
- PyObject *tmp = v;
- v = PyNumber_Long(tmp);
- Py_DECREF(tmp);
- }
- #endif
- if (likely(v)) {
- int one = 1; int is_little = (int)*(unsigned char *)&one;
- unsigned char *bytes = (unsigned char *)&val;
- int ret = _PyLong_AsByteArray((PyLongObject *)v,
- bytes, sizeof(val),
- is_little, !is_unsigned);
- Py_DECREF(v);
- if (likely(!ret))
- return val;
- }
-#endif
- return (int) -1;
- }
- } else {
- int val;
- PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
- if (!tmp) return (int) -1;
- val = __Pyx_PyInt_As_int(tmp);
- Py_DECREF(tmp);
- return val;
- }
-raise_overflow:
- PyErr_SetString(PyExc_OverflowError,
- "value too large to convert to int");
- return (int) -1;
-raise_neg_overflow:
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to int");
- return (int) -1;
-}
-
-/* CIntToPy */
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
-#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wconversion"
-#endif
- const int neg_one = (int) -1, const_zero = (int) 0;
-#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
-#pragma GCC diagnostic pop
-#endif
- const int is_unsigned = neg_one > const_zero;
- if (is_unsigned) {
- if (sizeof(int) < sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(int) <= sizeof(unsigned long)) {
- return PyLong_FromUnsignedLong((unsigned long) value);
-#ifdef HAVE_LONG_LONG
- } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
- return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
-#endif
- }
- } else {
- if (sizeof(int) <= sizeof(long)) {
- return PyInt_FromLong((long) value);
-#ifdef HAVE_LONG_LONG
- } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
- return PyLong_FromLongLong((PY_LONG_LONG) value);
-#endif
- }
- }
- {
- int one = 1; int little = (int)*(unsigned char *)&one;
- unsigned char *bytes = (unsigned char *)&value;
- return _PyLong_FromByteArray(bytes, sizeof(int),
- little, !is_unsigned);
- }
-}
-
-/* CIntToPy */
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
-#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wconversion"
-#endif
- const long neg_one = (long) -1, const_zero = (long) 0;
-#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
-#pragma GCC diagnostic pop
-#endif
- const int is_unsigned = neg_one > const_zero;
- if (is_unsigned) {
- if (sizeof(long) < sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(long) <= sizeof(unsigned long)) {
- return PyLong_FromUnsignedLong((unsigned long) value);
-#ifdef HAVE_LONG_LONG
- } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
- return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
-#endif
- }
- } else {
- if (sizeof(long) <= sizeof(long)) {
- return PyInt_FromLong((long) value);
-#ifdef HAVE_LONG_LONG
- } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
- return PyLong_FromLongLong((PY_LONG_LONG) value);
-#endif
- }
- }
- {
- int one = 1; int little = (int)*(unsigned char *)&one;
- unsigned char *bytes = (unsigned char *)&value;
- return _PyLong_FromByteArray(bytes, sizeof(long),
- little, !is_unsigned);
- }
-}
-
-/* CIntFromPy */
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
-#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wconversion"
-#endif
- const long neg_one = (long) -1, const_zero = (long) 0;
-#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
-#pragma GCC diagnostic pop
-#endif
- const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x))) {
- if (sizeof(long) < sizeof(long)) {
- __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
- } else {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- goto raise_neg_overflow;
- }
- return (long) val;
- }
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
-#if CYTHON_USE_PYLONG_INTERNALS
- const digit* digits = ((PyLongObject*)x)->ob_digit;
- switch (Py_SIZE(x)) {
- case 0: return (long) 0;
- case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
- case 2:
- if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
- return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
- }
- }
- break;
- case 3:
- if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
- return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
- }
- }
- break;
- case 4:
- if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
- return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
- }
- }
- break;
- }
-#endif
-#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
- if (unlikely(Py_SIZE(x) < 0)) {
- goto raise_neg_overflow;
- }
-#else
- {
- int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
- if (unlikely(result < 0))
- return (long) -1;
- if (unlikely(result == 1))
- goto raise_neg_overflow;
- }
-#endif
- if (sizeof(long) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
-#ifdef HAVE_LONG_LONG
- } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
- __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
-#endif
- }
- } else {
-#if CYTHON_USE_PYLONG_INTERNALS
- const digit* digits = ((PyLongObject*)x)->ob_digit;
- switch (Py_SIZE(x)) {
- case 0: return (long) 0;
- case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
- case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
- case -2:
- if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
- }
- }
- break;
- case 2:
- if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
- }
- }
- break;
- case -3:
- if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
- }
- }
- break;
- case 3:
- if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
- }
- }
- break;
- case -4:
- if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
- }
- }
- break;
- case 4:
- if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
- if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
- __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
- } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
- return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
- }
- }
- break;
- }
-#endif
- if (sizeof(long) <= sizeof(long)) {
- __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
-#ifdef HAVE_LONG_LONG
- } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
- __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
-#endif
- }
- }
- {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
- PyErr_SetString(PyExc_RuntimeError,
- "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
- long val;
- PyObject *v = __Pyx_PyNumber_IntOrLong(x);
- #if PY_MAJOR_VERSION < 3
- if (likely(v) && !PyLong_Check(v)) {
- PyObject *tmp = v;
- v = PyNumber_Long(tmp);
- Py_DECREF(tmp);
- }
- #endif
- if (likely(v)) {
- int one = 1; int is_little = (int)*(unsigned char *)&one;
- unsigned char *bytes = (unsigned char *)&val;
- int ret = _PyLong_AsByteArray((PyLongObject *)v,
- bytes, sizeof(val),
- is_little, !is_unsigned);
- Py_DECREF(v);
- if (likely(!ret))
- return val;
- }
-#endif
- return (long) -1;
- }
- } else {
- long val;
- PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
- if (!tmp) return (long) -1;
- val = __Pyx_PyInt_As_long(tmp);
- Py_DECREF(tmp);
- return val;
- }
-raise_overflow:
- PyErr_SetString(PyExc_OverflowError,
- "value too large to convert to long");
- return (long) -1;
-raise_neg_overflow:
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to long");
- return (long) -1;
-}
-
-/* FastTypeChecks */
-#if CYTHON_COMPILING_IN_CPYTHON
-static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
- while (a) {
- a = a->tp_base;
- if (a == b)
- return 1;
- }
- return b == &PyBaseObject_Type;
-}
-static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
- PyObject *mro;
- if (a == b) return 1;
- mro = a->tp_mro;
- if (likely(mro)) {
- Py_ssize_t i, n;
- n = PyTuple_GET_SIZE(mro);
- for (i = 0; i < n; i++) {
- if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
- return 1;
- }
- return 0;
- }
- return __Pyx_InBases(a, b);
-}
-#if PY_MAJOR_VERSION == 2
-static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
- PyObject *exception, *value, *tb;
- int res;
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __Pyx_ErrFetch(&exception, &value, &tb);
- res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
- if (unlikely(res == -1)) {
- PyErr_WriteUnraisable(err);
- res = 0;
- }
- if (!res) {
- res = PyObject_IsSubclass(err, exc_type2);
- if (unlikely(res == -1)) {
- PyErr_WriteUnraisable(err);
- res = 0;
- }
- }
- __Pyx_ErrRestore(exception, value, tb);
- return res;
-}
-#else
-static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
- int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
- if (!res) {
- res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
- }
- return res;
-}
-#endif
-static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
- Py_ssize_t i, n;
- assert(PyExceptionClass_Check(exc_type));
- n = PyTuple_GET_SIZE(tuple);
-#if PY_MAJOR_VERSION >= 3
- for (i=0; icurexc_traceback;
- if (tb != tmp_tb) {
- Py_INCREF(tb);
- tstate->curexc_traceback = tb;
- Py_XDECREF(tmp_tb);
- }
-#else
- PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
- Py_INCREF(tb);
- PyErr_Restore(tmp_type, tmp_value, tb);
- Py_XDECREF(tmp_tb);
-#endif
- }
-bad:
- Py_XDECREF(owned_instance);
- return;
-}
-#endif
-
-/* SwapException */
-#if CYTHON_FAST_THREAD_STATE
-static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
- PyObject *tmp_type, *tmp_value, *tmp_tb;
- #if CYTHON_USE_EXC_INFO_STACK
- _PyErr_StackItem *exc_info = tstate->exc_info;
- tmp_type = exc_info->exc_type;
- tmp_value = exc_info->exc_value;
- tmp_tb = exc_info->exc_traceback;
- exc_info->exc_type = *type;
- exc_info->exc_value = *value;
- exc_info->exc_traceback = *tb;
- #else
- tmp_type = tstate->exc_type;
- tmp_value = tstate->exc_value;
- tmp_tb = tstate->exc_traceback;
- tstate->exc_type = *type;
- tstate->exc_value = *value;
- tstate->exc_traceback = *tb;
- #endif
- *type = tmp_type;
- *value = tmp_value;
- *tb = tmp_tb;
-}
-#else
-static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
- PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
- PyErr_SetExcInfo(*type, *value, *tb);
- *type = tmp_type;
- *value = tmp_value;
- *tb = tmp_tb;
-}
-#endif
-
-/* PyObjectCall2Args */
-static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
- PyObject *args, *result = NULL;
- #if CYTHON_FAST_PYCALL
- if (PyFunction_Check(function)) {
- PyObject *args[2] = {arg1, arg2};
- return __Pyx_PyFunction_FastCall(function, args, 2);
- }
- #endif
- #if CYTHON_FAST_PYCCALL
- if (__Pyx_PyFastCFunction_Check(function)) {
- PyObject *args[2] = {arg1, arg2};
- return __Pyx_PyCFunction_FastCall(function, args, 2);
- }
- #endif
- args = PyTuple_New(2);
- if (unlikely(!args)) goto done;
- Py_INCREF(arg1);
- PyTuple_SET_ITEM(args, 0, arg1);
- Py_INCREF(arg2);
- PyTuple_SET_ITEM(args, 1, arg2);
- Py_INCREF(function);
- result = __Pyx_PyObject_Call(function, args, NULL);
- Py_DECREF(args);
- Py_DECREF(function);
-done:
- return result;
-}
-
-/* PyObjectGetMethod */
-static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
- PyObject *attr;
-#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
- PyTypeObject *tp = Py_TYPE(obj);
- PyObject *descr;
- descrgetfunc f = NULL;
- PyObject **dictptr, *dict;
- int meth_found = 0;
- assert (*method == NULL);
- if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
- attr = __Pyx_PyObject_GetAttrStr(obj, name);
- goto try_unpack;
- }
- if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
- return 0;
- }
- descr = _PyType_Lookup(tp, name);
- if (likely(descr != NULL)) {
- Py_INCREF(descr);
-#if PY_MAJOR_VERSION >= 3
- #ifdef __Pyx_CyFunction_USED
- if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
- #else
- if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
- #endif
-#else
- #ifdef __Pyx_CyFunction_USED
- if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
- #else
- if (likely(PyFunction_Check(descr)))
- #endif
-#endif
- {
- meth_found = 1;
- } else {
- f = Py_TYPE(descr)->tp_descr_get;
- if (f != NULL && PyDescr_IsData(descr)) {
- attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
- Py_DECREF(descr);
- goto try_unpack;
- }
- }
- }
- dictptr = _PyObject_GetDictPtr(obj);
- if (dictptr != NULL && (dict = *dictptr) != NULL) {
- Py_INCREF(dict);
- attr = __Pyx_PyDict_GetItemStr(dict, name);
- if (attr != NULL) {
- Py_INCREF(attr);
- Py_DECREF(dict);
- Py_XDECREF(descr);
- goto try_unpack;
- }
- Py_DECREF(dict);
- }
- if (meth_found) {
- *method = descr;
- return 1;
- }
- if (f != NULL) {
- attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
- Py_DECREF(descr);
- goto try_unpack;
- }
- if (descr != NULL) {
- *method = descr;
- return 0;
- }
- PyErr_Format(PyExc_AttributeError,
-#if PY_MAJOR_VERSION >= 3
- "'%.50s' object has no attribute '%U'",
- tp->tp_name, name);
-#else
- "'%.50s' object has no attribute '%.400s'",
- tp->tp_name, PyString_AS_STRING(name));
-#endif
- return 0;
-#else
- attr = __Pyx_PyObject_GetAttrStr(obj, name);
- goto try_unpack;
-#endif
-try_unpack:
-#if CYTHON_UNPACK_METHODS
- if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
- PyObject *function = PyMethod_GET_FUNCTION(attr);
- Py_INCREF(function);
- Py_DECREF(attr);
- *method = function;
- return 1;
- }
-#endif
- *method = attr;
- return 0;
-}
-
-/* PyObjectCallMethod1 */
-static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
- PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
- Py_DECREF(method);
- return result;
-}
-static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
- PyObject *method = NULL, *result;
- int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
- if (likely(is_method)) {
- result = __Pyx_PyObject_Call2Args(method, obj, arg);
- Py_DECREF(method);
- return result;
- }
- if (unlikely(!method)) return NULL;
- return __Pyx__PyObject_CallMethod1(method, arg);
-}
-
-/* CoroutineBase */
-#include
-#include
-#if PY_VERSION_HEX >= 0x030b00a6
- #ifndef Py_BUILD_CORE
- #define Py_BUILD_CORE 1
- #endif
- #include "internal/pycore_frame.h"
-#endif
-#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
-static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
- PyObject *et, *ev, *tb;
- PyObject *value = NULL;
- __Pyx_ErrFetch(&et, &ev, &tb);
- if (!et) {
- Py_XDECREF(tb);
- Py_XDECREF(ev);
- Py_INCREF(Py_None);
- *pvalue = Py_None;
- return 0;
- }
- if (likely(et == PyExc_StopIteration)) {
- if (!ev) {
- Py_INCREF(Py_None);
- value = Py_None;
- }
-#if PY_VERSION_HEX >= 0x030300A0
- else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
- value = ((PyStopIterationObject *)ev)->value;
- Py_INCREF(value);
- Py_DECREF(ev);
- }
-#endif
- else if (unlikely(PyTuple_Check(ev))) {
- if (PyTuple_GET_SIZE(ev) >= 1) {
-#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- value = PyTuple_GET_ITEM(ev, 0);
- Py_INCREF(value);
-#else
- value = PySequence_ITEM(ev, 0);
-#endif
- } else {
- Py_INCREF(Py_None);
- value = Py_None;
- }
- Py_DECREF(ev);
- }
- else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
- value = ev;
- }
- if (likely(value)) {
- Py_XDECREF(tb);
- Py_DECREF(et);
- *pvalue = value;
- return 0;
- }
- } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
- __Pyx_ErrRestore(et, ev, tb);
- return -1;
- }
- PyErr_NormalizeException(&et, &ev, &tb);
- if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
- __Pyx_ErrRestore(et, ev, tb);
- return -1;
- }
- Py_XDECREF(tb);
- Py_DECREF(et);
-#if PY_VERSION_HEX >= 0x030300A0
- value = ((PyStopIterationObject *)ev)->value;
- Py_INCREF(value);
- Py_DECREF(ev);
-#else
- {
- PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
- Py_DECREF(ev);
- if (likely(args)) {
- value = PySequence_GetItem(args, 0);
- Py_DECREF(args);
- }
- if (unlikely(!value)) {
- __Pyx_ErrRestore(NULL, NULL, NULL);
- Py_INCREF(Py_None);
- value = Py_None;
- }
- }
-#endif
- *pvalue = value;
- return 0;
-}
-static CYTHON_INLINE
-void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
- PyObject *t, *v, *tb;
- t = exc_state->exc_type;
- v = exc_state->exc_value;
- tb = exc_state->exc_traceback;
- exc_state->exc_type = NULL;
- exc_state->exc_value = NULL;
- exc_state->exc_traceback = NULL;
- Py_XDECREF(t);
- Py_XDECREF(v);
- Py_XDECREF(tb);
-}
-#define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
-static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
- const char *msg;
- if ((0)) {
- #ifdef __Pyx_Coroutine_USED
- } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
- msg = "coroutine already executing";
- #endif
- #ifdef __Pyx_AsyncGen_USED
- } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
- msg = "async generator already executing";
- #endif
- } else {
- msg = "generator already executing";
- }
- PyErr_SetString(PyExc_ValueError, msg);
-}
-#define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
-static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
- const char *msg;
- if ((0)) {
- #ifdef __Pyx_Coroutine_USED
- } else if (__Pyx_Coroutine_Check(gen)) {
- msg = "can't send non-None value to a just-started coroutine";
- #endif
- #ifdef __Pyx_AsyncGen_USED
- } else if (__Pyx_AsyncGen_CheckExact(gen)) {
- msg = "can't send non-None value to a just-started async generator";
- #endif
- } else {
- msg = "can't send non-None value to a just-started generator";
- }
- PyErr_SetString(PyExc_TypeError, msg);
-}
-#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
-static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) {
- #ifdef __Pyx_Coroutine_USED
- if (!closing && __Pyx_Coroutine_Check(gen)) {
- PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
- } else
- #endif
- if (value) {
- #ifdef __Pyx_AsyncGen_USED
- if (__Pyx_AsyncGen_CheckExact(gen))
- PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
- else
- #endif
- PyErr_SetNone(PyExc_StopIteration);
- }
-}
-static
-PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
- __Pyx_PyThreadState_declare
- PyThreadState *tstate;
- __Pyx_ExcInfoStruct *exc_state;
- PyObject *retval;
- assert(!self->is_running);
- if (unlikely(self->resume_label == 0)) {
- if (unlikely(value && value != Py_None)) {
- return __Pyx_Coroutine_NotStartedError((PyObject*)self);
- }
- }
- if (unlikely(self->resume_label == -1)) {
- return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
- }
-#if CYTHON_FAST_THREAD_STATE
- __Pyx_PyThreadState_assign
- tstate = __pyx_tstate;
-#else
- tstate = __Pyx_PyThreadState_Current;
-#endif
- exc_state = &self->gi_exc_state;
- if (exc_state->exc_type) {
- #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
- #else
- if (exc_state->exc_traceback) {
- PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
- PyFrameObject *f = tb->tb_frame;
- assert(f->f_back == NULL);
- #if PY_VERSION_HEX >= 0x030B00A1
- f->f_back = PyThreadState_GetFrame(tstate);
- #else
- Py_XINCREF(tstate->frame);
- f->f_back = tstate->frame;
- #endif
- }
- #endif
- }
-#if CYTHON_USE_EXC_INFO_STACK
- exc_state->previous_item = tstate->exc_info;
- tstate->exc_info = exc_state;
-#else
- if (exc_state->exc_type) {
- __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
- } else {
- __Pyx_Coroutine_ExceptionClear(exc_state);
- __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
- }
-#endif
- self->is_running = 1;
- retval = self->body((PyObject *) self, tstate, value);
- self->is_running = 0;
-#if CYTHON_USE_EXC_INFO_STACK
- exc_state = &self->gi_exc_state;
- tstate->exc_info = exc_state->previous_item;
- exc_state->previous_item = NULL;
- __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
-#endif
- return retval;
-}
-static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
- PyObject *exc_tb = exc_state->exc_traceback;
- if (likely(exc_tb)) {
-#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
-#else
- PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
- PyFrameObject *f = tb->tb_frame;
- Py_CLEAR(f->f_back);
-#endif
- }
-}
-static CYTHON_INLINE
-PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
- if (unlikely(!retval)) {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- if (!__Pyx_PyErr_Occurred()) {
- PyObject *exc = PyExc_StopIteration;
- #ifdef __Pyx_AsyncGen_USED
- if (__Pyx_AsyncGen_CheckExact(gen))
- exc = __Pyx_PyExc_StopAsyncIteration;
- #endif
- __Pyx_PyErr_SetNone(exc);
- }
- }
- return retval;
-}
-#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
-static CYTHON_INLINE
-PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) {
-#if PY_VERSION_HEX <= 0x030A00A1
- return _PyGen_Send(gen, arg);
-#else
- PyObject *result;
- if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) {
- if (PyAsyncGen_CheckExact(gen)) {
- assert(result == Py_None);
- PyErr_SetNone(PyExc_StopAsyncIteration);
- }
- else if (result == Py_None) {
- PyErr_SetNone(PyExc_StopIteration);
- }
- else {
- _PyGen_SetStopIterationValue(result);
- }
- Py_CLEAR(result);
- }
- return result;
-#endif
-}
-#endif
-static CYTHON_INLINE
-PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
- PyObject *ret;
- PyObject *val = NULL;
- __Pyx_Coroutine_Undelegate(gen);
- __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
- ret = __Pyx_Coroutine_SendEx(gen, val, 0);
- Py_XDECREF(val);
- return ret;
-}
-static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
- PyObject *retval;
- __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
- PyObject *yf = gen->yieldfrom;
- if (unlikely(gen->is_running))
- return __Pyx_Coroutine_AlreadyRunningError(gen);
- if (yf) {
- PyObject *ret;
- gen->is_running = 1;
- #ifdef __Pyx_Generator_USED
- if (__Pyx_Generator_CheckExact(yf)) {
- ret = __Pyx_Coroutine_Send(yf, value);
- } else
- #endif
- #ifdef __Pyx_Coroutine_USED
- if (__Pyx_Coroutine_Check(yf)) {
- ret = __Pyx_Coroutine_Send(yf, value);
- } else
- #endif
- #ifdef __Pyx_AsyncGen_USED
- if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
- ret = __Pyx_async_gen_asend_send(yf, value);
- } else
- #endif
- #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
- if (PyGen_CheckExact(yf)) {
- ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
- } else
- #endif
- #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
- if (PyCoro_CheckExact(yf)) {
- ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
- } else
- #endif
- {
- if (value == Py_None)
- ret = Py_TYPE(yf)->tp_iternext(yf);
- else
- ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
- }
- gen->is_running = 0;
- if (likely(ret)) {
- return ret;
- }
- retval = __Pyx_Coroutine_FinishDelegation(gen);
- } else {
- retval = __Pyx_Coroutine_SendEx(gen, value, 0);
- }
- return __Pyx_Coroutine_MethodReturn(self, retval);
-}
-static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
- PyObject *retval = NULL;
- int err = 0;
- #ifdef __Pyx_Generator_USED
- if (__Pyx_Generator_CheckExact(yf)) {
- retval = __Pyx_Coroutine_Close(yf);
- if (!retval)
- return -1;
- } else
- #endif
- #ifdef __Pyx_Coroutine_USED
- if (__Pyx_Coroutine_Check(yf)) {
- retval = __Pyx_Coroutine_Close(yf);
- if (!retval)
- return -1;
- } else
- if (__Pyx_CoroutineAwait_CheckExact(yf)) {
- retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
- if (!retval)
- return -1;
- } else
- #endif
- #ifdef __Pyx_AsyncGen_USED
- if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
- retval = __Pyx_async_gen_asend_close(yf, NULL);
- } else
- if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
- retval = __Pyx_async_gen_athrow_close(yf, NULL);
- } else
- #endif
- {
- PyObject *meth;
- gen->is_running = 1;
- meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
- if (unlikely(!meth)) {
- if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
- PyErr_WriteUnraisable(yf);
- }
- PyErr_Clear();
- } else {
- retval = PyObject_CallFunction(meth, NULL);
- Py_DECREF(meth);
- if (!retval)
- err = -1;
- }
- gen->is_running = 0;
- }
- Py_XDECREF(retval);
- return err;
-}
-static PyObject *__Pyx_Generator_Next(PyObject *self) {
- __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
- PyObject *yf = gen->yieldfrom;
- if (unlikely(gen->is_running))
- return __Pyx_Coroutine_AlreadyRunningError(gen);
- if (yf) {
- PyObject *ret;
- gen->is_running = 1;
- #ifdef __Pyx_Generator_USED
- if (__Pyx_Generator_CheckExact(yf)) {
- ret = __Pyx_Generator_Next(yf);
- } else
- #endif
- #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
- if (PyGen_CheckExact(yf)) {
- ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL);
- } else
- #endif
- #ifdef __Pyx_Coroutine_USED
- if (__Pyx_Coroutine_Check(yf)) {
- ret = __Pyx_Coroutine_Send(yf, Py_None);
- } else
- #endif
- ret = Py_TYPE(yf)->tp_iternext(yf);
- gen->is_running = 0;
- if (likely(ret)) {
- return ret;
- }
- return __Pyx_Coroutine_FinishDelegation(gen);
- }
- return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
-}
-static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, CYTHON_UNUSED PyObject *arg) {
- return __Pyx_Coroutine_Close(self);
-}
-static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
- __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
- PyObject *retval, *raised_exception;
- PyObject *yf = gen->yieldfrom;
- int err = 0;
- if (unlikely(gen->is_running))
- return __Pyx_Coroutine_AlreadyRunningError(gen);
- if (yf) {
- Py_INCREF(yf);
- err = __Pyx_Coroutine_CloseIter(gen, yf);
- __Pyx_Coroutine_Undelegate(gen);
- Py_DECREF(yf);
- }
- if (err == 0)
- PyErr_SetNone(PyExc_GeneratorExit);
- retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
- if (unlikely(retval)) {
- const char *msg;
- Py_DECREF(retval);
- if ((0)) {
- #ifdef __Pyx_Coroutine_USED
- } else if (__Pyx_Coroutine_Check(self)) {
- msg = "coroutine ignored GeneratorExit";
- #endif
- #ifdef __Pyx_AsyncGen_USED
- } else if (__Pyx_AsyncGen_CheckExact(self)) {
-#if PY_VERSION_HEX < 0x03060000
- msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
-#else
- msg = "async generator ignored GeneratorExit";
-#endif
- #endif
- } else {
- msg = "generator ignored GeneratorExit";
- }
- PyErr_SetString(PyExc_RuntimeError, msg);
- return NULL;
- }
- raised_exception = PyErr_Occurred();
- if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
- if (raised_exception) PyErr_Clear();
- Py_INCREF(Py_None);
- return Py_None;
- }
- return NULL;
-}
-static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
- PyObject *args, int close_on_genexit) {
- __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
- PyObject *yf = gen->yieldfrom;
- if (unlikely(gen->is_running))
- return __Pyx_Coroutine_AlreadyRunningError(gen);
- if (yf) {
- PyObject *ret;
- Py_INCREF(yf);
- if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
- int err = __Pyx_Coroutine_CloseIter(gen, yf);
- Py_DECREF(yf);
- __Pyx_Coroutine_Undelegate(gen);
- if (err < 0)
- return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
- goto throw_here;
- }
- gen->is_running = 1;
- if (0
- #ifdef __Pyx_Generator_USED
- || __Pyx_Generator_CheckExact(yf)
- #endif
- #ifdef __Pyx_Coroutine_USED
- || __Pyx_Coroutine_Check(yf)
- #endif
- ) {
- ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
- #ifdef __Pyx_Coroutine_USED
- } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
- ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
- #endif
- } else {
- PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
- if (unlikely(!meth)) {
- Py_DECREF(yf);
- if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
- gen->is_running = 0;
- return NULL;
- }
- PyErr_Clear();
- __Pyx_Coroutine_Undelegate(gen);
- gen->is_running = 0;
- goto throw_here;
- }
- if (likely(args)) {
- ret = PyObject_CallObject(meth, args);
- } else {
- ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
- }
- Py_DECREF(meth);
- }
- gen->is_running = 0;
- Py_DECREF(yf);
- if (!ret) {
- ret = __Pyx_Coroutine_FinishDelegation(gen);
- }
- return __Pyx_Coroutine_MethodReturn(self, ret);
- }
-throw_here:
- __Pyx_Raise(typ, val, tb, NULL);
- return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
-}
-static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
- PyObject *typ;
- PyObject *val = NULL;
- PyObject *tb = NULL;
- if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
- return NULL;
- return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
-}
-static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
- Py_VISIT(exc_state->exc_type);
- Py_VISIT(exc_state->exc_value);
- Py_VISIT(exc_state->exc_traceback);
- return 0;
-}
-static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
- Py_VISIT(gen->closure);
- Py_VISIT(gen->classobj);
- Py_VISIT(gen->yieldfrom);
- return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
-}
-static int __Pyx_Coroutine_clear(PyObject *self) {
- __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
- Py_CLEAR(gen->closure);
- Py_CLEAR(gen->classobj);
- Py_CLEAR(gen->yieldfrom);
- __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
-#ifdef __Pyx_AsyncGen_USED
- if (__Pyx_AsyncGen_CheckExact(self)) {
- Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
- }
-#endif
- Py_CLEAR(gen->gi_code);
- Py_CLEAR(gen->gi_frame);
- Py_CLEAR(gen->gi_name);
- Py_CLEAR(gen->gi_qualname);
- Py_CLEAR(gen->gi_modulename);
- return 0;
-}
-static void __Pyx_Coroutine_dealloc(PyObject *self) {
- __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
- PyObject_GC_UnTrack(gen);
- if (gen->gi_weakreflist != NULL)
- PyObject_ClearWeakRefs(self);
- if (gen->resume_label >= 0) {
- PyObject_GC_Track(self);
-#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
- if (PyObject_CallFinalizerFromDealloc(self))
-#else
- Py_TYPE(gen)->tp_del(self);
- if (Py_REFCNT(self) > 0)
-#endif
- {
- return;
- }
- PyObject_GC_UnTrack(self);
- }
-#ifdef __Pyx_AsyncGen_USED
- if (__Pyx_AsyncGen_CheckExact(self)) {
- /* We have to handle this case for asynchronous generators
- right here, because this code has to be between UNTRACK
- and GC_Del. */
- Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
- }
-#endif
- __Pyx_Coroutine_clear(self);
- PyObject_GC_Del(gen);
-}
-static void __Pyx_Coroutine_del(PyObject *self) {
- PyObject *error_type, *error_value, *error_traceback;
- __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
- __Pyx_PyThreadState_declare
- if (gen->resume_label < 0) {
- return;
- }
-#if !CYTHON_USE_TP_FINALIZE
- assert(self->ob_refcnt == 0);
- __Pyx_SET_REFCNT(self, 1);
-#endif
- __Pyx_PyThreadState_assign
- __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
-#ifdef __Pyx_AsyncGen_USED
- if (__Pyx_AsyncGen_CheckExact(self)) {
- __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
- PyObject *finalizer = agen->ag_finalizer;
- if (finalizer && !agen->ag_closed) {
- PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
- if (unlikely(!res)) {
- PyErr_WriteUnraisable(self);
- } else {
- Py_DECREF(res);
- }
- __Pyx_ErrRestore(error_type, error_value, error_traceback);
- return;
- }
- }
-#endif
- if (unlikely(gen->resume_label == 0 && !error_value)) {
-#ifdef __Pyx_Coroutine_USED
-#ifdef __Pyx_Generator_USED
- if (!__Pyx_Generator_CheckExact(self))
-#endif
- {
- PyObject_GC_UnTrack(self);
-#if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat)
- if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
- PyErr_WriteUnraisable(self);
-#else
- {PyObject *msg;
- char *cmsg;
- #if CYTHON_COMPILING_IN_PYPY
- msg = NULL;
- cmsg = (char*) "coroutine was never awaited";
- #else
- char *cname;
- PyObject *qualname;
- qualname = gen->gi_qualname;
- cname = PyString_AS_STRING(qualname);
- msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
- if (unlikely(!msg)) {
- PyErr_Clear();
- cmsg = (char*) "coroutine was never awaited";
- } else {
- cmsg = PyString_AS_STRING(msg);
- }
- #endif
- if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
- PyErr_WriteUnraisable(self);
- Py_XDECREF(msg);}
-#endif
- PyObject_GC_Track(self);
- }
-#endif
- } else {
- PyObject *res = __Pyx_Coroutine_Close(self);
- if (unlikely(!res)) {
- if (PyErr_Occurred())
- PyErr_WriteUnraisable(self);
- } else {
- Py_DECREF(res);
- }
- }
- __Pyx_ErrRestore(error_type, error_value, error_traceback);
-#if !CYTHON_USE_TP_FINALIZE
- assert(Py_REFCNT(self) > 0);
- if (--self->ob_refcnt == 0) {
- return;
- }
- {
- Py_ssize_t refcnt = Py_REFCNT(self);
- _Py_NewReference(self);
- __Pyx_SET_REFCNT(self, refcnt);
- }
-#if CYTHON_COMPILING_IN_CPYTHON
- assert(PyType_IS_GC(Py_TYPE(self)) &&
- _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
- _Py_DEC_REFTOTAL;
-#endif
-#ifdef COUNT_ALLOCS
- --Py_TYPE(self)->tp_frees;
- --Py_TYPE(self)->tp_allocs;
-#endif
-#endif
-}
-static PyObject *
-__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
-{
- PyObject *name = self->gi_name;
- if (unlikely(!name)) name = Py_None;
- Py_INCREF(name);
- return name;
-}
-static int
-__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
-{
- PyObject *tmp;
-#if PY_MAJOR_VERSION >= 3
- if (unlikely(value == NULL || !PyUnicode_Check(value)))
-#else
- if (unlikely(value == NULL || !PyString_Check(value)))
-#endif
- {
- PyErr_SetString(PyExc_TypeError,
- "__name__ must be set to a string object");
- return -1;
- }
- tmp = self->gi_name;
- Py_INCREF(value);
- self->gi_name = value;
- Py_XDECREF(tmp);
- return 0;
-}
-static PyObject *
-__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
-{
- PyObject *name = self->gi_qualname;
- if (unlikely(!name)) name = Py_None;
- Py_INCREF(name);
- return name;
-}
-static int
-__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
-{
- PyObject *tmp;
-#if PY_MAJOR_VERSION >= 3
- if (unlikely(value == NULL || !PyUnicode_Check(value)))
-#else
- if (unlikely(value == NULL || !PyString_Check(value)))
-#endif
- {
- PyErr_SetString(PyExc_TypeError,
- "__qualname__ must be set to a string object");
- return -1;
- }
- tmp = self->gi_qualname;
- Py_INCREF(value);
- self->gi_qualname = value;
- Py_XDECREF(tmp);
- return 0;
-}
-static PyObject *
-__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
-{
- PyObject *frame = self->gi_frame;
- if (!frame) {
- if (unlikely(!self->gi_code)) {
- Py_RETURN_NONE;
- }
- frame = (PyObject *) PyFrame_New(
- PyThreadState_Get(), /*PyThreadState *tstate,*/
- (PyCodeObject*) self->gi_code, /*PyCodeObject *code,*/
- __pyx_d, /*PyObject *globals,*/
- 0 /*PyObject *locals*/
- );
- if (unlikely(!frame))
- return NULL;
- self->gi_frame = frame;
- }
- Py_INCREF(frame);
- return frame;
-}
-static __pyx_CoroutineObject *__Pyx__Coroutine_New(
- PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
- PyObject *name, PyObject *qualname, PyObject *module_name) {
- __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
- if (unlikely(!gen))
- return NULL;
- return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
-}
-static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
- __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
- PyObject *name, PyObject *qualname, PyObject *module_name) {
- gen->body = body;
- gen->closure = closure;
- Py_XINCREF(closure);
- gen->is_running = 0;
- gen->resume_label = 0;
- gen->classobj = NULL;
- gen->yieldfrom = NULL;
- gen->gi_exc_state.exc_type = NULL;
- gen->gi_exc_state.exc_value = NULL;
- gen->gi_exc_state.exc_traceback = NULL;
-#if CYTHON_USE_EXC_INFO_STACK
- gen->gi_exc_state.previous_item = NULL;
-#endif
- gen->gi_weakreflist = NULL;
- Py_XINCREF(qualname);
- gen->gi_qualname = qualname;
- Py_XINCREF(name);
- gen->gi_name = name;
- Py_XINCREF(module_name);
- gen->gi_modulename = module_name;
- Py_XINCREF(code);
- gen->gi_code = code;
- gen->gi_frame = NULL;
- PyObject_GC_Track(gen);
- return gen;
-}
-
-/* PatchModuleWithCoroutine */
-static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
-#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
- int result;
- PyObject *globals, *result_obj;
- globals = PyDict_New(); if (unlikely(!globals)) goto ignore;
- result = PyDict_SetItemString(globals, "_cython_coroutine_type",
- #ifdef __Pyx_Coroutine_USED
- (PyObject*)__pyx_CoroutineType);
- #else
- Py_None);
- #endif
- if (unlikely(result < 0)) goto ignore;
- result = PyDict_SetItemString(globals, "_cython_generator_type",
- #ifdef __Pyx_Generator_USED
- (PyObject*)__pyx_GeneratorType);
- #else
- Py_None);
- #endif
- if (unlikely(result < 0)) goto ignore;
- if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
- if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
- result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
- if (unlikely(!result_obj)) goto ignore;
- Py_DECREF(result_obj);
- Py_DECREF(globals);
- return module;
-ignore:
- Py_XDECREF(globals);
- PyErr_WriteUnraisable(module);
- if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
- Py_DECREF(module);
- module = NULL;
- }
-#else
- py_code++;
-#endif
- return module;
-}
-
-/* PatchGeneratorABC */
-#ifndef CYTHON_REGISTER_ABCS
-#define CYTHON_REGISTER_ABCS 1
-#endif
-#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
-static PyObject* __Pyx_patch_abc_module(PyObject *module);
-static PyObject* __Pyx_patch_abc_module(PyObject *module) {
- module = __Pyx_Coroutine_patch_module(
- module, ""
-"if _cython_generator_type is not None:\n"
-" try: Generator = _module.Generator\n"
-" except AttributeError: pass\n"
-" else: Generator.register(_cython_generator_type)\n"
-"if _cython_coroutine_type is not None:\n"
-" try: Coroutine = _module.Coroutine\n"
-" except AttributeError: pass\n"
-" else: Coroutine.register(_cython_coroutine_type)\n"
- );
- return module;
-}
-#endif
-static int __Pyx_patch_abc(void) {
-#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
- static int abc_patched = 0;
- if (CYTHON_REGISTER_ABCS && !abc_patched) {
- PyObject *module;
- module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
- if (!module) {
- PyErr_WriteUnraisable(NULL);
- if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
- ((PY_MAJOR_VERSION >= 3) ?
- "Cython module failed to register with collections.abc module" :
- "Cython module failed to register with collections module"), 1) < 0)) {
- return -1;
- }
- } else {
- module = __Pyx_patch_abc_module(module);
- abc_patched = 1;
- if (unlikely(!module))
- return -1;
- Py_DECREF(module);
- }
- module = PyImport_ImportModule("backports_abc");
- if (module) {
- module = __Pyx_patch_abc_module(module);
- Py_XDECREF(module);
- }
- if (!module) {
- PyErr_Clear();
- }
- }
-#else
- if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
-#endif
- return 0;
-}
-
-/* Generator */
-static PyMethodDef __pyx_Generator_methods[] = {
- {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
- (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
- {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
- (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
- {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
- (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
- {0, 0, 0, 0}
-};
-static PyMemberDef __pyx_Generator_memberlist[] = {
- {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
- {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
- (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
- {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
- {0, 0, 0, 0, 0}
-};
-static PyGetSetDef __pyx_Generator_getsets[] = {
- {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
- (char*) PyDoc_STR("name of the generator"), 0},
- {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
- (char*) PyDoc_STR("qualified name of the generator"), 0},
- {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
- (char*) PyDoc_STR("Frame of the generator"), 0},
- {0, 0, 0, 0, 0}
-};
-static PyTypeObject __pyx_GeneratorType_type = {
- PyVarObject_HEAD_INIT(0, 0)
- "generator",
- sizeof(__pyx_CoroutineObject),
- 0,
- (destructor) __Pyx_Coroutine_dealloc,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
- 0,
- (traverseproc) __Pyx_Coroutine_traverse,
- 0,
- 0,
- offsetof(__pyx_CoroutineObject, gi_weakreflist),
- 0,
- (iternextfunc) __Pyx_Generator_Next,
- __pyx_Generator_methods,
- __pyx_Generator_memberlist,
- __pyx_Generator_getsets,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
-#if CYTHON_USE_TP_FINALIZE
- 0,
-#else
- __Pyx_Coroutine_del,
-#endif
- 0,
-#if CYTHON_USE_TP_FINALIZE
- __Pyx_Coroutine_del,
-#elif PY_VERSION_HEX >= 0x030400a1
- 0,
-#endif
-#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
- 0,
-#endif
-#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
- 0,
-#endif
-#if PY_VERSION_HEX >= 0x030C0000
- 0,
-#endif
-#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
- 0,
-#endif
-};
-static int __pyx_Generator_init(void) {
- __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
- __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
- __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
- if (unlikely(!__pyx_GeneratorType)) {
- return -1;
- }
- return 0;
-}
-
-/* CheckBinaryVersion */
-static int __Pyx_check_binary_version(void) {
- char ctversion[5];
- int same=1, i, found_dot;
- const char* rt_from_call = Py_GetVersion();
- PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
- found_dot = 0;
- for (i = 0; i < 4; i++) {
- if (!ctversion[i]) {
- same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
- break;
- }
- if (rt_from_call[i] != ctversion[i]) {
- same = 0;
- break;
- }
- }
- if (!same) {
- char rtversion[5] = {'\0'};
- char message[200];
- for (i=0; i<4; ++i) {
- if (rt_from_call[i] == '.') {
- if (found_dot) break;
- found_dot = 1;
- } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
- break;
- }
- rtversion[i] = rt_from_call[i];
- }
- PyOS_snprintf(message, sizeof(message),
- "compiletime version %s of module '%.100s' "
- "does not match runtime version %s",
- ctversion, __Pyx_MODULE_NAME, rtversion);
- return PyErr_WarnEx(NULL, message, 1);
- }
- return 0;
-}
-
-/* InitStrings */
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
- while (t->p) {
- #if PY_MAJOR_VERSION < 3
- if (t->is_unicode) {
- *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
- } else if (t->intern) {
- *t->p = PyString_InternFromString(t->s);
- } else {
- *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
- }
- #else
- if (t->is_unicode | t->is_str) {
- if (t->intern) {
- *t->p = PyUnicode_InternFromString(t->s);
- } else if (t->encoding) {
- *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
- } else {
- *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
- }
- } else {
- *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
- }
- #endif
- if (!*t->p)
- return -1;
- if (PyObject_Hash(*t->p) == -1)
- return -1;
- ++t;
- }
- return 0;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
- return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
-}
-static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
- Py_ssize_t ignore;
- return __Pyx_PyObject_AsStringAndSize(o, &ignore);
-}
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
-#if !CYTHON_PEP393_ENABLED
-static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
- char* defenc_c;
- PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
- if (!defenc) return NULL;
- defenc_c = PyBytes_AS_STRING(defenc);
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
- {
- char* end = defenc_c + PyBytes_GET_SIZE(defenc);
- char* c;
- for (c = defenc_c; c < end; c++) {
- if ((unsigned char) (*c) >= 128) {
- PyUnicode_AsASCIIString(o);
- return NULL;
- }
- }
- }
-#endif
- *length = PyBytes_GET_SIZE(defenc);
- return defenc_c;
-}
-#else
-static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
- if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
- if (likely(PyUnicode_IS_ASCII(o))) {
- *length = PyUnicode_GET_LENGTH(o);
- return PyUnicode_AsUTF8(o);
- } else {
- PyUnicode_AsASCIIString(o);
- return NULL;
- }
-#else
- return PyUnicode_AsUTF8AndSize(o, length);
-#endif
-}
-#endif
-#endif
-static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
- if (
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
- __Pyx_sys_getdefaultencoding_not_ascii &&
-#endif
- PyUnicode_Check(o)) {
- return __Pyx_PyUnicode_AsStringAndSize(o, length);
- } else
-#endif
-#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
- if (PyByteArray_Check(o)) {
- *length = PyByteArray_GET_SIZE(o);
- return PyByteArray_AS_STRING(o);
- } else
-#endif
- {
- char* result;
- int r = PyBytes_AsStringAndSize(o, &result, length);
- if (unlikely(r < 0)) {
- return NULL;
- } else {
- return result;
- }
- }
-}
-static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
- int is_true = x == Py_True;
- if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
- else return PyObject_IsTrue(x);
-}
-static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
- int retval;
- if (unlikely(!x)) return -1;
- retval = __Pyx_PyObject_IsTrue(x);
- Py_DECREF(x);
- return retval;
-}
-static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
-#if PY_MAJOR_VERSION >= 3
- if (PyLong_Check(result)) {
- if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
- "__int__ returned non-int (type %.200s). "
- "The ability to return an instance of a strict subclass of int "
- "is deprecated, and may be removed in a future version of Python.",
- Py_TYPE(result)->tp_name)) {
- Py_DECREF(result);
- return NULL;
- }
- return result;
- }
-#endif
- PyErr_Format(PyExc_TypeError,
- "__%.4s__ returned non-%.4s (type %.200s)",
- type_name, type_name, Py_TYPE(result)->tp_name);
- Py_DECREF(result);
- return NULL;
-}
-static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
-#if CYTHON_USE_TYPE_SLOTS
- PyNumberMethods *m;
-#endif
- const char *name = NULL;
- PyObject *res = NULL;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x) || PyLong_Check(x)))
-#else
- if (likely(PyLong_Check(x)))
-#endif
- return __Pyx_NewRef(x);
-#if CYTHON_USE_TYPE_SLOTS
- m = Py_TYPE(x)->tp_as_number;
- #if PY_MAJOR_VERSION < 3
- if (m && m->nb_int) {
- name = "int";
- res = m->nb_int(x);
- }
- else if (m && m->nb_long) {
- name = "long";
- res = m->nb_long(x);
- }
- #else
- if (likely(m && m->nb_int)) {
- name = "int";
- res = m->nb_int(x);
- }
- #endif
-#else
- if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
- res = PyNumber_Int(x);
- }
-#endif
- if (likely(res)) {
-#if PY_MAJOR_VERSION < 3
- if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
-#else
- if (unlikely(!PyLong_CheckExact(res))) {
-#endif
- return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
- }
- }
- else if (!PyErr_Occurred()) {
- PyErr_SetString(PyExc_TypeError,
- "an integer is required");
- }
- return res;
-}
-static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
- Py_ssize_t ival;
- PyObject *x;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_CheckExact(b))) {
- if (sizeof(Py_ssize_t) >= sizeof(long))
- return PyInt_AS_LONG(b);
- else
- return PyInt_AsSsize_t(b);
- }
-#endif
- if (likely(PyLong_CheckExact(b))) {
- #if CYTHON_USE_PYLONG_INTERNALS
- const digit* digits = ((PyLongObject*)b)->ob_digit;
- const Py_ssize_t size = Py_SIZE(b);
- if (likely(__Pyx_sst_abs(size) <= 1)) {
- ival = likely(size) ? digits[0] : 0;
- if (size == -1) ival = -ival;
- return ival;
- } else {
- switch (size) {
- case 2:
- if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
- return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
- }
- break;
- case -2:
- if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
- return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
- }
- break;
- case 3:
- if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
- return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
- }
- break;
- case -3:
- if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
- return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
- }
- break;
- case 4:
- if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
- return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
- }
- break;
- case -4:
- if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
- return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
- }
- break;
- }
- }
- #endif
- return PyLong_AsSsize_t(b);
- }
- x = PyNumber_Index(b);
- if (!x) return -1;
- ival = PyInt_AsSsize_t(x);
- Py_DECREF(x);
- return ival;
-}
-static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
- if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
- return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
-#if PY_MAJOR_VERSION < 3
- } else if (likely(PyInt_CheckExact(o))) {
- return PyInt_AS_LONG(o);
-#endif
- } else {
- Py_ssize_t ival;
- PyObject *x;
- x = PyNumber_Index(o);
- if (!x) return -1;
- ival = PyInt_AsLong(x);
- Py_DECREF(x);
- return ival;
- }
-}
-static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
- return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
-}
-static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
- return PyInt_FromSize_t(ival);
-}
-
-
-#endif /* Py_PYTHON_H */
diff --git a/spaces/DaFujaTyping/hf-Chat-ui/src/app.d.ts b/spaces/DaFujaTyping/hf-Chat-ui/src/app.d.ts
deleted file mode 100644
index 9c7e7159ba700cc7d04a098e5f268665dbd9cc2c..0000000000000000000000000000000000000000
--- a/spaces/DaFujaTyping/hf-Chat-ui/src/app.d.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-///
-///
-
-// See https://kit.svelte.dev/docs/types#app
-// for information about these interfaces
-declare global {
- namespace App {
- // interface Error {}
- interface Locals {
- sessionId: string;
- }
- // interface PageData {}
- // interface Platform {}
- }
-}
-
-export {};
diff --git a/spaces/Dennis0402/QSign/Dockerfile b/spaces/Dennis0402/QSign/Dockerfile
deleted file mode 100644
index 197343d759e41dd113b8ae94765f408a3f789f0c..0000000000000000000000000000000000000000
--- a/spaces/Dennis0402/QSign/Dockerfile
+++ /dev/null
@@ -1,15 +0,0 @@
-#程序开源地址 https://github.com/fuqiuluo/unidbg-fetch-qsign
-
-FROM openjdk:11.0-jdk
-
-ENV TZ Asia/Shanghai
-
-WORKDIR /app
-
-COPY unidbg-fetch-qsign /app
-
-CMD bash bin/unidbg-fetch-qsign --host=0.0.0.0 --port=7860 --count=5 --library=txlib --android_id=
-
-EXPOSE 7860
-
-#抱脸推荐项目 https://github.com/CikeyQi/QQsign_docs
\ No newline at end of file
diff --git a/spaces/DragGan/DragGan/torch_utils/ops/upfirdn2d.cpp b/spaces/DragGan/DragGan/torch_utils/ops/upfirdn2d.cpp
deleted file mode 100644
index 44fa337d8d4c34dfa010a59cd27d86857db671aa..0000000000000000000000000000000000000000
--- a/spaces/DragGan/DragGan/torch_utils/ops/upfirdn2d.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-// Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
-//
-// NVIDIA CORPORATION and its licensors retain all intellectual property
-// and proprietary rights in and to this software, related documentation
-// and any modifications thereto. Any use, reproduction, disclosure or
-// distribution of this software and related documentation without an express
-// license agreement from NVIDIA CORPORATION is strictly prohibited.
-
-#include
-#include
-#include
-#include "upfirdn2d.h"
-
-//------------------------------------------------------------------------
-
-static torch::Tensor upfirdn2d(torch::Tensor x, torch::Tensor f, int upx, int upy, int downx, int downy, int padx0, int padx1, int pady0, int pady1, bool flip, float gain)
-{
- // Validate arguments.
- TORCH_CHECK(x.is_cuda(), "x must reside on CUDA device");
- TORCH_CHECK(f.device() == x.device(), "f must reside on the same device as x");
- TORCH_CHECK(f.dtype() == torch::kFloat, "f must be float32");
- TORCH_CHECK(x.numel() <= INT_MAX, "x is too large");
- TORCH_CHECK(f.numel() <= INT_MAX, "f is too large");
- TORCH_CHECK(x.numel() > 0, "x has zero size");
- TORCH_CHECK(f.numel() > 0, "f has zero size");
- TORCH_CHECK(x.dim() == 4, "x must be rank 4");
- TORCH_CHECK(f.dim() == 2, "f must be rank 2");
- TORCH_CHECK((x.size(0)-1)*x.stride(0) + (x.size(1)-1)*x.stride(1) + (x.size(2)-1)*x.stride(2) + (x.size(3)-1)*x.stride(3) <= INT_MAX, "x memory footprint is too large");
- TORCH_CHECK(f.size(0) >= 1 && f.size(1) >= 1, "f must be at least 1x1");
- TORCH_CHECK(upx >= 1 && upy >= 1, "upsampling factor must be at least 1");
- TORCH_CHECK(downx >= 1 && downy >= 1, "downsampling factor must be at least 1");
-
- // Create output tensor.
- const at::cuda::OptionalCUDAGuard device_guard(device_of(x));
- int outW = ((int)x.size(3) * upx + padx0 + padx1 - (int)f.size(1) + downx) / downx;
- int outH = ((int)x.size(2) * upy + pady0 + pady1 - (int)f.size(0) + downy) / downy;
- TORCH_CHECK(outW >= 1 && outH >= 1, "output must be at least 1x1");
- torch::Tensor y = torch::empty({x.size(0), x.size(1), outH, outW}, x.options(), x.suggest_memory_format());
- TORCH_CHECK(y.numel() <= INT_MAX, "output is too large");
- TORCH_CHECK((y.size(0)-1)*y.stride(0) + (y.size(1)-1)*y.stride(1) + (y.size(2)-1)*y.stride(2) + (y.size(3)-1)*y.stride(3) <= INT_MAX, "output memory footprint is too large");
-
- // Initialize CUDA kernel parameters.
- upfirdn2d_kernel_params p;
- p.x = x.data_ptr();
- p.f = f.data_ptr();
- p.y = y.data_ptr();
- p.up = make_int2(upx, upy);
- p.down = make_int2(downx, downy);
- p.pad0 = make_int2(padx0, pady0);
- p.flip = (flip) ? 1 : 0;
- p.gain = gain;
- p.inSize = make_int4((int)x.size(3), (int)x.size(2), (int)x.size(1), (int)x.size(0));
- p.inStride = make_int4((int)x.stride(3), (int)x.stride(2), (int)x.stride(1), (int)x.stride(0));
- p.filterSize = make_int2((int)f.size(1), (int)f.size(0));
- p.filterStride = make_int2((int)f.stride(1), (int)f.stride(0));
- p.outSize = make_int4((int)y.size(3), (int)y.size(2), (int)y.size(1), (int)y.size(0));
- p.outStride = make_int4((int)y.stride(3), (int)y.stride(2), (int)y.stride(1), (int)y.stride(0));
- p.sizeMajor = (p.inStride.z == 1) ? p.inSize.w : p.inSize.w * p.inSize.z;
- p.sizeMinor = (p.inStride.z == 1) ? p.inSize.z : 1;
-
- // Choose CUDA kernel.
- upfirdn2d_kernel_spec spec;
- AT_DISPATCH_FLOATING_TYPES_AND_HALF(x.scalar_type(), "upfirdn2d_cuda", [&]
- {
- spec = choose_upfirdn2d_kernel(p);
- });
-
- // Set looping options.
- p.loopMajor = (p.sizeMajor - 1) / 16384 + 1;
- p.loopMinor = spec.loopMinor;
- p.loopX = spec.loopX;
- p.launchMinor = (p.sizeMinor - 1) / p.loopMinor + 1;
- p.launchMajor = (p.sizeMajor - 1) / p.loopMajor + 1;
-
- // Compute grid size.
- dim3 blockSize, gridSize;
- if (spec.tileOutW < 0) // large
- {
- blockSize = dim3(4, 32, 1);
- gridSize = dim3(
- ((p.outSize.y - 1) / blockSize.x + 1) * p.launchMinor,
- (p.outSize.x - 1) / (blockSize.y * p.loopX) + 1,
- p.launchMajor);
- }
- else // small
- {
- blockSize = dim3(256, 1, 1);
- gridSize = dim3(
- ((p.outSize.y - 1) / spec.tileOutH + 1) * p.launchMinor,
- (p.outSize.x - 1) / (spec.tileOutW * p.loopX) + 1,
- p.launchMajor);
- }
-
- // Launch CUDA kernel.
- void* args[] = {&p};
- AT_CUDA_CHECK(cudaLaunchKernel(spec.kernel, gridSize, blockSize, args, 0, at::cuda::getCurrentCUDAStream()));
- return y;
-}
-
-//------------------------------------------------------------------------
-
-PYBIND11_MODULE(TORCH_EXTENSION_NAME, m)
-{
- m.def("upfirdn2d", &upfirdn2d);
-}
-
-//------------------------------------------------------------------------
diff --git a/spaces/ECCV2022/bytetrack/yolox/exp/build.py b/spaces/ECCV2022/bytetrack/yolox/exp/build.py
deleted file mode 100644
index 411b09cdc6b65dd4f9e4bcec1a54dc00bdfe347b..0000000000000000000000000000000000000000
--- a/spaces/ECCV2022/bytetrack/yolox/exp/build.py
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding:utf-8 -*-
-# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
-
-import importlib
-import os
-import sys
-
-
-def get_exp_by_file(exp_file):
- try:
- sys.path.append(os.path.dirname(exp_file))
- current_exp = importlib.import_module(os.path.basename(exp_file).split(".")[0])
- exp = current_exp.Exp()
- except Exception:
- raise ImportError("{} doesn't contains class named 'Exp'".format(exp_file))
- return exp
-
-
-def get_exp_by_name(exp_name):
- import yolox
-
- yolox_path = os.path.dirname(os.path.dirname(yolox.__file__))
- filedict = {
- "yolox-s": "yolox_s.py",
- "yolox-m": "yolox_m.py",
- "yolox-l": "yolox_l.py",
- "yolox-x": "yolox_x.py",
- "yolox-tiny": "yolox_tiny.py",
- "yolox-nano": "nano.py",
- "yolov3": "yolov3.py",
- }
- filename = filedict[exp_name]
- exp_path = os.path.join(yolox_path, "exps", "default", filename)
- return get_exp_by_file(exp_path)
-
-
-def get_exp(exp_file, exp_name):
- """
- get Exp object by file or name. If exp_file and exp_name
- are both provided, get Exp by exp_file.
-
- Args:
- exp_file (str): file path of experiment.
- exp_name (str): name of experiment. "yolo-s",
- """
- assert (
- exp_file is not None or exp_name is not None
- ), "plz provide exp file or exp name."
- if exp_file is not None:
- return get_exp_by_file(exp_file)
- else:
- return get_exp_by_name(exp_name)
diff --git a/spaces/EPFL-VILAB/MultiMAE/dpt/transforms.py b/spaces/EPFL-VILAB/MultiMAE/dpt/transforms.py
deleted file mode 100644
index 399adbcdad096ae3fb8a190ecd3ec5483a897251..0000000000000000000000000000000000000000
--- a/spaces/EPFL-VILAB/MultiMAE/dpt/transforms.py
+++ /dev/null
@@ -1,231 +0,0 @@
-import numpy as np
-import cv2
-import math
-
-
-def apply_min_size(sample, size, image_interpolation_method=cv2.INTER_AREA):
- """Rezise the sample to ensure the given size. Keeps aspect ratio.
-
- Args:
- sample (dict): sample
- size (tuple): image size
-
- Returns:
- tuple: new size
- """
- shape = list(sample["disparity"].shape)
-
- if shape[0] >= size[0] and shape[1] >= size[1]:
- return sample
-
- scale = [0, 0]
- scale[0] = size[0] / shape[0]
- scale[1] = size[1] / shape[1]
-
- scale = max(scale)
-
- shape[0] = math.ceil(scale * shape[0])
- shape[1] = math.ceil(scale * shape[1])
-
- # resize
- sample["image"] = cv2.resize(
- sample["image"], tuple(shape[::-1]), interpolation=image_interpolation_method
- )
-
- sample["disparity"] = cv2.resize(
- sample["disparity"], tuple(shape[::-1]), interpolation=cv2.INTER_NEAREST
- )
- sample["mask"] = cv2.resize(
- sample["mask"].astype(np.float32),
- tuple(shape[::-1]),
- interpolation=cv2.INTER_NEAREST,
- )
- sample["mask"] = sample["mask"].astype(bool)
-
- return tuple(shape)
-
-
-class Resize(object):
- """Resize sample to given size (width, height)."""
-
- def __init__(
- self,
- width,
- height,
- resize_target=True,
- keep_aspect_ratio=False,
- ensure_multiple_of=1,
- resize_method="lower_bound",
- image_interpolation_method=cv2.INTER_AREA,
- ):
- """Init.
-
- Args:
- width (int): desired output width
- height (int): desired output height
- resize_target (bool, optional):
- True: Resize the full sample (image, mask, target).
- False: Resize image only.
- Defaults to True.
- keep_aspect_ratio (bool, optional):
- True: Keep the aspect ratio of the input sample.
- Output sample might not have the given width and height, and
- resize behaviour depends on the parameter 'resize_method'.
- Defaults to False.
- ensure_multiple_of (int, optional):
- Output width and height is constrained to be multiple of this parameter.
- Defaults to 1.
- resize_method (str, optional):
- "lower_bound": Output will be at least as large as the given size.
- "upper_bound": Output will be at max as large as the given size. (Output size might be smaller than given size.)
- "minimal": Scale as least as possible. (Output size might be smaller than given size.)
- Defaults to "lower_bound".
- """
- self.__width = width
- self.__height = height
-
- self.__resize_target = resize_target
- self.__keep_aspect_ratio = keep_aspect_ratio
- self.__multiple_of = ensure_multiple_of
- self.__resize_method = resize_method
- self.__image_interpolation_method = image_interpolation_method
-
- def constrain_to_multiple_of(self, x, min_val=0, max_val=None):
- y = (np.round(x / self.__multiple_of) * self.__multiple_of).astype(int)
-
- if max_val is not None and y > max_val:
- y = (np.floor(x / self.__multiple_of) * self.__multiple_of).astype(int)
-
- if y < min_val:
- y = (np.ceil(x / self.__multiple_of) * self.__multiple_of).astype(int)
-
- return y
-
- def get_size(self, width, height):
- # determine new height and width
- scale_height = self.__height / height
- scale_width = self.__width / width
-
- if self.__keep_aspect_ratio:
- if self.__resize_method == "lower_bound":
- # scale such that output size is lower bound
- if scale_width > scale_height:
- # fit width
- scale_height = scale_width
- else:
- # fit height
- scale_width = scale_height
- elif self.__resize_method == "upper_bound":
- # scale such that output size is upper bound
- if scale_width < scale_height:
- # fit width
- scale_height = scale_width
- else:
- # fit height
- scale_width = scale_height
- elif self.__resize_method == "minimal":
- # scale as least as possbile
- if abs(1 - scale_width) < abs(1 - scale_height):
- # fit width
- scale_height = scale_width
- else:
- # fit height
- scale_width = scale_height
- else:
- raise ValueError(
- f"resize_method {self.__resize_method} not implemented"
- )
-
- if self.__resize_method == "lower_bound":
- new_height = self.constrain_to_multiple_of(
- scale_height * height, min_val=self.__height
- )
- new_width = self.constrain_to_multiple_of(
- scale_width * width, min_val=self.__width
- )
- elif self.__resize_method == "upper_bound":
- new_height = self.constrain_to_multiple_of(
- scale_height * height, max_val=self.__height
- )
- new_width = self.constrain_to_multiple_of(
- scale_width * width, max_val=self.__width
- )
- elif self.__resize_method == "minimal":
- new_height = self.constrain_to_multiple_of(scale_height * height)
- new_width = self.constrain_to_multiple_of(scale_width * width)
- else:
- raise ValueError(f"resize_method {self.__resize_method} not implemented")
-
- return (new_width, new_height)
-
- def __call__(self, sample):
- width, height = self.get_size(
- sample["image"].shape[1], sample["image"].shape[0]
- )
-
- # resize sample
- sample["image"] = cv2.resize(
- sample["image"],
- (width, height),
- interpolation=self.__image_interpolation_method,
- )
-
- if self.__resize_target:
- if "disparity" in sample:
- sample["disparity"] = cv2.resize(
- sample["disparity"],
- (width, height),
- interpolation=cv2.INTER_NEAREST,
- )
-
- if "depth" in sample:
- sample["depth"] = cv2.resize(
- sample["depth"], (width, height), interpolation=cv2.INTER_NEAREST
- )
-
- sample["mask"] = cv2.resize(
- sample["mask"].astype(np.float32),
- (width, height),
- interpolation=cv2.INTER_NEAREST,
- )
- sample["mask"] = sample["mask"].astype(bool)
-
- return sample
-
-
-class NormalizeImage(object):
- """Normlize image by given mean and std."""
-
- def __init__(self, mean, std):
- self.__mean = mean
- self.__std = std
-
- def __call__(self, sample):
- sample["image"] = (sample["image"] - self.__mean) / self.__std
-
- return sample
-
-
-class PrepareForNet(object):
- """Prepare sample for usage as network input."""
-
- def __init__(self):
- pass
-
- def __call__(self, sample):
- image = np.transpose(sample["image"], (2, 0, 1))
- sample["image"] = np.ascontiguousarray(image).astype(np.float32)
-
- if "mask" in sample:
- sample["mask"] = sample["mask"].astype(np.float32)
- sample["mask"] = np.ascontiguousarray(sample["mask"])
-
- if "disparity" in sample:
- disparity = sample["disparity"].astype(np.float32)
- sample["disparity"] = np.ascontiguousarray(disparity)
-
- if "depth" in sample:
- depth = sample["depth"].astype(np.float32)
- sample["depth"] = np.ascontiguousarray(depth)
-
- return sample
diff --git a/spaces/EPFL-VILAB/MultiMAE/mask2former/modeling/__init__.py b/spaces/EPFL-VILAB/MultiMAE/mask2former/modeling/__init__.py
deleted file mode 100644
index 7aed7beac4a880371b14b368f64227a0d129e7c7..0000000000000000000000000000000000000000
--- a/spaces/EPFL-VILAB/MultiMAE/mask2former/modeling/__init__.py
+++ /dev/null
@@ -1,6 +0,0 @@
-# Copyright (c) Facebook, Inc. and its affiliates.
-from .backbone.swin import D2SwinTransformer
-from .pixel_decoder.fpn import BasePixelDecoder
-from .pixel_decoder.msdeformattn import MSDeformAttnPixelDecoder
-from .meta_arch.mask_former_head import MaskFormerHead
-from .meta_arch.per_pixel_baseline import PerPixelBaselineHead, PerPixelBaselinePlusHead
diff --git a/spaces/EcoCy/LoRA-DreamBooth-Training-UI/app_upload.py b/spaces/EcoCy/LoRA-DreamBooth-Training-UI/app_upload.py
deleted file mode 100644
index b2465fa1f13425e05bd638cfe330b47ed7bd53e2..0000000000000000000000000000000000000000
--- a/spaces/EcoCy/LoRA-DreamBooth-Training-UI/app_upload.py
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/usr/bin/env python
-
-from __future__ import annotations
-
-import pathlib
-
-import gradio as gr
-import slugify
-
-from constants import UploadTarget
-from uploader import Uploader
-from utils import find_exp_dirs
-
-
-class LoRAModelUploader(Uploader):
- def upload_lora_model(
- self,
- folder_path: str,
- repo_name: str,
- upload_to: str,
- private: bool,
- delete_existing_repo: bool,
- ) -> str:
- if not folder_path:
- raise ValueError
- if not repo_name:
- repo_name = pathlib.Path(folder_path).name
- repo_name = slugify.slugify(repo_name)
-
- if upload_to == UploadTarget.PERSONAL_PROFILE.value:
- organization = ''
- elif upload_to == UploadTarget.LORA_LIBRARY.value:
- organization = 'lora-library'
- else:
- raise ValueError
-
- return self.upload(folder_path,
- repo_name,
- organization=organization,
- private=private,
- delete_existing_repo=delete_existing_repo)
-
-
-def load_local_lora_model_list() -> dict:
- choices = find_exp_dirs(ignore_repo=True)
- return gr.update(choices=choices, value=choices[0] if choices else None)
-
-
-def create_upload_demo(hf_token: str | None) -> gr.Blocks:
- uploader = LoRAModelUploader(hf_token)
- model_dirs = find_exp_dirs(ignore_repo=True)
-
- with gr.Blocks() as demo:
- with gr.Box():
- gr.Markdown('Local Models')
- reload_button = gr.Button('Reload Model List')
- model_dir = gr.Dropdown(
- label='Model names',
- choices=model_dirs,
- value=model_dirs[0] if model_dirs else None)
- with gr.Box():
- gr.Markdown('Upload Settings')
- with gr.Row():
- use_private_repo = gr.Checkbox(label='Private', value=True)
- delete_existing_repo = gr.Checkbox(
- label='Delete existing repo of the same name', value=False)
- upload_to = gr.Radio(label='Upload to',
- choices=[_.value for _ in UploadTarget],
- value=UploadTarget.LORA_LIBRARY.value)
- model_name = gr.Textbox(label='Model Name')
- upload_button = gr.Button('Upload')
- gr.Markdown('''
- - You can upload your trained model to your personal profile (i.e. https://huggingface.co/{your_username}/{model_name}) or to the public [LoRA Concepts Library](https://huggingface.co/lora-library) (i.e. https://huggingface.co/lora-library/{model_name}).
- ''')
- with gr.Box():
- gr.Markdown('Output message')
- output_message = gr.Markdown()
-
- reload_button.click(fn=load_local_lora_model_list,
- inputs=None,
- outputs=model_dir)
- upload_button.click(fn=uploader.upload_lora_model,
- inputs=[
- model_dir,
- model_name,
- upload_to,
- use_private_repo,
- delete_existing_repo,
- ],
- outputs=output_message)
-
- return demo
-
-
-if __name__ == '__main__':
- import os
-
- hf_token = os.getenv('HF_TOKEN')
- demo = create_upload_demo(hf_token)
- demo.queue(max_size=1).launch(share=False)
diff --git a/spaces/Eddycrack864/Applio-Inference/infer/lib/infer_pack/models_onnx.py b/spaces/Eddycrack864/Applio-Inference/infer/lib/infer_pack/models_onnx.py
deleted file mode 100644
index 3e99763bf3ed7988eb2ae33d9066f85d37adf119..0000000000000000000000000000000000000000
--- a/spaces/Eddycrack864/Applio-Inference/infer/lib/infer_pack/models_onnx.py
+++ /dev/null
@@ -1,824 +0,0 @@
-import math
-import logging
-
-logger = logging.getLogger(__name__)
-
-import numpy as np
-import torch
-from torch import nn
-from torch.nn import AvgPool1d, Conv1d, Conv2d, ConvTranspose1d
-from torch.nn import functional as F
-from torch.nn.utils import remove_weight_norm, spectral_norm, weight_norm
-
-from infer.lib.infer_pack import attentions, commons, modules
-from infer.lib.infer_pack.commons import get_padding, init_weights
-
-
-class TextEncoder256(nn.Module):
- def __init__(
- self,
- out_channels,
- hidden_channels,
- filter_channels,
- n_heads,
- n_layers,
- kernel_size,
- p_dropout,
- f0=True,
- ):
- super().__init__()
- self.out_channels = out_channels
- self.hidden_channels = hidden_channels
- self.filter_channels = filter_channels
- self.n_heads = n_heads
- self.n_layers = n_layers
- self.kernel_size = kernel_size
- self.p_dropout = p_dropout
- self.emb_phone = nn.Linear(256, hidden_channels)
- self.lrelu = nn.LeakyReLU(0.1, inplace=True)
- if f0 == True:
- self.emb_pitch = nn.Embedding(256, hidden_channels) # pitch 256
- self.encoder = attentions.Encoder(
- hidden_channels, filter_channels, n_heads, n_layers, kernel_size, p_dropout
- )
- self.proj = nn.Conv1d(hidden_channels, out_channels * 2, 1)
-
- def forward(self, phone, pitch, lengths):
- if pitch == None:
- x = self.emb_phone(phone)
- else:
- x = self.emb_phone(phone) + self.emb_pitch(pitch)
- x = x * math.sqrt(self.hidden_channels) # [b, t, h]
- x = self.lrelu(x)
- x = torch.transpose(x, 1, -1) # [b, h, t]
- x_mask = torch.unsqueeze(commons.sequence_mask(lengths, x.size(2)), 1).to(
- x.dtype
- )
- x = self.encoder(x * x_mask, x_mask)
- stats = self.proj(x) * x_mask
-
- m, logs = torch.split(stats, self.out_channels, dim=1)
- return m, logs, x_mask
-
-
-class TextEncoder768(nn.Module):
- def __init__(
- self,
- out_channels,
- hidden_channels,
- filter_channels,
- n_heads,
- n_layers,
- kernel_size,
- p_dropout,
- f0=True,
- ):
- super().__init__()
- self.out_channels = out_channels
- self.hidden_channels = hidden_channels
- self.filter_channels = filter_channels
- self.n_heads = n_heads
- self.n_layers = n_layers
- self.kernel_size = kernel_size
- self.p_dropout = p_dropout
- self.emb_phone = nn.Linear(768, hidden_channels)
- self.lrelu = nn.LeakyReLU(0.1, inplace=True)
- if f0 == True:
- self.emb_pitch = nn.Embedding(256, hidden_channels) # pitch 256
- self.encoder = attentions.Encoder(
- hidden_channels, filter_channels, n_heads, n_layers, kernel_size, p_dropout
- )
- self.proj = nn.Conv1d(hidden_channels, out_channels * 2, 1)
-
- def forward(self, phone, pitch, lengths):
- if pitch == None:
- x = self.emb_phone(phone)
- else:
- x = self.emb_phone(phone) + self.emb_pitch(pitch)
- x = x * math.sqrt(self.hidden_channels) # [b, t, h]
- x = self.lrelu(x)
- x = torch.transpose(x, 1, -1) # [b, h, t]
- x_mask = torch.unsqueeze(commons.sequence_mask(lengths, x.size(2)), 1).to(
- x.dtype
- )
- x = self.encoder(x * x_mask, x_mask)
- stats = self.proj(x) * x_mask
-
- m, logs = torch.split(stats, self.out_channels, dim=1)
- return m, logs, x_mask
-
-
-class ResidualCouplingBlock(nn.Module):
- def __init__(
- self,
- channels,
- hidden_channels,
- kernel_size,
- dilation_rate,
- n_layers,
- n_flows=4,
- gin_channels=0,
- ):
- super().__init__()
- self.channels = channels
- self.hidden_channels = hidden_channels
- self.kernel_size = kernel_size
- self.dilation_rate = dilation_rate
- self.n_layers = n_layers
- self.n_flows = n_flows
- self.gin_channels = gin_channels
-
- self.flows = nn.ModuleList()
- for i in range(n_flows):
- self.flows.append(
- modules.ResidualCouplingLayer(
- channels,
- hidden_channels,
- kernel_size,
- dilation_rate,
- n_layers,
- gin_channels=gin_channels,
- mean_only=True,
- )
- )
- self.flows.append(modules.Flip())
-
- def forward(self, x, x_mask, g=None, reverse=False):
- if not reverse:
- for flow in self.flows:
- x, _ = flow(x, x_mask, g=g, reverse=reverse)
- else:
- for flow in reversed(self.flows):
- x = flow(x, x_mask, g=g, reverse=reverse)
- return x
-
- def remove_weight_norm(self):
- for i in range(self.n_flows):
- self.flows[i * 2].remove_weight_norm()
-
-
-class PosteriorEncoder(nn.Module):
- def __init__(
- self,
- in_channels,
- out_channels,
- hidden_channels,
- kernel_size,
- dilation_rate,
- n_layers,
- gin_channels=0,
- ):
- super().__init__()
- self.in_channels = in_channels
- self.out_channels = out_channels
- self.hidden_channels = hidden_channels
- self.kernel_size = kernel_size
- self.dilation_rate = dilation_rate
- self.n_layers = n_layers
- self.gin_channels = gin_channels
-
- self.pre = nn.Conv1d(in_channels, hidden_channels, 1)
- self.enc = modules.WN(
- hidden_channels,
- kernel_size,
- dilation_rate,
- n_layers,
- gin_channels=gin_channels,
- )
- self.proj = nn.Conv1d(hidden_channels, out_channels * 2, 1)
-
- def forward(self, x, x_lengths, g=None):
- x_mask = torch.unsqueeze(commons.sequence_mask(x_lengths, x.size(2)), 1).to(
- x.dtype
- )
- x = self.pre(x) * x_mask
- x = self.enc(x, x_mask, g=g)
- stats = self.proj(x) * x_mask
- m, logs = torch.split(stats, self.out_channels, dim=1)
- z = (m + torch.randn_like(m) * torch.exp(logs)) * x_mask
- return z, m, logs, x_mask
-
- def remove_weight_norm(self):
- self.enc.remove_weight_norm()
-
-
-class Generator(torch.nn.Module):
- def __init__(
- self,
- initial_channel,
- resblock,
- resblock_kernel_sizes,
- resblock_dilation_sizes,
- upsample_rates,
- upsample_initial_channel,
- upsample_kernel_sizes,
- gin_channels=0,
- ):
- super(Generator, self).__init__()
- self.num_kernels = len(resblock_kernel_sizes)
- self.num_upsamples = len(upsample_rates)
- self.conv_pre = Conv1d(
- initial_channel, upsample_initial_channel, 7, 1, padding=3
- )
- resblock = modules.ResBlock1 if resblock == "1" else modules.ResBlock2
-
- self.ups = nn.ModuleList()
- for i, (u, k) in enumerate(zip(upsample_rates, upsample_kernel_sizes)):
- self.ups.append(
- weight_norm(
- ConvTranspose1d(
- upsample_initial_channel // (2**i),
- upsample_initial_channel // (2 ** (i + 1)),
- k,
- u,
- padding=(k - u) // 2,
- )
- )
- )
-
- self.resblocks = nn.ModuleList()
- for i in range(len(self.ups)):
- ch = upsample_initial_channel // (2 ** (i + 1))
- for j, (k, d) in enumerate(
- zip(resblock_kernel_sizes, resblock_dilation_sizes)
- ):
- self.resblocks.append(resblock(ch, k, d))
-
- self.conv_post = Conv1d(ch, 1, 7, 1, padding=3, bias=False)
- self.ups.apply(init_weights)
-
- if gin_channels != 0:
- self.cond = nn.Conv1d(gin_channels, upsample_initial_channel, 1)
-
- def forward(self, x, g=None):
- x = self.conv_pre(x)
- if g is not None:
- x = x + self.cond(g)
-
- for i in range(self.num_upsamples):
- x = F.leaky_relu(x, modules.LRELU_SLOPE)
- x = self.ups[i](x)
- xs = None
- for j in range(self.num_kernels):
- if xs is None:
- xs = self.resblocks[i * self.num_kernels + j](x)
- else:
- xs += self.resblocks[i * self.num_kernels + j](x)
- x = xs / self.num_kernels
- x = F.leaky_relu(x)
- x = self.conv_post(x)
- x = torch.tanh(x)
-
- return x
-
- def remove_weight_norm(self):
- for l in self.ups:
- remove_weight_norm(l)
- for l in self.resblocks:
- l.remove_weight_norm()
-
-
-class SineGen(torch.nn.Module):
- """Definition of sine generator
- SineGen(samp_rate, harmonic_num = 0,
- sine_amp = 0.1, noise_std = 0.003,
- voiced_threshold = 0,
- flag_for_pulse=False)
- samp_rate: sampling rate in Hz
- harmonic_num: number of harmonic overtones (default 0)
- sine_amp: amplitude of sine-wavefrom (default 0.1)
- noise_std: std of Gaussian noise (default 0.003)
- voiced_thoreshold: F0 threshold for U/V classification (default 0)
- flag_for_pulse: this SinGen is used inside PulseGen (default False)
- Note: when flag_for_pulse is True, the first time step of a voiced
- segment is always sin(np.pi) or cos(0)
- """
-
- def __init__(
- self,
- samp_rate,
- harmonic_num=0,
- sine_amp=0.1,
- noise_std=0.003,
- voiced_threshold=0,
- flag_for_pulse=False,
- ):
- super(SineGen, self).__init__()
- self.sine_amp = sine_amp
- self.noise_std = noise_std
- self.harmonic_num = harmonic_num
- self.dim = self.harmonic_num + 1
- self.sampling_rate = samp_rate
- self.voiced_threshold = voiced_threshold
-
- def _f02uv(self, f0):
- # generate uv signal
- uv = torch.ones_like(f0)
- uv = uv * (f0 > self.voiced_threshold)
- return uv
-
- def forward(self, f0, upp):
- """sine_tensor, uv = forward(f0)
- input F0: tensor(batchsize=1, length, dim=1)
- f0 for unvoiced steps should be 0
- output sine_tensor: tensor(batchsize=1, length, dim)
- output uv: tensor(batchsize=1, length, 1)
- """
- with torch.no_grad():
- f0 = f0[:, None].transpose(1, 2)
- f0_buf = torch.zeros(f0.shape[0], f0.shape[1], self.dim, device=f0.device)
- # fundamental component
- f0_buf[:, :, 0] = f0[:, :, 0]
- for idx in np.arange(self.harmonic_num):
- f0_buf[:, :, idx + 1] = f0_buf[:, :, 0] * (
- idx + 2
- ) # idx + 2: the (idx+1)-th overtone, (idx+2)-th harmonic
- rad_values = (f0_buf / self.sampling_rate) % 1 ###%1意味着n_har的乘积无法后处理优化
- rand_ini = torch.rand(
- f0_buf.shape[0], f0_buf.shape[2], device=f0_buf.device
- )
- rand_ini[:, 0] = 0
- rad_values[:, 0, :] = rad_values[:, 0, :] + rand_ini
- tmp_over_one = torch.cumsum(rad_values, 1) # % 1 #####%1意味着后面的cumsum无法再优化
- tmp_over_one *= upp
- tmp_over_one = F.interpolate(
- tmp_over_one.transpose(2, 1),
- scale_factor=upp,
- mode="linear",
- align_corners=True,
- ).transpose(2, 1)
- rad_values = F.interpolate(
- rad_values.transpose(2, 1), scale_factor=upp, mode="nearest"
- ).transpose(
- 2, 1
- ) #######
- tmp_over_one %= 1
- tmp_over_one_idx = (tmp_over_one[:, 1:, :] - tmp_over_one[:, :-1, :]) < 0
- cumsum_shift = torch.zeros_like(rad_values)
- cumsum_shift[:, 1:, :] = tmp_over_one_idx * -1.0
- sine_waves = torch.sin(
- torch.cumsum(rad_values + cumsum_shift, dim=1) * 2 * np.pi
- )
- sine_waves = sine_waves * self.sine_amp
- uv = self._f02uv(f0)
- uv = F.interpolate(
- uv.transpose(2, 1), scale_factor=upp, mode="nearest"
- ).transpose(2, 1)
- noise_amp = uv * self.noise_std + (1 - uv) * self.sine_amp / 3
- noise = noise_amp * torch.randn_like(sine_waves)
- sine_waves = sine_waves * uv + noise
- return sine_waves, uv, noise
-
-
-class SourceModuleHnNSF(torch.nn.Module):
- """SourceModule for hn-nsf
- SourceModule(sampling_rate, harmonic_num=0, sine_amp=0.1,
- add_noise_std=0.003, voiced_threshod=0)
- sampling_rate: sampling_rate in Hz
- harmonic_num: number of harmonic above F0 (default: 0)
- sine_amp: amplitude of sine source signal (default: 0.1)
- add_noise_std: std of additive Gaussian noise (default: 0.003)
- note that amplitude of noise in unvoiced is decided
- by sine_amp
- voiced_threshold: threhold to set U/V given F0 (default: 0)
- Sine_source, noise_source = SourceModuleHnNSF(F0_sampled)
- F0_sampled (batchsize, length, 1)
- Sine_source (batchsize, length, 1)
- noise_source (batchsize, length 1)
- uv (batchsize, length, 1)
- """
-
- def __init__(
- self,
- sampling_rate,
- harmonic_num=0,
- sine_amp=0.1,
- add_noise_std=0.003,
- voiced_threshod=0,
- is_half=True,
- ):
- super(SourceModuleHnNSF, self).__init__()
-
- self.sine_amp = sine_amp
- self.noise_std = add_noise_std
- self.is_half = is_half
- # to produce sine waveforms
- self.l_sin_gen = SineGen(
- sampling_rate, harmonic_num, sine_amp, add_noise_std, voiced_threshod
- )
-
- # to merge source harmonics into a single excitation
- self.l_linear = torch.nn.Linear(harmonic_num + 1, 1)
- self.l_tanh = torch.nn.Tanh()
-
- def forward(self, x, upp=None):
- sine_wavs, uv, _ = self.l_sin_gen(x, upp)
- if self.is_half:
- sine_wavs = sine_wavs.half()
- sine_merge = self.l_tanh(self.l_linear(sine_wavs))
- return sine_merge, None, None # noise, uv
-
-
-class GeneratorNSF(torch.nn.Module):
- def __init__(
- self,
- initial_channel,
- resblock,
- resblock_kernel_sizes,
- resblock_dilation_sizes,
- upsample_rates,
- upsample_initial_channel,
- upsample_kernel_sizes,
- gin_channels,
- sr,
- is_half=False,
- ):
- super(GeneratorNSF, self).__init__()
- self.num_kernels = len(resblock_kernel_sizes)
- self.num_upsamples = len(upsample_rates)
-
- self.f0_upsamp = torch.nn.Upsample(scale_factor=np.prod(upsample_rates))
- self.m_source = SourceModuleHnNSF(
- sampling_rate=sr, harmonic_num=0, is_half=is_half
- )
- self.noise_convs = nn.ModuleList()
- self.conv_pre = Conv1d(
- initial_channel, upsample_initial_channel, 7, 1, padding=3
- )
- resblock = modules.ResBlock1 if resblock == "1" else modules.ResBlock2
-
- self.ups = nn.ModuleList()
- for i, (u, k) in enumerate(zip(upsample_rates, upsample_kernel_sizes)):
- c_cur = upsample_initial_channel // (2 ** (i + 1))
- self.ups.append(
- weight_norm(
- ConvTranspose1d(
- upsample_initial_channel // (2**i),
- upsample_initial_channel // (2 ** (i + 1)),
- k,
- u,
- padding=(k - u) // 2,
- )
- )
- )
- if i + 1 < len(upsample_rates):
- stride_f0 = np.prod(upsample_rates[i + 1 :])
- self.noise_convs.append(
- Conv1d(
- 1,
- c_cur,
- kernel_size=stride_f0 * 2,
- stride=stride_f0,
- padding=stride_f0 // 2,
- )
- )
- else:
- self.noise_convs.append(Conv1d(1, c_cur, kernel_size=1))
-
- self.resblocks = nn.ModuleList()
- for i in range(len(self.ups)):
- ch = upsample_initial_channel // (2 ** (i + 1))
- for j, (k, d) in enumerate(
- zip(resblock_kernel_sizes, resblock_dilation_sizes)
- ):
- self.resblocks.append(resblock(ch, k, d))
-
- self.conv_post = Conv1d(ch, 1, 7, 1, padding=3, bias=False)
- self.ups.apply(init_weights)
-
- if gin_channels != 0:
- self.cond = nn.Conv1d(gin_channels, upsample_initial_channel, 1)
-
- self.upp = np.prod(upsample_rates)
-
- def forward(self, x, f0, g=None):
- har_source, noi_source, uv = self.m_source(f0, self.upp)
- har_source = har_source.transpose(1, 2)
- x = self.conv_pre(x)
- if g is not None:
- x = x + self.cond(g)
-
- for i in range(self.num_upsamples):
- x = F.leaky_relu(x, modules.LRELU_SLOPE)
- x = self.ups[i](x)
- x_source = self.noise_convs[i](har_source)
- x = x + x_source
- xs = None
- for j in range(self.num_kernels):
- if xs is None:
- xs = self.resblocks[i * self.num_kernels + j](x)
- else:
- xs += self.resblocks[i * self.num_kernels + j](x)
- x = xs / self.num_kernels
- x = F.leaky_relu(x)
- x = self.conv_post(x)
- x = torch.tanh(x)
- return x
-
- def remove_weight_norm(self):
- for l in self.ups:
- remove_weight_norm(l)
- for l in self.resblocks:
- l.remove_weight_norm()
-
-
-sr2sr = {
- "32k": 32000,
- "40k": 40000,
- "48k": 48000,
-}
-
-
-class SynthesizerTrnMsNSFsidM(nn.Module):
- def __init__(
- self,
- spec_channels,
- segment_size,
- inter_channels,
- hidden_channels,
- filter_channels,
- n_heads,
- n_layers,
- kernel_size,
- p_dropout,
- resblock,
- resblock_kernel_sizes,
- resblock_dilation_sizes,
- upsample_rates,
- upsample_initial_channel,
- upsample_kernel_sizes,
- spk_embed_dim,
- gin_channels,
- sr,
- version,
- **kwargs
- ):
- super().__init__()
- if type(sr) == type("strr"):
- sr = sr2sr[sr]
- self.spec_channels = spec_channels
- self.inter_channels = inter_channels
- self.hidden_channels = hidden_channels
- self.filter_channels = filter_channels
- self.n_heads = n_heads
- self.n_layers = n_layers
- self.kernel_size = kernel_size
- self.p_dropout = p_dropout
- self.resblock = resblock
- self.resblock_kernel_sizes = resblock_kernel_sizes
- self.resblock_dilation_sizes = resblock_dilation_sizes
- self.upsample_rates = upsample_rates
- self.upsample_initial_channel = upsample_initial_channel
- self.upsample_kernel_sizes = upsample_kernel_sizes
- self.segment_size = segment_size
- self.gin_channels = gin_channels
- # self.hop_length = hop_length#
- self.spk_embed_dim = spk_embed_dim
- if version == "v1":
- self.enc_p = TextEncoder256(
- inter_channels,
- hidden_channels,
- filter_channels,
- n_heads,
- n_layers,
- kernel_size,
- p_dropout,
- )
- else:
- self.enc_p = TextEncoder768(
- inter_channels,
- hidden_channels,
- filter_channels,
- n_heads,
- n_layers,
- kernel_size,
- p_dropout,
- )
- self.dec = GeneratorNSF(
- inter_channels,
- resblock,
- resblock_kernel_sizes,
- resblock_dilation_sizes,
- upsample_rates,
- upsample_initial_channel,
- upsample_kernel_sizes,
- gin_channels=gin_channels,
- sr=sr,
- is_half=kwargs["is_half"],
- )
- self.enc_q = PosteriorEncoder(
- spec_channels,
- inter_channels,
- hidden_channels,
- 5,
- 1,
- 16,
- gin_channels=gin_channels,
- )
- self.flow = ResidualCouplingBlock(
- inter_channels, hidden_channels, 5, 1, 3, gin_channels=gin_channels
- )
- self.emb_g = nn.Embedding(self.spk_embed_dim, gin_channels)
- self.speaker_map = None
- logger.debug(
- "gin_channels: "
- + gin_channels
- + ", self.spk_embed_dim: "
- + self.spk_embed_dim
- )
-
- def remove_weight_norm(self):
- self.dec.remove_weight_norm()
- self.flow.remove_weight_norm()
- self.enc_q.remove_weight_norm()
-
- def construct_spkmixmap(self, n_speaker):
- self.speaker_map = torch.zeros((n_speaker, 1, 1, self.gin_channels))
- for i in range(n_speaker):
- self.speaker_map[i] = self.emb_g(torch.LongTensor([[i]]))
- self.speaker_map = self.speaker_map.unsqueeze(0)
-
- def forward(self, phone, phone_lengths, pitch, nsff0, g, rnd, max_len=None):
- if self.speaker_map is not None: # [N, S] * [S, B, 1, H]
- g = g.reshape((g.shape[0], g.shape[1], 1, 1, 1)) # [N, S, B, 1, 1]
- g = g * self.speaker_map # [N, S, B, 1, H]
- g = torch.sum(g, dim=1) # [N, 1, B, 1, H]
- g = g.transpose(0, -1).transpose(0, -2).squeeze(0) # [B, H, N]
- else:
- g = g.unsqueeze(0)
- g = self.emb_g(g).transpose(1, 2)
-
- m_p, logs_p, x_mask = self.enc_p(phone, pitch, phone_lengths)
- z_p = (m_p + torch.exp(logs_p) * rnd) * x_mask
- z = self.flow(z_p, x_mask, g=g, reverse=True)
- o = self.dec((z * x_mask)[:, :, :max_len], nsff0, g=g)
- return o
-
-
-class MultiPeriodDiscriminator(torch.nn.Module):
- def __init__(self, use_spectral_norm=False):
- super(MultiPeriodDiscriminator, self).__init__()
- periods = [2, 3, 5, 7, 11, 17]
- # periods = [3, 5, 7, 11, 17, 23, 37]
-
- discs = [DiscriminatorS(use_spectral_norm=use_spectral_norm)]
- discs = discs + [
- DiscriminatorP(i, use_spectral_norm=use_spectral_norm) for i in periods
- ]
- self.discriminators = nn.ModuleList(discs)
-
- def forward(self, y, y_hat):
- y_d_rs = [] #
- y_d_gs = []
- fmap_rs = []
- fmap_gs = []
- for i, d in enumerate(self.discriminators):
- y_d_r, fmap_r = d(y)
- y_d_g, fmap_g = d(y_hat)
- # for j in range(len(fmap_r)):
- # print(i,j,y.shape,y_hat.shape,fmap_r[j].shape,fmap_g[j].shape)
- y_d_rs.append(y_d_r)
- y_d_gs.append(y_d_g)
- fmap_rs.append(fmap_r)
- fmap_gs.append(fmap_g)
-
- return y_d_rs, y_d_gs, fmap_rs, fmap_gs
-
-
-class MultiPeriodDiscriminatorV2(torch.nn.Module):
- def __init__(self, use_spectral_norm=False):
- super(MultiPeriodDiscriminatorV2, self).__init__()
- # periods = [2, 3, 5, 7, 11, 17]
- periods = [2, 3, 5, 7, 11, 17, 23, 37]
-
- discs = [DiscriminatorS(use_spectral_norm=use_spectral_norm)]
- discs = discs + [
- DiscriminatorP(i, use_spectral_norm=use_spectral_norm) for i in periods
- ]
- self.discriminators = nn.ModuleList(discs)
-
- def forward(self, y, y_hat):
- y_d_rs = [] #
- y_d_gs = []
- fmap_rs = []
- fmap_gs = []
- for i, d in enumerate(self.discriminators):
- y_d_r, fmap_r = d(y)
- y_d_g, fmap_g = d(y_hat)
- # for j in range(len(fmap_r)):
- # print(i,j,y.shape,y_hat.shape,fmap_r[j].shape,fmap_g[j].shape)
- y_d_rs.append(y_d_r)
- y_d_gs.append(y_d_g)
- fmap_rs.append(fmap_r)
- fmap_gs.append(fmap_g)
-
- return y_d_rs, y_d_gs, fmap_rs, fmap_gs
-
-
-class DiscriminatorS(torch.nn.Module):
- def __init__(self, use_spectral_norm=False):
- super(DiscriminatorS, self).__init__()
- norm_f = weight_norm if use_spectral_norm == False else spectral_norm
- self.convs = nn.ModuleList(
- [
- norm_f(Conv1d(1, 16, 15, 1, padding=7)),
- norm_f(Conv1d(16, 64, 41, 4, groups=4, padding=20)),
- norm_f(Conv1d(64, 256, 41, 4, groups=16, padding=20)),
- norm_f(Conv1d(256, 1024, 41, 4, groups=64, padding=20)),
- norm_f(Conv1d(1024, 1024, 41, 4, groups=256, padding=20)),
- norm_f(Conv1d(1024, 1024, 5, 1, padding=2)),
- ]
- )
- self.conv_post = norm_f(Conv1d(1024, 1, 3, 1, padding=1))
-
- def forward(self, x):
- fmap = []
-
- for l in self.convs:
- x = l(x)
- x = F.leaky_relu(x, modules.LRELU_SLOPE)
- fmap.append(x)
- x = self.conv_post(x)
- fmap.append(x)
- x = torch.flatten(x, 1, -1)
-
- return x, fmap
-
-
-class DiscriminatorP(torch.nn.Module):
- def __init__(self, period, kernel_size=5, stride=3, use_spectral_norm=False):
- super(DiscriminatorP, self).__init__()
- self.period = period
- self.use_spectral_norm = use_spectral_norm
- norm_f = weight_norm if use_spectral_norm == False else spectral_norm
- self.convs = nn.ModuleList(
- [
- norm_f(
- Conv2d(
- 1,
- 32,
- (kernel_size, 1),
- (stride, 1),
- padding=(get_padding(kernel_size, 1), 0),
- )
- ),
- norm_f(
- Conv2d(
- 32,
- 128,
- (kernel_size, 1),
- (stride, 1),
- padding=(get_padding(kernel_size, 1), 0),
- )
- ),
- norm_f(
- Conv2d(
- 128,
- 512,
- (kernel_size, 1),
- (stride, 1),
- padding=(get_padding(kernel_size, 1), 0),
- )
- ),
- norm_f(
- Conv2d(
- 512,
- 1024,
- (kernel_size, 1),
- (stride, 1),
- padding=(get_padding(kernel_size, 1), 0),
- )
- ),
- norm_f(
- Conv2d(
- 1024,
- 1024,
- (kernel_size, 1),
- 1,
- padding=(get_padding(kernel_size, 1), 0),
- )
- ),
- ]
- )
- self.conv_post = norm_f(Conv2d(1024, 1, (3, 1), 1, padding=(1, 0)))
-
- def forward(self, x):
- fmap = []
-
- # 1d to 2d
- b, c, t = x.shape
- if t % self.period != 0: # pad first
- n_pad = self.period - (t % self.period)
- x = F.pad(x, (0, n_pad), "reflect")
- t = t + n_pad
- x = x.view(b, c, t // self.period, self.period)
-
- for l in self.convs:
- x = l(x)
- x = F.leaky_relu(x, modules.LRELU_SLOPE)
- fmap.append(x)
- x = self.conv_post(x)
- fmap.append(x)
- x = torch.flatten(x, 1, -1)
-
- return x, fmap
diff --git a/spaces/Eduardovco/Potato/Dockerfile b/spaces/Eduardovco/Potato/Dockerfile
deleted file mode 100644
index 6c01c09373883afcb4ea34ae2d316cd596e1737b..0000000000000000000000000000000000000000
--- a/spaces/Eduardovco/Potato/Dockerfile
+++ /dev/null
@@ -1,21 +0,0 @@
-FROM node:18-bullseye-slim
-
-RUN apt-get update && \
-
-apt-get install -y git
-
-RUN git clone https://gitgud.io/khanon/oai-reverse-proxy.git /app
-
-WORKDIR /app
-
-RUN npm install
-
-COPY Dockerfile greeting.md* .env* ./
-
-RUN npm run build
-
-EXPOSE 7860
-
-ENV NODE_ENV=production
-
-CMD [ "npm", "start" ]
\ No newline at end of file
diff --git a/spaces/Egrt/GCycleGAN/nets/resnest/__init__.py b/spaces/Egrt/GCycleGAN/nets/resnest/__init__.py
deleted file mode 100644
index 2acf216b90720c266e9582ab16b4204a8a072a25..0000000000000000000000000000000000000000
--- a/spaces/Egrt/GCycleGAN/nets/resnest/__init__.py
+++ /dev/null
@@ -1,2 +0,0 @@
-from .resnest import *
-from .ablation import *
diff --git a/spaces/EleutherAI/magma/magma/sampling.py b/spaces/EleutherAI/magma/magma/sampling.py
deleted file mode 100644
index 8734ea1589969e4a0cfa350a01585cfe424e6b1e..0000000000000000000000000000000000000000
--- a/spaces/EleutherAI/magma/magma/sampling.py
+++ /dev/null
@@ -1,121 +0,0 @@
-import torch
-import torch.nn.functional as F
-from torchtyping import TensorType
-from typing import Union, List
-
-
-def top_p_filter(logits: TensorType[..., "vocab"], threshold: float = 0.9):
- """
- Nucleus sampling
- """
- sorted_logits, sorted_indices = torch.sort(logits, descending=True)
- cum_probs = torch.cumsum(F.softmax(sorted_logits, dim=-1), dim=-1)
-
- sorted_indices_to_remove = cum_probs > (1 - threshold)
- sorted_indices_to_remove[..., 1:] = sorted_indices_to_remove[..., :-1].clone()
- sorted_indices_to_remove[..., 0] = 0
-
- sorted_logits[sorted_indices_to_remove] = float("-inf")
- return sorted_logits.scatter(1, sorted_indices, sorted_logits)
-
-
-def top_k_filter(logits, k):
- """
- Top K sampling
- """
- assert k > 0
- val, ind = torch.topk(logits, k)
- probs = torch.full_like(logits, float("-inf"))
- probs.scatter_(1, ind, val)
- return probs
-
-
-def remove_tokens_after_eos(tensor, eos_token, image_token):
- # any tokens after and end of sequence token is produced are also set to the eos token, and removed
- eos_index = (tensor == eos_token).nonzero()
- if eos_index.any():
- tensor[eos_index[0] :] = eos_token
-
- tensor = tensor.tolist()
- return [i for i in tensor if (not i == image_token) and (not i == eos_token)]
-
-
-@torch.no_grad()
-def generate(
- model: "Magma",
- embeddings: TensorType["b", "s", "d"],
- max_steps: int = 100,
- temperature: float = 0.7,
- top_k: int = 0,
- top_p: float = 0.9,
- eos_token: int = None,
- decode: bool = True,
-) -> Union[List[str], TensorType["b", "s"]]:
- """
- Generates captions for a batch of embeddings.
-
- :param model: The model to use for generation.
- :param embeddings: The embeddings to generate captions for.
- :param max_steps: The maximum number of steps to generate captions for.
- :param temperature: The temperature to use for sampling.
- :param top_k: value for top k sampling. If 0, no sampling will be used.
- :param top_p: value for top p sampling. If 0, no sampling will be used.
- :param eos_token: The token to use for end of sequence.
- :param decode: Whether to decode the output into text, or return the raw tokens.
- """
-
- # init values
- eos_token = eos_token or model.eos_token
- was_training = model.training
- model.eval()
- b, s, _ = embeddings.shape
- past_key_values = None
-
- # init output with image tokens
- out = torch.zeros((b, s), dtype=torch.long).to(model.device) + model.image_token
-
- # do sampling
- for i in range(max_steps):
- if i == 0:
- # initial input
- outputs = model.lm(
- inputs_embeds=embeddings,
- use_cache=True,
- past_key_values=past_key_values,
- )
- else:
- # now caching past k/v so we can use only the last token
- outputs = model.lm(
- input_ids=out[:, -1:], use_cache=True, past_key_values=past_key_values
- )
-
- logits = outputs.logits[:, -1, :].float()
- past_key_values = outputs.past_key_values
-
- # filter / temperature sample
- if temperature == 0.0:
- next_token = torch.argmax(logits, dim=-1)
- else:
- if top_k > 0:
- logits = top_k_filter(logits, k=top_k)
- if top_p > 0:
- logits = top_p_filter(logits, threshold=top_p)
-
- probs = F.softmax(logits / temperature, dim=-1)
- next_token = torch.multinomial(probs, num_samples=1)
-
- out = torch.cat((out, next_token), dim=-1)
-
- if eos_token is not None and (next_token == eos_token).all():
- break
-
- if decode:
- captions = []
- for b in out:
- b = remove_tokens_after_eos(b, eos_token, model.image_token)
- caption = model.tokenizer.decode(b)
- captions.append(caption)
- out = captions
-
- model.train(was_training)
- return out
diff --git a/spaces/EuroPython2022/viciu/app.py b/spaces/EuroPython2022/viciu/app.py
deleted file mode 100644
index 24f23e3d739b33cb13be133a6d8d7756d94569db..0000000000000000000000000000000000000000
--- a/spaces/EuroPython2022/viciu/app.py
+++ /dev/null
@@ -1,9 +0,0 @@
-import gradio as gr
-
-
-def update(name):
- return f"Welcome to Gradio, {name}!"
-
-
-gr.Interface.load('huggingface/distilgpt2').launch()
-
diff --git a/spaces/FFusion/FFXL-SDXL-Convert-diffusers/README.md b/spaces/FFusion/FFXL-SDXL-Convert-diffusers/README.md
deleted file mode 100644
index d5c26cee7a6ec272b6e3522723fd79ec224ac776..0000000000000000000000000000000000000000
--- a/spaces/FFusion/FFXL-SDXL-Convert-diffusers/README.md
+++ /dev/null
@@ -1,14 +0,0 @@
----
-title: Convert SDXL To Diffusers
-emoji: 🎨➡️🧨
-colorFrom: indigo
-colorTo: purple
-sdk: gradio
-sdk_version: 3.31.0
-app_file: app.py
-pinned: true
-license: mit
-duplicated_from: diffusers/sdxl-to-diffusers
----
-
-Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
diff --git a/spaces/Faryne/yulet1de-hentaidiffusion/app.py b/spaces/Faryne/yulet1de-hentaidiffusion/app.py
deleted file mode 100644
index edf0803cbdf9a26a10899d5021088c3d80eec76d..0000000000000000000000000000000000000000
--- a/spaces/Faryne/yulet1de-hentaidiffusion/app.py
+++ /dev/null
@@ -1,3 +0,0 @@
-import gradio as gr
-
-gr.Interface.load("models/yulet1de/hentaidiffusion").launch()
\ No newline at end of file
diff --git a/spaces/FridaZuley/RVC_HFKawaii/infer/lib/uvr5_pack/lib_v5/layers_123821KB.py b/spaces/FridaZuley/RVC_HFKawaii/infer/lib/uvr5_pack/lib_v5/layers_123821KB.py
deleted file mode 100644
index 4fc1b5cb85a3327f60cbb9f5deffbeeaaac516ad..0000000000000000000000000000000000000000
--- a/spaces/FridaZuley/RVC_HFKawaii/infer/lib/uvr5_pack/lib_v5/layers_123821KB.py
+++ /dev/null
@@ -1,118 +0,0 @@
-import torch
-import torch.nn.functional as F
-from torch import nn
-
-from . import spec_utils
-
-
-class Conv2DBNActiv(nn.Module):
- def __init__(self, nin, nout, ksize=3, stride=1, pad=1, dilation=1, activ=nn.ReLU):
- super(Conv2DBNActiv, self).__init__()
- self.conv = nn.Sequential(
- nn.Conv2d(
- nin,
- nout,
- kernel_size=ksize,
- stride=stride,
- padding=pad,
- dilation=dilation,
- bias=False,
- ),
- nn.BatchNorm2d(nout),
- activ(),
- )
-
- def __call__(self, x):
- return self.conv(x)
-
-
-class SeperableConv2DBNActiv(nn.Module):
- def __init__(self, nin, nout, ksize=3, stride=1, pad=1, dilation=1, activ=nn.ReLU):
- super(SeperableConv2DBNActiv, self).__init__()
- self.conv = nn.Sequential(
- nn.Conv2d(
- nin,
- nin,
- kernel_size=ksize,
- stride=stride,
- padding=pad,
- dilation=dilation,
- groups=nin,
- bias=False,
- ),
- nn.Conv2d(nin, nout, kernel_size=1, bias=False),
- nn.BatchNorm2d(nout),
- activ(),
- )
-
- def __call__(self, x):
- return self.conv(x)
-
-
-class Encoder(nn.Module):
- def __init__(self, nin, nout, ksize=3, stride=1, pad=1, activ=nn.LeakyReLU):
- super(Encoder, self).__init__()
- self.conv1 = Conv2DBNActiv(nin, nout, ksize, 1, pad, activ=activ)
- self.conv2 = Conv2DBNActiv(nout, nout, ksize, stride, pad, activ=activ)
-
- def __call__(self, x):
- skip = self.conv1(x)
- h = self.conv2(skip)
-
- return h, skip
-
-
-class Decoder(nn.Module):
- def __init__(
- self, nin, nout, ksize=3, stride=1, pad=1, activ=nn.ReLU, dropout=False
- ):
- super(Decoder, self).__init__()
- self.conv = Conv2DBNActiv(nin, nout, ksize, 1, pad, activ=activ)
- self.dropout = nn.Dropout2d(0.1) if dropout else None
-
- def __call__(self, x, skip=None):
- x = F.interpolate(x, scale_factor=2, mode="bilinear", align_corners=True)
- if skip is not None:
- skip = spec_utils.crop_center(skip, x)
- x = torch.cat([x, skip], dim=1)
- h = self.conv(x)
-
- if self.dropout is not None:
- h = self.dropout(h)
-
- return h
-
-
-class ASPPModule(nn.Module):
- def __init__(self, nin, nout, dilations=(4, 8, 16), activ=nn.ReLU):
- super(ASPPModule, self).__init__()
- self.conv1 = nn.Sequential(
- nn.AdaptiveAvgPool2d((1, None)),
- Conv2DBNActiv(nin, nin, 1, 1, 0, activ=activ),
- )
- self.conv2 = Conv2DBNActiv(nin, nin, 1, 1, 0, activ=activ)
- self.conv3 = SeperableConv2DBNActiv(
- nin, nin, 3, 1, dilations[0], dilations[0], activ=activ
- )
- self.conv4 = SeperableConv2DBNActiv(
- nin, nin, 3, 1, dilations[1], dilations[1], activ=activ
- )
- self.conv5 = SeperableConv2DBNActiv(
- nin, nin, 3, 1, dilations[2], dilations[2], activ=activ
- )
- self.bottleneck = nn.Sequential(
- Conv2DBNActiv(nin * 5, nout, 1, 1, 0, activ=activ), nn.Dropout2d(0.1)
- )
-
- def forward(self, x):
- _, _, h, w = x.size()
- feat1 = F.interpolate(
- self.conv1(x), size=(h, w), mode="bilinear", align_corners=True
- )
- feat2 = self.conv2(x)
- feat3 = self.conv3(x)
- feat4 = self.conv4(x)
- feat5 = self.conv5(x)
- out = torch.cat((feat1, feat2, feat3, feat4, feat5), dim=1)
- bottle = self.bottleneck(out)
- return bottle
diff --git a/spaces/GIZ/SDSN-demo/utils/streamlitcheck.py b/spaces/GIZ/SDSN-demo/utils/streamlitcheck.py
deleted file mode 100644
index a203c356ed1b6e586c1196084940c0d9e1446268..0000000000000000000000000000000000000000
--- a/spaces/GIZ/SDSN-demo/utils/streamlitcheck.py
+++ /dev/null
@@ -1,42 +0,0 @@
-import logging
-try:
- import streamlit as st
-except ImportError:
- logging.info("Streamlit not installed")
-
-
-def check_streamlit():
- """
- Function to check whether python code is run within streamlit
-
- Returns
- -------
- use_streamlit : boolean
- True if code is run within streamlit, else False
- """
- try:
- from streamlit.scriptrunner.script_run_context import get_script_run_ctx
- if not get_script_run_ctx():
- use_streamlit = False
- else:
- use_streamlit = True
- except ModuleNotFoundError:
- use_streamlit = False
- return use_streamlit
-
-def disable_other_checkboxes(*other_checkboxes_keys):
- for checkbox_key in other_checkboxes_keys:
- st.session_state[checkbox_key] = False
-
-def checkbox_without_preselect(keylist):
- dict_ = {}
- for i,key_val in enumerate(keylist):
- dict_[i] = st.checkbox(key_val,key = key_val,
- on_change = disable_other_checkboxes,
- args=tuple(list(filter(lambda x: x!= key_val, keylist))),)
-
- for key,val in dict_.items():
- if val == True:
- return keylist[int(key)]
-
- return None
\ No newline at end of file
diff --git a/spaces/Gen-Sim/Gen-Sim/cliport/generated_tasks/color_coordinated_cylinder_pyramid.py b/spaces/Gen-Sim/Gen-Sim/cliport/generated_tasks/color_coordinated_cylinder_pyramid.py
deleted file mode 100644
index fd5ca1a871f7999ed5874b36f04e493f97f8c0f1..0000000000000000000000000000000000000000
--- a/spaces/Gen-Sim/Gen-Sim/cliport/generated_tasks/color_coordinated_cylinder_pyramid.py
+++ /dev/null
@@ -1,68 +0,0 @@
-import numpy as np
-import os
-import pybullet as p
-import random
-from cliport.tasks import primitives
-from cliport.tasks.grippers import Spatula
-from cliport.tasks.task import Task
-from cliport.utils import utils
-import numpy as np
-from cliport.tasks.task import Task
-from cliport.utils import utils
-import pybullet as p
-
-class ColorCoordinatedCylinderPyramid(Task):
- """Construct a pyramid on a pallet using four cylinders of different colors (red, blue, green, and yellow)."""
-
- def __init__(self):
- super().__init__()
- self.max_steps = 12
- self.lang_template = "make the {row} row with {cylinder}"
- self.task_completed_desc = "done stacking cylinder pyramid."
- self.additional_reset()
-
- def reset(self, env):
- super().reset(env)
-
- # Add pallet.
- pallet_size = (0.15, 0.15, 0.005)
- pallet_urdf = 'pallet/pallet.urdf'
- pallet_pose = self.get_random_pose(env, pallet_size)
- env.add_object(pallet_urdf, pallet_pose, category='fixed')
-
- # Cylinder colors.
- colors = [
- utils.COLORS['red'], utils.COLORS['blue'], utils.COLORS['green'],
- utils.COLORS['yellow']
- ]
-
- # Add cylinders.
- # x, y, z dimensions for the asset size
- cylinder_size = (0.04, 0.04, 0.04)
- cylinder_urdf = 'cylinder/cylinder-template.urdf'
-
- cylinders = []
- for i in range(4):
- cylinder_pose = self.get_random_pose(env, cylinder_size)
- cylinder_id = env.add_object(cylinder_urdf, cylinder_pose, color=colors[i])
- cylinders.append(cylinder_id)
-
- # Associate placement locations for goals.
- place_pos = [(0, -0.05, 0.03), (0, 0.05, 0.03),
- (0, 0, 0.08), (0, 0, 0.13)]
- targs = [(utils.apply(pallet_pose, i), pallet_pose[1]) for i in place_pos]
-
- # Goal: cylinders are stacked in a pyramid (bottom row: red, blue).
- self.add_goal(objs=cylinders[:2], matches=np.ones((2, 2)), targ_poses=targs[:2], replace=False,
- rotations=True, metric='pose', params=None, step_max_reward=1 / 2, symmetries=[np.pi/2]*2,
- language_goal=self.lang_template.format(cylinder="the red and blue cylinders", row="bottom"))
-
- # Goal: cylinders are stacked in a pyramid (middle row: green).
- self.add_goal(objs=cylinders[2:3], matches=np.ones((1, 1)), targ_poses=targs[2:3], replace=False,
- rotations=True, metric='pose', params=None, step_max_reward=1 / 3, symmetries=[np.pi/2]*1,
- language_goal=self.lang_template.format(cylinder="the green cylinder", row="middle"))
-
- # Goal: cylinders are stacked in a pyramid (top row: yellow).
- self.add_goal(objs=cylinders[3:], matches=np.ones((1, 1)), targ_poses=targs[3:], replace=False,
- rotations=True, metric='pose', params=None, step_max_reward=1 / 4, symmetries=[np.pi/2]*1,
- language_goal=self.lang_template.format(cylinder="the yellow cylinder", row="top"))
\ No newline at end of file
diff --git a/spaces/Gen-Sim/Gen-Sim/gensim/run_simulation.py b/spaces/Gen-Sim/Gen-Sim/gensim/run_simulation.py
deleted file mode 100644
index 29f7e6f9fadfc7b1d8a941e8ab8f85c791c0adf2..0000000000000000000000000000000000000000
--- a/spaces/Gen-Sim/Gen-Sim/gensim/run_simulation.py
+++ /dev/null
@@ -1,50 +0,0 @@
-import numpy as np
-import os
-import hydra
-import random
-
-import re
-import openai
-import IPython
-import time
-import pybullet as p
-import traceback
-from datetime import datetime
-from pprint import pprint
-import cv2
-import re
-import random
-import json
-
-from gensim.agent import Agent
-from gensim.critic import Critic
-from gensim.sim_runner import SimulationRunner
-from gensim.memory import Memory
-from gensim.utils import set_gpt_model, clear_messages
-
-
-@hydra.main(config_path='../cliport/cfg', config_name='data', version_base="1.2")
-def main(cfg):
- openai.api_key = cfg['openai_key']
-
- model_time = datetime.now().strftime("%d_%m_%Y_%H:%M:%S")
- cfg['model_output_dir'] = os.path.join(cfg['output_folder'], cfg['prompt_folder'] + "_" + model_time)
- if 'seed' in cfg:
- cfg['model_output_dir'] = cfg['model_output_dir'] + f"_{cfg['seed']}"
-
- set_gpt_model(cfg['gpt_model'])
- memory = Memory(cfg)
- agent = Agent(cfg, memory)
- critic = Critic(cfg, memory)
- simulation_runner = SimulationRunner(cfg, agent, critic, memory)
-
- for trial_i in range(cfg['trials']):
- simulation_runner.task_creation()
- simulation_runner.simulate_task()
- simulation_runner.print_current_stats()
- # clear_messages()
-
- simulation_runner.save_stats()
-
-if __name__ == '__main__':
- main()
diff --git a/spaces/GeorgeOrville/bingo/tests/kblob.ts b/spaces/GeorgeOrville/bingo/tests/kblob.ts
deleted file mode 100644
index 9e15b41c1c94a690beb61b23cdb42fc78767ccd2..0000000000000000000000000000000000000000
--- a/spaces/GeorgeOrville/bingo/tests/kblob.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import FormData from 'form-data'
-
-import { fetch } from '@/lib/isomorphic'
-
-const formData = new FormData()
-
-const knowledgeRequest = {"imageInfo":{"url":"https://www.baidu.com/img/PCfb_5bf082d29588c07f842ccde3f97243ea.png"},"knowledgeRequest":{"invokedSkills":["ImageById"],"subscriptionId":"Bing.Chat.Multimodal","invokedSkillsRequestData":{"enableFaceBlur":true},"convoData":{"convoid":"51D|BingProdUnAuthenticatedUsers|E3DCA904FF236C67C3450163BCEC64CFF3F618CC8A4AFD75FD518F5ED0ADA080","convotone":"Creative"}}}
-
-formData.append('knowledgeRequest', JSON.stringify(knowledgeRequest))
-
-
-fetch('https://bing.vcanbb.top/images/kblob',
- {
- method: 'POST',
- body: formData.getBuffer(),
- headers: {
- "sec-ch-ua": "\"Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"115\", \"Chromium\";v=\"115\"",
- "sec-ch-ua-mobile": "?0",
- "sec-ch-ua-platform": "\"Windows\"",
- "Referer": "https://bing.vcanbb.top/web/index.html",
- "Referrer-Policy": "origin-when-cross-origin",
- ...formData.getHeaders()
- }
-
- }
-).then(res => res.text())
-.then(res => console.log('res', res))
diff --git a/spaces/Gradio-Blocks/protGPT2_gradioFold/alphafold/alphafold/relax/relax.py b/spaces/Gradio-Blocks/protGPT2_gradioFold/alphafold/alphafold/relax/relax.py
deleted file mode 100644
index f7af5856dc03b714d9a3566d0d393729c57c0522..0000000000000000000000000000000000000000
--- a/spaces/Gradio-Blocks/protGPT2_gradioFold/alphafold/alphafold/relax/relax.py
+++ /dev/null
@@ -1,80 +0,0 @@
-# Copyright 2021 DeepMind Technologies Limited
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""Amber relaxation."""
-from typing import Any, Dict, Sequence, Tuple
-from alphafold.common import protein
-from alphafold.relax import amber_minimize
-from alphafold.relax import utils
-import numpy as np
-
-
-class AmberRelaxation(object):
- """Amber relaxation."""
-
- def __init__(self,
- *,
- max_iterations: int,
- tolerance: float,
- stiffness: float,
- exclude_residues: Sequence[int],
- max_outer_iterations: int):
- """Initialize Amber Relaxer.
-
- Args:
- max_iterations: Maximum number of L-BFGS iterations. 0 means no max.
- tolerance: kcal/mol, the energy tolerance of L-BFGS.
- stiffness: kcal/mol A**2, spring constant of heavy atom restraining
- potential.
- exclude_residues: Residues to exclude from per-atom restraining.
- Zero-indexed.
- max_outer_iterations: Maximum number of violation-informed relax
- iterations. A value of 1 will run the non-iterative procedure used in
- CASP14. Use 20 so that >95% of the bad cases are relaxed. Relax finishes
- as soon as there are no violations, hence in most cases this causes no
- slowdown. In the worst case we do 20 outer iterations.
- """
-
- self._max_iterations = max_iterations
- self._tolerance = tolerance
- self._stiffness = stiffness
- self._exclude_residues = exclude_residues
- self._max_outer_iterations = max_outer_iterations
-
- def process(self, *,
- prot: protein.Protein) -> Tuple[str, Dict[str, Any], np.ndarray]:
- """Runs Amber relax on a prediction, adds hydrogens, returns PDB string."""
- out = amber_minimize.run_pipeline(
- prot=prot, max_iterations=self._max_iterations,
- tolerance=self._tolerance, stiffness=self._stiffness,
- exclude_residues=self._exclude_residues,
- max_outer_iterations=self._max_outer_iterations)
- min_pos = out['pos']
- start_pos = out['posinit']
- rmsd = np.sqrt(np.sum((start_pos - min_pos)**2) / start_pos.shape[0])
- debug_data = {
- 'initial_energy': out['einit'],
- 'final_energy': out['efinal'],
- 'attempts': out['min_attempts'],
- 'rmsd': rmsd
- }
- pdb_str = amber_minimize.clean_protein(prot)
- min_pdb = utils.overwrite_pdb_coordinates(pdb_str, min_pos)
- min_pdb = utils.overwrite_b_factors(min_pdb, prot.b_factors)
- utils.assert_equal_nonterminal_atom_types(
- protein.from_pdb_string(min_pdb).atom_mask,
- prot.atom_mask)
- violations = out['structural_violations'][
- 'total_per_residue_violations_mask']
- return min_pdb, debug_data, violations
diff --git a/spaces/Gradio-Blocks/uniformer_image_detection/configs/ssd/README.md b/spaces/Gradio-Blocks/uniformer_image_detection/configs/ssd/README.md
deleted file mode 100644
index 51262d68efa1e8be0e91e92c2c3dc5585ab2411e..0000000000000000000000000000000000000000
--- a/spaces/Gradio-Blocks/uniformer_image_detection/configs/ssd/README.md
+++ /dev/null
@@ -1,21 +0,0 @@
-# SSD: Single Shot MultiBox Detector
-
-## Introduction
-
-[ALGORITHM]
-
-```latex
-@article{Liu_2016,
- title={SSD: Single Shot MultiBox Detector},
- journal={ECCV},
- author={Liu, Wei and Anguelov, Dragomir and Erhan, Dumitru and Szegedy, Christian and Reed, Scott and Fu, Cheng-Yang and Berg, Alexander C.},
- year={2016},
-}
-```
-
-## Results and models
-
-| Backbone | Size | Style | Lr schd | Mem (GB) | Inf time (fps) | box AP | Config | Download |
-| :------: | :---: | :---: | :-----: | :------: | :------------: | :----: | :------: | :--------: |
-| VGG16 | 300 | caffe | 120e | 10.2 | 43.7 | 25.6 | [config](https://github.com/open-mmlab/mmdetection/tree/master/configs/ssd/ssd300_coco.py) | [model](http://download.openmmlab.com/mmdetection/v2.0/ssd/ssd300_coco/ssd300_coco_20200307-a92d2092.pth) | [log](http://download.openmmlab.com/mmdetection/v2.0/ssd/ssd300_coco/ssd300_coco_20200307_174216.log.json) |
-| VGG16 | 512 | caffe | 120e | 9.3 | 30.7 | 29.4 | [config](https://github.com/open-mmlab/mmdetection/tree/master/configs/ssd/ssd512_coco.py) | [model](http://download.openmmlab.com/mmdetection/v2.0/ssd/ssd512_coco/ssd512_coco_20200308-038c5591.pth) | [log](http://download.openmmlab.com/mmdetection/v2.0/ssd/ssd512_coco/ssd512_coco_20200308_134447.log.json) |
diff --git a/spaces/Gradio-Blocks/uniformer_image_detection/configs/yolact/yolact_r50_1x8_coco.py b/spaces/Gradio-Blocks/uniformer_image_detection/configs/yolact/yolact_r50_1x8_coco.py
deleted file mode 100644
index d0e5ace280e1377ce4bb772df7e132427143bf34..0000000000000000000000000000000000000000
--- a/spaces/Gradio-Blocks/uniformer_image_detection/configs/yolact/yolact_r50_1x8_coco.py
+++ /dev/null
@@ -1,160 +0,0 @@
-_base_ = '../_base_/default_runtime.py'
-
-# model settings
-img_size = 550
-model = dict(
- type='YOLACT',
- pretrained='torchvision://resnet50',
- backbone=dict(
- type='ResNet',
- depth=50,
- num_stages=4,
- out_indices=(0, 1, 2, 3),
- frozen_stages=-1, # do not freeze stem
- norm_cfg=dict(type='BN', requires_grad=True),
- norm_eval=False, # update the statistics of bn
- zero_init_residual=False,
- style='pytorch'),
- neck=dict(
- type='FPN',
- in_channels=[256, 512, 1024, 2048],
- out_channels=256,
- start_level=1,
- add_extra_convs='on_input',
- num_outs=5,
- upsample_cfg=dict(mode='bilinear')),
- bbox_head=dict(
- type='YOLACTHead',
- num_classes=80,
- in_channels=256,
- feat_channels=256,
- anchor_generator=dict(
- type='AnchorGenerator',
- octave_base_scale=3,
- scales_per_octave=1,
- base_sizes=[8, 16, 32, 64, 128],
- ratios=[0.5, 1.0, 2.0],
- strides=[550.0 / x for x in [69, 35, 18, 9, 5]],
- centers=[(550 * 0.5 / x, 550 * 0.5 / x)
- for x in [69, 35, 18, 9, 5]]),
- bbox_coder=dict(
- type='DeltaXYWHBBoxCoder',
- target_means=[.0, .0, .0, .0],
- target_stds=[0.1, 0.1, 0.2, 0.2]),
- loss_cls=dict(
- type='CrossEntropyLoss',
- use_sigmoid=False,
- reduction='none',
- loss_weight=1.0),
- loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.5),
- num_head_convs=1,
- num_protos=32,
- use_ohem=True),
- mask_head=dict(
- type='YOLACTProtonet',
- in_channels=256,
- num_protos=32,
- num_classes=80,
- max_masks_to_train=100,
- loss_mask_weight=6.125),
- segm_head=dict(
- type='YOLACTSegmHead',
- num_classes=80,
- in_channels=256,
- loss_segm=dict(
- type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0)),
- # training and testing settings
- train_cfg=dict(
- assigner=dict(
- type='MaxIoUAssigner',
- pos_iou_thr=0.5,
- neg_iou_thr=0.4,
- min_pos_iou=0.,
- ignore_iof_thr=-1,
- gt_max_assign_all=False),
- # smoothl1_beta=1.,
- allowed_border=-1,
- pos_weight=-1,
- neg_pos_ratio=3,
- debug=False),
- test_cfg=dict(
- nms_pre=1000,
- min_bbox_size=0,
- score_thr=0.05,
- iou_thr=0.5,
- top_k=200,
- max_per_img=100))
-# dataset settings
-dataset_type = 'CocoDataset'
-data_root = 'data/coco/'
-img_norm_cfg = dict(
- mean=[123.68, 116.78, 103.94], std=[58.40, 57.12, 57.38], to_rgb=True)
-train_pipeline = [
- dict(type='LoadImageFromFile', to_float32=True),
- dict(type='LoadAnnotations', with_bbox=True, with_mask=True),
- dict(type='FilterAnnotations', min_gt_bbox_wh=(4.0, 4.0)),
- dict(
- type='PhotoMetricDistortion',
- brightness_delta=32,
- contrast_range=(0.5, 1.5),
- saturation_range=(0.5, 1.5),
- hue_delta=18),
- dict(
- type='Expand',
- mean=img_norm_cfg['mean'],
- to_rgb=img_norm_cfg['to_rgb'],
- ratio_range=(1, 4)),
- dict(
- type='MinIoURandomCrop',
- min_ious=(0.1, 0.3, 0.5, 0.7, 0.9),
- min_crop_size=0.3),
- dict(type='Resize', img_scale=(img_size, img_size), keep_ratio=False),
- dict(type='Normalize', **img_norm_cfg),
- dict(type='RandomFlip', flip_ratio=0.5),
- dict(type='DefaultFormatBundle'),
- dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels', 'gt_masks']),
-]
-test_pipeline = [
- dict(type='LoadImageFromFile'),
- dict(
- type='MultiScaleFlipAug',
- img_scale=(img_size, img_size),
- flip=False,
- transforms=[
- dict(type='Resize', keep_ratio=False),
- dict(type='Normalize', **img_norm_cfg),
- dict(type='ImageToTensor', keys=['img']),
- dict(type='Collect', keys=['img']),
- ])
-]
-data = dict(
- samples_per_gpu=8,
- workers_per_gpu=4,
- train=dict(
- type=dataset_type,
- ann_file=data_root + 'annotations/instances_train2017.json',
- img_prefix=data_root + 'train2017/',
- pipeline=train_pipeline),
- val=dict(
- type=dataset_type,
- ann_file=data_root + 'annotations/instances_val2017.json',
- img_prefix=data_root + 'val2017/',
- pipeline=test_pipeline),
- test=dict(
- type=dataset_type,
- ann_file=data_root + 'annotations/instances_val2017.json',
- img_prefix=data_root + 'val2017/',
- pipeline=test_pipeline))
-# optimizer
-optimizer = dict(type='SGD', lr=1e-3, momentum=0.9, weight_decay=5e-4)
-optimizer_config = dict()
-# learning policy
-lr_config = dict(
- policy='step',
- warmup='linear',
- warmup_iters=500,
- warmup_ratio=0.1,
- step=[20, 42, 49, 52])
-runner = dict(type='EpochBasedRunner', max_epochs=55)
-cudnn_benchmark = True
-evaluation = dict(metric=['bbox', 'segm'])
diff --git a/spaces/Gradio-Blocks/uniformer_image_detection/mmdet/models/losses/balanced_l1_loss.py b/spaces/Gradio-Blocks/uniformer_image_detection/mmdet/models/losses/balanced_l1_loss.py
deleted file mode 100644
index 7bcd13ff26dbdc9f6eff8d7c7b5bde742a8d7d1d..0000000000000000000000000000000000000000
--- a/spaces/Gradio-Blocks/uniformer_image_detection/mmdet/models/losses/balanced_l1_loss.py
+++ /dev/null
@@ -1,120 +0,0 @@
-import mmcv
-import numpy as np
-import torch
-import torch.nn as nn
-
-from ..builder import LOSSES
-from .utils import weighted_loss
-
-
-@mmcv.jit(derivate=True, coderize=True)
-@weighted_loss
-def balanced_l1_loss(pred,
- target,
- beta=1.0,
- alpha=0.5,
- gamma=1.5,
- reduction='mean'):
- """Calculate balanced L1 loss.
-
- Please see the `Libra R-CNN `_
-
- Args:
- pred (torch.Tensor): The prediction with shape (N, 4).
- target (torch.Tensor): The learning target of the prediction with
- shape (N, 4).
- beta (float): The loss is a piecewise function of prediction and target
- and ``beta`` serves as a threshold for the difference between the
- prediction and target. Defaults to 1.0.
- alpha (float): The denominator ``alpha`` in the balanced L1 loss.
- Defaults to 0.5.
- gamma (float): The ``gamma`` in the balanced L1 loss.
- Defaults to 1.5.
- reduction (str, optional): The method that reduces the loss to a
- scalar. Options are "none", "mean" and "sum".
-
- Returns:
- torch.Tensor: The calculated loss
- """
- assert beta > 0
- assert pred.size() == target.size() and target.numel() > 0
-
- diff = torch.abs(pred - target)
- b = np.e**(gamma / alpha) - 1
- loss = torch.where(
- diff < beta, alpha / b *
- (b * diff + 1) * torch.log(b * diff / beta + 1) - alpha * diff,
- gamma * diff + gamma / b - alpha * beta)
-
- return loss
-
-
-@LOSSES.register_module()
-class BalancedL1Loss(nn.Module):
- """Balanced L1 Loss.
-
- arXiv: https://arxiv.org/pdf/1904.02701.pdf (CVPR 2019)
-
- Args:
- alpha (float): The denominator ``alpha`` in the balanced L1 loss.
- Defaults to 0.5.
- gamma (float): The ``gamma`` in the balanced L1 loss. Defaults to 1.5.
- beta (float, optional): The loss is a piecewise function of prediction
- and target. ``beta`` serves as a threshold for the difference
- between the prediction and target. Defaults to 1.0.
- reduction (str, optional): The method that reduces the loss to a
- scalar. Options are "none", "mean" and "sum".
- loss_weight (float, optional): The weight of the loss. Defaults to 1.0
- """
-
- def __init__(self,
- alpha=0.5,
- gamma=1.5,
- beta=1.0,
- reduction='mean',
- loss_weight=1.0):
- super(BalancedL1Loss, self).__init__()
- self.alpha = alpha
- self.gamma = gamma
- self.beta = beta
- self.reduction = reduction
- self.loss_weight = loss_weight
-
- def forward(self,
- pred,
- target,
- weight=None,
- avg_factor=None,
- reduction_override=None,
- **kwargs):
- """Forward function of loss.
-
- Args:
- pred (torch.Tensor): The prediction with shape (N, 4).
- target (torch.Tensor): The learning target of the prediction with
- shape (N, 4).
- weight (torch.Tensor, optional): Sample-wise loss weight with
- shape (N, ).
- avg_factor (int, optional): Average factor that is used to average
- the loss. Defaults to None.
- reduction_override (str, optional): The reduction method used to
- override the original reduction method of the loss.
- Options are "none", "mean" and "sum".
-
- Returns:
- torch.Tensor: The calculated loss
- """
- assert reduction_override in (None, 'none', 'mean', 'sum')
- reduction = (
- reduction_override if reduction_override else self.reduction)
- loss_bbox = self.loss_weight * balanced_l1_loss(
- pred,
- target,
- weight,
- alpha=self.alpha,
- gamma=self.gamma,
- beta=self.beta,
- reduction=reduction,
- avg_factor=avg_factor,
- **kwargs)
- return loss_bbox
diff --git a/spaces/Gradio-Blocks/uniformer_image_segmentation/configs/ocrnet/ocrnet_hr18s_512x512_20k_voc12aug.py b/spaces/Gradio-Blocks/uniformer_image_segmentation/configs/ocrnet/ocrnet_hr18s_512x512_20k_voc12aug.py
deleted file mode 100644
index ceb944815b5a979ddb72015295375f6fe0c31a89..0000000000000000000000000000000000000000
--- a/spaces/Gradio-Blocks/uniformer_image_segmentation/configs/ocrnet/ocrnet_hr18s_512x512_20k_voc12aug.py
+++ /dev/null
@@ -1,9 +0,0 @@
-_base_ = './ocrnet_hr18_512x512_20k_voc12aug.py'
-model = dict(
- pretrained='open-mmlab://msra/hrnetv2_w18_small',
- backbone=dict(
- extra=dict(
- stage1=dict(num_blocks=(2, )),
- stage2=dict(num_blocks=(2, 2)),
- stage3=dict(num_modules=3, num_blocks=(2, 2, 2)),
- stage4=dict(num_modules=2, num_blocks=(2, 2, 2, 2)))))
diff --git a/spaces/GrandaddyShmax/AudioCraft_Plus/audiocraft/losses/stftloss.py b/spaces/GrandaddyShmax/AudioCraft_Plus/audiocraft/losses/stftloss.py
deleted file mode 100644
index 5ad4b7d3324ee5b0e6064b6f71cf8caf0fdc3be7..0000000000000000000000000000000000000000
--- a/spaces/GrandaddyShmax/AudioCraft_Plus/audiocraft/losses/stftloss.py
+++ /dev/null
@@ -1,207 +0,0 @@
-# Copyright (c) Meta Platforms, Inc. and affiliates.
-# All rights reserved.
-#
-# This source code is licensed under the license found in the
-# LICENSE file in the root directory of this source tree.
-# Adapted from MIT code under the original license
-# Copyright 2019 Tomoki Hayashi
-# MIT License (https://opensource.org/licenses/MIT)
-import typing as tp
-
-import torch
-from torch import nn
-from torch.nn import functional as F
-
-
-# TODO: Replace with torchaudio.STFT?
-def _stft(x: torch.Tensor, fft_size: int, hop_length: int, win_length: int,
- window: tp.Optional[torch.Tensor], normalized: bool) -> torch.Tensor:
- """Perform STFT and convert to magnitude spectrogram.
-
- Args:
- x: Input signal tensor (B, C, T).
- fft_size (int): FFT size.
- hop_length (int): Hop size.
- win_length (int): Window length.
- window (torch.Tensor or None): Window function type.
- normalized (bool): Whether to normalize the STFT or not.
-
- Returns:
- torch.Tensor: Magnitude spectrogram (B, C, #frames, fft_size // 2 + 1).
- """
- B, C, T = x.shape
- x_stft = torch.stft(
- x.view(-1, T), fft_size, hop_length, win_length, window,
- normalized=normalized, return_complex=True,
- )
- x_stft = x_stft.view(B, C, *x_stft.shape[1:])
- real = x_stft.real
- imag = x_stft.imag
-
- # NOTE(kan-bayashi): clamp is needed to avoid nan or inf
- return torch.sqrt(torch.clamp(real ** 2 + imag ** 2, min=1e-7)).transpose(2, 1)
-
-
-class SpectralConvergenceLoss(nn.Module):
- """Spectral convergence loss.
- """
- def __init__(self, epsilon: float = torch.finfo(torch.float32).eps):
- super().__init__()
- self.epsilon = epsilon
-
- def forward(self, x_mag: torch.Tensor, y_mag: torch.Tensor):
- """Calculate forward propagation.
-
- Args:
- x_mag: Magnitude spectrogram of predicted signal (B, #frames, #freq_bins).
- y_mag: Magnitude spectrogram of groundtruth signal (B, #frames, #freq_bins).
- Returns:
- torch.Tensor: Spectral convergence loss value.
- """
- return torch.norm(y_mag - x_mag, p="fro") / (torch.norm(y_mag, p="fro") + self.epsilon)
-
-
-class LogSTFTMagnitudeLoss(nn.Module):
- """Log STFT magnitude loss.
-
- Args:
- epsilon (float): Epsilon value for numerical stability.
- """
- def __init__(self, epsilon: float = torch.finfo(torch.float32).eps):
- super().__init__()
- self.epsilon = epsilon
-
- def forward(self, x_mag: torch.Tensor, y_mag: torch.Tensor):
- """Calculate forward propagation.
-
- Args:
- x_mag (torch.Tensor): Magnitude spectrogram of predicted signal (B, #frames, #freq_bins).
- y_mag (torch.Tensor): Magnitude spectrogram of groundtruth signal (B, #frames, #freq_bins).
- Returns:
- torch.Tensor: Log STFT magnitude loss value.
- """
- return F.l1_loss(torch.log(self.epsilon + y_mag), torch.log(self.epsilon + x_mag))
-
-
-class STFTLosses(nn.Module):
- """STFT losses.
-
- Args:
- n_fft (int): Size of FFT.
- hop_length (int): Hop length.
- win_length (int): Window length.
- window (str): Window function type.
- normalized (bool): Whether to use normalized STFT or not.
- epsilon (float): Epsilon for numerical stability.
- """
- def __init__(self, n_fft: int = 1024, hop_length: int = 120, win_length: int = 600,
- window: str = "hann_window", normalized: bool = False,
- epsilon: float = torch.finfo(torch.float32).eps):
- super().__init__()
- self.n_fft = n_fft
- self.hop_length = hop_length
- self.win_length = win_length
- self.normalized = normalized
- self.register_buffer("window", getattr(torch, window)(win_length))
- self.spectral_convergenge_loss = SpectralConvergenceLoss(epsilon)
- self.log_stft_magnitude_loss = LogSTFTMagnitudeLoss(epsilon)
-
- def forward(self, x: torch.Tensor, y: torch.Tensor) -> tp.Tuple[torch.Tensor, torch.Tensor]:
- """Calculate forward propagation.
-
- Args:
- x (torch.Tensor): Predicted signal (B, T).
- y (torch.Tensor): Groundtruth signal (B, T).
- Returns:
- torch.Tensor: Spectral convergence loss value.
- torch.Tensor: Log STFT magnitude loss value.
- """
- x_mag = _stft(x, self.n_fft, self.hop_length,
- self.win_length, self.window, self.normalized) # type: ignore
- y_mag = _stft(y, self.n_fft, self.hop_length,
- self.win_length, self.window, self.normalized) # type: ignore
- sc_loss = self.spectral_convergenge_loss(x_mag, y_mag)
- mag_loss = self.log_stft_magnitude_loss(x_mag, y_mag)
-
- return sc_loss, mag_loss
-
-
-class STFTLoss(nn.Module):
- """Single Resolution STFT loss.
-
- Args:
- n_fft (int): Nb of FFT.
- hop_length (int): Hop length.
- win_length (int): Window length.
- window (str): Window function type.
- normalized (bool): Whether to use normalized STFT or not.
- epsilon (float): Epsilon for numerical stability.
- factor_sc (float): Coefficient for the spectral loss.
- factor_mag (float): Coefficient for the magnitude loss.
- """
- def __init__(self, n_fft: int = 1024, hop_length: int = 120, win_length: int = 600,
- window: str = "hann_window", normalized: bool = False,
- factor_sc: float = 0.1, factor_mag: float = 0.1,
- epsilon: float = torch.finfo(torch.float32).eps):
- super().__init__()
- self.loss = STFTLosses(n_fft, hop_length, win_length, window, normalized, epsilon)
- self.factor_sc = factor_sc
- self.factor_mag = factor_mag
-
- def forward(self, x: torch.Tensor, y: torch.Tensor) -> tp.Tuple[torch.Tensor, torch.Tensor]:
- """Calculate forward propagation.
-
- Args:
- x (torch.Tensor): Predicted signal (B, T).
- y (torch.Tensor): Groundtruth signal (B, T).
- Returns:
- torch.Tensor: Single resolution STFT loss.
- """
- sc_loss, mag_loss = self.loss(x, y)
- return self.factor_sc * sc_loss + self.factor_mag * mag_loss
-
-
-class MRSTFTLoss(nn.Module):
- """Multi resolution STFT loss.
-
- Args:
- n_ffts (Sequence[int]): Sequence of FFT sizes.
- hop_lengths (Sequence[int]): Sequence of hop sizes.
- win_lengths (Sequence[int]): Sequence of window lengths.
- window (str): Window function type.
- factor_sc (float): Coefficient for the spectral loss.
- factor_mag (float): Coefficient for the magnitude loss.
- normalized (bool): Whether to use normalized STFT or not.
- epsilon (float): Epsilon for numerical stability.
- """
- def __init__(self, n_ffts: tp.Sequence[int] = [1024, 2048, 512], hop_lengths: tp.Sequence[int] = [120, 240, 50],
- win_lengths: tp.Sequence[int] = [600, 1200, 240], window: str = "hann_window",
- factor_sc: float = 0.1, factor_mag: float = 0.1,
- normalized: bool = False, epsilon: float = torch.finfo(torch.float32).eps):
- super().__init__()
- assert len(n_ffts) == len(hop_lengths) == len(win_lengths)
- self.stft_losses = torch.nn.ModuleList()
- for fs, ss, wl in zip(n_ffts, hop_lengths, win_lengths):
- self.stft_losses += [STFTLosses(fs, ss, wl, window, normalized, epsilon)]
- self.factor_sc = factor_sc
- self.factor_mag = factor_mag
-
- def forward(self, x: torch.Tensor, y: torch.Tensor) -> torch.Tensor:
- """Calculate forward propagation.
-
- Args:
- x (torch.Tensor): Predicted signal (B, T).
- y (torch.Tensor): Groundtruth signal (B, T).
- Returns:
- torch.Tensor: Multi resolution STFT loss.
- """
- sc_loss = torch.Tensor([0.0])
- mag_loss = torch.Tensor([0.0])
- for f in self.stft_losses:
- sc_l, mag_l = f(x, y)
- sc_loss += sc_l
- mag_loss += mag_l
- sc_loss /= len(self.stft_losses)
- mag_loss /= len(self.stft_losses)
-
- return self.factor_sc * sc_loss + self.factor_mag * mag_loss
diff --git a/spaces/GroveStreet/GTA_SOVITS/README.md b/spaces/GroveStreet/GTA_SOVITS/README.md
deleted file mode 100644
index 7e4436da629a4e5f6aeecfab4f6dddf2dc309798..0000000000000000000000000000000000000000
--- a/spaces/GroveStreet/GTA_SOVITS/README.md
+++ /dev/null
@@ -1,16 +0,0 @@
----
-title: Sovits Models
-emoji: 🎙️
-colorFrom: gray
-colorTo: pink
-sdk: gradio
-sdk_version: 3.18.0
-app_file: app.py
-pinned: false
-license: mit
----
-
-我是一个菜鸡,推理界面设计参考了大佬。
-
-**但是使用此处的模型务必注明出处(即本人:B站Cyber蝈蝈总),这是孩子唯一的愿望。**
-
diff --git a/spaces/HarryLee/eCommerceImageCaptioning/fairseq/examples/pay_less_attention_paper/README.md b/spaces/HarryLee/eCommerceImageCaptioning/fairseq/examples/pay_less_attention_paper/README.md
deleted file mode 100644
index 5adab11f4dc3461f9e7126ac391b04e703616e6b..0000000000000000000000000000000000000000
--- a/spaces/HarryLee/eCommerceImageCaptioning/fairseq/examples/pay_less_attention_paper/README.md
+++ /dev/null
@@ -1,176 +0,0 @@
-# Pay Less Attention with Lightweight and Dynamic Convolutions (Wu et al., 2019)
-
-This page contains pointers to pre-trained models as well as instructions on how to train new models for [our paper](https://arxiv.org/abs/1901.10430).
-
-## Citation:
-```bibtex
-@inproceedings{wu2018pay,
- title = {Pay Less Attention with Lightweight and Dynamic Convolutions},
- author = {Felix Wu and Angela Fan and Alexei Baevski and Yann Dauphin and Michael Auli},
- booktitle = {International Conference on Learning Representations},
- year = {2019},
- url = {https://arxiv.org/abs/1901.10430},
-}
-```
-
-## Translation
-
-### Pre-trained models
-For some datasets we release models without GLUs which are faster at inference.
-
-Model | Description | Dataset | Download
----|---|---|---
-`lightconv.no_glu.iwslt14.de-en` | LightConv (without GLUs) | [IWSLT14 German-English](https://wit3.fbk.eu/archive/2014-01/texts/de/en/de-en.tgz) | model:
[download (.tar.gz)](https://dl.fbaipublicfiles.com/fairseq/models/dynamicconv/iwslt14.de-en.lightconv.tar.gz)
IWSLT14 test:
[download (.tar.bz2)](https://dl.fbaipublicfiles.com/fairseq/data/iwslt14.de-en.test.tar.bz2)
-`dynamicconv.no_glu.iwslt14.de-en` | DynamicConv (without GLUs) | [IWSLT14 German-English](https://wit3.fbk.eu/archive/2014-01/texts/de/en/de-en.tgz) | model:
[download (.tar.gz)](https://dl.fbaipublicfiles.com/fairseq/models/dynamicconv/iwslt14.de-en.dynamicconv.tar.gz)
IWSLT14 test:
[download (.tar.bz2)](https://dl.fbaipublicfiles.com/fairseq/data/iwslt14.de-en.test.tar.bz2)
-`lightconv.no_glu.wmt16.en-de` | LightConv (without GLUs) | [WMT16 English-German](https://drive.google.com/uc?export=download&id=0B_bZck-ksdkpM25jRUN2X2UxMm8) | model:
[download (.tar.gz)](https://dl.fbaipublicfiles.com/fairseq/models/dynamicconv/wmt16.en-de.joined-dict.lightconv.tar.gz)
newstest2014 (shared vocab):
[download (.tar.bz2)](https://dl.fbaipublicfiles.com/fairseq/data/wmt16.en-de.joined-dict.newstest2014.tar.bz2)
-`dynamicconv.no_glu.wmt16.en-de` | DynamicConv (without GLUs) | [WMT16 English-German](https://drive.google.com/uc?export=download&id=0B_bZck-ksdkpM25jRUN2X2UxMm8) | model:
[download (.tar.gz)](https://dl.fbaipublicfiles.com/fairseq/models/dynamicconv/wmt16.en-de.joined-dict.dynamicconv.tar.gz)
newstest2014 (shared vocab):
[download (.tar.bz2)](https://dl.fbaipublicfiles.com/fairseq/data/wmt16.en-de.joined-dict.newstest2014.tar.bz2)
-`lightconv.glu.wmt16.en-de` | LightConv | [WMT16 English-German](https://drive.google.com/uc?export=download&id=0B_bZck-ksdkpM25jRUN2X2UxMm8) | model:
[download (.tar.gz)](https://dl.fbaipublicfiles.com/fairseq/models/dynamicconv/wmt16.en-de.joined-dict.lightconv-glu.tar.gz)
newstest2014 (shared vocab):
[download (.tar.bz2)](https://dl.fbaipublicfiles.com/fairseq/data/wmt16.en-de.joined-dict.newstest2014.tar.bz2)
-`dynamicconv.glu.wmt16.en-de` | DynamicConv | [WMT16 English-German](https://drive.google.com/uc?export=download&id=0B_bZck-ksdkpM25jRUN2X2UxMm8) | model:
[download (.tar.gz)](https://dl.fbaipublicfiles.com/fairseq/models/dynamicconv/wmt16.en-de.joined-dict.dynamicconv-glu.tar.gz)
newstest2014 (shared vocab):
[download (.tar.bz2)](https://dl.fbaipublicfiles.com/fairseq/data/wmt16.en-de.joined-dict.newstest2014.tar.bz2)
-`lightconv.glu.wmt14.en-fr` | LightConv | [WMT14 English-French](http://statmt.org/wmt14/translation-task.html#Download) | model:
[download (.tar.gz)](https://dl.fbaipublicfiles.com/fairseq/models/dynamicconv/wmt14.en-fr.joined-dict.lightconv-glu.tar.gz)
newstest2014:
[download (.tar.bz2)](https://dl.fbaipublicfiles.com/fairseq/data/wmt14.en-fr.joined-dict.newstest2014.tar.bz2)
-`dynamicconv.glu.wmt14.en-fr` | DynamicConv | [WMT14 English-French](http://statmt.org/wmt14/translation-task.html#Download) | model:
[download (.tar.gz)](https://dl.fbaipublicfiles.com/fairseq/models/dynamicconv/wmt14.en-fr.joined-dict.dynamicconv-glu.tar.gz)
newstest2014:
[download (.tar.bz2)](https://dl.fbaipublicfiles.com/fairseq/data/wmt14.en-fr.joined-dict.newstest2014.tar.bz2)
-`lightconv.glu.wmt17.zh-en` | LightConv | [WMT17 Chinese-English](http://statmt.org/wmt17/translation-task.html#Download) | model:
[download (.tar.gz)](https://dl.fbaipublicfiles.com/fairseq/models/dynamicconv/wmt17.zh-en.lightconv-glu.tar.gz)
newstest2017:
[download (.tar.bz2)](https://dl.fbaipublicfiles.com/fairseq/data/wmt17.zh-en.newstest2017.tar.bz2)
-`dynamicconv.glu.wmt17.zh-en` | DynamicConv | [WMT17 Chinese-English](http://statmt.org/wmt17/translation-task.html#Download) | model:
[download (.tar.gz)](https://dl.fbaipublicfiles.com/fairseq/models/dynamicconv/wmt17.zh-en.dynamicconv-glu.tar.gz)
newstest2017:
[download (.tar.bz2)](https://dl.fbaipublicfiles.com/fairseq/data/wmt17.zh-en.newstest2017.tar.bz2)
-
-### Memory-Efficient CUDA Kernels
-
-Since the PyTorch implementations of Light/Dynamic conv are quite memory intensive, we have developed CUDA kernels that implement the light and dynamic convolution operator in a memory-efficient and performant manner. For large sequence lengths, these kernels save about 50% memory compared to the PyTorch equivalent.
-
-To install the kernels, use the commands below. Once installed, they will automatically be used in place of the PyTorch implementations whenever a light or dynamic convolution is used.
-
-```sh
-# to install lightconv
-cd fairseq/modules/lightconv_layer
-python cuda_function_gen.py
-python setup.py install
-
-# to install dynamicconv
-cd fairseq/modules/dynamicconv_layer
-python cuda_function_gen.py
-python setup.py install
-```
-
-### Example usage (torch.hub)
-
-We require a few additional Python dependencies for preprocessing:
-```bash
-pip install sacremoses subword_nmt
-```
-
-Interactive translation via PyTorch Hub:
-```python
-import torch
-
-# List available models
-torch.hub.list('pytorch/fairseq') # [..., 'lightconv.glu.wmt17.zh-en', ... ]
-
-# Load a transformer trained on WMT'16 En-De
-zh2en = torch.hub.load('pytorch/fairseq', 'lightconv.glu.wmt17.zh-en', tokenizer='moses', bpe='subword_nmt')
-
-# The underlying model is available under the *models* attribute
-assert isinstance(zh2en.models[0], fairseq.models.lightconv.LightConvModel)
-
-# Translate a sentence
-zh2en.translate('你好 世界')
-# 'Hello World'
-```
-
-Loading custom models:
-```python
-from fairseq.models.lightconv import LightConvModel
-en2fr = LightConvModel.from_pretrained(
- '/path/to/checkpoints',
- checkpoint_file='checkpoint_best.pt',
- data_name_or_path='data-bin/wmt14_en_fr',
- bpe='subword_nmt',
- bpe_codes='data-bin/wmt14_en_fr/en.code'
-)
-en2fr.translate('Hello world!')
-# 'Bonjour le monde'
-```
-
-### Preprocessing the training datasets
-
-Please follow the instructions in [`examples/translation/README.md`](../translation/README.md) to preprocess the data.
-
-### Training and evaluation options:
-To use the model without GLU, please set `--encoder-glu 0 --decoder-glu 0`.
-For LightConv, please use `--encoder-conv-type lightweight --decoder-conv-type lightweight`, otherwise the default is DynamicConv.
-For best BLEU results, lenpen may need to be manually tuned.
-
-To use the CUDA kernels, first install the PyTorch modules using the commands
-above. Once the CUDA modules are installed, they will automatically be used
-instead of the PyTorch modules.
-
-### IWSLT14 De-En
-Training and evaluating DynamicConv (without GLU) on a GPU:
-```sh
-# Training
-SAVE="save/dynamic_conv_iwslt"
-mkdir -p $SAVE
-CUDA_VISIBLE_DEVICES=0 $(which fairseq-train) data-bin/iwslt14.tokenized.de-en \
- --clip-norm 0 --optimizer adam --lr 0.0005 \
- --source-lang de --target-lang en --max-tokens 4000 --no-progress-bar \
- --log-interval 100 --stop-min-lr '1e-09' --weight-decay 0.0001 \
- --criterion label_smoothed_cross_entropy --label-smoothing 0.1 \
- --lr-scheduler inverse_sqrt \
- --ddp-backend=legacy_ddp \
- --max-update 50000 --warmup-updates 4000 --warmup-init-lr '1e-07' \
- --adam-betas '(0.9, 0.98)' --keep-last-epochs 10 \
- -a lightconv_iwslt_de_en --save-dir $SAVE \
- --dropout 0.3 --attention-dropout 0.1 --weight-dropout 0.1 \
- --encoder-glu 0 --decoder-glu 0
-python scripts/average_checkpoints.py --inputs $SAVE \
- --num-epoch-checkpoints 10 --output "${SAVE}/checkpoint_last10_avg.pt"
-
-# Evaluation
-CUDA_VISIBLE_DEVICES=0 fairseq-generate data-bin/iwslt14.tokenized.de-en --path "${SAVE}/checkpoint_last10_avg.pt" --batch-size 128 --beam 4 --remove-bpe --lenpen 1 --gen-subset test --quiet
-```
-
-### WMT16 En-De
-Training and evaluating DynamicConv (with GLU) on WMT16 En-De using cosine scheduler on one machine with 8 V100 GPUs:
-```sh
-# Training
-SAVE="save/dynamic_conv_wmt16en2de"
-mkdir -p $SAVE
-python -m torch.distributed.launch --nproc_per_node 8 $(which fairseq-train) \
- data-bin/wmt16_en_de_bpe32k --fp16 --log-interval 100 --no-progress-bar \
- --max-update 30000 --share-all-embeddings --optimizer adam \
- --adam-betas '(0.9, 0.98)' --clip-norm 0.0 --weight-decay 0.0 \
- --criterion label_smoothed_cross_entropy --label-smoothing 0.1 \
- --stop-min-lr 1e-09 --update-freq 16 --attention-dropout 0.1 --keep-last-epochs 10 \
- --ddp-backend=legacy_ddp --max-tokens 3584 \
- --lr-scheduler cosine --warmup-init-lr 1e-7 --warmup-updates 10000 \
- --lr-shrink 1 --lr 0.001 --min-lr 1e-7 --warmup-init-lr 1e-07 \
- --t-mult 1 --lr-period-updates 20000 \
- --arch lightconv_wmt_en_de_big --save-dir $SAVE \
- --dropout 0.3 --attention-dropout 0.1 --weight-dropout 0.1 \
- --encoder-glu 1 --decoder-glu 1
-
-# Evaluation
-CUDA_VISIBLE_DEVICES=0 fairseq-generate data-bin/wmt16.en-de.joined-dict.newstest2014 --path "${SAVE}/checkpoint_best.pt" --batch-size 128 --beam 5 --remove-bpe --lenpen 0.5 --gen-subset test > wmt16_gen.txt
-bash scripts/compound_split_bleu.sh wmt16_gen.txt
-```
-
-### WMT14 En-Fr
-Training DynamicConv (with GLU) on WMT14 En-Fr using cosine scheduler on one machine with 8 V100 GPUs:
-```sh
-# Training
-SAVE="save/dynamic_conv_wmt14en2fr"
-mkdir -p $SAVE
-python -m torch.distributed.launch --nproc_per_node 8 $(which fairseq-train) \
- data-bin/wmt14_en_fr --fp16 --log-interval 100 --no-progress-bar \
- --max-update 30000 --share-all-embeddings --optimizer adam \
- --adam-betas '(0.9, 0.98)' --clip-norm 0.0 --weight-decay 0.0 \
- --criterion label_smoothed_cross_entropy --label-smoothing 0.1 \
- --stop-min-lr 1e-09 --update-freq 16 --attention-dropout 0.1 --keep-last-epochs 10 \
- --ddp-backend=legacy_ddp --max-tokens 3584 \
- --lr-scheduler cosine --warmup-init-lr 1e-7 --warmup-updates 10000 \
- --lr-shrink 1 --lr 0.001 --min-lr 1e-7 --warmup-init-lr 1e-07 \
- --t-mult 1 --lr-period-updates 70000 \
- --arch lightconv_wmt_en_fr_big --save-dir $SAVE \
- --dropout 0.1 --attention-dropout 0.1 --weight-dropout 0.1 \
- --encoder-glu 1 --decoder-glu 1
-
-# Evaluation
-CUDA_VISIBLE_DEVICES=0 fairseq-generate data-bin/wmt14.en-fr.joined-dict.newstest2014 --path "${SAVE}/checkpoint_best.pt" --batch-size 128 --beam 5 --remove-bpe --lenpen 0.9 --gen-subset test
-```
diff --git a/spaces/HarryLee/eCommerceImageCaptioning/utils/eval_utils.py b/spaces/HarryLee/eCommerceImageCaptioning/utils/eval_utils.py
deleted file mode 100644
index 77bf28ce6a771f076e7a9ec7eb317e9f9da52d46..0000000000000000000000000000000000000000
--- a/spaces/HarryLee/eCommerceImageCaptioning/utils/eval_utils.py
+++ /dev/null
@@ -1,39 +0,0 @@
-import string
-import math
-
-import torch
-
-from data import data_utils
-
-
-def get_symbols_to_strip_from_output(generator):
- if hasattr(generator, "symbols_to_strip_from_output"):
- return generator.symbols_to_strip_from_output
- else:
- return {generator.bos, generator.eos}
-
-
-def decode_fn(x, tgt_dict, bpe, generator, tokenizer=None):
- x = tgt_dict.string(x.int().cpu(), extra_symbols_to_ignore=get_symbols_to_strip_from_output(generator))
- if bpe is not None:
- x = bpe.decode(x)
- if tokenizer is not None:
- x = tokenizer.decode(x)
- return x
-
-
-def eval_caption(task, generator, models, sample):
- transtab = str.maketrans({key: None for key in string.punctuation})
- hypos = task.inference_step(generator, models, sample)
- results = []
- for i, sample_id in enumerate(sample["id"].tolist()):
- detok_hypo_str = decode_fn(hypos[i][0]["tokens"], task.tgt_dict, task.bpe, generator)
- results.append({"image_id": str(sample_id), "caption": detok_hypo_str.translate(transtab).strip()})
- return results, None
-
-
-def eval_step(task, generator, models, sample):
- if task.cfg._name == 'caption':
- return eval_caption(task, generator, models, sample)
- else:
- raise NotImplementedError
diff --git a/spaces/Harveenchadha/Vakyansh-Malayalam-TTS/ttsv/src/glow_tts/text/cleaners.py b/spaces/Harveenchadha/Vakyansh-Malayalam-TTS/ttsv/src/glow_tts/text/cleaners.py
deleted file mode 100644
index a7d4e029baa436e88e4d68090e886afdd998a68d..0000000000000000000000000000000000000000
--- a/spaces/Harveenchadha/Vakyansh-Malayalam-TTS/ttsv/src/glow_tts/text/cleaners.py
+++ /dev/null
@@ -1,78 +0,0 @@
-import re
-
-from unidecode import unidecode
-from .numbers import normalize_numbers
-
-
-
-
-# Regular expression matching whitespace:
-_whitespace_re = re.compile(r"\s+")
-
-def lowercase(text):
- return text.lower()
-
-def collapse_whitespace(text):
- return re.sub(_whitespace_re, " ", text)
-
-def basic_indic_cleaners(text):
- """Basic pipeline that collapses whitespace without transliteration."""
- text = collapse_whitespace(text)
- return text
-
-
-def english_cleaner(text):
- text = text.lower().replace('‘','\'').replace('’','\'')
- return text
-
-
-def lowercase(text):
- return text.lower()
-
-def convert_to_ascii(text):
- return unidecode(text)
-
-def expand_numbers(text):
- return normalize_numbers(text)
-
-def expand_abbreviations(text):
- for regex, replacement in _abbreviations:
- text = re.sub(regex, replacement, text)
- return text
-
-_abbreviations = [(re.compile('\\b%s\\.' % x[0], re.IGNORECASE), x[1]) for x in [
- ('mrs', 'missus'),
- ('mr', 'mister'),
- ('dr', 'doctor'),
- ('st', 'saint'),
- ('co', 'company'),
- ('jr', 'junior'),
- ('maj', 'major'),
- ('gen', 'general'),
- ('drs', 'doctors'),
- ('rev', 'reverend'),
- ('lt', 'lieutenant'),
- ('hon', 'honorable'),
- ('sgt', 'sergeant'),
- ('capt', 'captain'),
- ('esq', 'esquire'),
- ('ltd', 'limited'),
- ('col', 'colonel'),
- ('ft', 'fort'),
- ('pvt', 'private'),
- ('rs', 'Rupees')
-]]
-
-
-
-
-
-
-def english_cleaners(text):
- '''Pipeline for English text, including number and abbreviation expansion.'''
- text = convert_to_ascii(text)
- text = lowercase(text)
- text = expand_numbers(text)
- text = expand_abbreviations(text)
- text = collapse_whitespace(text)
- return text
diff --git a/spaces/Harveenchadha/oiTrans/indic_nlp_library/docs/make.bat b/spaces/Harveenchadha/oiTrans/indic_nlp_library/docs/make.bat
deleted file mode 100644
index 922152e96a04a242e6fc40f124261d74890617d8..0000000000000000000000000000000000000000
--- a/spaces/Harveenchadha/oiTrans/indic_nlp_library/docs/make.bat
+++ /dev/null
@@ -1,35 +0,0 @@
-@ECHO OFF
-
-pushd %~dp0
-
-REM Command file for Sphinx documentation
-
-if "%SPHINXBUILD%" == "" (
- set SPHINXBUILD=sphinx-build
-)
-set SOURCEDIR=.
-set BUILDDIR=_build
-
-if "%1" == "" goto help
-
-%SPHINXBUILD% >NUL 2>NUL
-if errorlevel 9009 (
- echo.
- echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
- echo.installed, then set the SPHINXBUILD environment variable to point
- echo.to the full path of the 'sphinx-build' executable. Alternatively you
- echo.may add the Sphinx directory to PATH.
- echo.
- echo.If you don't have Sphinx installed, grab it from
- echo.http://sphinx-doc.org/
- exit /b 1
-)
-
-%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
-goto end
-
-:help
-%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
-
-:end
-popd
diff --git a/spaces/Hexamind/swarms/distribution_wrap.py b/spaces/Hexamind/swarms/distribution_wrap.py
deleted file mode 100644
index 5ec960109c8a6bc7a4a0b2519c76ba83be876b97..0000000000000000000000000000000000000000
--- a/spaces/Hexamind/swarms/distribution_wrap.py
+++ /dev/null
@@ -1,92 +0,0 @@
-import gym
-
-from gym import spaces
-import numpy as np
-
-from runner import run_episode
-from redux_wrap import ReduxWrapper
-from rotate_wrap import RotateWrapper
-from symetry_wrap import SymetryWrapper
-from sort_wrap import SortWrapper
-from team_wrap import TeamWrapper
-from reward_wrap import RewardWrapper
-
-
-class DistriWrapper(gym.Wrapper):
- """
- :param env: (gym.Env) Gym environment that will be wrapped
- """
-
- def __init__(self, env):
-
- self.blue_deads = self.red_deads = 0
- self.nb_blues, self.nb_reds = env.nb_blues, env.nb_reds
-
- env.observation_space = spaces.Tuple((
- spaces.Box(low=0, high=1, shape=(self.nb_blues, 6), dtype=np.float32),
- spaces.Box(low=0, high=1, shape=(self.nb_reds, 6), dtype=np.float32),
- spaces.Box(low=0, high=1, shape=(self.nb_blues, self.nb_reds), dtype=np.float32),
- spaces.Box(low=0, high=1, shape=(self.nb_reds, self.nb_blues), dtype=np.float32)))
-
- env.action_space = spaces.Tuple((
- spaces.Box(low=0, high=1, shape=(self.nb_blues, 3), dtype=np.float32),
- spaces.Box(low=0, high=1, shape=(self.nb_reds, 3), dtype=np.float32)))
-
- # Call the parent constructor, so we can access self.env later
- super(DistriWrapper, self).__init__(env)
-
- def reset(self):
- """
- Reset the environment
- """
- obs = self.env.reset()
- blue_obs, red_obs, blues_fire, reds_fire, blue_deads, red_deads = obs
- self.blue_deads, self.blue_deads = blue_deads, red_deads
- return blue_obs, red_obs, blues_fire, reds_fire
-
- def step(self, action):
- """
- :param action: ([float] or int) Action taken by the agent
- :return: (np.ndarray, float, bool, dict) observation, reward, is the episode over?, additional informations
- """
- obs, reward, done, info = self.env.step(action)
-
- blue_obs, red_obs, blues_fire, reds_fire, blue_deads, red_deads = obs
- obs = blue_obs, red_obs, blues_fire, reds_fire
-
- if done: # environment decision (eg drones oob)
- return obs, reward, True, info
-
- if red_deads == len(red_obs): # no more reds to fight (it could mean that they have all reached the target)
- return obs, reward, True, info
-
- if blue_deads == len(blue_obs): # reds have won
- return obs, reward, True, info
-
- # do we have new deaths?
- new_blue_deads = blue_deads - self.blue_deads
- new_red_deads = red_deads - self.red_deads
- self.blue_deads, self.red_deads = blue_deads, red_deads
-
- if 0 < new_red_deads + new_blue_deads: # we have someone killed but we still have some fight
-
- blues, reds = self.nb_blues - blue_deads, self.nb_reds - red_deads
-
- env = ReduxWrapper(self, minus_blue=blue_deads, minus_red=red_deads)
- obs_ = env.post_obs(obs)
-
- env = RotateWrapper(env)
- obs_ = env.post_obs(obs_)
-
- env = SymetryWrapper(env)
- obs_ = env.post_obs(obs_)
-
- env = SortWrapper(env)
- obs_ = env.post_obs(obs_)
-
- env = RewardWrapper(TeamWrapper(env, is_double=True), is_double=True)
- obs_ = env.post_obs(obs_)
-
- _, reward, done, info = run_episode(env, obs_, blues=blues, reds=reds)
-
- return obs, reward, done, info
diff --git a/spaces/HighCWu/anime-colorization-with-hint/gradio-modified/gradio/templates/frontend/assets/index.52ad5956.js b/spaces/HighCWu/anime-colorization-with-hint/gradio-modified/gradio/templates/frontend/assets/index.52ad5956.js
deleted file mode 100644
index a58c5c6e9a479b4b4b05c4cb870463e57a54f02a..0000000000000000000000000000000000000000
--- a/spaces/HighCWu/anime-colorization-with-hint/gradio-modified/gradio/templates/frontend/assets/index.52ad5956.js
+++ /dev/null
@@ -1,2 +0,0 @@
-import{S as D,i as E,s as q,a7 as K,e as j,c as d,a as A,b as w,f as S,m as h,g as B,a8 as C,l as N,am as F,j as g,k,n as T,o as v,A as L,F as O,t as P,h as R,aa as U,P as V,R as z,T as G,I as H,O as J,U as M,V as Q,L as W,K as y}from"./index.396f4a72.js";function X(a){let e;return{c(){e=P(a[2])},m(t,l){S(t,e,l)},p(t,l){l&4&&R(e,t[2])},d(t){t&&T(e)}}}function Y(a){let e,t,l,s,u,_,o;return t=new K({props:{show_label:a[3],$$slots:{default:[X]},$$scope:{ctx:a}}}),{c(){e=j("label"),d(t.$$.fragment),l=A(),s=j("input"),w(s,"type","number"),w(s,"class","gr-box gr-input w-full gr-text-input"),s.disabled=a[1],w(e,"class","block")},m(b,r){S(b,e,r),h(t,e,null),B(e,l),B(e,s),C(s,a[0]),u=!0,_||(o=[N(s,"input",a[6]),N(s,"keypress",a[4]),N(s,"blur",a[5])],_=!0)},p(b,[r]){const n={};r&8&&(n.show_label=b[3]),r&516&&(n.$$scope={dirty:r,ctx:b}),t.$set(n),(!u||r&2)&&(s.disabled=b[1]),r&1&&F(s.value)!==b[0]&&C(s,b[0])},i(b){u||(g(t.$$.fragment,b),u=!0)},o(b){k(t.$$.fragment,b),u=!1},d(b){b&&T(e),v(t),_=!1,L(o)}}}function Z(a,e,t){let{value:l=0}=e,{disabled:s=!1}=e,{label:u}=e,{show_label:_}=e;const o=O();function b(f){!isNaN(f)&&f!==null&&o("change",f)}async function r(f){await U(),f.key==="Enter"&&(f.preventDefault(),o("submit"))}function n(f){o("blur")}function c(){l=F(this.value),t(0,l)}return a.$$set=f=>{"value"in f&&t(0,l=f.value),"disabled"in f&&t(1,s=f.disabled),"label"in f&&t(2,u=f.label),"show_label"in f&&t(3,_=f.show_label)},a.$$.update=()=>{a.$$.dirty&1&&b(l)},[l,s,u,_,r,n,c]}class p extends D{constructor(e){super(),E(this,e,Z,Y,q,{value:0,disabled:1,label:2,show_label:3})}}function x(a){let e,t,l,s,u;const _=[a[6]];let o={};for(let n=0;n<_.length;n+=1)o=z(o,_[n]);e=new G({props:o});function b(n){a[8](n)}let r={label:a[1],show_label:a[5],disabled:a[7]==="static"};return a[0]!==void 0&&(r.value=a[0]),l=new p({props:r}),H.push(()=>J(l,"value",b)),l.$on("change",a[9]),l.$on("submit",a[10]),l.$on("blur",a[11]),{c(){d(e.$$.fragment),t=A(),d(l.$$.fragment)},m(n,c){h(e,n,c),S(n,t,c),h(l,n,c),u=!0},p(n,c){const f=c&64?M(_,[Q(n[6])]):{};e.$set(f);const m={};c&2&&(m.label=n[1]),c&32&&(m.show_label=n[5]),c&128&&(m.disabled=n[7]==="static"),!s&&c&1&&(s=!0,m.value=n[0],W(()=>s=!1)),l.$set(m)},i(n){u||(g(e.$$.fragment,n),g(l.$$.fragment,n),u=!0)},o(n){k(e.$$.fragment,n),k(l.$$.fragment,n),u=!1},d(n){v(e,n),n&&T(t),v(l,n)}}}function $(a){let e,t;return e=new V({props:{visible:a[3],elem_id:a[2],disable:typeof a[4].container=="boolean"&&!a[4].container,$$slots:{default:[x]},$$scope:{ctx:a}}}),{c(){d(e.$$.fragment)},m(l,s){h(e,l,s),t=!0},p(l,[s]){const u={};s&8&&(u.visible=l[3]),s&4&&(u.elem_id=l[2]),s&16&&(u.disable=typeof l[4].container=="boolean"&&!l[4].container),s&4323&&(u.$$scope={dirty:s,ctx:l}),e.$set(u)},i(l){t||(g(e.$$.fragment,l),t=!0)},o(l){k(e.$$.fragment,l),t=!1},d(l){v(e,l)}}}function ee(a,e,t){let{label:l="Number"}=e,{elem_id:s=""}=e,{visible:u=!0}=e,{style:_={}}=e,{value:o=0}=e,{show_label:b}=e,{loading_status:r}=e,{mode:n}=e;function c(i){o=i,t(0,o)}function f(i){y.call(this,a,i)}function m(i){y.call(this,a,i)}function I(i){y.call(this,a,i)}return a.$$set=i=>{"label"in i&&t(1,l=i.label),"elem_id"in i&&t(2,s=i.elem_id),"visible"in i&&t(3,u=i.visible),"style"in i&&t(4,_=i.style),"value"in i&&t(0,o=i.value),"show_label"in i&&t(5,b=i.show_label),"loading_status"in i&&t(6,r=i.loading_status),"mode"in i&&t(7,n=i.mode)},[o,l,s,u,_,b,r,n,c,f,m,I]}class le extends D{constructor(e){super(),E(this,e,ee,$,q,{label:1,elem_id:2,visible:3,style:4,value:0,show_label:5,loading_status:6,mode:7})}}var te=le;const ne=["static","dynamic"],se=a=>({type:"number",description:"numeric value",example_data:a.value??1});export{te as Component,se as document,ne as modes};
-//# sourceMappingURL=index.52ad5956.js.map
diff --git a/spaces/Hila/RobustViT/tokencut_dataset.py b/spaces/Hila/RobustViT/tokencut_dataset.py
deleted file mode 100644
index c0d5163194ffe16c763569699db1af4764de52ae..0000000000000000000000000000000000000000
--- a/spaces/Hila/RobustViT/tokencut_dataset.py
+++ /dev/null
@@ -1,139 +0,0 @@
-import json
-from torch.utils import data
-from torchvision.datasets import ImageFolder
-import torch
-import os
-from PIL import Image
-import numpy as np
-import argparse
-from tqdm import tqdm
-from munkres import Munkres
-import multiprocessing
-from multiprocessing import Process, Manager
-import collections
-import torchvision.transforms as transforms
-import torchvision.transforms.functional as TF
-import random
-import torchvision
-import cv2
-
-torch.manual_seed(0)
-
-SegItem = collections.namedtuple('SegItem', ('image_name', 'tag'))
-normalize = transforms.Normalize(mean=[0.5, 0.5, 0.5],
- std=[0.5, 0.5, 0.5])
-
-TRANSFORM_TRAIN = transforms.Compose([
- transforms.RandomResizedCrop(224),
- transforms.RandomHorizontalFlip(),
-])
-
-TRANSFORM_EVAL = transforms.Compose([
- transforms.Resize(256),
- transforms.CenterCrop(224),
-])
-
-IMAGE_TRANSFORMS = transforms.Compose([
- transforms.ToTensor(),
- normalize
-])
-
-MERGED_TAGS = {'n04356056', 'n04355933',
- 'n04493381', 'n02808440',
- 'n03642806', 'n03832673',
- 'n04008634', 'n03773504',
- 'n03887697', 'n15075141'}
-
-TRAIN_PARTITION = "train"
-VAL_PARTITION = "val"
-LEGAL_PARTITIONS = {TRAIN_PARTITION, VAL_PARTITION}
-
-
-# TRAIN_CLASSES = 500
-
-class SegmentationDataset(ImageFolder):
- def __init__(self, seg_path, imagenet_path, partition=TRAIN_PARTITION, num_samples=2, train_classes=500
- , imagenet_classes_path='imagenet_classes.json'):
- assert partition in LEGAL_PARTITIONS
- self._partition = partition
- self._seg_path = seg_path
- self._imagenet_path = imagenet_path
- with open(imagenet_classes_path, 'r') as f:
- self._imagenet_classes = json.load(f)
- self._tag_list = [tag for tag in os.listdir(self._seg_path) if tag not in MERGED_TAGS]
- if partition == TRAIN_PARTITION:
- # Skip merged tags as those cause a headache
- self._tag_list = self._tag_list[:train_classes]
- elif partition == VAL_PARTITION:
- # Skip merged tags as those cause a headache
- self._tag_list = self._tag_list[train_classes:]
- for tag in self._tag_list:
- assert tag in self._imagenet_classes
- self._all_segementations = []
- for tag in self._tag_list:
- base_dir = os.path.join(self._seg_path, tag)
- curr_num_samples = 0
- for i, seg in enumerate(os.listdir(base_dir)):
- seg_name = seg.split('.')[0]
- if 'bfs' not in seg_name:
- continue
- seg_path = os.path.join(self._seg_path, tag, seg)
- seg_map = torch.load(seg_path)
- seg_map = torch.from_numpy(seg_map.astype(np.float32))
- if torch.sum(seg_map) < 520:
- continue
- if curr_num_samples >= num_samples:
- break
- self._all_segementations.append(SegItem(seg_name, tag))
- curr_num_samples += 1
-
- def __getitem__(self, item):
- seg_item = self._all_segementations[item]
-
- seg_path = os.path.join(self._seg_path, seg_item.tag, seg_item.image_name + ".pt")
-
- image_path = os.path.join(self._imagenet_path, seg_item.image_name.split('_tokencut_bfs')[0] + ".JPEG")
- image = Image.open(image_path)
- image = image.convert('RGB')
-
- seg_map = torch.load(seg_path)
- seg_map = torch.from_numpy(seg_map.astype(np.float32))
-
- # transforms - start
- seg_map = seg_map.reshape(1, seg_map.shape[-2], seg_map.shape[-1])
-
- resize = transforms.Resize(224)
- image = resize(image)
-
- if self._partition == VAL_PARTITION:
- image = TRANSFORM_EVAL(image)
- seg_map = TRANSFORM_EVAL(seg_map)
-
- elif self._partition == TRAIN_PARTITION:
- # Resize
- resize = transforms.Resize(size=(256, 256))
- image = resize(image)
- seg_map = resize(seg_map)
-
- # Random crop
- i, j, h, w = transforms.RandomCrop.get_params(
- image, output_size=(224, 224))
- image = TF.crop(image, i, j, h, w)
- seg_map = TF.crop(seg_map, i, j, h, w)
-
- # RandomHorizontalFlip
- if random.random() > 0.5:
- image = TF.hflip(image)
- seg_map = TF.hflip(seg_map)
-
- else:
- raise Exception(f"Unsupported partition type {self._partition}")
- image_ten = IMAGE_TRANSFORMS(image)
- # transforms - end
-
- class_name = int(self._imagenet_classes[seg_item.tag])
-
- return seg_map, image_ten, class_name
-
- def __len__(self):
- return len(self._all_segementations)
diff --git a/spaces/Hoodady/3DFuse/run_3DFuse.py b/spaces/Hoodady/3DFuse/run_3DFuse.py
deleted file mode 100644
index 3dfabd4671152381d0dfeb32b4c19f4245a98df7..0000000000000000000000000000000000000000
--- a/spaces/Hoodady/3DFuse/run_3DFuse.py
+++ /dev/null
@@ -1,321 +0,0 @@
-import os
-import numpy as np
-import torch
-from einops import rearrange
-from imageio import imwrite
-from pydantic import validator
-import imageio
-import tempfile
-import gradio as gr
-
-from PIL import Image
-
-from my.utils import (
- tqdm, EventStorage, HeartBeat, EarlyLoopBreak,
- get_event_storage, get_heartbeat, read_stats
-)
-from my.config import BaseConf, dispatch, optional_load_config
-from my.utils.seed import seed_everything
-
-from adapt import ScoreAdapter
-from run_img_sampling import SD
-from misc import torch_samps_to_imgs
-from pose import PoseConfig
-
-from run_nerf import VoxConfig
-from voxnerf.utils import every
-from voxnerf.render import (
- as_torch_tsrs, rays_from_img, ray_box_intersect, render_ray_bundle
-)
-from voxnerf.vis import stitch_vis, bad_vis as nerf_vis
-
-from pytorch3d.renderer import PointsRasterizationSettings
-
-from semantic_coding import semantic_coding, semantic_karlo, semantic_sd
-from pc_project import point_e, render_depth_from_cloud
-device_glb = torch.device("cuda")
-
-def tsr_stats(tsr):
- return {
- "mean": tsr.mean().item(),
- "std": tsr.std().item(),
- "max": tsr.max().item(),
- }
-
-class SJC_3DFuse(BaseConf):
- family: str = "sd"
- sd: SD = SD(
- variant="v1",
- prompt="a comfortable bed",
- scale=100.0,
- dir="./results",
- alpha=0.3
- )
- lr: float = 0.05
- n_steps: int = 10000
- vox: VoxConfig = VoxConfig(
- model_type="V_SD", grid_size=100, density_shift=-1.0, c=3,
- blend_bg_texture=False , bg_texture_hw=4,
- bbox_len=1.0
- )
- pose: PoseConfig = PoseConfig(rend_hw=64, FoV=60.0, R=1.5)
-
- emptiness_scale: int = 10
- emptiness_weight: int = 1e4
- emptiness_step: float = 0.5
- emptiness_multiplier: float = 20.0
-
- depth_weight: int = 0
-
- var_red: bool = True
- exp_dir: str = "./results"
- ti_step: int = 800
- pt_step: int = 800
- initial: str = ""
- random_seed: int = 0
- semantic_model: str = "Karlo"
- bg_preprocess: bool = True
- num_initial_image: int = 4
- @validator("vox")
- def check_vox(cls, vox_cfg, values):
- family = values['family']
- if family == "sd":
- vox_cfg.c = 4
- return vox_cfg
-
- def run(self):
- raise Exception("This version is for huggingface demo, which doesn't support CLI. Please visit https://github.com/KU-CVLAB/3DFuse")
-
- def run_gradio(self, points, images):
- cfgs = self.dict()
- initial = cfgs.pop('initial')
- exp_dir=os.path.join(cfgs.pop('exp_dir'),initial)
-
- # Optimization and pivotal tuning for LoRA
- yield gr.update(value=None), "Tuning for the LoRA layer is starting now. It will take approximately ~10 mins.", gr.update(value=None)
- state=semantic_coding(images, cfgs,self.sd,initial)
- self.sd.dir=state
-
- # Load SD with Consistency Injection Module
- family = cfgs.pop("family")
- model = getattr(self, family).make()
- print(model.prompt)
- cfgs.pop("vox")
- vox = self.vox.make()
-
- cfgs.pop("pose")
- poser = self.pose.make()
-
- # Score distillation
- yield from fuse_3d(**cfgs, poser=poser,model=model,vox=vox,exp_dir=exp_dir, points=points, is_gradio=True)
-
-
-def fuse_3d(
- poser, vox, model: ScoreAdapter,
- lr, n_steps, emptiness_scale, emptiness_weight, emptiness_step, emptiness_multiplier,
- depth_weight, var_red, exp_dir, points, is_gradio, **kwargs
-):
- del kwargs
-
- if is_gradio:
- yield gr.update(visible=True), "LoRA layers tuning has just finished. \nScore distillation has started.", gr.update(visible=True)
- assert model.samps_centered()
- _, target_H, target_W = model.data_shape()
- bs = 1
- aabb = vox.aabb.T.cpu().numpy()
- vox = vox.to(device_glb)
- opt = torch.optim.Adamax(vox.opt_params(), lr=lr)
-
- H, W = poser.H, poser.W
- Ks_, poses_, prompt_prefixes_, angles_list = poser.sample_train(n_steps,device_glb)
-
- ts = model.us[30:-10]
-
- fuse = EarlyLoopBreak(5)
-
- raster_settings = PointsRasterizationSettings(
- image_size= 800,
- radius = 0.02,
- points_per_pixel = 10
- )
-
- ts = model.us[30:-10]
- calibration_value=0.0
-
-
-
- with tqdm(total=n_steps) as pbar:
- # HeartBeat(pbar) as hbeat, \
- # EventStorage(output_dir=os.path.join(exp_dir,'3d')) as metric:
-
- for i in range(len(poses_)):
- if fuse.on_break():
- break
-
- depth_map = render_depth_from_cloud(points, angles_list[i], raster_settings, device_glb,calibration_value)
-
- y, depth, ws = render_one_view(vox, aabb, H, W, Ks_[i], poses_[i], return_w=True)
-
-
- p = f"{prompt_prefixes_[i]} {model.prompt}"
- score_conds = model.prompts_emb([p])
-
- score_conds['c']=score_conds['c'].repeat(bs,1,1)
- score_conds['uc']=score_conds['uc'].repeat(bs,1,1)
-
- opt.zero_grad()
-
- with torch.no_grad():
- chosen_σs = np.random.choice(ts, bs, replace=False)
- chosen_σs = chosen_σs.reshape(-1, 1, 1, 1)
- chosen_σs = torch.as_tensor(chosen_σs, device=model.device, dtype=torch.float32)
-
-
- noise = torch.randn(bs, *y.shape[1:], device=model.device)
-
- zs = y + chosen_σs * noise
-
- Ds = model.denoise(zs, chosen_σs,depth_map.unsqueeze(dim=0),**score_conds)
-
- if var_red:
- grad = (Ds - y) / chosen_σs
- else:
- grad = (Ds - zs) / chosen_σs
-
- grad = grad.mean(0, keepdim=True)
-
- y.backward(-grad, retain_graph=True)
-
- if depth_weight > 0:
- center_depth = depth[7:-7, 7:-7]
- border_depth_mean = (depth.sum() - center_depth.sum()) / (64*64-50*50)
- center_depth_mean = center_depth.mean()
- depth_diff = center_depth_mean - border_depth_mean
- depth_loss = - torch.log(depth_diff + 1e-12)
- depth_loss = depth_weight * depth_loss
- depth_loss.backward(retain_graph=True)
-
- emptiness_loss = torch.log(1 + emptiness_scale * ws).mean()
- emptiness_loss = emptiness_weight * emptiness_loss
- if emptiness_step * n_steps <= i:
- emptiness_loss *= emptiness_multiplier
- emptiness_loss.backward()
-
- opt.step()
-
- # metric.put_scalars(**tsr_stats(y))
-
- if every(pbar, percent=2):
- with torch.no_grad():
- y = model.decode(y)
- # vis_routine(metric, y, depth,p,depth_map[0])
-
- if is_gradio :
- yield torch_samps_to_imgs(y)[0], f"Progress: {pbar.n}/{pbar.total} \nAfter the generation is complete, the video results will be displayed below.", gr.update(value=None)
-
-
-
-
- # metric.step()
- pbar.update()
-
- pbar.set_description(p)
- # hbeat.beat()
-
- # metric.put_artifact(
- # "ckpt", ".pt","", lambda fn: torch.save(vox.state_dict(), fn)
- # )
-
- # with EventStorage("result"):
- out=evaluate(model, vox, poser)
-
- if is_gradio:
- yield gr.update(visible=False), f"Generation complete. Please check the video below.", gr.update(value=out)
- else :
- yield None
-
- # metric.step()
-
- # hbeat.done()
-
-@torch.no_grad()
-def evaluate(score_model, vox, poser):
- H, W = poser.H, poser.W
- vox.eval()
- K, poses = poser.sample_test(100)
-
- fuse = EarlyLoopBreak(5)
- # metric = get_event_storage()
- # hbeat = get_heartbeat()
-
- aabb = vox.aabb.T.cpu().numpy()
- vox = vox.to(device_glb)
-
- num_imgs = len(poses)
- frames=[]
- for i in (pbar := tqdm(range(num_imgs))):
- if fuse.on_break():
- break
-
- pose = poses[i]
- y, depth = render_one_view(vox, aabb, H, W, K, pose)
- y = score_model.decode(y)
- # vis_routine(metric, y, depth,"",None)
- y=torch_samps_to_imgs(y)[0]
- frames.append(y)
- # metric.step()
- # hbeat.beat()
-
- # metric.flush_history()
-
- # metric.put_artifact(
- # "video", ".mp4","",
- # lambda fn: stitch_vis(fn, read_stats(metric.output_dir, "img")[1])
- # )
- out_file = tempfile.NamedTemporaryFile(suffix='.mp4', delete=False)
- writer = imageio.get_writer(out_file.name, fps=10)
- for img in frames:
- writer.append_data(img)
- writer.close()
- # metric.step()
- return out_file.name
-
-def render_one_view(vox, aabb, H, W, K, pose, return_w=False):
- N = H * W
- ro, rd = rays_from_img(H, W, K, pose)
-
- ro, rd, t_min, t_max = scene_box_filter_(ro, rd, aabb)
-
- assert len(ro) == N, "for now all pixels must be in"
- ro, rd, t_min, t_max = as_torch_tsrs(vox.device, ro, rd, t_min, t_max)
- rgbs, depth, weights = render_ray_bundle(vox, ro, rd, t_min, t_max)
-
- rgbs = rearrange(rgbs, "(h w) c -> 1 c h w", h=H, w=W)
- depth = rearrange(depth, "(h w) 1 -> h w", h=H, w=W)
- if return_w:
- return rgbs, depth, weights
- else:
- return rgbs, depth
-
-
-def scene_box_filter_(ro, rd, aabb):
- _, t_min, t_max = ray_box_intersect(ro, rd, aabb)
- # do not render what's behind the ray origin
- t_min, t_max = np.maximum(t_min, 0), np.maximum(t_max, 0)
- return ro, rd, t_min, t_max
-
-
-def vis_routine(metric, y, depth,prompt,depth_map):
- pane = nerf_vis(y, depth, final_H=256)
- im = torch_samps_to_imgs(y)[0]
-
- depth = depth.cpu().numpy()
- metric.put_artifact("view", ".png","",lambda fn: imwrite(fn, pane))
- metric.put_artifact("img", ".png",prompt, lambda fn: imwrite(fn, im))
- if depth_map != None:
- metric.put_artifact("PC_depth", ".png",prompt, lambda fn: imwrite(fn, depth_map.cpu().squeeze()))
- metric.put_artifact("depth", ".npy","",lambda fn: np.save(fn, depth))
-
-
-if __name__ == "__main__":
- dispatch(SJC_3DFuse)
\ No newline at end of file
diff --git a/spaces/ICML2022/OFA/fairseq/examples/wav2vec/README.md b/spaces/ICML2022/OFA/fairseq/examples/wav2vec/README.md
deleted file mode 100644
index 253c8af2516580bbc33e8ecc8efe4f7a526d7142..0000000000000000000000000000000000000000
--- a/spaces/ICML2022/OFA/fairseq/examples/wav2vec/README.md
+++ /dev/null
@@ -1,376 +0,0 @@
-# wav2vec 2.0
-
-wav2vec 2.0 learns speech representations on unlabeled data as described in [wav2vec 2.0: A Framework for Self-Supervised Learning of Speech Representations (Baevski et al., 2020)](https://arxiv.org/abs/2006.11477).
-
-We learned speech representations in multiple languages as well in [Unsupervised Cross-lingual Representation Learning for Speech Recognition (Conneau et al., 2020)](https://arxiv.org/abs/2006.13979).
-
-We also combined wav2vec 2.0 with self-training in [Self-training and Pre-training are Complementary for Speech Recognition (Xu et al., 2020)](https://arxiv.org/abs/2010.11430).
-
-We combined speech data from multiple domains in [Robust wav2vec 2.0: Analyzing Domain Shift in Self-Supervised Pre-Training (Hsu, et al., 2021)](https://arxiv.org/abs/2104.01027)
-
-## Pre-trained models
-
-Model | Finetuning split | Dataset | Model
-|---|---|---|---
-Wav2Vec 2.0 Base | No finetuning | [Librispeech](http://www.openslr.org/12) | [download](https://dl.fbaipublicfiles.com/fairseq/wav2vec/wav2vec_small.pt)
-Wav2Vec 2.0 Base | 10 minutes | [Librispeech](http://www.openslr.org/12) | [download](https://dl.fbaipublicfiles.com/fairseq/wav2vec/wav2vec_small_10m.pt)
-Wav2Vec 2.0 Base | 100 hours | [Librispeech](http://www.openslr.org/12) | [download](https://dl.fbaipublicfiles.com/fairseq/wav2vec/wav2vec_small_100h.pt)
-Wav2Vec 2.0 Base | 960 hours | [Librispeech](http://www.openslr.org/12) | [download](https://dl.fbaipublicfiles.com/fairseq/wav2vec/wav2vec_small_960h.pt)
-Wav2Vec 2.0 Large | No finetuning | [Librispeech](http://www.openslr.org/12) | [download](https://dl.fbaipublicfiles.com/fairseq/wav2vec/libri960_big.pt)
-Wav2Vec 2.0 Large | 10 minutes | [Librispeech](http://www.openslr.org/12) | [download](https://dl.fbaipublicfiles.com/fairseq/wav2vec/wav2vec_big_10m.pt)
-Wav2Vec 2.0 Large | 100 hours | [Librispeech](http://www.openslr.org/12) | [download](https://dl.fbaipublicfiles.com/fairseq/wav2vec/wav2vec_big_100h.pt)
-Wav2Vec 2.0 Large | 960 hours | [Librispeech](http://www.openslr.org/12) | [download](https://dl.fbaipublicfiles.com/fairseq/wav2vec/wav2vec_big_960h.pt)
-Wav2Vec 2.0 Large (LV-60)* | No finetuning | [Libri-Light](https://github.com/facebookresearch/libri-light) | [download](https://dl.fbaipublicfiles.com/fairseq/wav2vec/wav2vec_vox_new.pt)
-Wav2Vec 2.0 Large (LV-60)* | 10 minutes | [Libri-Light](https://github.com/facebookresearch/libri-light) + [Librispeech](http://www.openslr.org/12) | [download](https://dl.fbaipublicfiles.com/fairseq/wav2vec/wav2vec_vox_10m_new.pt)
-Wav2Vec 2.0 Large (LV-60)* | 100 hours | [Libri-Light](https://github.com/facebookresearch/libri-light) + [Librispeech](http://www.openslr.org/12) | [download](https://dl.fbaipublicfiles.com/fairseq/wav2vec/wav2vec_vox_100h_new.pt)
-Wav2Vec 2.0 Large (LV-60)* | 960 hours | [Libri-Light](https://github.com/facebookresearch/libri-light) + [Librispeech](http://www.openslr.org/12) | [download](https://dl.fbaipublicfiles.com/fairseq/wav2vec/wav2vec2_vox_960h_new.pt)
-Wav2Vec 2.0 Large (LV-60) + Self Training * | 10 minutes | [Libri-Light](https://github.com/facebookresearch/libri-light) + [Librispeech](http://www.openslr.org/12) | [download](https://dl.fbaipublicfiles.com/fairseq/wav2vec/wav2vec_vox_10m_pl.pt)
-Wav2Vec 2.0 Large (LV-60) + Self Training * | 100 hours | [Libri-Light](https://github.com/facebookresearch/libri-light) + [Librispeech](http://www.openslr.org/12) | [download](https://dl.fbaipublicfiles.com/fairseq/wav2vec/wav2vec_vox_100h_pl.pt)
-Wav2Vec 2.0 Large (LV-60) + Self Training * | 960 hours | [Libri-Light](https://github.com/facebookresearch/libri-light) + [Librispeech](http://www.openslr.org/12) | [download](https://dl.fbaipublicfiles.com/fairseq/wav2vec/wav2vec_vox_960h_pl.pt)
-Wav2Vec 2.0 Large (LV-60 + CV + SWBD + FSH) ** | No finetuning | [Libri-Light](https://github.com/facebookresearch/libri-light) + [CommonVoice](https://commonvoice.mozilla.org/en/languages) + [Switchboard](https://catalog.ldc.upenn.edu/LDC97S62) + [Fisher](https://catalog.ldc.upenn.edu/LDC2004T19) | [download](https://dl.fbaipublicfiles.com/fairseq/wav2vec/w2v_large_lv_fsh_swbd_cv.pt)
-Wav2Vec 2.0 Large (LV-60 + CV + SWBD + FSH) ** | 960 hours Librispeech | [Libri-Light](https://github.com/facebookresearch/libri-light) + [CommonVoice](https://commonvoice.mozilla.org/en/languages) + [Switchboard](https://catalog.ldc.upenn.edu/LDC97S62) + [Fisher](https://catalog.ldc.upenn.edu/LDC2004T19) | [download](https://dl.fbaipublicfiles.com/fairseq/wav2vec/w2v_large_lv_fsh_swbd_cv_ftls960.pt)
-Wav2Vec 2.0 Large (LV-60 + CV + SWBD + FSH) ** | 300 hours Switchboard | [Libri-Light](https://github.com/facebookresearch/libri-light) + [CommonVoice](https://commonvoice.mozilla.org/en/languages) + [Switchboard](https://catalog.ldc.upenn.edu/LDC97S62) + [Fisher](https://catalog.ldc.upenn.edu/LDC2004T19) | [download](https://dl.fbaipublicfiles.com/fairseq/wav2vec/w2v_large_lv_fsh_swbd_cv_ftsb300.pt)
-
-\* updated (Oct. 24, 2020)\
-** updated (Jul. 8, 2021)
-
-We also release multilingual pre-trained wav2vec 2.0 (XLSR) models:
-
-Model | Architecture | Hours | Languages | Datasets | Model
-|---|---|---|---|---|---
-XLSR-53 | Large | 56k | 53 | MLS, CommonVoice, BABEL | [download](https://dl.fbaipublicfiles.com/fairseq/wav2vec/xlsr_53_56k.pt)
-
-The XLSR model uses the following datasets for multilingual pretraining:
-
-* **[MLS: Multilingual LibriSpeech](https://indico2.conference4me.psnc.pl/event/35/contributions/3585/attachments/1060/1101/Wed-2-6-10.pdf)** (8 languages, 50.7k hours): *Dutch, English, French, German, Italian, Polish, Portuguese, Spanish*
-
-* **[CommonVoice](https://commonvoice.mozilla.org/en/languages)** (36 languages, 3.6k hours): *Arabic, Basque, Breton, Chinese (CN), Chinese (HK), Chinese (TW), Chuvash, Dhivehi, Dutch, English, Esperanto, Estonian, French, German, Hakh-Chin, Indonesian, Interlingua, Irish, Italian, Japanese, Kabyle, Kinyarwanda, Kyrgyz, Latvian, Mongolian, Persian, Portuguese, Russian, Sakha, Slovenian, Spanish, Swedish, Tamil, Tatar, Turkish, Welsh* (see also [finetuning splits]([https://dl.fbaipublicfiles.com/cpc_audio/common_voices_splits.tar.gz]) from [this paper](https://arxiv.org/abs/2002.02848)).
-
-* **[Babel](https://catalog.ldc.upenn.edu/byyear)** (17 languages, 1.7k hours): *Assamese, Bengali, Cantonese, Cebuano, Georgian, Haitian, Kazakh, Kurmanji, Lao, Pashto, Swahili, Tagalog, Tamil, Tok, Turkish, Vietnamese, Zulu*
-
-
-## Training a new model with the CLI tools
-
-Given a directory containing wav files to be used for pretraining (we recommend splitting each file into separate file 10 to 30 seconds in length)
-
-### Prepare training data manifest:
-
-First, install the `soundfile` library:
-```shell script
-pip install soundfile
-```
-
-Next, run:
-
-```shell script
-$ python examples/wav2vec/wav2vec_manifest.py /path/to/waves --dest /manifest/path --ext $ext --valid-percent $valid
-```
-
-$ext should be set to flac, wav, or whatever format your dataset happens to use that soundfile can read.
-
-$valid should be set to some reasonable percentage (like 0.01) of training data to use for validation.
-To use a pre-defined validation set (like dev-other from librispeech), set to it 0 and then overwrite valid.tsv with a
-separately pre-processed manifest file.
-
-### Train a wav2vec 2.0 base model:
-
-This configuration was used for the base model trained on the Librispeech dataset in the wav2vec 2.0 paper
-
-Note that the input is expected to be single channel, sampled at 16 kHz
-
-```shell script
-$ fairseq-hydra-train \
- task.data=/path/to/data \
- --config-dir /path/to/fairseq-py/examples/wav2vec/config/pretraining \
- --config-name wav2vec2_base_librispeech
-```
-
-Note: you can simulate 64 GPUs by using k GPUs and adding command line parameters (before `--config-dir`)
-`distributed_training.distributed_world_size=k` `+optimization.update_freq='[x]'` where x = 64/k
-
-### Train a wav2vec 2.0 large model:
-
-This configuration was used for the large model trained on the Libri-light dataset in the wav2vec 2.0 paper
-
-```shell script
-$ fairseq-hydra-train \
- task.data=/path/to/data \
- --config-dir /path/to/fairseq-py/examples/wav2vec/config/pretraining \
- --config-name wav2vec2_large_librivox
-```
-
-Note: you can simulate 128 GPUs by using k GPUs and adding command line parameters (before `--config-dir`)
-`distributed_training.distributed_world_size=k` `+optimization.update_freq='[x]'` where x = 128/k
-
-### Fine-tune a pre-trained model with CTC:
-
-Fine-tuning a model requires parallel audio and labels file, as well as a vocabulary file in fairseq format.
-A letter vocabulary can be downloaded [here](https://dl.fbaipublicfiles.com/fairseq/wav2vec/dict.ltr.txt).
-An example [script](libri_labels.py) that generates labels for the Librispeech dataset from the tsv file produced by wav2vec_manifest.py can be used as follows:
-
-```shell script
-split=train
-$ python libri_labels.py /path/to/tsv --output-dir /output/dir --output-name $split
-```
-
-Fine-tuning on 100h of Librispeech with letter targets:
-```shell script
-$ fairseq-hydra-train \
- distributed_training.distributed_port=$PORT \
- task.data=/path/to/data \
- model.w2v_path=/path/to/model.pt \
- --config-dir /path/to/fairseq-py/examples/wav2vec/config/finetuning \
- --config-name base_100h
-```
-
-There are other config files in the config/finetuning directory that can be used to fine-tune on other splits.
-You can specify the right config via the `--config-name` parameter.
-
-Note: you can simulate 24 GPUs by using k GPUs and adding command line parameters (before `--config-dir`)
-`distributed_training.distributed_world_size=k` `+optimization.update_freq='[x]'` where x = 24/k
-
-Decoding with a language model during training requires flashlight [python bindings](https://github.com/facebookresearch/flashlight/tree/master/bindings/python) (previously called [wav2letter](https://github.com/facebookresearch/wav2letter).
-If you want to use a language model, add `+criterion.wer_args='[/path/to/kenlm, /path/to/lexicon, 2, -1]'` to the command line.
-
-### Evaluating a CTC model:
-
-Evaluating a CTC model with a language model requires [flashlight python bindings](https://github.com/facebookresearch/flashlight/tree/master/bindings/python) (previously called [wav2letter](https://github.com/facebookresearch/wav2letter) to be installed.
-
-Fairseq transformer language model used in the wav2vec 2.0 paper can be obtained from the [wav2letter model repository](https://github.com/facebookresearch/wav2letter/tree/master/recipes/sota/2019).
-Be sure to upper-case the language model vocab after downloading it.
-
-Letter dictionary for pre-trained models can be found [here](https://dl.fbaipublicfiles.com/fairseq/wav2vec/dict.ltr.txt).
-
-Next, run the evaluation command:
-
-```shell script
-$subset=dev_other
-python examples/speech_recognition/infer.py /checkpoint/abaevski/data/speech/libri/10h/wav2vec/raw --task audio_finetuning \
---nbest 1 --path /path/to/model --gen-subset $subset --results-path /path/to/save/results/for/sclite --w2l-decoder kenlm \
---lm-model /path/to/kenlm.bin --lm-weight 2 --word-score -1 --sil-weight 0 --criterion ctc --labels ltr --max-tokens 4000000 \
---post-process letter
-```
-
-To get raw numbers, use --w2l-decoder viterbi and omit the lexicon. To use the transformer language model, use --w2l-decoder fairseqlm.
-
-## Use wav2vec 2.0 with 🤗Transformers:
-
-Wav2Vec2 is also available in the [🤗Transformers library](https://github.com/huggingface/transformers) since version 4.4.
-
-Pretrained Models can be found on the [hub](https://huggingface.co/models?filter=wav2vec2)
-and documentation can be found [here](https://huggingface.co/transformers/master/model_doc/wav2vec2.html).
-
-Usage example:
-
-```python
-# !pip install transformers
-# !pip install datasets
-import soundfile as sf
-import torch
-from datasets import load_dataset
-from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor
-
-# load pretrained model
-processor = Wav2Vec2Processor.from_pretrained("facebook/wav2vec2-base-960h")
-model = Wav2Vec2ForCTC.from_pretrained("facebook/wav2vec2-base-960h")
-
-
-librispeech_samples_ds = load_dataset("patrickvonplaten/librispeech_asr_dummy", "clean", split="validation")
-
-# load audio
-audio_input, sample_rate = sf.read(librispeech_samples_ds[0]["file"])
-
-# pad input values and return pt tensor
-input_values = processor(audio_input, sampling_rate=sample_rate, return_tensors="pt").input_values
-
-# INFERENCE
-
-# retrieve logits & take argmax
-logits = model(input_values).logits
-predicted_ids = torch.argmax(logits, dim=-1)
-
-# transcribe
-transcription = processor.decode(predicted_ids[0])
-
-# FINE-TUNE
-
-target_transcription = "A MAN SAID TO THE UNIVERSE I EXIST"
-
-# encode labels
-with processor.as_target_processor():
- labels = processor(target_transcription, return_tensors="pt").input_ids
-
-# compute loss by passing labels
-loss = model(input_values, labels=labels).loss
-loss.backward()
-```
-
-# wav2vec
-
-Example to train a wav2vec model as described in [wav2vec: Unsupervised Pre-training for Speech Recognition (Schneider et al., 2019)](https://arxiv.org/abs/1904.05862).
-
-## Pre-trained models
-
-Description | Dataset | Model
----|---|---
-Wav2Vec large | [Librispeech](http://www.openslr.org/12) | [download](https://dl.fbaipublicfiles.com/fairseq/wav2vec/wav2vec_large.pt)
-
-#### Example usage:
-```python
-import torch
-import fairseq
-
-cp_path = '/path/to/wav2vec.pt'
-model, cfg, task = fairseq.checkpoint_utils.load_model_ensemble_and_task([cp_path])
-model = model[0]
-model.eval()
-
-wav_input_16khz = torch.randn(1,10000)
-z = model.feature_extractor(wav_input_16khz)
-c = model.feature_aggregator(z)
-```
-
-## Training a new model with the CLI tools
-
-Given a directory containing wav files to be used for pretraining (we recommend splitting each file into separate files 10 to 30 seconds in length)
-
-### Prepare training data manifest:
-
-```
-$ python examples/wav2vec/wav2vec_manifest.py /path/to/waves --dest /manifest/path --ext wav
-```
-
-### Train a wav2vec model:
-
-```
-$ python train.py /manifest/path --save-dir /model/path --num-workers 6 --fp16 --max-update 400000 --save-interval 1 --no-epoch-checkpoints \
---arch wav2vec --task audio_pretraining --min-lr 1e-06 --stop-min-lr 1e-09 --optimizer adam --lr 0.005 --lr-scheduler cosine \
---conv-feature-layers [(512, 10, 5), (512, 8, 4), (512, 4, 2), (512, 4, 2), (512, 4, 2), (512, 1, 1), (512, 1, 1)] \
---conv-aggregator-layers [(512, 2, 1), (512, 3, 1), (512, 4, 1), (512, 5, 1), (512, 6, 1), (512, 7, 1), (512, 8, 1), (512, 9, 1), (512, 10, 1), (512, 11, 1), (512, 12, 1), (512, 13, 1)] \
---skip-connections-agg --residual-scale 0.5 --log-compression --warmup-updates 500 --warmup-init-lr 1e-07 --criterion wav2vec --num-negatives 10 \
---max-sample-size 150000 --max-tokens 1500000 --skip-invalid-size-inputs-valid-test
-```
-
-### Run wav2vec2 pre-training on Google Cloud TPUs:
-
-Wav2Vec2 is now supported on TPUs! It's currently pre-training only.
-
-#### Using hydra on a v3-8:
-
-```
-$ OMP_NUM_THREADS=1 fairseq-hydra-train \
- task.data=/manifest/path \
- --config-dir /PATH/TO/FAIRSEQ/examples/wav2vec/config/pretraining \
- --config-name wav2vec2_large_librivox_tpu.yaml
-```
-
-#### Using command line arguments on a v3-8:
-Note: Commandline arguments way of execution has a [known-problem](https://github.com/pytorch/fairseq/issues/3741) currently.
-
-```
-$ OMP_NUM_THREADS=1 python train.py /manifest/path --save-dir /model/path --num-workers 6 --fp16 --max-update 400000 --save-interval 1 --no-epoch-checkpoints \
---arch wav2vec2 --task audio_pretraining --min-lr 1e-06 --stop-min-lr 1e-09 --optimizer adam --lr 0.005 --lr-scheduler cosine \
---conv-feature-layers [(512, 10, 5), (512, 8, 4), (512, 4, 2), (512, 4, 2), (512, 4, 2), (512, 1, 1), (512, 1, 1)] \
---conv-aggregator-layers [(512, 2, 1), (512, 3, 1), (512, 4, 1), (512, 5, 1), (512, 6, 1), (512, 7, 1), (512, 8, 1), (512, 9, 1), (512, 10, 1), (512, 11, 1), (512, 12, 1), (512, 13, 1)] \
---skip-connections-agg --residual-scale 0.5 --log-compression --warmup-updates 500 --warmup-init-lr 1e-07 --criterion wav2vec --num-negatives 10 \
---max-sample-size 150000 --max-tokens 1500000 --skip-invalid-size-inputs-valid-test \
---tpu --distributed-world-size 8 --num-batch-buckets 3 --enable-padding \
---encoder-layerdrop 0 --mask-channel-prob 0.1
-```
-
-#### Using hydra on a pod slice (v3-N with N > 8):
-
-```
-$ OMP_NUM_THREADS=1 fairseq-hydra-train \
- task.data=/manifest/path \
- --config-dir /PATH/TO/FAIRSEQ/examples/wav2vec/config/pretraining \
- --config-name wav2vec2_large_librivox_tpu-pod.yaml # edit distributed-world-size accordingly
-```
-
-#### Using command line arguments on a pod slice (v3-N with N > 8):
-Note: Commandline arguments way of execution has a [known-problem](https://github.com/pytorch/fairseq/issues/3741) currently.
-
-```
-$ python -m torch_xla.distributed.xla_dist \
- --tpu ${TPUNAME} --conda-env=torch-xla-${TORCH_XLA_VERSION} --env OMP_NUM_THREADS=1 \
- -- \
-python train.py /manifest/path --save-dir /model/path --num-workers 6 --fp16 --max-update 400000 --save-interval 1 --no-epoch-checkpoints \
---arch wav2vec2 --task audio_pretraining --min-lr 1e-06 --stop-min-lr 1e-09 --optimizer adam --lr 0.005 --lr-scheduler cosine \
---conv-feature-layers [(512, 10, 5), (512, 8, 4), (512, 4, 2), (512, 4, 2), (512, 4, 2), (512, 1, 1), (512, 1, 1)] \
---conv-aggregator-layers [(512, 2, 1), (512, 3, 1), (512, 4, 1), (512, 5, 1), (512, 6, 1), (512, 7, 1), (512, 8, 1), (512, 9, 1), (512, 10, 1), (512, 11, 1), (512, 12, 1), (512, 13, 1)] \
---skip-connections-agg --residual-scale 0.5 --log-compression --warmup-updates 500 --warmup-init-lr 1e-07 --criterion wav2vec --num-negatives 10 \
---max-sample-size 150000 --max-tokens 1500000 --skip-invalid-size-inputs-valid-test \
---tpu --distributed-world-size ${WORLD_SIZE} --num-batch-buckets 3 --enable-padding \
---encoder-layerdrop 0 --mask-channel-prob 0.1
-```
-
-### Extract embeddings from the downstream task data:
-
-```
-$ PYTHONPATH=/path/to/fairseq python examples/wav2vec/wav2vec_featurize.py --input /path/to/task/waves --output /path/to/output \
---model /model/path/checkpoint_best.pt --split train valid test
-```
-
-# vq-wav2vec
-
-Example to train a vq-wav2vec model as described in [vq-wav2vec: Self-Supervised Learning of Discrete Speech Representations (Baevski et al., 2019)](https://arxiv.org/abs/1910.05453).
-
-These models are also used in [Effectiveness of self-supervised pre-training for speech recognition (Baevski et al., 2019)](https://arxiv.org/abs/1911.03912).
-
-## Pre-trained models
-
-Description | Dataset | Model
----|---|---
-vq-wav2vec Gumbel | [Librispeech](http://www.openslr.org/12) | [download](https://dl.fbaipublicfiles.com/fairseq/wav2vec/vq-wav2vec.pt)
-vq-wav2vec K-means | [Librispeech](http://www.openslr.org/12) | [download](https://dl.fbaipublicfiles.com/fairseq/wav2vec/vq-wav2vec_kmeans.pt)
-Roberta on K-means codes | [Librispeech](http://www.openslr.org/12) | [download](https://dl.fbaipublicfiles.com/fairseq/wav2vec/bert_kmeans.tar)
-
-#### Example usage:
-```python
-import torch
-import fairseq
-
-cp = torch.load('/path/to/vq-wav2vec.pt')
-model, cfg, task = fairseq.checkpoint_utils.load_model_ensemble_and_task([cp])
-model = model[0]
-model.eval()
-
-wav_input_16khz = torch.randn(1,10000)
-z = model.feature_extractor(wav_input_16khz)
-_, idxs = model.vector_quantizer.forward_idx(z)
-print(idxs.shape) # output: torch.Size([1, 60, 2]), 60 timesteps with 2 indexes corresponding to 2 groups in the model
-```
-
-## Training a new model with the CLI tools
-
-Given a directory containing wav files to be used for pretraining (we recommend splitting each file into separate file 10 to 30 seconds in length)
-
-### Prepare training data manifest:
-
-```
-$ python examples/wav2vec/wav2vec_manifest.py /path/to/waves --dest /manifest/path --ext wav
-```
-
-### Train a gumbel vq-wav2vec model:
-
-```
-$ python train.py /manifest/path --save-dir /model/path --num-workers 6 --fp16 --max-update 400000 \
---save-interval 1 --no-epoch-checkpoints --arch wav2vec --task audio_pretraining --min-lr 1e-06 --stop-min-lr 1e-09 \
---optimizer adam --lr 1e-05 --lr-scheduler cosine \
---conv-feature-layers [(512, 10, 5), (512, 8, 4), (512, 4, 2), (512, 4, 2), (512, 4, 2), (512, 1, 1), (512, 1, 1), (512, 1, 1)] \
---conv-aggregator-layers [(512, 2, 1), (512, 3, 1), (512, 4, 1), (512, 5, 1), (512, 6, 1), (512, 7, 1), (512, 8, 1), (512, 9, 1), (512, 10, 1), (512, 11, 1), (512, 12, 1), (512, 13, 1)] \
---activation gelu --offset auto --skip-connections-agg --residual-scale 0.5 \
---log-keys ["prob_perplexity","code_perplexity","temp"] --vq-type gumbel --vq-groups 2 --vq-depth 2 \
---combine-groups --vq-vars 320 --vq-temp (2,0.5,0.999995) --prediction-steps 12 --warmup-updates 1000 \
---warmup-init-lr 1e-07 --criterion wav2vec --num-negatives 10 --max-sample-size 150000 \
---max-tokens 300000 --cross-sample-negatives 0 --update-freq 1 --seed 2 --skip-invalid-size-inputs-valid-test
-```
-
-for k-means training, set vq-type with "kmeans" and add --loss-weights [1] argument. Pre-trained models were trained on 16 GPUs.
-
-### Tokenize audio data (e.g. for BERT training):
-
-```
-$ PYTHONPATH=/path/to/fairseq python examples/wav2vec/vq-wav2vec_featurize.py --data-dir /manifest/path --output-dir /path/to/output \
---checkpoint /model/path/checkpoint_best.pt --split train valid test --extension tsv
-```
diff --git a/spaces/ICML2022/OFA/fairseq/fairseq/data/data_utils.py b/spaces/ICML2022/OFA/fairseq/fairseq/data/data_utils.py
deleted file mode 100644
index b3de57681e0fb6b026003eff19f7745caf6799d3..0000000000000000000000000000000000000000
--- a/spaces/ICML2022/OFA/fairseq/fairseq/data/data_utils.py
+++ /dev/null
@@ -1,595 +0,0 @@
-# Copyright (c) Facebook, Inc. and its affiliates.
-#
-# This source code is licensed under the MIT license found in the
-# LICENSE file in the root directory of this source tree.
-
-try:
- from collections.abc import Iterable
-except ImportError:
- from collections import Iterable
-import contextlib
-import itertools
-import logging
-import re
-import warnings
-from typing import Optional, Tuple
-
-import numpy as np
-import torch
-
-from fairseq.file_io import PathManager
-from fairseq import utils
-import os
-
-logger = logging.getLogger(__name__)
-
-
-def infer_language_pair(path):
- """Infer language pair from filename: .-.(...).idx"""
- src, dst = None, None
- for filename in PathManager.ls(path):
- parts = filename.split(".")
- if len(parts) >= 3 and len(parts[1].split("-")) == 2:
- return parts[1].split("-")
- return src, dst
-
-
-def collate_tokens(
- values,
- pad_idx,
- eos_idx=None,
- left_pad=False,
- move_eos_to_beginning=False,
- pad_to_length=None,
- pad_to_multiple=1,
- pad_to_bsz=None,
-):
- """Convert a list of 1d tensors into a padded 2d tensor."""
- size = max(v.size(0) for v in values)
- size = size if pad_to_length is None else max(size, pad_to_length)
- if pad_to_multiple != 1 and size % pad_to_multiple != 0:
- size = int(((size - 0.1) // pad_to_multiple + 1) * pad_to_multiple)
-
- batch_size = len(values) if pad_to_bsz is None else max(len(values), pad_to_bsz)
- res = values[0].new(batch_size, size).fill_(pad_idx)
-
- def copy_tensor(src, dst):
- assert dst.numel() == src.numel()
- if move_eos_to_beginning:
- if eos_idx is None:
- # if no eos_idx is specified, then use the last token in src
- dst[0] = src[-1]
- else:
- dst[0] = eos_idx
- dst[1:] = src[:-1]
- else:
- dst.copy_(src)
-
- for i, v in enumerate(values):
- copy_tensor(v, res[i][size - len(v) :] if left_pad else res[i][: len(v)])
- return res
-
-def load_indexed_dataset(
- path, dictionary=None, dataset_impl=None, combine=False, default="cached"
-):
- """A helper function for loading indexed datasets.
-
- Args:
- path (str): path to indexed dataset (e.g., 'data-bin/train')
- dictionary (~fairseq.data.Dictionary): data dictionary
- dataset_impl (str, optional): which dataset implementation to use. If
- not provided, it will be inferred automatically. For legacy indexed
- data we use the 'cached' implementation by default.
- combine (bool, optional): automatically load and combine multiple
- datasets. For example, if *path* is 'data-bin/train', then we will
- combine 'data-bin/train', 'data-bin/train1', ... and return a
- single ConcatDataset instance.
- """
- import fairseq.data.indexed_dataset as indexed_dataset
- from fairseq.data.concat_dataset import ConcatDataset
-
- datasets = []
- for k in itertools.count():
- path_k = path + (str(k) if k > 0 else "")
- try:
- path_k = indexed_dataset.get_indexed_dataset_to_local(path_k)
- except Exception as e:
- if "StorageException: [404] Path not found" in str(e):
- logger.warning(f"path_k: {e} not found")
- else:
- raise e
-
- dataset_impl_k = dataset_impl
- if dataset_impl_k is None:
- dataset_impl_k = indexed_dataset.infer_dataset_impl(path_k)
- dataset = indexed_dataset.make_dataset(
- path_k,
- impl=dataset_impl_k or default,
- fix_lua_indexing=True,
- dictionary=dictionary,
- )
- if dataset is None:
- break
- logger.info("loaded {:,} examples from: {}".format(len(dataset), path_k))
- datasets.append(dataset)
- if not combine:
- break
- if len(datasets) == 0:
- return None
- elif len(datasets) == 1:
- return datasets[0]
- else:
- return ConcatDataset(datasets)
-
-
-@contextlib.contextmanager
-def numpy_seed(seed, *addl_seeds):
- """Context manager which seeds the NumPy PRNG with the specified seed and
- restores the state afterward"""
- if seed is None:
- yield
- return
- if len(addl_seeds) > 0:
- seed = int(hash((seed, *addl_seeds)) % 1e6)
- state = np.random.get_state()
- np.random.seed(seed)
- try:
- yield
- finally:
- np.random.set_state(state)
-
-
-def collect_filtered(function, iterable, filtered):
- """
- Similar to :func:`filter` but collects filtered elements in ``filtered``.
-
- Args:
- function (callable): function that returns ``False`` for elements that
- should be filtered
- iterable (iterable): iterable to filter
- filtered (list): list to store filtered elements
- """
- for el in iterable:
- if function(el):
- yield el
- else:
- filtered.append(el)
-
-
-def _filter_by_size_dynamic(indices, size_fn, max_positions, raise_exception=False):
- def compare_leq(a, b):
- return a <= b if not isinstance(a, tuple) else max(a) <= b
-
- def check_size(idx):
- if isinstance(max_positions, float) or isinstance(max_positions, int):
- return size_fn(idx) <= max_positions
- elif isinstance(max_positions, dict):
- idx_size = size_fn(idx)
- assert isinstance(idx_size, dict)
- intersect_keys = set(max_positions.keys()) & set(idx_size.keys())
- return all(
- all(
- a is None or b is None or a <= b
- for a, b in zip(idx_size[key], max_positions[key])
- )
- for key in intersect_keys
- )
- else:
- # For MultiCorpusSampledDataset, will generalize it later
- if not isinstance(size_fn(idx), Iterable):
- return all(size_fn(idx) <= b for b in max_positions)
- return all(
- a is None or b is None or a <= b
- for a, b in zip(size_fn(idx), max_positions)
- )
-
- ignored = []
- itr = collect_filtered(check_size, indices, ignored)
- indices = np.fromiter(itr, dtype=np.int64, count=-1)
- return indices, ignored
-
-
-def filter_by_size(indices, dataset, max_positions, raise_exception=False):
- """
- [deprecated] Filter indices based on their size.
- Use `FairseqDataset::filter_indices_by_size` instead.
-
- Args:
- indices (List[int]): ordered list of dataset indices
- dataset (FairseqDataset): fairseq dataset instance
- max_positions (tuple): filter elements larger than this size.
- Comparisons are done component-wise.
- raise_exception (bool, optional): if ``True``, raise an exception if
- any elements are filtered (default: False).
- """
- warnings.warn(
- "data_utils.filter_by_size is deprecated. "
- "Use `FairseqDataset::filter_indices_by_size` instead.",
- stacklevel=2,
- )
- if isinstance(max_positions, float) or isinstance(max_positions, int):
- if hasattr(dataset, "sizes") and isinstance(dataset.sizes, np.ndarray):
- ignored = indices[dataset.sizes[indices] > max_positions].tolist()
- indices = indices[dataset.sizes[indices] <= max_positions]
- elif (
- hasattr(dataset, "sizes")
- and isinstance(dataset.sizes, list)
- and len(dataset.sizes) == 1
- ):
- ignored = indices[dataset.sizes[0][indices] > max_positions].tolist()
- indices = indices[dataset.sizes[0][indices] <= max_positions]
- else:
- indices, ignored = _filter_by_size_dynamic(
- indices, dataset.size, max_positions
- )
- else:
- indices, ignored = _filter_by_size_dynamic(indices, dataset.size, max_positions)
-
- if len(ignored) > 0 and raise_exception:
- raise Exception(
- (
- "Size of sample #{} is invalid (={}) since max_positions={}, "
- "skip this example with --skip-invalid-size-inputs-valid-test"
- ).format(ignored[0], dataset.size(ignored[0]), max_positions)
- )
- if len(ignored) > 0:
- logger.warning(
- (
- "{} samples have invalid sizes and will be skipped, "
- "max_positions={}, first few sample ids={}"
- ).format(len(ignored), max_positions, ignored[:10])
- )
- return indices
-
-
-def filter_paired_dataset_indices_by_size(src_sizes, tgt_sizes, indices, max_sizes):
- """Filter a list of sample indices. Remove those that are longer
- than specified in max_sizes.
-
- Args:
- indices (np.array): original array of sample indices
- max_sizes (int or list[int] or tuple[int]): max sample size,
- can be defined separately for src and tgt (then list or tuple)
-
- Returns:
- np.array: filtered sample array
- list: list of removed indices
- """
- if max_sizes is None:
- return indices, []
- if type(max_sizes) in (int, float):
- max_src_size, max_tgt_size = max_sizes, max_sizes
- else:
- max_src_size, max_tgt_size = max_sizes
- if tgt_sizes is None:
- ignored = indices[src_sizes[indices] > max_src_size]
- else:
- ignored = indices[
- (src_sizes[indices] > max_src_size) | (tgt_sizes[indices] > max_tgt_size)
- ]
- if len(ignored) > 0:
- if tgt_sizes is None:
- indices = indices[src_sizes[indices] <= max_src_size]
- else:
- indices = indices[
- (src_sizes[indices] <= max_src_size)
- & (tgt_sizes[indices] <= max_tgt_size)
- ]
- return indices, ignored.tolist()
-
-
-def batch_by_size(
- indices,
- num_tokens_fn,
- num_tokens_vec=None,
- max_tokens=None,
- max_sentences=None,
- required_batch_size_multiple=1,
- fixed_shapes=None,
-):
- """
- Yield mini-batches of indices bucketed by size. Batches may contain
- sequences of different lengths.
-
- Args:
- indices (List[int]): ordered list of dataset indices
- num_tokens_fn (callable): function that returns the number of tokens at
- a given index
- num_tokens_vec (List[int], optional): precomputed vector of the number
- of tokens for each index in indices (to enable faster batch generation)
- max_tokens (int, optional): max number of tokens in each batch
- (default: None).
- max_sentences (int, optional): max number of sentences in each
- batch (default: None).
- required_batch_size_multiple (int, optional): require batch size to
- be less than N or a multiple of N (default: 1).
- fixed_shapes (List[Tuple[int, int]], optional): if given, batches will
- only be created with the given shapes. *max_sentences* and
- *required_batch_size_multiple* will be ignored (default: None).
- """
- try:
- from fairseq.data.data_utils_fast import (
- batch_by_size_fn,
- batch_by_size_vec,
- batch_fixed_shapes_fast,
- )
- except ImportError:
- raise ImportError(
- "Please build Cython components with: "
- "`python setup.py build_ext --inplace`"
- )
- except ValueError:
- raise ValueError(
- "Please build (or rebuild) Cython components with `python setup.py build_ext --inplace`."
- )
-
- # added int() to avoid TypeError: an integer is required
- max_tokens = (
- int(max_tokens) if max_tokens is not None else -1
- )
- max_sentences = max_sentences if max_sentences is not None else -1
- bsz_mult = required_batch_size_multiple
-
- if not isinstance(indices, np.ndarray):
- indices = np.fromiter(indices, dtype=np.int64, count=-1)
-
- if num_tokens_vec is not None and not isinstance(num_tokens_vec, np.ndarray):
- num_tokens_vec = np.fromiter(num_tokens_vec, dtype=np.int64, count=-1)
-
- if fixed_shapes is None:
- if num_tokens_vec is None:
- return batch_by_size_fn(
- indices,
- num_tokens_fn,
- max_tokens,
- max_sentences,
- bsz_mult,
- )
- else:
- return batch_by_size_vec(
- indices,
- num_tokens_vec,
- max_tokens,
- max_sentences,
- bsz_mult,
- )
-
- else:
- fixed_shapes = np.array(fixed_shapes, dtype=np.int64)
- sort_order = np.lexsort(
- [
- fixed_shapes[:, 1].argsort(), # length
- fixed_shapes[:, 0].argsort(), # bsz
- ]
- )
- fixed_shapes_sorted = fixed_shapes[sort_order]
- return batch_fixed_shapes_fast(indices, num_tokens_fn, fixed_shapes_sorted)
-
-
-def post_process(sentence: str, symbol: str):
- if symbol == "sentencepiece":
- sentence = sentence.replace(" ", "").replace("\u2581", " ").strip()
- elif symbol == "wordpiece":
- sentence = sentence.replace(" ", "").replace("_", " ").strip()
- elif symbol == "letter":
- sentence = sentence.replace(" ", "").replace("|", " ").strip()
- elif symbol == "silence":
- import re
- sentence = sentence.replace("", "")
- sentence = re.sub(' +', ' ', sentence).strip()
- elif symbol == "_EOW":
- sentence = sentence.replace(" ", "").replace("_EOW", " ").strip()
- elif symbol in {"subword_nmt", "@@ ", "@@"}:
- if symbol == "subword_nmt":
- symbol = "@@ "
- sentence = (sentence + " ").replace(symbol, "").rstrip()
- elif symbol == "none":
- pass
- elif symbol is not None:
- raise NotImplementedError(f"Unknown post_process option: {symbol}")
- return sentence
-
-
-def compute_mask_indices(
- shape: Tuple[int, int],
- padding_mask: Optional[torch.Tensor],
- mask_prob: float,
- mask_length: int,
- mask_type: str = "static",
- mask_other: float = 0.0,
- min_masks: int = 0,
- no_overlap: bool = False,
- min_space: int = 0,
-) -> np.ndarray:
- """
- Computes random mask spans for a given shape
-
- Args:
- shape: the the shape for which to compute masks.
- should be of size 2 where first element is batch size and 2nd is timesteps
- padding_mask: optional padding mask of the same size as shape, which will prevent masking padded elements
- mask_prob: probability for each token to be chosen as start of the span to be masked. this will be multiplied by
- number of timesteps divided by length of mask span to mask approximately this percentage of all elements.
- however due to overlaps, the actual number will be smaller (unless no_overlap is True)
- mask_type: how to compute mask lengths
- static = fixed size
- uniform = sample from uniform distribution [mask_other, mask_length*2]
- normal = sample from normal distribution with mean mask_length and stdev mask_other. mask is min 1 element
- poisson = sample from possion distribution with lambda = mask length
- min_masks: minimum number of masked spans
- no_overlap: if false, will switch to an alternative recursive algorithm that prevents spans from overlapping
- min_space: only used if no_overlap is True, this is how many elements to keep unmasked between spans
- """
-
- bsz, all_sz = shape
- mask = np.full((bsz, all_sz), False)
-
- all_num_mask = int(
- # add a random number for probabilistic rounding
- mask_prob * all_sz / float(mask_length)
- + np.random.rand()
- )
-
- all_num_mask = max(min_masks, all_num_mask)
-
- mask_idcs = []
- for i in range(bsz):
- if padding_mask is not None:
- sz = all_sz - padding_mask[i].long().sum().item()
- num_mask = int(
- # add a random number for probabilistic rounding
- mask_prob * sz / float(mask_length)
- + np.random.rand()
- )
- num_mask = max(min_masks, num_mask)
- else:
- sz = all_sz
- num_mask = all_num_mask
-
- if mask_type == "static":
- lengths = np.full(num_mask, mask_length)
- elif mask_type == "uniform":
- lengths = np.random.randint(mask_other, mask_length * 2 + 1, size=num_mask)
- elif mask_type == "normal":
- lengths = np.random.normal(mask_length, mask_other, size=num_mask)
- lengths = [max(1, int(round(x))) for x in lengths]
- elif mask_type == "poisson":
- lengths = np.random.poisson(mask_length, size=num_mask)
- lengths = [int(round(x)) for x in lengths]
- else:
- raise Exception("unknown mask selection " + mask_type)
-
- if sum(lengths) == 0:
- lengths[0] = min(mask_length, sz - 1)
-
- if no_overlap:
- mask_idc = []
-
- def arrange(s, e, length, keep_length):
- span_start = np.random.randint(s, e - length)
- mask_idc.extend(span_start + i for i in range(length))
-
- new_parts = []
- if span_start - s - min_space >= keep_length:
- new_parts.append((s, span_start - min_space + 1))
- if e - span_start - keep_length - min_space > keep_length:
- new_parts.append((span_start + length + min_space, e))
- return new_parts
-
- parts = [(0, sz)]
- min_length = min(lengths)
- for length in sorted(lengths, reverse=True):
- lens = np.fromiter(
- (e - s if e - s >= length + min_space else 0 for s, e in parts),
- np.int,
- )
- l_sum = np.sum(lens)
- if l_sum == 0:
- break
- probs = lens / np.sum(lens)
- c = np.random.choice(len(parts), p=probs)
- s, e = parts.pop(c)
- parts.extend(arrange(s, e, length, min_length))
- mask_idc = np.asarray(mask_idc)
- else:
- min_len = min(lengths)
- if sz - min_len <= num_mask:
- min_len = sz - num_mask - 1
-
- mask_idc = np.random.choice(sz - min_len, num_mask, replace=False)
-
- mask_idc = np.asarray(
- [
- mask_idc[j] + offset
- for j in range(len(mask_idc))
- for offset in range(lengths[j])
- ]
- )
-
- mask_idcs.append(np.unique(mask_idc[mask_idc < sz]))
-
- min_len = min([len(m) for m in mask_idcs])
- for i, mask_idc in enumerate(mask_idcs):
- if len(mask_idc) > min_len:
- mask_idc = np.random.choice(mask_idc, min_len, replace=False)
- mask[i, mask_idc] = True
-
- return mask
-
-
-def get_mem_usage():
- try:
- import psutil
-
- mb = 1024 * 1024
- return f"used={psutil.virtual_memory().used / mb}Mb; avail={psutil.virtual_memory().available / mb}Mb"
- except ImportError:
- return "N/A"
-
-
-# lens: torch.LongTensor
-# returns: torch.BoolTensor
-def lengths_to_padding_mask(lens):
- bsz, max_lens = lens.size(0), torch.max(lens).item()
- mask = torch.arange(max_lens).to(lens.device).view(1, max_lens)
- mask = mask.expand(bsz, -1) >= lens.view(bsz, 1).expand(-1, max_lens)
- return mask
-
-
-# lens: torch.LongTensor
-# returns: torch.BoolTensor
-def lengths_to_mask(lens):
- return ~lengths_to_padding_mask(lens)
-
-
-def get_buckets(sizes, num_buckets):
- buckets = np.unique(
- np.percentile(
- sizes,
- np.linspace(0, 100, num_buckets + 1),
- interpolation='lower',
- )[1:]
- )
- return buckets
-
-
-def get_bucketed_sizes(orig_sizes, buckets):
- sizes = np.copy(orig_sizes)
- assert np.min(sizes) >= 0
- start_val = -1
- for end_val in buckets:
- mask = (sizes > start_val) & (sizes <= end_val)
- sizes[mask] = end_val
- start_val = end_val
- return sizes
-
-
-
-def _find_extra_valid_paths(dataset_path: str) -> set:
- paths = utils.split_paths(dataset_path)
- all_valid_paths = set()
- for sub_dir in paths:
- contents = PathManager.ls(sub_dir)
- valid_paths = [c for c in contents if re.match("valid*[0-9].*", c) is not None]
- all_valid_paths |= {os.path.basename(p) for p in valid_paths}
- # Remove .bin, .idx etc
- roots = {os.path.splitext(p)[0] for p in all_valid_paths}
- return roots
-
-
-def raise_if_valid_subsets_unintentionally_ignored(train_cfg) -> None:
- """Raises if there are paths matching 'valid*[0-9].*' which are not combined or ignored."""
- if (
- train_cfg.dataset.ignore_unused_valid_subsets
- or train_cfg.dataset.combine_valid_subsets
- or train_cfg.dataset.disable_validation
- or not hasattr(train_cfg.task, "data")
- ):
- return
- other_paths = _find_extra_valid_paths(train_cfg.task.data)
- specified_subsets = train_cfg.dataset.valid_subset.split(",")
- ignored_paths = [p for p in other_paths if p not in specified_subsets]
- if ignored_paths:
- advice = "Set --combine-val to combine them or --ignore-unused-valid-subsets to ignore them."
- msg = f"Valid paths {ignored_paths} will be ignored. {advice}"
- raise ValueError(msg)
diff --git a/spaces/Ibtehaj10/cheating-detection-FYP/generate_keys.py b/spaces/Ibtehaj10/cheating-detection-FYP/generate_keys.py
deleted file mode 100644
index 997135fada594e5b17f64a219bbd8b44f1463cfa..0000000000000000000000000000000000000000
--- a/spaces/Ibtehaj10/cheating-detection-FYP/generate_keys.py
+++ /dev/null
@@ -1,17 +0,0 @@
-import pickle
-from pathlib import Path
-import streamlit_authenticator as stauth
-# print("Done !!!")
-
-names = ["dmin", "ser"]
-
-username =["admin", "user"]
-
-password =["admin123", "user123"]
-
-hashed_passwords =stauth.Hasher(password).generate()
-
-file_path = Path(__file__).parent / "hashed_pw.pkl"
-
-with file_path.open("wb") as file:
- pickle.dump(hashed_passwords, file)
diff --git a/spaces/JFoz/CoherentControl/app_pose.py b/spaces/JFoz/CoherentControl/app_pose.py
deleted file mode 100644
index 60523d1b77ac8a81575a5f1f98f599f8e05cfb1b..0000000000000000000000000000000000000000
--- a/spaces/JFoz/CoherentControl/app_pose.py
+++ /dev/null
@@ -1,67 +0,0 @@
-from model import Model
-import gradio as gr
-
-examples = [
- ['Motion 1', "An astronaut dancing in the outer space"],
- ['Motion 2', "An astronaut dancing in the outer space"],
- ['Motion 3', "An astronaut dancing in the outer space"],
- ['Motion 4', "An astronaut dancing in the outer space"],
- ['Motion 5', "An astronaut dancing in the outer space"],
-]
-
-
-def create_demo(model: Model):
- with gr.Blocks() as demo:
- with gr.Row():
- gr.Markdown('## Text and Pose Conditional Video Generation')
-
- with gr.Row():
- gr.Markdown(
- 'Selection: **one motion** and a **prompt**, or use the examples below.')
- with gr.Column():
- gallery_pose_sequence = gr.Gallery(label="Pose Sequence", value=[('__assets__/poses_skeleton_gifs/dance1.gif', "Motion 1"), ('__assets__/poses_skeleton_gifs/dance2.gif', "Motion 2"), (
- '__assets__/poses_skeleton_gifs/dance3.gif', "Motion 3"), ('__assets__/poses_skeleton_gifs/dance4.gif', "Motion 4"), ('__assets__/poses_skeleton_gifs/dance5.gif', "Motion 5")]).style(grid=[2], height="auto")
- input_video_path = gr.Textbox(
- label="Pose Sequence", visible=False, value="Motion 1")
- gr.Markdown("## Selection")
- pose_sequence_selector = gr.Markdown(
- 'Pose Sequence: **Motion 1**')
- with gr.Column():
- prompt = gr.Textbox(label='Prompt')
- run_button = gr.Button(label='Run')
- with gr.Column():
- result = gr.Image(label="Generated Video")
-
- input_video_path.change(on_video_path_update,
- None, pose_sequence_selector)
-
- gallery_pose_sequence.select(
- pose_gallery_callback, None, input_video_path)
-
- inputs = [
- input_video_path,
- prompt,
- ]
-
- gr.Examples(examples=examples,
- inputs=inputs,
- outputs=result,
- fn=model.process_controlnet_pose,
- # cache_examples=on_huggingspace,
- cache_examples=False,
- run_on_click=False,
- )
-
- run_button.click(fn=model.process_controlnet_pose,
- inputs=inputs,
- outputs=result,)
-
- return demo
-
-
-def on_video_path_update(evt: gr.EventData):
- return f'Selection: **{evt._data}**'
-
-
-def pose_gallery_callback(evt: gr.SelectData):
- return f"Motion {evt.index+1}"
diff --git a/spaces/JohnSmith9982/ChuanhuChatGPT_Beta/modules/models/PaLM.py b/spaces/JohnSmith9982/ChuanhuChatGPT_Beta/modules/models/PaLM.py
deleted file mode 100644
index 8e77e8fe13004ffbd7665a29957b7567af3af80a..0000000000000000000000000000000000000000
--- a/spaces/JohnSmith9982/ChuanhuChatGPT_Beta/modules/models/PaLM.py
+++ /dev/null
@@ -1,11 +0,0 @@
-from .base_model import BaseLLMModel, CallbackToIterator, ChuanhuCallbackHandler
-from langchain.chat_models import ChatGooglePalm
-import os
-
-class PaLM_Client(BaseLLMModel):
- def __init__(self, model_name, user="") -> None:
- super().__init__(model_name, user)
- self.llm = ChatGooglePalm(google_api_key=os.environ["GOOGLE_PALM_API_KEY"])
-
- def get_answer_at_once(self):
- self.llm.generate(self.history)
\ No newline at end of file
diff --git a/spaces/KPCGD/bingo/src/components/header.tsx b/spaces/KPCGD/bingo/src/components/header.tsx
deleted file mode 100644
index dc298b722154d1ac6d7a7e148204605562d6cc58..0000000000000000000000000000000000000000
--- a/spaces/KPCGD/bingo/src/components/header.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import * as React from 'react'
-import { UserMenu } from './user-menu'
-
-export async function Header() {
- return (
-
- )
-}
diff --git a/spaces/KaygNas/cut-it/mocks/handlers/index.ts b/spaces/KaygNas/cut-it/mocks/handlers/index.ts
deleted file mode 100644
index 50737a56e06c1beb8bb3d832ee9761ddf9f35b86..0000000000000000000000000000000000000000
--- a/spaces/KaygNas/cut-it/mocks/handlers/index.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-const modules = import.meta.glob('./*.handlers.ts', { eager: true })
-const subHandlers = Object.values(modules).map((m: any) => m.default)
-
-function concat(...args: T[]) {
- if (args.length === 0)
- return []
- return args[0].concat(...args.slice(1))
-}
-
-export const handlers = concat(...subHandlers)
diff --git a/spaces/Kirihasan/rvc-holo/app.py b/spaces/Kirihasan/rvc-holo/app.py
deleted file mode 100644
index d1d4fb32cf4b9622530b9fdba4af2ffea3a48c79..0000000000000000000000000000000000000000
--- a/spaces/Kirihasan/rvc-holo/app.py
+++ /dev/null
@@ -1,188 +0,0 @@
-import os
-import json
-import argparse
-import traceback
-import logging
-import gradio as gr
-import numpy as np
-import librosa
-import torch
-import asyncio
-import edge_tts
-from datetime import datetime
-from fairseq import checkpoint_utils
-from infer_pack.models import SynthesizerTrnMs256NSFsid, SynthesizerTrnMs256NSFsid_nono
-from vc_infer_pipeline import VC
-from config import (
- is_half,
- device
-)
-logging.getLogger("numba").setLevel(logging.WARNING)
-limitation = os.getenv("SYSTEM") == "spaces" # limit audio length in huggingface spaces
-
-def create_vc_fn(tgt_sr, net_g, vc, if_f0, file_index, file_big_npy):
- def vc_fn(
- input_audio,
- f0_up_key,
- f0_method,
- index_rate,
- tts_mode,
- tts_text,
- tts_voice
- ):
- try:
- if tts_mode:
- if len(tts_text) > 100 and limitation:
- return "Text is too long", None
- if tts_text is None or tts_voice is None:
- return "You need to enter text and select a voice", None
- asyncio.run(edge_tts.Communicate(tts_text, "-".join(tts_voice.split('-')[:-1])).save("tts.mp3"))
- audio, sr = librosa.load("tts.mp3", sr=16000, mono=True)
- else:
- if args.files:
- audio, sr = librosa.load(input_audio, sr=16000, mono=True)
- else:
- if input_audio is None:
- return "You need to upload an audio", None
- sampling_rate, audio = input_audio
- duration = audio.shape[0] / sampling_rate
- if duration > 20 and limitation:
- return "Please upload an audio file that is less than 20 seconds. If you need to generate a longer audio file, please use Colab.", None
- audio = (audio / np.iinfo(audio.dtype).max).astype(np.float32)
- if len(audio.shape) > 1:
- audio = librosa.to_mono(audio.transpose(1, 0))
- if sampling_rate != 16000:
- audio = librosa.resample(audio, orig_sr=sampling_rate, target_sr=16000)
- times = [0, 0, 0]
- f0_up_key = int(f0_up_key)
- audio_opt = vc.pipeline(
- hubert_model,
- net_g,
- 0,
- audio,
- times,
- f0_up_key,
- f0_method,
- file_index,
- file_big_npy,
- index_rate,
- if_f0,
- )
- print(
- f"[{datetime.now().strftime('%Y-%m-%d %H:%M')}]: npy: {times[0]}, f0: {times[1]}s, infer: {times[2]}s"
- )
- return "Success", (tgt_sr, audio_opt)
- except:
- info = traceback.format_exc()
- print(info)
- return info, (None, None)
- return vc_fn
-
-def load_hubert():
- global hubert_model
- models, _, _ = checkpoint_utils.load_model_ensemble_and_task(
- ["hubert_base.pt"],
- suffix="",
- )
- hubert_model = models[0]
- hubert_model = hubert_model.to(device)
- if is_half:
- hubert_model = hubert_model.half()
- else:
- hubert_model = hubert_model.float()
- hubert_model.eval()
-
-def change_to_tts_mode(tts_mode):
- if tts_mode:
- return gr.Audio.update(visible=False), gr.Textbox.update(visible=True), gr.Dropdown.update(visible=True)
- else:
- return gr.Audio.update(visible=True), gr.Textbox.update(visible=False), gr.Dropdown.update(visible=False)
-
-if __name__ == '__main__':
- parser = argparse.ArgumentParser()
- parser.add_argument('--api', action="store_true", default=False)
- parser.add_argument("--share", action="store_true", default=False, help="share gradio app")
- parser.add_argument("--files", action="store_true", default=False, help="load audio from path")
- args, unknown = parser.parse_known_args()
- load_hubert()
- models = []
- tts_voice_list = asyncio.get_event_loop().run_until_complete(edge_tts.list_voices())
- voices = [f"{v['ShortName']}-{v['Gender']}" for v in tts_voice_list]
- with open("weights/model_info.json", "r", encoding="utf-8") as f:
- models_info = json.load(f)
- for name, info in models_info.items():
- if not info['enable']:
- continue
- title = info['title']
- author = info.get("author", None)
- cover = f"weights/{name}/{info['cover']}"
- index = f"weights/{name}/{info['feature_retrieval_library']}"
- npy = f"weights/{name}/{info['feature_file']}"
- cpt = torch.load(f"weights/{name}/{name}.pth", map_location="cpu")
- tgt_sr = cpt["config"][-1]
- cpt["config"][-3] = cpt["weight"]["emb_g.weight"].shape[0] # n_spk
- if_f0 = cpt.get("f0", 1)
- if if_f0 == 1:
- net_g = SynthesizerTrnMs256NSFsid(*cpt["config"], is_half=is_half)
- else:
- net_g = SynthesizerTrnMs256NSFsid_nono(*cpt["config"])
- del net_g.enc_q
- print(net_g.load_state_dict(cpt["weight"], strict=False)) # 不加这一行清不干净, 真奇葩
- net_g.eval().to(device)
- if is_half:
- net_g = net_g.half()
- else:
- net_g = net_g.float()
- vc = VC(tgt_sr, device, is_half)
- models.append((name, title, author, cover, create_vc_fn(tgt_sr, net_g, vc, if_f0, index, npy)))
- with gr.Blocks() as app:
- gr.Markdown(
- "# RVC Models\n"
- "## The input audio should be clean and pure voice without background music.\n"
- "\n\n"
- "[](https://colab.research.google.com/drive/12rbZk9CoXD1m84dqBW5IKMBjiVY6tcoj?usp=share_link)\n\n"
- "[](https://huggingface.co/spaces/ardha27pi/rvc-models?duplicate=true)\n\n"
- "[](https://github.com/ardha27/AI-Song-Cover-RVC)\n\n"
- "[](https://ko-fi.com/R6R7AH1FA)\n\n"
- )
- with gr.Tabs():
- for (name, title, author, cover, vc_fn) in models:
- with gr.TabItem(name):
- with gr.Row():
- gr.Markdown(
- ''
- f'
{title}
\n'+
- (f'
Model author: {author}
' if author else "")+
- (f'

' if cover else "")+
- '
'
- )
- with gr.Row():
- with gr.Column():
- if args.files:
- vc_input = gr.Textbox(label="Input audio path")
- else:
- vc_input = gr.Audio(label="Input audio"+' (less than 20 seconds)' if limitation else '')
- vc_transpose = gr.Number(label="Transpose", value=0)
- vc_f0method = gr.Radio(
- label="Pitch extraction algorithm, PM is fast but Harvest is better for low frequencies",
- choices=["pm", "harvest"],
- value="pm",
- interactive=True,
- )
- vc_index_ratio = gr.Slider(
- minimum=0,
- maximum=1,
- label="Retrieval feature ratio",
- value=0.6,
- interactive=True,
- )
- tts_mode = gr.Checkbox(label="tts (use edge-tts as input)", value=False)
- tts_text = gr.Textbox(visible=False,label="TTS text (100 words limitation)" if limitation else "TTS text")
- tts_voice = gr.Dropdown(label="Edge-tts speaker", choices=voices, visible=False, allow_custom_value=False, value="en-US-AnaNeural-Female")
- vc_submit = gr.Button("Generate", variant="primary")
- with gr.Column():
- vc_output1 = gr.Textbox(label="Output Message")
- vc_output2 = gr.Audio(label="Output Audio")
- vc_submit.click(vc_fn, [vc_input, vc_transpose, vc_f0method, vc_index_ratio, tts_mode, tts_text, tts_voice], [vc_output1, vc_output2])
- tts_mode.change(change_to_tts_mode, [tts_mode], [vc_input, tts_text, tts_voice])
- app.queue(concurrency_count=1, max_size=20, api_open=args.api).launch(share=args.share)
\ No newline at end of file
diff --git a/spaces/Kirihasan/rvc-holo/infer_pack/modules.py b/spaces/Kirihasan/rvc-holo/infer_pack/modules.py
deleted file mode 100644
index 960481cedad9a6106f2bf0b9e86e82b120f7b33f..0000000000000000000000000000000000000000
--- a/spaces/Kirihasan/rvc-holo/infer_pack/modules.py
+++ /dev/null
@@ -1,522 +0,0 @@
-import copy
-import math
-import numpy as np
-import scipy
-import torch
-from torch import nn
-from torch.nn import functional as F
-
-from torch.nn import Conv1d, ConvTranspose1d, AvgPool1d, Conv2d
-from torch.nn.utils import weight_norm, remove_weight_norm
-
-from infer_pack import commons
-from infer_pack.commons import init_weights, get_padding
-from infer_pack.transforms import piecewise_rational_quadratic_transform
-
-
-LRELU_SLOPE = 0.1
-
-
-class LayerNorm(nn.Module):
- def __init__(self, channels, eps=1e-5):
- super().__init__()
- self.channels = channels
- self.eps = eps
-
- self.gamma = nn.Parameter(torch.ones(channels))
- self.beta = nn.Parameter(torch.zeros(channels))
-
- def forward(self, x):
- x = x.transpose(1, -1)
- x = F.layer_norm(x, (self.channels,), self.gamma, self.beta, self.eps)
- return x.transpose(1, -1)
-
-
-class ConvReluNorm(nn.Module):
- def __init__(
- self,
- in_channels,
- hidden_channels,
- out_channels,
- kernel_size,
- n_layers,
- p_dropout,
- ):
- super().__init__()
- self.in_channels = in_channels
- self.hidden_channels = hidden_channels
- self.out_channels = out_channels
- self.kernel_size = kernel_size
- self.n_layers = n_layers
- self.p_dropout = p_dropout
- assert n_layers > 1, "Number of layers should be larger than 0."
-
- self.conv_layers = nn.ModuleList()
- self.norm_layers = nn.ModuleList()
- self.conv_layers.append(
- nn.Conv1d(
- in_channels, hidden_channels, kernel_size, padding=kernel_size // 2
- )
- )
- self.norm_layers.append(LayerNorm(hidden_channels))
- self.relu_drop = nn.Sequential(nn.ReLU(), nn.Dropout(p_dropout))
- for _ in range(n_layers - 1):
- self.conv_layers.append(
- nn.Conv1d(
- hidden_channels,
- hidden_channels,
- kernel_size,
- padding=kernel_size // 2,
- )
- )
- self.norm_layers.append(LayerNorm(hidden_channels))
- self.proj = nn.Conv1d(hidden_channels, out_channels, 1)
- self.proj.weight.data.zero_()
- self.proj.bias.data.zero_()
-
- def forward(self, x, x_mask):
- x_org = x
- for i in range(self.n_layers):
- x = self.conv_layers[i](x * x_mask)
- x = self.norm_layers[i](x)
- x = self.relu_drop(x)
- x = x_org + self.proj(x)
- return x * x_mask
-
-
-class DDSConv(nn.Module):
- """
- Dialted and Depth-Separable Convolution
- """
-
- def __init__(self, channels, kernel_size, n_layers, p_dropout=0.0):
- super().__init__()
- self.channels = channels
- self.kernel_size = kernel_size
- self.n_layers = n_layers
- self.p_dropout = p_dropout
-
- self.drop = nn.Dropout(p_dropout)
- self.convs_sep = nn.ModuleList()
- self.convs_1x1 = nn.ModuleList()
- self.norms_1 = nn.ModuleList()
- self.norms_2 = nn.ModuleList()
- for i in range(n_layers):
- dilation = kernel_size**i
- padding = (kernel_size * dilation - dilation) // 2
- self.convs_sep.append(
- nn.Conv1d(
- channels,
- channels,
- kernel_size,
- groups=channels,
- dilation=dilation,
- padding=padding,
- )
- )
- self.convs_1x1.append(nn.Conv1d(channels, channels, 1))
- self.norms_1.append(LayerNorm(channels))
- self.norms_2.append(LayerNorm(channels))
-
- def forward(self, x, x_mask, g=None):
- if g is not None:
- x = x + g
- for i in range(self.n_layers):
- y = self.convs_sep[i](x * x_mask)
- y = self.norms_1[i](y)
- y = F.gelu(y)
- y = self.convs_1x1[i](y)
- y = self.norms_2[i](y)
- y = F.gelu(y)
- y = self.drop(y)
- x = x + y
- return x * x_mask
-
-
-class WN(torch.nn.Module):
- def __init__(
- self,
- hidden_channels,
- kernel_size,
- dilation_rate,
- n_layers,
- gin_channels=0,
- p_dropout=0,
- ):
- super(WN, self).__init__()
- assert kernel_size % 2 == 1
- self.hidden_channels = hidden_channels
- self.kernel_size = (kernel_size,)
- self.dilation_rate = dilation_rate
- self.n_layers = n_layers
- self.gin_channels = gin_channels
- self.p_dropout = p_dropout
-
- self.in_layers = torch.nn.ModuleList()
- self.res_skip_layers = torch.nn.ModuleList()
- self.drop = nn.Dropout(p_dropout)
-
- if gin_channels != 0:
- cond_layer = torch.nn.Conv1d(
- gin_channels, 2 * hidden_channels * n_layers, 1
- )
- self.cond_layer = torch.nn.utils.weight_norm(cond_layer, name="weight")
-
- for i in range(n_layers):
- dilation = dilation_rate**i
- padding = int((kernel_size * dilation - dilation) / 2)
- in_layer = torch.nn.Conv1d(
- hidden_channels,
- 2 * hidden_channels,
- kernel_size,
- dilation=dilation,
- padding=padding,
- )
- in_layer = torch.nn.utils.weight_norm(in_layer, name="weight")
- self.in_layers.append(in_layer)
-
- # last one is not necessary
- if i < n_layers - 1:
- res_skip_channels = 2 * hidden_channels
- else:
- res_skip_channels = hidden_channels
-
- res_skip_layer = torch.nn.Conv1d(hidden_channels, res_skip_channels, 1)
- res_skip_layer = torch.nn.utils.weight_norm(res_skip_layer, name="weight")
- self.res_skip_layers.append(res_skip_layer)
-
- def forward(self, x, x_mask, g=None, **kwargs):
- output = torch.zeros_like(x)
- n_channels_tensor = torch.IntTensor([self.hidden_channels])
-
- if g is not None:
- g = self.cond_layer(g)
-
- for i in range(self.n_layers):
- x_in = self.in_layers[i](x)
- if g is not None:
- cond_offset = i * 2 * self.hidden_channels
- g_l = g[:, cond_offset : cond_offset + 2 * self.hidden_channels, :]
- else:
- g_l = torch.zeros_like(x_in)
-
- acts = commons.fused_add_tanh_sigmoid_multiply(x_in, g_l, n_channels_tensor)
- acts = self.drop(acts)
-
- res_skip_acts = self.res_skip_layers[i](acts)
- if i < self.n_layers - 1:
- res_acts = res_skip_acts[:, : self.hidden_channels, :]
- x = (x + res_acts) * x_mask
- output = output + res_skip_acts[:, self.hidden_channels :, :]
- else:
- output = output + res_skip_acts
- return output * x_mask
-
- def remove_weight_norm(self):
- if self.gin_channels != 0:
- torch.nn.utils.remove_weight_norm(self.cond_layer)
- for l in self.in_layers:
- torch.nn.utils.remove_weight_norm(l)
- for l in self.res_skip_layers:
- torch.nn.utils.remove_weight_norm(l)
-
-
-class ResBlock1(torch.nn.Module):
- def __init__(self, channels, kernel_size=3, dilation=(1, 3, 5)):
- super(ResBlock1, self).__init__()
- self.convs1 = nn.ModuleList(
- [
- weight_norm(
- Conv1d(
- channels,
- channels,
- kernel_size,
- 1,
- dilation=dilation[0],
- padding=get_padding(kernel_size, dilation[0]),
- )
- ),
- weight_norm(
- Conv1d(
- channels,
- channels,
- kernel_size,
- 1,
- dilation=dilation[1],
- padding=get_padding(kernel_size, dilation[1]),
- )
- ),
- weight_norm(
- Conv1d(
- channels,
- channels,
- kernel_size,
- 1,
- dilation=dilation[2],
- padding=get_padding(kernel_size, dilation[2]),
- )
- ),
- ]
- )
- self.convs1.apply(init_weights)
-
- self.convs2 = nn.ModuleList(
- [
- weight_norm(
- Conv1d(
- channels,
- channels,
- kernel_size,
- 1,
- dilation=1,
- padding=get_padding(kernel_size, 1),
- )
- ),
- weight_norm(
- Conv1d(
- channels,
- channels,
- kernel_size,
- 1,
- dilation=1,
- padding=get_padding(kernel_size, 1),
- )
- ),
- weight_norm(
- Conv1d(
- channels,
- channels,
- kernel_size,
- 1,
- dilation=1,
- padding=get_padding(kernel_size, 1),
- )
- ),
- ]
- )
- self.convs2.apply(init_weights)
-
- def forward(self, x, x_mask=None):
- for c1, c2 in zip(self.convs1, self.convs2):
- xt = F.leaky_relu(x, LRELU_SLOPE)
- if x_mask is not None:
- xt = xt * x_mask
- xt = c1(xt)
- xt = F.leaky_relu(xt, LRELU_SLOPE)
- if x_mask is not None:
- xt = xt * x_mask
- xt = c2(xt)
- x = xt + x
- if x_mask is not None:
- x = x * x_mask
- return x
-
- def remove_weight_norm(self):
- for l in self.convs1:
- remove_weight_norm(l)
- for l in self.convs2:
- remove_weight_norm(l)
-
-
-class ResBlock2(torch.nn.Module):
- def __init__(self, channels, kernel_size=3, dilation=(1, 3)):
- super(ResBlock2, self).__init__()
- self.convs = nn.ModuleList(
- [
- weight_norm(
- Conv1d(
- channels,
- channels,
- kernel_size,
- 1,
- dilation=dilation[0],
- padding=get_padding(kernel_size, dilation[0]),
- )
- ),
- weight_norm(
- Conv1d(
- channels,
- channels,
- kernel_size,
- 1,
- dilation=dilation[1],
- padding=get_padding(kernel_size, dilation[1]),
- )
- ),
- ]
- )
- self.convs.apply(init_weights)
-
- def forward(self, x, x_mask=None):
- for c in self.convs:
- xt = F.leaky_relu(x, LRELU_SLOPE)
- if x_mask is not None:
- xt = xt * x_mask
- xt = c(xt)
- x = xt + x
- if x_mask is not None:
- x = x * x_mask
- return x
-
- def remove_weight_norm(self):
- for l in self.convs:
- remove_weight_norm(l)
-
-
-class Log(nn.Module):
- def forward(self, x, x_mask, reverse=False, **kwargs):
- if not reverse:
- y = torch.log(torch.clamp_min(x, 1e-5)) * x_mask
- logdet = torch.sum(-y, [1, 2])
- return y, logdet
- else:
- x = torch.exp(x) * x_mask
- return x
-
-
-class Flip(nn.Module):
- def forward(self, x, *args, reverse=False, **kwargs):
- x = torch.flip(x, [1])
- if not reverse:
- logdet = torch.zeros(x.size(0)).to(dtype=x.dtype, device=x.device)
- return x, logdet
- else:
- return x
-
-
-class ElementwiseAffine(nn.Module):
- def __init__(self, channels):
- super().__init__()
- self.channels = channels
- self.m = nn.Parameter(torch.zeros(channels, 1))
- self.logs = nn.Parameter(torch.zeros(channels, 1))
-
- def forward(self, x, x_mask, reverse=False, **kwargs):
- if not reverse:
- y = self.m + torch.exp(self.logs) * x
- y = y * x_mask
- logdet = torch.sum(self.logs * x_mask, [1, 2])
- return y, logdet
- else:
- x = (x - self.m) * torch.exp(-self.logs) * x_mask
- return x
-
-
-class ResidualCouplingLayer(nn.Module):
- def __init__(
- self,
- channels,
- hidden_channels,
- kernel_size,
- dilation_rate,
- n_layers,
- p_dropout=0,
- gin_channels=0,
- mean_only=False,
- ):
- assert channels % 2 == 0, "channels should be divisible by 2"
- super().__init__()
- self.channels = channels
- self.hidden_channels = hidden_channels
- self.kernel_size = kernel_size
- self.dilation_rate = dilation_rate
- self.n_layers = n_layers
- self.half_channels = channels // 2
- self.mean_only = mean_only
-
- self.pre = nn.Conv1d(self.half_channels, hidden_channels, 1)
- self.enc = WN(
- hidden_channels,
- kernel_size,
- dilation_rate,
- n_layers,
- p_dropout=p_dropout,
- gin_channels=gin_channels,
- )
- self.post = nn.Conv1d(hidden_channels, self.half_channels * (2 - mean_only), 1)
- self.post.weight.data.zero_()
- self.post.bias.data.zero_()
-
- def forward(self, x, x_mask, g=None, reverse=False):
- x0, x1 = torch.split(x, [self.half_channels] * 2, 1)
- h = self.pre(x0) * x_mask
- h = self.enc(h, x_mask, g=g)
- stats = self.post(h) * x_mask
- if not self.mean_only:
- m, logs = torch.split(stats, [self.half_channels] * 2, 1)
- else:
- m = stats
- logs = torch.zeros_like(m)
-
- if not reverse:
- x1 = m + x1 * torch.exp(logs) * x_mask
- x = torch.cat([x0, x1], 1)
- logdet = torch.sum(logs, [1, 2])
- return x, logdet
- else:
- x1 = (x1 - m) * torch.exp(-logs) * x_mask
- x = torch.cat([x0, x1], 1)
- return x
-
- def remove_weight_norm(self):
- self.enc.remove_weight_norm()
-
-
-class ConvFlow(nn.Module):
- def __init__(
- self,
- in_channels,
- filter_channels,
- kernel_size,
- n_layers,
- num_bins=10,
- tail_bound=5.0,
- ):
- super().__init__()
- self.in_channels = in_channels
- self.filter_channels = filter_channels
- self.kernel_size = kernel_size
- self.n_layers = n_layers
- self.num_bins = num_bins
- self.tail_bound = tail_bound
- self.half_channels = in_channels // 2
-
- self.pre = nn.Conv1d(self.half_channels, filter_channels, 1)
- self.convs = DDSConv(filter_channels, kernel_size, n_layers, p_dropout=0.0)
- self.proj = nn.Conv1d(
- filter_channels, self.half_channels * (num_bins * 3 - 1), 1
- )
- self.proj.weight.data.zero_()
- self.proj.bias.data.zero_()
-
- def forward(self, x, x_mask, g=None, reverse=False):
- x0, x1 = torch.split(x, [self.half_channels] * 2, 1)
- h = self.pre(x0)
- h = self.convs(h, x_mask, g=g)
- h = self.proj(h) * x_mask
-
- b, c, t = x0.shape
- h = h.reshape(b, c, -1, t).permute(0, 1, 3, 2) # [b, cx?, t] -> [b, c, t, ?]
-
- unnormalized_widths = h[..., : self.num_bins] / math.sqrt(self.filter_channels)
- unnormalized_heights = h[..., self.num_bins : 2 * self.num_bins] / math.sqrt(
- self.filter_channels
- )
- unnormalized_derivatives = h[..., 2 * self.num_bins :]
-
- x1, logabsdet = piecewise_rational_quadratic_transform(
- x1,
- unnormalized_widths,
- unnormalized_heights,
- unnormalized_derivatives,
- inverse=reverse,
- tails="linear",
- tail_bound=self.tail_bound,
- )
-
- x = torch.cat([x0, x1], 1) * x_mask
- logdet = torch.sum(logabsdet * x_mask, [1, 2])
- if not reverse:
- return x, logdet
- else:
- return x
diff --git a/spaces/KyanChen/RSPrompter/mmdet/models/roi_heads/roi_extractors/generic_roi_extractor.py b/spaces/KyanChen/RSPrompter/mmdet/models/roi_heads/roi_extractors/generic_roi_extractor.py
deleted file mode 100644
index 39d4c90135d853404d564391f029558841ac9cac..0000000000000000000000000000000000000000
--- a/spaces/KyanChen/RSPrompter/mmdet/models/roi_heads/roi_extractors/generic_roi_extractor.py
+++ /dev/null
@@ -1,102 +0,0 @@
-# Copyright (c) OpenMMLab. All rights reserved.
-from typing import Optional, Tuple
-
-from mmcv.cnn.bricks import build_plugin_layer
-from torch import Tensor
-
-from mmdet.registry import MODELS
-from mmdet.utils import OptConfigType
-from .base_roi_extractor import BaseRoIExtractor
-
-
-@MODELS.register_module()
-class GenericRoIExtractor(BaseRoIExtractor):
- """Extract RoI features from all level feature maps levels.
-
- This is the implementation of `A novel Region of Interest Extraction Layer
- for Instance Segmentation `_.
-
- Args:
- aggregation (str): The method to aggregate multiple feature maps.
- Options are 'sum', 'concat'. Defaults to 'sum'.
- pre_cfg (:obj:`ConfigDict` or dict): Specify pre-processing modules.
- Defaults to None.
- post_cfg (:obj:`ConfigDict` or dict): Specify post-processing modules.
- Defaults to None.
- kwargs (keyword arguments): Arguments that are the same
- as :class:`BaseRoIExtractor`.
- """
-
- def __init__(self,
- aggregation: str = 'sum',
- pre_cfg: OptConfigType = None,
- post_cfg: OptConfigType = None,
- **kwargs) -> None:
- super().__init__(**kwargs)
-
- assert aggregation in ['sum', 'concat']
-
- self.aggregation = aggregation
- self.with_post = post_cfg is not None
- self.with_pre = pre_cfg is not None
- # build pre/post processing modules
- if self.with_post:
- self.post_module = build_plugin_layer(post_cfg, '_post_module')[1]
- if self.with_pre:
- self.pre_module = build_plugin_layer(pre_cfg, '_pre_module')[1]
-
- def forward(self,
- feats: Tuple[Tensor],
- rois: Tensor,
- roi_scale_factor: Optional[float] = None) -> Tensor:
- """Extractor ROI feats.
-
- Args:
- feats (Tuple[Tensor]): Multi-scale features.
- rois (Tensor): RoIs with the shape (n, 5) where the first
- column indicates batch id of each RoI.
- roi_scale_factor (Optional[float]): RoI scale factor.
- Defaults to None.
-
- Returns:
- Tensor: RoI feature.
- """
- out_size = self.roi_layers[0].output_size
- num_levels = len(feats)
- roi_feats = feats[0].new_zeros(
- rois.size(0), self.out_channels, *out_size)
-
- # some times rois is an empty tensor
- if roi_feats.shape[0] == 0:
- return roi_feats
-
- if num_levels == 1:
- return self.roi_layers[0](feats[0], rois)
-
- if roi_scale_factor is not None:
- rois = self.roi_rescale(rois, roi_scale_factor)
-
- # mark the starting channels for concat mode
- start_channels = 0
- for i in range(num_levels):
- roi_feats_t = self.roi_layers[i](feats[i], rois)
- end_channels = start_channels + roi_feats_t.size(1)
- if self.with_pre:
- # apply pre-processing to a RoI extracted from each layer
- roi_feats_t = self.pre_module(roi_feats_t)
- if self.aggregation == 'sum':
- # and sum them all
- roi_feats += roi_feats_t
- else:
- # and concat them along channel dimension
- roi_feats[:, start_channels:end_channels] = roi_feats_t
- # update channels starting position
- start_channels = end_channels
- # check if concat channels match at the end
- if self.aggregation == 'concat':
- assert start_channels == self.out_channels
-
- if self.with_post:
- # apply post-processing before return the result
- roi_feats = self.post_module(roi_feats)
- return roi_feats
diff --git a/spaces/Lajonbot/Chatbot-Share/README.md b/spaces/Lajonbot/Chatbot-Share/README.md
deleted file mode 100644
index 51e89f46c1eec000e951f8ee45cd8f820d937234..0000000000000000000000000000000000000000
--- a/spaces/Lajonbot/Chatbot-Share/README.md
+++ /dev/null
@@ -1,14 +0,0 @@
----
-title: Lp Music Caps
-emoji: 🎵🎵🎵
-colorFrom: purple
-colorTo: indigo
-sdk: gradio
-sdk_version: 3.33.1
-app_file: app.py
-pinned: false
-license: mit
-duplicated_from: Lajonbot/Marketplace-audio
----
-
-Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
diff --git a/spaces/LaynzKunz/Aesthetic_RVC_Inference_HF/lib/tools/get-pip.py b/spaces/LaynzKunz/Aesthetic_RVC_Inference_HF/lib/tools/get-pip.py
deleted file mode 100644
index ca93fe3cee809982109cfbcefb1400956b1f4c69..0000000000000000000000000000000000000000
--- a/spaces/LaynzKunz/Aesthetic_RVC_Inference_HF/lib/tools/get-pip.py
+++ /dev/null
@@ -1,32635 +0,0 @@
-import sys
-
-this_python = sys.version_info[:2]
-min_version = (3, 7)
-if this_python < min_version:
- message_parts = [
- "This script does not work on Python {}.{}".format(*this_python),
- "The minimum supported Python version is {}.{}.".format(*min_version),
- "Please use https://bootstrap.pypa.io/pip/{}.{}/get-pip.py instead.".format(*this_python),
- ]
- print("ERROR: " + " ".join(message_parts))
- sys.exit(1)
-
-
-import os.path
-import pkgutil
-import shutil
-import tempfile
-import argparse
-import importlib
-from base64 import b85decode
-
-
-def include_setuptools(args):
- """
- Install setuptools only if absent and not excluded.
- """
- cli = not args.no_setuptools
- env = not os.environ.get("PIP_NO_SETUPTOOLS")
- absent = not importlib.util.find_spec("setuptools")
- return cli and env and absent
-
-
-def include_wheel(args):
- """
- Install wheel only if absent and not excluded.
- """
- cli = not args.no_wheel
- env = not os.environ.get("PIP_NO_WHEEL")
- absent = not importlib.util.find_spec("wheel")
- return cli and env and absent
-
-
-def determine_pip_install_arguments():
- pre_parser = argparse.ArgumentParser()
- pre_parser.add_argument("--no-setuptools", action="store_true")
- pre_parser.add_argument("--no-wheel", action="store_true")
- pre, args = pre_parser.parse_known_args()
-
- args.append("pip")
-
- if include_setuptools(pre):
- args.append("setuptools")
-
- if include_wheel(pre):
- args.append("wheel")
-
- return ["install", "--upgrade", "--force-reinstall"] + args
-
-
-def monkeypatch_for_cert(tmpdir):
- """Patches `pip install` to provide default certificate with the lowest priority.
-
- This ensures that the bundled certificates are used unless the user specifies a
- custom cert via any of pip's option passing mechanisms (config, env-var, CLI).
-
- A monkeypatch is the easiest way to achieve this, without messing too much with
- the rest of pip's internals.
- """
- from pip._internal.commands.install import InstallCommand
-
- # We want to be using the internal certificates.
- cert_path = os.path.join(tmpdir, "cacert.pem")
- with open(cert_path, "wb") as cert:
- cert.write(pkgutil.get_data("pip._vendor.certifi", "cacert.pem"))
-
- install_parse_args = InstallCommand.parse_args
-
- def cert_parse_args(self, args):
- if not self.parser.get_default_values().cert:
- # There are no user provided cert -- force use of bundled cert
- self.parser.defaults["cert"] = cert_path # calculated above
- return install_parse_args(self, args)
-
- InstallCommand.parse_args = cert_parse_args
-
-
-def bootstrap(tmpdir):
- monkeypatch_for_cert(tmpdir)
-
- # Execute the included pip and use it to install the latest pip and
- # setuptools from PyPI
- from pip._internal.cli.main import main as pip_entry_point
- args = determine_pip_install_arguments()
- sys.exit(pip_entry_point(args))
-
-
-def main():
- tmpdir = None
- try:
- # Create a temporary working directory
- tmpdir = tempfile.mkdtemp()
-
- # Unpack the zipfile into the temporary directory
- pip_zip = os.path.join(tmpdir, "pip.zip")
- with open(pip_zip, "wb") as fp:
- fp.write(b85decode(DATA.replace(b"\n", b"")))
-
- # Add the zipfile to sys.path so that we can import it
- sys.path.insert(0, pip_zip)
-
- # Run the bootstrap
- bootstrap(tmpdir=tmpdir)
- finally:
- # Clean up our temporary working directory
- if tmpdir:
- shutil.rmtree(tmpdir, ignore_errors=True)
-
-
-DATA = b"""
-P)h>@6aWAK2ml*O_EvJ33*7hs003nH000jF003}la4%n9X>MtBUtcb8c|B0UO2j}6z0X&KUUXrd;wrc
-n6ubz6s0VM$QfAw<4YV^ulDhQoop$MlK*;0e$L01LzdVw?IP-tnf*qTlkJj!Mom=viw7qw3H>hK(>
-3ZJA0oQV`^+*aO7_tw^Cd$4zs{Pl#j>6{|X*AaQ6!2wJ?w>%d+2&1X4Rc!^r6h-hMtH_d5{IF3D`nKTt~p1QY-O00;mZO7>Q7_pjHy0RRA2
-0{{RI0001RX>c!JUu|J&ZeL$6aCu!)OK;mS48HqU5b43r;JP^vOMxACEp{6QLy+m1h%E`C9MAjpBNe-
-8r;{H19{ebpf{zJ27j)n8%0=-6Z#elILRo@w9oRWWbO{z8ujDS!QAC@3T%nJCf;1rX6ghzu#Z}R@K&*?Hgj1WFD91+adaM4G`4Xs@*hA^t@nbDYdL)-aOjsW~3}QVVby(8=@7U$
-Fzj5Y{w!2hUUH`?e9j7WDA;>-1aos>7j{2$~BfyL8p@__Y98dsP#Bs7^lWF
-=e_gr;(4^?am?Cp93+7b-!?~nb}-$cPSR1zckA*zNp!)$;YjlZrfn&RWNM}=QA7*cb8A{(9@{5!vBfq
-rEMoeu5FvJZngI@N#4#(2v$WnMGCAVD?b9t8W^qDfcFBe5ZZF%dPAPaq#>ikclG~yPvCg`JUGb_W2#PdCXxx}7!|T*xc9qdnTILbO-nAJaF2
-~0snMFDU<%E01X4*yW9@|}F2;vY~;0|XQR000O88%p+8eg`F$&;kGeqy+!~6#xJLaA|NaUte%(a4
-m9mZf<3AUtcb8d3{vDZrd;nz56RT_b?l9y`mj3AXtV0MT+&(WJ!7$x|Xq_^eh*q`
-qYNbl$TgcX!{RW4b=Vw*pI`moV*K|DJ2bY*KQViviHGglIK{X_)>pN=IEr427|<0g`vfCSX-CrF6hnx-
-fU6^LzLVM{GttvQ!RX(K-@qvQ<9nZh3{TwCd*xxj~wep|+d4YrpRGd3uJ(;$x#MJ^wO(dX9-I(W~SOL
-|!j@ev4#PBd+t2O-3Y4TDlA%@&y9h}l?d7(gvc*a&O+atWdOv5|
-XtFg8N1I1Eg2~6T^Prn{|GZSIw2~Ql9c?>!a3=lwO6eT!TZzV{RAoH`=gPAEk0OKF^-L_LxAV)%Ld>V
-rC7Ea!84dqJ@cSb~%=6Dm=^V^deci#%k)qhs`k`mikNs;GRv|TRB1+w&XWHK8?pSmvO+Mn5HP0Rg&
-0e2!{O&s!2A%Oz`W5|6)QOoeMptG0vVbf-p%MA<(l*rGUrRG$G|nf0000U0RR9D
-0001RX>c!ac`kH$aAjmAj&U%1)EvFVxRjSzi=C>J@cM
-k87yJyz4~-Qcqlg}hXv}1CF`fEox?~SG{pae%Dy$pBG>tnWs3{>FohpTZSG@fe-hAmws@4PFv7Mv`H@
-JnAXTbgKqwrl)IWaYE>+%OsO9KQH0000802@m7R+hDJp-}+<06hW#02u%P0B~t=FJEbHbY*gGVQep7U
-ukY>bYEXCaCvo+F;B!W42Adn3hP*|5~K?fa1xA6Cs^1JI)&D4jnX98E~x(=w{RdN$P(+xdH(X;aUMbE
-La7HDOJ;>ViJroJQOYSq=f31Z#UCgsvZ;PjisC7~V50}YW@1zhN!C_4fs|i^>lX7r-W?|$V(y(g0ZOD
-x-5bTWf^iasXM`rih^?Sk#%z{jZl{Ri-7?Gn9_p
-NH(fR_VZQx#ZustU5xCHVj%1=)fT*F;XSi#wiQR~iuoy}(RFp&L9pfC#Zn^7Axz>2yIKB7|@~y3-1&J5eC&FySna4hw0fjd92G^LTzc+Br>7Y7w1=({
-s_3<|LwzLQl3jT^=CKlyadUgD7M{+)3>-rRJjjOO9KQH0000802@m7Rtz49V_OUW00Srh02%-Q0B~t=
-FJEbHbY*gGVQepAb!lv5UuAA~E^v9(T1#`|xDmeVS714ZB@>eSIHgphB=gYhxH9p$W;~m0sZ?Bwghq@
-hk_(WwwJ!hnbT%XT~X$2UELOWbx^D5}
-p)=7nt84rjpQ!t=bvqBu6SXjxf*{)}V#v6kjnleUMl*qKLJw7ma)>Zw|O-`#U0v?-c6x#d+}i#X$=E%t?3;qCzPO{p3XDn-l0g8$MLf}@FhxjzhJPffk$LZTb=
-tRL0mAd`8KB>SS|Ny1Wz!%10ZP4l!(Z9X~Qr(M}5e1M{2V-3vl>e`}|vFvt@s535m*|M}OlVSM$)RrHcBrimd6?lFPUdh
-^8oI-}L;caqLRJjDa?_Dr07Ysf#%z>QWYbSDW3_SKrT&dAFG`Lt`@W9KJiJ}-Jm
-Eim0UQMILLA#<&5?}IiA5v%!>tEItSETqsiWmt%EBta_NRXj{H*Zo{ba+L0f#Cr>zURR@B*qHa1TLRl
-QIY3XdTuN;Q8cY|sQ{2jC4o$vPgD13HO~sl#?~l?=&A}cMFP(CNl(yMsR`-t2i}7DFz8rYgPveC_)gi
-?sXaiv@_U|jtx7a74!l@<;4JHe05F%Q2)SdHLgXxn>Gh!i1WT2K^_-Mqe1LMOvU4R{fH+QfQ%eQYa2d
-+e#MFwQ*oaQwvhGC2wTnRW_zJ##J9Pw*x1bE%az6lfqS#7Kz)e-Rnn7GhG_W5G{(q)4xvM*rJ>eb1rMlGrLDy?OC^}{4osLlt4f7K8F}Z|`B#E1o*9RQ|@+2V@Bv`<7P)h{}C>a!R4k{Eil{;q0l?#-&mQ~4}M0|c2#OI;L{3Tudz_N!_rY+hTGzghD(#5kNVHprZaZYt##W$uR8%mb^&)N6ivKk8Fogh
-BMr8%*?0wS)XN@6p#nApa&Y-w9Ew#Zu@h&NSzS79U`3ykgq8X+X_$OD4A`np9UQ(OZ&?G>pd7)u100h
-6&Ehk$^P1yyq9_uwBi4bItZ;{YLK4idID%pU;f7}zm-6NU3Bg;MsQ)C_Xl%pd#APfelK6ZX)4MevarN3gu`&(XOy?+-ilBrvl6uD3dNNZ)`pUd=i?WZkc;yu4_~oaIcdwK6<&R*Ivfg2cB}&44
-buBuR0s5klsH#FHwVF%6r=l3b;v1Sm=o@?fr!Fer2uDL9L&_isoatz297jX@o{A}`XCC6WOfkP0%87K
-kvdJZNsFYvO_uCPfDQ#!T$k!x23L!YQl05fIp!Qum#J6eLAwB~uW~Tzhl*@BpO*0iZn3-W@i=nr-W|(
-11w{K!f#O~7gF*~{#IxcX?lmI`bj@X}m2N^O|Q*fI&p?b#N0ES?Pkc+y}Zj6*0Av01gLhWTd
-nOTbhdhE1BKPS3Fg`Z@s&2l@TrvgBPRJC~P2NN1QqdwS}`bs=5XEmp~mF78qqjMEpthH9w@9Bbi4O^<
-&W#%iuEa|8!D0@I9@+SrhW~?;jIcMk1?8@}gUVbulb{fRenF5C)Hq^fLi3aX)oB9={Aw5B1Eya}ud)zI$Kgq)lD
-w*#4Ftggw^aT0%+Vu2)HvSC$KTnIVg4EflgOXhv&oh3ZSz1L>6#^bnq(m1-OmeK*vFp=M92_79T`!l}
-{9`kKpLiSkSXPgGNTXzCM!m$>YmKH1A`kiHiQ*43y-)7dhX|M$wzbh0!*8wWuO
-$+?!aMXV))oSMbZk=4=^~Bzkn$82y9L)OTJZ?WBoqw*oo)B@x+ciJET=1kF<^8cqPG
-P!?R*vWNM|ELa#g+A5(FI=e?5HVwlmM86Sq%vDSn84<7Nu4Cy@v^93Go0~&XH@{(?4R;W-+{wnaSX4h
-dBLaWBKHJuX_r9tZX^)!C5M>y}CCk2Bg3Q180j_`3MbCnUAON=wR_Mw>=B(2!qdobEOu2v5=yT@shGM
-~r3jQ4Lc*S5nc8W7-2G(!r^M~cFZ6m}#W&xX`N#98l}tUwm`Ct`*ss)D%~d2{jaf3BD8RZT}pLU*I=(
-}#C|8y|~WONGYELk8FDK9$3V(nS{-09xll!z%G^#&nYYK%@=^l2j(@kWt-j^soOk{KTUk>+MW2)n^^6
-(IL-fyvERX*?qG*p`hD|5y$?@0$n)X&O2H;^6Ex)SV+1jP-txm+iOw9lzzJAF$`cMda)C%T
-GVJkVYGtLqIROwK@kZ{Ay>IU@jDOX%0SdYm|x;oqbm2$vloyp_(hz1t7I43OljOG#o7wOvTf?rAeARa
-|#tj9{cl%YbU1ah!CbL`!H33}dzr
-htU}qX&Y?3r~m~9(#^Nq?X+Q|_9G!Gbecu}-EupvSfdppnjX=t2xj3q;=s^aZd#RHI3bE@&IndzQQe?
-i1`zO-;MmiOM@SbDofi_1tz~EAd#Gh=@ohyX!HEeD{|0MK8X+k#$FHr^$7_}l_w`+ZnbT?no-_f_d2^
-gF__@%r^IIH%GBQ!NI72pmqqVd1vE@1Pr*4|@_{B@EF0PV~*Do$#zj*ila-FfeFvbZm^^FGfkZ#J7flbgK~uVgNF>Y#FaF`LaUF7%-+Dl7KV>@&S?9zU2OZ+>URZm
-08I^H`XRZB-mZDJ|^~e)wBFx(RzKvAh|7nx7WpE4{G`@lqRnzbUOQa+zItGP;bDTa~9p6_;}JQPNqll
-{?c=cqexYp>wOMvQqd?a(Phwky}+65WS0HZFSa?+{nDh^+sm;N5$kqW|%M-jMb-&VrJWYFY;ULN#F04
-%D&c_;;kb)4@Ign6Q{aT8=KTs))4rLN4~GJJ9cF{|Jba5iQjiDJrX0$TIOnOF^e8sbtn^X)T$NFj-8@
-{iD(+L$w!^1W||6QX|+Kfkl2FcySN}PQI%LV?h@~meaT}{!YWRZ`NhSX?_PZK;&t-(w{Ko2ub;lU!un
-ZJX>5qe<=~GOsoIK!+!4%fY?Ln9d#;VG76M;4bMf#m^kaD;@PQA1r)*v2LSj&^GbPMkK6><66k7}t3G
-%k;6qC2p4udo4tT?R?rHN8dg)qrSbuz1WRSnNFs+5(4TFfe%EoKWbTh8VSp>k7KDv@TRHLsjAy~-W$1
-1NTW?#JpWLXRdK6RW#F?EzNxpE#>lp)
-L@KQmY%OvdbHSvR#Q(wVAd@e}J8Z3r!je`je)Ck^oa=V6;$d%XlO!@K+b%*1V2d^Xy2w4ltjxNEf#-3
-%Z{ALUeFZ1U3)_(q;J7d`IZmt%WR2RXZX+EXcUxBd?R0*?FT5;q^X!cf+#1h3DP+kJ#Eet+Auqb=xQF
-Q9DDq=$BF)ebs7G3HsErkC)iV2`(78&*QQLjTPOCZkd?wy2ag;d-6k?}x1rJg}=7ORhL$$#ZPN^$zNj
-Tg>9AVKS|J*h^19BgTg-Si7jbyU#zk3OeHjX#w6z)PBwmsR4&u*u~na&oyv#6o7)N(dOcowdnwS-4$gvNc5Z?Za7Vbu|?4jtqNxFtz=&^dnjT11v;4IL1ID{P8VIaktI_HeD
-ph^a6s9Mm}XTh}^EIel%nssby5GkriNRV6AM)!D*Xygb1)d3!pB5HAL~sf^1LseG+ybyersu{iS!=M*
-kuF}3F4jbb^91EN5$b*Ak}P;HI_0()yqv%I|AL85vcWASBqD&-~0$E7x=R_5}LkN*5*=wa8h^Qz7UIU
-fvi%EVSL^kBCir+nM7d*!60Km<7sPqu|i+!T_ZXPIzO$7*Xs4&En>KIlwV0X?HObwzqXrbaTfl$l{}e1zjN>Bi_ss8)0_r(d{QhFWq$@a3>XM?j}$soOk6IBI
-&u#!le>AE~2k_cxYGN!FNPI=l!F}8{4xeyA%X@jh$HDXDyZ`<-I6shZfA>e12}YZck^uA^W39p#_)p2
-?1tXA~?YD!vm?bE50NhSCj^BGD}h;>RuQ2#i7i&_fqLqRTWi}nLKk*4+C{cI`FT+ETMNbO%(&2ZV})a
-A$64|l(d)5`Or`KCEg)Hd?>D=q(YqtM3teKWMm{m^@+;W!hw$?$yfP(7znro3iP!k!L^00BCW;vx+q
-NX+TzEJ+U|VJoPE$|UH24jzygsZkM7^8isYA9!ZY7WyC6|sYS73jlUte`zO3Aa%^$)d*#Z|nEMSSVQD
-}>o;@grJ5^0LOK=tx&yb%(S`XAOR9&=~f75q}ZKF-<~5a7#-pFZMQ;&TtGsIz)hE2gRavlZHtiLkZvY
-{ZwSV!k~w`La8T+vQ`*YDPlDZwC{UD=Zn-1a&Y^0ko|)NIqvml?~u{qy;lD}oo_g+kf^F0msufq*K--n%A)TfOG-cds<|N9Wt{C3jrdGQS^DtTw`*s)69PYV+`VKuz?ioy
-k*jhrh$Xa2Iy{pQ=Fyl3ea31xSnpRs%F+~5Fr=M|@FUGJj7EPZA#cIXKycEe0A9=P<3{}8VzrnB+QX`x)Je2|u-Qb7SFaxVx`#8w*J1
-?3mE?gP}g#VDb`lB4rk&&9(}DF1N9{N5@jA)J!i*ogX3G6MTP6My3*$(1bVg6Qn
-!M<@5_Si=GPt~X7Kslz*{=cXBHm-h3x${9v=mfe)LP!=9;k=?-iw;ej0gk3T6$LlFQ7_SU{0H>s^A5X
-RmB11KbUVj#A&NVnbCr5iDb9=9evaaM%=xCes3hP=|4Q^Ujqt`09VfB&Qhe3F5AVAI-HESy7v%BPx6i
-L$CGVeKUA;`6J$?54s&BwuR;+;#PRW5^x1{c7xm^-ibAT-SjIplI?u)PTHiPyg{W)cffQhkmQ6|=OrXGd}tA1a}6Ww-9cMttV?p{AAlI_b6x~JiL+-AL7nso0=65n;wTcxPwCEg;}^VA%A;aqSj&R;3?n
-$c0ZvFlx;`;?_X60p-s5Yv@=La!0Vlg7lsaAl+m^~pwj*M_>Vn$>pu@K3X0Djh9+SIsLaDjd@l=_sol
-#DA(LX;(&l94T@u&$%E?2W2XHVCECWWn9$hLc>O!&WNLBrg8u29`Jo7%R#nbcs~q;;hx;bqPP3bll?F3jeP|ga5#Al)jQ3x_KVI8q`TLdzllbIEagHuxU>s~JyP!>yR
-(CO7kVK@`0wzoO$a#7#)7?Z2S^$Vg-rb~G}mtJs_M#JrkmB3!{49w2^?@W>4O@Xw-K*(-ps(;%|1m^9fopm0d{)eQjvRPV
-r~Jt6SOhBZZ{nvUJ`3Uh3yHs$nK=`gHg#{t|7t9X)aIbjC#7x3p*|N?nxw$cSpgj43U}16A`8*Z>wH@
-*JIFIqUwr8gv07It?g!0&E*`rRiiI@qfLgyEvU*n3S<0rR{Oc{i2pONRc`?tYpf4{_vWiNOMZXYsa^e0Yj~!AIh~K}y6eSo2|#uEhcCW-@|c1Fd2C0wmF
-F~CKcT-qpqrVVbJF0DTl(C`SoE2_aTcP#tr!~U0bTI+ZeW_@dBeEnnCt@+J2Z)Znf|DN9VPual~~t1!
-M7Ri90X)lJFnw6b_0|XQR000O88%p+8N-^Lqfe-)y4>kY*9smFUaA|NaUukZ1WpZv|Y%gPPZf0p`b#h^JX>V>
-WaCyxe{cqbg_ILjkoQk3{=BVp#INS{Q?y|-01xu44>Bk1c&=iY~d66Z7lVj+@>r)(#x6-zXbBX-C4u;?6q0EG38$n6SIy;6Y0g76B>mk4(a3
-Az+XULh7tiTpO>Y*)yXrCcqf05G>~x8f2|UvYz)r4dd%BIH<^2+07sE1_*#v`w|Z}kB{^Hh@FT3LE8#LtQ(<>_cJ>^o;uiL5>%Da%wyb#Pq-!YY
-%>F8_Rbesb~o`tWj4om+=Dx4b%oC&1f-JJv!i>~fx~jpQ+4G=lG&^@=O1BqBEPBo?(_vlr}o1&
-~%ro(_Hyc?uhh5W)a|2P38`IUEdrzBqq-`Y!(I_n<_B4A=^31vJ}T))9{gTeItQ;h4c<
-I{KN7gy60+_>dZfeZk4u;N(>+Vz5c0DZiJ0~ITlzG5oWRnXW(@@Sx!Oo&=7?vK~gt4Xi{Y5*S4^AYK~
-F8M+%#e!D6JG=Pl_-qo~X2ngC=~dTzRq-|ZEK*Kuu1`NqCxH?b*Y9Vagse76HfPg(D`b(A?R#K>v`N7
-8t=>TLx;(v%4Wr(ko=xqt_|x$fEd~3M&T<#@Cp26z1qDiY@o9Q>b$T+5FRo6eS3oUM9cem7<`>d!za#
-ecJDlfy#iIwGj?Yd{;0`oJ
-v79`GqA_1rBFZ!PA1}gjxKvt$7(AEQnl1w&d1YE7$DmB>n=^9_R|c&Tw}
-!J2(Po}*xkJlnHU@+B}XE5NdWABr|e2plrk{(YdSPlbX2z}F!67#PzcAARBse$2-fogfN;l@*2+T3RE
-*(apucRs~@SFbeB8#J*qno}~p>v>CWpB>*8UFqna3py*>G3OE9kQN#it#3h%jq*QEQY}gJW3~T|pqR?
-MyyNd1~UIAhtmL&a0vw0XTQN&fKBb0qC69HSht~&H68MYZ0sWKB)2z(f^H$%fl(9YQN7%>IgkeG;pW`
->?@)bP_VRO4;7>OH`^S&d_%B5>ua=--9NL;N;kEiX7^KpewYC=wGJBJ?5_Dn1C&9~zyS59l9v2_6jRd
-Z$6?j8KWhm+qMaAOpQ$>>mTsA%lM@LAdBB!{EQca8xfK^tw(w!pF_378?46MkeRG$1t&c!J{3%7`7ZB
-&Unz|dO=v%<>;tQnA!ROdbh~HaDDx)UDdyU&8SOG(%6n^kye9CS!^K
-!DX=<5VSWi-2<<9aEWiRVF+h7HK={K?*i1@EkUp%0Vj3w}1Oc{E;Ds9K$Cszzogp!)z>g{x*t`*wJ~X
-TVyv{z;u@IgqI#*SN)E>F11%XGcnE~3vNrGo!voxs^O+NrbWEBK4v49N32w77?UK}zsQ
-N=Oj;@NTptBVXdGzP>ANMJL_En|!d<2tJ)e>BHbtH?QdDg4rSbG0ccEY*;QgZdqqX$=uELywNT3G?QS
-i4v{IKlXh3K_Bd`B6{BuI8XwS8dX5KHOCz>wZd$gK_Y<2fWF^91lIL;;1NuSwAw$clQM(|3^{BI-Qlp
-a(|^+ZLf%J~^}t#C)nCvcJZX?`c>99=#1{$1v>hfYykwP37I#REE}G!+EpVb%5Gs$n6Jnict8pjrP$7
-fiXT(}r_NxOAb7HmmjWYGK!+O_43lXj19v<|SFn}8Du|w}4zVgs@kwSjV(}oRC(vBf_-d
-Gcgg)FJZF2L-tQd4c~#az0_pvfehRM2LC4Z5TQZVU;BuA$|WAvucW+m8doIVA?JDQmGdJwf1cRm41n?
-4_oz_6JRpXUM#w=%-yTg;a94D{;HxsscYJ3Ms06(_S!iyA)z#DXX^LJ01h<@0{y24y;z`(guDf`b7O0
-5r)VUG)7X%eansLNUgbn#A?|ixug#Ja5(#J-lVEjwzE@+6ko{Q^g=@f8x}$cU#o_1wr$|*6=`%Y5B=X%BL*$3H4hLr%2n>|3BEEAGA3F8a!tYyGJ90%X5}*^eSVmxdN8Ka+(NEfy7Caq3Q>G0)GuYLUBor4ta(uy>;)d7?$Uy-KM#l@>EZ*?@
-80tMA#jAP4hVasWjaQI_q)0GWH`0(`;rz<^v{s7mZj+!t&%N|Yp>wu7rkzye!E1tBUakx(ql&N5*3@HZ7X%?BZeQdI7!pa;z7?k5PRs+W904N?}q4
-^&+9oE8L+@MirpRSMBc@KvyHQ%ClE*VHu)jt>sPpsxc>S2_VupjPfk?9^WLfEo)g`Ex7~gZ)l;jDYVfg&0+xP>fjh~cfPx}ui2
-!V|~l2Bj6Yi;ZsDLEzkM{7V@?!j3=&Kq^J<|mC8YX{#}YAfv&2p%VN!#NW9vIv9EQs{)NU@sL^i%YGX
-Ex}F+8AvuHuokiAU!dYpzUZ2JlF)Xh;5#`d4fRQ|uM{isvQOc~MVL2vGv4%ZOh$c~b}}mbP!eC1Jh!q
-9cEJ$Uc-dX+=nx$dF8u>c@^x`d#)Lq4HwnYfAG5z@aGV>XD;A^@Db&7Hfi&XiZ=kTQ8ET04MC}8Vl?3
-?Vpt-)#f3r&|wxD`U78^LybY@;S9hZI$JfP%a*;52{eegj(QI$k>k*SduZh@rzJuoH;8UYzSPC0ldP-
-Ky1q$-8HqYGG6gO{of65g?7Q(B$Q>ta27WH(+kBH{^IjjTb+g;)yS@`
-8-PR-d2YSvd-H`fs4LNWcA>cAw_n}|}2(dxU2QX|45ya9f|B*qXZhvS#*lOFSw+=?QoYwVaG^a~_%Z#
-%X*2=B6VP*__f3I!xciq)xUQXJ;qKdReH8%~z0^zG}e$?xpysoar#E5s#h$m`+
-P6e&<56#J*L}p#SdN@ihRQdowu!Qn2^J>!bVs5Fz`KLDhwxt;5Izn@tj&%C{KLELN^TamrU={I
-Lw&ZHENEq2bJCNJ_LE5f@ZPMoCkt)4N#BRobzO=@iE7FQ0z2&bR5K^kNTEZW7RGbAU-Rm*p%$ly+t{@
->DqZ5~yS=o)R?!WaCE%-NCE&@XVhi|P@%oZUgQ{B$`(3ghq5oSIS#w(yIZICp9be&4p=_&bx8iw|F6a
-xkWNS@RjhZ_KLd^kZ)6JTDkc$}F-I&l^^kN2V6sPU{aa0TPr$s^ZPRx@Cida3g012Oc8@`3e{hYkEu6
-2^SYOydTtrL5b*pIn@xBP_T-#xuV&4p{u*{Z5aHGcj27E-9q4GvqqF85{fx)kMW$jvugz5e0Hzy9SpN
-pRl;Sbt6obg3erECVw+q3Wx!`xbQ%Y_UqfmqGAW&egg5A^uD>mwNKx9`1O${#3UAd^Y{<$FFA-9X_GI
-hfmsk{{_ich#&FQsCgj-NF$bHQorYpJzOXm*d0
-t7_|AR#Qxl#sEn6yc?c)%r;4M&kZ$;+##_^UyeYQOVKoz?G^zz@+XAOu>$w0--q)ZA`c_^Ky;>dU8OJ
-*6%^^XJ9f3wJW%YLlWhw^jbBuv?V-=&IW~e7z-HWu5@>`mn`nGrA%(uGcOs5gsR`O<%f3@Rj%A@yH&K
-#1V+TK?s04awJ6%eUsf+3-BSOpX#c>PWf2~nc$G7cF8*w_4l&|o0+C&{{@>P@;4$ezZQX;H%R*$?Bn9
-ii(>YiXtF(RSuQ`*YX5;1E)4(VDgZ`}Nmf$68C_55%~|O3!$p{#Cqg_n50fd7x@*iJ?6d=1b!@#H6Xw
-QSE!Lm^%|OZM$j)BPz-&QhfobO%{yAHPn790H6MTdUiHu?~83cxUEZTfUv1_;tWSEH#tFaCmMR4CR^F
-AABxYpQSK{D^*EPRAJB5G8%|vZzLF+c4iu<|``%jI&fMzEowll%;yl_@8|Q;Q+?5_)?H>9fmQLmTOOy9$#nIu@8J)v<)An2fsb}{-z?A{6XeEfwYd
-5AjLOg&%`=%G0>w0|7{of8Kc2HO;MG7e;yU`bQIp4X94oX$eCiid?UwFJ+iX1%To^AESHYjSxQYEN3g
-vB)#o4OG16{4P_?l}}+%zal+H)SdoxnW9QUHMc9#|wT9hnc<{O|H2NIyhy}s??lRr1wIq_JWVh;*1@x
-o^bu2TW}UnK+$BXADpHmfc4VHZ|ZC@KWSC&tvd@>>6%Lx)m5~{q2jU?)&01MgQD%h31WM-kaw6rN^IR
-{d%xrI2WH+5-b8)>+?y!R!+bRJ@tq-_b|vTK(Q0<|X8sjnuzQ`we
-0SV0XE9Q~UTGQ2!d+;pu>ObMP43+h!2c{|^KXUzfqXJ|d=Z**K2u|7my#@7n_}-^hnyF!&!(O9KQH00
-00802@m7R>_yM1-u&o0J&TM02=@R0B~t=FJEbHbY*gGVQepDcw=R7bZKvHb1ras-8|cJ<2IJ>{tAS>T
-P-CLdoq_)%DYaD)2&Xs(igAoPA27eX^Mm-#uTX`NV_#ERc-Az%+~(K{=@!BzGTk@0Kto7b&{7^SJIM5
-;Nalk;M@Vv^Cll6xhj)9Q=(Eb7UiPItN9|YO0f!~yKpZ3qob=uqQo+ft5k|N?=P>!+jm!@EY_mTMY3G
-wMJZ-Qz7%1$E*D8Q7Y_-3irZDP@`EHRWs!yHEi^yMSF#98=?j7h|H%(48I?G4E~Zk03#TxW0r@OUQ!z
-_YsSMn5A&*ow)d)hHcm&TXH4+LiPh*kgrHJK9X0gbr`O-h~Jn!g8V;kk!ESayuLdn8;R>}`$noP};G>
-^hm*1zU+n49^z3d@Dlwy^EgS{)JU2~4}p^HdocMT;=WMq&;WUQO2{=(Cbx$&JhP3JIrMUj1-B37)^2J
-pcCW?KdOwB8ke8I4hBKc`*{N69vED(Yl4{NW9PB%Mk-2lHbG3^TIFWUn{9f<-^*^8jlNpJc2K31uHLm
-dM44r2a2dXHESZC^Usm_!s9Chlf|+CU{zY~0JRK@yJ}@1Nfm{wU8CY6SUSLWShQJ_Ajd}n{;2mNRJaP
-Jeeeo?*KeCdeT@qerbqSr27CHTS%z^~hNk`3p^`6v(nT_@aHhNZ0hRH8c%VvTRo(rJe;5HQFuf!C%jE
-PdnvMMt80E(BlyF
-2@K*y&2I9%^=5?HR$Q5{K3!&Nq)c}^#j5i;W6H@#EBvTW)VznM6ZVY4*!TLPK2Tdz{;}oO5*}6fy@}d
-AOkf#a*5K@f^i&){9YEbG=Dhpl6jUF(i@7;`r6w;XWoz5h9|W3diqntq5o5!WCKLdSF1EB2fz>cLoiL
-l?C#{MsN@h=J4!>P#Cfus6h&SPtVGt+2f1~%kYWmJj*KTHw(?1u>8>x55JpvH5?LVTOAX^R5|o)aicQoBh0jzZfsH~EgqRYcm{wV|5cv#wIf+KtLuMqn0d`rg%@7O^+T~TjC=
-j@%R0@Q*^2H>&4AYlY*
-QLO;84`b9zay+e)6!`1bH!EeBR!^Qb3_qh?3R^QNgP`U`CDYl+{`$23dIt=8ES_q)ckK~Az^&dxSY&{
-Uck>iBj(KdmIU^etbB%i*+M=|m8*1Vh>45v1_U%pGL@$N|somCTjLQYvYEKyS75(>|D@`fY5E)F0R*Ji9wya
-u?s(Fw7GZyy}BMroek$8BS_mI1C+d+b0=QIDPAW{o}E>CQf|!jw!D;jJa=duPwA6A9kQ%)8
-z&oGqAcX?(M>Ft*pvZjQyZ^R#9vc;&Sqc@Atq1to-@m>;SrNrF5}*GNswO}Drc^
-_uhA<}l6E8p~Rja};4lg$BZYwkX!`+t1(aWjOc2hFf)Z2y`$|LO(xu3^s|w3MFMKe6tlctS3ozn0rQZ^sK4P-FYHw3;)9
-0KME&Xge|Jl?=N<_jNvKU7H}g)ZV$Gb~TqkW$+JJ1|lR9emx6UuPXkv8Vo!0JeWv_&(nhZCG(8d;Ihy
-p5zH@~WM`ISw>-`T-G?*pHQB%$3uf!-pu=fYR^URB>!{!f`Y0$?ftlzmXYw8A2NO6+NBE?di
-I#Iymx?5aX&~7pm^;0tMs$*MP0EU4Y*tN!-TGbU5Dk$fV>h<&$8Ptr>F)LTknDGSIx?}|I;7O(sE#?@U
-@K!$&b;Tq=-N$*;Gx)Xq;H_X54SD0HWnuOYTcdZk!Nk9yhyJQx#~VllekSyj1T)iW?h*}!INv3A~%BL
-%NWyU(rHsDi!r>q7Ppq-;QFlnCd^@T2DRnu**E|osZ=FxP{B?CgMh$Vz!2dyzXyYhXqBw|7FlWonF!-
-uN-54K=i*PFe<^053J_*2%Mj)a>SQIOWR^t4wZ7-zH*~fe5$(5SU}rHtj$w7L-;7}~k{+r&`v>CQ9Rx
-#uL%G>y0^b?Twfk?jBzf)do~S8W|))#iXSmx7Yx`DQ5CnhFX8FiynLBgSxmFJy
-(Q%(!+6NTKH-Qq(m5pEo2~^3Cm0EqJFYN*RC3%E7DuPemf;%XGI7Q2WI=LFXDG-6Rjp{^A(6uvCJdHI
-JMH1Dy_qgWBAm#6&z|!f)8lv*7U5FEKW!2=pAt*A+qOnR8IIpDjNG96R1y;qJIJ`fqyr2T1C@3$#L(|
-WmW(1q6(kjYv_n=7UKF@;e!HZGDejE;JQ44aJrFwbgA*$@5wWR^!b8J=L>5uv-_mTGZbnh>M*BGeN<9PzqK{?t(Tz^;>mfK7^HPXwt_amwUCps*Veh05
-k~o+=gVo5(M)zu>v2S;a)v7nDs&_~PA*|qDjd>Eg~&@p=&+cp>*Mj~H^cTENXZexvJ@MJwfH%qEwow~RWySpFo}
-WR#3PJ>r_g47WLVe(s8?V!2;z~5dl|+h`n!NN)I+o|vWL_b1yht%D`}M@-5RODskz^nyPoDJK9@WKIFw6_^=tg+~XI%y1F_?pt>2)=%W-U^$3<~?x;rIdt7GWq
-@7IVMK?dCrC6gaJ$W=uIOmFKrIq7G$M^~CYl<3j*B&`NC1ihzk
-&DWM{(7=9oqa8h(#*XP$F}SU8HZ1091Ud~&_RT<}3>-D}YQZ@??i=3BsDVvqppN5V=Qk4dpt{%aBh``
-8dBd839e?lpg_J4EN>s@Eq@-?-drh)0jXfFy=Y0mV!NL~FVE2J@+A_!nBp10ukQzvT?!(S3ifUC3U4S
-*c8t$R7bF_14ja6qUIrOF5Q9Vw}y5i_28+jjN+gUwJ(-TiO7SQ%7kAmJ+X@YNh*ex=$_6>a}?xYQ>v)
-V-|_fZTbYFQg`wphb)aZ1-tY!xsRZEe*71PB7F>J=gC;6Bn?Y^dELm|dLH?xPwc0_B#L7zqxpPCiArr
-e;Es*=@Lw<*H8afu7+HT`
-+V8tWGA%NK1}?&n<_m%gZ|Jl23PIy5{A{@(`W1bCBwMzV%oo;V-dI$(6su^k%%(Pbyfs*=YkLvqtCs;uGBhrn_9B603ta6!sx!g4
-_7szMNSbPB#XIkbT_S0T+M{W}L&j-oPFoxR?&Nf-%m`3~sKU-Tat&-F)k38e#1LHK6Qj-9X}kk@)eN>
-Vw_!TB8m36omA~5W5tB3C{~Dvl|mk?BR+bruM;lWs{|-K(|*E(U?_fy6%l?A_R~}@*-WJnM|#
-!%cp&eey^|o)KC;2Q3FxH?E3bi+%x(`0bkxn9z!|Kg**xEN^xABLW^~_7W4LQWv;?GX-Uj}g$J;;FEw
-IZh>SY#onKhSTnLHz_^?*Z#RM6bOrBOw}hDQUI;Vw`{tae%
-7cDS#x?szW2C2M_7!Rdkz-RTdzT)K}*>GPC097}Y88^Ik(D3EB+2hGuWDaBouKV;*1o|Egpkcx3Vj_y
-O$TCifr;uO7!QYhwQYUfl65MICx(>18;*(`}*hkzF|bLJG`S%9?|r1=9zizP!Lb^sAqSJi`$Bvtmbg!
-yA|3sj{naYzdaL;?n^vsIFzgwT^w?4B(+qZmtx<;Wynl#cp;_x#er;4@I501|u+w23A74k(9waf&tcc
-L2cXZQi}am7xQn#Pm{@&`kP;RZNDvyqd7c}hVh3kOdXMVzU-2d<-
-ZoeT?bP|Z;Z$HVxmW54%#mnN!5&5?SjshO!YMnpm8ftBJ%*g1q2(<<2-d(f8=uV#RxY*H~IERBebSOq
-5YUl#ZMOyRE8}f-SIDai)b-c?w$-7Bes}(P_8?qyEUHU)QL^AG#XbnG0pP2E*;grjd-1h@{{CnDGym%
-?((cp&noH?s_yrBCWl$lm{+5BMt=4VKw{5Xe|i^|Fdd2m4(_%TpPp$7(-jyh5-|`1h$qy*0l^twKr=H&Hs+T?
-wa{=?Ap^It?$j4d8Nd)7}|XtH+cy2?@XqSDj^>LVT!NS6mbLaa>6npEz#)GSkUyjAm1hKs{NmBvG0oZ)mw1m
-gXT+AuOUrau07DIJN+05yoJi#Id%#O)Y~W>u!z5FFJ`@D$Q}%u8{X6^1|hcw2&_bXEW?<<1G5HVuxNX
-al(u+8u8gdlAj3xC25FuL{;V()MjgdbIjS=+MSI(iX_Al{GnwbE9#r+i+NsxsT5%2T@`IT)isS?SDN%
-jLJwg3t7J;1SDHi^eIJ@NfKAv?r9a`RuX?F^$0RB3j0l|R{5r@|c_LoqF%T(A3b3NV%Hw0xb)vE7q;*
-xI$F0{%AG3aW`rW&Wv#Uw)>h$tet!vC0oHTQTj)rL;i#g+@2Oe`nvc11}-IZKmL>n6l+v-SHij7;)l$
-4pN?dg^kfLp#G3oOhU0fBDe%oF1?=wqb1sEI`qtY?(3661#Vj@3N1Q=`%0<0zB&+TrWhCa&H9F{x!rU4BGzp0o``lE`x
-eDu%WSlR#-j-PJXJ*r99AcIuT@+D-AHQBvnD^c^9nhgAkK(h?^p=&7M_=cM5-4a@f#^bmzU8#RTr#n=
-wwd?ni$1VNj;>{y!6Uw@IIS>29{$-wQrmKr%zT#pK`KpIuDeOx|8yx{LPm?
-DfPKT6faAR;!pCE0;!QX-5J)2i*1C$OTlJ1HO2N;_o5B>IeBDT%xz&Letf*n6@h>&0)IO0zU;o9g)=(rgIRh)$k
-FH0e4d}IPvzIU_(5|d*_;f+UDv-FEguoYL08lXNQ>67llC=b;Knq%kt}=-V49tSNN+C-H(gzDZ>9P#f
-v@6UFGKk^e+9H2r?r<7-OnGnUWFvL@-inoG3c>ieTr6!FN!3NXyqSDJXsHIR=s%w=#9Iw|sk$c*&{^(
-*XTDjU1mnlqbQxybc|h1`a_FWI4Awg=s(N&tsOXIDHGVm4x7lKXLO_BJoSmaoYb8*~q1)@XfSSL
-C9L&$$$x97Ru#E1Vk#GD*;XRE4W^&I;qyk-cnf%7e(*$z0BOfA7CTMyK#>Bll)DpQiX|-D`i9<*+dYp
-E0KzRQ%F>In#xH^x1sHHkhtVJv7p5TqK6O^Ng;x>;jlAhWKY5ZmCV(bL$j6bgOUlg)R=3yNY2uR4wsE0S0YmU&^78ck>#Jb$m#fLe+tb&te+b^3z6JC1MKHOzcy~c#d)|*nXld(
-R;U3api({kK%4cyyWs%D;gJDqBaufi=F{pac`eW8Rf+k5T+)o!*iF0j?q8q9mAc0r%*@zeE65~5y?aJ
-(^tdVoi1JhlH7>EGvZ|qD=NI3ZGqh0!{LA|Rd7VS4YkxAWS@5xIfQdAWMLT-$r98wtSJW|PdFdQJQGE
-7c|nLy54Jlglg7hm265T6Fo9CBayeVC)cSca3pdZlQ4Nug9}<>WVYRkZb%GY!i*JDhw
-qn@VsPLsVwW7?~n$~2J_Fwg}v=u(&AowVL06(GaDqu_5(wOHSN1){&ZY#uw(`3evWJurR%OweA${Cxq
-f2%QnuYExV-QFmzjPl4I)P<#+7dfXmpT~tQ6msTN%+s9)9WKtw1xxfFc`L1KPus1*Q*e!niSz&rF;*?
-9x=4k&0^_mBI%>zDVa3|Mbiz1(!+enG?-LUTK=fRuFO-h3=5()R4L6)QA(h_BHvNm1AJXA
-thX3Sph7I=>y|v%+N8J!YUf^#dpV!Q!GB_+f8jChorOvjW09=p9E7;Af3h%{m8JakF99{c==q8nY>QVBbaL{JY7-WY!y7{r>DMrxVH;o?v^U;=}dn7^1ue!Cw`id>;)dfn_&N1
-Rrbv^VJ>iXnm=RU8AQ*QoeG9X&}lj@jR)z$(POUvpX^wM0)sIMvZ&*9U(x|Ln-ea4C7gtIx$7xC5BIa
-`Qy46_)JX|&2&;GHz1>>Zxe08noa7$hjvjQ#KvuPSHbFI$z^roQMz_r2~>+}=%x74&rqSRQwfVCya_S
-$g%=&_4Qp;MA$Xw{qj)6Rmyt
-?aZnLX>M;y{%&&dHH_8_S^*jX9^=us7sD`#notfkewh~o-KXXIb3=XK=)mJzW|Wa+v;DL34CW&X|HOR
-hxba9#=B)n%P)h>@6aWAK2ml*O_EskVqo?Qq002}0000#L003}la4%nJZggdGZeeUMZDDC{E^v80kil
-xhFbsz8ehQJ(3Y~o!Yzu71oyKN+NJv4cNQhtasYJ1-tE{6v-IUeB+zDmX&JiY^EYaP^Rn&xLBg_?`@_o1&v~&MZO9KQH0000802@m7R%wcA+pq}$0Qnm
-L02%-Q0B~t=FJEbHbY*gGVQepOd2n)XYGq?|E^v9(S>JEmI1YZFze49eWDLwWEpWwU2gn|Fv0Yq%-d?
-aRun$2n(Ae^f8js|Yg1*xoa|=)k!d??jo!0bcb
-%x6)XD})rubeoZs#C!61=PYaejq^n8ggaHpK@wpa#wu||U!Oxwtj&~i$Pw$M;W)WV~68DFDqd&p+e;#BP
-7qnjF-_ly}@RCS5o6Q>0vbD794x+Kv?bG
--^W>{^V!vQuuw*TU6CRmV43y%+d;TQW{h{~Xt$Xfv^Fd)`MYFbgFtu1W;A`!)Ijp=Xa0z~A9%);lYV}
-D=bya7M%M7L<+uWWQ-8MkCqJUT~F|*>S6`921}WPS(7i>dXtZi4w!A(7E;g_pL;zO20A|5&edYohloUBtnz4m@)G_SIbd_^6FGP=48kKIBTWd(HaQ6@
-h!w1pS2%XBZ)QRo(s0Fd60Cbz}l+T~3FEeJApl{wb;9usbT6R!|>?YxDK&6{~yjBCu5^z`7Brsa1J|s;#$GPvRHo}Tuq=i`EHcq=EE-5{;J1#TQjawKi
-b;qBvLSy0ODpQIlo4REm%^*T1!+x^_#$AS-kBkN*oXY(F1uL=!3xV?OBQ^qPUSGbRQ^l;x*}}1gTIJ30km&aEqXdG5!`+avbZOL%c*Q4B(}Rny_M{nbm
-lJX=ei?D1U(^y~5)4d;`D$Pd9W{$~^}qYEc3l2Y{?*6R-hbbr>PsOWX&62%$Y5ir5b
-Y=<8E+P2BNDTCHBbE>xfJM<=JoXtM@wwM(y*y&y}yQlbF_X9;~Jp!_08M2KTPGBR~S~;Sq6T4
-#N;x>%f7(or^Aagb=683RIpIy#k9Gi{A-$YT!~T{v*0H@PV5vgqQNK(DfFcD%b4Vz8gDh$be{13$hd_
-ZcNf4WD|nyzHgsF452+F}31DFJUZ&I_5xesppKmOtH^L@Yhf#Ti(*U%7e8OW+Ou!iqdq
-1Bf)f+WEi_yT1>JEqpxFhxhbOu4=U}DA@-bg>w2C_d*W#Y4_2fs9eW0*Vwh`^iF8}KSY?
-1vp#n1Fj+E$-|a3#h2v^F#)Wsv4kkD>4v?XsVi~cMeou4~f-|z}*t>4V*7kuMJVda`>^fq*Sa|48aus
-0N6Oi|bxJ1mD(#B)#CC=rU(>HJS=AmES#=&lcVIo;XFJQ&dp%61pS9w$q&VX?n?%0CVEz6nD=q)G~9iUqHC+5HSnW*Zu7B(VtS=KjoI-;hqLO{M^66t_3+&
-Y43_b(3q~d7?cvNq_Hq=E@j-pu3>+-1)oX_vbN8;@Dy!A@>~zM&;)$ACScN75kDr{mpzWa&x7J5AxlI
-JHmXPMCpVbVXsW(>E`sjQgU~Lcd>za(+s_$yZr|^{72Az81pkaai$~RB~aAJ2C1}%pF;{hfL~J=JFpk
-7T%apygF4&bD)uvydZNx(lx6{xzz*TERCPDN4E-HF>SZS(b+Jix()Y({l@B`ax_HG7h7>`v4tERz3Ly
-?zI^!TOEdHsX$tOl)?*Jd-EnG6(r##^!8ijvg)#19GraHvAW?CNWi1s$#=hk#NLNPjuBtS9%DdPIVyN
-!b6D(px(iTxt122^?vv0BD)#<%Y@o{c9!0mqr(29(=Cp!i01(jCyvc=XxTrPCR0LZ%@`>ft$-60j*O9
-xEH*jxYiX(F9J5M(`-dPLXajP!F*O=JPCUMRzjV$gM=06aA%DyW`jot=!9wn-EZ#Nz;7-KkvwCB6~Ot
-$(ANSNI-rlr}LVs^3SQpsN|QtJ&0!+5Z4gO9KQH0000802@m7R(R!
-C9=Qqt0Oub703-ka0B~t=FJEbHbY*gGVQepRWo%|&Z*_EJVRU6=Ut?%xV{0yOd8JufkK4Eve)q3n9Sk
-BbJVFsH+QO)}n`S1vL9Kc!;2)!nk2jRgDsIfhv$B?*w?brEKfDpV$
-Wy7z87tkX(>zP7j~)Im15&xKPp-I=TdIBqT2dbS?fA&REJ8cxK8!XzpA5}6^-1}m1$O{N^!+RM}=LoC
--kufUcdRgIxg9Zv@Fw2$(QUxWO~Wo)>_CaEoT;@7ImE5^D37OF3s*zA}qe=jlwC9$WX^pWgil^dy1eD
-*)GmxrDVxH>`#qs>qn06)8?+N{YkE}wC0Z-)%-#GgV%T-k}oRF8?Y3MD(4R%pe#9b(fISPMRoVWFFp=
-u+2=_?uO09^yZX{BP66+^PDu?OV9Rxq^CE3ao$%^jG_u7oP~q=HePvgsfIu2<&g33e>LEV7dUNsi!`0)*A%f;uOR
-RQ8Ml*&F$!o)v2Ee_{Qo~Cjn?&z~N`Ptk4X2KJC#&Ub@%Z(HC^;NS^S!@4%|E6Ys7my{PH20{vK`Ov6
-7s!79xC1}S;OlRryj?<7b@!vxKeGylUy{jS#t6G`Z9U>%QaiG`PskE&-UkM`Ssb)tFvELXIKB3&t@}<
-0?@6sLxh^m=#C#(45qSR=ReTz%E$?;$>yjLA=dN^v1c%pXkj)
-94(l#5#cG#6d-i?Qfh^)3f5^oaVs-!x*KJc7I8b5&4VhN)f&_I%^w?VsjS!8{NfN;%3&=8sG)Wdck#A
-(>&eMmE#g?g+iA^^+x1^wT3mQLto;ql_C;i|AVViY_p0MlY$h3qo)12uYXZ!(d!a
-Xh;#~)$4Q2;=n4%d>+34t-8`EpWY<^o825nu`5;3TV)OAZ2*$eLHt6pc$}lnhqa^Hvw>qvb0V3c6ih&yT3oO;DHNdA(R_*0V7{6UW
-oVN7NijMtddllXXkbNrXoThw(bH9X1N0{a#S?br)2(+$libc#%`;Jm%xTq@#0Sc;75msKJ;EX(9dk7l
-iSzf=GAUAG1F%YVA=&679yx`ns-q$%D_c%_b{`a7>ESAmF*E-}waR#bUO;1AcFBZjdOszP;I?j=QzH-4Y$Rb#FZ>E{_=I!%CPs@@V8yv=&p}l-M@^w04G2?7
-g4aa}ql)C^>b)vM^x*=9J#2!i+CgY(4=G67$ef}SkuO(~i+_-$xR
-*%regnyK^lV1Q_1(5_u{Khc)>?dVso)X4SEQK@5CL}Aal6S1GE{{hiB$8oozbA{qNcVC}
-)pN>+m@$&zMx)XS{8VP0$+BsF`i0eHe*b8W;Oj+jX9irb)S1Yg3$zzB)D8_Ow!q7>C#(oehA;h-zFiN
-3dCM|W>lj^?%d?Kga%mQ*q^voV{>X3iEZ`R^#0LU{6!9MkHK=j)d#Vio23u9H*kmZk~Lc&P0Icd0{Qp
-*&NulWjQ8T2D^0dY(@2Uyk_TH&GI*Xy~G<9IoMJa5(t;{5C7
-+B2|q|3!24e{*Mj}nxJsFzG+8$_|;5%%|yu=}uzEE*g&|6X)(e_D?KgY7|x1Ig1wop2sFXM{6ricX<6
-msCKmrz~tXlA#MAHwVt
-|VrBv+DOMquK&xDsVoq355*}1u0(~56Bi*JYiX=vVec9m#jSbLu|9W-#K6&x{#m|??#jE$!k^_@0>}*owmPfiVcY@*Cb|w;_31Q(I86iV?vLddrl&<(o^~Z)DO;Ca>E|u^@kYZxK|Lc$4=U-&lygX%3
-Kd>7zoFU@l$=x7d}~8sh|6B%`ua=%N5E?K7{+TFDwy5{USfY?0-;80|XQR000O88%p+8=?eQ`WDEcRLM{LR9smFUaA|NaUukZ1WpZv|Y%h0cWo2w
-%Vs&Y3WMy(LaCzMtYmeNv@%#P?Mn+Hx(W!BeN4vlVXdJsRki>!Qq#ulfz>~PU%4sDq;v||uW}
-7IAHk<0ywf(^A_HY0o^V-U+IFHt=gQ(z5+f)Uwt6xOk@DpJ4hVDc!0rMq%dWj{ixdYJhM>U!<{lg`xYJhy8
-HY+&D(*XVhMfeOymX?b5g&-znun~d1sA{38|Dlm%hx0!iyy^P35YlnNy3VKJbx^R-4rw-kZ{huG5LE&3Xi?A#Z0sk8$4HY8Z
-4P5g0C$C52|qU*6tn2r&cv(?T;m%Wi*t$>d7f-Gxi}mE$G**b0c(4a744}5iN<{tzvEZGe0=rSJiGoV
-xtiWS_~;4-q7+xZ{QGyWUO#{Kw>QrL*;gpw*Fui<0Jtcgy~8N?Zf+jeD*i3aTyHj;QtVk?w9UZ5&@7F
-y+%j4TA^b^Vb4|aH<-C(R?@p+wdPQMLVn8_ExgGx)qE!%;3s41ibBd&rb{xznvh47KG
-hPk+J95A%k?$UVV~1HJj1j9xSJCh>F;iA=n#-R1?c2F>J_VJA!AC^~Daq%_$Gq1|vx=+n)d-`
-8q)!z{2h$HvsY>_(7lqoV;|T;;pW@KNoN8c=$J$q|;QJ@9z~q(FvHfdN<9oCwn81LI&ZC((=g%qDPY!
-L@{5@LCFYt4eC_>`It$n6|_CC?n2D`Q8Kx;>~TTFu}y>#G8_}O?}oF;)$j
-m5u0Qax$QuF%69AvikREW{NZAgM_dl?1#PJ<;rr*`v(G>OnAvRPnnt(*?XS|h%)2wh$)6zR*=!Xjo6S
-r%>RTvuJE;Djx>r@x&&_
-3j8!Gy3oR47Au>~!hxIxjL@%mT?}pf?s`Wd7*lMxrvpUt{K-}y+ADbEl6&pp0pnF(JrV;DjLxzS+%cuR4WRiJ^^qx>A
-?1NoEf@Av}jC}Es?$=-u%~2E|8}YsaO9M;7;}|1^%#Qu~LH}FIA|Lty9)uH72Esq_A@=D30V-0b5>2s
-%2YZmh@<~4qIs&d#(tzU$9W_e^G!ghe#u3vSS(c=pj2&2CqVA%5i|cBBr1s5
-9|nhi|hz>2~;haQ{tGA4w9;T#u)i3ykC|(;NR#Qm-8U5bay|862h!1ODjp@mhp&MlG
-cji{dhsmNpVCwo-IbH7};>W~ysqwB661{za$9YBWv@QOiu#+FW3O7eQl8A
-DI%CBdUcZo69
-!oaWK0-OaVVynb#wyJeGF21j!)cgCpcxG`Vo3&uZuJtz^y#Q&*0=CW9ogSv2=%i#eT(EU~3oe3qa^F|
-f`Y|DjKj}2Z1i!z_a*ZB9t$1X^Iv*n%>@BGX;Tl}D0b(a_)Kb@+2G&o;OlGaD-OGjl7suXfC>M=k+wN
-(?lWx#~m2cD(zi4N@Mr3`ZOfl%9P%T+>1SM&`*c53h3b?HRp9OUA42|m%YUT{1vs@9K6^jllY?jRycI
-J@pXEMa^8$!DMMW(A*lE_>!Aq~&=fi%YQ70X>TMWpx0C(q2vPHJ5iuF2sqVJN}7ltPmp|HlZC^U~L-s=>+`O|>?Ox~P_Ba%bs4X8`@W1YEPXPVD
-zC5yg6$BIrzGb&yEK(SKx>-*jX1k0_p)sil_d6_Qt!Ryv<{9}iz)e!oK0I0*1XN9lF28}?4>a05}nzX
-u|f@7h_5qw3L#3}jVEN>s
-pE%7pitq%!p|H;ix3dF&-r~_5uTg=Gg$O5U_ecn;jS2D~I3`$T`i^pr3!
-#1a)_Jv-X+$Aez~r-DN(dtp9;3?V*})`6CM3r!u#r9bV^7H~gx=m0>;SzS)uvIiF|KC+xK-+FsdV+1@
-vG%S#5wy8~!QUsC(mtPWzN$iUD=-+IY7?KcBBjJ)T~;9Qi60sa&mlA$_N-V5uoD@YeyR^9UgB7t1=?R
-Yqx5Qhc&hiveJZ*EP7n6z29`*AC7AgBwWu&C!Yj*x-=yu7krPT|_?OSnEd;4_F6K
-urzQyrZ@PrUTUIou=^~x&g=N-jam%Fnf@MUn3sx?iK*|Ff@-ko^-5sHC-Dh2j6R0W7k(o8*N8M5K1|~
-i^OXy?DRTb7T96!dk)gihyPPC8{{&D=0|XQR000O88%p+8&UflGXaE2Jga7~l9RL6TaA|NaUukZ1WpZ
-v|Y%gPMX)j-2X>MtBUtcb8c_oZ74g(Pjj$fq)2mk;S8UO$z0001RX>c!JX>N37a&BR4FJo+JFJX0bZ)0z5aBO9CX>V>WaCx0r
-O_SR;620qJVClnO1LE8=FVBjt^q)0dVv2S4$yxh%|8(o1sR;=Z(ASP3{zUhoDM!B}3^JU@Z9!W
-=^OJ4i+~D}tF>VR1UqW;dM6{V#UBf{mRLH#(=_#5CPeO}&Bx)5VVMX;hqm`{VO{@$3En9zNWCzDr0WG(-jXHg{IpL*qv>-O0xMt)7JhFxSDlO@c~
-_Kkq;O_9@xss;#+Bv(1~;c8~x8FgcwF{fbh_HZv;$nqkkXlM-MBLA&L~>bWIvtXg)iSgXnVX2;HVQVK
-aIiZP5ME^yW}F_YT82gK318iF#7BE_z9&VUu0?ZUZZkQ^y08hT=@KD0MV%PmM^JeZZ}e`6D%ZfzV)03
-Z3O;AF%6%ub*hMWQ8-VD6X6IlUP^8pevaGQlteu2aymiqo1@RDoGHM^?8tp;ib$kc*UG*J%=G
-bVKDqWr2;a@cxHvC8C3hP_id3It2`B$aT+Ie!FnOcRz31PS0-mrQZ;Ljkfy|rias&g*yTlheaEdwu~
-J36Z1BkbQ<8ha_Qn{&{7yJmgh0ji_uh^%XXjTbSxhFYA7#f5_@7FR*lMWu4I)Kk~0HTS&j}_mQXhYip
-uh56#k_wm-rjR;U@vq;SU-K|3W?)X^UgtkOctrB87}J#B>n`0Lm@Nk6FY{M%i}E3AR)6(yOt`0-Vfhv
-UUp~1xDA5O-^#Nz8S6&MV^nmIzmzX|Bjm*=%8j;1@*nzk|AsaXL70UsJ7F1679
-G&h(c#vQ@!dGl}M@=$5*2=S?pu$N%vzQ;7c|;o~Q4FkY{}O8UKy*hkh+-$p`Ez+C5X{Co!kInr@NGr}
-nwhwqEYJO;ycTi=!2!Odm^J0VH_7j)I><~-a&;VyWU%yN6?`oFNAFrEC%Z0s5~^L$}CJBQ5*`&@Gg!=
-!)Z*t}~l+l6@zh`Pc4S>WH`P^d?(C&k{fQsCjVERjqtmjadAAGpeLDz<74lNCfHJ@w~PSk6IXhT4PP0
-s5&YD!B=bvK;z%N6Mj+@6ln}`B;ZV;xmX&f)P2fI0QV9Gt$fwYA63l$(&%5?L(sh1CyZvhr5NMnqK@9%7cd5CJ?YzG#8x5ER;
-6(pkDP36$Eh9LjUV9=`$kBpWg;&=#C{qHw0J4QJ7ydlHTl-3V3cp~uN5%Fhnc
-NZY=uBN?w2f;c6Hxfvi7|z{*mIWUPefqL`OFow_o-1Dh*}=HCZ5OX?XAbeGJycO^v
-L>G!Cka?49;AJMF}?Kl}olPPSJP3jtu~-F>d!UDu~Drrs<6>^LgpVFH5uDJzWWvSUtdBW$a)X({&^>Jj8
-GVk-oy^5!7ot
-994L{BFdDM35$XLG2bU>A?bD5WrW~3Jx*wXsIZa`j#(GB0itA4x{^N$m?lZg1wCceE(eS0M;hoW3;YN
-nzV^X|uR__Mjg8DCTC0FR_Yr?T_ye436pya;+P)h>@6aWAK2ml*O_Evldu6ol7000&u001EX003}la4
-%nJZggdGZeeUMV{B1i_`Sl3nTDPNXr55@GF>(N7~2kxTs5MXpk5gCH1<
-)GpH|XX_%3a;+0vEhKugQR$}l8b&%@t9n&uc_xgN^?QBX9_pXD5s_Sp=*wtr^sYX`%I!}gDWvs#`5^<
-5YUd(7Oxcx460u6;l-(+uPuX3TE1imD%9cfz$dNyosVwBLGL5wfjf%FcPn!wLXoEN0v`(rtmj+0~C{f
-kXXcuco%boy)E}V)vbdt-rygFEF{>rcZtlsA7DGW{#ra4Hu^#b0zohf_DVgX}quH{-3Np63XN%ldToy
-dXa6k3~$ys+RambOAZ9x*&O4-a<_Q}^@!;pWr)?&*@yZ5DK0^NL$MbneVmv0?nl|
->h0Yd`KokbFAJ5#*UGfEo>Fy;Z%`6MN@BycN+diwm%G|Kwley{Gm&q(-lxN+@Mp`&sSaKm{Y9pad5j>
-u^;@1kvobF-Ud7!>d^=^M3fV^HJTrPTWhwbYqW&u#Pp3~qgp9|k_PHhAp&KYqo5S*u$p^VXoS6d!Ou1
-PteLL1oqE{l}w2V~_8;cEjbG2Z86XUBgc_9*+zE(I*k-};lUZk-!yxAX(IEN)UXEXL3lpYnlj7FqM1l
-O$2UC`F8TN`tpik;+qG8&Csf~-7oJP^E-bLTUKg$(BmYy%}SC#@;?s*w=qKLvD13F!5lt&m0m@j
-1DZ8YsMj=$~hlfnXF+i(09mS_W~r%p?p(TyDZ(sGht_cV+);1&kH@a$RNoitPxK}%^qlkL;~mOPj{mv
-h`sVxce_kVvw?gxt|4oU%-k9GbK2P@znrauUn(CRPkv>;5Hr69UBGpf&SqatcH>F+n22M(1pxP1dgk=
-h1tDrP`lq{$tQZ;PPdV;6k9EX(7pgMEtoqSx_ch&j>+`xwJ@-QB1!^TTHVEETu4kFu>LQ6rFjiI`mTQ
-)8l`Y@d2BkZzk7Cg+@Y2#yc5V1D5}C?fMj*v|er(X?8zqjkXK}Ww%Atq+NO;FBcbImmP1*unfZ=>Ak&
-TcDMN%!en4$n~FB9BANM^_+&
-4De9njjym42i*5BJ8S0nE^^%=Vb#lfG!9cdo9Te@Si}YKhqhrJ}c?h
-*c>0>Afb2cXBY;V!AQ2314#T~rq*slAsfGWg&x`c9TPy38EIvjH`JgciF{5hZiPi`n{jz^%7RpLhcak
-s9+`hwXJ~8925;0EJ|nzdoDxw<8XX#;&}uGpKHs5R+<_74+l>aj^AAp#N-9H0U9R-s!}~UgcX)htO1A>Uh$H>hr`MP0vTQzg
-9?PNe_KhRqeJwGqX?IvBJNH@ptUAWV^zmfkq)yE@%0yx02AJbbeN*SXQ?Z8mnec#>I~oE&`?mK&8(tVEp)*kh#@kZW``OU3xjQhNcQ4jxlGAeF<(mzaIlr}8IMmeHtF?)9XD%gnDZ}k_p`I?kZ+L_;FARv0+iGAea>tqBehm=JF$lM_fmi@
-R%M9|DNT`=<}yj9@YP5Zbc?ZWFz*qwHM(gF3sOwk-02jdZKQ~{KE-7aG$$l``5xSsLk=>b4^cou1zmp
-7Oj914vi+8BI#5F$EWe-M^M|L!V!rsu=L`P$bb0@9cXjjl2$f@8(kThuLiH+)a=8I66t+E~a-T|HY0Q
-Gt*aMed!LYVrNode#&~js{7s&~ysg+o^x~?D~A!Lb&V4GGcpkAagi)-?Oo+q^5Ft>;DP32>EmC^B%<=
-yq&Ia?xiBRyhHA@ndQwQ*zws%p&NOSyFE=>5HQ-ak}lsp7*Y;jnZN*cxTf+g2yBM;;y>cby$(7Y+YgB
-YWF=@?a~vxvIgb~%(73HQPjXO91MFdY>FAVi
-deUA>V>NW$d5)ui51_Hl2Berfb#ubB;Fqj-+tsQmfqHS1p5%P$ni-KB~tdBeIV7Q-~;=uB
-1#s-@1AevMc9IF7rsUQ`Wl4oE+8ZgxaYS$XxBI1qsPn<(rHOmn0~S`4+v1^^_fSQPqeO*r?hN?0d`3e
-q`%JY{G%^Nzaj$j=_%IZ^&u7R~6LRyK6eS+_i`lKjFq)zC~R#BbYdSQ8=%!@1MgkoYLu+ru(2t;CR35
-Q2(euOoV$QGCQtNcLgBUz(v*9ae}4mu|NCi<03sA&mGlsG&og{zea}|Dw-bMvFhk4r&?v*&2k#au|Mv
-F8a`5uT@LOD!r!3}T!_07;Vl~GxePu@faBn~9KO%!)5i-sE;Ls-I?PUaG?uGkGY)R5D}3$kNt)kFoKs&+PDwbN`c8bw=s$y>D24$0-&Fd~*FKT7pUEFu_g
-__X`!mvaNfG>^BI4Aips!SKAR5Ngh^On3%3?j485#N+W2t{l+bOVaA|NaUukZ1WpZv|Y%
-gPMX)j}KWN&bEX>V?GE^v9>J!^B@Mv~w8D`w%kBDqUqD2nY`$5u&7_EI_(79@uvA`svLp
-k%Jg|NZ(kFA$VvDz3XaS6LE)nVy;Mo_2)@7llIxBAAecD(
-+_gS-4=?p&{_0#oQ7xTWFr3L)2s;vU3jqXi#bFX!w)@fDiI#%m!Eq|*UUFa&!ExhJFo57rmMpp%nKce
-N;%W{*?i+G@$^^PWF
-e!oOUF(1ybTQyR@r1?hI49$#epw0ChkRtE4Yeba1IWB-YCxGvCngcWa0IN5E(|n{ZH^72D?g#{rlRMy
-zvWnN~>^8+!6DI7EfM?1go27a7Pn{I$D(GtXA)e(~OpC2dzmu|9WHj^MTBlW2cJ|
-22SsHZs`Qr3EIXOOgb(;L}`g{bO+az^0OV$-^t@m9ZR^?phb-XC6RoW!Lq)k=k2HcPI^n@Qi&^s&U`n
-~CNwmp0OK-(s*a8~PWvxF@oeJ<(Y89nRjOH_!LX}#2TtrwT)@7}&lUL9Y&I=$H6X_eJ8(*@YSDW|}sy
-&iHk5a`ITcMRjdp=X1HNSh?XUatotNmXf9>xB1AqLCH@Chw%hqTFO+xp`IJ(3Tsj@ptNNS?Ebm!9U#C
-`1>5;g6NQbByEs&X$ZBUzj>gTM;*pJ>Udn;)C@`~GZO&gPez304E8>^Gjp@;c3RMEQE2e^xX0pPzR&>
-hwTM12tdHDqqCUWjkA4%gJ>vz)wn3z#_%{$r19%zN>pW`)!{M;!CNHal*9POO^wuJrw8nsbPH6vL0Y*
-o-v9CvV^}8F4aPEnd7V0&~#lj(jny7O6o1Qh)fW}j5JXRpfH!F~@4N37iOn~)CADN_2lD{vqysvKcw)
-R#={R=1jWbgYk@mC3`^QI$AHsZNlML1q`&4`2TYPbd@y)=+nMAwElLg;Zip9@k4@=M52F*f|hLWtQ?&
-u)`B=&hvEtUO%zdLlx3B<*->PZaJjSPLnaUEco@6$Q>57ctkcSyx#>A{)lr)D795w2gWgqAo*zX`Gy4wf}>h9O+G~4qAL|v}YMj*}L+Fa9LL&n}TE7EG4ltsQpLiu8T0LvH*N9sc~0gO
-+gkIW-AEqAWbc+z0H={gaD0DwWSJ&Tq;`NL5#ByJi+xt;S(QC2#D?$7p_dX2IQl(-m%z&GW6k(cSb7C
-DKtQywvDwE|Y6LBM2!v9&;|%S|=Y)V|8VwzSqMJ{i|*J{%inV(HNXXA*k_~
-`EqRd5_W-shJORgjS%(Yaf`*;fOJONYCJB=F)U9=0a${S3k2kXF>}Nbv6*etf@P3Jz_^2>EQ3@70O<{
-ZBxymJ6exg(v3o3>l`TSF?S4cH{>iw@9QjEGtdG58glo`U(Zf2teTDa(n^`
-YHr>4ZZgxqq8?mN_w@(1q*%V{(*mISmasoytmZ(I+<7x=qiq5=mzL8^PM*t#m$=?%sl%1u*ebBaBHg$j08y_tfo1Y%eFGLZJ7PUosz80Uh*6)2bLW)8-#$e|(OC96
-x=_ImyV)EE!}b^^G+1A@*s1;s=%GMf!_h0sTe6gc@V#a&jF1;r@t(kjEHuzp3s;A3eBc7yTc_IStdQr&0_I6g*z!EVBh?$o4VH?@wPXQC
-mFnneZJS#Uv(_+Z4{8hZn?m%7v6;Ob!H%)8<0I)IV^Q?jQ9KpnpDA-Ww>ZlD-=7nmqm9AxNMF|FdjxP
-TpI0plcdIxJVAP?PY(ZyyB_y>(oU@+p$i?r0Jvjdsrmw*~|*5a4&*(cbYl%ez>RO9BBIfA@FZ}fl}{=
-?0XfCTgNpFEaVJi$d=L)PX2T;oYGW*{|~l@*X_T^4iFho$=4@%h`=Z(oko>G}D)a|U&C{`&Iu$?+SbH
-+?v{z5|bJ7)Uc$D>951i)%FykP}cOL*^a8(<9ey4Pv`==o|ST#)~Z1{u3~-y+(`{_j#q86g2#
-in9d%Cya&AGvlQiLi8_x(nBqei`y){0r=m{1fw==6%Ujs}=zQWEnVHJ7X@x#J_|qE>O9O&PhDbEe-{Nj-WV0nO*bL0^tR}-5UF0jXijlI)LQ1is>_K$&L5hg9XO>ZCg^p2<@skuKi@Cu5F6cw9PIe{mI1oWF&^^>V;&)LA!1%~FuwP;L;
-Z!qrY7lvKko6z6n~^fviQil@}3#V%NoIhYe}**5fQ+GLVnH5PCFJ3d&83qgL(+o{A@W=gKS7qXZY)Wn
-62^mbO^oFTj8xT|WhbHG;KgB_jOrC8fC*l5(V)1St=n1K%t#?!Gvuoy7JXvK7c
-p^VsH{Og4hO#vd*xNsEUHlzufUudoR7Z-2Ti3j!VRN^*93roR5_h1Dt~fN5%er{lBNLyE8Sn
-GM(n6(}cslcyPZj|PBfK>b4%Y>?=CLi9{+UuC?WAvTHSI|A`XQ3#@`c3@5?GW9_Oiyl)lr5%5rnFR9WL=Z(ahP
-5lPGRPUF!Y3fhW}JYQX2o?Wz2<{edk2F7OLc5y&oX*U@n%0G@r7y-M
-H?vwl;KfJbrX;9Lvjmr9HlcNhX#6AaaRfsna$`0cE5xxxOB+)~0DyPMkKk)B`E)9weHO*(BN{6U25Oy
-`Vym&g2P|p3iLngPblnZ9Yfc~@J^WLI~caY{;;?ym@y_iC?AhJ5{02nqY7~topkhQ8RN^zd7)$x$|sORp@cS(xrRfSyu@zKg>8
-|ZtyY`Llz{KIxe<0De)!d_NZ3Y8s~$?CgD%S!i_Lj2UoRuA8b(0Sz`Wq+BWF5_5npVP^lbsBA}D^d3y
-x;ezDATwLxkn`u!~5z*?MuAqY|CiQVy?N+TD4!qwM)S(W$sTg`)8ldbDK9Q
->we+6Cz}+j%S$nQ!7bfloVKO?ett>>yz+PWm*i(JmGsMSbmw0FU3gk@k^ispbZc4<@U&%GkEb8czr-~rAQ(i6ur-<-vb(
-}$Z7!JG%bgyWPcy2`vOn-JP`Zcbfd=MIJU?vR=@9G&q}!qYcNl;|?%@=5FXfz({H+=0yI9E?iDeBBH!
-jzh!?V?stq;t__u2S!;J2i}Xjr|`X
-f83#q;h0aWX-tI%*H2!r-2h9Z~j?}0r!Qq
-Nl}E!4fHjuI1`;SmN<4Cu-P{U<Gj1q>yZY+dzK~(qzl7O84=V%A%CD#abQJ6M>iOjQnkU*+Ti3_u2
-du3_E*St1(K?2-74R=Qildc@0gOVQy&oz+*n>h+AwK48B}K~FjW@b7_%j_t4i%yX)_rT=eE|dC@a-!a
-kmDY7u<*EIvz`UVHW!dJ7MU4$GacN5)&gO$`4rs3LdL87)iBM7}IIF7DQAttb06
-kWZhS#YW$m{QZNqyj=0!T_|f@7twD!0#x~uD6d3al?Mv5bX0gUiayz7&Yx9MyaG@Ml@qG(F9AUQWZSt?r`|WehPtn0gJ_2ph8;5ld)Thn%9a|moBUhddXL!01~$4hF!8k%3;j_;i-SCWYjM$<@(N+jwFZ99GZ2xbs@W;^?~*6!R->F4eP;dMV0Thu_
->s&zGYFEHh!7Bbz@8zqO(zGDLl|JM8ZQYktX=wyAB~(S-S$C{Tc5P4PH}t*TzxM!ZEX5rC11^#pl4bz
-A50E?x|(R71%~$wR(sK+o-E>J+wT7^?*KEo6Jg)`0;H=e3<8_>GIxpJM7L6bS$>4~|Q(Q%Y_rAPeE96PhQ`6)R5T-dwjc>rfq1|^
-G9u#1c@-+}|9V@fzoSTgMe(u^z3F+T_#Z4jF?M!l#3%)p=m35o^U(ZIx1ufRnH?i&f9#!g8LMnACNLB
-u#fmEnCkST2jYZHg(40;Q`Abi_fDv)5~mi*+k
-vI71}4LBUNKsm&ri=vE%Kv9Z=+D&HfwBZs7fd$q-*Ck=uDb;$+0bqH9h8pGh)hXKrIp*4Xp3_t-ih
-vKIgWg+)2z&;Q*8J*9F)*u=U+5s8DHvroY+Um?Q_KYV8p6hZCY9nl`@;O%fic|FKE(_I`9rU5r!KmVq
-+)V9F}uadQ1L&N`Fiw)*6=6M`$vIWc8W3gS3Wz`;XpLsR%%qjCw0Cn1V9>^U-FEH_pGBd{8;bxmruyp
--Gx7mjH(eG2Lq=>{g0oNd51|j<`dW-=lVeu$BmR5KwC5v2?RT~AK?^%^on95e-0dkN{MJ4UobS}XH5<
-*A8IFaJ3NVslC$WDPQ3{$T0{+EjGoTW)SSPMIYPYiE|^~SVdcE>ga1kPqP?1%pj4f8+4Xdji}8fLxE>
-ZJ)$3&zoevv=TmsiGL6kq9=Oj)`y-!1$K$yW(3)pl{X)3mB6~{M;ioh#Xuh6-2P^+z+`1U=PBpXk#jH
-K*>E2Q0Cyv)MnTrhHZWePgNGtYcn;qF6){ic7lZV7K~awO+i-1^A3TH1j>I>ZDQjXj-m@65F?qn$Z
-=TWG(W2rW`i#yOMJJ)B@($H=~NazGxdmRbQ;3SY8L{)Px_wSDKceWuc@i+DEvoa>u(wgr*6Oz$
-#)GIZw9=Pf!E8jo7{BP?&%_d(2r_a*OWVwNI_c#!p%IB~tzn{df
-(Mm@d{Nz2BDwa?1bHR>&~AmKZ{RXfb;h?ypg*6AUqT7b>ZdyjG$0j8cX5!Z_LJ@_;~m;t~5-MjCFKksf3BGZ>hYC)%RNi$((~ncxeG;$
-f03b;}*%LdJzO0E_;@Xi{5f_7LHUSA^hiLD`
-8sEO{=$~<$|mheL*fjDztiCk02`KFm&I^Nz$$tpM$`BNc(r3%5J#k$gUO}+`;VsKw{1yEMHy3q-Kt-%
-+{k$cJ6HR5lB1I00|G`}e)^9;Neya$R!pj1KQGd^(0&8;zX`vMC$D(s>=@Fh0@AyJBV+{z>keGdNSh8
-<%tc