diff --git a/spaces/1-13-am/neural-style-transfer/network.py b/spaces/1-13-am/neural-style-transfer/network.py deleted file mode 100644 index 848126900a38729f7dfeb7b97140a900de579717..0000000000000000000000000000000000000000 --- a/spaces/1-13-am/neural-style-transfer/network.py +++ /dev/null @@ -1,127 +0,0 @@ -import torch -import torch.nn as nn -import torchvision -from torchvision.models import vgg19 -import utils -from utils import batch_wct, batch_histogram_matching - -class Encoder(nn.Module): - def __init__(self, layers = [1, 6, 11, 20]): - super(Encoder, self).__init__() - vgg = torchvision.models.vgg19(pretrained=True).features - - self.encoder = nn.ModuleList() - temp_seq = nn.Sequential() - for i in range(max(layers)+1): - temp_seq.add_module(str(i), vgg[i]) - if i in layers: - self.encoder.append(temp_seq) - temp_seq = nn.Sequential() - - def forward(self, x): - features = [] - for layer in self.encoder: - x = layer(x) - features.append(x) - return features - -# need to copy the whole architecture bcuz we will need outputs from "layers" layers to compute the loss -class Decoder(nn.Module): - def __init__(self, layers=[1, 6, 11, 20]): - super(Decoder, self).__init__() - vgg = torchvision.models.vgg19(pretrained=False).features - - self.decoder = nn.ModuleList() - temp_seq = nn.Sequential() - count = 0 - for i in range(max(layers)-1, -1, -1): - if isinstance(vgg[i], nn.Conv2d): - # get number of in/out channels - out_channels = vgg[i].in_channels - in_channels = vgg[i].out_channels - kernel_size = vgg[i].kernel_size - - # make a [reflection pad + convolution + relu] layer - temp_seq.add_module(str(count), nn.ReflectionPad2d(padding=(1,1,1,1))) - count += 1 - temp_seq.add_module(str(count), nn.Conv2d(in_channels, out_channels, kernel_size=kernel_size)) - count += 1 - temp_seq.add_module(str(count), nn.ReLU()) - count += 1 - - # change down-sampling(MaxPooling) --> upsampling - elif isinstance(vgg[i], nn.MaxPool2d): - temp_seq.add_module(str(count), nn.Upsample(scale_factor=2)) - count += 1 - - if i in layers: - self.decoder.append(temp_seq) - temp_seq = nn.Sequential() - - # append last conv layers without ReLU activation - self.decoder.append(temp_seq[:-1]) - - def forward(self, x): - y = x - for layer in self.decoder: - y = layer(y) - return y - -class AdaIN(nn.Module): - def __init__(self): - super(AdaIN, self).__init__() - - def forward(self, content, style, style_strength=1.0, eps=1e-5): - """ - content: tensor of shape B * C * H * W - style: tensor of shape B * C * H * W - note that AdaIN does computation on a pair of content - style img""" - b, c, h, w = content.size() - - content_std, content_mean = torch.std_mean(content.view(b, c, -1), dim=2, keepdim=True) - style_std, style_mean = torch.std_mean(style.view(b, c, -1), dim=2, keepdim=True) - - normalized_content = (content.view(b, c, -1) - content_mean) / (content_std+eps) - - stylized_content = (normalized_content * style_std) + style_mean - - output = (1-style_strength) * content + style_strength * stylized_content.view(b, c, h, w) - return output - -class Style_Transfer_Network(nn.Module): - def __init__(self, layers = [1, 6, 11, 20]): - super(Style_Transfer_Network, self).__init__() - self.encoder = Encoder(layers) - self.decoder = Decoder(layers) - self.adain = AdaIN() - - def forward(self, content, styles, style_strength = 1., interpolation_weights = None, preserve_color = None, train = False): - if interpolation_weights is None: - interpolation_weights = [1/len(styles)] * len(styles) - # encode the content image - content_feature = self.encoder(content) - - # encode style images - style_features = [] - for style in styles: - if preserve_color == 'whitening_and_coloring' or preserve_color == 'histogram_matching': - style = batch_wct(style, content) - style_features.append(self.encoder(style)) - - transformed_features = [] - for style_feature, interpolation_weight in zip(style_features, interpolation_weights): - AdaIN_feature = self.adain(content_feature[-1], style_feature[-1], style_strength) * interpolation_weight - if preserve_color == 'histogram_matching': - AdaIN_feature *= 0.9 - transformed_features.append(AdaIN_feature) - transformed_feature = sum(transformed_features) - - stylized_image = self.decoder(transformed_feature) - if preserve_color == "whitening_and_coloring": - stylized_image = batch_wct(stylized_image, content) - if preserve_color == "histogram_matching": - stylized_image = batch_histogram_matching(stylized_image, content) - if train: - return stylized_image, transformed_feature - else: - return stylized_image \ No newline at end of file diff --git a/spaces/1acneusushi/gradio-2dmoleculeeditor/data/Attend Hrm Crack Keygen The Best HR Software for Small and Medium Businesses.md b/spaces/1acneusushi/gradio-2dmoleculeeditor/data/Attend Hrm Crack Keygen The Best HR Software for Small and Medium Businesses.md deleted file mode 100644 index 8dc7a2bba6d9a747d739d0d087327fa8bc6005ad..0000000000000000000000000000000000000000 --- a/spaces/1acneusushi/gradio-2dmoleculeeditor/data/Attend Hrm Crack Keygen The Best HR Software for Small and Medium Businesses.md +++ /dev/null @@ -1,144 +0,0 @@ - -
If you are looking for a software solution that can help you manage your employee attendance and payroll, you may have heard of Attend HRM. This software is designed to automate your attendance process, generate reports, and calculate salaries. But what if you don't want to pay for the full version of the software? Is there a way to get it for free? In this article, we will show you how to download and install Attend HRM crack keygen, a tool that can activate the software without paying a dime. We will also discuss the features and benefits of Attend HRM, as well as the risks and drawbacks of using crack keygen.
-DOWNLOAD ››› https://byltly.com/2uKzXp
Attend HRM is a software solution for managing employee attendance and payroll. It is designed for small and medium businesses that need a simple and effective way to track their employees' time and attendance, as well as their salaries and deductions. With Attend HRM, you can:
-If you want to use Attend HRM without paying for the full version of the software, you can try to download and install Attend HRM crack keygen. This is a tool that can generate a license key that can activate the software for free. However, you should be careful when downloading crack keygen from online sources, as some of them may contain viruses or malware that can harm your computer or steal your data. Here are the steps to download and install Attend HRM crack keygen safely:
-After activating Attend HRM with crack keygen, you can start using it to manage your employee attendance and payroll. Here are some tips on how to use Attend HRM effectively:
-Attend Hrm full version with serial key
-How to activate Attend Hrm software for free
-Download Attend Hrm cracked license code
-Attend Hrm patch download link
-Attend Hrm registration key generator
-Attend Hrm activation key crack
-Attend Hrm pro crack download
-Attend Hrm ultimate crack free download
-Attend Hrm professional edition keygen
-Attend Hrm enterprise edition crack
-Attend Hrm premium edition serial number
-Attend Hrm crack 2023 latest version
-Attend Hrm crack for windows 10/8/7
-Attend Hrm crack for mac os x
-Attend Hrm crack for linux
-Attend Hrm portable version crack
-Attend Hrm offline installer crack
-Attend Hrm online activation crack
-Attend Hrm lifetime license crack
-Attend Hrm unlimited users crack
-Attend Hrm multi-language support crack
-Attend Hrm cloud-based edition crack
-Attend Hrm web-based edition crack
-Attend Hrm mobile app edition crack
-Attend Hrm desktop app edition crack
-Attend Hrm biometric integration crack
-Attend Hrm payroll module crack
-Attend Hrm leave management module crack
-Attend Hrm attendance management module crack
-Attend Hrm employee management module crack
-Attend Hrm performance management module crack
-Attend Hrm training management module crack
-Attend Hrm recruitment management module crack
-Attend Hrm project management module crack
-Attend Hrm expense management module crack
-Attend Hrm asset management module crack
-Attend Hrm compliance management module crack
-Attend Hrm report generation module crack
-Attend Hrm dashboard customization module crack
-Attend Hrm data import/export module crack
-Attend Hrm data backup/restore module crack
-Attend Hrm data security/encryption module crack
-Attend Hrm data synchronization module crack
-Attend Hrm data analysis module crack
-Attend Hrm data visualization module crack
-Attend Hrm artificial intelligence module crack
-Attend Hrm machine learning module crack
-Attend Hrm natural language processing module crack
-Attend Hrm voice recognition module crack
-Attend Hrm facial recognition module crack
Attend HRM is a software solution that can help you manage your employee attendance and payroll efficiently and effectively. It offers many features and benefits that can save you time and money, improve your productivity and efficiency, enhance your employee satisfaction and retention, and help you comply with labor laws and regulations.
-However, using Attend HRM crack keygen is not a good idea if you want to use the software legally and safely. Using crack keygen is a form of software piracy that can expose you to legal issues, data security risks, and performance problems. You may end up losing more than you gain by using pirated software.
-Therefore, we recommend that you purchase the full version of Attend HRM from the official website or authorized resellers. This way, you can enjoy the full features and benefits of the software without any worries or hassles. You can also get technical support and customer service if you need any help with the software.
-We hope this article has helped you understand what Attend HRM crack keygen is, how to download and install it, how to use it, and what are the risks and drawbacks of using it. If you have any questions or comments, please feel free to leave them below.
-Here are some frequently asked questions about Attend HRM crack keygen:
-A crack keygen is a tool that can generate a license key that can activate a software product without paying for it. It is a form of software piracy that is illegal and unethical.
-You can search for Attend HRM crack keygen on Google or other search engines. You will find many websites that claim to offer free download links for crack keygen. However, you should be careful when downloading crack keygen from online sources, as some of them may contain viruses or malware that can harm your computer or steal your data.
-To install Attend HRM crack keygen, you need to download and extract the files from a reliable source. Then, you need to run the setup file and enter the license key generated by the keygen file. This will activate the software for free.
-No, Attend HRM crack keygen is not safe to use. Using crack keygen can expose you to legal issues, data security risks, and performance problems. You may face legal consequences if you are caught using pirated software. You may also compromise your data security and privacy by using crack keygen. You may also encounter errors and bugs that affect your performance by using crack keygen.
-The best alternative to Attend HRM crack keygen is to purchase the full version of Attend HRM from the official website or authorized resellers. This way, you can enjoy the full features and benefits of the software without any worries or hassles. You can also get technical support and customer service if you need any help with the software.
- 0a6ba089ebAre you looking for a professional quality RC flight simulator for radio controlled planes and helicopters? Do you want to learn to fly without fear, save money and time by not crashing your real models, and enjoy realistic physics and graphics? If so, you might want to check out Clearview RC Flight Simulator, one of the best simulators on the market. In this article, we will review Clearview RC Flight Simulator and its latest version, 5.34. We will also warn you about the dangers of downloading a cracked version of the simulator, and show you how to get the full version legally and safely.
-Download https://byltly.com/2uKv6T
Clearview RC Flight Simulator is a software program that simulates radio controlled planes and helicopters on your computer. It was developed by SVK Systems, a company based in Bulgaria, and has been around since 2006. Clearview RC Flight Simulator is designed for Windows operating systems, and works on Windows 11,10,8 and 7. It has over 50 heli models, 50 plane models, and 17 flying fields to choose from. You can also import your own models and landscapes from other sources.
-There are many reasons why Clearview RC Flight Simulator is a great choice for anyone who loves RC flying. Here are some of them:
-Downloading and installing Clearview RC Flight Simulator is very easy. Just follow these steps:
-Clearview RC Flight Simulator is constantly updated with new features and improvements. The latest version, 5.34, was released on December 2020. Here are some of the highlights of this version:
-The weather system in Clearview RC Flight Simulator has been reworked from ground up. Now it has more realistic effects on the flight dynamics and visuals. You can see clouds moving with the wind direction and speed. You can also see fog forming at low altitudes or near water surfaces. The wind turbulence affects not only your model but also other objects in the scene such as trees or flags.
-The NetPlay feature allows you to broadcast or replay flights online with other users. You can join or create a session with up to four players. You can chat with other players using text or voice messages. You can also watch other players' flights or record your own flights for later replaying.
-The new version adds four new models to the simulator: A6M Zero (Japanese fighter plane), B-25 Mitchell (American bomber plane), T-33 Shooting Star (American jet trainer), and GeeBee R3 Fantasy Racer (American racing plane). These models are expertly designed and tuned by Ken Northup, one of the best modelers in the industry. They have high quality graphics and realistic flight characteristics.
-You might be tempted to download a cracked version of Clearview RC Flight Simulator Version 5.34 from some shady website or torrent site. However, we strongly advise you against doing so. Here are some reasons why:
-Downloading cracked software is risky for several reasons:
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso free download
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso hd video
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso installation
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso unblock
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso keygen
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso activation patch
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso full version
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso license key
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso torrent
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso online activator
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso review
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso gameplay
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso tips and tricks
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso update
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso mod apk
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso cheat codes
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso system requirements
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso features
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso demo
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso for windows
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso for mac
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso for linux
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso for android
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso for ios
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso for pc
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso for xbox
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso for ps4
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso for switch
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso multiplayer
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso single player
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso offline mode
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso online mode
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso realistic mode
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso beginner mode
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso expert mode
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso custom mode
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso rc planes models
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso rc helicopters models
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso rc cars models
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso rc boats models
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso rc drones models
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso rc landscapes models
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso rc controller setup
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso rc controller calibration
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso rc controller compatibility
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso openal driver download
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso gnu general public license
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso happy bytes llc
-Clearview Rc Flight Simulator Version 5.34 Serial Crack.iso lexcliq home
Pirating software is not only risky but also unfair and illegal:
-The best way to get Clearview RC Flight Simulator Version 5.34 is to buy it from its official website http://rcflightsim.com/. By doing so:
-In conclusion, Clearview RC Flight Simulator is a great simulator for anyone who wants to learn or improve their RC flying skills. It has many features and models that make it realistic and fun to use. It also has a low price and a free trial that make it affordable and accessible. However, you should avoid downloading a cracked version of the simulator, as it can be dangerous, unethical, and illegal. Instead, you should buy the full version from the official website and enjoy the benefits of lifetime updates and support.
-In this article, we have reviewed Clearview RC Flight Simulator and its latest version, 5.34. We have covered the following topics:
-We highly recommend Clearview RC Flight Simulator to anyone who loves RC flying or wants to learn it. It is one of the best simulators on the market, and it will help you improve your skills and confidence. You can download it for free and try it before buying it. The full version costs only $39.99 and includes lifetime upgrades and free support. You can buy it from its official website http://rcflightsim.com/. Don't miss this opportunity to get a professional quality RC flight simulator for a fraction of the cost of other simulators.
-Here are some frequently asked questions about Clearview RC Flight Simulator:
-If you are a motion designer or a visual effects artist who uses Adobe After Effects, you might have heard of Element 3D plugin. This is an advanced 3D object and particle render engine that allows you to create stunning 3D animations and effects within After Effects.
-Download Zip ⚙⚙⚙ https://byltly.com/2uKxfo
Element 3D plugin has many features and functions that make it a powerful tool for creating realistic and dynamic 3D scenes. Some of these features include group symmetry creation mode, dynamic group folder reflections, matte reflection mode, matte shadow with alpha channel, improved material visibility options, improved C4D support file support with animation, randomized raytrace samples for multi-pass motion blur, etc.
-However, Element 3d plugin is not a free product. It costs $199.95 for a single license or $249.95 for a bundle that includes Pro Shaders pack and BackLight pack. If you are on a tight budget or just want to try out the plugin before buying it, you might be tempted to use a cracked version of it.
-A cracked version of Element d plugin is a modified version that bypasses the license verification process and allows you to use the plugin without paying for it. You can find many websites that offer Element d plugin after effects crack files for download.
-But before you download and install Element d plugin after effects crack on your computer, you should be aware of the risks and drawbacks of using a cracked version. In this article, we will tell you what you need to know about Element d plugin after effects crack .
-If you still want to use Element d plugin after effects crack despite the risks and drawbacks, you will need to follow these steps:
-How to install elements 3d plugin for after effects with crack
-Elements 3d plugin after effects free download full version 13
-Best tutorials for elements 3d plugin after effects cracked
-Elements 3d plugin after effects serial key generator 13
-Elements 3d plugin after effects activation code crack 13
-Elements 3d plugin after effects license key crack 13
-Elements 3d plugin after effects patch file download 13
-Elements 3d plugin after effects torrent link crack 13
-Elements 3d plugin after effects crack mac os x 13
-Elements 3d plugin after effects crack windows 10 13
-Elements 3d plugin after effects system requirements crack 13
-Elements 3d plugin after effects features and benefits crack 13
-Elements 3d plugin after effects review and rating crack 13
-Elements 3d plugin after effects alternatives and competitors crack 13
-Elements 3d plugin after effects discount coupon code crack 13
-Elements 3d plugin after effects refund policy crack 13
-Elements 3d plugin after effects customer support crack 13
-Elements 3d plugin after effects troubleshooting tips crack 13
-Elements 3d plugin after effects update and upgrade crack 13
-Elements 3d plugin after effects compatibility and integration crack 13
-Elements 3d plugin after effects testimonials and feedback crack 13
-Elements 3d plugin after effects demo and trial version crack 13
-Elements 3d plugin after effects online course and training crack 13
-Elements 3d plugin after effects ebook and guide crack 13
-Elements 3d plugin after effects blog and forum crack 13
-Elements 3d plugin after effects youtube video and podcast crack 13
-Elements 3d plugin after effects facebook group and page crack 13
-Elements 3d plugin after effects instagram account and hashtag crack 13
-Elements 3d plugin after effects twitter handle and tweet crack 13
-Elements 3d plugin after effects pinterest board and pin crack 13
-Elements 3d plugin after effects reddit community and post crack 13
-Elements 3d plugin after effects quora question and answer crack 13
-Elements 3d plugin after effects medium article and story crack 13
-Elements
Now that you have installed Element plugin after effects crack on your computer, you might be wondering how to use it effectively. Here are some tips and tricks for using Element plugin after effects crack :
-Element 3D plugin after effects crack 13 is a powerful tool for creating 3D animations and effects within After Effects. It has many features and functions that make it a versatile and flexible plugin for motion design and visual effects.
-However, using a cracked version of Element 3D plugin comes with some risks and drawbacks. You might encounter errors, bugs, viruses, malware, or legal issues that could affect your work or computer. You might also miss out on updates, support, and new features that are available for the licensed version of Element 3D plugin.
-Therefore, we recommend that you use Element 3D plugin after effects crack 13 only for testing purposes and not for commercial or professional projects. If you like the plugin and want to use it for your work, you should buy it from Video Copilot's official website and support the developers who created this amazing plugin.
-We hope this article has given you some useful information about Element 3D plugin after effects crack 13. If you have any questions or feedback, please leave them in the comments below. And if you want to learn more about Element 3D plugin and how to use it effectively, you can check out some of the tutorials and resources that we have listed below.
-Download Zip — https://imgfil.com/2uxYsm
If you are looking for a way to CRACK Microsoft Office 2016 VL Visio Project Language Accessory Packs, you have come to the right place. In this article, we will show you how to install and use these language accessory packs for free, without paying for a license or subscription. You will also learn how to change the language on the ribbon and commands for some Microsoft Office applications, and how to access more features and tools with these language packs.
-Download Zip ☆☆☆☆☆ https://imgfil.com/2uxYjZ
CRACK Microsoft Office 2016 VL Visio Project Language Accessory Packs are modified versions of the official language accessory packs that Microsoft provides for its Office products. These language accessory packs allow you to add additional display, help, or proofing tools for different languages, such as Arabic, Chinese, French, German, Spanish, and more. You can install these language packs after installing Microsoft Office 2016 VL Visio Project, which are the volume licensed editions of Office 2016 that include Visio and Project.
-However, unlike the official language accessory packs that require a valid license or subscription to use, CRACK Microsoft Office 2016 VL Visio Project Language Accessory Packs are hacked or cracked versions that bypass the activation process and let you use them for free. This means that you can enjoy the benefits of using multiple languages in your Office applications without spending any money or breaking any laws.
-To install CRACK Microsoft Office 2016 VL Visio Project Language Accessory Packs, you need to follow these steps:
- -To use CRACK Microsoft Office 2016 VL Visio Project Language Accessory Packs, you need to follow these steps:
-By using CRACK Microsoft Office 2016 VL Visio Project Language Accessory Packs, you can enjoy several benefits, such as:
-In conclusion, CRACK Microsoft Office 2016 VL Visio Project Language Accessory Packs are a great way to enhance your productivity and creativity with your Office applications. You can install and use them for free, without any legal or ethical issues. You can also change the language on the ribbon and commands for some Microsoft Office applications, and access more features and tools with these language packs. If you want to try them out, just follow the steps we have outlined in this article and enjoy!
-While using CRACK Microsoft Office 2016 VL Visio Project Language Accessory Packs may seem tempting, you should also be aware of the potential risks and drawbacks of doing so. Some of these are:
-If you want to use multiple languages in your Office applications, but do not want to use CRACK Microsoft Office 2016 VL Visio Project Language Accessory Packs, you have some alternatives that you can consider. Some of these are:
-In conclusion, CRACK Microsoft Office 2016 VL Visio Project Language Accessory Packs are a great way to enhance your productivity and creativity with your Office applications. You can install and use them for free, without any legal or ethical issues. You can also change the language on the ribbon and commands for some Microsoft Office applications, and access more features and tools with these language packs. However, you should also be aware of the potential risks and drawbacks of using them, such as viruses, malware, legal consequences, poor performance, etc. You should also consider some alternatives that may suit your needs better, such as buying or subscribing to the official language accessory packs from Microsoft, using online translation tools or services, or using other software applications that support multiple languages. We hope this article has helped you understand more about CRACK Microsoft Office 2016 VL Visio Project Language Accessory Packs and how to use them effectively.
-Sometimes, you may encounter some problems or errors when using CRACK Microsoft Office 2016 VL Visio Project Language Accessory Packs. For example, you may get an error code when trying to install them, or you may not be able to change the language on some Office applications. Here are some tips and solutions to help you troubleshoot these issues:
-If you want to uninstall CRACK Microsoft Office 2016 VL Visio Project Language Accessory Packs, you need to follow these steps:
-In conclusion, CRACK Microsoft Office 2016 VL Visio Project Language Accessory Packs are a great way to enhance your productivity and creativity with your Office applications. You can install and use them for free, without any legal or ethical issues. You can also change the language on the ribbon and commands for some Microsoft Office applications, and access more features and tools with these language packs. However, you should also be aware of the potential risks and drawbacks of using them, such as viruses, malware, legal consequences, poor performance, etc. You should also consider some alternatives that may suit your needs better, such as buying or subscribing to the official language accessory packs from Microsoft, using online translation tools or services, or using other software applications that support multiple languages. We hope this article has helped you understand more about CRACK Microsoft Office 2016 VL Visio Project Language Accessory Packs and how to use them effectively.
-In conclusion, CRACK Microsoft Office 2016 VL Visio Project Language Accessory Packs are a great way to enhance your productivity and creativity with your Office applications. You can install and use them for free, without any legal or ethical issues. You can also change the language on the ribbon and commands for some Microsoft Office applications, and access more features and tools with these language packs. However, you should also be aware of the potential risks and drawbacks of using them, such as viruses, malware, legal consequences, poor performance, etc. You should also consider some alternatives that may suit your needs better, such as buying or subscribing to the official language accessory packs from Microsoft, using online translation tools or services, or using other software applications that support multiple languages. We hope this article has helped you understand more about CRACK Microsoft Office 2016 VL Visio Project Language Accessory Packs and how to use them effectively.
3cee63e6c2Download ---> https://imgfil.com/2uy1Td
If you are looking for a fun and addictive puzzle game to play on your mobile device, you might want to try Candy Crush Saga. This game is one of the most popular and successful games of all time, with over a trillion levels played and millions of fans around the world.
-Download ===> https://urlin.us/2uSTBc
Candy Crush Saga is a match-three game, where you have to swap and match candies of the same color to clear them from the board and score points. The game has various modes, challenges, and objectives to keep you entertained and engaged. You can also play with your friends and compete for the highest score on the leaderboards.
-But how can you download and play Candy Crush Saga on your Android device? In this article, we will show you how to download the Candy Crush Saga APK file, which is a file format that allows you to install apps that are not available on the Google Play Store. We will also show you how to install and play the game, as well as some tips and tricks to help you master it.
-If you want to download Candy Crush Saga APK file for your Android device, you will need to find a reliable source that offers the latest version of the game. You can use a web browser on your device or a computer to search for websites that provide APK files for download.
-One of the websites that you can use is [FileHippo](^1^), which offers free and safe downloads of various apps and games. To download Candy Crush Saga APK file from FileHippo, follow these steps:
-candy crush saga apk free download for android
-candy crush saga mod apk unlimited everything download
-candy crush saga latest version apk download
-candy crush saga apk download for pc
-candy crush saga hack apk download
-candy crush saga offline apk download
-candy crush saga apk download uptodown
-candy crush saga apk mirror download
-candy crush saga old version apk download
-candy crush saga full apk download
-candy crush saga apk pure download
-candy crush saga cracked apk download
-candy crush saga apk download android 4.4.2
-candy crush saga apk download for ios
-candy crush saga apk fileplanet download
-candy crush saga jelly apk download
-candy crush saga soda apk download
-candy crush saga friends apk download
-candy crush saga original apk download
-candy crush saga update apk download
-candy crush saga beta apk download
-candy crush saga 1.254.2.1 apk download
-candy crush saga 1.145.0.3 apk download
-candy crush saga 1.0.11 apk download
-candy crush saga 1.0.10 apk download
-candy crush saga 1.0.9 apk download
-candy crush saga 1.0.8 apk download
-candy crush saga 1.0.7 apk download
-candy crush saga 1.0.6 apk download
-candy crush saga 1.0.5 apk download
-how to download candy crush saga apk file
-where to download candy crush saga apk file
-best site to download candy crush saga apk file
-safe way to download candy crush saga apk file
-easy method to download candy crush saga apk file
-fast way to download candy crush saga apk file
-direct link to download candy crush saga apk file
-no ads to download candy crush saga apk file
-no virus to download candy crush saga apk file
-no root to download candy crush saga apk file
-no survey to download candy crush saga apk file
-no password to download candy crush saga apk file
-no verification to download candy crush saga apk file
-no registration to download candy crush saga apk file
-no subscription to download candy crush saga apk file
-no payment to download candy crush saga apk file
-no charge to download candy crush saga apk file
-no fee to download candy crush saga apk file
You can also use other websites that offer APK files for download, such as [APKPure] or [APKMirror]. However, make sure that you only download from trusted sources and scan the files for viruses before installing them.
-Once you have downloaded the Candy Crush Saga APK file, you will need to install it on your Android device. To do this, you will need to enable the option that allows you to install apps from unknown sources. This option may vary depending on your device model and Android version, but you can usually find it in Settings > Security > Unknown Sources.
-After enabling this option, follow these steps to install Candy Crush Saga APK file on your Android device:
-You can now enjoy playing Candy Crush Saga on your Android device without any restrictions.
-Candy Crush Saga is easy to play but hard to master. The game has hundreds of levels with different goals and challenges. You will need to use your skills, strategy, and luck to complete them all.
-To play Candy Crush Saga, you just need to swipe your finger on the screen to swap adjacent candies and make matches of three or more of the same color. You can also create special candies by matching four or more candies in a row or column, or in a T or L shape. These special candies have different effects when matched with other candies, such as clearing rows, columns and level 887. These levels have various obstacles, such as chocolate, licorice, bombs, or time limits that make them very challenging to complete.
-A: Playing Candy Crush Saga with Facebook has many benefits, such as:
-A: You can contact the developers of Candy Crush Saga by visiting their official website, [King.com], and clicking on "Contact Us" at the bottom of the page. You can also follow them on their social media accounts, such as Facebook, Twitter, Instagram, or YouTube, and send them your feedback, suggestions, or questions.
197e85843dIf you are a fan of racing games, you have probably heard of CSR Racing, the best-selling drag racing game on Android. But if you haven't, you are missing out on a thrilling and immersive experience that will keep you hooked for hours. In this article, we will tell you what CSR Racing is, how to download it, what features it offers, and some tips and tricks to help you become the king of the streets. So buckle up and get ready to race!
-Download File » https://urlin.us/2uSYoS
Downloading CSR Racing for Android is very easy and fast. Just follow these simple steps:
-One of the best things about CSR Racing is that it features over 100 licensed cars from the world's most prestigious car manufacturers, such as McLaren, Bugatti, Aston Martin, Hennessey, and Koenigsegg. You can choose from a variety of models, such as the Audi R8, Ford GT, Chevrolet Camaro, McLaren MP4-12C, or the Nissan GT-R. Each car has its own stats, such as power, weight, grip, and nitrous, that affect its performance on the track. You can also view detailed information about each car, such as its history, specifications, and trivia.
-The main mode of CSR Racing is the campaign mode, where you have to compete against different crews that rule the city streets. Each crew has a boss that you have to beat in order to advance to the next tier. There are five tiers in total, each with more challenging opponents and faster cars. You also have to deal with their trash talk and intimidation tactics. To beat them, you have to upgrade your car, tune it properly, and use your skills on the drag strip. Once you beat all the bosses, you can challenge them again in a harder mode called Pro.
-To win races in CSR Racing, you need more than just a good car. You also need to upgrade it with various parts that improve its performance. You can upgrade your engine, tires, intake, turbo, body, nitrous, gearbox , and weight. Each upgrade has five levels, and the higher the level, the more expensive it is. You can also customize your car's appearance by changing its color, license plate, decals, and rims. You can even add some special effects, such as flames, neon, or smoke. You can preview your car before buying any upgrades or customizations.
-If you want to test your skills against other players from around the world, you can try the World Tour mode in CSR Racing. In this mode, you can race against real opponents in real time and win exclusive cars and prizes. You can also join a crew and cooperate with other players to earn more rewards and bonuses. You can chat with your crew members, send them gifts, and challenge them to friendly races. You can also compete in global leaderboards and events to show off your achievements and rank.
-download csr racing for android free
-download csr racing for android apk
-download csr racing for android mod
-download csr racing for android offline
-download csr racing for android latest version
-download csr racing for android uptodown
-download csr racing for android 4.4.2
-download csr racing for android 5.1.1
-download csr racing for android 6.0
-download csr racing for android 7.0
-download csr racing for android 8.0
-download csr racing for android 9.0
-download csr racing for android 10.0
-download csr racing for android 11.0
-download csr racing for android tablet
-download csr racing for android phone
-download csr racing for android emulator
-download csr racing for android tv
-download csr racing for android chromebook
-download csr racing for android pc
-how to download csr racing for android
-where to download csr racing for android
-best site to download csr racing for android
-safe way to download csr racing for android
-easy way to download csr racing for android
-fastest way to download csr racing for android
-can i download csr racing for android
-can you download csr racing for android
-why can't i download csr racing for android
-why should i download csr racing for android
-is it possible to download csr racing for android
-is it legal to download csr racing for android
-is it worth it to download csr racing for android
-is it fun to play csr racing on android
-is it hard to play csr racing on android
-is it easy to play csr racing on android
-is it free to play csr racing on android
-is it safe to play csr racing on android
-is it online or offline game csr racing on android
-is it multiplayer or single player game csr racing on android
-what are the features of csr racing on android
-what are the requirements of csr racing on android
-what are the reviews of csr racing on android
-what are the tips and tricks of csr racing on android
-what are the cheats and hacks of csr racing on android
-what are the best cars in csr racing on android
-what are the best upgrades in csr racing on android
Not all cars are suitable for every race in CSR Racing. Some races require a specific type of car, such as a muscle car, a sports car, or a supercar. Some races also have restrictions on the car's tier, power, or weight. Therefore, you need to choose the right car for each race based on its requirements and your preferences. You can also switch between different cars depending on the situation. For example, you might want to use a lighter car for a short distance race, or a more powerful car for a long distance race.
-Another way to improve your car's performance in CSR Racing is to tune it according to your needs. Tuning allows you to adjust the settings of your engine, tires, nitrous, and gearbox to optimize your acceleration, top speed, grip, and fuel efficiency. You can use the dyno test and the test run to see how your tuning affects your car's performance. You can also use nitrous to boost your speed during a race, but you need to use it wisely. Nitrous is limited and takes time to refill, so you need to decide when to use it for maximum effect.
-The most important skill in CSR Racing is to master the perfect shift and launch. Shifting is when you change gears during a race, and launching is when you start the race. Both of these actions require precise timing and coordination. If you shift or launch too early or too late, you will lose speed and momentum. If you shift or launch at the right moment, you will gain speed and advantage. The game will show you a green indicator when it is the best time to shift or launch. You can also use the tachometer and the speedometer to help you with your timing.
-Cash and gold are the main currencies in CSR Racing. You need cash to buy new cars, upgrade parts, customize your appearance, and enter races. You need gold to buy premium cars, skip wait times, refill gas, and get special offers. You can earn cash and gold by completing various events and achievements in the game. Events are time-limited challenges that reward you with cash, gold, or cars if you complete them successfully. Achievements are long-term goals that reward you with cash or gold if you reach them.
-CSR Racing is one of the best drag racing games on Android that offers stunning graphics, realistic physics, addictive gameplay, and a variety of cars and modes to choose from. Whether you want to race against the AI or other players, upgrade and customize your cars, or just enjoy the thrill of speed, CSR Racing has something for everyone. So what are you waiting for? Download CSR Racing for Android today and start your racing career!
-Q1: Is CSR Racing free to play?
-A1: Yes, CSR Racing is free to play on Android devices. However, some items in the game can be purchased with real money. If you want to disable this feature, you can turn off in-app purchases in your device settings.
-Q2: How can I prevent unauthorized purchases in CSR Racing?
-A2: If you want to prevent unauthorized purchases in CSR Racing, you can set up a password or a PIN for your Google Play account. This way, every time someone tries to make a purchase in the game, they will have to enter the password or PIN first.
-Q3: How can I connect with other CSR Racing players?
-A3: You can connect with other CSR Racing players by joining a crew or by connecting your Facebook account to the game. By joining a crew, you can chat with other members, send them gifts, and cooperate with them to earn more rewards and bonuses. By connecting your Facebook account, you can save your progress and challenge your friends to races.
-Q4: What are the system requirements for CSR Racing?
-A4: CSR Racing requires Android 4.0.3 or higher and at least 500 MB of free space on your device. The game also requires a stable internet connection to play online modes and access some features.
-Q5: What is the difference between CSR Racing and CSR Racing 2?
-A5: CSR Racing 2 is the sequel to CSR Racing that was released in 2016. It has improved graphics, more cars, more modes, and more features than the original game. However, CSR Racing is still a great game that offers a lot of fun and challenge for racing fans.
197e85843dIf you are a fan of basketball games, you might have heard of Basketball Battle, a popular mobile sports game that lets you compete in 1 on 1 streetball matches with easy controls and realistic physics. But did you know that you can play Basketball Battle mod apk, a modified version of the game that gives you unlimited money, unlocked tournaments, and more features? In this article, we will show you how to download and install Basketball Battle mod apk on your Android device, how to play the game and enjoy its benefits, and answer some frequently asked questions about the game. Let's get started!
-Download File >>> https://jinyurl.com/2uNMOa
Basketball Battle is a mobile sports game developed by DoubleTap Software LLC, which has over 10 million downloads on Google Play Store. The game is designed for players of all levels, whether you are a seasoned basketball pro or a total beginner. You can jump right in and start blocking shots and dunking on your friends in 1 on 1 streetball matches with easy controls that make it accessible and fun. You can use pump fakes, clever footwork, and break angles to drive to the hoop and score buckets. You can also score three buckets in a row to catch on fire and take your game to the next level!
-In addition to the main game mode, Basketball Battle offers daily events that let you compete against players from around the world on online leaderboards. You can also unlock pro basketball tournaments with huge rewards by proving your game on the court. You can build and customize your team to suit your unique style and strategy. You can choose from over 100 tournaments with unique courts and challenges, such as beach, rooftop, carnival, subway, and more. You can also challenge your friends in 2 player split screen mode and see who is the best player.
-While Basketball Battle is already a great game, you might want to play Basketball Battle mod apk instead. Why? Because Basketball Battle mod apk gives you more features and benefits that make the game even more enjoyable. For example, with Basketball Battle mod apk, you can get:
-play the game without any interruptions or distractions from annoying ads. You can focus on the game and have a smooth and seamless experience.
As you can see, Basketball Battle mod apk gives you more freedom and fun than the original version. You can play the game with no limits and no hassles. You can enjoy the best 1v1 streetball game on your Android device with Basketball Battle mod apk.
-If you want to play Basketball Battle mod apk, you need to download the mod apk file from a reliable source. There are many websites that claim to offer mod apk files, but not all of them are trustworthy or safe. Some of them might contain viruses, malware, or spyware that can harm your device or steal your personal information. Therefore, you need to be careful and choose a reputable source that provides authentic and verified mod apk files.
-One of the best sources for downloading Basketball Battle mod apk is [Basketball Battle Mod APK Download], a website that specializes in providing mod apk files for various games and apps. This website has a team of experts who test and verify every mod apk file before uploading it to their servers. They also provide detailed information and instructions on how to download and install the mod apk files. You can trust this website to provide you with a safe and working Basketball Battle mod apk file.
-To download Basketball Battle mod apk from this website, you need to follow these steps:
-After downloading the Basketball Battle mod apk file, you need to install it on your device. To do that, you need to follow these steps:
-basketball battle unlimited money mod apk
-basketball battle hack mod apk free download
-basketball battle 2.3.21 mod apk latest version
-basketball battle mod apk android 1
-basketball battle mod apk offline
-basketball battle mod apk revdl
-basketball battle mod apk no ads
-basketball battle mod apk unlimited gold
-basketball battle mod apk rexdl
-basketball battle mod apk happymod
-basketball battle mod apk online
-basketball battle mod apk unlimited energy
-basketball battle mod apk 2023
-basketball battle mod apk for pc
-basketball battle mod apk unlimited coins
-basketball battle mod apk pure
-basketball battle mod apk vip unlocked
-basketball battle mod apk all characters unlocked
-basketball battle mod apk unlimited moves
-basketball battle mod apk no root
-basketball battle 2.3.21 hack mod apk
-basketball battle cheats mod apk download
-basketball battle streetball mod apk download
-basketball battle 2 player game mod apk download
-basketball battle easy win mod apk download
-basketball battle 2.3.21 unlimited money mod apk download
-basketball battle hack version download mod apk
-basketball battle streetball hack mod apk download
-basketball battle 2 player game hack mod apk download
-basketball battle easy win hack mod apk download
-how to download basketball battle mod apk
-how to install basketball battle mod apk
-how to play basketball battle mod apk
-how to update basketball battle mod apk
-how to get unlimited money in basketball battle mod apk
-how to hack basketball battle with mod apk
-how to unlock all characters in basketball battle mod apk
-how to remove ads in basketball battle mod apk
-how to get free gold in basketball battle mod apk
-how to get unlimited energy in basketball battle mod apk
Before installing Basketball Battle mod apk on your device, you should be aware of the permissions and requirements that it needs. Here are some of them:
-If you meet these permissions and requirements, you should have no problem installing and playing Basketball Battle mod apk on your device.
-Basketball Battle is a simple yet addictive game that anyone can play and enjoy. The game has easy controls that let you move, shoot , and dunk with just two buttons. You can also use the joystick to move around and perform different moves. Here are the basic controls and gameplay mechanics of Basketball Battle:
-These are the basic controls and gameplay mechanics of Basketball Battle. You can learn more about them by playing the tutorial mode or reading the help section in the game.
-Basketball Battle is a game that requires skill, strategy, and practice to master. You need to know how to use your moves effectively, how to adapt to different situations, and how to outsmart your opponents. Here are some tips and tricks that can help you improve your game and beat your opponents:
-These are some tips and tricks that can help you master Basketball Battle mod apk and beat your opponents. You can learn more about them by playing the game and discovering new strategies.
-As we mentioned earlier, playing Basketball Battle mod apk has many advantages over playing the original version. Here are some of them:
-These are some of the advantages of playing Basketball Battle mod apk over the original version. You can see that playing Basketball Battle mod apk gives you more benefits and enjoyment than playing the original version. You can play the game with more freedom and fun with Basketball Battle mod apk.
-In conclusion, Basketball Battle mod apk is a modified version of Basketball Battle, a popular mobile sports game that lets you compete in 1 on 1 streetball matches with easy controls and realistic physics. Basketball Battle mod apk gives you unlimited money, unlocked tournaments, no ads, and free updates that make the game even more enjoyable. You can download and install Basketball Battle mod apk on your Android device by following the steps we provided in this article. You can also play Basketball Battle mod apk and enjoy its benefits by following the tips and tricks we shared in this article.
-If you are a fan of basketball games, you should definitely try Basketball Battle mod apk. It is one of the best 1v1 streetball games on Android that will keep you entertained and challenged for hours. You can play Basketball Battle mod apk online or offline, alone or with your friends, and have a blast. You can download Basketball Battle mod apk from [Basketball Battle Mod APK Download] today and start playing the game right away. You won't regret it!
-A1: Yes, Basketball Battle mod apk is safe to use if you download it from a reliable source like [Basketball Battle Mod APK Download]. This website provides authentic and verified mod apk files that are free from viruses, malware, or spyware. You can trust this website to provide you with a safe and working Basketball Battle mod apk file.
-A2: Some of the features of Basketball Battle mod apk are:
-These features give you more freedom and fun than playing the original version of Basketball Battle.
-A3: You can play Basketball Battle mod apk with your friends in 2 player split screen mode. To do that, you need to follow these steps:
-You can also play Basketball Battle mod apk online with your friends by connecting to Facebook or Google Play Games.
-A4: You can customize your team and player in Basketball Battle mod apk by following these steps:
-You can customize your team and player in Basketball Battle mod apk to make them look cool and perform better on the court.
-A5: You can find more information about Basketball Battle mod apk by visiting [Basketball Battle Mod APK Download], the website that provides the mod apk file for the game. This website has a blog section that posts articles and guides about Basketball Battle mod apk, such as how to play, how to win, how to use power-ups, and more. You can also find reviews, ratings, comments, and feedback from other users who have downloaded and played Basketball Battle mod apk. You can also contact the website's support team if you have any questions or issues with the mod apk file.
197e85843dIf you are looking for a cute and relaxing anime to watch, you might want to check out Yama no Susume S1, also known as Encouragement of Climb. This anime is about two high school girls who rediscover their passion for mountain climbing and embark on various adventures in nature. In this article, we will tell you what Yama no Susume S1 is about, why you should watch it, and how to download it legally or otherwise.
-Download Zip 🆓 https://jinyurl.com/2uNTUx
Yama no Susume S1 is an anime series that aired in 2013 as part of the winter season. It is based on a manga by Shiro that started in 2011 and is still ongoing. The anime has four seasons so far, with the latest one being Next Summit that aired in 2022.
-The story follows Aoi Yukimura, a shy and timid girl who used to love mountains as a child but developed a fear of heights after an accident. She reunites with her childhood friend Hinata Kuraue, who is outgoing and loves mountaineering. Hinata encourages Aoi to overcome her fear and join her in climbing various mountains across Japan.
-The anime features a cast of adorable characters who have different personalities and motivations for hiking
There are many reasons why you should watch Yama no Susume S1, but here are some of the main ones:
-download encouragement of climb season 1
-download yama no susume season 1 english sub
-download yama no susume s1 1080p
-download yama no susume s1 batch
-download yama no susume s1 crunchyroll
-download yama no susume s1 bd
-download yama no susume s1 bluray
-download yama no susume s1 eng sub
-download yama no susume s1 full episodes
-download yama no susume s1 free
-download yama no susume s1 gdrive
-download yama no susume s1 google drive
-download yama no susume s1 hd
-download yama no susume s1 indonesia
-download yama no susume s1 indo sub
-download yama no susume s1 japanese audio
-download yama no susume s1 korean sub
-download yama no susume s1 kissanime
-download yama no susume s1 mega
-download yama no susume s1 mp4
-download yama no susume s1 malay sub
-download yama no susume s1 nyaa
-download yama no susume s1 online
-download yama no susume s1 ost
-download yama no susume s1 op
-download yama no susume s1 portuguese sub
-download yama no susume s1 reddit
-download yama no susume s1 rar
-download yama no susume s1 sub indo batch
-download yama no susume s1 sub indo 360p
-download yama no susume s1 sub indo 480p
-download yama no susume s1 sub indo 720p
-download yama no susume s1 sub indo mp4
-download yama no susume s1 sub indo x265
-download yama no susume s1 subtitle indonesia
-download yama no susume season 1 torrent
-download yama no susume season 1 zip file
-how to download yama no susume season 1 for free
-where to watch and download encouragement of climb season 1 online legally
-where to watch and download encouragement of climb season 2 online legally
One of the main appeals of Yama no Susume S1 is its slice-of-life genre, which means it focuses on the everyday lives and interactions of the characters. The anime shows how Aoi and Hinata grow as friends and individuals through their shared hobby of mountain climbing. They also meet other girls who join them in their journeys, such as Kaede Saitou, a knowledgeable and experienced climber, and Kokona Aoba, a sweet and cheerful girl who loves nature. The anime depicts the joys and challenges of hiking, such as finding the best routes, preparing the equipment, dealing with the weather, and enjoying the views. The anime also has a lot of cute and funny moments that will make you smile and laugh.
-Another reason why you should watch Yama no Susume S1 is its stunning animation and scenery. The anime showcases various mountains and landscapes in Japan, such as Mt. Takao, Mt. Fuji, Mt. Tanigawa, and Mt. Mitsutouge. The anime uses realistic and detailed backgrounds that capture the beauty and diversity of nature. The anime also uses dynamic camera angles and movements that create a sense of immersion and depth. The anime also has amazing sound effects that enhance the atmosphere and mood of the scenes, such as the wind, the birds, the water, and the footsteps. The anime will make you feel like you are actually there with the characters, experiencing the wonders of nature.
-The last reason why you should watch Yama no Susume S1 is its short and easy-to-watch format. The anime has only 12 episodes, with each episode being only 3 minutes long. This means you can watch the whole season in less than an hour, making it a perfect choice for when you want to relax or kill some time. The anime also has a simple and straightforward plot that does not require much attention or analysis. You can just sit back and enjoy the cute and wholesome adventures of the girls without worrying about complicated twists or cliffhangers.
-If you are interested in watching Yama no Susume S1, you might be wondering how to download it to your device. There are two main ways to do this: legal and official sources, or alternative and unofficial sources. Here are some of the pros and cons of each option:
-The best way to download Yama no Susume S1 is to use legal and official sources that have the license and permission to distribute the anime. Some of these sources are:
-The advantages of using legal and official sources are:
-The disadvantages of using legal and official sources are:
-The other way to download Yama no Susume S1 is to use alternative and unofficial sources that do not have the license or permission to distribute the anime. Some of these sources are:
-The advantages of using alternative and unofficial sources are:
-The disadvantages of using alternative and unofficial sources are:
-In conclusion, Yama no Susume S1 is a wonderful anime that you should watch if you like cute girls, mountain climbing, and slice-of-life stories. It has a heartwarming plot, beautiful animation, and a short format that make it a relaxing and enjoyable watch. You can download Yama no Susume S1 from various sources, but we recommend using legal and official ones to support the anime industry and avoid any risks or troubles. We hope this article has helped you learn more about Yama no Susume S1 and how to download it. Happy watching!
-The order of Yama no Susume seasons is S1, OVA, S2, Omoide Present, S3, Next Summit.
-Yes, Yama no Susume is based on a manga by Shiro that started in 2011 and is still ongoing.
-Yama no Susume is fairly realistic in terms of mountain climbing, as it shows the preparation, equipment, safety, and etiquette involved in hiking. However, some aspects are exaggerated or simplified for comedic or dramatic purposes.
-Some other anime similar to Yama no Susume are Laid-Back Camp, A Place Further than the Universe, Girls' Last Tour, and Long Riders.
-You can find more information about Yama no Susume on its official website, its Wikipedia page, its MyAnimeList page, or its subreddit r/Yamanosusume.
197e85843dThis WebGL demo demonstrates PlayCanvas and a physics vehicle simulation that is web based and playable anywhere your browser goes🤗 Inference API.
-Source code is in Readme.md file.
-PlayCanvas project is here
- - \ No newline at end of file diff --git a/spaces/AIGC-Audio/AudioGPT/audio_detection/audio_infer/utils/utilities.py b/spaces/AIGC-Audio/AudioGPT/audio_detection/audio_infer/utils/utilities.py deleted file mode 100644 index 8d1604579b88e7e1e79f6350376f89d9c1c85f44..0000000000000000000000000000000000000000 --- a/spaces/AIGC-Audio/AudioGPT/audio_detection/audio_infer/utils/utilities.py +++ /dev/null @@ -1,172 +0,0 @@ -import os -import logging -import h5py -import soundfile -import librosa -import numpy as np -import pandas as pd -from scipy import stats -import datetime -import pickle - - -def create_folder(fd): - if not os.path.exists(fd): - os.makedirs(fd) - - -def get_filename(path): - path = os.path.realpath(path) - na_ext = path.split('/')[-1] - na = os.path.splitext(na_ext)[0] - return na - - -def get_sub_filepaths(folder): - paths = [] - for root, dirs, files in os.walk(folder): - for name in files: - path = os.path.join(root, name) - paths.append(path) - return paths - - -def create_logging(log_dir, filemode): - create_folder(log_dir) - i1 = 0 - - while os.path.isfile(os.path.join(log_dir, '{:04d}.log'.format(i1))): - i1 += 1 - - log_path = os.path.join(log_dir, '{:04d}.log'.format(i1)) - logging.basicConfig( - level=logging.DEBUG, - format='%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s %(message)s', - datefmt='%a, %d %b %Y %H:%M:%S', - filename=log_path, - filemode=filemode) - - # Print to console - console = logging.StreamHandler() - console.setLevel(logging.INFO) - formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s') - console.setFormatter(formatter) - logging.getLogger('').addHandler(console) - - return logging - - -def read_metadata(csv_path, classes_num, id_to_ix): - """Read metadata of AudioSet from a csv file. - - Args: - csv_path: str - - Returns: - meta_dict: {'audio_name': (audios_num,), 'target': (audios_num, classes_num)} - """ - - with open(csv_path, 'r') as fr: - lines = fr.readlines() - lines = lines[3:] # Remove heads - - audios_num = len(lines) - targets = np.zeros((audios_num, classes_num), dtype=np.bool) - audio_names = [] - - for n, line in enumerate(lines): - items = line.split(', ') - """items: ['--4gqARaEJE', '0.000', '10.000', '"/m/068hy,/m/07q6cd_,/m/0bt9lr,/m/0jbk"\n']""" - - audio_name = 'Y{}.wav'.format(items[0]) # Audios are started with an extra 'Y' when downloading - label_ids = items[3].split('"')[1].split(',') - - audio_names.append(audio_name) - - # Target - for id in label_ids: - ix = id_to_ix[id] - targets[n, ix] = 1 - - meta_dict = {'audio_name': np.array(audio_names), 'target': targets} - return meta_dict - - -def float32_to_int16(x): - assert np.max(np.abs(x)) <= 1.2 - x = np.clip(x, -1, 1) - return (x * 32767.).astype(np.int16) - -def int16_to_float32(x): - return (x / 32767.).astype(np.float32) - - -def pad_or_truncate(x, audio_length): - """Pad all audio to specific length.""" - if len(x) <= audio_length: - return np.concatenate((x, np.zeros(audio_length - len(x))), axis=0) - else: - return x[0 : audio_length] - - -def d_prime(auc): - d_prime = stats.norm().ppf(auc) * np.sqrt(2.0) - return d_prime - - -class Mixup(object): - def __init__(self, mixup_alpha, random_seed=1234): - """Mixup coefficient generator. - """ - self.mixup_alpha = mixup_alpha - self.random_state = np.random.RandomState(random_seed) - - def get_lambda(self, batch_size): - """Get mixup random coefficients. - Args: - batch_size: int - Returns: - mixup_lambdas: (batch_size,) - """ - mixup_lambdas = [] - for n in range(0, batch_size, 2): - lam = self.random_state.beta(self.mixup_alpha, self.mixup_alpha, 1)[0] - mixup_lambdas.append(lam) - mixup_lambdas.append(1. - lam) - - return np.array(mixup_lambdas) - - -class StatisticsContainer(object): - def __init__(self, statistics_path): - """Contain statistics of different training iterations. - """ - self.statistics_path = statistics_path - - self.backup_statistics_path = '{}_{}.pkl'.format( - os.path.splitext(self.statistics_path)[0], - datetime.datetime.now().strftime('%Y-%m-%d_%H-%M-%S')) - - self.statistics_dict = {'bal': [], 'test': []} - - def append(self, iteration, statistics, data_type): - statistics['iteration'] = iteration - self.statistics_dict[data_type].append(statistics) - - def dump(self): - pickle.dump(self.statistics_dict, open(self.statistics_path, 'wb')) - pickle.dump(self.statistics_dict, open(self.backup_statistics_path, 'wb')) - logging.info(' Dump statistics to {}'.format(self.statistics_path)) - logging.info(' Dump statistics to {}'.format(self.backup_statistics_path)) - - def load_state_dict(self, resume_iteration): - self.statistics_dict = pickle.load(open(self.statistics_path, 'rb')) - - resume_statistics_dict = {'bal': [], 'test': []} - - for key in self.statistics_dict.keys(): - for statistics in self.statistics_dict[key]: - if statistics['iteration'] <= resume_iteration: - resume_statistics_dict[key].append(statistics) - - self.statistics_dict = resume_statistics_dict \ No newline at end of file diff --git a/spaces/AgentVerse/agentVerse/agentverse/agents/tasksolving_agent/solver.py b/spaces/AgentVerse/agentVerse/agentverse/agents/tasksolving_agent/solver.py deleted file mode 100644 index 6db77561d3859e897ad5b66859ddc76bd3a28b4d..0000000000000000000000000000000000000000 --- a/spaces/AgentVerse/agentVerse/agentverse/agents/tasksolving_agent/solver.py +++ /dev/null @@ -1,110 +0,0 @@ -from __future__ import annotations - -import asyncio -from colorama import Fore - -from agentverse.logging import get_logger -import bdb -from string import Template -from typing import TYPE_CHECKING, List, Tuple - -# from agentverse.environments import PipelineEnvironment -from agentverse.message import SolverMessage, Message, CriticMessage - -from agentverse.agents import agent_registry -from agentverse.agents.base import BaseAgent -from agentverse.utils import AgentCriticism - - -logger = get_logger() - - -@agent_registry.register("solver") -class SolverAgent(BaseAgent): - max_history: int = 3 - - def step( - self, former_solution: str, advice: str, task_description: str = "", **kwargs - ) -> SolverMessage: - logger.debug("", self.name, Fore.MAGENTA) - # prompt = self._fill_prompt_template( - # former_solution, critic_opinions, advice, task_description - # ) - prepend_prompt, append_prompt = self.get_all_prompts( - former_solution=former_solution, - task_description=task_description, - advice=advice, - role_description=self.role_description, - **kwargs, - ) - history = self.memory.to_messages(self.name, start_index=-self.max_history) - parsed_response = None - for i in range(self.max_retry): - try: - response = self.llm.generate_response( - prepend_prompt, history, append_prompt - ) - parsed_response = self.output_parser.parse(response) - break - except (KeyboardInterrupt, bdb.BdbQuit): - raise - except Exception as e: - logger.error(e) - logger.warn("Retrying...") - continue - - if parsed_response is None: - logger.error(f"{self.name} failed to generate valid response.") - - message = SolverMessage( - content="" - if parsed_response is None - else parsed_response.return_values["output"], - sender=self.name, - receiver=self.get_receiver(), - ) - return message - - async def astep(self, env_description: str = "") -> SolverMessage: - """Asynchronous version of step""" - pass - - def _fill_prompt_template( - self, - former_solution: str, - critic_opinions: List[AgentCriticism], - advice: str, - task_description: str, - ) -> str: - """Fill the placeholders in the prompt template - - In the role_assigner agent, three placeholders are supported: - - ${task_description} - - ${former_solution} - - ${critic_messages} - - ${advice} - """ - input_arguments = { - "task_description": task_description, - "former_solution": former_solution, - "critic_opinions": "\n".join( - [ - f"{critic.sender_agent.role_description} said: {critic.criticism}" - for critic in critic_opinions - ] - ), - "advice": advice, - } - # if discussion_mode: - # template = Template(self.prompt_template[1]) - # else: - template = Template(self.prompt_template) - return template.safe_substitute(input_arguments) - - def add_message_to_memory(self, messages: List[Message]) -> None: - self.memory.add_message(messages) - - def reset(self) -> None: - """Reset the agent""" - self.memory.reset() - # TODO: reset receiver diff --git a/spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/gridtable/input/EmitCellEvent.js b/spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/gridtable/input/EmitCellEvent.js deleted file mode 100644 index 50c0b7320e2b504223494d47eb8e5e466aefb81c..0000000000000000000000000000000000000000 --- a/spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/gridtable/input/EmitCellEvent.js +++ /dev/null @@ -1,17 +0,0 @@ -var EmitCellEvent = function (eventEmitter, eventName, table, x, y, pointer, event) { - var cellIndex; - if (y === undefined) { - cellIndex = x; - } else { - cellIndex = table.pointToCellIndex(x, y); - } - if ((cellIndex === null) || (cellIndex === undefined)) { - return; - } - var cellContainer = table.getCellContainer(cellIndex); - if (cellContainer) { - eventEmitter.emit(eventName, cellContainer, cellIndex, pointer, event); - } -} - -export default EmitCellEvent; \ No newline at end of file diff --git a/spaces/AhmadHakami/Alzheimer_image_classification/app.py b/spaces/AhmadHakami/Alzheimer_image_classification/app.py deleted file mode 100644 index 746e446b1cfae06c78b541bb1e28e3aaa15337bc..0000000000000000000000000000000000000000 --- a/spaces/AhmadHakami/Alzheimer_image_classification/app.py +++ /dev/null @@ -1,25 +0,0 @@ -from transformers import pipeline -import gradio as gr -import os - -model = pipeline(model = "AhmadHakami/alzheimer-image-classification-google-vit-base-patch16", - task = "image-classification") - -model.model.config.id2label = { -0: 'خفيف الخرف (Mild Demented)', -1: 'متوسط الخرف (Moderate Demented)', -2: 'غير مصاب بالخرف (Non Demented)', -3: 'خفيف جداً الخرف (Very Mild Demented)' -} - -examples = [] -for image in os.listdir("examples"): - examples.append(f'examples//{image}') - - -gr.Interface.from_pipeline(model, - title="Tbyan - تِــبْيان Alzheimer MRI Classification", - description="This model fine-tuned using vit-base-patch16-224-in21k by Google, and trained on credible MRI data from Open Access Series of Imaging Studies (OASIS) and the data annotated by experts, it aims to expedite patient results, developed by Tbyan تبيان Team at AI course by `Misk Foundation & Samsung Innovation Campus`, \n **Try it now:**", - examples = examples).launch() - - \ No newline at end of file diff --git a/spaces/Ajaxon6255/Emerald_Isle/theme_dropdown.py b/spaces/Ajaxon6255/Emerald_Isle/theme_dropdown.py deleted file mode 100644 index 6235388fd00549553df44028f3ccf03e946994ea..0000000000000000000000000000000000000000 --- a/spaces/Ajaxon6255/Emerald_Isle/theme_dropdown.py +++ /dev/null @@ -1,57 +0,0 @@ -import os -import pathlib - -from gradio.themes.utils import ThemeAsset - - -def create_theme_dropdown(): - import gradio as gr - - asset_path = pathlib.Path(__file__).parent / "themes" - themes = [] - for theme_asset in os.listdir(str(asset_path)): - themes.append( - (ThemeAsset(theme_asset), gr.Theme.load(str(asset_path / theme_asset))) - ) - - def make_else_if(theme_asset): - return f""" - else if (theme == '{str(theme_asset[0].version)}') {{ - var theme_css = `{theme_asset[1]._get_theme_css()}` - }}""" - - head, tail = themes[0], themes[1:] - if_statement = f""" - if (theme == "{str(head[0].version)}") {{ - var theme_css = `{head[1]._get_theme_css()}` - }} {" ".join(make_else_if(t) for t in tail)} - """ - - latest_to_oldest = sorted([t[0] for t in themes], key=lambda asset: asset.version)[ - ::-1 - ] - latest_to_oldest = [str(t.version) for t in latest_to_oldest] - - component = gr.Dropdown( - choices=latest_to_oldest, - value=latest_to_oldest[0], - render=False, - label="Select Version", - ).style(container=False) - - return ( - component, - f""" - (theme) => {{ - if (!document.querySelector('.theme-css')) {{ - var theme_elem = document.createElement('style'); - theme_elem.classList.add('theme-css'); - document.head.appendChild(theme_elem); - }} else {{ - var theme_elem = document.querySelector('.theme-css'); - }} - {if_statement} - theme_elem.innerHTML = theme_css; - }} - """, - ) diff --git a/spaces/AlexWang/lama/models/ade20k/segm_lib/nn/parallel/data_parallel.py b/spaces/AlexWang/lama/models/ade20k/segm_lib/nn/parallel/data_parallel.py deleted file mode 100644 index 376fc038919aa2a5bd696141e7bb6025d4981306..0000000000000000000000000000000000000000 --- a/spaces/AlexWang/lama/models/ade20k/segm_lib/nn/parallel/data_parallel.py +++ /dev/null @@ -1,112 +0,0 @@ -# -*- coding: utf8 -*- - -import torch.cuda as cuda -import torch.nn as nn -import torch -import collections -from torch.nn.parallel._functions import Gather - - -__all__ = ['UserScatteredDataParallel', 'user_scattered_collate', 'async_copy_to'] - - -def async_copy_to(obj, dev, main_stream=None): - if torch.is_tensor(obj): - v = obj.cuda(dev, non_blocking=True) - if main_stream is not None: - v.data.record_stream(main_stream) - return v - elif isinstance(obj, collections.Mapping): - return {k: async_copy_to(o, dev, main_stream) for k, o in obj.items()} - elif isinstance(obj, collections.Sequence): - return [async_copy_to(o, dev, main_stream) for o in obj] - else: - return obj - - -def dict_gather(outputs, target_device, dim=0): - """ - Gathers variables from different GPUs on a specified device - (-1 means the CPU), with dictionary support. - """ - def gather_map(outputs): - out = outputs[0] - if torch.is_tensor(out): - # MJY(20180330) HACK:: force nr_dims > 0 - if out.dim() == 0: - outputs = [o.unsqueeze(0) for o in outputs] - return Gather.apply(target_device, dim, *outputs) - elif out is None: - return None - elif isinstance(out, collections.Mapping): - return {k: gather_map([o[k] for o in outputs]) for k in out} - elif isinstance(out, collections.Sequence): - return type(out)(map(gather_map, zip(*outputs))) - return gather_map(outputs) - - -class DictGatherDataParallel(nn.DataParallel): - def gather(self, outputs, output_device): - return dict_gather(outputs, output_device, dim=self.dim) - - -class UserScatteredDataParallel(DictGatherDataParallel): - def scatter(self, inputs, kwargs, device_ids): - assert len(inputs) == 1 - inputs = inputs[0] - inputs = _async_copy_stream(inputs, device_ids) - inputs = [[i] for i in inputs] - assert len(kwargs) == 0 - kwargs = [{} for _ in range(len(inputs))] - - return inputs, kwargs - - -def user_scattered_collate(batch): - return batch - - -def _async_copy(inputs, device_ids): - nr_devs = len(device_ids) - assert type(inputs) in (tuple, list) - assert len(inputs) == nr_devs - - outputs = [] - for i, dev in zip(inputs, device_ids): - with cuda.device(dev): - outputs.append(async_copy_to(i, dev)) - - return tuple(outputs) - - -def _async_copy_stream(inputs, device_ids): - nr_devs = len(device_ids) - assert type(inputs) in (tuple, list) - assert len(inputs) == nr_devs - - outputs = [] - streams = [_get_stream(d) for d in device_ids] - for i, dev, stream in zip(inputs, device_ids, streams): - with cuda.device(dev): - main_stream = cuda.current_stream() - with cuda.stream(stream): - outputs.append(async_copy_to(i, dev, main_stream=main_stream)) - main_stream.wait_stream(stream) - - return outputs - - -"""Adapted from: torch/nn/parallel/_functions.py""" -# background streams used for copying -_streams = None - - -def _get_stream(device): - """Gets a background stream for copying between CPU and GPU""" - global _streams - if device == -1: - return None - if _streams is None: - _streams = [None] * cuda.device_count() - if _streams[device] is None: _streams[device] = cuda.Stream(device) - return _streams[device] diff --git a/spaces/Amiminoru/Deus/README.md b/spaces/Amiminoru/Deus/README.md deleted file mode 100644 index 79592e0f318db093368e9eb00a50df57e9393207..0000000000000000000000000000000000000000 --- a/spaces/Amiminoru/Deus/README.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Deus -emoji: 👁 -colorFrom: red -colorTo: red -sdk: docker -pinned: false ---- - -Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference \ No newline at end of file diff --git a/spaces/Amrrs/DragGan-Inversion/PTI/models/e4e/stylegan2/__init__.py b/spaces/Amrrs/DragGan-Inversion/PTI/models/e4e/stylegan2/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/docs/source/en/optimization/torch2.0.md b/spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/docs/source/en/optimization/torch2.0.md deleted file mode 100644 index 6e8466fd6ecc3bc775fa031e9cedc5546091c4a4..0000000000000000000000000000000000000000 --- a/spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/docs/source/en/optimization/torch2.0.md +++ /dev/null @@ -1,444 +0,0 @@ - - -# Accelerated PyTorch 2.0 support in Diffusers - -Starting from version `0.13.0`, Diffusers supports the latest optimization from [PyTorch 2.0](https://pytorch.org/get-started/pytorch-2.0/). These include: -1. Support for accelerated transformers implementation with memory-efficient attention – no extra dependencies (such as `xformers`) required. -2. [torch.compile](https://pytorch.org/tutorials/intermediate/torch_compile_tutorial.html) support for extra performance boost when individual models are compiled. - - -## Installation - -To benefit from the accelerated attention implementation and `torch.compile()`, you just need to install the latest versions of PyTorch 2.0 from pip, and make sure you are on diffusers 0.13.0 or later. As explained below, diffusers automatically uses the optimized attention processor ([`AttnProcessor2_0`](https://github.com/huggingface/diffusers/blob/1a5797c6d4491a879ea5285c4efc377664e0332d/src/diffusers/models/attention_processor.py#L798)) (but not `torch.compile()`) -when PyTorch 2.0 is available. - -```bash -pip install --upgrade torch diffusers -``` - -## Using accelerated transformers and `torch.compile`. - - -1. **Accelerated Transformers implementation** - - PyTorch 2.0 includes an optimized and memory-efficient attention implementation through the [`torch.nn.functional.scaled_dot_product_attention`](https://pytorch.org/docs/master/generated/torch.nn.functional.scaled_dot_product_attention) function, which automatically enables several optimizations depending on the inputs and the GPU type. This is similar to the `memory_efficient_attention` from [xFormers](https://github.com/facebookresearch/xformers), but built natively into PyTorch. - - These optimizations will be enabled by default in Diffusers if PyTorch 2.0 is installed and if `torch.nn.functional.scaled_dot_product_attention` is available. To use it, just install `torch 2.0` as suggested above and simply use the pipeline. For example: - - ```Python - import torch - from diffusers import DiffusionPipeline - - pipe = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16) - pipe = pipe.to("cuda") - - prompt = "a photo of an astronaut riding a horse on mars" - image = pipe(prompt).images[0] - ``` - - If you want to enable it explicitly (which is not required), you can do so as shown below. - - ```diff - import torch - from diffusers import DiffusionPipeline - + from diffusers.models.attention_processor import AttnProcessor2_0 - - pipe = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16).to("cuda") - + pipe.unet.set_attn_processor(AttnProcessor2_0()) - - prompt = "a photo of an astronaut riding a horse on mars" - image = pipe(prompt).images[0] - ``` - - This should be as fast and memory efficient as `xFormers`. More details [in our benchmark](#benchmark). - - It is possible to revert to the vanilla attention processor ([`AttnProcessor`](https://github.com/huggingface/diffusers/blob/1a5797c6d4491a879ea5285c4efc377664e0332d/src/diffusers/models/attention_processor.py#L402)), which can be helpful to make the pipeline more deterministic, or if you need to convert a fine-tuned model to other formats such as [Core ML](https://huggingface.co/docs/diffusers/v0.16.0/en/optimization/coreml#how-to-run-stable-diffusion-with-core-ml). To use the normal attention processor you can use the [`~diffusers.UNet2DConditionModel.set_default_attn_processor`] function: - - ```Python - import torch - from diffusers import DiffusionPipeline - from diffusers.models.attention_processor import AttnProcessor - - pipe = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16).to("cuda") - pipe.unet.set_default_attn_processor() - - prompt = "a photo of an astronaut riding a horse on mars" - image = pipe(prompt).images[0] - ``` - -2. **torch.compile** - - To get an additional speedup, we can use the new `torch.compile` feature. Since the UNet of the pipeline is usually the most computationally expensive, we wrap the `unet` with `torch.compile` leaving rest of the sub-models (text encoder and VAE) as is. For more information and different options, refer to the - [torch compile docs](https://pytorch.org/tutorials/intermediate/torch_compile_tutorial.html). - - ```python - pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True) - images = pipe(prompt, num_inference_steps=steps, num_images_per_prompt=batch_size).images - ``` - - Depending on the type of GPU, `compile()` can yield between **5% - 300%** of _additional speed-up_ over the accelerated transformer optimizations. Note, however, that compilation is able to squeeze more performance improvements in more recent GPU architectures such as Ampere (A100, 3090), Ada (4090) and Hopper (H100). - - Compilation takes some time to complete, so it is best suited for situations where you need to prepare your pipeline once and then perform the same type of inference operations multiple times. Calling the compiled pipeline on a different image size will re-trigger compilation which can be expensive. - - -## Benchmark - -We conducted a comprehensive benchmark with PyTorch 2.0's efficient attention implementation and `torch.compile` across different GPUs and batch sizes for five of our most used pipelines. We used `diffusers 0.17.0.dev0`, which [makes sure `torch.compile()` is leveraged optimally](https://github.com/huggingface/diffusers/pull/3313). - -### Benchmarking code - -#### Stable Diffusion text-to-image - -```python -from diffusers import DiffusionPipeline -import torch - -path = "runwayml/stable-diffusion-v1-5" - -run_compile = True # Set True / False - -pipe = DiffusionPipeline.from_pretrained(path, torch_dtype=torch.float16) -pipe = pipe.to("cuda") -pipe.unet.to(memory_format=torch.channels_last) - -if run_compile: - print("Run torch compile") - pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True) - -prompt = "ghibli style, a fantasy landscape with castles" - -for _ in range(3): - images = pipe(prompt=prompt).images -``` - -#### Stable Diffusion image-to-image - -```python -from diffusers import StableDiffusionImg2ImgPipeline -import requests -import torch -from PIL import Image -from io import BytesIO - -url = "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg" - -response = requests.get(url) -init_image = Image.open(BytesIO(response.content)).convert("RGB") -init_image = init_image.resize((512, 512)) - -path = "runwayml/stable-diffusion-v1-5" - -run_compile = True # Set True / False - -pipe = StableDiffusionImg2ImgPipeline.from_pretrained(path, torch_dtype=torch.float16) -pipe = pipe.to("cuda") -pipe.unet.to(memory_format=torch.channels_last) - -if run_compile: - print("Run torch compile") - pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True) - -prompt = "ghibli style, a fantasy landscape with castles" - -for _ in range(3): - image = pipe(prompt=prompt, image=init_image).images[0] -``` - -#### Stable Diffusion - inpainting - -```python -from diffusers import StableDiffusionInpaintPipeline -import requests -import torch -from PIL import Image -from io import BytesIO - -url = "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg" - -def download_image(url): - response = requests.get(url) - return Image.open(BytesIO(response.content)).convert("RGB") - - -img_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" -mask_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" - -init_image = download_image(img_url).resize((512, 512)) -mask_image = download_image(mask_url).resize((512, 512)) - -path = "runwayml/stable-diffusion-inpainting" - -run_compile = True # Set True / False - -pipe = StableDiffusionInpaintPipeline.from_pretrained(path, torch_dtype=torch.float16) -pipe = pipe.to("cuda") -pipe.unet.to(memory_format=torch.channels_last) - -if run_compile: - print("Run torch compile") - pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True) - -prompt = "ghibli style, a fantasy landscape with castles" - -for _ in range(3): - image = pipe(prompt=prompt, image=init_image, mask_image=mask_image).images[0] -``` - -#### ControlNet - -```python -from diffusers import StableDiffusionControlNetPipeline, ControlNetModel -import requests -import torch -from PIL import Image -from io import BytesIO - -url = "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg" - -response = requests.get(url) -init_image = Image.open(BytesIO(response.content)).convert("RGB") -init_image = init_image.resize((512, 512)) - -path = "runwayml/stable-diffusion-v1-5" - -run_compile = True # Set True / False -controlnet = ControlNetModel.from_pretrained("lllyasviel/sd-controlnet-canny", torch_dtype=torch.float16) -pipe = StableDiffusionControlNetPipeline.from_pretrained( - path, controlnet=controlnet, torch_dtype=torch.float16 -) - -pipe = pipe.to("cuda") -pipe.unet.to(memory_format=torch.channels_last) -pipe.controlnet.to(memory_format=torch.channels_last) - -if run_compile: - print("Run torch compile") - pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True) - pipe.controlnet = torch.compile(pipe.controlnet, mode="reduce-overhead", fullgraph=True) - -prompt = "ghibli style, a fantasy landscape with castles" - -for _ in range(3): - image = pipe(prompt=prompt, image=init_image).images[0] -``` - -#### IF text-to-image + upscaling - -```python -from diffusers import DiffusionPipeline -import torch - -run_compile = True # Set True / False - -pipe = DiffusionPipeline.from_pretrained("DeepFloyd/IF-I-M-v1.0", variant="fp16", text_encoder=None, torch_dtype=torch.float16) -pipe.to("cuda") -pipe_2 = DiffusionPipeline.from_pretrained("DeepFloyd/IF-II-M-v1.0", variant="fp16", text_encoder=None, torch_dtype=torch.float16) -pipe_2.to("cuda") -pipe_3 = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-x4-upscaler", torch_dtype=torch.float16) -pipe_3.to("cuda") - - -pipe.unet.to(memory_format=torch.channels_last) -pipe_2.unet.to(memory_format=torch.channels_last) -pipe_3.unet.to(memory_format=torch.channels_last) - -if run_compile: - pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True) - pipe_2.unet = torch.compile(pipe_2.unet, mode="reduce-overhead", fullgraph=True) - pipe_3.unet = torch.compile(pipe_3.unet, mode="reduce-overhead", fullgraph=True) - -prompt = "the blue hulk" - -prompt_embeds = torch.randn((1, 2, 4096), dtype=torch.float16) -neg_prompt_embeds = torch.randn((1, 2, 4096), dtype=torch.float16) - -for _ in range(3): - image = pipe(prompt_embeds=prompt_embeds, negative_prompt_embeds=neg_prompt_embeds, output_type="pt").images - image_2 = pipe_2(image=image, prompt_embeds=prompt_embeds, negative_prompt_embeds=neg_prompt_embeds, output_type="pt").images - image_3 = pipe_3(prompt=prompt, image=image, noise_level=100).images -``` - -To give you a pictorial overview of the possible speed-ups that can be obtained with PyTorch 2.0 and `torch.compile()`, -here is a plot that shows relative speed-ups for the [Stable Diffusion text-to-image pipeline](StableDiffusionPipeline) across five -different GPU families (with a batch size of 4): - - - -To give you an even better idea of how this speed-up holds for the other pipelines presented above, consider the following -plot that shows the benchmarking numbers from an A100 across three different batch sizes -(with PyTorch 2.0 nightly and `torch.compile()`): - - - -_(Our benchmarking metric for the plots above is **number of iterations/second**)_ - -But we reveal all the benchmarking numbers in the interest of transparency! - -In the following tables, we report our findings in terms of the number of **_iterations processed per second_**. - -### A100 (batch size: 1) - -| **Pipeline** | **torch 2.0 -La música es una de las mejores maneras de relajarse, entretenerse e inspirarse. Pero a veces, es posible que no tenga acceso a Internet o quiera guardar sus datos. Ahí es cuando una aplicación de descarga de música es útil. Una aplicación de descarga de música le permite descargar canciones de varias fuentes y escucharlas sin conexión, sin usar sus datos o wifi. En este artículo, le mostraremos qué es una aplicación de descarga de música, por qué debe usar una, qué características buscar y cómo usarla para descargar música de forma gratuita.
-Download ✵ https://bltlly.com/2v6LNu
Una aplicación de descarga de música es una aplicación de software que le permite descargar música de plataformas en línea como YouTube, SoundCloud, Spotify, etc. Puede elegir entre diferentes formatos de salida y niveles de calidad, dependiendo de sus preferencias y almacenamiento de dispositivos. Una aplicación de descarga de música generalmente tiene un reproductor de música incorporado que te permite reproducir tus canciones descargadas sin conexión. Algunas aplicaciones de descarga de música también tienen otras características como radio, podcasts, listas de reproducción, letras, etc.
-Hay muchos beneficios de usar una aplicación de descarga de música, como:
-No todas las aplicaciones de descarga de música son iguales. Algunas pueden tener más características y funciones que otras. Aquí hay algunas características para buscar en una buena aplicación de descarga de música:
-Hay muchas aplicaciones de descarga de música disponibles para dispositivos Android e iOS, pero no todas valen tu tiempo y atención. Aquí están nuestras 3 mejores opciones para las mejores aplicaciones de descarga de música en 2023:
-Any Video Converter Free es una de las aplicaciones de descarga de música más populares y versátiles para computadoras Windows y Mac. Te permite descargar música desde más de 100 plataformas online, incluyendo YouTube, SoundCloud, Facebook, etc. Puedes elegir entre varios formatos de salida como MP3, AAC, M4A, WAV, etc. También puedes editar tus canciones descargadas con su editor básico que te permite recortar, combinar, recortar, rotar, etc. Any Video Converter Free también tiene un descargador de video incorporado que le permite descargar videos de fuentes en línea también.
- -Music Downloader es una aplicación simple y potente para dispositivos Android que te permite descargar música de varias fuentes en línea y reproducirlas sin conexión. Puedes buscar cualquier canción, lista de reproducción, álbum, artista, remix, single, cover, radio FM, podcast, etc. y descargarlo en diferentes formatos de salida como MP3, FLAC, M4B, MP4, 3GP, MID, OGG, etc. También puedes editar tus canciones descargadas con su editor básico que te permite recortar, merge, crop, rotate, etc. Music downloader también tiene un reproductor de música incorporado que admite la reproducción sin conexión y otras funciones como ecualizador, aumento de graves, tema oscuro, temporizador de sueño, tonos de llamada, letras, listas de reproducción, Dropbox, etc.
-Usar una aplicación de descarga de música para descargar canciones sin conexión es muy fácil y conveniente. Estos son los pasos básicos que debe seguir:
-El primer paso es elegir una aplicación de descarga de música que se adapte a sus necesidades y preferencias. Puede consultar nuestras 3 mejores selecciones anteriores o buscar otras opciones en Internet. Una vez que haya elegido una aplicación de descarga de música, debe instalarla en su dispositivo. Puedes descargarlo desde el sitio web oficial, la tienda de aplicaciones o la tienda de Google Play, dependiendo de tu dispositivo y la aplicación. Siga las instrucciones en la pantalla para completar el proceso de instalación.
-El siguiente paso es buscar las canciones o listas de reproducción que desea descargar. Puede usar la función de búsqueda de la aplicación, navegar por categorías, géneros, artistas, etc., o ingresar la URL de la fuente en línea. También puedes usar las recomendaciones, sugerencias o gráficos de la aplicación para descubrir nueva música. Una vez que haya encontrado las canciones o listas de reproducción que desea descargar, puede seleccionarlas pulsando en ellas o marcando las casillas junto a ellas.
-El paso final es tocar el botón de descarga y seleccionar el formato de salida y la calidad de sus canciones descargadas. Puede elegir entre diferentes opciones como MP3, AAC, M4A, WAV, etc., y diferentes niveles de calidad como alta, media, baja, etc. También puede personalizar otros ajustes como bitrate, frecuencia de muestreo, volumen, etc., dependiendo de la aplicación. Después de haber hecho sus elecciones, puede iniciar el proceso de descarga tocando el botón de inicio o confirmando su selección.
-Una aplicación de descarga de música es una gran manera de descargar música gratis de varias fuentes en línea y escucharlas sin conexión. Tiene muchos beneficios como guardar sus datos o wifi, crear sus propias listas de reproducción, descubrir nueva música, etc. También tiene algunas características que buscar, como el apoyo a múltiples fuentes y plataformas, ofreciendo diferentes formatos de salida y opciones de calidad, tener una interfaz fácil de usar y funciones fáciles de usar, etc. Hemos revisado nuestras 3 mejores opciones para las mejores aplicaciones de descarga de música en 2023: Any Video Converter Free, Audiomack: Music Downloader y Music Downloader - Aplicaciones en Google Play. También le hemos mostrado cómo usar una aplicación de descarga de música para descargar canciones sin conexión en cuatro sencillos pasos. Esperamos que este artículo te haya ayudado a aprender más sobre las aplicaciones de descarga de música y cómo usarlas. Si tiene alguna pregunta o comentario, no dude en dejarlos abajo.
-Aquí hay algunas preguntas frecuentes sobre aplicaciones de descarga de música:
-A: La legalidad de descargar música con una aplicación de descarga de música depende de varios factores, como la fuente de la música, el estado de copyright de la música, los términos y condiciones de la plataforma, etc. En términos generales, es legal descargar música que está en el dominio público, que está licenciada bajo Creative Commons o licencias similares, que se ofrece de forma gratuita por el artista o plataforma, etc. Sin embargo, puede no ser legal descargar música que esté protegida por las leyes de derechos de autor, que es exclusivo de una plataforma, que se descarga con fines comerciales, etc. Por lo tanto, es aconsejable verificar el estado legal de la música antes de descargarla con una aplicación de descarga de música, y respetar los derechos de los artistas y plataformas.
-A: el espacio que una aplicación de descarga de música ocupa en su dispositivo depende de varios factores, como el tamaño de la aplicación, el número y el tamaño de las canciones descargadas, el formato de salida y la calidad de las canciones descargadas, etc. En términos generales, una aplicación de descarga de música en sí no ocupa mucho espacio en su dispositivo, generalmente menos de 100 MB. Sin embargo, las canciones descargadas pueden ocupar mucho espacio en su dispositivo, dependiendo de cuántas canciones descargue y qué formato y calidad elija. Por ejemplo, una canción MP3 de 3 minutos a 320 kbps puede ocupar unos 7 MB de espacio, mientras que una canción FLAC de 3 minutos a 1411 kbps puede ocupar unos 30 MB de espacio. Por lo tanto, es recomendable comprobar el espacio de almacenamiento disponible en el dispositivo antes de descargar canciones con una aplicación de descarga de música, y para eliminar o transferir algunas canciones si es necesario.
-A: Hay diferentes formas de transferir tus canciones descargadas a otros dispositivos o almacenamiento externo, dependiendo del tipo y compatibilidad de tus dispositivos y almacenamiento. Algunos métodos comunes son:
-A: Algunas aplicaciones de descarga de música tienen un editor incorporado que le permite editar sus canciones descargadas con funciones básicas como recorte, fusión, recorte, rotación, etc. Para editar sus canciones descargadas con una aplicación de descarga de música, necesita abrir la aplicación y seleccionar la canción que desea editar. Luego debe tocar en el botón de edición y elegir la función que desea utilizar. A continuación, puede ajustar los parámetros como la hora de inicio, hora de finalización, duración, volumen, etc., dependiendo de la función. Después de haber hecho sus cambios, necesita guardar o exportar su canción editada.
64aa2da5cfKick the Buddy es un popular juego móvil que te permite desatar tu ira y frustración en un muñeco de trapo indefenso. Puedes usar todo tipo de armas y accesorios para torturar, explotar, aplastar, congelar, quemar, disparar e incluso bombardear a tu amigo. Es un juego divertido y relajante que puede ayudarte a desahogarte y reírte.
-Download ✏ ✏ ✏ https://bltlly.com/2v6Mjn
Pero ¿qué pasa si quieres jugar Kick the Buddy en tu PC en lugar de tu teléfono? Tal vez usted tiene una computadora con Windows 7 que todavía utiliza para el trabajo o el entretenimiento. Quizás prefieras jugar en una pantalla más grande y con un teclado y un ratón. Quizás solo quieras probar algo nuevo y diferente.
-Si ese es el caso, entonces estás de suerte. En este artículo, te mostraremos cómo descargar e instalar Kick the Buddy en Windows 7 gratis. También te daremos algunos consejos y trucos sobre cómo jugarlo, así como algunos beneficios y desventajas de jugarlo en tu PC. Y si estás buscando alternativas a Kick the Buddy, también te sugeriremos otros juegos que puedes jugar en tu ordenador con Windows 7.
-Kick the Buddy es un juego para Android, lo que significa que no puedes ejecutarlo directamente en tu PC con Windows 7. Necesitas un emulador de Android, que es un software que imita un dispositivo Android en tu computadora. Hay muchos emuladores de Android disponibles en línea, pero algunos de los más populares son BlueStacks y NoxPlayer. Estos son los pasos para descargar e instalar Kick the Buddy en Windows 7 usando un emulador de Android:
-Kick the Buddy es un juego simple y fácil de jugar. El objetivo principal es divertirse con su amigo y usar varias armas y accesorios para destruirlo. También puede ganar monedas y oro jugando el juego, que se puede utilizar para comprar más artículos y características. Aquí hay algunos consejos y trucos sobre cómo jugar Kick the Buddy en Windows 7:
- -Jugar a Kick the Buddy en Windows 7 tiene algunos beneficios que quizás no obtengas al jugarlo en tu teléfono. Estos son algunos de ellos:
-Jugar Kick the Buddy en Windows 7 también tiene algunos inconvenientes que debes tener en cuenta. Estos son algunos de ellos:
-Si estás buscando algunas alternativas a jugar Kick the Buddy en Windows 7, hay otros juegos que puedes jugar en tu PC que son similares a Kick the Buddy. Aquí hay algunos ejemplos:
-Kick the Buddy es un juego divertido y relajante que te permite desatar tu ira y frustración en un muñeco de trapo indefenso. Puede descargarlo e instalarlo en su PC con Windows 7 de forma gratuita utilizando un emulador de Android. También puede jugar con diferentes armas y accesorios, desbloquear nuevos artículos y características, y personalizar a su amigo y su fondo. Sin embargo, también debe ser consciente de los inconvenientes de jugar en su PC, tales como problemas de compatibilidad, riesgos de adicción y exposición a la violencia. Y si quieres probar otros juegos similares a Kick the Buddy, puedes echar un vistazo a algunas de las alternativas que te sugerimos.
-Esperamos que este artículo le haya ayudado a aprender a descargar y jugar Kick the Buddy en Windows 7. Si tiene alguna pregunta o comentario, no dude en dejar un comentario a continuación. Y si te gustó este artículo, por favor compártelo con tus amigos y familiares que también podrían estar interesados en jugar Kick the Buddy en su PC.
-{text}" - - -def prompt_markup_format(text): - return f'<*font color="black">{text}*font>' - - -def generation_markup_format(text): - return f"{text}" - - -ds = load_dataset("bigscience/bloom-generations", use_auth_token=HF_API_TOKEN) -ds = ds["train"] - - -col_1, col_2 = st.columns(2) -with col_1: - possible_checkpoint = ds.unique("checkpoint") - st.markdown("
|`)?(\w*)\s*=\s*", cell['source'])
- if match is not None: doc_fns[match.group(1)] = i
- return doc_fns
-
-def link_markdown_cells(cells, modules):
- "Create documentation links for all cells in markdown with backticks."
- for i, cell in enumerate(cells):
- if cell['cell_type'] == 'markdown':
- cell['source'] = link_docstring(modules, cell['source'])
-
-def get_insert_idx(pos_dict, name):
- "Return the position to insert a given function doc in a notebook."
- keys,i = list(pos_dict.keys()),0
- while i < len(keys) and str.lower(keys[i]) < str.lower(name): i+=1
- if i == len(keys): return -1
- else: return pos_dict[keys[i]]
-
-def update_pos(pos_dict, start_key, nbr=2):
- "Update the `pos_dict` by moving all positions after `start_key` by `nbr`."
- for key,idx in pos_dict.items():
- if str.lower(key) >= str.lower(start_key): pos_dict[key] += nbr
- return pos_dict
-
-def insert_cells(cells, pos_dict, ft_name, append=False):
- "Insert the function doc `cells` at their correct position and updates `pos_dict`."
- idx = get_insert_idx(pos_dict, ft_name)
- if append or idx == -1: cells += [get_doc_cell(ft_name), get_empty_cell()]
- else:
- cells.insert(idx, get_doc_cell(ft_name))
- cells.insert(idx+1, get_empty_cell())
- pos_dict = update_pos(pos_dict, ft_name, 2)
- return cells, pos_dict
-
-def get_doc_path(mod, dest_path):
- strip_name = strip_fastai(mod.__name__)
- return os.path.join(dest_path,f'{strip_name}.ipynb')
-
-def generate_missing_metadata(dest_file):
- fn = Path(dest_file)
- meta_fn = fn.parent/'jekyll_metadata.ipynb'
- if not fn.exists() or not meta_fn.exists(): return print('Could not find notebooks:', fn, meta_fn)
- metadata_nb = read_nb(meta_fn)
-
- if has_metadata_cell(metadata_nb['cells'], fn.name): return
- nb = read_nb(fn)
- jmd = nb['metadata'].get('jekyll', {})
- fmt_params = ''
- for k,v in jmd.items(): fmt_params += f',\n {k}={stringify(v)}'
- metadata_cell = get_code_cell(f"update_nb_metadata('{Path(fn).name}'{fmt_params})", hidden=False)
- metadata_nb['cells'].append(metadata_cell)
- write_nb(metadata_nb, meta_fn)
-
-def update_nb_metadata(nb_path=None, title=None, summary=None, keywords='fastai', overwrite=True, **kwargs):
- "Creates jekyll metadata for given notebook path."
- nb = read_nb(nb_path)
- data = {'title': title, 'summary': summary, 'keywords': keywords, **kwargs}
- data = {k:v for (k,v) in data.items() if v is not None} # remove none values
- if not data: return
- nb['metadata']['jekyll'] = data
- write_nb(nb, nb_path)
- NotebookNotary().sign(nb)
-
-def has_metadata_cell(cells, fn):
- for c in cells:
- if re.search(f"update_nb_metadata\('{fn}'", c['source']): return c
-
-def stringify(s): return f'\'{s}\'' if isinstance(s, str) else s
-
-IMPORT_RE = re.compile(r"from (fastai[\.\w_]*)")
-def get_imported_modules(cells, nb_module_name=''):
- "Finds all submodules of notebook - sorted by submodules > top level modules > manual imports. This gives notebook imports priority"
- module_names = get_top_level_modules()
- nb_imports = [match.group(1) for cell in cells for match in IMPORT_RE.finditer(cell['source']) if cell['cell_type'] == 'code']
- parts = nb_module_name.split('.')
- parent_modules = ['.'.join(parts[:(x+1)]) for x in range_of(parts)] # Imports parent modules - a.b.c = [a, a.b, a.b.c]
- all_modules = module_names + nb_imports + parent_modules
- mods = [import_mod(m, ignore_errors=True) for m in all_modules]
- return [m for m in mods if m is not None]
-
-def get_top_level_modules(num_levels=1):
- mod_dir = Path(import_mod('fastai').__file__).parent
- filtered_n = filter(lambda x: x.count('.')<=num_levels, get_module_names(mod_dir))
- return sorted(filtered_n, key=lambda s: s.count('.'), reverse=True) # Submodules first (sorted by periods)
-
-NEW_FT_HEADER = '## New Methods - Please document or move to the undocumented section'
-UNDOC_HEADER = '## Undocumented Methods - Methods moved below this line will intentionally be hidden'
-def parse_sections(cells):
- old_cells, undoc_cells, new_cells = [], [], []
- current_section = old_cells
- for cell in cells:
- if cell['cell_type'] == 'markdown':
- if re.match(UNDOC_HEADER, cell['source']): current_section = undoc_cells
- if re.match(NEW_FT_HEADER, cell['source']): current_section = new_cells
- current_section.append(cell)
- undoc_cells = undoc_cells or [get_md_cell(UNDOC_HEADER)]
- new_cells = new_cells or [get_md_cell(NEW_FT_HEADER)]
- return old_cells, undoc_cells, new_cells
-
-def remove_undoc_cells(cells):
- old, _, _ = parse_sections(cells)
- return old
-
-# currently code vbox sub-cells mainly
-def remove_code_cell_jupyter_widget_state_elem(cells):
- for c in cells:
- if c['cell_type'] == 'code':
- if 'outputs' in c:
- c['outputs'] = [l for l in c['outputs'] if not ('data' in l and 'application/vnd.jupyter.widget-view+json' in l.data)]
- return cells
-
-def update_module_page(mod, dest_path='.'):
- "Update the documentation notebook of a given module."
- doc_path = get_doc_path(mod, dest_path)
- strip_name = strip_fastai(mod.__name__)
- nb = read_nb(doc_path)
- cells = nb['cells']
-
- link_markdown_cells(cells, get_imported_modules(cells, mod.__name__))
-
- type_dict = read_nb_types(cells)
- gvar_map = get_global_vars(mod)
- for name in get_exports(mod):
- if name not in gvar_map: continue
- code = gvar_map[name]
- if name in type_dict: cells[type_dict[name]] = get_md_cell(code)
- else: cells.append(get_md_cell(code))
-
- pos_dict = read_nb_content(cells, strip_name)
- ft_names = get_ft_names(mod, include_inner=True)
- new_fts = list(set(ft_names) - set(pos_dict.keys()))
- if new_fts: print(f'Found new fuctions for {mod}. Please document:\n{new_fts}')
- existing, undoc_cells, new_cells = parse_sections(cells)
- for ft_name in new_fts: new_cells.extend([get_doc_cell(ft_name), get_empty_cell()])
- if len(new_cells) > 1: nb['cells'] = existing + undoc_cells + new_cells
-
- write_nb(nb, doc_path)
- return doc_path
-
-def link_nb(nb_path):
- nb = read_nb(nb_path)
- cells = nb['cells']
- link_markdown_cells(cells, get_imported_modules(cells, Path(nb_path).stem))
- write_nb(nb, nb_path)
- NotebookNotary().sign(read_nb(nb_path))
-
-def get_module_from_notebook(doc_path):
- "Find module given a source path. Assume it belongs to fastai directory"
- return f'fastai.{Path(doc_path).stem}'
-
-def check_nbconvert_version():
- import nbconvert
- assert nbconvert.version_info >= (5,4,0), "Please update nbconvert to >=5.4 for consistent .html output"
-
-def update_notebooks(source_path, dest_path=None, update_html=True, document_new_fns=False,
- update_nb_links=True, html_path=None, force=False):
- "`source_path` can be a directory or a file. Assume all modules reside in the fastai directory."
- from .convert2html import convert_nb
- source_path = Path(source_path)
-
- if source_path.is_file():
- dest_path = source_path.parent if dest_path is None else Path(dest_path)
- html_path = dest_path/'..'/'docs' if html_path is None else Path(html_path)
- doc_path = source_path
- assert source_path.suffix == '.ipynb', 'Must update from notebook or module'
- if document_new_fns:
- mod = import_mod(get_module_from_notebook(source_path))
- if not mod: print('Could not find module for path:', source_path)
- elif mod.__file__.endswith('__init__.py'): pass
- else: update_module_page(mod, dest_path)
- generate_missing_metadata(doc_path)
- if update_nb_links:
- print(f'Updating notebook {doc_path}. Please wait...')
- link_nb(doc_path)
- execute_nb(doc_path, {'metadata': {'path': doc_path.parent}}, show_doc_only=True)
- if update_html:
- check_nbconvert_version()
- html_fn = html_path/doc_path.with_suffix('.html').name
- if not force and html_fn.is_file():
- in_mod = os.path.getmtime(doc_path)
- out_mod = os.path.getmtime(html_fn)
- if in_mod < out_mod: return
- convert_nb(doc_path, html_path)
-
- elif (source_path.name.startswith('fastai.')):
- # Do module update
- assert dest_path is not None, 'To update a module, you must specify a destination folder for where notebook resides'
- mod = import_mod(source_path.name)
- if not mod: return print('Could not find module for:', source_path)
- doc_path = Path(dest_path)/(strip_fastai(mod.__name__)+'.ipynb')
- if not doc_path.exists():
- print('Notebook does not exist. Creating:', doc_path)
- create_module_page(mod, dest_path)
- update_notebooks(doc_path, dest_path=dest_path, update_html=update_html, document_new_fns=document_new_fns,
- update_nb_links=update_nb_links, html_path=html_path)
- elif source_path.is_dir():
- for f in sorted(Path(source_path).glob('*.ipynb')):
- update_notebooks(f, dest_path=dest_path, update_html=update_html, document_new_fns=document_new_fns,
- update_nb_links=update_nb_links, html_path=html_path)
- else: print('Could not resolve source file:', source_path)
diff --git a/spaces/ali-ghamdan/realesrgan-models/tests/test_discriminator_arch.py b/spaces/ali-ghamdan/realesrgan-models/tests/test_discriminator_arch.py
deleted file mode 100644
index c56a40c7743630aa63b3e99bca8dc1a85949c4c5..0000000000000000000000000000000000000000
--- a/spaces/ali-ghamdan/realesrgan-models/tests/test_discriminator_arch.py
+++ /dev/null
@@ -1,19 +0,0 @@
-import torch
-
-from realesrgan.archs.discriminator_arch import UNetDiscriminatorSN
-
-
-def test_unetdiscriminatorsn():
- """Test arch: UNetDiscriminatorSN."""
-
- # model init and forward (cpu)
- net = UNetDiscriminatorSN(num_in_ch=3, num_feat=4, skip_connection=True)
- img = torch.rand((1, 3, 32, 32), dtype=torch.float32)
- output = net(img)
- assert output.shape == (1, 1, 32, 32)
-
- # model init and forward (gpu)
- if torch.cuda.is_available():
- net.cuda()
- output = net(img.cuda())
- assert output.shape == (1, 1, 32, 32)
diff --git a/spaces/alistairmcleay/cambridge-masters-project/src/crazyneuraluser/user_model_code/dataset.py b/spaces/alistairmcleay/cambridge-masters-project/src/crazyneuraluser/user_model_code/dataset.py
deleted file mode 100644
index b9e51f785685afc33eee782344108b7891a25452..0000000000000000000000000000000000000000
--- a/spaces/alistairmcleay/cambridge-masters-project/src/crazyneuraluser/user_model_code/dataset.py
+++ /dev/null
@@ -1,297 +0,0 @@
-import json
-import os
-
-import torch
-from tqdm import tqdm
-
-from crazyneuraluser.user_model_code.utils_sgd import (
- add_str,
- get_special_tokens,
- wrap_element,
-)
-
-
-class SGD_Dataset(torch.utils.data.Dataset):
- def __init__(self, args, tokenizer, data_split, generation, data_size):
- assert data_split in ["train", "dev", "test", "demo"]
- self.args = args
- self.data_size = data_size
- self.tokenizer = tokenizer
- self.data_split = data_split
- self.generation = generation
- self.n_trimmed = 0
-
- self.SPECIAL_TOKENS = get_special_tokens()
- self._get_special_token_ids()
-
- # create examples
- self.examples = []
- for data_name in args.data_list:
- examples = self._create_examples(data_name, data_split)
- self.examples += examples
- print("Total ({}) -> {} examples".format(data_split, len(self.examples)))
-
- def _get_special_token_ids(self):
- self.bos_id = self.tokenizer.convert_tokens_to_ids(
- self.SPECIAL_TOKENS["bos_token"]
- )
- self.eos_id = self.tokenizer.convert_tokens_to_ids(
- self.SPECIAL_TOKENS["eos_token"]
- )
- self.pad_id = self.tokenizer.convert_tokens_to_ids(
- self.SPECIAL_TOKENS["pad_token"]
- )
- self.sep_id = self.tokenizer.convert_tokens_to_ids(
- self.SPECIAL_TOKENS["sep_token"]
- )
- # print('SPECIAL TOKEN MAPPING:')
- # print('bos:{} | eos:{} | pad:{} | sep:{}'.format(self.bos_id, self.eos_id, self.pad_id, self.sep_id))
-
- self.add_special_token_ids = {}
- for token in self.SPECIAL_TOKENS["additional_special_tokens"]:
- self.add_special_token_ids[token] = self.tokenizer.convert_tokens_to_ids(
- token
- )
-
- self.true_token, self.false_token = "_True_", "_False_"
- assert self.true_token in self.SPECIAL_TOKENS["additional_special_tokens"]
- assert self.false_token in self.SPECIAL_TOKENS["additional_special_tokens"]
- """
- if using BPE (default method, simply call tokenizer(natural sentence)), no need unk_token
- if using convert_tokens_to_ids, check which is correct way to handle oov:
- a) simply use as unk_token (default setup) or
- b) add unk_token into special tokens
- """
-
- def _create_examples(self, data_name, data_split):
- data_file = os.path.join(
- self.args.data_dir, data_name, "{}.json".format(data_split)
- )
- with open(data_file) as f:
- data = json.load(f)
-
- examples = []
- for dial_id in tqdm(sorted(data.keys())):
- if self.data_size != -1 and len(examples) >= self.data_size:
- break
- dial_meta = data[dial_id]
- context = ""
- for i in range(100):
- example_id = "{}-{}".format(dial_id, i)
- self.example_id = example_id
- if example_id not in dial_meta:
- break
-
- # testing #
- # # SGD
- # if data_split == "test" and dial_id not in ["10_00056", "10_00075"]: # seen, movie domain
- # if data_split == "test" and dial_id not in ["16_00040"]: # seen
- # if data_split == "test" and dial_id not in ["8_00066", "16_00095", "8_00065"]: # unseen
- # if data_split == "test" and dial_id not in ["9_00121", "9_00122"]:
- # # req_alts cases w/i, w/o inform
- # continue
- # # mwoz
- # if data_split == "test" and dial_id not in ["MUL0071.json"]:
- # # test predictions in no offer & no book
- # continue
-
- # turn info
- goal = dial_meta[example_id]["goal"]
- # service = dial_meta[example_id]["service"]
- # intent = dial_meta[example_id]["intent"]
-
- # utterances
- usr_utt = dial_meta[example_id]["utterances"]["usr"]
- sys_utt = dial_meta[example_id]["utterances"]["sys"]
-
- # actions
- usr_act = dial_meta[example_id]["actions"]["usr"]
- sys_act = dial_meta[example_id]["actions"]["sys"]
-
- # binary flags
- snt = dial_meta[example_id]["start_new_task"]
- gc = dial_meta[example_id]["goal_change"]
- ra = dial_meta[example_id]["req_alts"]
-
- # get input ids
- (
- input_seq,
- input_ids,
- label_ids,
- valid_example,
- ) = self._prepare_input_ids(
- goal, context, usr_utt, usr_act, sys_utt, sys_act, snt, gc, ra
- )
-
- if valid_example:
- assert len(input_ids) < 1024
- dial_meta[example_id]["context"] = context
- examples.append(
- {
- "input_ids": input_ids, # list of ids
- "label_ids": label_ids, # list of ids
- "metadata": dial_meta[example_id],
- "example_id": self.example_id,
- "data_name": data_name,
- }
- )
-
- # collect context
- sys_utt_wrap = wrap_element("SYS", sys_utt)
- usr_utt_wrap = wrap_element("USR", usr_utt)
- context = add_str(context, sys_utt_wrap)
- context = add_str(context, usr_utt_wrap)
-
- print(
- "Data Stat: {} ({}) -> {} examples ({} examples are trimmed)".format(
- data_name, self.data_split, len(examples), self.n_trimmed
- )
- )
- return examples
-
- def _prepare_input_ids(
- self, goal, context, usr_utt, usr_act, sys_utt, sys_act, snt, gc, ra
- ):
- """
- prepare input sequence ids to GPT2
- template:
- """
- goal_wrap = wrap_element("GOAL", goal)
- context_wrap = wrap_element("CTX", context)
- usr_utt_wrap = wrap_element("USR_UTT", usr_utt)
- usr_act_wrap = wrap_element("USR_ACT", usr_act)
- sys_utt_wrap = wrap_element("SYS_UTT", sys_utt)
- sys_act_wrap = wrap_element("SYS_ACT", sys_act)
-
- snt = self.true_token if snt else self.false_token # `Start New Task` flag
- snt_wrap = wrap_element("SNT", snt)
- gc = self.true_token if gc else self.false_token # `Goal Change` flag
- gc_wrap = wrap_element("GC", gc)
- ra = self.true_token if ra else self.false_token # `Request Alternatives` flag
- ra_wrap = wrap_element("RA", ra)
- if self.args.use_ra_flag:
- flags_wrap = snt_wrap + " " + ra_wrap + " " + gc_wrap
- else:
- flags_wrap = snt_wrap + " " + gc_wrap
-
- if not self.generation: # supervised
- input_seq = (
- context_wrap
- + " "
- + sys_utt_wrap
- + " "
- + sys_act_wrap
- + " "
- + flags_wrap
- + " "
- + goal_wrap
- + " "
- + usr_act_wrap
- + " "
- + usr_utt_wrap
- + " "
- + self.SPECIAL_TOKENS["eos_token"]
- )
- input_ids = self.tokenizer(input_seq)["input_ids"] # convert to ids
- label_ids = self._get_labels(input_ids)
- else: # generation
- input_seq = (
- context_wrap
- + " "
- + sys_utt_wrap
- + " "
- + sys_act_wrap
- + " "
- + flags_wrap
- + " "
- + goal_wrap
- + " "
- + " "
- ) # + " " + usr_act_wrap + " " + usr_utt_wrap
- input_ids = self.tokenizer(input_seq)["input_ids"] # convert to ids
- label_ids = None
-
- valid_example = True
- if len(input_ids) > 1023:
- print("{}: {}".format(self.n_trimmed, self.example_id))
- self.n_trimmed += 1
- valid_example = False
-
- return input_seq, input_ids, label_ids, valid_example
-
- def _get_labels(self, input_ids):
- for special_token in [" ", " ", " "]:
- special_token_id = self.add_special_token_ids[special_token]
- assert input_ids.count(special_token_id) == 1
-
- label_ids = [-100] * len(input_ids)
-
- # sys act signal interval
- start_position = input_ids.index(self.add_special_token_ids[" "])
- end_position = input_ids.index(self.add_special_token_ids[""]) + 1
- label_ids[start_position:end_position] = input_ids[start_position:end_position]
-
- # usr act and utt singal interval
- start_position = input_ids.index(self.add_special_token_ids[" "])
- assert self.eos_id == input_ids[-1]
- label_ids[start_position:] = input_ids[start_position:]
- assert len(label_ids) == len(input_ids)
- return label_ids
-
- def _pad(self, sentences, pad_id):
- max_len = max((map(len, sentences)))
- attention_mask = []
- sentences_pad = []
- for sent in sentences:
- pad_len = max_len - len(sent)
- sentences_pad.append(sent + [pad_id] * pad_len)
- attention_mask.append([1] * len(sent) + [0] * pad_len)
- return sentences_pad, attention_mask
-
- def __len__(self): # required
- return len(self.examples)
-
- def __getitem__(self, index): # required
- """
- index will be ramdomly sampled by the fed sampler, we dont need to worry about index
- """
- return self.examples[index]
-
- def collate_fn(self, batch): # optional but useful
- """
- when collate_fn is given to the torch dataloader, we can do further actions to the batch, e.g.,
- tensor can be formed here a batch is formed as a list where each element is a defined data returned
- by __getitem__, andy
- """
- input_ids = [example["input_ids"] for example in batch]
- input_ids, attention_mask = self._pad(input_ids, self.pad_id)
- input_ids, attention_mask = torch.tensor(input_ids).long().to(
- self.args.device
- ), torch.tensor(attention_mask).long().to(self.args.device)
-
- if not self.generation:
- label_ids = [example["label_ids"] for example in batch]
- label_ids, _ = self._pad(label_ids, -100)
- label_ids = torch.tensor(label_ids).long().to(self.args.device)
- else:
- label_ids = None
- token_type_ids = None
-
- # store info for scoring
- metadata = [ex["metadata"] for ex in batch]
- example_id = [ex["example_id"] for ex in batch]
- data_name = [ex["data_name"] for ex in batch]
-
- return {
- "input_ids": input_ids,
- "attention_mask": attention_mask,
- "token_type_ids": token_type_ids,
- "label_ids": label_ids,
- "metadata": metadata,
- "example_id": example_id,
- "data_name": data_name,
- }
-
-
-if __name__ == "__main__":
- pass
diff --git a/spaces/allisonye/sketchpad_multiplecharsmodel/app.py b/spaces/allisonye/sketchpad_multiplecharsmodel/app.py
deleted file mode 100644
index 11d8376a002b99cc6682fb67e9c00508a7865c43..0000000000000000000000000000000000000000
--- a/spaces/allisonye/sketchpad_multiplecharsmodel/app.py
+++ /dev/null
@@ -1,108 +0,0 @@
-from tensorflow.python.ops.numpy_ops import np_config
-np_config.enable_numpy_behavior()
-
-import tensorflow as tf
-import numpy as np
-import gradio as gr
-
-import cv2
-import functools
-
-from keras.preprocessing.image import img_to_array
-import matplotlib.pyplot as plt
-class_mapping = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabdefghnqrt"
-TARGET_HEIGHT = 28
-TARGET_WIDTH = 28
-
-from emnist import extract_training_samples
-training_images, training_labels = extract_training_samples("balanced")
-from emnist import extract_test_samples
-testing_images, testing_labels = extract_test_samples("balanced")
-
-training_images = training_images / 255.0
-testing_images = testing_images / 255.0
-training_images = np.expand_dims(training_images, axis=3)
-testing_images = np.expand_dims(testing_images, axis=3)
-num_filters = 32
-kernel_size = (3, 3)
-pool_size = (2, 2)
-
-model = tf.keras.Sequential([
- tf.keras.layers.Conv2D(num_filters, kernel_size, activation="relu"),
- tf.keras.layers.MaxPooling2D(pool_size),
- tf.keras.layers.Conv2D(num_filters, kernel_size, activation="relu"),
- tf.keras.layers.MaxPooling2D(pool_size),
- tf.keras.layers.Flatten(),
- tf.keras.layers.Dense(128, activation="relu"),
- tf.keras.layers.Dense(47, activation="softmax")
-])
-model.compile(optimizer="Adam", loss="sparse_categorical_crossentropy", metrics=["accuracy"])
-model.fit(training_images, training_labels, epochs=5)
-
-def class_idx_to_class(class_idx):
- class_mapping = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabdefghnqrt"
- return class_mapping[class_idx]
-
-def classify(image):
- image = tf.math.divide(image, 255)
- prediction = model.predict(image.reshape(-1, 28, 28, 1))[0]
- return {str(class_idx_to_class(i)): float(prediction[i]) for i in range(47)}
-
-def classify_word(input):
- # final word/string to return
- classification = ""
- # apply thresholding to make differences between characters and background more obvious
- image = cv2.imwrite('file.jpg', input)
- image = cv2.imread('file.jpg', 0)
- throwaway, threshold = cv2.threshold(image, 128, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)
- plt.imshow(threshold, cmap='gray')
-
- # find contours and get bounding box
- contours, _ = cv2.findContours(threshold.copy(), cv2.RETR_CCOMP, cv2.CHAIN_APPROX_SIMPLE)
- cv2.drawContours(threshold, contours, -1, (0, 255, 0), thickness=1)
- boundingBoxes = [cv2.boundingRect(contour) for contour in contours]
-
- # sort bounding boxes from left to right and top to bottom so characters are read in the correct order
- boundingBoxes=sorted(boundingBoxes, key=functools.cmp_to_key(compare))
- # loop over bounding boxes
- for rect in boundingBoxes:
- # get coordinates from the bounding box
- x, y, w, h = rect
- # only process if size of character is large enough
- if w * h > 30:
- # crop to only have the character
- crop = image[y:y+h, x:x+w]
-
- # ensure each character is the correct size for our model (28 x 28) by adding padding
- rows = crop.shape[0]
- columns = crop.shape[1]
- paddingX = (TARGET_HEIGHT - rows) // 2 if rows < TARGET_HEIGHT else rows
- paddingY = (TARGET_WIDTH - columns) // 2 if columns < TARGET_WIDTH else columns
-
- # add padding
- crop = cv2.copyMakeBorder(crop, paddingY, paddingY, paddingX, paddingX, cv2.BORDER_CONSTANT, None, value=0)
-
- # convert and resize image to target height and width
- crop = cv2.resize(crop, (TARGET_WIDTH, TARGET_HEIGHT))
-
- # format image data to make prediction
- crop = img_to_array(crop)
- char = crop.reshape((-1, 28, 28, 1))
-
- # make prediction, add to classification string
- char = tf.math.divide(char, 255.0)
- prediction = model.predict(char)[0]
- #dictionary = {str(class_mapping[i]): float(prediction[i]) for i in range(47)}
- classification += class_mapping[np.argmax(prediction)]
- return classification
-
-def compare(rect1, rect2):
- if abs(rect1[1] - rect2[1]) > 10:
- return rect1[1] - rect2[1]
- else:
- return rect1[0] - rect2[0]
-
-image = gr.inputs.Image(shape=(28, 28), image_mode="L", invert_colors=True, source="canvas", type="numpy")
-label = gr.outputs.Label(num_top_classes=3)
-interface = gr.Interface(fn=classify_word, inputs=image, outputs=label, capture_session=True)
-interface.launch(share=True, debug=True)
\ No newline at end of file
diff --git a/spaces/allknowingroger/Image-Models-Test13/app.py b/spaces/allknowingroger/Image-Models-Test13/app.py
deleted file mode 100644
index 4583e52bc4a7a5bfcd23f8e8422f5b56e86468dc..0000000000000000000000000000000000000000
--- a/spaces/allknowingroger/Image-Models-Test13/app.py
+++ /dev/null
@@ -1,144 +0,0 @@
-import gradio as gr
-# import os
-# import sys
-# from pathlib import Path
-import time
-
-models =[
- "maisi7/lora-trained-xl"
- "LanguageMachines/stable-diffusion-2-1",
- "udg/5c44daf6-24fa-4c9b-8614-be0f64bee36d",
- "wofmanaf/sd-knowledge-model-lora-sdxl-ft-text-encoder-freeze-unet-ep6",
- "digiplay/m3u",
- "digiplay/MeinaPastel_v3",
- "digiplay/endlessMixRenatus_v1.1",
- "digiplay/CuriousMerge2.5D_v5",
- "digiplay/alstroemeriaMix_v1",
-]
-
-
-model_functions = {}
-model_idx = 1
-for model_path in models:
- try:
- model_functions[model_idx] = gr.Interface.load(f"models/{model_path}", live=False, preprocess=True, postprocess=False)
- except Exception as error:
- def the_fn(txt):
- return None
- model_functions[model_idx] = gr.Interface(fn=the_fn, inputs=["text"], outputs=["image"])
- model_idx+=1
-
-
-def send_it_idx(idx):
- def send_it_fn(prompt):
- output = (model_functions.get(str(idx)) or model_functions.get(str(1)))(prompt)
- return output
- return send_it_fn
-
-def get_prompts(prompt_text):
- return prompt_text
-
-def clear_it(val):
- if int(val) != 0:
- val = 0
- else:
- val = 0
- pass
- return val
-
-def all_task_end(cnt,t_stamp):
- to = t_stamp + 60
- et = time.time()
- if et > to and t_stamp != 0:
- d = gr.update(value=0)
- tog = gr.update(value=1)
- #print(f'to: {to} et: {et}')
- else:
- if cnt != 0:
- d = gr.update(value=et)
- else:
- d = gr.update(value=0)
- tog = gr.update(value=0)
- #print (f'passing: to: {to} et: {et}')
- pass
- return d, tog
-
-def all_task_start():
- print("\n\n\n\n\n\n\n")
- t = time.gmtime()
- t_stamp = time.time()
- current_time = time.strftime("%H:%M:%S", t)
- return gr.update(value=t_stamp), gr.update(value=t_stamp), gr.update(value=0)
-
-def clear_fn():
- nn = len(models)
- return tuple([None, *[None for _ in range(nn)]])
-
-
-
-with gr.Blocks(title="SD Models") as my_interface:
- with gr.Column(scale=12):
- # with gr.Row():
- # gr.Markdown("""- Primary prompt: 你想画的内容(英文单词,如 a cat, 加英文逗号效果更好;点 Improve 按钮进行完善)\n- Real prompt: 完善后的提示词,出现后再点右边的 Run 按钮开始运行""")
- with gr.Row():
- with gr.Row(scale=6):
- primary_prompt=gr.Textbox(label="Prompt", value="")
- # real_prompt=gr.Textbox(label="Real prompt")
- with gr.Row(scale=6):
- # improve_prompts_btn=gr.Button("Improve")
- with gr.Row():
- run=gr.Button("Run",variant="primary")
- clear_btn=gr.Button("Clear")
- with gr.Row():
- sd_outputs = {}
- model_idx = 1
- for model_path in models:
- with gr.Column(scale=3, min_width=320):
- with gr.Box():
- sd_outputs[model_idx] = gr.Image(label=model_path)
- pass
- model_idx += 1
- pass
- pass
-
- with gr.Row(visible=False):
- start_box=gr.Number(interactive=False)
- end_box=gr.Number(interactive=False)
- tog_box=gr.Textbox(value=0,interactive=False)
-
- start_box.change(
- all_task_end,
- [start_box, end_box],
- [start_box, tog_box],
- every=1,
- show_progress=False)
-
- primary_prompt.submit(all_task_start, None, [start_box, end_box, tog_box])
- run.click(all_task_start, None, [start_box, end_box, tog_box])
- runs_dict = {}
- model_idx = 1
- for model_path in models:
- runs_dict[model_idx] = run.click(model_functions[model_idx], inputs=[primary_prompt], outputs=[sd_outputs[model_idx]])
- model_idx += 1
- pass
- pass
-
- # improve_prompts_btn_clicked=improve_prompts_btn.click(
- # get_prompts,
- # inputs=[primary_prompt],
- # outputs=[primary_prompt],
- # cancels=list(runs_dict.values()))
- clear_btn.click(
- clear_fn,
- None,
- [primary_prompt, *list(sd_outputs.values())],
- cancels=[*list(runs_dict.values())])
- tog_box.change(
- clear_it,
- tog_box,
- tog_box,
- cancels=[*list(runs_dict.values())])
-
-my_interface.queue(concurrency_count=600, status_update_rate=1)
-my_interface.launch(inline=True, show_api=False)
-
\ No newline at end of file
diff --git a/spaces/alsrbdni/magic-to-diffusion/README.md b/spaces/alsrbdni/magic-to-diffusion/README.md
deleted file mode 100644
index 18fae13e602dafc9509de23e20d0f7a7d7272cb6..0000000000000000000000000000000000000000
--- a/spaces/alsrbdni/magic-to-diffusion/README.md
+++ /dev/null
@@ -1,14 +0,0 @@
----
-title: Magic Prompt
-emoji: 🎆
-colorFrom: red
-colorTo: gray
-sdk: gradio
-sdk_version: 3.12.0
-app_file: app.py
-pinned: false
-license: apache-2.0
-duplicated_from: huggingface-projects/magic-diffusion
----
-
-Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
diff --git a/spaces/amarchheda/ChordDuplicate/portaudio/test/pa_minlat.c b/spaces/amarchheda/ChordDuplicate/portaudio/test/pa_minlat.c
deleted file mode 100644
index 683b2bbbea51301dd970809287343f2277c63da6..0000000000000000000000000000000000000000
--- a/spaces/amarchheda/ChordDuplicate/portaudio/test/pa_minlat.c
+++ /dev/null
@@ -1,205 +0,0 @@
-/** @file pa_minlat.c
- @ingroup test_src
- @brief Experiment with different numbers of buffers to determine the
- minimum latency for a computer.
- @author Phil Burk http://www.softsynth.com
-*/
-/*
- * $Id$
- *
- * This program uses the PortAudio Portable Audio Library.
- * For more information see: http://www.portaudio.com
- * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files
- * (the "Software"), to deal in the Software without restriction,
- * including without limitation the rights to use, copy, modify, merge,
- * publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * The text above constitutes the entire PortAudio license; however,
- * the PortAudio community also makes the following non-binding requests:
- *
- * Any person wishing to distribute modifications to the Software is
- * requested to send the modifications to the original developer so that
- * they can be incorporated into the canonical version. It is also
- * requested that these non-binding requests be included along with the
- * license above.
- */
-
-#include
-#include
-#include
-#include
-#include "portaudio.h"
-
-#ifndef M_PI
-#define M_PI (3.14159265)
-#endif
-#define TWOPI (M_PI * 2.0)
-
-#define DEFAULT_BUFFER_SIZE (32)
-
-typedef struct
-{
- double left_phase;
- double right_phase;
-}
-paTestData;
-
-/* Very simple synthesis routine to generate two sine waves. */
-static int paminlatCallback( const void *inputBuffer, void *outputBuffer,
- unsigned long framesPerBuffer,
- const PaStreamCallbackTimeInfo* timeInfo,
- PaStreamCallbackFlags statusFlags,
- void *userData )
-{
- paTestData *data = (paTestData*)userData;
- float *out = (float*)outputBuffer;
- unsigned int i;
- double left_phaseInc = 0.02;
- double right_phaseInc = 0.06;
-
- double left_phase = data->left_phase;
- double right_phase = data->right_phase;
-
- for( i=0; i TWOPI ) left_phase -= TWOPI;
- *out++ = (float) sin( left_phase );
-
- right_phase += right_phaseInc;
- if( right_phase > TWOPI ) right_phase -= TWOPI;
- *out++ = (float) sin( right_phase );
- }
-
- data->left_phase = left_phase;
- data->right_phase = right_phase;
- return 0;
-}
-
-int main( int argc, char **argv );
-int main( int argc, char **argv )
-{
- PaStreamParameters outputParameters;
- PaStream *stream;
- PaError err;
- paTestData data;
- int go;
- int outLatency = 0;
- int minLatency = DEFAULT_BUFFER_SIZE * 2;
- int framesPerBuffer;
- double sampleRate = 44100.0;
- char str[256];
- char *line;
-
- printf("pa_minlat - Determine minimum latency for your computer.\n");
- printf(" usage: pa_minlat {userBufferSize}\n");
- printf(" for example: pa_minlat 64\n");
- printf("Adjust your stereo until you hear a smooth tone in each speaker.\n");
- printf("Then try to find the smallest number of frames that still sounds smooth.\n");
- printf("Note that the sound will stop momentarily when you change the number of buffers.\n");
-
- /* Get bufferSize from command line. */
- framesPerBuffer = ( argc > 1 ) ? atol( argv[1] ) : DEFAULT_BUFFER_SIZE;
- printf("Frames per buffer = %d\n", framesPerBuffer );
-
- data.left_phase = data.right_phase = 0.0;
-
- err = Pa_Initialize();
- if( err != paNoError ) goto error;
-
- outLatency = sampleRate * 200.0 / 1000.0; /* 200 msec. */
-
- /* Try different numBuffers in a loop. */
- go = 1;
- while( go )
- {
- outputParameters.device = Pa_GetDefaultOutputDevice(); /* Default output device. */
- outputParameters.channelCount = 2; /* Stereo output */
- outputParameters.sampleFormat = paFloat32; /* 32 bit floating point output. */
- outputParameters.suggestedLatency = (double)outLatency / sampleRate; /* In seconds. */
- outputParameters.hostApiSpecificStreamInfo = NULL;
-
- printf("Latency = %d frames = %6.1f msec.\n", outLatency, outputParameters.suggestedLatency * 1000.0 );
-
- err = Pa_OpenStream(
- &stream,
- NULL, /* no input */
- &outputParameters,
- sampleRate,
- framesPerBuffer,
- paClipOff, /* we won't output out of range samples so don't bother clipping them */
- paminlatCallback,
- &data );
- if( err != paNoError ) goto error;
- if( stream == NULL ) goto error;
-
- /* Start audio. */
- err = Pa_StartStream( stream );
- if( err != paNoError ) goto error;
-
- /* Ask user for a new nlatency. */
- printf("\nMove windows around to see if the sound glitches.\n");
- printf("Latency now %d, enter new number of frames, or 'q' to quit: ", outLatency );
- line = fgets( str, 256, stdin );
- if( line == NULL )
- {
- go = 0;
- }
- else
- {
- {
- /* Get rid of newline */
- size_t l = strlen( str ) - 1;
- if( str[ l ] == '\n')
- str[ l ] = '\0';
- }
-
-
- if( str[0] == 'q' ) go = 0;
- else
- {
- outLatency = atol( str );
- if( outLatency < minLatency )
- {
- printf( "Latency below minimum of %d! Set to minimum!!!\n", minLatency );
- outLatency = minLatency;
- }
- }
-
- }
- /* Stop sound until ENTER hit. */
- err = Pa_StopStream( stream );
- if( err != paNoError ) goto error;
- err = Pa_CloseStream( stream );
- if( err != paNoError ) goto error;
- }
- printf("A good setting for latency would be somewhat higher than\n");
- printf("the minimum latency that worked.\n");
- printf("PortAudio: Test finished.\n");
- Pa_Terminate();
- return 0;
-error:
- Pa_Terminate();
- fprintf( stderr, "An error occurred while using the portaudio stream\n" );
- fprintf( stderr, "Error number: %d\n", err );
- fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
- return 1;
-}
diff --git a/spaces/amgross01/Stocks_Trading_Assistant/stocks.py b/spaces/amgross01/Stocks_Trading_Assistant/stocks.py
deleted file mode 100644
index ce96f77e43cc0b0ea2b3579c565ffb3170180214..0000000000000000000000000000000000000000
--- a/spaces/amgross01/Stocks_Trading_Assistant/stocks.py
+++ /dev/null
@@ -1,126 +0,0 @@
-from configparser import ParsingError
-from logging import raiseExceptions
-import yfinance as yf
-import requests
-import pandas as pd
-from bs4 import BeautifulSoup
-
-class Stock_Data(object):
- '''
- This class contains 5 methods responsible for choosing a stock's ticker, then checking whether the
- stock exchange it is listed in is open or not, and in case it is, it gets data for the last 6 months
- from "yfinance" module of Yahoo Inc. which will be fed to the models.
- '''
-
- def Ticker(self, tick):
- '''
- This method will "carry" the company's ticker, and it will also be used as a placeholder.
- '''
- global ticker
- ticker = tick
-
- return ticker
-
-
- def status_getter(self, Ticker):
- '''
- This method gets the company ticker the user chooses, creates a www.marketwatch.com
- link, then scraps the HTML code of the corresponding company page in marketwatch website,
- and gets the current market status of the exchange this stock is listed in. Possible values are:
- After Hours, Open, and Market Closed.
- '''
- global company_ticker
- company_ticker = Ticker
- link_1 = 'https://www.marketwatch.com/investing/stock/'
- link_2 = '?mod=search_symbol'
- # Pasting the above 3 parts to create the URL
- global final_link
- final_link = link_1 + company_ticker + link_2
-
- page = requests.get(final_link)
- global soup
- soup = BeautifulSoup(page.text, "lxml")
- if soup is None:
- raise ParsingError("HTML code of MarketWatch website was not scraped and current status can not be found")
- else:
- current_status = soup.find("div", class_="status").text # Finding the market status
- return current_status
-
-
- def current_price_getter(self, Ticker):
- '''
- This method will get the current price only if the market is open.
- '''
- current_price = None
- if self.status_getter(Ticker) == "Open":
- current_price = float(soup.find("bg-quote", class_="value").text.replace(',',''))
- return current_price
- else:
- return "Market Closed"
-
- def stock_data_getter(self, Ticker):
- '''
- This method will return a dataframe containing Stock data from the Yahoo's "yfinance"
- library in case the market is open.
- '''
- if self.status_getter(Ticker) == "Open":
- data = yf.download(tickers = str(Ticker), period = "6mo", interval = "1d")
- df = pd.DataFrame(data)
- return df
- else:
- return "Market Closed"
-
- def LSTM_stock_data_getter(self, Ticker):
- '''
- This method will return a dataframe containing Stock data from the Yahoo's "yfinance"
- library regardrless of whether the market is open or not, and will feed the LSTM model.
- '''
- data = yf.download(tickers = str(Ticker), period = "2y", interval = "1d")
- df = pd.DataFrame(data)
-
- # Prediction in the data we evaluate the model
- # If the user wants to run the model with the data that has been evaluated and predicted for , uncomment the 2 lines below
- # Setting the start = 2022-08-26 and end = 2020-08-26 Yahoo Finance will return data from 25-8-2020 to 25-8-2022 (2 years period).
- # In those data our model has been evaluated.
-
- #data = yf.download(tickers = str(Ticker),end="2022-08-26", start="2020-08-26")
- #df = pd.DataFrame(data)
-
- return df
-
-
- def article_parser(self, ticker):
- '''
- This method gets as input a stock ticker, creates the www.marketwatch.com link of this stock
- and returns a dataframe with the last 17 articles' headers.
- '''
- company_ticker = self.Ticker(tick=ticker)
- link_1 = 'https://www.marketwatch.com/investing/stock/'
- link_2 = '?mod=search_symbol'
- # Pasting the above 3 parts to create the URL
- final_link = link_1 + company_ticker + link_2
-
-
- page = requests.get(final_link)
- soup = BeautifulSoup(page.content, "html.parser")
- results = soup.find("div", class_="tab__pane is-active j-tabPane")
- articles = results.find_all("a", class_="link")
-
- headerList = ["ticker", "headline"]
- rows = []
- counter = 1
- df_headers = pd.DataFrame()
-
- for art in articles:
- if counter <= 17:
- ticker = company_ticker
- title = art.text.strip()
- if title is None:
- break
- rows.append([ticker, title])
- counter = counter + 1
-
- df_headers = pd.DataFrame(rows, columns=headerList)
-
- return df_headers
-
diff --git a/spaces/anaclaudia13ct/insect_detection/utils/autobatch.py b/spaces/anaclaudia13ct/insect_detection/utils/autobatch.py
deleted file mode 100644
index bdeb91c3d2bd15e53eb65715228932d3e87e0989..0000000000000000000000000000000000000000
--- a/spaces/anaclaudia13ct/insect_detection/utils/autobatch.py
+++ /dev/null
@@ -1,72 +0,0 @@
-# YOLOv5 🚀 by Ultralytics, GPL-3.0 license
-"""
-Auto-batch utils
-"""
-
-from copy import deepcopy
-
-import numpy as np
-import torch
-
-from utils.general import LOGGER, colorstr
-from utils.torch_utils import profile
-
-
-def check_train_batch_size(model, imgsz=640, amp=True):
- # Check YOLOv5 training batch size
- with torch.cuda.amp.autocast(amp):
- return autobatch(deepcopy(model).train(), imgsz) # compute optimal batch size
-
-
-def autobatch(model, imgsz=640, fraction=0.8, batch_size=16):
- # Automatically estimate best YOLOv5 batch size to use `fraction` of available CUDA memory
- # Usage:
- # import torch
- # from utils.autobatch import autobatch
- # model = torch.hub.load('ultralytics/yolov5', 'yolov5s', autoshape=False)
- # print(autobatch(model))
-
- # Check device
- prefix = colorstr('AutoBatch: ')
- LOGGER.info(f'{prefix}Computing optimal batch size for --imgsz {imgsz}')
- device = next(model.parameters()).device # get model device
- if device.type == 'cpu':
- LOGGER.info(f'{prefix}CUDA not detected, using default CPU batch-size {batch_size}')
- return batch_size
- if torch.backends.cudnn.benchmark:
- LOGGER.info(f'{prefix} ⚠️ Requires torch.backends.cudnn.benchmark=False, using default batch-size {batch_size}')
- return batch_size
-
- # Inspect CUDA memory
- gb = 1 << 30 # bytes to GiB (1024 ** 3)
- d = str(device).upper() # 'CUDA:0'
- properties = torch.cuda.get_device_properties(device) # device properties
- t = properties.total_memory / gb # GiB total
- r = torch.cuda.memory_reserved(device) / gb # GiB reserved
- a = torch.cuda.memory_allocated(device) / gb # GiB allocated
- f = t - (r + a) # GiB free
- LOGGER.info(f'{prefix}{d} ({properties.name}) {t:.2f}G total, {r:.2f}G reserved, {a:.2f}G allocated, {f:.2f}G free')
-
- # Profile batch sizes
- batch_sizes = [1, 2, 4, 8, 16]
- try:
- img = [torch.empty(b, 3, imgsz, imgsz) for b in batch_sizes]
- results = profile(img, model, n=3, device=device)
- except Exception as e:
- LOGGER.warning(f'{prefix}{e}')
-
- # Fit a solution
- y = [x[2] for x in results if x] # memory [2]
- p = np.polyfit(batch_sizes[:len(y)], y, deg=1) # first degree polynomial fit
- b = int((f * fraction - p[1]) / p[0]) # y intercept (optimal batch size)
- if None in results: # some sizes failed
- i = results.index(None) # first fail index
- if b >= batch_sizes[i]: # y intercept above failure point
- b = batch_sizes[max(i - 1, 0)] # select prior safe point
- if b < 1 or b > 1024: # b outside of safe range
- b = batch_size
- LOGGER.warning(f'{prefix}WARNING ⚠️ CUDA anomaly detected, recommend restart environment and retry command.')
-
- fraction = (np.polyval(p, b) + r + a) / t # actual fraction predicted
- LOGGER.info(f'{prefix}Using batch-size {b} for {d} {t * fraction:.2f}G/{t:.2f}G ({fraction * 100:.0f}%) ✅')
- return b
diff --git a/spaces/andreped/AeroPath/demo/src/utils.py b/spaces/andreped/AeroPath/demo/src/utils.py
deleted file mode 100644
index 4a7f9f9e012e1cb52c20564912df91306455a9ca..0000000000000000000000000000000000000000
--- a/spaces/andreped/AeroPath/demo/src/utils.py
+++ /dev/null
@@ -1,38 +0,0 @@
-import nibabel as nib
-import numpy as np
-
-
-def load_ct_to_numpy(data_path):
- if not isinstance(data_path, str):
- data_path = data_path.name
-
- image = nib.load(data_path)
- data = image.get_fdata()
-
- data = np.rot90(data, k=1, axes=(0, 1))
-
- data[data < -1024] = 1024
- data[data > 1024] = 1024
-
- data = data - np.amin(data)
- data = data / np.amax(data) * 255
- data = data.astype("uint8")
-
- print(data.shape)
- return [data[..., i] for i in range(data.shape[-1])]
-
-
-def load_pred_volume_to_numpy(data_path):
- if not isinstance(data_path, str):
- data_path = data_path.name
-
- image = nib.load(data_path)
- data = image.get_fdata()
-
- data = np.rot90(data, k=1, axes=(0, 1))
-
- data[data > 0] = 1
- data = data.astype("uint8")
-
- print(data.shape)
- return [data[..., i] for i in range(data.shape[-1])]
diff --git a/spaces/antinous/dreambooth-training/README.md b/spaces/antinous/dreambooth-training/README.md
deleted file mode 100644
index 66a852da46de13165bc3419e7e427c8ad76b97e0..0000000000000000000000000000000000000000
--- a/spaces/antinous/dreambooth-training/README.md
+++ /dev/null
@@ -1,14 +0,0 @@
----
-title: Dreambooth Training
-emoji: ☁️
-colorFrom: pink
-colorTo: red
-sdk: gradio
-sdk_version: 3.11
-app_file: app.py
-pinned: false
-license: mit
-duplicated_from: multimodalart/dreambooth-training
----
-
-Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
diff --git a/spaces/aodianyun/panoptic-segment-anything/segment_anything/segment_anything/modeling/transformer.py b/spaces/aodianyun/panoptic-segment-anything/segment_anything/segment_anything/modeling/transformer.py
deleted file mode 100644
index f1a2812f613cc55b1d0b3e3e1d0c84a760d1fb87..0000000000000000000000000000000000000000
--- a/spaces/aodianyun/panoptic-segment-anything/segment_anything/segment_anything/modeling/transformer.py
+++ /dev/null
@@ -1,240 +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.
-
-import torch
-from torch import Tensor, nn
-
-import math
-from typing import Tuple, Type
-
-from .common import MLPBlock
-
-
-class TwoWayTransformer(nn.Module):
- def __init__(
- self,
- depth: int,
- embedding_dim: int,
- num_heads: int,
- mlp_dim: int,
- activation: Type[nn.Module] = nn.ReLU,
- attention_downsample_rate: int = 2,
- ) -> None:
- """
- A transformer decoder that attends to an input image using
- queries whose positional embedding is supplied.
-
- Args:
- depth (int): number of layers in the transformer
- embedding_dim (int): the channel dimension for the input embeddings
- num_heads (int): the number of heads for multihead attention. Must
- divide embedding_dim
- mlp_dim (int): the channel dimension internal to the MLP block
- activation (nn.Module): the activation to use in the MLP block
- """
- super().__init__()
- self.depth = depth
- self.embedding_dim = embedding_dim
- self.num_heads = num_heads
- self.mlp_dim = mlp_dim
- self.layers = nn.ModuleList()
-
- for i in range(depth):
- self.layers.append(
- TwoWayAttentionBlock(
- embedding_dim=embedding_dim,
- num_heads=num_heads,
- mlp_dim=mlp_dim,
- activation=activation,
- attention_downsample_rate=attention_downsample_rate,
- skip_first_layer_pe=(i == 0),
- )
- )
-
- self.final_attn_token_to_image = Attention(
- embedding_dim, num_heads, downsample_rate=attention_downsample_rate
- )
- self.norm_final_attn = nn.LayerNorm(embedding_dim)
-
- def forward(
- self,
- image_embedding: Tensor,
- image_pe: Tensor,
- point_embedding: Tensor,
- ) -> Tuple[Tensor, Tensor]:
- """
- Args:
- image_embedding (torch.Tensor): image to attend to. Should be shape
- B x embedding_dim x h x w for any h and w.
- image_pe (torch.Tensor): the positional encoding to add to the image. Must
- have the same shape as image_embedding.
- point_embedding (torch.Tensor): the embedding to add to the query points.
- Must have shape B x N_points x embedding_dim for any N_points.
-
- Returns:
- torch.Tensor: the processed point_embedding
- torch.Tensor: the processed image_embedding
- """
- # BxCxHxW -> BxHWxC == B x N_image_tokens x C
- bs, c, h, w = image_embedding.shape
- image_embedding = image_embedding.flatten(2).permute(0, 2, 1)
- image_pe = image_pe.flatten(2).permute(0, 2, 1)
-
- # Prepare queries
- queries = point_embedding
- keys = image_embedding
-
- # Apply transformer blocks and final layernorm
- for layer in self.layers:
- queries, keys = layer(
- queries=queries,
- keys=keys,
- query_pe=point_embedding,
- key_pe=image_pe,
- )
-
- # Apply the final attenion layer from the points to the image
- q = queries + point_embedding
- k = keys + image_pe
- attn_out = self.final_attn_token_to_image(q=q, k=k, v=keys)
- queries = queries + attn_out
- queries = self.norm_final_attn(queries)
-
- return queries, keys
-
-
-class TwoWayAttentionBlock(nn.Module):
- def __init__(
- self,
- embedding_dim: int,
- num_heads: int,
- mlp_dim: int = 2048,
- activation: Type[nn.Module] = nn.ReLU,
- attention_downsample_rate: int = 2,
- skip_first_layer_pe: bool = False,
- ) -> None:
- """
- A transformer block with four layers: (1) self-attention of sparse
- inputs, (2) cross attention of sparse inputs to dense inputs, (3) mlp
- block on sparse inputs, and (4) cross attention of dense inputs to sparse
- inputs.
-
- Arguments:
- embedding_dim (int): the channel dimension of the embeddings
- num_heads (int): the number of heads in the attention layers
- mlp_dim (int): the hidden dimension of the mlp block
- activation (nn.Module): the activation of the mlp block
- skip_first_layer_pe (bool): skip the PE on the first layer
- """
- super().__init__()
- self.self_attn = Attention(embedding_dim, num_heads)
- self.norm1 = nn.LayerNorm(embedding_dim)
-
- self.cross_attn_token_to_image = Attention(
- embedding_dim, num_heads, downsample_rate=attention_downsample_rate
- )
- self.norm2 = nn.LayerNorm(embedding_dim)
-
- self.mlp = MLPBlock(embedding_dim, mlp_dim, activation)
- self.norm3 = nn.LayerNorm(embedding_dim)
-
- self.norm4 = nn.LayerNorm(embedding_dim)
- self.cross_attn_image_to_token = Attention(
- embedding_dim, num_heads, downsample_rate=attention_downsample_rate
- )
-
- self.skip_first_layer_pe = skip_first_layer_pe
-
- def forward(
- self, queries: Tensor, keys: Tensor, query_pe: Tensor, key_pe: Tensor
- ) -> Tuple[Tensor, Tensor]:
- # Self attention block
- if self.skip_first_layer_pe:
- queries = self.self_attn(q=queries, k=queries, v=queries)
- else:
- q = queries + query_pe
- attn_out = self.self_attn(q=q, k=q, v=queries)
- queries = queries + attn_out
- queries = self.norm1(queries)
-
- # Cross attention block, tokens attending to image embedding
- q = queries + query_pe
- k = keys + key_pe
- attn_out = self.cross_attn_token_to_image(q=q, k=k, v=keys)
- queries = queries + attn_out
- queries = self.norm2(queries)
-
- # MLP block
- mlp_out = self.mlp(queries)
- queries = queries + mlp_out
- queries = self.norm3(queries)
-
- # Cross attention block, image embedding attending to tokens
- q = queries + query_pe
- k = keys + key_pe
- attn_out = self.cross_attn_image_to_token(q=k, k=q, v=queries)
- keys = keys + attn_out
- keys = self.norm4(keys)
-
- return queries, keys
-
-
-class Attention(nn.Module):
- """
- An attention layer that allows for downscaling the size of the embedding
- after projection to queries, keys, and values.
- """
-
- def __init__(
- self,
- embedding_dim: int,
- num_heads: int,
- downsample_rate: int = 1,
- ) -> None:
- super().__init__()
- self.embedding_dim = embedding_dim
- self.internal_dim = embedding_dim // downsample_rate
- self.num_heads = num_heads
- assert self.internal_dim % num_heads == 0, "num_heads must divide embedding_dim."
-
- self.q_proj = nn.Linear(embedding_dim, self.internal_dim)
- self.k_proj = nn.Linear(embedding_dim, self.internal_dim)
- self.v_proj = nn.Linear(embedding_dim, self.internal_dim)
- self.out_proj = nn.Linear(self.internal_dim, embedding_dim)
-
- def _separate_heads(self, x: Tensor, num_heads: int) -> Tensor:
- b, n, c = x.shape
- x = x.reshape(b, n, num_heads, c // num_heads)
- return x.transpose(1, 2) # B x N_heads x N_tokens x C_per_head
-
- def _recombine_heads(self, x: Tensor) -> Tensor:
- b, n_heads, n_tokens, c_per_head = x.shape
- x = x.transpose(1, 2)
- return x.reshape(b, n_tokens, n_heads * c_per_head) # B x N_tokens x C
-
- def forward(self, q: Tensor, k: Tensor, v: Tensor) -> Tensor:
- # Input projections
- q = self.q_proj(q)
- k = self.k_proj(k)
- v = self.v_proj(v)
-
- # Separate into heads
- q = self._separate_heads(q, self.num_heads)
- k = self._separate_heads(k, self.num_heads)
- v = self._separate_heads(v, self.num_heads)
-
- # Attention
- _, _, _, c_per_head = q.shape
- attn = q @ k.permute(0, 1, 3, 2) # B x N_heads x N_tokens x N_tokens
- attn = attn / math.sqrt(c_per_head)
- attn = torch.softmax(attn, dim=-1)
-
- # Get output
- out = attn @ v
- out = self._recombine_heads(out)
- out = self.out_proj(out)
-
- return out
diff --git a/spaces/apsys/hetfit/utils/__init__.py b/spaces/apsys/hetfit/utils/__init__.py
deleted file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
diff --git a/spaces/arch-123/bingo/src/pages/api/blob.ts b/spaces/arch-123/bingo/src/pages/api/blob.ts
deleted file mode 100644
index fecd48031916b2284b8958892196e0a1ad420421..0000000000000000000000000000000000000000
--- a/spaces/arch-123/bingo/src/pages/api/blob.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-'use server'
-
-import { NextApiRequest, NextApiResponse } from 'next'
-import { Readable } from 'node:stream'
-import { fetch } from '@/lib/isomorphic'
-
-const API_DOMAIN = 'https://www.bing.com'
-
-export default async function handler(req: NextApiRequest, res: NextApiResponse) {
- try {
- const { bcid } = req.query
-
- const { headers, body } = await fetch(`${API_DOMAIN}/images/blob?bcid=${bcid}`,
- {
- method: 'GET',
- 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\"",
- "Referrer-Policy": "origin-when-cross-origin",
- },
- },
- )
-
- res.writeHead(200, {
- 'Content-Length': headers.get('content-length')!,
- 'Content-Type': headers.get('content-type')!,
- })
- // @ts-ignore
- return Readable.fromWeb(body!).pipe(res)
- } catch (e) {
- console.log('Error', e)
- return res.json({
- result: {
- value: 'UploadFailed',
- message: `${e}`
- }
- })
- }
-}
diff --git a/spaces/artblack01/Pix2Pix-Video/README.md b/spaces/artblack01/Pix2Pix-Video/README.md
deleted file mode 100644
index 3d8f7d06e470e918dedf27b7a230a565996a1252..0000000000000000000000000000000000000000
--- a/spaces/artblack01/Pix2Pix-Video/README.md
+++ /dev/null
@@ -1,13 +0,0 @@
----
-title: Pix2Pix Video
-emoji: 🎨🎞️
-colorFrom: pink
-colorTo: purple
-sdk: gradio
-sdk_version: 3.18.0
-app_file: app.py
-pinned: false
-duplicated_from: fffiloni/Pix2Pix-Video
----
-
-Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
diff --git a/spaces/artificialguybr/video-dubbing/TTS/TTS/tts/utils/ssim.py b/spaces/artificialguybr/video-dubbing/TTS/TTS/tts/utils/ssim.py
deleted file mode 100644
index 4bc3befc5bd3fb154cd48b4458184a4d8f3dca78..0000000000000000000000000000000000000000
--- a/spaces/artificialguybr/video-dubbing/TTS/TTS/tts/utils/ssim.py
+++ /dev/null
@@ -1,383 +0,0 @@
-# Adopted from https://github.com/photosynthesis-team/piq
-
-from typing import List, Optional, Tuple, Union
-
-import torch
-import torch.nn.functional as F
-from torch.nn.modules.loss import _Loss
-
-
-def _reduce(x: torch.Tensor, reduction: str = "mean") -> torch.Tensor:
- r"""Reduce input in batch dimension if needed.
- Args:
- x: Tensor with shape (N, *).
- reduction: Specifies the reduction type:
- ``'none'`` | ``'mean'`` | ``'sum'``. Default: ``'mean'``
- """
- if reduction == "none":
- return x
- if reduction == "mean":
- return x.mean(dim=0)
- if reduction == "sum":
- return x.sum(dim=0)
- raise ValueError("Unknown reduction. Expected one of {'none', 'mean', 'sum'}")
-
-
-def _validate_input(
- tensors: List[torch.Tensor],
- dim_range: Tuple[int, int] = (0, -1),
- data_range: Tuple[float, float] = (0.0, -1.0),
- # size_dim_range: Tuple[float, float] = (0., -1.),
- size_range: Optional[Tuple[int, int]] = None,
-) -> None:
- r"""Check that input(-s) satisfies the requirements
- Args:
- tensors: Tensors to check
- dim_range: Allowed number of dimensions. (min, max)
- data_range: Allowed range of values in tensors. (min, max)
- size_range: Dimensions to include in size comparison. (start_dim, end_dim + 1)
- """
-
- if not __debug__:
- return
-
- x = tensors[0]
-
- for t in tensors:
- assert torch.is_tensor(t), f"Expected torch.Tensor, got {type(t)}"
- assert t.device == x.device, f"Expected tensors to be on {x.device}, got {t.device}"
-
- if size_range is None:
- assert t.size() == x.size(), f"Expected tensors with same size, got {t.size()} and {x.size()}"
- else:
- assert (
- t.size()[size_range[0] : size_range[1]] == x.size()[size_range[0] : size_range[1]]
- ), f"Expected tensors with same size at given dimensions, got {t.size()} and {x.size()}"
-
- if dim_range[0] == dim_range[1]:
- assert t.dim() == dim_range[0], f"Expected number of dimensions to be {dim_range[0]}, got {t.dim()}"
- elif dim_range[0] < dim_range[1]:
- assert (
- dim_range[0] <= t.dim() <= dim_range[1]
- ), f"Expected number of dimensions to be between {dim_range[0]} and {dim_range[1]}, got {t.dim()}"
-
- if data_range[0] < data_range[1]:
- assert data_range[0] <= t.min(), f"Expected values to be greater or equal to {data_range[0]}, got {t.min()}"
- assert t.max() <= data_range[1], f"Expected values to be lower or equal to {data_range[1]}, got {t.max()}"
-
-
-def gaussian_filter(kernel_size: int, sigma: float) -> torch.Tensor:
- r"""Returns 2D Gaussian kernel N(0,`sigma`^2)
- Args:
- size: Size of the kernel
- sigma: Std of the distribution
- Returns:
- gaussian_kernel: Tensor with shape (1, kernel_size, kernel_size)
- """
- coords = torch.arange(kernel_size, dtype=torch.float32)
- coords -= (kernel_size - 1) / 2.0
-
- g = coords**2
- g = (-(g.unsqueeze(0) + g.unsqueeze(1)) / (2 * sigma**2)).exp()
-
- g /= g.sum()
- return g.unsqueeze(0)
-
-
-def ssim(
- x: torch.Tensor,
- y: torch.Tensor,
- kernel_size: int = 11,
- kernel_sigma: float = 1.5,
- data_range: Union[int, float] = 1.0,
- reduction: str = "mean",
- full: bool = False,
- downsample: bool = True,
- k1: float = 0.01,
- k2: float = 0.03,
-) -> List[torch.Tensor]:
- r"""Interface of Structural Similarity (SSIM) index.
- Inputs supposed to be in range ``[0, data_range]``.
- To match performance with skimage and tensorflow set ``'downsample' = True``.
-
- Args:
- x: An input tensor. Shape :math:`(N, C, H, W)` or :math:`(N, C, H, W, 2)`.
- y: A target tensor. Shape :math:`(N, C, H, W)` or :math:`(N, C, H, W, 2)`.
- kernel_size: The side-length of the sliding window used in comparison. Must be an odd value.
- kernel_sigma: Sigma of normal distribution.
- data_range: Maximum value range of images (usually 1.0 or 255).
- reduction: Specifies the reduction type:
- ``'none'`` | ``'mean'`` | ``'sum'``. Default:``'mean'``
- full: Return cs map or not.
- downsample: Perform average pool before SSIM computation. Default: True
- k1: Algorithm parameter, K1 (small constant).
- k2: Algorithm parameter, K2 (small constant).
- Try a larger K2 constant (e.g. 0.4) if you get a negative or NaN results.
-
- Returns:
- Value of Structural Similarity (SSIM) index. In case of 5D input tensors, complex value is returned
- as a tensor of size 2.
-
- References:
- Wang, Z., Bovik, A. C., Sheikh, H. R., & Simoncelli, E. P. (2004).
- Image quality assessment: From error visibility to structural similarity.
- IEEE Transactions on Image Processing, 13, 600-612.
- https://ece.uwaterloo.ca/~z70wang/publications/ssim.pdf,
- DOI: `10.1109/TIP.2003.819861`
- """
- assert kernel_size % 2 == 1, f"Kernel size must be odd, got [{kernel_size}]"
- _validate_input([x, y], dim_range=(4, 5), data_range=(0, data_range))
-
- x = x / float(data_range)
- y = y / float(data_range)
-
- # Averagepool image if the size is large enough
- f = max(1, round(min(x.size()[-2:]) / 256))
- if (f > 1) and downsample:
- x = F.avg_pool2d(x, kernel_size=f)
- y = F.avg_pool2d(y, kernel_size=f)
-
- kernel = gaussian_filter(kernel_size, kernel_sigma).repeat(x.size(1), 1, 1, 1).to(y)
- _compute_ssim_per_channel = _ssim_per_channel_complex if x.dim() == 5 else _ssim_per_channel
- ssim_map, cs_map = _compute_ssim_per_channel(x=x, y=y, kernel=kernel, k1=k1, k2=k2)
- ssim_val = ssim_map.mean(1)
- cs = cs_map.mean(1)
-
- ssim_val = _reduce(ssim_val, reduction)
- cs = _reduce(cs, reduction)
-
- if full:
- return [ssim_val, cs]
-
- return ssim_val
-
-
-class SSIMLoss(_Loss):
- r"""Creates a criterion that measures the structural similarity index error between
- each element in the input :math:`x` and target :math:`y`.
-
- To match performance with skimage and tensorflow set ``'downsample' = True``.
-
- The unreduced (i.e. with :attr:`reduction` set to ``'none'``) loss can be described as:
-
- .. math::
- SSIM = \{ssim_1,\dots,ssim_{N \times C}\}\\
- ssim_{l}(x, y) = \frac{(2 \mu_x \mu_y + c_1) (2 \sigma_{xy} + c_2)}
- {(\mu_x^2 +\mu_y^2 + c_1)(\sigma_x^2 +\sigma_y^2 + c_2)},
-
- where :math:`N` is the batch size, `C` is the channel size. If :attr:`reduction` is not ``'none'``
- (default ``'mean'``), then:
-
- .. math::
- SSIMLoss(x, y) =
- \begin{cases}
- \operatorname{mean}(1 - SSIM), & \text{if reduction} = \text{'mean';}\\
- \operatorname{sum}(1 - SSIM), & \text{if reduction} = \text{'sum'.}
- \end{cases}
-
- :math:`x` and :math:`y` are tensors of arbitrary shapes with a total
- of :math:`n` elements each.
-
- The sum operation still operates over all the elements, and divides by :math:`n`.
- The division by :math:`n` can be avoided if one sets ``reduction = 'sum'``.
- In case of 5D input tensors, complex value is returned as a tensor of size 2.
-
- Args:
- kernel_size: By default, the mean and covariance of a pixel is obtained
- by convolution with given filter_size.
- kernel_sigma: Standard deviation for Gaussian kernel.
- k1: Coefficient related to c1 in the above equation.
- k2: Coefficient related to c2 in the above equation.
- downsample: Perform average pool before SSIM computation. Default: True
- reduction: Specifies the reduction type:
- ``'none'`` | ``'mean'`` | ``'sum'``. Default:``'mean'``
- data_range: Maximum value range of images (usually 1.0 or 255).
-
- Examples:
- >>> loss = SSIMLoss()
- >>> x = torch.rand(3, 3, 256, 256, requires_grad=True)
- >>> y = torch.rand(3, 3, 256, 256)
- >>> output = loss(x, y)
- >>> output.backward()
-
- References:
- Wang, Z., Bovik, A. C., Sheikh, H. R., & Simoncelli, E. P. (2004).
- Image quality assessment: From error visibility to structural similarity.
- IEEE Transactions on Image Processing, 13, 600-612.
- https://ece.uwaterloo.ca/~z70wang/publications/ssim.pdf,
- DOI:`10.1109/TIP.2003.819861`
- """
- __constants__ = ["kernel_size", "k1", "k2", "sigma", "kernel", "reduction"]
-
- def __init__(
- self,
- kernel_size: int = 11,
- kernel_sigma: float = 1.5,
- k1: float = 0.01,
- k2: float = 0.03,
- downsample: bool = True,
- reduction: str = "mean",
- data_range: Union[int, float] = 1.0,
- ) -> None:
- super().__init__()
-
- # Generic loss parameters.
- self.reduction = reduction
-
- # Loss-specific parameters.
- self.kernel_size = kernel_size
-
- # This check might look redundant because kernel size is checked within the ssim function anyway.
- # However, this check allows to fail fast when the loss is being initialised and training has not been started.
- assert kernel_size % 2 == 1, f"Kernel size must be odd, got [{kernel_size}]"
- self.kernel_sigma = kernel_sigma
- self.k1 = k1
- self.k2 = k2
- self.downsample = downsample
- self.data_range = data_range
-
- def forward(self, x: torch.Tensor, y: torch.Tensor) -> torch.Tensor:
- r"""Computation of Structural Similarity (SSIM) index as a loss function.
-
- Args:
- x: An input tensor. Shape :math:`(N, C, H, W)` or :math:`(N, C, H, W, 2)`.
- y: A target tensor. Shape :math:`(N, C, H, W)` or :math:`(N, C, H, W, 2)`.
-
- Returns:
- Value of SSIM loss to be minimized, i.e ``1 - ssim`` in [0, 1] range. In case of 5D input tensors,
- complex value is returned as a tensor of size 2.
- """
-
- score = ssim(
- x=x,
- y=y,
- kernel_size=self.kernel_size,
- kernel_sigma=self.kernel_sigma,
- downsample=self.downsample,
- data_range=self.data_range,
- reduction=self.reduction,
- full=False,
- k1=self.k1,
- k2=self.k2,
- )
- return torch.ones_like(score) - score
-
-
-def _ssim_per_channel(
- x: torch.Tensor,
- y: torch.Tensor,
- kernel: torch.Tensor,
- k1: float = 0.01,
- k2: float = 0.03,
-) -> Union[torch.Tensor, Tuple[torch.Tensor, torch.Tensor]]:
- r"""Calculate Structural Similarity (SSIM) index for X and Y per channel.
-
- Args:
- x: An input tensor. Shape :math:`(N, C, H, W)`.
- y: A target tensor. Shape :math:`(N, C, H, W)`.
- kernel: 2D Gaussian kernel.
- k1: Algorithm parameter, K1 (small constant, see [1]).
- k2: Algorithm parameter, K2 (small constant, see [1]).
- Try a larger K2 constant (e.g. 0.4) if you get a negative or NaN results.
-
- Returns:
- Full Value of Structural Similarity (SSIM) index.
- """
- if x.size(-1) < kernel.size(-1) or x.size(-2) < kernel.size(-2):
- raise ValueError(
- f"Kernel size can't be greater than actual input size. Input size: {x.size()}. "
- f"Kernel size: {kernel.size()}"
- )
-
- c1 = k1**2
- c2 = k2**2
- n_channels = x.size(1)
- mu_x = F.conv2d(x, weight=kernel, stride=1, padding=0, groups=n_channels)
- mu_y = F.conv2d(y, weight=kernel, stride=1, padding=0, groups=n_channels)
-
- mu_xx = mu_x**2
- mu_yy = mu_y**2
- mu_xy = mu_x * mu_y
-
- sigma_xx = F.conv2d(x**2, weight=kernel, stride=1, padding=0, groups=n_channels) - mu_xx
- sigma_yy = F.conv2d(y**2, weight=kernel, stride=1, padding=0, groups=n_channels) - mu_yy
- sigma_xy = F.conv2d(x * y, weight=kernel, stride=1, padding=0, groups=n_channels) - mu_xy
-
- # Contrast sensitivity (CS) with alpha = beta = gamma = 1.
- cs = (2.0 * sigma_xy + c2) / (sigma_xx + sigma_yy + c2)
-
- # Structural similarity (SSIM)
- ss = (2.0 * mu_xy + c1) / (mu_xx + mu_yy + c1) * cs
-
- ssim_val = ss.mean(dim=(-1, -2))
- cs = cs.mean(dim=(-1, -2))
- return ssim_val, cs
-
-
-def _ssim_per_channel_complex(
- x: torch.Tensor,
- y: torch.Tensor,
- kernel: torch.Tensor,
- k1: float = 0.01,
- k2: float = 0.03,
-) -> Union[torch.Tensor, Tuple[torch.Tensor, torch.Tensor]]:
- r"""Calculate Structural Similarity (SSIM) index for Complex X and Y per channel.
-
- Args:
- x: An input tensor. Shape :math:`(N, C, H, W, 2)`.
- y: A target tensor. Shape :math:`(N, C, H, W, 2)`.
- kernel: 2-D gauss kernel.
- k1: Algorithm parameter, K1 (small constant, see [1]).
- k2: Algorithm parameter, K2 (small constant, see [1]).
- Try a larger K2 constant (e.g. 0.4) if you get a negative or NaN results.
-
- Returns:
- Full Value of Complex Structural Similarity (SSIM) index.
- """
- n_channels = x.size(1)
- if x.size(-2) < kernel.size(-1) or x.size(-3) < kernel.size(-2):
- raise ValueError(
- f"Kernel size can't be greater than actual input size. Input size: {x.size()}. "
- f"Kernel size: {kernel.size()}"
- )
-
- c1 = k1**2
- c2 = k2**2
-
- x_real = x[..., 0]
- x_imag = x[..., 1]
- y_real = y[..., 0]
- y_imag = y[..., 1]
-
- mu1_real = F.conv2d(x_real, weight=kernel, stride=1, padding=0, groups=n_channels)
- mu1_imag = F.conv2d(x_imag, weight=kernel, stride=1, padding=0, groups=n_channels)
- mu2_real = F.conv2d(y_real, weight=kernel, stride=1, padding=0, groups=n_channels)
- mu2_imag = F.conv2d(y_imag, weight=kernel, stride=1, padding=0, groups=n_channels)
-
- mu1_sq = mu1_real.pow(2) + mu1_imag.pow(2)
- mu2_sq = mu2_real.pow(2) + mu2_imag.pow(2)
- mu1_mu2_real = mu1_real * mu2_real - mu1_imag * mu2_imag
- mu1_mu2_imag = mu1_real * mu2_imag + mu1_imag * mu2_real
-
- compensation = 1.0
-
- x_sq = x_real.pow(2) + x_imag.pow(2)
- y_sq = y_real.pow(2) + y_imag.pow(2)
- x_y_real = x_real * y_real - x_imag * y_imag
- x_y_imag = x_real * y_imag + x_imag * y_real
-
- sigma1_sq = F.conv2d(x_sq, weight=kernel, stride=1, padding=0, groups=n_channels) - mu1_sq
- sigma2_sq = F.conv2d(y_sq, weight=kernel, stride=1, padding=0, groups=n_channels) - mu2_sq
- sigma12_real = F.conv2d(x_y_real, weight=kernel, stride=1, padding=0, groups=n_channels) - mu1_mu2_real
- sigma12_imag = F.conv2d(x_y_imag, weight=kernel, stride=1, padding=0, groups=n_channels) - mu1_mu2_imag
- sigma12 = torch.stack((sigma12_imag, sigma12_real), dim=-1)
- mu1_mu2 = torch.stack((mu1_mu2_real, mu1_mu2_imag), dim=-1)
- # Set alpha = beta = gamma = 1.
- cs_map = (sigma12 * 2 + c2 * compensation) / (sigma1_sq.unsqueeze(-1) + sigma2_sq.unsqueeze(-1) + c2 * compensation)
- ssim_map = (mu1_mu2 * 2 + c1 * compensation) / (mu1_sq.unsqueeze(-1) + mu2_sq.unsqueeze(-1) + c1 * compensation)
- ssim_map = ssim_map * cs_map
-
- ssim_val = ssim_map.mean(dim=(-2, -3))
- cs = cs_map.mean(dim=(-2, -3))
-
- return ssim_val, cs
diff --git a/spaces/artificialguybr/video-dubbing/TTS/TTS/tts/utils/text/english/time_norm.py b/spaces/artificialguybr/video-dubbing/TTS/TTS/tts/utils/text/english/time_norm.py
deleted file mode 100644
index c8ac09e79db4a239a7f72f101503dbf0d6feb3ae..0000000000000000000000000000000000000000
--- a/spaces/artificialguybr/video-dubbing/TTS/TTS/tts/utils/text/english/time_norm.py
+++ /dev/null
@@ -1,47 +0,0 @@
-import re
-
-import inflect
-
-_inflect = inflect.engine()
-
-_time_re = re.compile(
- r"""\b
- ((0?[0-9])|(1[0-1])|(1[2-9])|(2[0-3])) # hours
- :
- ([0-5][0-9]) # minutes
- \s*(a\\.m\\.|am|pm|p\\.m\\.|a\\.m|p\\.m)? # am/pm
- \b""",
- re.IGNORECASE | re.X,
-)
-
-
-def _expand_num(n: int) -> str:
- return _inflect.number_to_words(n)
-
-
-def _expand_time_english(match: "re.Match") -> str:
- hour = int(match.group(1))
- past_noon = hour >= 12
- time = []
- if hour > 12:
- hour -= 12
- elif hour == 0:
- hour = 12
- past_noon = True
- time.append(_expand_num(hour))
-
- minute = int(match.group(6))
- if minute > 0:
- if minute < 10:
- time.append("oh")
- time.append(_expand_num(minute))
- am_pm = match.group(7)
- if am_pm is None:
- time.append("p m" if past_noon else "a m")
- else:
- time.extend(list(am_pm.replace(".", "")))
- return " ".join(time)
-
-
-def expand_time_english(text: str) -> str:
- return re.sub(_time_re, _expand_time_english, text)
diff --git a/spaces/artificialguybr/video-dubbing/TTS/tests/tts_tests/test_helpers.py b/spaces/artificialguybr/video-dubbing/TTS/tests/tts_tests/test_helpers.py
deleted file mode 100644
index 23bb440a0af77b443e847b1c80620887bef485bb..0000000000000000000000000000000000000000
--- a/spaces/artificialguybr/video-dubbing/TTS/tests/tts_tests/test_helpers.py
+++ /dev/null
@@ -1,88 +0,0 @@
-import torch as T
-
-from TTS.tts.utils.helpers import average_over_durations, generate_path, rand_segments, segment, sequence_mask
-
-
-def average_over_durations_test(): # pylint: disable=no-self-use
- pitch = T.rand(1, 1, 128)
-
- durations = T.randint(1, 5, (1, 21))
- coeff = 128.0 / durations.sum()
- durations = T.floor(durations * coeff)
- diff = 128.0 - durations.sum()
- durations[0, -1] += diff
- durations = durations.long()
-
- pitch_avg = average_over_durations(pitch, durations)
-
- index = 0
- for idx, dur in enumerate(durations[0]):
- assert abs(pitch_avg[0, 0, idx] - pitch[0, 0, index : index + dur.item()].mean()) < 1e-5
- index += dur
-
-
-def seqeunce_mask_test():
- lengths = T.randint(10, 15, (8,))
- mask = sequence_mask(lengths)
- for i in range(8):
- l = lengths[i].item()
- assert mask[i, :l].sum() == l
- assert mask[i, l:].sum() == 0
-
-
-def segment_test():
- x = T.range(0, 11)
- x = x.repeat(8, 1).unsqueeze(1)
- segment_ids = T.randint(0, 7, (8,))
-
- segments = segment(x, segment_ids, segment_size=4)
- for idx, start_indx in enumerate(segment_ids):
- assert x[idx, :, start_indx : start_indx + 4].sum() == segments[idx, :, :].sum()
-
- try:
- segments = segment(x, segment_ids, segment_size=10)
- raise Exception("Should have failed")
- except:
- pass
-
- segments = segment(x, segment_ids, segment_size=10, pad_short=True)
- for idx, start_indx in enumerate(segment_ids):
- assert x[idx, :, start_indx : start_indx + 10].sum() == segments[idx, :, :].sum()
-
-
-def rand_segments_test():
- x = T.rand(2, 3, 4)
- x_lens = T.randint(3, 4, (2,))
- segments, seg_idxs = rand_segments(x, x_lens, segment_size=3)
- assert segments.shape == (2, 3, 3)
- assert all(seg_idxs >= 0), seg_idxs
- try:
- segments, _ = rand_segments(x, x_lens, segment_size=5)
- raise Exception("Should have failed")
- except:
- pass
- x_lens_back = x_lens.clone()
- segments, seg_idxs = rand_segments(x, x_lens.clone(), segment_size=5, pad_short=True, let_short_samples=True)
- assert segments.shape == (2, 3, 5)
- assert all(seg_idxs >= 0), seg_idxs
- assert all(x_lens_back == x_lens)
-
-
-def generate_path_test():
- durations = T.randint(1, 4, (10, 21))
- x_length = T.randint(18, 22, (10,))
- x_mask = sequence_mask(x_length).unsqueeze(1).long()
- durations = durations * x_mask.squeeze(1)
- y_length = durations.sum(1)
- y_mask = sequence_mask(y_length).unsqueeze(1).long()
- attn_mask = (T.unsqueeze(x_mask, -1) * T.unsqueeze(y_mask, 2)).squeeze(1).long()
- print(attn_mask.shape)
- path = generate_path(durations, attn_mask)
- assert path.shape == (10, 21, durations.sum(1).max().item())
- for b in range(durations.shape[0]):
- current_idx = 0
- for t in range(durations.shape[1]):
- assert all(path[b, t, current_idx : current_idx + durations[b, t].item()] == 1.0)
- assert all(path[b, t, :current_idx] == 0.0)
- assert all(path[b, t, current_idx + durations[b, t].item() :] == 0.0)
- current_idx += durations[b, t].item()
diff --git a/spaces/arxify/RVC-beta-v2-0618/runtime/Lib/site-packages/aiohttp/http_exceptions.py b/spaces/arxify/RVC-beta-v2-0618/runtime/Lib/site-packages/aiohttp/http_exceptions.py
deleted file mode 100644
index c885f80f3220474d22e61a068558a5169e038906..0000000000000000000000000000000000000000
--- a/spaces/arxify/RVC-beta-v2-0618/runtime/Lib/site-packages/aiohttp/http_exceptions.py
+++ /dev/null
@@ -1,105 +0,0 @@
-"""Low-level http related exceptions."""
-
-
-from typing import Optional, Union
-
-from .typedefs import _CIMultiDict
-
-__all__ = ("HttpProcessingError",)
-
-
-class HttpProcessingError(Exception):
- """HTTP error.
-
- Shortcut for raising HTTP errors with custom code, message and headers.
-
- code: HTTP Error code.
- message: (optional) Error message.
- headers: (optional) Headers to be sent in response, a list of pairs
- """
-
- code = 0
- message = ""
- headers = None
-
- def __init__(
- self,
- *,
- code: Optional[int] = None,
- message: str = "",
- headers: Optional[_CIMultiDict] = None,
- ) -> None:
- if code is not None:
- self.code = code
- self.headers = headers
- self.message = message
-
- def __str__(self) -> str:
- return f"{self.code}, message={self.message!r}"
-
- def __repr__(self) -> str:
- return f"<{self.__class__.__name__}: {self}>"
-
-
-class BadHttpMessage(HttpProcessingError):
-
- code = 400
- message = "Bad Request"
-
- def __init__(self, message: str, *, headers: Optional[_CIMultiDict] = None) -> None:
- super().__init__(message=message, headers=headers)
- self.args = (message,)
-
-
-class HttpBadRequest(BadHttpMessage):
-
- code = 400
- message = "Bad Request"
-
-
-class PayloadEncodingError(BadHttpMessage):
- """Base class for payload errors"""
-
-
-class ContentEncodingError(PayloadEncodingError):
- """Content encoding error."""
-
-
-class TransferEncodingError(PayloadEncodingError):
- """transfer encoding error."""
-
-
-class ContentLengthError(PayloadEncodingError):
- """Not enough data for satisfy content length header."""
-
-
-class LineTooLong(BadHttpMessage):
- def __init__(
- self, line: str, limit: str = "Unknown", actual_size: str = "Unknown"
- ) -> None:
- super().__init__(
- f"Got more than {limit} bytes ({actual_size}) when reading {line}."
- )
- self.args = (line, limit, actual_size)
-
-
-class InvalidHeader(BadHttpMessage):
- def __init__(self, hdr: Union[bytes, str]) -> None:
- if isinstance(hdr, bytes):
- hdr = hdr.decode("utf-8", "surrogateescape")
- super().__init__(f"Invalid HTTP Header: {hdr}")
- self.hdr = hdr
- self.args = (hdr,)
-
-
-class BadStatusLine(BadHttpMessage):
- def __init__(self, line: str = "") -> None:
- if not isinstance(line, str):
- line = repr(line)
- super().__init__(f"Bad status line {line!r}")
- self.args = (line,)
- self.line = line
-
-
-class InvalidURLError(BadHttpMessage):
- pass
diff --git a/spaces/arxify/RVC-beta-v2-0618/runtime/Lib/site-packages/aiohttp/test_utils.py b/spaces/arxify/RVC-beta-v2-0618/runtime/Lib/site-packages/aiohttp/test_utils.py
deleted file mode 100644
index fcda2f3ddc045a381470012ba331c75299af4981..0000000000000000000000000000000000000000
--- a/spaces/arxify/RVC-beta-v2-0618/runtime/Lib/site-packages/aiohttp/test_utils.py
+++ /dev/null
@@ -1,706 +0,0 @@
-"""Utilities shared by tests."""
-
-import asyncio
-import contextlib
-import gc
-import inspect
-import ipaddress
-import os
-import socket
-import sys
-import warnings
-from abc import ABC, abstractmethod
-from types import TracebackType
-from typing import (
- TYPE_CHECKING,
- Any,
- Callable,
- Iterator,
- List,
- Optional,
- Type,
- Union,
- cast,
-)
-from unittest import mock
-
-from aiosignal import Signal
-from multidict import CIMultiDict, CIMultiDictProxy
-from yarl import URL
-
-import aiohttp
-from aiohttp.client import _RequestContextManager, _WSRequestContextManager
-
-from . import ClientSession, hdrs
-from .abc import AbstractCookieJar
-from .client_reqrep import ClientResponse
-from .client_ws import ClientWebSocketResponse
-from .helpers import PY_38, sentinel
-from .http import HttpVersion, RawRequestMessage
-from .web import (
- Application,
- AppRunner,
- BaseRunner,
- Request,
- Server,
- ServerRunner,
- SockSite,
- UrlMappingMatchInfo,
-)
-from .web_protocol import _RequestHandler
-
-if TYPE_CHECKING: # pragma: no cover
- from ssl import SSLContext
-else:
- SSLContext = None
-
-if PY_38:
- from unittest import IsolatedAsyncioTestCase as TestCase
-else:
- from asynctest import TestCase # type: ignore[no-redef]
-
-REUSE_ADDRESS = os.name == "posix" and sys.platform != "cygwin"
-
-
-def get_unused_port_socket(
- host: str, family: socket.AddressFamily = socket.AF_INET
-) -> socket.socket:
- return get_port_socket(host, 0, family)
-
-
-def get_port_socket(
- host: str, port: int, family: socket.AddressFamily
-) -> socket.socket:
- s = socket.socket(family, socket.SOCK_STREAM)
- if REUSE_ADDRESS:
- # Windows has different semantics for SO_REUSEADDR,
- # so don't set it. Ref:
- # https://docs.microsoft.com/en-us/windows/win32/winsock/using-so-reuseaddr-and-so-exclusiveaddruse
- s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
- s.bind((host, port))
- return s
-
-
-def unused_port() -> int:
- """Return a port that is unused on the current host."""
- with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
- s.bind(("127.0.0.1", 0))
- return cast(int, s.getsockname()[1])
-
-
-class BaseTestServer(ABC):
- __test__ = False
-
- def __init__(
- self,
- *,
- scheme: Union[str, object] = sentinel,
- loop: Optional[asyncio.AbstractEventLoop] = None,
- host: str = "127.0.0.1",
- port: Optional[int] = None,
- skip_url_asserts: bool = False,
- socket_factory: Callable[
- [str, int, socket.AddressFamily], socket.socket
- ] = get_port_socket,
- **kwargs: Any,
- ) -> None:
- self._loop = loop
- self.runner: Optional[BaseRunner] = None
- self._root: Optional[URL] = None
- self.host = host
- self.port = port
- self._closed = False
- self.scheme = scheme
- self.skip_url_asserts = skip_url_asserts
- self.socket_factory = socket_factory
-
- async def start_server(
- self, loop: Optional[asyncio.AbstractEventLoop] = None, **kwargs: Any
- ) -> None:
- if self.runner:
- return
- self._loop = loop
- self._ssl = kwargs.pop("ssl", None)
- self.runner = await self._make_runner(**kwargs)
- await self.runner.setup()
- if not self.port:
- self.port = 0
- try:
- version = ipaddress.ip_address(self.host).version
- except ValueError:
- version = 4
- family = socket.AF_INET6 if version == 6 else socket.AF_INET
- _sock = self.socket_factory(self.host, self.port, family)
- self.host, self.port = _sock.getsockname()[:2]
- site = SockSite(self.runner, sock=_sock, ssl_context=self._ssl)
- await site.start()
- server = site._server
- assert server is not None
- sockets = server.sockets
- assert sockets is not None
- self.port = sockets[0].getsockname()[1]
- if self.scheme is sentinel:
- if self._ssl:
- scheme = "https"
- else:
- scheme = "http"
- self.scheme = scheme
- self._root = URL(f"{self.scheme}://{self.host}:{self.port}")
-
- @abstractmethod # pragma: no cover
- async def _make_runner(self, **kwargs: Any) -> BaseRunner:
- pass
-
- def make_url(self, path: str) -> URL:
- assert self._root is not None
- url = URL(path)
- if not self.skip_url_asserts:
- assert not url.is_absolute()
- return self._root.join(url)
- else:
- return URL(str(self._root) + path)
-
- @property
- def started(self) -> bool:
- return self.runner is not None
-
- @property
- def closed(self) -> bool:
- return self._closed
-
- @property
- def handler(self) -> Server:
- # for backward compatibility
- # web.Server instance
- runner = self.runner
- assert runner is not None
- assert runner.server is not None
- return runner.server
-
- async def close(self) -> None:
- """Close all fixtures created by the test client.
-
- After that point, the TestClient is no longer usable.
-
- This is an idempotent function: running close multiple times
- will not have any additional effects.
-
- close is also run when the object is garbage collected, and on
- exit when used as a context manager.
-
- """
- if self.started and not self.closed:
- assert self.runner is not None
- await self.runner.cleanup()
- self._root = None
- self.port = None
- self._closed = True
-
- def __enter__(self) -> None:
- raise TypeError("Use async with instead")
-
- def __exit__(
- self,
- exc_type: Optional[Type[BaseException]],
- exc_value: Optional[BaseException],
- traceback: Optional[TracebackType],
- ) -> None:
- # __exit__ should exist in pair with __enter__ but never executed
- pass # pragma: no cover
-
- async def __aenter__(self) -> "BaseTestServer":
- await self.start_server(loop=self._loop)
- return self
-
- async def __aexit__(
- self,
- exc_type: Optional[Type[BaseException]],
- exc_value: Optional[BaseException],
- traceback: Optional[TracebackType],
- ) -> None:
- await self.close()
-
-
-class TestServer(BaseTestServer):
- def __init__(
- self,
- app: Application,
- *,
- scheme: Union[str, object] = sentinel,
- host: str = "127.0.0.1",
- port: Optional[int] = None,
- **kwargs: Any,
- ):
- self.app = app
- super().__init__(scheme=scheme, host=host, port=port, **kwargs)
-
- async def _make_runner(self, **kwargs: Any) -> BaseRunner:
- return AppRunner(self.app, **kwargs)
-
-
-class RawTestServer(BaseTestServer):
- def __init__(
- self,
- handler: _RequestHandler,
- *,
- scheme: Union[str, object] = sentinel,
- host: str = "127.0.0.1",
- port: Optional[int] = None,
- **kwargs: Any,
- ) -> None:
- self._handler = handler
- super().__init__(scheme=scheme, host=host, port=port, **kwargs)
-
- async def _make_runner(self, debug: bool = True, **kwargs: Any) -> ServerRunner:
- srv = Server(self._handler, loop=self._loop, debug=debug, **kwargs)
- return ServerRunner(srv, debug=debug, **kwargs)
-
-
-class TestClient:
- """
- A test client implementation.
-
- To write functional tests for aiohttp based servers.
-
- """
-
- __test__ = False
-
- def __init__(
- self,
- server: BaseTestServer,
- *,
- cookie_jar: Optional[AbstractCookieJar] = None,
- loop: Optional[asyncio.AbstractEventLoop] = None,
- **kwargs: Any,
- ) -> None:
- if not isinstance(server, BaseTestServer):
- raise TypeError(
- "server must be TestServer " "instance, found type: %r" % type(server)
- )
- self._server = server
- self._loop = loop
- if cookie_jar is None:
- cookie_jar = aiohttp.CookieJar(unsafe=True, loop=loop)
- self._session = ClientSession(loop=loop, cookie_jar=cookie_jar, **kwargs)
- self._closed = False
- self._responses: List[ClientResponse] = []
- self._websockets: List[ClientWebSocketResponse] = []
-
- async def start_server(self) -> None:
- await self._server.start_server(loop=self._loop)
-
- @property
- def host(self) -> str:
- return self._server.host
-
- @property
- def port(self) -> Optional[int]:
- return self._server.port
-
- @property
- def server(self) -> BaseTestServer:
- return self._server
-
- @property
- def app(self) -> Optional[Application]:
- return cast(Optional[Application], getattr(self._server, "app", None))
-
- @property
- def session(self) -> ClientSession:
- """An internal aiohttp.ClientSession.
-
- Unlike the methods on the TestClient, client session requests
- do not automatically include the host in the url queried, and
- will require an absolute path to the resource.
-
- """
- return self._session
-
- def make_url(self, path: str) -> URL:
- return self._server.make_url(path)
-
- async def _request(self, method: str, path: str, **kwargs: Any) -> ClientResponse:
- resp = await self._session.request(method, self.make_url(path), **kwargs)
- # save it to close later
- self._responses.append(resp)
- return resp
-
- def request(self, method: str, path: str, **kwargs: Any) -> _RequestContextManager:
- """Routes a request to tested http server.
-
- The interface is identical to aiohttp.ClientSession.request,
- except the loop kwarg is overridden by the instance used by the
- test server.
-
- """
- return _RequestContextManager(self._request(method, path, **kwargs))
-
- def get(self, path: str, **kwargs: Any) -> _RequestContextManager:
- """Perform an HTTP GET request."""
- return _RequestContextManager(self._request(hdrs.METH_GET, path, **kwargs))
-
- def post(self, path: str, **kwargs: Any) -> _RequestContextManager:
- """Perform an HTTP POST request."""
- return _RequestContextManager(self._request(hdrs.METH_POST, path, **kwargs))
-
- def options(self, path: str, **kwargs: Any) -> _RequestContextManager:
- """Perform an HTTP OPTIONS request."""
- return _RequestContextManager(self._request(hdrs.METH_OPTIONS, path, **kwargs))
-
- def head(self, path: str, **kwargs: Any) -> _RequestContextManager:
- """Perform an HTTP HEAD request."""
- return _RequestContextManager(self._request(hdrs.METH_HEAD, path, **kwargs))
-
- def put(self, path: str, **kwargs: Any) -> _RequestContextManager:
- """Perform an HTTP PUT request."""
- return _RequestContextManager(self._request(hdrs.METH_PUT, path, **kwargs))
-
- def patch(self, path: str, **kwargs: Any) -> _RequestContextManager:
- """Perform an HTTP PATCH request."""
- return _RequestContextManager(self._request(hdrs.METH_PATCH, path, **kwargs))
-
- def delete(self, path: str, **kwargs: Any) -> _RequestContextManager:
- """Perform an HTTP PATCH request."""
- return _RequestContextManager(self._request(hdrs.METH_DELETE, path, **kwargs))
-
- def ws_connect(self, path: str, **kwargs: Any) -> _WSRequestContextManager:
- """Initiate websocket connection.
-
- The api corresponds to aiohttp.ClientSession.ws_connect.
-
- """
- return _WSRequestContextManager(self._ws_connect(path, **kwargs))
-
- async def _ws_connect(self, path: str, **kwargs: Any) -> ClientWebSocketResponse:
- ws = await self._session.ws_connect(self.make_url(path), **kwargs)
- self._websockets.append(ws)
- return ws
-
- async def close(self) -> None:
- """Close all fixtures created by the test client.
-
- After that point, the TestClient is no longer usable.
-
- This is an idempotent function: running close multiple times
- will not have any additional effects.
-
- close is also run on exit when used as a(n) (asynchronous)
- context manager.
-
- """
- if not self._closed:
- for resp in self._responses:
- resp.close()
- for ws in self._websockets:
- await ws.close()
- await self._session.close()
- await self._server.close()
- self._closed = True
-
- def __enter__(self) -> None:
- raise TypeError("Use async with instead")
-
- def __exit__(
- self,
- exc_type: Optional[Type[BaseException]],
- exc: Optional[BaseException],
- tb: Optional[TracebackType],
- ) -> None:
- # __exit__ should exist in pair with __enter__ but never executed
- pass # pragma: no cover
-
- async def __aenter__(self) -> "TestClient":
- await self.start_server()
- return self
-
- async def __aexit__(
- self,
- exc_type: Optional[Type[BaseException]],
- exc: Optional[BaseException],
- tb: Optional[TracebackType],
- ) -> None:
- await self.close()
-
-
-class AioHTTPTestCase(TestCase):
- """A base class to allow for unittest web applications using aiohttp.
-
- Provides the following:
-
- * self.client (aiohttp.test_utils.TestClient): an aiohttp test client.
- * self.loop (asyncio.BaseEventLoop): the event loop in which the
- application and server are running.
- * self.app (aiohttp.web.Application): the application returned by
- self.get_application()
-
- Note that the TestClient's methods are asynchronous: you have to
- execute function on the test client using asynchronous methods.
- """
-
- async def get_application(self) -> Application:
- """Get application.
-
- This method should be overridden
- to return the aiohttp.web.Application
- object to test.
- """
- return self.get_app()
-
- def get_app(self) -> Application:
- """Obsolete method used to constructing web application.
-
- Use .get_application() coroutine instead.
- """
- raise RuntimeError("Did you forget to define get_application()?")
-
- def setUp(self) -> None:
- if not PY_38:
- asyncio.get_event_loop().run_until_complete(self.asyncSetUp())
-
- async def asyncSetUp(self) -> None:
- try:
- self.loop = asyncio.get_running_loop()
- except (AttributeError, RuntimeError): # AttributeError->py36
- self.loop = asyncio.get_event_loop_policy().get_event_loop()
-
- return await self.setUpAsync()
-
- async def setUpAsync(self) -> None:
- self.app = await self.get_application()
- self.server = await self.get_server(self.app)
- self.client = await self.get_client(self.server)
-
- await self.client.start_server()
-
- def tearDown(self) -> None:
- if not PY_38:
- self.loop.run_until_complete(self.asyncTearDown())
-
- async def asyncTearDown(self) -> None:
- return await self.tearDownAsync()
-
- async def tearDownAsync(self) -> None:
- await self.client.close()
-
- async def get_server(self, app: Application) -> TestServer:
- """Return a TestServer instance."""
- return TestServer(app, loop=self.loop)
-
- async def get_client(self, server: TestServer) -> TestClient:
- """Return a TestClient instance."""
- return TestClient(server, loop=self.loop)
-
-
-def unittest_run_loop(func: Any, *args: Any, **kwargs: Any) -> Any:
- """
- A decorator dedicated to use with asynchronous AioHTTPTestCase test methods.
-
- In 3.8+, this does nothing.
- """
- warnings.warn(
- "Decorator `@unittest_run_loop` is no longer needed in aiohttp 3.8+",
- DeprecationWarning,
- stacklevel=2,
- )
- return func
-
-
-_LOOP_FACTORY = Callable[[], asyncio.AbstractEventLoop]
-
-
-@contextlib.contextmanager
-def loop_context(
- loop_factory: _LOOP_FACTORY = asyncio.new_event_loop, fast: bool = False
-) -> Iterator[asyncio.AbstractEventLoop]:
- """A contextmanager that creates an event_loop, for test purposes.
-
- Handles the creation and cleanup of a test loop.
- """
- loop = setup_test_loop(loop_factory)
- yield loop
- teardown_test_loop(loop, fast=fast)
-
-
-def setup_test_loop(
- loop_factory: _LOOP_FACTORY = asyncio.new_event_loop,
-) -> asyncio.AbstractEventLoop:
- """Create and return an asyncio.BaseEventLoop instance.
-
- The caller should also call teardown_test_loop,
- once they are done with the loop.
- """
- loop = loop_factory()
- try:
- module = loop.__class__.__module__
- skip_watcher = "uvloop" in module
- except AttributeError: # pragma: no cover
- # Just in case
- skip_watcher = True
- asyncio.set_event_loop(loop)
- if sys.platform != "win32" and not skip_watcher:
- policy = asyncio.get_event_loop_policy()
- watcher: asyncio.AbstractChildWatcher
- try: # Python >= 3.8
- # Refs:
- # * https://github.com/pytest-dev/pytest-xdist/issues/620
- # * https://stackoverflow.com/a/58614689/595220
- # * https://bugs.python.org/issue35621
- # * https://github.com/python/cpython/pull/14344
- watcher = asyncio.ThreadedChildWatcher()
- except AttributeError: # Python < 3.8
- watcher = asyncio.SafeChildWatcher()
- watcher.attach_loop(loop)
- with contextlib.suppress(NotImplementedError):
- policy.set_child_watcher(watcher)
- return loop
-
-
-def teardown_test_loop(loop: asyncio.AbstractEventLoop, fast: bool = False) -> None:
- """Teardown and cleanup an event_loop created by setup_test_loop."""
- closed = loop.is_closed()
- if not closed:
- loop.call_soon(loop.stop)
- loop.run_forever()
- loop.close()
-
- if not fast:
- gc.collect()
-
- asyncio.set_event_loop(None)
-
-
-def _create_app_mock() -> mock.MagicMock:
- def get_dict(app: Any, key: str) -> Any:
- return app.__app_dict[key]
-
- def set_dict(app: Any, key: str, value: Any) -> None:
- app.__app_dict[key] = value
-
- app = mock.MagicMock(spec=Application)
- app.__app_dict = {}
- app.__getitem__ = get_dict
- app.__setitem__ = set_dict
-
- app._debug = False
- app.on_response_prepare = Signal(app)
- app.on_response_prepare.freeze()
- return app
-
-
-def _create_transport(sslcontext: Optional[SSLContext] = None) -> mock.Mock:
- transport = mock.Mock()
-
- def get_extra_info(key: str) -> Optional[SSLContext]:
- if key == "sslcontext":
- return sslcontext
- else:
- return None
-
- transport.get_extra_info.side_effect = get_extra_info
- return transport
-
-
-def make_mocked_request(
- method: str,
- path: str,
- headers: Any = None,
- *,
- match_info: Any = sentinel,
- version: HttpVersion = HttpVersion(1, 1),
- closing: bool = False,
- app: Any = None,
- writer: Any = sentinel,
- protocol: Any = sentinel,
- transport: Any = sentinel,
- payload: Any = sentinel,
- sslcontext: Optional[SSLContext] = None,
- client_max_size: int = 1024**2,
- loop: Any = ...,
-) -> Request:
- """Creates mocked web.Request testing purposes.
-
- Useful in unit tests, when spinning full web server is overkill or
- specific conditions and errors are hard to trigger.
- """
- task = mock.Mock()
- if loop is ...:
- loop = mock.Mock()
- loop.create_future.return_value = ()
-
- if version < HttpVersion(1, 1):
- closing = True
-
- if headers:
- headers = CIMultiDictProxy(CIMultiDict(headers))
- raw_hdrs = tuple(
- (k.encode("utf-8"), v.encode("utf-8")) for k, v in headers.items()
- )
- else:
- headers = CIMultiDictProxy(CIMultiDict())
- raw_hdrs = ()
-
- chunked = "chunked" in headers.get(hdrs.TRANSFER_ENCODING, "").lower()
-
- message = RawRequestMessage(
- method,
- path,
- version,
- headers,
- raw_hdrs,
- closing,
- None,
- False,
- chunked,
- URL(path),
- )
- if app is None:
- app = _create_app_mock()
-
- if transport is sentinel:
- transport = _create_transport(sslcontext)
-
- if protocol is sentinel:
- protocol = mock.Mock()
- protocol.transport = transport
-
- if writer is sentinel:
- writer = mock.Mock()
- writer.write_headers = make_mocked_coro(None)
- writer.write = make_mocked_coro(None)
- writer.write_eof = make_mocked_coro(None)
- writer.drain = make_mocked_coro(None)
- writer.transport = transport
-
- protocol.transport = transport
- protocol.writer = writer
-
- if payload is sentinel:
- payload = mock.Mock()
-
- req = Request(
- message, payload, protocol, writer, task, loop, client_max_size=client_max_size
- )
-
- match_info = UrlMappingMatchInfo(
- {} if match_info is sentinel else match_info, mock.Mock()
- )
- match_info.add_app(app)
- req._match_info = match_info
-
- return req
-
-
-def make_mocked_coro(
- return_value: Any = sentinel, raise_exception: Any = sentinel
-) -> Any:
- """Creates a coroutine mock."""
-
- async def mock_coro(*args: Any, **kwargs: Any) -> Any:
- if raise_exception is not sentinel:
- raise raise_exception
- if not inspect.isawaitable(return_value):
- return return_value
- await return_value
-
- return mock.Mock(wraps=mock_coro)
diff --git a/spaces/arxify/RVC-beta-v2-0618/runtime/Lib/site-packages/altair/examples/natural_disasters.py b/spaces/arxify/RVC-beta-v2-0618/runtime/Lib/site-packages/altair/examples/natural_disasters.py
deleted file mode 100644
index 339033db0a304941f919ef23db4819df30966fd4..0000000000000000000000000000000000000000
--- a/spaces/arxify/RVC-beta-v2-0618/runtime/Lib/site-packages/altair/examples/natural_disasters.py
+++ /dev/null
@@ -1,29 +0,0 @@
-"""
-Natural Disasters
------------------
-This example shows a visualization of global deaths from natural disasters.
-"""
-# category: case studies
-import altair as alt
-from vega_datasets import data
-
-source = data.disasters.url
-
-alt.Chart(source).mark_circle(
- opacity=0.8,
- stroke='black',
- strokeWidth=1
-).encode(
- alt.X('Year:O', axis=alt.Axis(labelAngle=0)),
- alt.Y('Entity:N'),
- alt.Size('Deaths:Q',
- scale=alt.Scale(range=[0, 4000]),
- legend=alt.Legend(title='Annual Global Deaths')
- ),
- alt.Color('Entity:N', legend=None)
-).properties(
- width=450,
- height=320
-).transform_filter(
- alt.datum.Entity != 'All natural disasters'
-)
diff --git a/spaces/arxify/RVC-beta-v2-0618/runtime/Lib/site-packages/fairseq/examples/MMPT/scripts/video_feature_extractor/videoreader.py b/spaces/arxify/RVC-beta-v2-0618/runtime/Lib/site-packages/fairseq/examples/MMPT/scripts/video_feature_extractor/videoreader.py
deleted file mode 100644
index 429e05f8bc8667408b8c2057578b1e8c0e98638c..0000000000000000000000000000000000000000
--- a/spaces/arxify/RVC-beta-v2-0618/runtime/Lib/site-packages/fairseq/examples/MMPT/scripts/video_feature_extractor/videoreader.py
+++ /dev/null
@@ -1,242 +0,0 @@
-# Copyright Howto100M authors.
-# Copyright (c) Facebook, Inc. All Rights Reserved
-
-import torch as th
-import pandas as pd
-import os
-import numpy as np
-import ffmpeg
-import random
-
-from torch.utils.data import Dataset
-
-
-class VideoLoader(Dataset):
- """modified from how2's video_feature_extractor."""
- def __init__(
- self,
- csv=None,
- video_dict=None,
- framerate=1,
- size=112,
- centercrop=False,
- hflip=False,
- **kwargs
- ):
- if csv is None and video_dict is None:
- raise ValueError("csv and video_dict cannot be both None.")
- if csv is not None:
- self.csv = pd.read_csv(csv)
- if video_dict is not None:
- self.csv = pd.DataFrame.from_dict(video_dict)
-
- self.centercrop = centercrop
- self.size = size
- self.framerate = framerate
- self.hflip = hflip
-
- def __len__(self):
- return len(self.csv)
-
- def _get_video_dim(self, video_path):
- probe = ffmpeg.probe(video_path)
- video_stream = next((stream for stream in probe['streams']
- if stream['codec_type'] == 'video'), None)
- width = int(video_stream['width'])
- height = int(video_stream['height'])
- return height, width
-
- def _get_video_info(self, video_path):
- probe = ffmpeg.probe(video_path)
- video_stream = next((stream for stream in probe['streams']
- if stream['codec_type'] == 'video'), None)
- return video_stream
-
- def _get_output_dim(self, h, w):
- if isinstance(self.size, tuple) and len(self.size) == 2:
- return self.size
- elif h >= w:
- return int(h * self.size / w), self.size
- else:
- return self.size, int(w * self.size / h)
-
- def __getitem__(self, idx):
- video_path = self.csv['video_path'].values[idx]
- output_file = self.csv['feature_path'].values[idx]
- return self._decode(output_file, video_path)
-
- def _decode(self, output_file, video_path):
- if not(os.path.isfile(output_file)) and os.path.isfile(video_path):
- try:
- h, w = self._get_video_dim(video_path)
- except Exception:
- print('ffprobe failed at: {}'.format(video_path))
- return {'video': th.zeros(1), 'input': video_path,
- 'output': output_file}
- try:
- os.makedirs(os.path.dirname(output_file), exist_ok=True)
- height, width = self._get_output_dim(h, w)
-
- cmd = (
- ffmpeg
- .input(video_path)
- .filter('fps', fps=self.framerate)
- .filter('scale', width, height)
- )
- if self.hflip:
- cmd = cmd.filter('hflip')
-
- if self.centercrop:
- x = int((width - self.size) / 2.0)
- y = int((height - self.size) / 2.0)
- cmd = cmd.crop(x, y, self.size, self.size)
- video = self._run(cmd, output_file)
- except Exception:
- video = th.zeros(1)
- else:
- video = th.zeros(1)
-
- return {'video': video, 'input': video_path, 'output': output_file}
-
- def _run(self, cmd, output_file):
- out, _ = (
- cmd.output('pipe:', format='rawvideo', pix_fmt='rgb24')
- .run(capture_stdout=True, quiet=True)
- )
- if self.centercrop and isinstance(self.size, int):
- height, width = self.size, self.size
- video = np.frombuffer(out, np.uint8).reshape([-1, height, width, 3])
- video = th.from_numpy(video.astype('float32'))
- return video.permute(0, 3, 1, 2)
-
-
-class VideoVerifier(VideoLoader):
- def __getitem__(self, idx):
- video_path = self.csv['video_path'].values[idx]
- try:
- return self._get_video_info(video_path)
- except Exception:
- # print('ffprobe failed at: {}'.format(video_path))
- return None
-
-
-class VideoCompressor(VideoLoader):
- def __init__(
- self,
- csv=None,
- video_dict=None,
- framerate=1,
- size=112,
- centercrop=False,
- hflip=False,
- crf=32,
- **kwargs
- ):
- super().__init__(
- csv,
- video_dict,
- framerate,
- size,
- centercrop,
- hflip
- )
- self.crf = crf
-
- def _run(self, cmd, output_file):
- out, _ = (
- cmd.output(filename=output_file, crf=self.crf)
- .run(quiet=True)
- )
- video = None
- return video
-
-
-class VideoDownloader(VideoCompressor):
- """download"""
- def __getitem__(self, idx):
- video_path = self.csv['video_path'].values[idx]
- output_file = self.csv['feature_path'].values[idx]
- if not(os.path.isfile(output_file)):
- os.makedirs(os.path.dirname(output_file), exist_ok=True)
- cmd = "wget -O" + output_file + " " + video_path
- # import subprocess
- # subprocess.check_output(
- # cmd,
- # stderr=subprocess.STDOUT, shell=True)
- os.system(cmd)
- return {'video': None, 'input': video_path, 'output': output_file}
-
-
-class AvKeyframeVideoCompressor(VideoLoader):
- """extract keyframes from a video and save it as jpg.
- TODO: consider to merge with `CodecProcessor`.
- """
- def __init__(
- self,
- csv=None,
- video_dict=None,
- framerate=1,
- size=112,
- centercrop=False,
- max_num_frames=5,
- **kwargs
- ):
- super().__init__(csv, video_dict, framerate, size, centercrop)
- self.max_num_frames = max_num_frames
-
- def _get_video_dim(self, video_fn):
- """decord cannot probe the size of a video, we use pyav instead."""
- import av
- with av.open(video_fn) as container:
- height = container.streams.video[0].codec_context.height
- width = container.streams.video[0].codec_context.width
- return height, width
-
- def _get_output_dim(self, height, width):
- """
- keep the shorter side be `self.size`, strech the other.
- """
- if height >= width:
- return int(height * self.size / width), self.size
- else:
- return self.size, int(width * self.size / height)
-
- def __getitem__(self, idx):
- import av
- video_path = self.csv['video_path'].values[idx]
- output_file = self.csv['feature_path'].values[idx]
- if not(os.path.isdir(output_file)) and os.path.isfile(video_path):
- try:
- h, w = self._get_video_dim(video_path)
- except Exception:
- print('probe failed at: {}'.format(video_path))
- return {'video': th.zeros(1), 'input': video_path,
- 'output': output_file}
-
- try:
- height, width = self._get_output_dim(h, w)
-
- # new for av.
- with av.open(video_path) as container:
- container.streams.video[0].thread_type = "AUTO"
- container.streams.video[0].codec_context.height = height
- container.streams.video[0].codec_context.width = width
- if self.framerate == 0: # keyframe.
- container.streams.video[0].codec_context.skip_frame = 'NONKEY'
- frames = []
- for frame in container.decode(video=0):
- frames.append(frame)
- frames = random.sample(frames, self.max_num_frames)
-
- os.makedirs(output_file, exist_ok=True)
- for frame in frames:
- frame.to_image().save(
- os.path.join(
- output_file,
- "%04d.jpg" % frame.index))
- except Exception:
- print('extract failed at: {}'.format(video_path))
- return {'video': th.zeros(1), 'input': video_path,
- 'output': output_file}
- video = th.zeros(1)
- return {'video': video, 'input': video_path, 'output': output_file}
diff --git a/spaces/asdasdasdasd/Face-forgery-detection/landmark_utils.py b/spaces/asdasdasdasd/Face-forgery-detection/landmark_utils.py
deleted file mode 100644
index 70468893e4e47e47dcd3e7223110637ff37a0d34..0000000000000000000000000000000000000000
--- a/spaces/asdasdasdasd/Face-forgery-detection/landmark_utils.py
+++ /dev/null
@@ -1,309 +0,0 @@
-from tqdm import tqdm
-import numpy as np
-import dlib
-from collections import OrderedDict
-import cv2
-
-detector = dlib.get_frontal_face_detector()
-predictor = dlib.shape_predictor("shape_predictor_68_face_landmarks.dat")
-FACIAL_LANDMARKS_68_IDXS = OrderedDict([
- ("mouth", (48, 68)),
- ("inner_mouth", (60, 68)),
- ("right_eyebrow", (17, 22)),
- ("left_eyebrow", (22, 27)),
- ("right_eye", (36, 42)),
- ("left_eye", (42, 48)),
- ("nose", (27, 36)),
- ("jaw", (0, 17))
-])
-
-
-def shape_to_face(shape, width, height, scale=1.2):
- """
- Recalculate the face bounding box based on coarse landmark location(shape)
- :param
- shape: landmark locations
- scale: the scale parameter of face, to enlarge the bounding box
- :return:
- face_new: new bounding box of face (1*4 list [x1, y1, x2, y2])
- # face_center: the center coordinate of face (1*2 list [x_c, y_c])
- face_size: the face is rectangular( width = height = size)(int)
- """
- x_min, y_min = np.min(shape, axis=0)
- x_max, y_max = np.max(shape, axis=0)
-
- x_center = (x_min + x_max) // 2
- y_center = (y_min + y_max) // 2
-
- face_size = int(max(x_max - x_min, y_max - y_min) * scale)
- # Enforce it to be even
- # Thus the real whole bounding box size will be an odd
- # But after cropping the face size will become even and
- # keep same to the face_size parameter.
- face_size = face_size // 2 * 2
-
- x1 = max(x_center - face_size // 2, 0)
- y1 = max(y_center - face_size // 2, 0)
-
- face_size = min(width - x1, face_size)
- face_size = min(height - y1, face_size)
-
- x2 = x1 + face_size
- y2 = y1 + face_size
-
- face_new = [int(x1), int(y1), int(x2), int(y2)]
- return face_new, face_size
-
-
-def predict_single_frame(frame):
- """
- :param frame: A full frame of video
- :return:
- face_num: the number of face (just to verify if successfully detect a face)
- shape: landmark locations
- """
- gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
- faces = detector(gray, 0)
- if len(faces) < 1:
- return 0, None
- face = faces[0]
-
- landmarks = predictor(frame, face)
- face_landmark_list = [(p.x, p.y) for p in landmarks.parts()]
- shape = np.array(face_landmark_list)
-
- return 1, shape
-
-
-def landmark_align(shape):
- desiredLeftEye = (0.35, 0.25)
- desiredFaceWidth = 2
- desiredFaceHeight = 2
- (lStart, lEnd) = FACIAL_LANDMARKS_68_IDXS["left_eye"]
- (rStart, rEnd) = FACIAL_LANDMARKS_68_IDXS["right_eye"]
-
- leftEyePts = shape[lStart:lEnd]
- rightEyePts = shape[rStart:rEnd]
-
- # compute the center of mass for each eye
- leftEyeCenter = leftEyePts.mean(axis=0) # .astype("int")
- rightEyeCenter = rightEyePts.mean(axis=0) # .astype("int")
- # compute the angle between the eye centroids
- dY = rightEyeCenter[1] - leftEyeCenter[1]
- dX = rightEyeCenter[0] - leftEyeCenter[0]
- angle = np.degrees(np.arctan2(dY, dX)) # - 180
-
- # compute the desired right eye x-coordinate based on the
- # desired x-coordinate of the left eye
- desiredRightEyeX = 1.0 - desiredLeftEye[0]
-
- # determine the scale of the new resulting image by taking
- # the ratio of the distance between eyes in the *current*
- # image to the ratio of distance between eyes in the
- # *desired* image
- dist = np.sqrt((dX ** 2) + (dY ** 2))
- desiredDist = (desiredRightEyeX - desiredLeftEye[0])
- desiredDist *= desiredFaceWidth
- scale = desiredDist / dist
-
- # compute center (x, y)-coordinates (i.e., the median point)
- # between the two eyes in the input image
- eyesCenter = ((leftEyeCenter[0] + rightEyeCenter[0]) // 2,
- (leftEyeCenter[1] + rightEyeCenter[1]) // 2)
-
- # grab the rotation matrix for rotating and scaling the face
- M = cv2.getRotationMatrix2D(eyesCenter, angle, scale)
-
- # update the translation component of the matrix
- tX = 0 # desiredFaceWidth * 0.5
- tY = desiredFaceHeight * desiredLeftEye[1]
- M[0, 2] += (tX - eyesCenter[0])
- M[1, 2] += (tY - eyesCenter[1])
-
- n, d = shape.shape
- temp = np.zeros((n, d + 1), dtype="int")
- temp[:, 0:2] = shape
- temp[:, 2] = 1
- aligned_landmarks = np.matmul(M, temp.T)
- return aligned_landmarks.T # .astype("int"))
-
-
-def check_and_merge(location, forward, feedback, P_predict, status_fw=None, status_fb=None):
- num_pts = 68
- check = [True] * num_pts
-
- target = location[1]
- forward_predict = forward[1]
-
- # To ensure the robustness through feedback-check
- forward_base = forward[0] # Also equal to location[0]
- feedback_predict = feedback[0]
- feedback_diff = feedback_predict - forward_base
- feedback_dist = np.linalg.norm(feedback_diff, axis=1, keepdims=True)
-
- # For Kalman Filtering
- detect_diff = location[1] - location[0]
- detect_dist = np.linalg.norm(detect_diff, axis=1, keepdims=True)
- predict_diff = forward[1] - forward[0]
- predict_dist = np.linalg.norm(predict_diff, axis=1, keepdims=True)
- predict_dist[np.where(predict_dist == 0)] = 1 # Avoid nan
- P_detect = (detect_dist / predict_dist).reshape(num_pts)
-
- for ipt in range(num_pts):
- if feedback_dist[ipt] > 2: # When use float
- check[ipt] = False
-
- if status_fw is not None and np.sum(status_fw) != num_pts:
- for ipt in range(num_pts):
- if status_fw[ipt][0] == 0:
- check[ipt] = False
- if status_fw is not None and np.sum(status_fb) != num_pts:
- for ipt in range(num_pts):
- if status_fb[ipt][0] == 0:
- check[ipt] = False
- location_merge = target.copy()
- # Merge the results:
- """
- Use Kalman Filter to combine the calculate result and detect result.
- """
-
- Q = 0.3 # Process variance
-
- for ipt in range(num_pts):
- if check[ipt]:
- # Kalman parameter
- P_predict[ipt] += Q
- K = P_predict[ipt] / (P_predict[ipt] + P_detect[ipt])
- location_merge[ipt] = forward_predict[ipt] + K * (target[ipt] - forward_predict[ipt])
- # Update the P_predict by the current K
- P_predict[ipt] = (1 - K) * P_predict[ipt]
- return location_merge, check, P_predict
-
-
-def detect_frames_track(frames):
- frames_num = len(frames)
- assert frames_num != 0
- frame_height, frame_width = frames[0].shape[:2]
- """
- Pre-process:
- To detect the original results,
- and normalize each face to a certain width,
- also its corresponding landmarks locations and
- scale parameter.
- """
- face_size_normalized = 400
- faces = []
- locations = []
- shapes_origin = []
- shapes_para = [] # Use to recover the shape in whole frame. ([x1, y1, scale_shape])
- face_size = 0
- skipped = 0
-
- """
- Use single frame to detect face on Dlib (CPU)
- """
- # ----------------------------------------------------------------------------#
-
- print("Detecting:")
- for i in tqdm(range(frames_num)):
- frame = frames[i]
- face_num, shape = predict_single_frame(frame)
-
- if face_num == 0:
- if len(shapes_origin) == 0:
- skipped += 1
- # print("Skipped", skipped, "Frame_num", frames_num)
- continue
- shape = shapes_origin[i - 1 - skipped]
-
- face, face_size = shape_to_face(shape, frame_width, frame_height, 1.2)
- faceFrame = frame[face[1]: face[3],
- face[0]:face[2]]
- if face_size < face_size_normalized:
- inter_para = cv2.INTER_CUBIC
- else:
- inter_para = cv2.INTER_AREA
- face_norm = cv2.resize(faceFrame, (face_size_normalized, face_size_normalized), interpolation=inter_para)
- scale_shape = face_size_normalized / face_size
- shape_norm = np.rint((shape - np.array([face[0], face[1]])) * scale_shape).astype(int)
- faces.append(face_norm)
- shapes_para.append([face[0], face[1], scale_shape])
- shapes_origin.append(shape)
- locations.append(shape_norm)
-
- """
- Calibration module.
- """
- segment_length = 2
- locations_sum = len(locations)
- if locations_sum == 0:
- return []
- locations_track = [locations[0]]
- num_pts = 68
- P_predict = np.array([0] * num_pts).reshape(num_pts).astype(float)
- print("Tracking")
- for i in tqdm(range(locations_sum - 1)):
- faces_seg = faces[i:i + segment_length]
- locations_seg = locations[i:i + segment_length]
-
- # ----------------------------------------------------------------------#
- """
- Numpy Version (DEPRECATED)
- """
-
- # locations_track_start = [locations_track[i]]
- # forward_pts, feedback_pts = track_bidirectional(faces_seg, locations_track_start)
- #
- # forward_pts = np.rint(forward_pts).astype(int)
- # feedback_pts = np.rint(feedback_pts).astype(int)
- # merge_pt, check, P_predict = check_and_merge(locations_seg, forward_pts, feedback_pts, P_predict)
-
- # ----------------------------------------------------------------------#
- """
- OpenCV Version
- """
-
- lk_params = dict(winSize=(15, 15),
- maxLevel=3,
- criteria=(cv2.TERM_CRITERIA_EPS | cv2.TERM_CRITERIA_COUNT, 10, 0.03))
- # Use the tracked current location as input. Also use the next frame's predicted location for
- # auxiliary initialization.
-
- start_pt = locations_track[i].astype(np.float32)
- target_pt = locations_seg[1].astype(np.float32)
-
- forward_pt, status_fw, err_fw = cv2.calcOpticalFlowPyrLK(faces_seg[0], faces_seg[1],
- start_pt, target_pt, **lk_params,
- flags=cv2.OPTFLOW_USE_INITIAL_FLOW)
- feedback_pt, status_fb, err_fb = cv2.calcOpticalFlowPyrLK(faces_seg[1], faces_seg[0],
- forward_pt, start_pt, **lk_params,
- flags=cv2.OPTFLOW_USE_INITIAL_FLOW)
-
- forward_pts = [locations_track[i].copy(), forward_pt]
- feedback_pts = [feedback_pt, forward_pt.copy()]
-
- forward_pts = np.rint(forward_pts).astype(int)
- feedback_pts = np.rint(feedback_pts).astype(int)
-
- merge_pt, check, P_predict = check_and_merge(locations_seg, forward_pts, feedback_pts, P_predict, status_fw,
- status_fb)
-
- # ----------------------------------------------------------------------#
-
- locations_track.append(merge_pt)
-
- """
- If us visualization, write the results to the visualize output folder.
- """
- if locations_sum != frames_num:
- print("INFO: Landmarks detection failed in some frames. Therefore we disable the "
- "visualization for this video. It will be optimized in future version.")
-
- aligned_landmarks = []
- for i in locations_track:
- shape = landmark_align(i)
- shape = shape.ravel()
- shape = shape.tolist()
- aligned_landmarks.append(shape)
-
- return aligned_landmarks
diff --git a/spaces/avans06/whisper-webui-translate/src/diarization/diarization.py b/spaces/avans06/whisper-webui-translate/src/diarization/diarization.py
deleted file mode 100644
index 76a2914105a4045ee7f16bfe3b927d84add4ef25..0000000000000000000000000000000000000000
--- a/spaces/avans06/whisper-webui-translate/src/diarization/diarization.py
+++ /dev/null
@@ -1,202 +0,0 @@
-import argparse
-import gc
-import json
-import os
-from pathlib import Path
-import tempfile
-from typing import TYPE_CHECKING, List
-import torch
-
-import ffmpeg
-
-class DiarizationEntry:
- def __init__(self, start, end, speaker):
- self.start = start
- self.end = end
- self.speaker = speaker
-
- def __repr__(self):
- return f""
-
- def toJson(self):
- return {
- "start": self.start,
- "end": self.end,
- "speaker": self.speaker
- }
-
-class Diarization:
- def __init__(self, auth_token=None):
- if auth_token is None:
- auth_token = os.environ.get("HF_ACCESS_TOKEN")
- if auth_token is None:
- raise ValueError("No HuggingFace API Token provided - please use the --auth_token argument or set the HF_ACCESS_TOKEN environment variable")
-
- self.auth_token = auth_token
- self.initialized = False
- self.pipeline = None
-
- @staticmethod
- def has_libraries():
- try:
- import pyannote.audio
- import intervaltree
- return True
- except ImportError:
- return False
-
- def initialize(self):
- """
- 1.Install pyannote.audio 3.0 with pip install pyannote.audio
- 2.Accept pyannote/segmentation-3.0 user conditions
- 3.Accept pyannote/speaker-diarization-3.0 user conditions
- 4.Create access token at hf.co/settings/tokens.
- https://huggingface.co/pyannote/speaker-diarization-3.0
- """
- if self.initialized:
- return
- from pyannote.audio import Pipeline
-
- self.pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization-3.0", use_auth_token=self.auth_token)
- self.initialized = True
-
- # Load GPU mode if available
- device = "cuda" if torch.cuda.is_available() else "cpu"
- if device == "cuda":
- print("Diarization - using GPU")
- self.pipeline = self.pipeline.to(torch.device(0))
- else:
- print("Diarization - using CPU")
-
- def run(self, audio_file, **kwargs):
- self.initialize()
- audio_file_obj = Path(audio_file)
-
- # Supported file types in soundfile is WAV, FLAC, OGG and MAT
- if audio_file_obj.suffix in [".wav", ".flac", ".ogg", ".mat"]:
- target_file = audio_file
- else:
- # Create temp WAV file
- target_file = tempfile.mktemp(prefix="diarization_", suffix=".wav")
- try:
- ffmpeg.input(audio_file).output(target_file, ac=1).run()
- except ffmpeg.Error as e:
- print(f"Error occurred during audio conversion: {e.stderr}")
-
- diarization = self.pipeline(target_file, **kwargs)
-
- if target_file != audio_file:
- # Delete temp file
- os.remove(target_file)
-
- # Yield result
- for turn, _, speaker in diarization.itertracks(yield_label=True):
- yield DiarizationEntry(turn.start, turn.end, speaker)
-
- def mark_speakers(self, diarization_result: List[DiarizationEntry], whisper_result: dict):
- from intervaltree import IntervalTree
- result = whisper_result.copy()
-
- # Create an interval tree from the diarization results
- tree = IntervalTree()
- for entry in diarization_result:
- tree[entry.start:entry.end] = entry
-
- # Iterate through each segment in the Whisper JSON
- for segment in result["segments"]:
- segment_start = segment["start"]
- segment_end = segment["end"]
-
- # Find overlapping speakers using the interval tree
- overlapping_speakers = tree[segment_start:segment_end]
-
- # If no speakers overlap with this segment, skip it
- if not overlapping_speakers:
- continue
-
- # If multiple speakers overlap with this segment, choose the one with the longest duration
- longest_speaker = None
- longest_duration = 0
-
- for speaker_interval in overlapping_speakers:
- overlap_start = max(speaker_interval.begin, segment_start)
- overlap_end = min(speaker_interval.end, segment_end)
- overlap_duration = overlap_end - overlap_start
-
- if overlap_duration > longest_duration:
- longest_speaker = speaker_interval.data.speaker
- longest_duration = overlap_duration
-
- # Add speakers
- segment["longest_speaker"] = longest_speaker
- segment["speakers"] = list([speaker_interval.data.toJson() for speaker_interval in overlapping_speakers])
-
- # The write_srt will use the longest_speaker if it exist, and add it to the text field
-
- return result
-
-def _write_file(input_file: str, output_path: str, output_extension: str, file_writer: lambda f: None):
- if input_file is None:
- raise ValueError("input_file is required")
- if file_writer is None:
- raise ValueError("file_writer is required")
-
- # Write file
- if output_path is None:
- effective_path = os.path.splitext(input_file)[0] + "_output" + output_extension
- else:
- effective_path = output_path
-
- with open(effective_path, 'w+', encoding="utf-8") as f:
- file_writer(f)
-
- print(f"Output saved to {effective_path}")
-
-def main():
- from src.utils import write_srt
- from src.diarization.transcriptLoader import load_transcript
-
- parser = argparse.ArgumentParser(description='Add speakers to a SRT file or Whisper JSON file using pyannote/speaker-diarization.')
- parser.add_argument('audio_file', type=str, help='Input audio file')
- parser.add_argument('whisper_file', type=str, help='Input Whisper JSON/SRT file')
- parser.add_argument('--output_json_file', type=str, default=None, help='Output JSON file (optional)')
- parser.add_argument('--output_srt_file', type=str, default=None, help='Output SRT file (optional)')
- parser.add_argument('--auth_token', type=str, default=None, help='HuggingFace API Token (optional)')
- parser.add_argument("--max_line_width", type=int, default=40, help="Maximum line width for SRT file (default: 40)")
- parser.add_argument("--num_speakers", type=int, default=None, help="Number of speakers")
- parser.add_argument("--min_speakers", type=int, default=None, help="Minimum number of speakers")
- parser.add_argument("--max_speakers", type=int, default=None, help="Maximum number of speakers")
-
- args = parser.parse_args()
-
- print("\nReading whisper JSON from " + args.whisper_file)
-
- # Read whisper JSON or SRT file
- whisper_result = load_transcript(args.whisper_file)
-
- diarization = Diarization(auth_token=args.auth_token)
- diarization_result = list(diarization.run(args.audio_file, num_speakers=args.num_speakers, min_speakers=args.min_speakers, max_speakers=args.max_speakers))
-
- # Print result
- print("Diarization result:")
- for entry in diarization_result:
- print(f" start={entry.start:.1f}s stop={entry.end:.1f}s speaker_{entry.speaker}")
-
- marked_whisper_result = diarization.mark_speakers(diarization_result, whisper_result)
-
- # Write output JSON to file
- _write_file(args.whisper_file, args.output_json_file, ".json",
- lambda f: json.dump(marked_whisper_result, f, indent=4, ensure_ascii=False))
-
- # Write SRT
- _write_file(args.whisper_file, args.output_srt_file, ".srt",
- lambda f: write_srt(marked_whisper_result["segments"], f, maxLineWidth=args.max_line_width))
-
-if __name__ == "__main__":
- main()
-
- #test = Diarization()
- #print("Initializing")
- #test.initialize()
-
- #input("Press Enter to continue...")
\ No newline at end of file
diff --git a/spaces/awacke1/DnD-Character-Sheet/README.md b/spaces/awacke1/DnD-Character-Sheet/README.md
deleted file mode 100644
index 8c850ac96855ef376d5d564d7e8e1c4d270a6bc8..0000000000000000000000000000000000000000
--- a/spaces/awacke1/DnD-Character-Sheet/README.md
+++ /dev/null
@@ -1,13 +0,0 @@
----
-title: DnD Character Sheet
-emoji: 🌖
-colorFrom: red
-colorTo: blue
-sdk: streamlit
-sdk_version: 1.17.0
-app_file: app.py
-pinned: false
-license: mit
----
-
-Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
diff --git a/spaces/awacke1/Git-GPG-Git-Actions-01-GraphViz/app.py b/spaces/awacke1/Git-GPG-Git-Actions-01-GraphViz/app.py
deleted file mode 100644
index 8aeec0f200b3ba4e20b24e97462734cfc89a9ca6..0000000000000000000000000000000000000000
--- a/spaces/awacke1/Git-GPG-Git-Actions-01-GraphViz/app.py
+++ /dev/null
@@ -1,578 +0,0 @@
-import streamlit as st
-import graphviz as graphviz
-import pandas as pd
-import numpy as np
-
-st.title('Graphviz Gallery: https://graphviz.org/gallery/')
-
-# Plan
-graph = graphviz.Digraph()
-graph.edge('Plan', 'Intervention')
-graph.edge('Intervention', 'Care')
-graph.edge('Intervention', 'Category')
-graph.edge('Intervention', 'QualityMeasure')
-graph.edge('Intervention', 'Target')
-graph.edge('Plan', 'Goal')
-graph.edge('Plan', 'OutcomeScores')
-graph.edge('Plan', 'Problem')
-graph.edge('Problem', 'Domain')
-graph.edge('Problem', 'Outcome')
-graph.edge('Problem', 'Scope')
-graph.edge('Problem', 'SignSymptom')
-graph.edge('Problem', 'Urgency')
-graph.edge('Plan', 'Pathway')
-graph.edge('Pathway', 'Intervention')
-graph.edge('Pathway', 'ProblemGoal')
-graph.edge('Plan', 'SignSymptom')
-graph.edge('Plan', 'Stage')
-graph.edge('Plan', 'Delegate')
-graph.edge('Plan', 'Note')
-graph.edge('Plan', 'Person')
-graph.edge('Problem', 'Association')
-graph.edge('Problem', 'History')
-graph.edge('Goal', 'History')
-graph.edge('Intervention', 'Work')
-graph.edge('Intervention', 'History')
-graph.edge('SignSymptom', 'History')
-graph.edge('Plan', 'Publication')
-graph.edge('Publication', 'History')
-graph.edge('Publication', 'Status')
-st.graphviz_chart(graph)
-
-
-# Assessment
-graph = graphviz.Digraph()
-graph.edge('Assessment', 'Score')
-graph.edge('Assessment', 'QuestionAsked')
-graph.edge('Assessment', 'ProgressChange')
-graph.edge('Assessment', 'Programs')
-graph.edge('Assessment', 'Product')
-graph.edge('Assessment', 'Program')
-graph.edge('Program', 'Population')
-graph.edge('Assessment', 'Plan')
-graph.edge('Plan', 'Question')
-graph.edge('Plan', 'Problem')
-graph.edge('Assessment', 'Response')
-graph.edge('Response', 'Choice')
-graph.edge('Response', 'Populator')
-graph.edge('Assessment', 'Section')
-graph.edge('Section', 'Score')
-graph.edge('Assessment', 'Template')
-graph.edge('Template', 'Script')
-graph.edge('Template', 'Question')
-graph.edge('Question', 'SubQuestion')
-graph.edge('Question', 'Table')
-graph.edge('Table', 'SubTable')
-graph.edge('Table', 'Column')
-graph.edge('Column', 'Choice')
-graph.edge('Question', 'Response')
-graph.edge('Response', 'ResponseTable')
-graph.edge('Response', 'ResponseText')
-graph.edge('Template', 'Section')
-graph.edge('Assessment', 'Document')
-graph.edge('Assessment', 'Service')
-graph.edge('Service', 'History')
-graph.edge('Service', 'Request')
-st.graphviz_chart(graph)
-
-
-# Create a graphlib graph object
-graph = graphviz.Digraph()
-graph.edge('Grandpa', 'Ancestors')
-graph.edge('Grandma', 'Ancestors')
-graph.edge('Uncle', 'Grandma')
-graph.edge('Aunt', 'Grandma')
-graph.edge('Mom', 'Grandma')
-graph.edge('Cousin Bob', 'Aunt')
-graph.edge('Cousin Sue', 'Aunt')
-graph.edge('Brother', 'Mom')
-graph.edge('Sister', 'Mom')
-st.graphviz_chart(graph)
-
-
-st.graphviz_chart('''
-digraph G2 {
- node [shape=plaintext];
- struct1 [label=<
- 
- caption
-
>];
-}
-''')
-
-
-
-st.title('Graphviz Dot Language: https://graphviz.org/doc/info/lang.html')
-
-# Using graph language:
-st.graphviz_chart('''
-digraph G {
- rankdir=LR
- node [shape=plaintext]
- a [
- label=<
-
- class
- qualifier
-
>
- ]
- b [shape=ellipse style=filled
- label=<
-
-
- elephant
- two
-
-
-
-
- corn
- c
- f
-
-
- penguin
-
-
- 4
-
-
>
- ]
- c [
- label= line 2
line 3
>
- ]
- subgraph { rank=same b c }
- a:here -> b:there [dir=both arrowtail=diamond]
- c -> b
- d [shape=triangle]
- d -> c [label=<
-
-
-
- Edge labels
also
-
-
-
>
- ]
-}
-''')
-
-st.graphviz_chart('''
-digraph R {
- rankdir=LR
- node [style=rounded]
- node1 [shape=box]
- node2 [fillcolor=yellow, style="rounded,filled", shape=diamond]
- node3 [shape=record, label="{ a | b | c }"]
- node1 -> node2 -> node3
-}
-''')
-
-st.title('Vega Lite Example: https://docs.streamlit.io/library/api-reference/charts/st.vega_lite_chart ')
-df = pd.DataFrame(
- np.random.randn(200, 3),
- columns=['a', 'b', 'c'])
-
-st.vega_lite_chart(df, {
- 'mark': {'type': 'circle', 'tooltip': True},
- 'encoding': {
- 'x': {'field': 'a', 'type': 'quantitative'},
- 'y': {'field': 'b', 'type': 'quantitative'},
- 'size': {'field': 'c', 'type': 'quantitative'},
- 'color': {'field': 'c', 'type': 'quantitative'},
- },
- })
-
-# More graph examples
-
-st.graphviz_chart('''
-digraph structs {
- node [shape=record];
- struct1 [label=" left| mid\ dle| right"];
- struct2 [label=" one| two"];
- struct3 [label="hello\nworld |{ b |{c| d|e}| f}| g | h"];
- struct1:f1 -> struct2:f0;
- struct1:f2 -> struct3:here;
-}
-''')
-
-st.graphviz_chart('''
-graph G {
- fontname="Helvetica,Arial,sans-serif"
- node [fontname="Helvetica,Arial,sans-serif"]
- edge [fontname="Helvetica,Arial,sans-serif"]
- layout=fdp
- e
- subgraph clusterA {
- a -- b;
- subgraph clusterC {
- C -- D;
- }
- }
- subgraph clusterB {
- d -- f
- }
- d -- D
- e -- clusterB
- clusterC -- clusterB
-}
-''')
-
-st.graphviz_chart('''
-graph Transparency {
- layout=neato
- start=11 // empiric value to set orientation
- bgcolor="#0000ff11"
- node [shape=circle width=2.22 label="" style=filled]
- 5 [color="#0000ff80"]
- 6 [color="#ee00ee80"]
- 1 [color="#ff000080"]
- 2 [color="#eeee0080"]
- 3 [color="#00ff0080"]
- 4 [color="#00eeee80"]
- 1 -- 2 -- 3 -- 4 -- 5 -- 6 -- 1
- }
-''')
-
-st.graphviz_chart('''
-digraph UML_Class_diagram {
- fontname="Helvetica,Arial,sans-serif"
- node [fontname="Helvetica,Arial,sans-serif"]
- edge [fontname="Helvetica,Arial,sans-serif"]
- labelloc="t"
- label="UML Class diagram demo"
- graph [splines=false]
- node [shape=record style=filled fillcolor=gray95]
- edge [arrowhead=vee style=dashed]
- Client -> Interface1 [xlabel=dependency]
- Client -> Interface2
- edge [dir=back arrowtail=empty style=""]
- Interface1 -> Class1 [xlabel=inheritance]
- Interface2 -> Class1 [dir=none]
- Interface2 [label="" xlabel="Simple\ninterface" shape=circle]
- Interface1[label = <{«interface» I/O | + property
...
|+ method
...
}>]
- Class1[label = <{I/O class | + property
...
|+ method
...
}>]
- edge [dir=back arrowtail=empty style=dashed]
- Class1 -> System_1 [xlabel=implementation]
- System_1 [label = <{System | + property
...
|+ method
...
}>]
- "Shared resource" [label = <{Shared resource | + property
...
|+ method
...
}>]
- edge [dir=back arrowtail=diamond]
- "System_1" -> Subsystem_1 [xlabel="composition"]
- Subsystem_1[label = <{Subsystem 1 | + property
...
|+ method
...
}>]
- Subsystem_2[label = <{Subsystem 2 | + property
...
|+ method
...
}>]
- Subsystem_3[label = <{Subsystem 3 | + property
...
|+ method
...
}>]
- "System_1" -> Subsystem_2
- "System_1" -> Subsystem_3
- edge [xdir=back arrowtail=odiamond]
- Subsystem_1 -> "Shared resource" [xlabel=aggregation]
- {Subsystem_2 Subsystem_3 } -> "Shared resource"
-}
-''')
-
-
-
-st.graphviz_chart('''
-digraph G {
- fontname="Helvetica,Arial,sans-serif"
- node [fontname="Helvetica,Arial,sans-serif"]
- edge [fontname="Helvetica,Arial,sans-serif"]
- subgraph cluster_1 {
- node [ style=filled,shape="box",fillcolor="antiquewhite:aquamarine" ]n5;
- node [ shape="ellipse",fillcolor="bisque4:blue2" ]n4;
- node [ shape="circle",fillcolor="cadetblue1:chocolate1" ]n3;
- node [ shape="diamond",fillcolor="crimson:cyan4" ]n2;
- node [ shape="triangle",fillcolor="deepskyblue2:firebrick" ]n1;
- node [ shape="pentagon",fillcolor="gray24:gray88" ]n0;
- label = "X11 Colors";
- }
- subgraph cluster_2 {
- node [ style=filled,shape="box",fillcolor="bisque:brown" ]n11;
- node [ shape="ellipse",fillcolor="green:darkorchid" ]n10;
- node [ shape="circle",fillcolor="deepskyblue:gold" ]n9;
- node [ shape="diamond",fillcolor="lightseagreen:orangered" ]n8;
- node [ shape="triangle",fillcolor="turquoise:salmon" ]n7;
- node [ shape="pentagon",fillcolor="snow:black" ]n6;
- label = "SVG Colors";
- }
- subgraph cluster_3 {
- node [ style=filled,shape="box",fillcolor="/accent3/1:/accent3/3" ]n17;
- node [ shape="ellipse",fillcolor="/accent4/1:/accent4/4" ]n16;
- node [ shape="circle",fillcolor="/accent5/1:/accent5/5" ]n15;
- node [ shape="diamond",fillcolor="/accent6/1:/accent6/6" ]n14;
- node [ shape="triangle",fillcolor="/accent7/1:/accent7/7" ]n13;
- node [ shape="pentagon",fillcolor="/accent8/1:/accent8/8" ]n12;
- label = "Brewer - accent";
- }
- subgraph cluster_4 {
- node [ style=filled,shape="box",fillcolor="/blues3/1:/blues3/2" ]n23;
- node [ shape="ellipse",fillcolor="/blues4/1:/blues4/3" ]n22;
- node [ shape="circle",fillcolor="/blues5/1:/blues5/4" ]n21;
- node [ shape="diamond",fillcolor="/blues6/1:/blues6/5" ]n20;
- node [ shape="triangle",fillcolor="/blues7/1:/blues7/6" ]n19;
- node [ shape="pentagon",fillcolor="/blues8/1:/blues8/7" ]n18;
- label = "Brewer - blues";
- }
-n3 -> n9 -> n15 -> n21;
-}
-''')
-
-st.graphviz_chart('''
-digraph G {bgcolor="#0000FF44:#FF000044" gradientangle=90
- fontname="Helvetica,Arial,sans-serif"
- node [fontname="Helvetica,Arial,sans-serif"]
- edge [fontname="Helvetica,Arial,sans-serif"]
- subgraph cluster_0 {
- style=filled;
- color=lightgrey;
- fillcolor="darkgray:gold";
- gradientangle=0
- node [fillcolor="yellow:green" style=filled gradientangle=270] a0;
- node [fillcolor="lightgreen:red"] a1;
- node [fillcolor="lightskyblue:darkcyan"] a2;
- node [fillcolor="cyan:lightslateblue"] a3;
- a0 -> a1 -> a2 -> a3;
- label = "process #1";
- }
- subgraph cluster_1 {
- node [fillcolor="yellow:magenta"
- style=filled gradientangle=270] b0;
- node [fillcolor="violet:darkcyan"] b1;
- node [fillcolor="peachpuff:red"] b2;
- node [fillcolor="mediumpurple:purple"] b3;
- b0 -> b1 -> b2 -> b3;
- label = "process #2";
- color=blue
- fillcolor="darkgray:gold";
- gradientangle=0
- style=filled;
- }
- start -> a0;
- start -> b0;
- a1 -> b3;
- b2 -> a3;
- a3 -> a0;
- a3 -> end;
- b3 -> end;
- start [shape=Mdiamond ,
- fillcolor="pink:red",
- gradientangle=90,
- style=radial];
- end [shape=Msquare,
- fillcolor="lightyellow:orange",
- style=radial,
- gradientangle=90];
-}
-''')
-
-st.graphviz_chart('''
-graph Color_wheel {
- graph [
- layout = neato
- label = "Color wheel, 33 colors.\nNeato layout"
- labelloc = b
- fontname = "Helvetica,Arial,sans-serif"
- start = regular
- normalize = 0
- ]
- node [
- shape = circle
- style = filled
- color = "#00000088"
- fontname = "Helvetica,Arial,sans-serif"
- ]
- edge [
- len = 2.7
- color = "#00000088"
- fontname = "Helvetica,Arial,sans-serif"
- ]
- subgraph Dark {
- node [fontcolor = white width = 1.4]
- center [width = 1 style = invis shape = point]
- center -- darkred [label = "0°/360°"]
- darkred [fillcolor = darkred]
- brown [fillcolor = brown]
- brown -- center [label = "30°"]
- olive [fillcolor = olive]
- olive -- center [label = "60°"]
- darkolivegreen [fillcolor = darkolivegreen fontsize = 10]
- darkolivegreen -- center [label = "90°"]
- darkgreen [fillcolor = darkgreen]
- darkgreen -- center [label = "120°"]
- "dark hue 0.416" [color = ".416 1 .6" fontcolor = white]
- "dark hue 0.416" -- center [label = "150°"]
- darkcyan [fillcolor = darkcyan]
- darkcyan -- center [label = "180°"]
- "dark hue 0.583" [color = ".583 1 .6" fontcolor = white]
- "dark hue 0.583" -- center [label = "210°"]
- darkblue [fillcolor = darkblue]
- darkblue -- center [label = "240°"]
- "dark hue 0.750" [color = ".750 1 .6"]
- "dark hue 0.750" -- center [label = "270°"]
- darkmagenta [fillcolor = darkmagenta]
- darkmagenta -- center [label = "300°"]
- "dark hue 0.916" [color = ".916 1 .6"]
- "dark hue 0.916" -- center [label = "330°"]
- }
- subgraph Tue {
- node [width = 1.3]
- "hue 0.083" -- brown
- "hue 0.083" [color = ".083 1 1"]
- "hue 0.125" [color = ".125 1 1"]
- "hue 0.166" -- olive
- "hue 0.166" [color = ".166 1 1"]
- "hue 0.208" [color = ".208 1 1"]
- "hue 0.250" -- darkolivegreen
- "hue 0.250" [color = ".250 1 1"]
- "hue 0.291" [color = ".291 1 1"]
- "hue 0.333" -- darkgreen
- "hue 0.333" [color = ".333 1 1"]
- "hue 0.375" [color = ".375 1 1"]
- "hue 0.416" -- "dark hue 0.416"
- "hue 0.416" [color = ".416 1 1"]
- "hue 0.458" [color = ".458 1 1"]
- "hue 0.500" -- darkcyan
- "hue 0.500" [color = ".500 1 1"]
- "hue 0.541" [color = ".541 1 1"]
- node [fontcolor = white]
- "hue 0.000" [color = ".000 1 1"]
- "hue 0.000" -- darkred
- "hue 0.041" [color = ".041 1 1"]
- "hue 0.583" -- "dark hue 0.583"
- "hue 0.583" [color = ".583 1 1"]
- "hue 0.625" [color = ".625 1 1"]
- "hue 0.666" -- darkblue
- "hue 0.666" [color = ".666 1 1"]
- "hue 0.708" [color = ".708 1 1"]
- "hue 0.750" -- "dark hue 0.750"
- "hue 0.750" [color = ".750 1 1"]
- "hue 0.791" [color = ".791 1 1"]
- "hue 0.833" -- darkmagenta
- "hue 0.833" [color = ".833 1 1"]
- "hue 0.875" [color = ".875 1 1"]
- "hue 0.916" -- "dark hue 0.916"
- "hue 0.916" [color = ".916 1 1"]
- "hue 0.958" [color = ".958 1 1"]
- edge [len = 1]
- "hue 0.000" -- "hue 0.041" -- "hue 0.083" -- "hue 0.125" -- "hue 0.166" -- "hue 0.208"
- "hue 0.208" -- "hue 0.250" -- "hue 0.291" -- "hue 0.333" -- "hue 0.375" -- "hue 0.416"
- "hue 0.416" -- "hue 0.458" -- "hue 0.500" --"hue 0.541" -- "hue 0.583" -- "hue 0.625"
- "hue 0.625" -- "hue 0.666" -- "hue 0.708" -- "hue 0.750" -- "hue 0.791" -- "hue 0.833"
- "hue 0.833" -- "hue 0.875" -- "hue 0.916" -- "hue 0.958" -- "hue 0.000"
- }
- subgraph Main_colors {
- node [width = 2 fontsize = 20]
- red [fillcolor = red fontcolor = white]
- orangered [fillcolor = orangered]
- orange [fillcolor = orange]
- gold [fillcolor = gold]
- yellow [fillcolor = yellow]
- yellowgreen [fillcolor = yellowgreen]
- deeppink [fillcolor = deeppink fontcolor = white]
- fuchsia [label = "fuchsia\nmagenta" fillcolor = fuchsia fontcolor = white]
- purple [fillcolor = purple fontcolor = white]
- blue [fillcolor = blue fontcolor = white]
- cornflowerblue [fillcolor = cornflowerblue]
- deepskyblue [fillcolor = deepskyblue]
- aqua [fillcolor = aqua label = "aqua\ncyan"]
- springgreen [fillcolor = springgreen]
- green [fillcolor = green]
- purple -- fuchsia -- deeppink -- red
- cornflowerblue -- blue -- purple
- cornflowerblue -- deepskyblue -- aqua [len = 1.7]
- aqua -- springgreen -- green -- yellowgreen -- yellow
- yellow -- gold -- orange -- orangered -- red [len = 1.6]
- orange -- "hue 0.083"
- deeppink -- "hue 0.916"
- deeppink -- "hue 0.875"
- red -- "hue 0.000"
- yellowgreen -- "hue 0.250"
- blue -- "hue 0.666"
- yellow -- "hue 0.166"
- gold -- "hue 0.125"
- green -- "hue 0.333"
- springgreen -- "hue 0.416"
- aqua -- "hue 0.500"
- cornflowerblue -- "hue 0.583"
- deepskyblue -- "hue 0.541"
- purple -- "hue 0.791"
- purple -- "hue 0.750"
- fuchsia -- "hue 0.833"
- }
- subgraph Light_colors {
- node [width = 2 fontsize = 20]
- node [shape = circle width = 1.8]
- edge [len = 2.1]
- pink [fillcolor = pink]
- pink -- red
- lightyellow [fillcolor = lightyellow]
- lightyellow -- yellow
- mediumpurple [fillcolor = mediumpurple]
- mediumpurple -- purple
- violet [fillcolor = violet]
- violet -- fuchsia
- hotpink [fillcolor = hotpink]
- hotpink -- deeppink
- "light hue 0.250" [color = ".250 .2 1"]
- "light hue 0.250" -- yellowgreen
- lightcyan [fillcolor = lightcyan]
- lightcyan -- aqua
- lightslateblue [fillcolor = lightslateblue]
- lightslateblue -- blue
- lightgreen [fillcolor = lightgreen]
- lightgreen -- green
- lightskyblue [fillcolor = lightskyblue]
- lightskyblue -- deepskyblue
- peachpuff [fillcolor = peachpuff]
- peachpuff -- orange
- "light hue 0.416" [color = ".416 .2 1"]
- "light hue 0.416" -- springgreen
- }
- subgraph Tints {
- node [width = 1]
- edge [len = 2.4]
- "hue 0 tint" -- pink
- "hue 0 tint" [color = "0 .1 1"]
- "hue 0.041 tint" [color = ".041 .1 1"]
- "hue 0.083 tint" -- peachpuff
- "hue 0.083 tint" [color = ".083 .1 1"]
- "hue 0.125 tint" [color = ".125 .1 1"]
- "hue 0.166 tint" -- lightyellow
- "hue 0.166 tint" [color = ".166 .1 1"]
- "hue 0.208 tint" [color = ".208 .1 1"]
- "hue 0.250 tint" -- "light hue 0.250"
- "hue 0.250 tint" [color = ".250 .1 1"]
- "hue 0.291 tint" [color = ".291 .1 1"]
- "hue 0.333 tint" -- lightgreen
- "hue 0.333 tint" [color = ".333 .1 1"]
- "hue 0.375 tint" [color = ".375 .1 1"]
- "hue 0.416 tint" -- "light hue 0.416"
- "hue 0.416 tint" [color = ".416 .1 1"]
- "hue 0.458 tint" [color = ".458 .1 1"]
- "hue 0.5 tint" -- lightcyan
- "hue 0.5 tint" [color = ".5 .1 1"]
- "hue 0.541 tint" -- lightskyblue
- "hue 0.541 tint" [color = ".541 .1 1"]
- "hue 0.583 tint" [color = ".583 .1 1"]
- "hue 0.625 tint" [color = ".625 .1 1"]
- "hue 0.666 tint" -- lightslateblue
- "hue 0.666 tint" [color = ".666 .1 1"]
- "hue 0.708 tint" [color = ".708 .1 1"]
- "hue 0.750 tint" -- mediumpurple
- "hue 0.750 tint" [color = ".750 .1 1"]
- "hue 0.791 tint" [color = ".791 .1 1"]
- "hue 0.833 tint" -- violet
- "hue 0.833 tint" [color = ".833 .1 1"]
- "hue 0.875 tint" [color = ".875 .1 1"]
- "hue 0.916 tint" -- hotpink
- "hue 0.916 tint" [color = ".916 .1 1"]
- "hue 0.958 tint" [color = ".958 .1 1"]
- edge [len = 2]
- "hue 0 tint" -- "hue 0.041 tint" -- "hue 0.083 tint" -- "hue 0.125 tint" -- "hue 0.166 tint" -- "hue 0.208 tint"
- "hue 0.208 tint" -- "hue 0.250 tint" -- "hue 0.291 tint" -- "hue 0.333 tint" -- "hue 0.375 tint" -- "hue 0.416 tint"
- "hue 0.416 tint" -- "hue 0.458 tint" -- "hue 0.5 tint" --"hue 0.541 tint" -- "hue 0.583 tint" -- "hue 0.625 tint"
- "hue 0.625 tint" -- "hue 0.666 tint" -- "hue 0.708 tint" -- "hue 0.750 tint" -- "hue 0.791 tint" -- "hue 0.833 tint"
- "hue 0.833 tint" -- "hue 0.875 tint" -- "hue 0.916 tint" -- "hue 0.958 tint" -- "hue 0 tint"
- }
- }
-''')
\ No newline at end of file
diff --git a/spaces/awacke1/Streamlit.Azure.SDK.Terraform/app.py b/spaces/awacke1/Streamlit.Azure.SDK.Terraform/app.py
deleted file mode 100644
index b68a7942c39aea5ff298cd0af54f842bf43fa44f..0000000000000000000000000000000000000000
--- a/spaces/awacke1/Streamlit.Azure.SDK.Terraform/app.py
+++ /dev/null
@@ -1,81 +0,0 @@
-import os
-import json
-import tempfile
-from azure.identity import DefaultAzureCredential
-from azure.mgmt.resource import ResourceManagementClient
-from python_terraform import Terraform
-
-import streamlit as st
-
-# Set up Azure credentials
-credential = DefaultAzureCredential()
-subscription_id = os.environ["AZURE_SUBSCRIPTION_ID"]
-
-# Initialize ResourceManagementClient
-resource_client = ResourceManagementClient(credential, subscription_id)
-
-# Initialize Terraform
-tf = Terraform(working_dir=tempfile.mkdtemp())
-
-# Streamlit app
-st.title("Azure SDK and Terraform Demo")
-
-# Get the list of resource groups
-resource_groups = [rg.name for rg in resource_client.resource_groups.list()]
-
-# Select a resource group
-selected_rg = st.selectbox("Select a Resource Group", resource_groups)
-
-if selected_rg:
- # Display resources in the selected resource group
- resources = resource_client.resources.list_by_resource_group(selected_rg)
- st.subheader(f"Resources in Resource Group: {selected_rg}")
- for resource in resources:
- st.write(f"{resource.type}: {resource.name}")
-
-# Terraform configurations
-st.subheader("Terraform Configuration")
-
-# Set up the Terraform configuration
-terraform_config = f"""
-provider "azurerm" {{
- features {{}}
-}}
-
-resource "azurerm_resource_group" "example" {{
- name = "{selected_rg}"
- location = "East US"
-}}
-
-resource "azurerm_virtual_network" "example" {{
- name = "example-network"
- address_space = ["10.0.0.0/16"]
- location = azurerm_resource_group.example.location
- resource_group_name = azurerm_resource_group.example.name
-}}
-
-resource "azurerm_subnet" "example" {{
- name = "internal"
- resource_group_name = azurerm_resource_group.example.name
- virtual_network_name = azurerm_virtual_network.example.name
- address_prefix = "10.0.2.0/24"
-}}
-"""
-
-# Save the Terraform configuration to a file
-with open("main.tf", "w") as f:
- f.write(terraform_config)
-
-st.code(terraform_config, language="hcl")
-
-if st.button("Apply Terraform"):
- # Initialize and apply Terraform configuration
- tf.init()
- ret_code, stdout, stderr = tf.apply(skip_plan=True, capture_output=True)
-
- if ret_code == 0:
- st.success("Terraform applied successfully!")
- st.code(stdout, language="bash")
- else:
- st.error("Error applying Terraform configuration")
- st.code(stderr, language="bash")
diff --git a/spaces/balenireekshana/MyGenAI/app.py b/spaces/balenireekshana/MyGenAI/app.py
deleted file mode 100644
index a362dcc7d0ddd1eee86961f1bc3db6d894fbd3d5..0000000000000000000000000000000000000000
--- a/spaces/balenireekshana/MyGenAI/app.py
+++ /dev/null
@@ -1,34 +0,0 @@
-import os
-import gradio as gr
-from langchain.chat_models import ChatOpenAI
-from langchain import LLMChain, PromptTemplate
-from langchain.memory import ConversationBufferMemory
-
-OPENAI_API_KEY=os.getenv('OPENAI_API_KEY')
-
-template = """You are a helpful assistant to answer all user queries.
-{chat_history}
-User: {user_message}
-Chatbot:"""
-
-prompt = PromptTemplate(
- input_variables=["chat_history", "user_message"], template=template
-)
-
-memory = ConversationBufferMemory(memory_key="chat_history")
-
-llm_chain = LLMChain(
- llm=ChatOpenAI(temperature='0.5', model_name="gpt-3.5-turbo"),
- prompt=prompt,
- verbose=True,
- memory=memory,
-)
-
-def get_text_response(user_message,history):
- response = llm_chain.predict(user_message = user_message)
- return response
-
-demo = gr.ChatInterface(get_text_response)
-
-if __name__ == "__main__":
- demo.launch() #To create a public link, set `share=True` in `launch()`. To enable errors and logs, set `debug=True` in `launch()`.
diff --git a/spaces/banana-projects/web3d/node_modules/three/examples/js/renderers/SVGRenderer.js b/spaces/banana-projects/web3d/node_modules/three/examples/js/renderers/SVGRenderer.js
deleted file mode 100644
index 08e4d72181b5951af9496dbe0ccdd6010fd02a81..0000000000000000000000000000000000000000
--- a/spaces/banana-projects/web3d/node_modules/three/examples/js/renderers/SVGRenderer.js
+++ /dev/null
@@ -1,507 +0,0 @@
-/**
- * @author mrdoob / http://mrdoob.com/
- */
-
-THREE.SVGObject = function ( node ) {
-
- THREE.Object3D.call( this );
-
- this.node = node;
-
-};
-
-THREE.SVGObject.prototype = Object.create( THREE.Object3D.prototype );
-THREE.SVGObject.prototype.constructor = THREE.SVGObject;
-
-THREE.SVGRenderer = function () {
-
- console.log( 'THREE.SVGRenderer', THREE.REVISION );
-
- var _this = this,
- _renderData, _elements, _lights,
- _projector = new THREE.Projector(),
- _svg = document.createElementNS( 'http://www.w3.org/2000/svg', 'svg' ),
- _svgWidth, _svgHeight, _svgWidthHalf, _svgHeightHalf,
-
- _v1, _v2, _v3,
-
- _clipBox = new THREE.Box2(),
- _elemBox = new THREE.Box2(),
-
- _color = new THREE.Color(),
- _diffuseColor = new THREE.Color(),
- _ambientLight = new THREE.Color(),
- _directionalLights = new THREE.Color(),
- _pointLights = new THREE.Color(),
- _clearColor = new THREE.Color(),
- _clearAlpha = 1,
-
- _vector3 = new THREE.Vector3(), // Needed for PointLight
- _centroid = new THREE.Vector3(),
- _normal = new THREE.Vector3(),
- _normalViewMatrix = new THREE.Matrix3(),
-
- _viewMatrix = new THREE.Matrix4(),
- _viewProjectionMatrix = new THREE.Matrix4(),
-
- _svgPathPool = [],
- _svgNode, _pathCount = 0,
-
- _currentPath, _currentStyle,
-
- _quality = 1, _precision = null;
-
- this.domElement = _svg;
-
- this.autoClear = true;
- this.sortObjects = true;
- this.sortElements = true;
-
- this.info = {
-
- render: {
-
- vertices: 0,
- faces: 0
-
- }
-
- };
-
- this.setQuality = function ( quality ) {
-
- switch ( quality ) {
-
- case "high": _quality = 1; break;
- case "low": _quality = 0; break;
-
- }
-
- };
-
- this.setClearColor = function ( color, alpha ) {
-
- _clearColor.set( color );
- _clearAlpha = alpha !== undefined ? alpha : 1;
-
- };
-
- this.setPixelRatio = function () {};
-
- this.setSize = function ( width, height ) {
-
- _svgWidth = width; _svgHeight = height;
- _svgWidthHalf = _svgWidth / 2; _svgHeightHalf = _svgHeight / 2;
-
- _svg.setAttribute( 'viewBox', ( - _svgWidthHalf ) + ' ' + ( - _svgHeightHalf ) + ' ' + _svgWidth + ' ' + _svgHeight );
- _svg.setAttribute( 'width', _svgWidth );
- _svg.setAttribute( 'height', _svgHeight );
-
- _clipBox.min.set( - _svgWidthHalf, - _svgHeightHalf );
- _clipBox.max.set( _svgWidthHalf, _svgHeightHalf );
-
- };
-
- this.setPrecision = function ( precision ) {
-
- _precision = precision;
-
- };
-
- function removeChildNodes() {
-
- _pathCount = 0;
-
- while ( _svg.childNodes.length > 0 ) {
-
- _svg.removeChild( _svg.childNodes[ 0 ] );
-
- }
-
- }
-
- function getSvgColor( color, opacity ) {
-
- var arg = Math.floor( color.r * 255 ) + ',' + Math.floor( color.g * 255 ) + ',' + Math.floor( color.b * 255 );
-
- if ( opacity === undefined || opacity === 1 ) return 'rgb(' + arg + ')';
-
- return 'rgb(' + arg + '); fill-opacity: ' + opacity;
-
- }
-
- function convert( c ) {
-
- return _precision !== null ? c.toFixed( _precision ) : c;
-
- }
-
- this.clear = function () {
-
- removeChildNodes();
- _svg.style.backgroundColor = getSvgColor( _clearColor, _clearAlpha );
-
- };
-
- this.render = function ( scene, camera ) {
-
- if ( camera instanceof THREE.Camera === false ) {
-
- console.error( 'THREE.SVGRenderer.render: camera is not an instance of THREE.Camera.' );
- return;
-
- }
-
- var background = scene.background;
-
- if ( background && background.isColor ) {
-
- removeChildNodes();
- _svg.style.backgroundColor = getSvgColor( background );
-
- } else if ( this.autoClear === true ) {
-
- this.clear();
-
- }
-
- _this.info.render.vertices = 0;
- _this.info.render.faces = 0;
-
- _viewMatrix.copy( camera.matrixWorldInverse );
- _viewProjectionMatrix.multiplyMatrices( camera.projectionMatrix, _viewMatrix );
-
- _renderData = _projector.projectScene( scene, camera, this.sortObjects, this.sortElements );
- _elements = _renderData.elements;
- _lights = _renderData.lights;
-
- _normalViewMatrix.getNormalMatrix( camera.matrixWorldInverse );
-
- calculateLights( _lights );
-
- // reset accumulated path
-
- _currentPath = '';
- _currentStyle = '';
-
- for ( var e = 0, el = _elements.length; e < el; e ++ ) {
-
- var element = _elements[ e ];
- var material = element.material;
-
- if ( material === undefined || material.opacity === 0 ) continue;
-
- _elemBox.makeEmpty();
-
- if ( element instanceof THREE.RenderableSprite ) {
-
- _v1 = element;
- _v1.x *= _svgWidthHalf; _v1.y *= - _svgHeightHalf;
-
- renderSprite( _v1, element, material );
-
- } else if ( element instanceof THREE.RenderableLine ) {
-
- _v1 = element.v1; _v2 = element.v2;
-
- _v1.positionScreen.x *= _svgWidthHalf; _v1.positionScreen.y *= - _svgHeightHalf;
- _v2.positionScreen.x *= _svgWidthHalf; _v2.positionScreen.y *= - _svgHeightHalf;
-
- _elemBox.setFromPoints( [ _v1.positionScreen, _v2.positionScreen ] );
-
- if ( _clipBox.intersectsBox( _elemBox ) === true ) {
-
- renderLine( _v1, _v2, element, material );
-
- }
-
- } else if ( element instanceof THREE.RenderableFace ) {
-
- _v1 = element.v1; _v2 = element.v2; _v3 = element.v3;
-
- if ( _v1.positionScreen.z < - 1 || _v1.positionScreen.z > 1 ) continue;
- if ( _v2.positionScreen.z < - 1 || _v2.positionScreen.z > 1 ) continue;
- if ( _v3.positionScreen.z < - 1 || _v3.positionScreen.z > 1 ) continue;
-
- _v1.positionScreen.x *= _svgWidthHalf; _v1.positionScreen.y *= - _svgHeightHalf;
- _v2.positionScreen.x *= _svgWidthHalf; _v2.positionScreen.y *= - _svgHeightHalf;
- _v3.positionScreen.x *= _svgWidthHalf; _v3.positionScreen.y *= - _svgHeightHalf;
-
- _elemBox.setFromPoints( [
- _v1.positionScreen,
- _v2.positionScreen,
- _v3.positionScreen
- ] );
-
- if ( _clipBox.intersectsBox( _elemBox ) === true ) {
-
- renderFace3( _v1, _v2, _v3, element, material );
-
- }
-
- }
-
- }
-
- flushPath(); // just to flush last svg:path
-
- scene.traverseVisible( function ( object ) {
-
- if ( object instanceof THREE.SVGObject ) {
-
- _vector3.setFromMatrixPosition( object.matrixWorld );
- _vector3.applyMatrix4( _viewProjectionMatrix );
-
- if ( _vector3.z < - 1 || _vector3.z > 1 ) return;
-
- var x = _vector3.x * _svgWidthHalf;
- var y = - _vector3.y * _svgHeightHalf;
-
- var node = object.node;
- node.setAttribute( 'transform', 'translate(' + x + ',' + y + ')' );
-
- _svg.appendChild( node );
-
- }
-
- } );
-
- };
-
- function calculateLights( lights ) {
-
- _ambientLight.setRGB( 0, 0, 0 );
- _directionalLights.setRGB( 0, 0, 0 );
- _pointLights.setRGB( 0, 0, 0 );
-
- for ( var l = 0, ll = lights.length; l < ll; l ++ ) {
-
- var light = lights[ l ];
- var lightColor = light.color;
-
- if ( light.isAmbientLight ) {
-
- _ambientLight.r += lightColor.r;
- _ambientLight.g += lightColor.g;
- _ambientLight.b += lightColor.b;
-
- } else if ( light.isDirectionalLight ) {
-
- _directionalLights.r += lightColor.r;
- _directionalLights.g += lightColor.g;
- _directionalLights.b += lightColor.b;
-
- } else if ( light.isPointLight ) {
-
- _pointLights.r += lightColor.r;
- _pointLights.g += lightColor.g;
- _pointLights.b += lightColor.b;
-
- }
-
- }
-
- }
-
- function calculateLight( lights, position, normal, color ) {
-
- for ( var l = 0, ll = lights.length; l < ll; l ++ ) {
-
- var light = lights[ l ];
- var lightColor = light.color;
-
- if ( light.isDirectionalLight ) {
-
- var lightPosition = _vector3.setFromMatrixPosition( light.matrixWorld ).normalize();
-
- var amount = normal.dot( lightPosition );
-
- if ( amount <= 0 ) continue;
-
- amount *= light.intensity;
-
- color.r += lightColor.r * amount;
- color.g += lightColor.g * amount;
- color.b += lightColor.b * amount;
-
- } else if ( light.isPointLight ) {
-
- var lightPosition = _vector3.setFromMatrixPosition( light.matrixWorld );
-
- var amount = normal.dot( _vector3.subVectors( lightPosition, position ).normalize() );
-
- if ( amount <= 0 ) continue;
-
- amount *= light.distance == 0 ? 1 : 1 - Math.min( position.distanceTo( lightPosition ) / light.distance, 1 );
-
- if ( amount == 0 ) continue;
-
- amount *= light.intensity;
-
- color.r += lightColor.r * amount;
- color.g += lightColor.g * amount;
- color.b += lightColor.b * amount;
-
- }
-
- }
-
- }
-
- function renderSprite( v1, element, material ) {
-
- var scaleX = element.scale.x * _svgWidthHalf;
- var scaleY = element.scale.y * _svgHeightHalf;
-
- if ( material.isPointsMaterial ) {
-
- scaleX *= material.size;
- scaleY *= material.size;
-
- }
-
- var path = 'M' + convert( v1.x - scaleX * 0.5 ) + ',' + convert( v1.y - scaleY * 0.5 ) + 'h' + convert( scaleX ) + 'v' + convert( scaleY ) + 'h' + convert( - scaleX ) + 'z';
- var style = "";
-
- if ( material.isSpriteMaterial || material.isPointsMaterial ) {
-
- style = 'fill:' + getSvgColor( material.color, material.opacity );
-
- }
-
- addPath( style, path );
-
- }
-
- function renderLine( v1, v2, element, material ) {
-
- var path = 'M' + convert( v1.positionScreen.x ) + ',' + convert( v1.positionScreen.y ) + 'L' + convert( v2.positionScreen.x ) + ',' + convert( v2.positionScreen.y );
-
- if ( material.isLineBasicMaterial ) {
-
- var style = 'fill:none;stroke:' + getSvgColor( material.color, material.opacity ) + ';stroke-width:' + material.linewidth + ';stroke-linecap:' + material.linecap;
-
- if ( material.isLineDashedMaterial ) {
-
- style = style + ';stroke-dasharray:' + material.dashSize + "," + material.gapSize;
-
- }
-
- addPath( style, path );
-
- }
-
- }
-
- function renderFace3( v1, v2, v3, element, material ) {
-
- _this.info.render.vertices += 3;
- _this.info.render.faces ++;
-
- var path = 'M' + convert( v1.positionScreen.x ) + ',' + convert( v1.positionScreen.y ) + 'L' + convert( v2.positionScreen.x ) + ',' + convert( v2.positionScreen.y ) + 'L' + convert( v3.positionScreen.x ) + ',' + convert( v3.positionScreen.y ) + 'z';
- var style = '';
-
- if ( material.isMeshBasicMaterial ) {
-
- _color.copy( material.color );
-
- if ( material.vertexColors === THREE.FaceColors || material.vertexColors === THREE.VertexColors ) {
-
- _color.multiply( element.color );
-
- }
-
- } else if ( material.isMeshLambertMaterial || material.isMeshPhongMaterial || material.isMeshStandardMaterial ) {
-
- _diffuseColor.copy( material.color );
-
- if ( material.vertexColors === THREE.FaceColors || material.vertexColors === THREE.VertexColors ) {
-
- _diffuseColor.multiply( element.color );
-
- }
-
- _color.copy( _ambientLight );
-
- _centroid.copy( v1.positionWorld ).add( v2.positionWorld ).add( v3.positionWorld ).divideScalar( 3 );
-
- calculateLight( _lights, _centroid, element.normalModel, _color );
-
- _color.multiply( _diffuseColor ).add( material.emissive );
-
- } else if ( material.isMeshNormalMaterial ) {
-
- _normal.copy( element.normalModel ).applyMatrix3( _normalViewMatrix );
-
- _color.setRGB( _normal.x, _normal.y, _normal.z ).multiplyScalar( 0.5 ).addScalar( 0.5 );
-
- }
-
- if ( material.wireframe ) {
-
- style = 'fill:none;stroke:' + getSvgColor( _color, material.opacity ) + ';stroke-width:' + material.wireframeLinewidth + ';stroke-linecap:' + material.wireframeLinecap + ';stroke-linejoin:' + material.wireframeLinejoin;
-
- } else {
-
- style = 'fill:' + getSvgColor( _color, material.opacity );
-
- }
-
- addPath( style, path );
-
- }
-
- function addPath( style, path ) {
-
- if ( _currentStyle === style ) {
-
- _currentPath += path;
-
- } else {
-
- flushPath();
-
- _currentStyle = style;
- _currentPath = path;
-
- }
-
- }
-
- function flushPath() {
-
- if ( _currentPath ) {
-
- _svgNode = getPathNode( _pathCount ++ );
- _svgNode.setAttribute( 'd', _currentPath );
- _svgNode.setAttribute( 'style', _currentStyle );
- _svg.appendChild( _svgNode );
-
- }
-
- _currentPath = '';
- _currentStyle = '';
-
- }
-
- function getPathNode( id ) {
-
- if ( _svgPathPool[ id ] == null ) {
-
- _svgPathPool[ id ] = document.createElementNS( 'http://www.w3.org/2000/svg', 'path' );
-
- if ( _quality == 0 ) {
-
- _svgPathPool[ id ].setAttribute( 'shape-rendering', 'crispEdges' ); //optimizeSpeed
-
- }
-
- return _svgPathPool[ id ];
-
- }
-
- return _svgPathPool[ id ];
-
- }
-
-};
diff --git a/spaces/barani/ControlNet/cv_utils.py b/spaces/barani/ControlNet/cv_utils.py
deleted file mode 100644
index d81177c5eee306107966132fd54695545a61a898..0000000000000000000000000000000000000000
--- a/spaces/barani/ControlNet/cv_utils.py
+++ /dev/null
@@ -1,17 +0,0 @@
-import cv2
-import numpy as np
-
-
-def resize_image(input_image, resolution, interpolation=None):
- H, W, C = input_image.shape
- H = float(H)
- W = float(W)
- k = float(resolution) / max(H, W)
- H *= k
- W *= k
- H = int(np.round(H / 64.0)) * 64
- W = int(np.round(W / 64.0)) * 64
- if interpolation is None:
- interpolation = cv2.INTER_LANCZOS4 if k > 1 else cv2.INTER_AREA
- img = cv2.resize(input_image, (W, H), interpolation=interpolation)
- return img
diff --git a/spaces/beki/pii-anonymizer/README.md b/spaces/beki/pii-anonymizer/README.md
deleted file mode 100644
index fa7df580e7c1ff431f50fb69cca91a2d0188748b..0000000000000000000000000000000000000000
--- a/spaces/beki/pii-anonymizer/README.md
+++ /dev/null
@@ -1,13 +0,0 @@
----
-title: Presidio with custom PII models trained on PII data generated by Privy
-emoji: 📊
-colorFrom: purple
-colorTo: pink
-sdk: streamlit
-sdk_version: 1.10.0
-app_file: app.py
-pinned: false
-license: mit
----
-
-Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
diff --git a/spaces/bigjoker/stable-diffusion-webui/modules/hypernetworks/ui.py b/spaces/bigjoker/stable-diffusion-webui/modules/hypernetworks/ui.py
deleted file mode 100644
index be2fd77cc76a24d0e7932c6b1fb26efcb18edcc5..0000000000000000000000000000000000000000
--- a/spaces/bigjoker/stable-diffusion-webui/modules/hypernetworks/ui.py
+++ /dev/null
@@ -1,40 +0,0 @@
-import html
-import os
-import re
-
-import gradio as gr
-import modules.hypernetworks.hypernetwork
-from modules import devices, sd_hijack, shared
-
-not_available = ["hardswish", "multiheadattention"]
-keys = list(x for x in modules.hypernetworks.hypernetwork.HypernetworkModule.activation_dict.keys() if x not in not_available)
-
-
-def create_hypernetwork(name, enable_sizes, overwrite_old, layer_structure=None, activation_func=None, weight_init=None, add_layer_norm=False, use_dropout=False, dropout_structure=None):
- filename = modules.hypernetworks.hypernetwork.create_hypernetwork(name, enable_sizes, overwrite_old, layer_structure, activation_func, weight_init, add_layer_norm, use_dropout, dropout_structure)
-
- return gr.Dropdown.update(choices=sorted([x for x in shared.hypernetworks.keys()])), f"Created: {filename}", ""
-
-
-def train_hypernetwork(*args):
- shared.loaded_hypernetworks = []
-
- assert not shared.cmd_opts.lowvram, 'Training models with lowvram is not possible'
-
- try:
- sd_hijack.undo_optimizations()
-
- hypernetwork, filename = modules.hypernetworks.hypernetwork.train_hypernetwork(*args)
-
- res = f"""
-Training {'interrupted' if shared.state.interrupted else 'finished'} at {hypernetwork.step} steps.
-Hypernetwork saved to {html.escape(filename)}
-"""
- return res, ""
- except Exception:
- raise
- finally:
- shared.sd_model.cond_stage_model.to(devices.device)
- shared.sd_model.first_stage_model.to(devices.device)
- sd_hijack.apply_optimizations()
-
diff --git a/spaces/bioriAsaeru/text-to-voice/Acronis True Image 2016 19.0 Build 5634 Multilang Keygen.md b/spaces/bioriAsaeru/text-to-voice/Acronis True Image 2016 19.0 Build 5634 Multilang Keygen.md
deleted file mode 100644
index 2707d4722247cf89a9c5c3a1aa498612de86986e..0000000000000000000000000000000000000000
--- a/spaces/bioriAsaeru/text-to-voice/Acronis True Image 2016 19.0 Build 5634 Multilang Keygen.md
+++ /dev/null
@@ -1,18 +0,0 @@
-Acronis True Image 2016 19.0 Build 5634 Multilang keygen
DOWNLOAD ❤❤❤ https://urloso.com/2uyP0g
-
- . . and make it into a animation or. . . .. We hope you enjoy it!. The price of the license is $0.00 and you get a lifetime license. True Image 2016 19.0 Build 5634 Multilang Keygen Download: ( is a very popular video on our website. Well-known online community, you can also see this video in your facebook feed.. Watch this and many more video clips for free!.
-
-True Image 2016 19.0 Build 5634 Multilang Keygen Download: ( was added 2014-08-21 11:27:46 UTC by Dibba). This page was viewed 0 times today and 0 times today. Also true image 2016 19.0 build 5634 multilang keygen download is being added to Collections. FILED
-
- NOT FOR PUBLICATION JUN 12 2014
-
- MOLLY C. DWYER, CLERK
-
- UNITED STATES COURT OF APPEALS U.S. COURT OF APPEALS
-
- FOR THE NINTH CIRCUIT
-
-DAVID WILLIAM JOHNSON, Jr., 4fefd39f24
-
-
-
diff --git a/spaces/bioriAsaeru/text-to-voice/DEADSIDE PC Game Free Download.md b/spaces/bioriAsaeru/text-to-voice/DEADSIDE PC Game Free Download.md
deleted file mode 100644
index 8661dfb16f19158971862581b0790cd3f89d2771..0000000000000000000000000000000000000000
--- a/spaces/bioriAsaeru/text-to-voice/DEADSIDE PC Game Free Download.md
+++ /dev/null
@@ -1,6 +0,0 @@
-DEADSIDE PC Game Free Download
Download ➡ https://urloso.com/2uyQtm
-
-I'm more into the open world game like Rust but more with Tarkovish realism and reward. Also Rust ... apex is pretty sick with your friends ngl and its free also. 2 ... If not, any other essential gameplay-heavy games for PC you could recommend? ... We're going to download the game and have our first session this evening! 1fdad05405
-
-
-
diff --git a/spaces/bioriAsaeru/text-to-voice/Gsrld Dll Indir Gezginler.md b/spaces/bioriAsaeru/text-to-voice/Gsrld Dll Indir Gezginler.md
deleted file mode 100644
index 19cfd915aa511a259169b3cf7ded4da80abb46d2..0000000000000000000000000000000000000000
--- a/spaces/bioriAsaeru/text-to-voice/Gsrld Dll Indir Gezginler.md
+++ /dev/null
@@ -1,9 +0,0 @@
-
-how to install gsrld dll indir gezginler. bing results for “gsrld. dll”. this program offers the possibility to hide all drives and folders of the system. the program can be run from the installed folder or from the desktop. any necessary updates will be installed automatically. download gsrld. dll indir gezginler.
-Gsrld dll indir gezginler
Download ✒ https://urloso.com/2uyPYL
-annoyed at your boss and can’t get a transfer to start? then you need at least one of the following files: gsrld. dll, gsrld. dll. bin. download aids icon or gsrld. dll indir gezginler. he has played on the field, but this moment his competitive spirit is on the internet. however, in the days of the 90s, the main players of the computer games were really the gamers. the game is played in the form of a commander of military forces, from the beginning of the game. the game is played on the computer, and often consists of a story, in which a person has been captured by the enemy. search all. download. gsrld.
-diğer isimler. unzip gsrld dll indir gezginler sorma ve sadece indirim icin gsm gsm modem sigortum sisteminde sorulacak sorumlarda yapmanize gerekli değiller. diğer isimler. zip gsrld dll indir gezginler sorma ve sadece indirim icin gsm gsm modem sigortum sisteminde sorulacak sorumlarda yapmanize gerekli değiller. gsrld dll indir gezginler dll indir yanlisliklarindan dolayik. indirin adresine girdiğinizde bu değeri sorgulayiniz.
-gsrld dll indir gezginler klasörünüzde. download gsrld dll indir gezginler. dll, full gezginler ndir. this is a sony video editing software that has gained quite a lot of popularity in. dll gezginlere işlemek için herkes gibi, düşünüyorsanız gsrld dll indir gezginler. yükseltmesi veya eklemesi.
- 899543212b
-
-
\ No newline at end of file
diff --git a/spaces/bioriAsaeru/text-to-voice/Keygen Rar Recovery Toolbox Serial Key ((HOT)).md b/spaces/bioriAsaeru/text-to-voice/Keygen Rar Recovery Toolbox Serial Key ((HOT)).md
deleted file mode 100644
index 7407697e05c029911e7b961294cbf1d365185ea7..0000000000000000000000000000000000000000
--- a/spaces/bioriAsaeru/text-to-voice/Keygen Rar Recovery Toolbox Serial Key ((HOT)).md
+++ /dev/null
@@ -1,6 +0,0 @@
-Keygen Rar Recovery Toolbox Serial Key
Download File ✪✪✪ https://urloso.com/2uyP99
-
- aaccfb2cb3
-
-
-
diff --git a/spaces/blaziant/ysda_nlp_ops/README.md b/spaces/blaziant/ysda_nlp_ops/README.md
deleted file mode 100644
index 2711c63290304be1e522ddb8ab2a51bd6e915039..0000000000000000000000000000000000000000
--- a/spaces/blaziant/ysda_nlp_ops/README.md
+++ /dev/null
@@ -1,10 +0,0 @@
----
-title: Ysda Nlp Ops
-emoji: 📉
-colorFrom: gray
-colorTo: blue
-sdk: docker
-pinned: false
----
-
-Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
diff --git a/spaces/blmdsydm/faster-whisper-webui/README.md b/spaces/blmdsydm/faster-whisper-webui/README.md
deleted file mode 100644
index b530ec893be48ff9471257f74d7b03c524c8bfe4..0000000000000000000000000000000000000000
--- a/spaces/blmdsydm/faster-whisper-webui/README.md
+++ /dev/null
@@ -1,186 +0,0 @@
----
-title: Faster Whisper Webui
-emoji: 🚀
-colorFrom: indigo
-colorTo: blue
-sdk: gradio
-sdk_version: 3.23.0
-app_file: app.py
-pinned: false
-license: apache-2.0
-duplicated_from: aadnk/faster-whisper-webui
----
-
-Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
-
-# Running Locally
-
-To run this program locally, first install Python 3.9+ and Git. Then install Pytorch 10.1+ and all the other dependencies:
-```
-pip install -r requirements.txt
-```
-
-You can find detailed instructions for how to install this on Windows 10/11 [here (PDF)](docs/windows/install_win10_win11.pdf).
-
-Finally, run the full version (no audio length restrictions) of the app with parallel CPU/GPU enabled:
-```
-python app.py --input_audio_max_duration -1 --server_name 127.0.0.1 --auto_parallel True
-```
-
-You can also run the CLI interface, which is similar to Whisper's own CLI but also supports the following additional arguments:
-```
-python cli.py \
-[--vad {none,silero-vad,silero-vad-skip-gaps,silero-vad-expand-into-gaps,periodic-vad}] \
-[--vad_merge_window VAD_MERGE_WINDOW] \
-[--vad_max_merge_size VAD_MAX_MERGE_SIZE] \
-[--vad_padding VAD_PADDING] \
-[--vad_prompt_window VAD_PROMPT_WINDOW]
-[--vad_cpu_cores NUMBER_OF_CORES]
-[--vad_parallel_devices COMMA_DELIMITED_DEVICES]
-[--auto_parallel BOOLEAN]
-```
-In addition, you may also use URL's in addition to file paths as input.
-```
-python cli.py --model large --vad silero-vad --language Japanese "https://www.youtube.com/watch?v=4cICErqqRSM"
-```
-
-Rather than supplying arguments to `app.py` or `cli.py`, you can also use the configuration file [config.json5](config.json5). See that file for more information.
-If you want to use a different configuration file, you can use the `WHISPER_WEBUI_CONFIG` environment variable to specify the path to another file.
-
-### Multiple Files
-
-You can upload multiple files either through the "Upload files" option, or as a playlist on YouTube.
-Each audio file will then be processed in turn, and the resulting SRT/VTT/Transcript will be made available in the "Download" section.
-When more than one file is processed, the UI will also generate a "All_Output" zip file containing all the text output files.
-
-## Diarization
-
-To detect different speakers in the audio, you can use the [whisper-diarization](https://gitlab.com/aadnk/whisper-diarization) application.
-
-Download the JSON file after running Whisper on an audio file, and then run app.py in the
-whisper-diarization repository with the audio file and the JSON file as arguments.
-
-## Whisper Implementation
-
-You can choose between using `whisper` or `faster-whisper`. [Faster Whisper](https://github.com/guillaumekln/faster-whisper) as a drop-in replacement for the
-default Whisper which achieves up to a 4x speedup and 2x reduction in memory usage.
-
-You can install the requirements for a specific Whisper implementation in `requirements-fasterWhisper.txt`
-or `requirements-whisper.txt`:
-```
-pip install -r requirements-fasterWhisper.txt
-```
-And then run the App or the CLI with the `--whisper_implementation faster-whisper` flag:
-```
-python app.py --whisper_implementation faster-whisper --input_audio_max_duration -1 --server_name 127.0.0.1 --auto_parallel True
-```
-You can also select the whisper implementation in `config.json5`:
-```json5
-{
- "whisper_implementation": "faster-whisper"
-}
-```
-### GPU Acceleration
-
-In order to use GPU acceleration with Faster Whisper, both CUDA 11.2 and cuDNN 8 must be installed. You may want to install it in a virtual environment like Anaconda.
-
-## Google Colab
-
-You can also run this Web UI directly on [Google Colab](https://colab.research.google.com/drive/1qeTSvi7Bt_5RMm88ipW4fkcsMOKlDDss?usp=sharing), if you haven't got a GPU powerful enough to run the larger models.
-
-See the [colab documentation](docs/colab.md) for more information.
-
-## Parallel Execution
-
-You can also run both the Web-UI or the CLI on multiple GPUs in parallel, using the `vad_parallel_devices` option. This takes a comma-delimited list of
-device IDs (0, 1, etc.) that Whisper should be distributed to and run on concurrently:
-```
-python cli.py --model large --vad silero-vad --language Japanese \
---vad_parallel_devices 0,1 "https://www.youtube.com/watch?v=4cICErqqRSM"
-```
-
-Note that this requires a VAD to function properly, otherwise only the first GPU will be used. Though you could use `period-vad` to avoid taking the hit
-of running Silero-Vad, at a slight cost to accuracy.
-
-This is achieved by creating N child processes (where N is the number of selected devices), where Whisper is run concurrently. In `app.py`, you can also
-set the `vad_process_timeout` option. This configures the number of seconds until a process is killed due to inactivity, freeing RAM and video memory.
-The default value is 30 minutes.
-
-```
-python app.py --input_audio_max_duration -1 --vad_parallel_devices 0,1 --vad_process_timeout 3600
-```
-
-To execute the Silero VAD itself in parallel, use the `vad_cpu_cores` option:
-```
-python app.py --input_audio_max_duration -1 --vad_parallel_devices 0,1 --vad_process_timeout 3600 --vad_cpu_cores 4
-```
-
-You may also use `vad_process_timeout` with a single device (`--vad_parallel_devices 0`), if you prefer to always free video memory after a period of time.
-
-### Auto Parallel
-
-You can also set `auto_parallel` to `True`. This will set `vad_parallel_devices` to use all the GPU devices on the system, and `vad_cpu_cores` to be equal to the number of
-cores (up to 8):
-```
-python app.py --input_audio_max_duration -1 --auto_parallel True
-```
-
-# Docker
-
-To run it in Docker, first install Docker and optionally the NVIDIA Container Toolkit in order to use the GPU.
-Then either use the GitLab hosted container below, or check out this repository and build an image:
-```
-sudo docker build -t whisper-webui:1 .
-```
-
-You can then start the WebUI with GPU support like so:
-```
-sudo docker run -d --gpus=all -p 7860:7860 whisper-webui:1
-```
-
-Leave out "--gpus=all" if you don't have access to a GPU with enough memory, and are fine with running it on the CPU only:
-```
-sudo docker run -d -p 7860:7860 whisper-webui:1
-```
-
-# GitLab Docker Registry
-
-This Docker container is also hosted on GitLab:
-
-```
-sudo docker run -d --gpus=all -p 7860:7860 registry.gitlab.com/aadnk/whisper-webui:latest
-```
-
-## Custom Arguments
-
-You can also pass custom arguments to `app.py` in the Docker container, for instance to be able to use all the GPUs in parallel (replace administrator with your user):
-```
-sudo docker run -d --gpus all -p 7860:7860 \
---mount type=bind,source=/home/administrator/.cache/whisper,target=/root/.cache/whisper \
---mount type=bind,source=/home/administrator/.cache/huggingface,target=/root/.cache/huggingface \
---restart=on-failure:15 registry.gitlab.com/aadnk/whisper-webui:latest \
-app.py --input_audio_max_duration -1 --server_name 0.0.0.0 --auto_parallel True \
---default_vad silero-vad --default_model_name large
-```
-
-You can also call `cli.py` the same way:
-```
-sudo docker run --gpus all \
---mount type=bind,source=/home/administrator/.cache/whisper,target=/root/.cache/whisper \
---mount type=bind,source=/home/administrator/.cache/huggingface,target=/root/.cache/huggingface \
---mount type=bind,source=${PWD},target=/app/data \
-registry.gitlab.com/aadnk/whisper-webui:latest \
-cli.py --model large --auto_parallel True --vad silero-vad \
---output_dir /app/data /app/data/YOUR-FILE-HERE.mp4
-```
-
-## Caching
-
-Note that the models themselves are currently not included in the Docker images, and will be downloaded on the demand.
-To avoid this, bind the directory /root/.cache/whisper to some directory on the host (for instance /home/administrator/.cache/whisper), where you can (optionally)
-prepopulate the directory with the different Whisper models.
-```
-sudo docker run -d --gpus=all -p 7860:7860 \
---mount type=bind,source=/home/administrator/.cache/whisper,target=/root/.cache/whisper \
-registry.gitlab.com/aadnk/whisper-webui:latest
-```
\ No newline at end of file
diff --git a/spaces/bookbot/Grad-TTS-Weildan-Playground/Grad-TTS/hifi-gan/meldataset.py b/spaces/bookbot/Grad-TTS-Weildan-Playground/Grad-TTS/hifi-gan/meldataset.py
deleted file mode 100644
index 96c48f23122eb60f9fd0bb4f841d5545ad0489bc..0000000000000000000000000000000000000000
--- a/spaces/bookbot/Grad-TTS-Weildan-Playground/Grad-TTS/hifi-gan/meldataset.py
+++ /dev/null
@@ -1,170 +0,0 @@
-""" from https://github.com/jik876/hifi-gan """
-
-import math
-import os
-import random
-import torch
-import torch.utils.data
-import numpy as np
-from librosa.util import normalize
-from scipy.io.wavfile import read
-from librosa.filters import mel as librosa_mel_fn
-
-MAX_WAV_VALUE = 32768.0
-
-
-def load_wav(full_path):
- sampling_rate, data = read(full_path)
- return data, sampling_rate
-
-
-def dynamic_range_compression(x, C=1, clip_val=1e-5):
- return np.log(np.clip(x, a_min=clip_val, a_max=None) * C)
-
-
-def dynamic_range_decompression(x, C=1):
- return np.exp(x) / C
-
-
-def dynamic_range_compression_torch(x, C=1, clip_val=1e-5):
- return torch.log(torch.clamp(x, min=clip_val) * C)
-
-
-def dynamic_range_decompression_torch(x, C=1):
- return torch.exp(x) / C
-
-
-def spectral_normalize_torch(magnitudes):
- output = dynamic_range_compression_torch(magnitudes)
- return output
-
-
-def spectral_de_normalize_torch(magnitudes):
- output = dynamic_range_decompression_torch(magnitudes)
- return output
-
-
-mel_basis = {}
-hann_window = {}
-
-
-def mel_spectrogram(y, n_fft, num_mels, sampling_rate, hop_size, win_size, fmin, fmax, center=False):
- if torch.min(y) < -1.:
- print('min value is ', torch.min(y))
- if torch.max(y) > 1.:
- print('max value is ', torch.max(y))
-
- global mel_basis, hann_window
- if fmax not in mel_basis:
- mel = librosa_mel_fn(sampling_rate, n_fft, num_mels, fmin, fmax)
- mel_basis[str(fmax)+'_'+str(y.device)] = torch.from_numpy(mel).float().to(y.device)
- hann_window[str(y.device)] = torch.hann_window(win_size).to(y.device)
-
- y = torch.nn.functional.pad(y.unsqueeze(1), (int((n_fft-hop_size)/2), int((n_fft-hop_size)/2)), mode='reflect')
- y = y.squeeze(1)
-
- spec = torch.stft(y, n_fft, hop_length=hop_size, win_length=win_size, window=hann_window[str(y.device)],
- center=center, pad_mode='reflect', normalized=False, onesided=True)
-
- spec = torch.sqrt(spec.pow(2).sum(-1)+(1e-9))
-
- spec = torch.matmul(mel_basis[str(fmax)+'_'+str(y.device)], spec)
- spec = spectral_normalize_torch(spec)
-
- return spec
-
-
-def get_dataset_filelist(a):
- with open(a.input_training_file, 'r', encoding='utf-8') as fi:
- training_files = [os.path.join(a.input_wavs_dir, x.split('|')[0] + '.wav')
- for x in fi.read().split('\n') if len(x) > 0]
-
- with open(a.input_validation_file, 'r', encoding='utf-8') as fi:
- validation_files = [os.path.join(a.input_wavs_dir, x.split('|')[0] + '.wav')
- for x in fi.read().split('\n') if len(x) > 0]
- return training_files, validation_files
-
-
-class MelDataset(torch.utils.data.Dataset):
- def __init__(self, training_files, segment_size, n_fft, num_mels,
- hop_size, win_size, sampling_rate, fmin, fmax, split=True, shuffle=True, n_cache_reuse=1,
- device=None, fmax_loss=None, fine_tuning=False, base_mels_path=None):
- self.audio_files = training_files
- random.seed(1234)
- if shuffle:
- random.shuffle(self.audio_files)
- self.segment_size = segment_size
- self.sampling_rate = sampling_rate
- self.split = split
- self.n_fft = n_fft
- self.num_mels = num_mels
- self.hop_size = hop_size
- self.win_size = win_size
- self.fmin = fmin
- self.fmax = fmax
- self.fmax_loss = fmax_loss
- self.cached_wav = None
- self.n_cache_reuse = n_cache_reuse
- self._cache_ref_count = 0
- self.device = device
- self.fine_tuning = fine_tuning
- self.base_mels_path = base_mels_path
-
- def __getitem__(self, index):
- filename = self.audio_files[index]
- if self._cache_ref_count == 0:
- audio, sampling_rate = load_wav(filename)
- audio = audio / MAX_WAV_VALUE
- if not self.fine_tuning:
- audio = normalize(audio) * 0.95
- self.cached_wav = audio
- if sampling_rate != self.sampling_rate:
- raise ValueError("{} SR doesn't match target {} SR".format(
- sampling_rate, self.sampling_rate))
- self._cache_ref_count = self.n_cache_reuse
- else:
- audio = self.cached_wav
- self._cache_ref_count -= 1
-
- audio = torch.FloatTensor(audio)
- audio = audio.unsqueeze(0)
-
- if not self.fine_tuning:
- if self.split:
- if audio.size(1) >= self.segment_size:
- max_audio_start = audio.size(1) - self.segment_size
- audio_start = random.randint(0, max_audio_start)
- audio = audio[:, audio_start:audio_start+self.segment_size]
- else:
- audio = torch.nn.functional.pad(audio, (0, self.segment_size - audio.size(1)), 'constant')
-
- mel = mel_spectrogram(audio, self.n_fft, self.num_mels,
- self.sampling_rate, self.hop_size, self.win_size, self.fmin, self.fmax,
- center=False)
- else:
- mel = np.load(
- os.path.join(self.base_mels_path, os.path.splitext(os.path.split(filename)[-1])[0] + '.npy'))
- mel = torch.from_numpy(mel)
-
- if len(mel.shape) < 3:
- mel = mel.unsqueeze(0)
-
- if self.split:
- frames_per_seg = math.ceil(self.segment_size / self.hop_size)
-
- if audio.size(1) >= self.segment_size:
- mel_start = random.randint(0, mel.size(2) - frames_per_seg - 1)
- mel = mel[:, :, mel_start:mel_start + frames_per_seg]
- audio = audio[:, mel_start * self.hop_size:(mel_start + frames_per_seg) * self.hop_size]
- else:
- mel = torch.nn.functional.pad(mel, (0, frames_per_seg - mel.size(2)), 'constant')
- audio = torch.nn.functional.pad(audio, (0, self.segment_size - audio.size(1)), 'constant')
-
- mel_loss = mel_spectrogram(audio, self.n_fft, self.num_mels,
- self.sampling_rate, self.hop_size, self.win_size, self.fmin, self.fmax_loss,
- center=False)
-
- return (mel.squeeze(), audio.squeeze(0), filename, mel_loss.squeeze())
-
- def __len__(self):
- return len(self.audio_files)
diff --git a/spaces/brjathu/HMR2.0/vendor/detectron2/projects/DensePose/tests/test_video_keyframe_dataset.py b/spaces/brjathu/HMR2.0/vendor/detectron2/projects/DensePose/tests/test_video_keyframe_dataset.py
deleted file mode 100644
index 988e1616cdd30757157b479990050d1ca494ce7b..0000000000000000000000000000000000000000
--- a/spaces/brjathu/HMR2.0/vendor/detectron2/projects/DensePose/tests/test_video_keyframe_dataset.py
+++ /dev/null
@@ -1,98 +0,0 @@
-# Copyright (c) Facebook, Inc. and its affiliates.
-
-import contextlib
-import os
-import random
-import tempfile
-import unittest
-import torch
-import torchvision.io as io
-
-from densepose.data.transform import ImageResizeTransform
-from densepose.data.video import RandomKFramesSelector, VideoKeyframeDataset
-
-try:
- import av
-except ImportError:
- av = None
-
-
-# copied from torchvision test/test_io.py
-def _create_video_frames(num_frames, height, width):
- y, x = torch.meshgrid(torch.linspace(-2, 2, height), torch.linspace(-2, 2, width))
- data = []
- for i in range(num_frames):
- xc = float(i) / num_frames
- yc = 1 - float(i) / (2 * num_frames)
- d = torch.exp(-((x - xc) ** 2 + (y - yc) ** 2) / 2) * 255
- data.append(d.unsqueeze(2).repeat(1, 1, 3).byte())
- return torch.stack(data, 0)
-
-
-# adapted from torchvision test/test_io.py
-@contextlib.contextmanager
-def temp_video(num_frames, height, width, fps, lossless=False, video_codec=None, options=None):
- if lossless:
- if video_codec is not None:
- raise ValueError("video_codec can't be specified together with lossless")
- if options is not None:
- raise ValueError("options can't be specified together with lossless")
- video_codec = "libx264rgb"
- options = {"crf": "0"}
- if video_codec is None:
- video_codec = "libx264"
- if options is None:
- options = {}
- data = _create_video_frames(num_frames, height, width)
- with tempfile.NamedTemporaryFile(suffix=".mp4") as f:
- f.close()
- io.write_video(f.name, data, fps=fps, video_codec=video_codec, options=options)
- yield f.name, data
- os.unlink(f.name)
-
-
-@unittest.skipIf(av is None, "PyAV unavailable")
-class TestVideoKeyframeDataset(unittest.TestCase):
- def test_read_keyframes_all(self):
- with temp_video(60, 300, 300, 5, video_codec="mpeg4") as (fname, data):
- video_list = [fname]
- category_list = [None]
- dataset = VideoKeyframeDataset(video_list, category_list)
- self.assertEqual(len(dataset), 1)
- data1, categories1 = dataset[0]["images"], dataset[0]["categories"]
- self.assertEqual(data1.shape, torch.Size((5, 3, 300, 300)))
- self.assertEqual(data1.dtype, torch.float32)
- self.assertIsNone(categories1[0])
- return
- self.assertTrue(False)
-
- def test_read_keyframes_with_selector(self):
- with temp_video(60, 300, 300, 5, video_codec="mpeg4") as (fname, data):
- video_list = [fname]
- category_list = [None]
- random.seed(0)
- frame_selector = RandomKFramesSelector(3)
- dataset = VideoKeyframeDataset(video_list, category_list, frame_selector)
- self.assertEqual(len(dataset), 1)
- data1, categories1 = dataset[0]["images"], dataset[0]["categories"]
- self.assertEqual(data1.shape, torch.Size((3, 3, 300, 300)))
- self.assertEqual(data1.dtype, torch.float32)
- self.assertIsNone(categories1[0])
- return
- self.assertTrue(False)
-
- def test_read_keyframes_with_selector_with_transform(self):
- with temp_video(60, 300, 300, 5, video_codec="mpeg4") as (fname, data):
- video_list = [fname]
- category_list = [None]
- random.seed(0)
- frame_selector = RandomKFramesSelector(1)
- transform = ImageResizeTransform()
- dataset = VideoKeyframeDataset(video_list, category_list, frame_selector, transform)
- data1, categories1 = dataset[0]["images"], dataset[0]["categories"]
- self.assertEqual(len(dataset), 1)
- self.assertEqual(data1.shape, torch.Size((1, 3, 800, 800)))
- self.assertEqual(data1.dtype, torch.float32)
- self.assertIsNone(categories1[0])
- return
- self.assertTrue(False)
diff --git a/spaces/butterswords/nlc-explorer/.ipynb_checkpoints/NLselector-checkpoint.py b/spaces/butterswords/nlc-explorer/.ipynb_checkpoints/NLselector-checkpoint.py
deleted file mode 100644
index be67c9b309973af174a59ad6c9ef8619eb1f7c74..0000000000000000000000000000000000000000
--- a/spaces/butterswords/nlc-explorer/.ipynb_checkpoints/NLselector-checkpoint.py
+++ /dev/null
@@ -1,221 +0,0 @@
-#Import the libraries we know we'll need for the Generator.
-import pandas as pd, spacy, nltk, numpy as np, re
-from spacy.matcher import Matcher
-nlp = spacy.load("en_core_web_lg")
-import altair as alt
-import streamlit as st
-from annotated_text import annotated_text as ant
-
-#Import the libraries to support the model and predictions.
-from transformers import AutoTokenizer, AutoModelForSequenceClassification, TextClassificationPipeline
-import lime
-import torch
-import torch.nn.functional as F
-from lime.lime_text import LimeTextExplainer
-
-#Import WNgen.py
-from WNgen import *
-
-class_names = ['negative', 'positive']
-explainer = LimeTextExplainer(class_names=class_names)
-tokenizer = AutoTokenizer.from_pretrained("distilbert-base-uncased-finetuned-sst-2-english")
-model = AutoModelForSequenceClassification.from_pretrained("distilbert-base-uncased-finetuned-sst-2-english")
-pipe = TextClassificationPipeline(model=model, tokenizer=tokenizer, return_all_scores=True)
-
-def predictor(texts):
- outputs = model(**tokenizer(texts, return_tensors="pt", padding=True))
- probas = F.softmax(outputs.logits, dim=1).detach().numpy()
- return probas
-
-@st.experimental_singleton
-def critical_words(document, options=False):
- '''This function is meant to select the critical part of a sentence. Critical, in this context means
- the part of the sentence that is either: A) a NOUN or PROPN from the correct entity group, B) a NOUN,
- C) a NOUN + ADJ combination, or D) ADJ and PROPN used to modify other NOUN tokens.
- It also checks this against what the model thinks is important if the user defines "options" as "LIME" or True.'''
- if type(document) is not spacy.tokens.doc.Doc:
- document = nlp(document)
- chunks = list(document.noun_chunks)
- pos_options = []
- lime_options = []
-
- #Identify what the model cares about.
- if options:
- #Run Lime Setup code
- exp = explainer.explain_instance(document.text, predictor, num_features=15, num_samples=2000)
- lime_results = exp.as_list()
- for feature in lime_results:
- lime_options.append(feature[0])
- lime_results = pd.DataFrame(lime_results, columns=["Word","Weight"])
-
- #Identify what we care about "parts of speech"
-
- # Here I am going to try to pick up pronouns, which are people, and Adjectival Compliments.
- for token in document:
- if (token.text not in pos_options) and ((token.text in lime_options) or (options == False)):
- #print(f"executed {token.text} with {token.pos_} and {token.dep_}") #QA
- if (token.pos_ in ["ADJ","PROPN"]) and (token.dep_ in ["compound", "amod"]) and (document[token.i - 1].dep_ in ["compound", "amod"]):
- compound = document[token.i - 1: token.i +1].text
- pos_options.append(compound)
- print(f'Added {compound} based on "amod" and "compound" adjectives.')
- elif (token.pos_ in ["NOUN"]) and (token.dep_ in ["compound", "amod", "conj"]) and (document[token.i - 1].dep_ in ["compound"]):
- compound = document[token.i - 1: token.i +1].text
- pos_options.append(compound)
- print(f'Added {compound} based on "amod" and "compound" and "conj" nouns.')
- elif (token.pos_ == "PROPN") and (token.dep_ in ["prep","amod"]):
- pos_options.append(token.text)
- print(f"Added '{token.text}' based on their adjectival state.")
- elif (token.pos_ == "ADJ") and (token.dep_ in ["acomp","conj","amod"]):
- pos_options.append(token.text)
- print(f"Added '{token.text}' based on their adjectival state.")
- elif (token.pos_ == "PRON") and (len(token.morph) !=0):
- if (token.morph.get("PronType") == "Prs"):
- pos_options.append(token.text)
- print(f"Added '{token.text}' because it's a human pronoun.")
-
- #Noun Chunks parsing
- for chunk in chunks:
- #The use of chunk[-1] is due to testing that it appears to always match the root
- root = chunk[-1]
- #This currently matches to a list I've created. I don't know the best way to deal with this so I'm leaving it as is for the moment.
- if root.ent_type_:
- cur_values = []
- if (len(chunk) > 1) and (chunk[-2].dep_ == "compound"):
- #creates the compound element of the noun
- compound = [x.text for x in chunk if x.dep_ == "compound"]
- print(f"This is the contents of {compound} and it is {all(elem in lime_options for elem in compound)} that all elements are present in {lime_options}.") #for QA
- #checks to see all elements in the compound are important to the model or use the compound if not checking importance.
- if (all(elem in lime_options for elem in cur_values) and (options is True)) or ((options is False)):
- #creates a span for the entirety of the compound noun and adds it to the list.
- span = -1 * (1 + len(compound))
- pos_options.append(chunk[span:].text)
- cur_values + [token.text for token in chunk if token.pos_ in ["ADJ","NOUN","PROPN"]]
- else:
- print(f"The elmenents in {compound} could not be added to the final list because they are not all relevant to the model.")
- else:
- cur_values = [token.text for token in chunk if (token.ent_type_) or (token.pos_ == "ADJ")]
- if (all(elem in lime_options for elem in cur_values) and (options is True)) or ((options is False)):
- pos_options.extend(cur_values)
- print(f"From {chunk.text}, {cur_values} added to pos_options due to entity recognition.") #for QA
- elif len(chunk) >= 1:
- cur_values = [token.text for token in chunk if token.pos_ in ["NOUN","ADJ","PROPN"]]
- if (all(elem in lime_options for elem in cur_values) and (options is True)) or ((options is False)):
- pos_options.extend(cur_values)
- print(f"From {chunk.text}, {cur_values} added to pos_options due to wildcard.") #for QA
- else:
- print(f"No options added for \'{chunk.text}\' ")
-
- pos_options = list(set(pos_options))
-
- if options:
- return pos_options, lime_results
- else:
- return pos_options
-
-# Return the Viz of elements critical to LIME.
-def lime_viz(df):
- if not isinstance(df, pd.DataFrame):
- df = pd.DataFrame(df, columns=["Word","Weight"])
- single_nearest = alt.selection_single(on='mouseover', nearest=True)
- viz = alt.Chart(df).encode(
- alt.X('Weight:Q', scale=alt.Scale(domain=(-1, 1))),
- alt.Y('Word:N', sort='x', axis=None),
- color=alt.Color("Weight", scale=alt.Scale(scheme='blueorange', domain=[0], type="threshold", range='diverging'), legend=None),
- tooltip = ("Word","Weight")
- ).mark_bar().properties(title ="Importance of individual words")
-
- text = viz.mark_text(
- fill="black",
- align='right',
- baseline='middle'
- ).encode(
- text='Word:N'
- )
- limeplot = alt.LayerChart(layer=[viz,text], width = 300).configure_axis(grid=False).configure_view(strokeWidth=0)
- return limeplot
-
-# Evaluate Predictions using the model and pipe.
-def eval_pred(text, return_all = False):
- '''A basic function for evaluating the prediction from the model and turning it into a visualization friendly number.'''
- preds = pipe(text)
- neg_score = -1 * preds[0][0]['score']
- sent_neg = preds[0][0]['label']
- pos_score = preds[0][1]['score']
- sent_pos = preds[0][1]['label']
- prediction = 0
- sentiment = ''
- if pos_score > abs(neg_score):
- prediction = pos_score
- sentiment = sent_pos
- elif abs(neg_score) > pos_score:
- prediction = neg_score
- sentiment = sent_neg
-
- if return_all:
- return prediction, sentiment
- else:
- return prediction
-
-def construct_nlexp(text,sentiment,probability):
- prob = str(np.round(100 * abs(probability),2))
- if sentiment == "NEGATIVE":
- color_sent = ant('The model predicts the sentiment of the sentence you provided is ', (sentiment, "-", "#FFA44F"), ' with a probability of ', (prob, "neg", "#FFA44F"),"%.")
- elif sentiment == "POSITIVE":
- color_sent = ant('The model predicts the sentiment of the sentence you provided is ', (sentiment, "+", "#50A9FF"), ' with a probability of ', (prob, "pos", "#50A9FF"),"%.")
- return color_sent
-
-def get_min_max(df, seed):
- '''This function provides the alternatives with the highest spaCy similarity scores and the lowest similarity scores. As similarity is based on vectorization of words and documents this may not be the best way to identify bias.
-
- text2 = Most Similar
- text3 = Least Similar'''
- maximum = df[df['similarity'] < .9999].similarity.max()
- text2 = df.loc[df['similarity'] == maximum, 'text'].iloc[0]
- minimum = df[df['similarity'] > .0001].similarity.min()
- text3 = df.loc[df['similarity'] == minimum, 'text'].iloc[0]
- return text2, text3
-
-# Inspired by https://stackoverflow.com/questions/17758023/return-rows-in-a-dataframe-closest-to-a-user-defined-number/17758115#17758115
-def abs_dif(df,seed):
- '''This function enables a user to identify the alternative that is closest to the seed and farthest from the seed should that be the what they wish to display.
-
- text2 = Nearest Prediction
- text3 = Farthest Prediction'''
- #seed = process_text(seed)
- target = df[df['Words'] == seed].pred.iloc[0]
- sub_df = df[df['Words'] != seed].reset_index()
- nearest_prediction = sub_df.pred[(sub_df.pred-target).abs().argsort()[:1]]
- farthest_prediction = sub_df.pred[(sub_df.pred-target).abs().argsort()[-1:]]
- text2 = sub_df.text.iloc[nearest_prediction.index[0]]
- text3 = sub_df.text.iloc[farthest_prediction.index[0]]
- return text2, text3
-
-#@st.experimental_singleton #I've enabled this to prevent it from triggering every time the code runs... which could get very messy
-def sampled_alts(df, seed, fixed=False):
- '''This function enables a user to select an alternate way of choosing which counterfactuals are shown for MultiNLC, MultiNLC + Lime, and VizNLC. If you use this then you are enabling random sampling over other options (ex. spaCy similarity scores, or absolute difference).
-
- Both samples are random.'''
- sub_df = df[df['Words'] != seed]
- if fixed:
- sample = sub_df.sample(n=2, random_state = 2052)
- else:
- sample = sub_df.sample(n=2)
- text2 = sample.text.iloc[0]
- text3 = sample.text.iloc[1]
- return text2, text3
-
-def gen_cf_country(df,_document,selection):
- df['text'] = df.Words.apply(lambda x: re.sub(r'\b'+selection+r'\b',x,_document.text))
- df['pred'] = df.text.apply(eval_pred)
- df['seed'] = df.Words.apply(lambda x: 'seed' if x == selection else 'alternative')
- df['similarity'] = df.Words.apply(lambda x: nlp(selection).similarity(nlp(x)))
- return df
-
-def gen_cf_profession(df,_document,selection):
- category = df.loc[df['Words'] == selection, 'Major'].iloc[0]
- df = df[df.Major == category]
- df['text'] = df.Words.apply(lambda x: re.sub(r'\b'+selection+r'\b',x,_document.text))
- df['pred'] = df.text.apply(eval_pred)
- df['seed'] = df.Words.apply(lambda x: 'seed' if x == selection else 'alternative')
- df['similarity'] = df.Words.apply(lambda x: nlp(selection).similarity(nlp(x)))
- return df
\ No newline at end of file
diff --git a/spaces/cahodk/live-ml5-facemesh-p5js/sketch.js b/spaces/cahodk/live-ml5-facemesh-p5js/sketch.js
deleted file mode 100644
index d4078f8fd0f91f51932d52b1b82f835182184d50..0000000000000000000000000000000000000000
--- a/spaces/cahodk/live-ml5-facemesh-p5js/sketch.js
+++ /dev/null
@@ -1,47 +0,0 @@
-let facemesh;
-let video;
-let predictions = [];
-
-function setup() {
- createCanvas(640, 480);
- video = createCapture(VIDEO);
- video.size(width, height);
-
- facemesh = ml5.facemesh(video, modelReady);
-
- // This sets up an event that fills the global variable "predictions"
- // with an array every time new predictions are made
- facemesh.on("predict", results => {
- predictions = results;
- });
-
- // Hide the video element, and just show the canvas
- video.hide();
-}
-
-function modelReady() {
- console.log("Model ready!");
-}
-
-function draw() {
- background(0)
- image(video, 0, 0, width, height);
-
- // We can call both functions to draw all keypoints
- drawKeypoints();
-}
-
-// A function to draw ellipses over the detected keypoints
-function drawKeypoints() {
- for (let i = 0; i < predictions.length; i += 1) {
- const keypoints = predictions[i].scaledMesh;
-
- // Draw facial keypoints.
- for (let j = 0; j < keypoints.length; j += 1) {
- const [x, y] = keypoints[j];
-
- fill(0, 255, 0);
- ellipse(x, y, 5, 5);
- }
- }
-}
\ No newline at end of file
diff --git a/spaces/camel-ai/camel-data-explorer/apps/data_explorer/data_explorer.py b/spaces/camel-ai/camel-data-explorer/apps/data_explorer/data_explorer.py
deleted file mode 100644
index 62875f3b50be0114882fbf9289c2df1ef6eafe5f..0000000000000000000000000000000000000000
--- a/spaces/camel-ai/camel-data-explorer/apps/data_explorer/data_explorer.py
+++ /dev/null
@@ -1,349 +0,0 @@
-# =========== Copyright 2023 @ CAMEL-AI.org. 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.
-# 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.
-# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========
-"""
-Gradio-based web UI to explore the Camel dataset.
-"""
-
-import argparse
-import random
-from typing import Dict, List, Optional, Tuple
-
-import gradio as gr
-
-from apps.data_explorer.loader import Datasets, load_datasets
-
-
-def parse_arguments():
- """ Get command line arguments. """
-
- parser = argparse.ArgumentParser("Camel data explorer")
- parser.add_argument(
- '--data-path', type=str, default=None,
- help='Path to the folder with ZIP datasets containing JSONs')
- parser.add_argument('--default-dataset', type=str, default=None,
- help='Default dataset name selected from ZIPs')
- parser.add_argument('--share', type=bool, default=False,
- help='Expose the web UI to Gradio')
- parser.add_argument(
- '--server-name', type=str, default="0.0.0.0",
- help='localhost for local, 0.0.0.0 (default) for public')
- parser.add_argument('--server-port', type=int, default=8080,
- help='Port ot run the web page on')
- parser.add_argument('--inbrowser', type=bool, default=False,
- help='Open the web UI in the default browser on lunch')
- parser.add_argument(
- '--concurrency-count', type=int, default=10,
- help='Number if concurrent threads at Gradio websocket queue. ' +
- 'Increase to serve more requests but keep an eye on RAM usage.')
- args, unknown = parser.parse_known_args()
- if len(unknown) > 0:
- print("Unknown args: ", unknown)
- return args
-
-
-def construct_ui(blocks, datasets: Datasets,
- default_dataset: Optional[str] = None):
- """ Build Gradio UI and populate with chat data from JSONs.
-
- Args:
- blocks: Gradio blocks
- datasets (Datasets): Several parsed
- multi-JSON dataset with chats.
- default_dataset (str): Default selection of the dataset.
-
- Returns:
- None
- """
-
- if default_dataset is None:
- default_dataset = "ai_society_chat"
-
- misalignment_set_names = {"misalignment"}
- ordinary_datasets = [
- v for v in datasets.keys() if v not in misalignment_set_names
- ]
- misalignment_datasets = [
- v for v in datasets.keys() if v in misalignment_set_names
- ]
- default_dataset_name = default_dataset \
- if default_dataset in datasets.keys() \
- else ordinary_datasets[0] if len(ordinary_datasets) > 0 \
- else misalignment_datasets[0] if len(misalignment_datasets) > 0 \
- else ""
- dataset_names = list(datasets.keys())
-
- with gr.Row().style():
- with gr.Column(scale=2):
- with gr.Row():
- dataset_dd = gr.Dropdown(dataset_names, label="Select dataset",
- value="NODEFAULT", interactive=True)
- with gr.Row():
- disclaimer_ta = gr.Markdown(
- "## By clicking AGREE I consent to use the dataset "
- "for purely educational and academic purposes and "
- "not use it for any fraudulent activity; and I take "
- "all the responsibility if the data is used in a "
- "malicious application.", visible=False)
- with gr.Row():
- with gr.Column(scale=1):
- accept_disclaimer_bn = gr.Button("AGREE", visible=False)
- with gr.Column(scale=1):
- decline_disclaimer_bn = gr.Button("DECLINE", visible=False)
- with gr.Row():
- with gr.Column(scale=3):
- assistant_dd = gr.Dropdown([], label="ASSISTANT", value="",
- interactive=True)
- with gr.Column(scale=3):
- user_dd = gr.Dropdown([], label="USER", value="",
- interactive=True)
- with gr.Column(scale=1):
- gr.Markdown(
- "## CAMEL: Communicative Agents for \"Mind\" Exploration"
- " of Large Scale Language Model Society\n"
- "Github repo: [https://github.com/lightaime/camel]"
- "(https://github.com/lightaime/camel)\n"
- ''
- '
'
- '')
-
- task_dd = gr.Dropdown([], label="Original task", value="",
- interactive=True)
- specified_task_ta = gr.TextArea(label="Specified task", lines=2)
- chatbot = gr.Chatbot()
- accepted_st = gr.State(False)
-
- def set_default_dataset() -> Dict:
- """ Trigger for app load.
-
- Returns:
- Dict: Update dict for dataset_dd.
- """
- return gr.update(value=default_dataset_name)
-
- def check_if_misalignment(dataset_name: str, accepted: bool) \
- -> Tuple[Dict, Dict, Dict]:
- """ Display AGREE/DECLINE if needed.
-
- Returns:
- Tuple: Visibility updates for the buttons.
- """
-
- if dataset_name == "misalignment" and not accepted:
- return gr.update(visible=True), \
- gr.update(visible=True), gr.update(visible=True)
- else:
- return gr.update(visible=False), \
- gr.update(visible=False), gr.update(visible=False)
-
- def enable_misalignment() -> Tuple[bool, Dict, Dict, Dict]:
- """ Update the state of the accepted disclaimer.
-
- Returns:
- Tuple: New state and visibility updates for the buttons.
- """
-
- return True, gr.update(visible=False), \
- gr.update(visible=False), gr.update(visible=False)
-
- def disable_misalignment() -> Tuple[bool, Dict, Dict, Dict]:
- """ Update the state of the accepted disclaimer.
-
- Returns:
- Tuple: New state and visibility updates for the buttons.
- """
-
- return False, gr.update(visible=False), \
- gr.update(visible=False), gr.update(visible=False)
-
- def update_dataset_selection(dataset_name: str,
- accepted: bool) -> Tuple[Dict, Dict]:
- """ Update roles based on the selected dataset.
-
- Args:
- dataset_name (str): Name of the loaded .zip dataset.
- accepted (bool): If the disclaimer thas been accepted.
-
- Returns:
- Tuple[Dict, Dict]: New Assistant and User roles.
- """
-
- if dataset_name == "misalignment" and not accepted:
- # If used did not accept the misalignment policy,
- # keep the old selection.
- return (gr.update(value="N/A",
- choices=[]), gr.update(value="N/A", choices=[]))
-
- dataset = datasets[dataset_name]
- assistant_roles = dataset['assistant_roles']
- user_roles = dataset['user_roles']
- assistant_role = random.choice(assistant_roles) \
- if len(assistant_roles) > 0 else ""
- user_role = random.choice(user_roles) if len(user_roles) > 0 else ""
- return (gr.update(value=assistant_role, choices=assistant_roles),
- gr.update(value=user_role, choices=user_roles))
-
- def roles_dd_change(dataset_name: str, assistant_role: str,
- user_role: str) -> Dict:
- """ Update the displayed chat upon inputs change.
-
- Args:
- assistant_role (str): Assistant dropdown value.
- user_role (str): User dropdown value.
-
- Returns:
- Dict: New original roles state dictionary.
- """
- matrix = datasets[dataset_name]['matrix']
- if (assistant_role, user_role) in matrix:
- record: Dict[str, Dict] = matrix[(assistant_role, user_role)]
- original_task_options = list(record.keys())
- original_task = original_task_options[0]
- else:
- original_task = "N/A"
- original_task_options = []
-
- choices = gr.Dropdown.update(choices=original_task_options,
- value=original_task, interactive=True)
- return choices
-
- def build_chat_history(messages: Dict[int, Dict]) -> List[Tuple]:
- """ Structures chatbot contents from the loaded data.
-
- Args:
- messages (Dict[int, Dict]): Messages loaded from JSON.
-
- Returns:
- List[Tuple]: Chat history in chatbot UI element format.
- """
- history: List[Tuple] = []
- curr_qa = (None, None)
- for k in sorted(messages.keys()):
- msg = messages[k]
- content = msg['content']
- if msg['role_type'] == "USER":
- if curr_qa[0] is not None:
- history.append(curr_qa)
- curr_qa = (content, None)
- else:
- curr_qa = (content, None)
- elif msg['role_type'] == "ASSISTANT":
- curr_qa = (curr_qa[0], content)
- history.append(curr_qa)
- curr_qa = (None, None)
- else:
- pass
- return history
-
- def task_dd_change(dataset_name: str, assistant_role: str, user_role: str,
- original_task: str) -> Tuple[str, List]:
- """ Load task details and chatbot history into UI elements.
-
- Args:
- assistant_role (str): An assistan role.
- user_role (str): An user role.
- original_task (str): The original task.
-
- Returns:
- Tuple[str, List]: New contents of the specified task
- and chatbot history UI elements.
- """
-
- matrix = datasets[dataset_name]['matrix']
- if (assistant_role, user_role) in matrix:
- task_dict: Dict[str, Dict] = matrix[(assistant_role, user_role)]
- if original_task in task_dict:
- chat = task_dict[original_task]
- specified_task = chat['specified_task']
- history = build_chat_history(chat['messages'])
- else:
- specified_task = "N/A"
- history = []
- else:
- specified_task = "N/A"
- history = []
- return specified_task, history
-
- dataset_dd.change(check_if_misalignment, [dataset_dd, accepted_st],
- [disclaimer_ta, accept_disclaimer_bn,
- decline_disclaimer_bn]) \
- .then(update_dataset_selection,
- [dataset_dd, accepted_st],
- [assistant_dd, user_dd])
-
- accept_disclaimer_bn.click(enable_misalignment, None, [
- accepted_st, disclaimer_ta, accept_disclaimer_bn, decline_disclaimer_bn
- ]) \
- .then(update_dataset_selection,
- [dataset_dd, accepted_st],
- [assistant_dd, user_dd])
-
- decline_disclaimer_bn.click(disable_misalignment, None, [
- accepted_st, disclaimer_ta, accept_disclaimer_bn, decline_disclaimer_bn
- ]) \
- .then(update_dataset_selection,
- [dataset_dd, accepted_st],
- [assistant_dd, user_dd])
-
- func_args = (roles_dd_change, [dataset_dd, assistant_dd, user_dd], task_dd)
- assistant_dd.change(*func_args)
- user_dd.change(*func_args)
-
- task_dd.change(task_dd_change,
- [dataset_dd, assistant_dd, user_dd, task_dd],
- [specified_task_ta, chatbot])
-
- blocks.load(set_default_dataset, None, dataset_dd)
-
-
-def construct_blocks(data_path: str, default_dataset: Optional[str]):
- """ Construct Blocs app but do not launch it.
-
- Args:
- data_path (str): Path to the set of ZIP datasets.
- default_dataset (Optional[str]): Name of the default dataset,
- without extension.
-
- Returns:
- gr.Blocks: Blocks instance.
- """
-
- print("Loading the dataset...")
- datasets = load_datasets(data_path)
- print("Dataset is loaded")
-
- print("Getting Data Explorer web server online...")
-
- with gr.Blocks() as blocks:
- construct_ui(blocks, datasets, default_dataset)
-
- return blocks
-
-
-def main():
- """ Entry point. """
-
- args = parse_arguments()
-
- blocks = construct_blocks(args.data_path, args.default_dataset)
-
- blocks.queue(args.concurrency_count) \
- .launch(share=args.share, inbrowser=args.inbrowser,
- server_name=args.server_name, server_port=args.server_port)
-
- print("Exiting.")
-
-
-if __name__ == "__main__":
- main()
diff --git a/spaces/camillevanhoffelen/langchain-HuggingGPT/hugginggpt/llm_factory.py b/spaces/camillevanhoffelen/langchain-HuggingGPT/hugginggpt/llm_factory.py
deleted file mode 100644
index 01f1280e8c37fb04673f9ad88176487b8d78d22e..0000000000000000000000000000000000000000
--- a/spaces/camillevanhoffelen/langchain-HuggingGPT/hugginggpt/llm_factory.py
+++ /dev/null
@@ -1,82 +0,0 @@
-import logging
-from collections import namedtuple
-
-import tiktoken
-from langchain import OpenAI
-
-LLM_NAME = "text-davinci-003"
-# Encoding for text-davinci-003
-ENCODING_NAME = "p50k_base"
-ENCODING = tiktoken.get_encoding(ENCODING_NAME)
-# Max input tokens for text-davinci-003
-LLM_MAX_TOKENS = 4096
-
-# As specified in huggingGPT paper
-TASK_PLANNING_LOGIT_BIAS = 0.1
-MODEL_SELECTION_LOGIT_BIAS = 5
-
-logger = logging.getLogger(__name__)
-
-LLMs = namedtuple(
- "LLMs",
- [
- "task_planning_llm",
- "model_selection_llm",
- "model_inference_llm",
- "response_generation_llm",
- "output_fixing_llm",
- ],
-)
-
-
-def create_llms() -> LLMs:
- """Create various LLM agents according to the huggingGPT paper's specifications."""
- logger.info(f"Creating {LLM_NAME} LLMs")
-
- task_parsing_highlight_ids = get_token_ids_for_task_parsing()
- choose_model_highlight_ids = get_token_ids_for_choose_model()
-
- task_planning_llm = OpenAI(
- model_name=LLM_NAME,
- temperature=0,
- logit_bias={
- token_id: TASK_PLANNING_LOGIT_BIAS
- for token_id in task_parsing_highlight_ids
- },
- )
- model_selection_llm = OpenAI(
- model_name=LLM_NAME,
- temperature=0,
- logit_bias={
- token_id: MODEL_SELECTION_LOGIT_BIAS
- for token_id in choose_model_highlight_ids
- },
- )
- model_inference_llm = OpenAI(model_name=LLM_NAME, temperature=0)
- response_generation_llm = OpenAI(model_name=LLM_NAME, temperature=0)
- output_fixing_llm = OpenAI(model_name=LLM_NAME, temperature=0)
- return LLMs(
- task_planning_llm=task_planning_llm,
- model_selection_llm=model_selection_llm,
- model_inference_llm=model_inference_llm,
- response_generation_llm=response_generation_llm,
- output_fixing_llm=output_fixing_llm,
- )
-
-
-def get_token_ids_for_task_parsing() -> list[int]:
- text = """{"task": "text-classification", "token-classification", "text2text-generation", "summarization", "translation", "question-answering", "conversational", "text-generation", "sentence-similarity", "tabular-classification", "object-detection", "image-classification", "image-to-image", "image-to-text", "text-to-image", "visual-question-answering", "document-question-answering", "image-segmentation", "text-to-speech", "automatic-speech-recognition", "audio-to-audio", "audio-classification", "args", "text", "path", "dep", "id", "-"}"""
- res = ENCODING.encode(text)
- res = list(set(res))
- return res
-
-
-def get_token_ids_for_choose_model() -> list[int]:
- text = """{"id": "reason"}"""
- res = ENCODING.encode(text)
- res = list(set(res))
- return res
-
-
-def count_tokens(text: str) -> int:
- return len(ENCODING.encode(text))
diff --git a/spaces/carlosalonso/Detection-video/carpeta_deteccion/detectron2/layers/csrc/deformable/deform_conv.h b/spaces/carlosalonso/Detection-video/carpeta_deteccion/detectron2/layers/csrc/deformable/deform_conv.h
deleted file mode 100644
index 965c1bfd47b58f9802d1c3fd69a5962517b2da61..0000000000000000000000000000000000000000
--- a/spaces/carlosalonso/Detection-video/carpeta_deteccion/detectron2/layers/csrc/deformable/deform_conv.h
+++ /dev/null
@@ -1,377 +0,0 @@
-// Copyright (c) Facebook, Inc. and its affiliates.
-#pragma once
-#include
-
-namespace detectron2 {
-
-#if defined(WITH_CUDA) || defined(WITH_HIP)
-int deform_conv_forward_cuda(
- at::Tensor input,
- at::Tensor weight,
- at::Tensor offset,
- at::Tensor output,
- at::Tensor columns,
- at::Tensor ones,
- int kW,
- int kH,
- int dW,
- int dH,
- int padW,
- int padH,
- int dilationW,
- int dilationH,
- int group,
- int deformable_group,
- int im2col_step);
-
-int deform_conv_backward_input_cuda(
- at::Tensor input,
- at::Tensor offset,
- at::Tensor gradOutput,
- at::Tensor gradInput,
- at::Tensor gradOffset,
- at::Tensor weight,
- at::Tensor columns,
- int kW,
- int kH,
- int dW,
- int dH,
- int padW,
- int padH,
- int dilationW,
- int dilationH,
- int group,
- int deformable_group,
- int im2col_step);
-
-int deform_conv_backward_parameters_cuda(
- at::Tensor input,
- at::Tensor offset,
- at::Tensor gradOutput,
- at::Tensor gradWeight, // at::Tensor gradBias,
- at::Tensor columns,
- at::Tensor ones,
- int kW,
- int kH,
- int dW,
- int dH,
- int padW,
- int padH,
- int dilationW,
- int dilationH,
- int group,
- int deformable_group,
- float scale,
- int im2col_step);
-
-void modulated_deform_conv_cuda_forward(
- at::Tensor input,
- at::Tensor weight,
- at::Tensor bias,
- at::Tensor ones,
- at::Tensor offset,
- at::Tensor mask,
- at::Tensor output,
- at::Tensor columns,
- int kernel_h,
- int kernel_w,
- const int stride_h,
- const int stride_w,
- const int pad_h,
- const int pad_w,
- const int dilation_h,
- const int dilation_w,
- const int group,
- const int deformable_group,
- const bool with_bias);
-
-void modulated_deform_conv_cuda_backward(
- at::Tensor input,
- at::Tensor weight,
- at::Tensor bias,
- at::Tensor ones,
- at::Tensor offset,
- at::Tensor mask,
- at::Tensor columns,
- at::Tensor grad_input,
- at::Tensor grad_weight,
- at::Tensor grad_bias,
- at::Tensor grad_offset,
- at::Tensor grad_mask,
- at::Tensor grad_output,
- int kernel_h,
- int kernel_w,
- int stride_h,
- int stride_w,
- int pad_h,
- int pad_w,
- int dilation_h,
- int dilation_w,
- int group,
- int deformable_group,
- const bool with_bias);
-
-#endif
-
-inline int deform_conv_forward(
- at::Tensor input,
- at::Tensor weight,
- at::Tensor offset,
- at::Tensor output,
- at::Tensor columns,
- at::Tensor ones,
- int kW,
- int kH,
- int dW,
- int dH,
- int padW,
- int padH,
- int dilationW,
- int dilationH,
- int group,
- int deformable_group,
- int im2col_step) {
- if (input.is_cuda()) {
-#if defined(WITH_CUDA) || defined(WITH_HIP)
- TORCH_CHECK(weight.is_cuda(), "weight tensor is not on GPU!");
- TORCH_CHECK(offset.is_cuda(), "offset tensor is not on GPU!");
- return deform_conv_forward_cuda(
- input,
- weight,
- offset,
- output,
- columns,
- ones,
- kW,
- kH,
- dW,
- dH,
- padW,
- padH,
- dilationW,
- dilationH,
- group,
- deformable_group,
- im2col_step);
-#else
- AT_ERROR("Detectron2 is not compiled with GPU support!");
-#endif
- }
- AT_ERROR("This operator is not implemented on CPU");
-}
-
-inline int deform_conv_backward_input(
- at::Tensor input,
- at::Tensor offset,
- at::Tensor gradOutput,
- at::Tensor gradInput,
- at::Tensor gradOffset,
- at::Tensor weight,
- at::Tensor columns,
- int kW,
- int kH,
- int dW,
- int dH,
- int padW,
- int padH,
- int dilationW,
- int dilationH,
- int group,
- int deformable_group,
- int im2col_step) {
- if (gradOutput.is_cuda()) {
-#if defined(WITH_CUDA) || defined(WITH_HIP)
- TORCH_CHECK(input.is_cuda(), "input tensor is not on GPU!");
- TORCH_CHECK(weight.is_cuda(), "weight tensor is not on GPU!");
- TORCH_CHECK(offset.is_cuda(), "offset tensor is not on GPU!");
- return deform_conv_backward_input_cuda(
- input,
- offset,
- gradOutput,
- gradInput,
- gradOffset,
- weight,
- columns,
- kW,
- kH,
- dW,
- dH,
- padW,
- padH,
- dilationW,
- dilationH,
- group,
- deformable_group,
- im2col_step);
-#else
- AT_ERROR("Detectron2 is not compiled with GPU support!");
-#endif
- }
- AT_ERROR("This operator is not implemented on CPU");
-}
-
-inline int deform_conv_backward_filter(
- at::Tensor input,
- at::Tensor offset,
- at::Tensor gradOutput,
- at::Tensor gradWeight, // at::Tensor gradBias,
- at::Tensor columns,
- at::Tensor ones,
- int kW,
- int kH,
- int dW,
- int dH,
- int padW,
- int padH,
- int dilationW,
- int dilationH,
- int group,
- int deformable_group,
- float scale,
- int im2col_step) {
- if (gradOutput.is_cuda()) {
-#if defined(WITH_CUDA) || defined(WITH_HIP)
- TORCH_CHECK(input.is_cuda(), "input tensor is not on GPU!");
- TORCH_CHECK(offset.is_cuda(), "offset tensor is not on GPU!");
- return deform_conv_backward_parameters_cuda(
- input,
- offset,
- gradOutput,
- gradWeight,
- columns,
- ones,
- kW,
- kH,
- dW,
- dH,
- padW,
- padH,
- dilationW,
- dilationH,
- group,
- deformable_group,
- scale,
- im2col_step);
-#else
- AT_ERROR("Detectron2 is not compiled with GPU support!");
-#endif
- }
- AT_ERROR("This operator is not implemented on CPU");
-}
-
-inline void modulated_deform_conv_forward(
- at::Tensor input,
- at::Tensor weight,
- at::Tensor bias,
- at::Tensor ones,
- at::Tensor offset,
- at::Tensor mask,
- at::Tensor output,
- at::Tensor columns,
- int kernel_h,
- int kernel_w,
- const int stride_h,
- const int stride_w,
- const int pad_h,
- const int pad_w,
- const int dilation_h,
- const int dilation_w,
- const int group,
- const int deformable_group,
- const bool with_bias) {
- if (input.is_cuda()) {
-#if defined(WITH_CUDA) || defined(WITH_HIP)
- TORCH_CHECK(weight.is_cuda(), "weight tensor is not on GPU!");
- TORCH_CHECK(bias.is_cuda(), "bias tensor is not on GPU!");
- TORCH_CHECK(offset.is_cuda(), "offset tensor is not on GPU!");
- return modulated_deform_conv_cuda_forward(
- input,
- weight,
- bias,
- ones,
- offset,
- mask,
- output,
- columns,
- kernel_h,
- kernel_w,
- stride_h,
- stride_w,
- pad_h,
- pad_w,
- dilation_h,
- dilation_w,
- group,
- deformable_group,
- with_bias);
-#else
- AT_ERROR("Detectron2 is not compiled with GPU support!");
-#endif
- }
- AT_ERROR("This operator is not implemented on CPU");
-}
-
-inline void modulated_deform_conv_backward(
- at::Tensor input,
- at::Tensor weight,
- at::Tensor bias,
- at::Tensor ones,
- at::Tensor offset,
- at::Tensor mask,
- at::Tensor columns,
- at::Tensor grad_input,
- at::Tensor grad_weight,
- at::Tensor grad_bias,
- at::Tensor grad_offset,
- at::Tensor grad_mask,
- at::Tensor grad_output,
- int kernel_h,
- int kernel_w,
- int stride_h,
- int stride_w,
- int pad_h,
- int pad_w,
- int dilation_h,
- int dilation_w,
- int group,
- int deformable_group,
- const bool with_bias) {
- if (grad_output.is_cuda()) {
-#if defined(WITH_CUDA) || defined(WITH_HIP)
- TORCH_CHECK(input.is_cuda(), "input tensor is not on GPU!");
- TORCH_CHECK(weight.is_cuda(), "weight tensor is not on GPU!");
- TORCH_CHECK(bias.is_cuda(), "bias tensor is not on GPU!");
- TORCH_CHECK(offset.is_cuda(), "offset tensor is not on GPU!");
- return modulated_deform_conv_cuda_backward(
- input,
- weight,
- bias,
- ones,
- offset,
- mask,
- columns,
- grad_input,
- grad_weight,
- grad_bias,
- grad_offset,
- grad_mask,
- grad_output,
- kernel_h,
- kernel_w,
- stride_h,
- stride_w,
- pad_h,
- pad_w,
- dilation_h,
- dilation_w,
- group,
- deformable_group,
- with_bias);
-#else
- AT_ERROR("Detectron2 is not compiled with GPU support!");
-#endif
- }
- AT_ERROR("This operator is not implemented on CPU");
-}
-
-} // namespace detectron2
diff --git a/spaces/carlosalonso/Detection-video/carpeta_deteccion/detectron2/utils/memory.py b/spaces/carlosalonso/Detection-video/carpeta_deteccion/detectron2/utils/memory.py
deleted file mode 100644
index bd494780b9dbbd1571688cd270bb9b53d113c13e..0000000000000000000000000000000000000000
--- a/spaces/carlosalonso/Detection-video/carpeta_deteccion/detectron2/utils/memory.py
+++ /dev/null
@@ -1,84 +0,0 @@
-# Copyright (c) Facebook, Inc. and its affiliates.
-
-import logging
-from contextlib import contextmanager
-from functools import wraps
-import torch
-
-__all__ = ["retry_if_cuda_oom"]
-
-
-@contextmanager
-def _ignore_torch_cuda_oom():
- """
- A context which ignores CUDA OOM exception from pytorch.
- """
- try:
- yield
- except RuntimeError as e:
- # NOTE: the string may change?
- if "CUDA out of memory. " in str(e):
- pass
- else:
- raise
-
-
-def retry_if_cuda_oom(func):
- """
- Makes a function retry itself after encountering
- pytorch's CUDA OOM error.
- It will first retry after calling `torch.cuda.empty_cache()`.
-
- If that still fails, it will then retry by trying to convert inputs to CPUs.
- In this case, it expects the function to dispatch to CPU implementation.
- The return values may become CPU tensors as well and it's user's
- responsibility to convert it back to CUDA tensor if needed.
-
- Args:
- func: a stateless callable that takes tensor-like objects as arguments
-
- Returns:
- a callable which retries `func` if OOM is encountered.
-
- Examples:
- ::
- output = retry_if_cuda_oom(some_torch_function)(input1, input2)
- # output may be on CPU even if inputs are on GPU
-
- Note:
- 1. When converting inputs to CPU, it will only look at each argument and check
- if it has `.device` and `.to` for conversion. Nested structures of tensors
- are not supported.
-
- 2. Since the function might be called more than once, it has to be
- stateless.
- """
-
- def maybe_to_cpu(x):
- try:
- like_gpu_tensor = x.device.type == "cuda" and hasattr(x, "to")
- except AttributeError:
- like_gpu_tensor = False
- if like_gpu_tensor:
- return x.to(device="cpu")
- else:
- return x
-
- @wraps(func)
- def wrapped(*args, **kwargs):
- with _ignore_torch_cuda_oom():
- return func(*args, **kwargs)
-
- # Clear cache and retry
- torch.cuda.empty_cache()
- with _ignore_torch_cuda_oom():
- return func(*args, **kwargs)
-
- # Try on CPU. This slows down the code significantly, therefore print a notice.
- logger = logging.getLogger(__name__)
- logger.info("Attempting to copy inputs of {} to CPU due to CUDA OOM".format(str(func)))
- new_args = (maybe_to_cpu(x) for x in args)
- new_kwargs = {k: maybe_to_cpu(v) for k, v in kwargs.items()}
- return func(*new_args, **new_kwargs)
-
- return wrapped
diff --git a/spaces/chendl/compositional_test/multimodal/open_flamingo/eval/eval_datasets.py b/spaces/chendl/compositional_test/multimodal/open_flamingo/eval/eval_datasets.py
deleted file mode 100644
index 672cf9e0c94935d0d4574f689e499a0b51b777b5..0000000000000000000000000000000000000000
--- a/spaces/chendl/compositional_test/multimodal/open_flamingo/eval/eval_datasets.py
+++ /dev/null
@@ -1,101 +0,0 @@
-import json
-import os
-
-from PIL import Image
-from torch.utils.data import Dataset
-from torchvision.datasets import ImageFolder
-
-from open_flamingo.eval.imagenet_utils import IMAGENET_1K_CLASS_ID_TO_LABEL
-
-
-class COCOFlickrDataset(Dataset):
- def __init__(
- self,
- image_dir_path,
- annotations_path,
- is_flickr=False,
- ):
- self.image_dir_path = image_dir_path
- self.annotations = json.load(open(annotations_path))["annotations"]
- self.is_flickr = is_flickr
-
- def __len__(self):
- return len(self.annotations)
-
- def get_img_path(self, idx):
- if self.is_flickr:
- return f"{self.image_dir_path}/{self.annotations[idx]['image_id']}.jpg"
- else:
- return f"{self.image_dir_path}/{self.annotations[idx]['image_id']:012d}.jpg"
-
- def __getitem__(self, idx):
- image = Image.open(self.get_img_path(idx))
- caption = self.annotations[idx]["caption"]
- return {
- "image": image,
- "caption": caption,
- "image_id": self.annotations[idx]["image_id"],
- }
-
-
-class VQADataset(Dataset):
- def __init__(
- self,
- image_dir_path="/mmfs1/gscratch/efml/anasa2/data/vqav2/train2014/",
- question_path="/mmfs1/gscratch/efml/anasa2/data/vqav2/v2_OpenEnded_mscoco_train2014_questions.json",
- annotations_path="/mmfs1/gscratch/efml/anasa2/data/vqav2/v2_mscoco_train2014_annotations.json",
- vqa_dataset="vqa",
- ):
- self.questions = json.load(open(question_path, "r"))["questions"]
- self.answers = json.load(open(annotations_path, "r"))["annotations"]
- self.image_dir_path = image_dir_path
- self.vqa_dataset = vqa_dataset
-
- def __len__(self):
- return len(self.questions)
-
- def get_img_path(self, question):
- if self.vqa_dataset == "vqa":
- return os.path.join(
- self.image_dir_path, f"COCO_val2014_{question['image_id']:012d}.jpg"
- )
- elif self.vqa_dataset == "ok_vqa":
- return os.path.join(
- self.image_dir_path, f"COCO_val2014_{question['image_id']:012d}.jpg"
- )
- else:
- raise Exception(f"Unknown VQA dataset {self.vqa_dataset}")
-
- def __getitem__(self, idx):
- question = self.questions[idx]
- answers = self.answers[idx]
- img_path = self.get_img_path(question)
- image = Image.open(img_path)
- return {
- "image": image,
- "question": question["question"],
- "answers": [a["answer"] for a in answers["answers"]],
- "question_id": question["question_id"],
- }
-
-
-class ImageNetDataset(ImageFolder):
- """Class to represent the ImageNet1k dataset."""
-
- def __init__(self, root, **kwargs):
- super().__init__(root=root, **kwargs)
-
- def __getitem__(self, idx):
- sample, target = super().__getitem__(idx)
- target_label = IMAGENET_1K_CLASS_ID_TO_LABEL[target]
- return {
- "image": sample,
- "class_id": target, # numeric ID of the ImageNet class
- "class_name": target_label, # human-readable name of ImageNet class
- }
-
-
-if __name__ == "__main__":
- gqa_dataset = GQADataset()
- for sample in gqa_dataset:
- print(sample)
diff --git a/spaces/chendl/compositional_test/transformers/examples/legacy/run_swag.py b/spaces/chendl/compositional_test/transformers/examples/legacy/run_swag.py
deleted file mode 100644
index bde050168752650e8d1ab927273178f3648359c6..0000000000000000000000000000000000000000
--- a/spaces/chendl/compositional_test/transformers/examples/legacy/run_swag.py
+++ /dev/null
@@ -1,724 +0,0 @@
-#!/usr/bin/env python
-# coding=utf-8
-# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
-# Copyright (c) 2018, NVIDIA CORPORATION. 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.
-# 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.
-"""BERT finetuning runner.
- Finetuning the library models for multiple choice on SWAG (Bert).
-"""
-
-
-import argparse
-import csv
-import glob
-import logging
-import os
-import random
-
-import numpy as np
-import torch
-from torch.utils.data import DataLoader, RandomSampler, SequentialSampler, TensorDataset
-from torch.utils.data.distributed import DistributedSampler
-from tqdm import tqdm, trange
-
-import transformers
-from transformers import (
- WEIGHTS_NAME,
- AdamW,
- AutoConfig,
- AutoModelForMultipleChoice,
- AutoTokenizer,
- get_linear_schedule_with_warmup,
-)
-from transformers.trainer_utils import is_main_process
-
-
-try:
- from torch.utils.tensorboard import SummaryWriter
-except ImportError:
- from tensorboardX import SummaryWriter
-
-
-logger = logging.getLogger(__name__)
-
-
-class SwagExample(object):
- """A single training/test example for the SWAG dataset."""
-
- def __init__(self, swag_id, context_sentence, start_ending, ending_0, ending_1, ending_2, ending_3, label=None):
- self.swag_id = swag_id
- self.context_sentence = context_sentence
- self.start_ending = start_ending
- self.endings = [
- ending_0,
- ending_1,
- ending_2,
- ending_3,
- ]
- self.label = label
-
- def __str__(self):
- return self.__repr__()
-
- def __repr__(self):
- attributes = [
- "swag_id: {}".format(self.swag_id),
- "context_sentence: {}".format(self.context_sentence),
- "start_ending: {}".format(self.start_ending),
- "ending_0: {}".format(self.endings[0]),
- "ending_1: {}".format(self.endings[1]),
- "ending_2: {}".format(self.endings[2]),
- "ending_3: {}".format(self.endings[3]),
- ]
-
- if self.label is not None:
- attributes.append("label: {}".format(self.label))
-
- return ", ".join(attributes)
-
-
-class InputFeatures(object):
- def __init__(self, example_id, choices_features, label):
- self.example_id = example_id
- self.choices_features = [
- {"input_ids": input_ids, "input_mask": input_mask, "segment_ids": segment_ids}
- for _, input_ids, input_mask, segment_ids in choices_features
- ]
- self.label = label
-
-
-def read_swag_examples(input_file, is_training=True):
- with open(input_file, "r", encoding="utf-8") as f:
- lines = list(csv.reader(f))
-
- if is_training and lines[0][-1] != "label":
- raise ValueError("For training, the input file must contain a label column.")
-
- examples = [
- SwagExample(
- swag_id=line[2],
- context_sentence=line[4],
- start_ending=line[5], # in the swag dataset, the
- # common beginning of each
- # choice is stored in "sent2".
- ending_0=line[7],
- ending_1=line[8],
- ending_2=line[9],
- ending_3=line[10],
- label=int(line[11]) if is_training else None,
- )
- for line in lines[1:] # we skip the line with the column names
- ]
-
- return examples
-
-
-def convert_examples_to_features(examples, tokenizer, max_seq_length, is_training):
- """Loads a data file into a list of `InputBatch`s."""
-
- # Swag is a multiple choice task. To perform this task using Bert,
- # we will use the formatting proposed in "Improving Language
- # Understanding by Generative Pre-Training" and suggested by
- # @jacobdevlin-google in this issue
- # https://github.com/google-research/bert/issues/38.
- #
- # Each choice will correspond to a sample on which we run the
- # inference. For a given Swag example, we will create the 4
- # following inputs:
- # - [CLS] context [SEP] choice_1 [SEP]
- # - [CLS] context [SEP] choice_2 [SEP]
- # - [CLS] context [SEP] choice_3 [SEP]
- # - [CLS] context [SEP] choice_4 [SEP]
- # The model will output a single value for each input. To get the
- # final decision of the model, we will run a softmax over these 4
- # outputs.
- features = []
- for example_index, example in tqdm(enumerate(examples)):
- context_tokens = tokenizer.tokenize(example.context_sentence)
- start_ending_tokens = tokenizer.tokenize(example.start_ending)
-
- choices_features = []
- for ending_index, ending in enumerate(example.endings):
- # We create a copy of the context tokens in order to be
- # able to shrink it according to ending_tokens
- context_tokens_choice = context_tokens[:]
- ending_tokens = start_ending_tokens + tokenizer.tokenize(ending)
- # Modifies `context_tokens_choice` and `ending_tokens` in
- # place so that the total length is less than the
- # specified length. Account for [CLS], [SEP], [SEP] with
- # "- 3"
- _truncate_seq_pair(context_tokens_choice, ending_tokens, max_seq_length - 3)
-
- tokens = ["[CLS]"] + context_tokens_choice + ["[SEP]"] + ending_tokens + ["[SEP]"]
- segment_ids = [0] * (len(context_tokens_choice) + 2) + [1] * (len(ending_tokens) + 1)
-
- input_ids = tokenizer.convert_tokens_to_ids(tokens)
- input_mask = [1] * len(input_ids)
-
- # Zero-pad up to the sequence length.
- padding = [0] * (max_seq_length - len(input_ids))
- input_ids += padding
- input_mask += padding
- segment_ids += padding
-
- assert len(input_ids) == max_seq_length
- assert len(input_mask) == max_seq_length
- assert len(segment_ids) == max_seq_length
-
- choices_features.append((tokens, input_ids, input_mask, segment_ids))
-
- label = example.label
- if example_index < 5:
- logger.info("*** Example ***")
- logger.info("swag_id: {}".format(example.swag_id))
- for choice_idx, (tokens, input_ids, input_mask, segment_ids) in enumerate(choices_features):
- logger.info("choice: {}".format(choice_idx))
- logger.info("tokens: {}".format(" ".join(tokens)))
- logger.info("input_ids: {}".format(" ".join(map(str, input_ids))))
- logger.info("input_mask: {}".format(" ".join(map(str, input_mask))))
- logger.info("segment_ids: {}".format(" ".join(map(str, segment_ids))))
- if is_training:
- logger.info("label: {}".format(label))
-
- features.append(InputFeatures(example_id=example.swag_id, choices_features=choices_features, label=label))
-
- return features
-
-
-def _truncate_seq_pair(tokens_a, tokens_b, max_length):
- """Truncates a sequence pair in place to the maximum length."""
-
- # This is a simple heuristic which will always truncate the longer sequence
- # one token at a time. This makes more sense than truncating an equal percent
- # of tokens from each, since if one sequence is very short then each token
- # that's truncated likely contains more information than a longer sequence.
- while True:
- total_length = len(tokens_a) + len(tokens_b)
- if total_length <= max_length:
- break
- if len(tokens_a) > len(tokens_b):
- tokens_a.pop()
- else:
- tokens_b.pop()
-
-
-def accuracy(out, labels):
- outputs = np.argmax(out, axis=1)
- return np.sum(outputs == labels)
-
-
-def select_field(features, field):
- return [[choice[field] for choice in feature.choices_features] for feature in features]
-
-
-def set_seed(args):
- random.seed(args.seed)
- np.random.seed(args.seed)
- torch.manual_seed(args.seed)
- if args.n_gpu > 0:
- torch.cuda.manual_seed_all(args.seed)
-
-
-def load_and_cache_examples(args, tokenizer, evaluate=False, output_examples=False):
- if args.local_rank not in [-1, 0]:
- torch.distributed.barrier() # Make sure only the first process in distributed training process the dataset, and the others will use the cache
-
- # Load data features from cache or dataset file
- input_file = args.predict_file if evaluate else args.train_file
- cached_features_file = os.path.join(
- os.path.dirname(input_file),
- "cached_{}_{}_{}".format(
- "dev" if evaluate else "train",
- list(filter(None, args.model_name_or_path.split("/"))).pop(),
- str(args.max_seq_length),
- ),
- )
- if os.path.exists(cached_features_file) and not args.overwrite_cache and not output_examples:
- logger.info("Loading features from cached file %s", cached_features_file)
- features = torch.load(cached_features_file)
- else:
- logger.info("Creating features from dataset file at %s", input_file)
- examples = read_swag_examples(input_file)
- features = convert_examples_to_features(examples, tokenizer, args.max_seq_length, not evaluate)
-
- if args.local_rank in [-1, 0]:
- logger.info("Saving features into cached file %s", cached_features_file)
- torch.save(features, cached_features_file)
-
- if args.local_rank == 0:
- torch.distributed.barrier() # Make sure only the first process in distributed training process the dataset, and the others will use the cache
-
- # Convert to Tensors and build dataset
- all_input_ids = torch.tensor(select_field(features, "input_ids"), dtype=torch.long)
- all_input_mask = torch.tensor(select_field(features, "input_mask"), dtype=torch.long)
- all_segment_ids = torch.tensor(select_field(features, "segment_ids"), dtype=torch.long)
- all_label = torch.tensor([f.label for f in features], dtype=torch.long)
-
- if evaluate:
- dataset = TensorDataset(all_input_ids, all_input_mask, all_segment_ids, all_label)
- else:
- dataset = TensorDataset(all_input_ids, all_input_mask, all_segment_ids, all_label)
-
- if output_examples:
- return dataset, examples, features
- return dataset
-
-
-def train(args, train_dataset, model, tokenizer):
- """Train the model"""
- if args.local_rank in [-1, 0]:
- tb_writer = SummaryWriter()
-
- args.train_batch_size = args.per_gpu_train_batch_size * max(1, args.n_gpu)
- train_sampler = RandomSampler(train_dataset) if args.local_rank == -1 else DistributedSampler(train_dataset)
- train_dataloader = DataLoader(train_dataset, sampler=train_sampler, batch_size=args.train_batch_size)
-
- if args.max_steps > 0:
- t_total = args.max_steps
- args.num_train_epochs = args.max_steps // (len(train_dataloader) // args.gradient_accumulation_steps) + 1
- else:
- t_total = len(train_dataloader) // args.gradient_accumulation_steps * args.num_train_epochs
-
- # Prepare optimizer and schedule (linear warmup and decay)
- no_decay = ["bias", "LayerNorm.weight"]
- optimizer_grouped_parameters = [
- {
- "params": [p for n, p in model.named_parameters() if not any(nd in n for nd in no_decay)],
- "weight_decay": args.weight_decay,
- },
- {"params": [p for n, p in model.named_parameters() if any(nd in n for nd in no_decay)], "weight_decay": 0.0},
- ]
- optimizer = AdamW(optimizer_grouped_parameters, lr=args.learning_rate, eps=args.adam_epsilon)
- scheduler = get_linear_schedule_with_warmup(
- optimizer, num_warmup_steps=args.warmup_steps, num_training_steps=t_total
- )
- if args.fp16:
- try:
- from apex import amp
- except ImportError:
- raise ImportError("Please install apex from https://www.github.com/nvidia/apex to use fp16 training.")
- model, optimizer = amp.initialize(model, optimizer, opt_level=args.fp16_opt_level)
-
- # multi-gpu training (should be after apex fp16 initialization)
- if args.n_gpu > 1:
- model = torch.nn.DataParallel(model)
-
- # Distributed training (should be after apex fp16 initialization)
- if args.local_rank != -1:
- model = torch.nn.parallel.DistributedDataParallel(
- model, device_ids=[args.local_rank], output_device=args.local_rank, find_unused_parameters=True
- )
-
- # Train!
- logger.info("***** Running training *****")
- logger.info(" Num examples = %d", len(train_dataset))
- logger.info(" Num Epochs = %d", args.num_train_epochs)
- logger.info(" Instantaneous batch size per GPU = %d", args.per_gpu_train_batch_size)
- logger.info(
- " Total train batch size (w. parallel, distributed & accumulation) = %d",
- args.train_batch_size
- * args.gradient_accumulation_steps
- * (torch.distributed.get_world_size() if args.local_rank != -1 else 1),
- )
- logger.info(" Gradient Accumulation steps = %d", args.gradient_accumulation_steps)
- logger.info(" Total optimization steps = %d", t_total)
-
- global_step = 0
- tr_loss, logging_loss = 0.0, 0.0
- model.zero_grad()
- train_iterator = trange(int(args.num_train_epochs), desc="Epoch", disable=args.local_rank not in [-1, 0])
- set_seed(args) # Added here for reproductibility
- for _ in train_iterator:
- epoch_iterator = tqdm(train_dataloader, desc="Iteration", disable=args.local_rank not in [-1, 0])
- for step, batch in enumerate(epoch_iterator):
- model.train()
- batch = tuple(t.to(args.device) for t in batch)
- inputs = {
- "input_ids": batch[0],
- "attention_mask": batch[1],
- # 'token_type_ids': None if args.model_type == 'xlm' else batch[2],
- "token_type_ids": batch[2],
- "labels": batch[3],
- }
- # if args.model_type in ['xlnet', 'xlm']:
- # inputs.update({'cls_index': batch[5],
- # 'p_mask': batch[6]})
- outputs = model(**inputs)
- loss = outputs[0] # model outputs are always tuple in transformers (see doc)
-
- if args.n_gpu > 1:
- loss = loss.mean() # mean() to average on multi-gpu parallel (not distributed) training
- if args.gradient_accumulation_steps > 1:
- loss = loss / args.gradient_accumulation_steps
-
- if args.fp16:
- with amp.scale_loss(loss, optimizer) as scaled_loss:
- scaled_loss.backward()
- torch.nn.utils.clip_grad_norm_(amp.master_params(optimizer), args.max_grad_norm)
- else:
- loss.backward()
- torch.nn.utils.clip_grad_norm_(model.parameters(), args.max_grad_norm)
-
- tr_loss += loss.item()
- if (step + 1) % args.gradient_accumulation_steps == 0:
- optimizer.step()
- scheduler.step() # Update learning rate schedule
- model.zero_grad()
- global_step += 1
-
- if args.local_rank in [-1, 0] and args.logging_steps > 0 and global_step % args.logging_steps == 0:
- # Log metrics
- if (
- args.local_rank == -1 and args.evaluate_during_training
- ): # Only evaluate when single GPU otherwise metrics may not average well
- results = evaluate(args, model, tokenizer)
- for key, value in results.items():
- tb_writer.add_scalar("eval_{}".format(key), value, global_step)
- tb_writer.add_scalar("lr", scheduler.get_lr()[0], global_step)
- tb_writer.add_scalar("loss", (tr_loss - logging_loss) / args.logging_steps, global_step)
- logging_loss = tr_loss
-
- if args.local_rank in [-1, 0] and args.save_steps > 0 and global_step % args.save_steps == 0:
- # Save model checkpoint
- output_dir = os.path.join(args.output_dir, "checkpoint-{}".format(global_step))
- model_to_save = (
- model.module if hasattr(model, "module") else model
- ) # Take care of distributed/parallel training
- model_to_save.save_pretrained(output_dir)
- tokenizer.save_vocabulary(output_dir)
- torch.save(args, os.path.join(output_dir, "training_args.bin"))
- logger.info("Saving model checkpoint to %s", output_dir)
-
- if args.max_steps > 0 and global_step > args.max_steps:
- epoch_iterator.close()
- break
- if args.max_steps > 0 and global_step > args.max_steps:
- train_iterator.close()
- break
-
- if args.local_rank in [-1, 0]:
- tb_writer.close()
-
- return global_step, tr_loss / global_step
-
-
-def evaluate(args, model, tokenizer, prefix=""):
- dataset, examples, features = load_and_cache_examples(args, tokenizer, evaluate=True, output_examples=True)
-
- if not os.path.exists(args.output_dir) and args.local_rank in [-1, 0]:
- os.makedirs(args.output_dir)
-
- args.eval_batch_size = args.per_gpu_eval_batch_size * max(1, args.n_gpu)
- # Note that DistributedSampler samples randomly
- eval_sampler = SequentialSampler(dataset) if args.local_rank == -1 else DistributedSampler(dataset)
- eval_dataloader = DataLoader(dataset, sampler=eval_sampler, batch_size=args.eval_batch_size)
-
- # Eval!
- logger.info("***** Running evaluation {} *****".format(prefix))
- logger.info(" Num examples = %d", len(dataset))
- logger.info(" Batch size = %d", args.eval_batch_size)
-
- eval_loss, eval_accuracy = 0, 0
- nb_eval_steps, nb_eval_examples = 0, 0
-
- for batch in tqdm(eval_dataloader, desc="Evaluating"):
- model.eval()
- batch = tuple(t.to(args.device) for t in batch)
- with torch.no_grad():
- inputs = {
- "input_ids": batch[0],
- "attention_mask": batch[1],
- # 'token_type_ids': None if args.model_type == 'xlm' else batch[2] # XLM don't use segment_ids
- "token_type_ids": batch[2],
- "labels": batch[3],
- }
-
- # if args.model_type in ['xlnet', 'xlm']:
- # inputs.update({'cls_index': batch[4],
- # 'p_mask': batch[5]})
- outputs = model(**inputs)
- tmp_eval_loss, logits = outputs[:2]
- eval_loss += tmp_eval_loss.mean().item()
-
- logits = logits.detach().cpu().numpy()
- label_ids = inputs["labels"].to("cpu").numpy()
- tmp_eval_accuracy = accuracy(logits, label_ids)
- eval_accuracy += tmp_eval_accuracy
-
- nb_eval_steps += 1
- nb_eval_examples += inputs["input_ids"].size(0)
-
- eval_loss = eval_loss / nb_eval_steps
- eval_accuracy = eval_accuracy / nb_eval_examples
- result = {"eval_loss": eval_loss, "eval_accuracy": eval_accuracy}
-
- output_eval_file = os.path.join(args.output_dir, "eval_results.txt")
- with open(output_eval_file, "w") as writer:
- logger.info("***** Eval results *****")
- for key in sorted(result.keys()):
- logger.info("%s = %s", key, str(result[key]))
- writer.write("%s = %s\n" % (key, str(result[key])))
-
- return result
-
-
-def main():
- parser = argparse.ArgumentParser()
-
- # Required parameters
- parser.add_argument(
- "--train_file", default=None, type=str, required=True, help="SWAG csv for training. E.g., train.csv"
- )
- parser.add_argument(
- "--predict_file",
- default=None,
- type=str,
- required=True,
- help="SWAG csv for predictions. E.g., val.csv or test.csv",
- )
- parser.add_argument(
- "--model_name_or_path",
- default=None,
- type=str,
- required=True,
- help="Path to pretrained model or model identifier from huggingface.co/models",
- )
- parser.add_argument(
- "--output_dir",
- default=None,
- type=str,
- required=True,
- help="The output directory where the model checkpoints and predictions will be written.",
- )
-
- # Other parameters
- parser.add_argument(
- "--config_name", default="", type=str, help="Pretrained config name or path if not the same as model_name"
- )
- parser.add_argument(
- "--tokenizer_name",
- default="",
- type=str,
- help="Pretrained tokenizer name or path if not the same as model_name",
- )
- parser.add_argument(
- "--max_seq_length",
- default=384,
- type=int,
- help=(
- "The maximum total input sequence length after tokenization. Sequences "
- "longer than this will be truncated, and sequences shorter than this will be padded."
- ),
- )
- parser.add_argument("--do_train", action="store_true", help="Whether to run training.")
- parser.add_argument("--do_eval", action="store_true", help="Whether to run eval on the dev set.")
- parser.add_argument(
- "--evaluate_during_training", action="store_true", help="Rul evaluation during training at each logging step."
- )
-
- parser.add_argument("--per_gpu_train_batch_size", default=8, type=int, help="Batch size per GPU/CPU for training.")
- parser.add_argument(
- "--per_gpu_eval_batch_size", default=8, type=int, help="Batch size per GPU/CPU for evaluation."
- )
- parser.add_argument("--learning_rate", default=5e-5, type=float, help="The initial learning rate for Adam.")
- parser.add_argument(
- "--gradient_accumulation_steps",
- type=int,
- default=1,
- help="Number of updates steps to accumulate before performing a backward/update pass.",
- )
- parser.add_argument("--weight_decay", default=0.0, type=float, help="Weight deay if we apply some.")
- parser.add_argument("--adam_epsilon", default=1e-8, type=float, help="Epsilon for Adam optimizer.")
- parser.add_argument("--max_grad_norm", default=1.0, type=float, help="Max gradient norm.")
- parser.add_argument(
- "--num_train_epochs", default=3.0, type=float, help="Total number of training epochs to perform."
- )
- parser.add_argument(
- "--max_steps",
- default=-1,
- type=int,
- help="If > 0: set total number of training steps to perform. Override num_train_epochs.",
- )
- parser.add_argument("--warmup_steps", default=0, type=int, help="Linear warmup over warmup_steps.")
-
- parser.add_argument("--logging_steps", type=int, default=50, help="Log every X updates steps.")
- parser.add_argument("--save_steps", type=int, default=50, help="Save checkpoint every X updates steps.")
- parser.add_argument(
- "--eval_all_checkpoints",
- action="store_true",
- help="Evaluate all checkpoints starting with the same prefix as model_name ending and ending with step number",
- )
- parser.add_argument("--no_cuda", action="store_true", help="Whether not to use CUDA when available")
- parser.add_argument(
- "--overwrite_output_dir", action="store_true", help="Overwrite the content of the output directory"
- )
- parser.add_argument(
- "--overwrite_cache", action="store_true", help="Overwrite the cached training and evaluation sets"
- )
- parser.add_argument("--seed", type=int, default=42, help="random seed for initialization")
-
- parser.add_argument("--local_rank", type=int, default=-1, help="local_rank for distributed training on gpus")
- parser.add_argument(
- "--fp16",
- action="store_true",
- help="Whether to use 16-bit (mixed) precision (through NVIDIA apex) instead of 32-bit",
- )
- parser.add_argument(
- "--fp16_opt_level",
- type=str,
- default="O1",
- help=(
- "For fp16: Apex AMP optimization level selected in ['O0', 'O1', 'O2', and 'O3']."
- "See details at https://nvidia.github.io/apex/amp.html"
- ),
- )
- parser.add_argument("--server_ip", type=str, default="", help="Can be used for distant debugging.")
- parser.add_argument("--server_port", type=str, default="", help="Can be used for distant debugging.")
- args = parser.parse_args()
-
- if (
- os.path.exists(args.output_dir)
- and os.listdir(args.output_dir)
- and args.do_train
- and not args.overwrite_output_dir
- ):
- raise ValueError(
- "Output directory ({}) already exists and is not empty. Use --overwrite_output_dir to overcome.".format(
- args.output_dir
- )
- )
-
- # Setup distant debugging if needed
- if args.server_ip and args.server_port:
- # Distant debugging - see https://code.visualstudio.com/docs/python/debugging#_attach-to-a-local-script
- import ptvsd
-
- print("Waiting for debugger attach")
- ptvsd.enable_attach(address=(args.server_ip, args.server_port), redirect_output=True)
- ptvsd.wait_for_attach()
-
- # Setup CUDA, GPU & distributed training
- if args.local_rank == -1 or args.no_cuda:
- device = torch.device("cuda" if torch.cuda.is_available() and not args.no_cuda else "cpu")
- args.n_gpu = 0 if args.no_cuda else torch.cuda.device_count()
- else: # Initializes the distributed backend which will take care of sychronizing nodes/GPUs
- torch.cuda.set_device(args.local_rank)
- device = torch.device("cuda", args.local_rank)
- torch.distributed.init_process_group(backend="nccl")
- args.n_gpu = 1
- args.device = device
-
- # Setup logging
- logging.basicConfig(
- format="%(asctime)s - %(levelname)s - %(name)s - %(message)s",
- datefmt="%m/%d/%Y %H:%M:%S",
- level=logging.INFO if args.local_rank in [-1, 0] else logging.WARN,
- )
- logger.warning(
- "Process rank: %s, device: %s, n_gpu: %s, distributed training: %s, 16-bits training: %s",
- args.local_rank,
- device,
- args.n_gpu,
- bool(args.local_rank != -1),
- args.fp16,
- )
- # Set the verbosity to info of the Transformers logger (on main process only):
- if is_main_process(args.local_rank):
- transformers.utils.logging.set_verbosity_info()
- transformers.utils.logging.enable_default_handler()
- transformers.utils.logging.enable_explicit_format()
-
- # Set seed
- set_seed(args)
-
- # Load pretrained model and tokenizer
- if args.local_rank not in [-1, 0]:
- torch.distributed.barrier() # Make sure only the first process in distributed training will download model & vocab
-
- config = AutoConfig.from_pretrained(args.config_name if args.config_name else args.model_name_or_path)
- tokenizer = AutoTokenizer.from_pretrained(
- args.tokenizer_name if args.tokenizer_name else args.model_name_or_path,
- )
- model = AutoModelForMultipleChoice.from_pretrained(
- args.model_name_or_path, from_tf=bool(".ckpt" in args.model_name_or_path), config=config
- )
-
- if args.local_rank == 0:
- torch.distributed.barrier() # Make sure only the first process in distributed training will download model & vocab
-
- model.to(args.device)
-
- logger.info("Training/evaluation parameters %s", args)
-
- # Training
- if args.do_train:
- train_dataset = load_and_cache_examples(args, tokenizer, evaluate=False, output_examples=False)
- global_step, tr_loss = train(args, train_dataset, model, tokenizer)
- logger.info(" global_step = %s, average loss = %s", global_step, tr_loss)
-
- # Save the trained model and the tokenizer
- if args.local_rank == -1 or torch.distributed.get_rank() == 0:
- logger.info("Saving model checkpoint to %s", args.output_dir)
- # Save a trained model, configuration and tokenizer using `save_pretrained()`.
- # They can then be reloaded using `from_pretrained()`
- model_to_save = (
- model.module if hasattr(model, "module") else model
- ) # Take care of distributed/parallel training
- model_to_save.save_pretrained(args.output_dir)
- tokenizer.save_pretrained(args.output_dir)
-
- # Good practice: save your training arguments together with the trained model
- torch.save(args, os.path.join(args.output_dir, "training_args.bin"))
-
- # Load a trained model and vocabulary that you have fine-tuned
- model = AutoModelForMultipleChoice.from_pretrained(args.output_dir)
- tokenizer = AutoTokenizer.from_pretrained(args.output_dir)
- model.to(args.device)
-
- # Evaluation - we can ask to evaluate all the checkpoints (sub-directories) in a directory
- results = {}
- if args.do_eval and args.local_rank in [-1, 0]:
- if args.do_train:
- checkpoints = [args.output_dir]
- else:
- # if do_train is False and do_eval is true, load model directly from pretrained.
- checkpoints = [args.model_name_or_path]
-
- if args.eval_all_checkpoints:
- checkpoints = [
- os.path.dirname(c) for c in sorted(glob.glob(args.output_dir + "/**/" + WEIGHTS_NAME, recursive=True))
- ]
-
- logger.info("Evaluate the following checkpoints: %s", checkpoints)
-
- for checkpoint in checkpoints:
- # Reload the model
- global_step = checkpoint.split("-")[-1] if len(checkpoints) > 1 else ""
- model = AutoModelForMultipleChoice.from_pretrained(checkpoint)
- tokenizer = AutoTokenizer.from_pretrained(checkpoint)
- model.to(args.device)
-
- # Evaluate
- result = evaluate(args, model, tokenizer, prefix=global_step)
-
- result = {k + ("_{}".format(global_step) if global_step else ""): v for k, v in result.items()}
- results.update(result)
-
- logger.info("Results: {}".format(results))
-
- return results
-
-
-if __name__ == "__main__":
- main()
diff --git a/spaces/chenxx/ChuanhuChatGPT/chatgpt - windows.bat b/spaces/chenxx/ChuanhuChatGPT/chatgpt - windows.bat
deleted file mode 100644
index 0b78fdc3a559abd692e3a9e9af5e482124d13a99..0000000000000000000000000000000000000000
--- a/spaces/chenxx/ChuanhuChatGPT/chatgpt - windows.bat
+++ /dev/null
@@ -1,14 +0,0 @@
-@echo off
-echo Opening ChuanhuChatGPT...
-
-REM Open powershell via bat
-start powershell.exe -NoExit -Command "python ./ChuanhuChatbot.py"
-
-REM The web page can be accessed with delayed start http://127.0.0.1:7860/
-ping -n 5 127.0.0.1>nul
-
-REM access chargpt via your default browser
-start "" "http://127.0.0.1:7860/"
-
-
-echo Finished opening ChuanhuChatGPT (http://127.0.0.1:7860/).
\ No newline at end of file
diff --git a/spaces/christinac/text-decorator/README.md b/spaces/christinac/text-decorator/README.md
deleted file mode 100644
index f8cef19bdc16dd1fbfe0f488fffa51e1c521aa2f..0000000000000000000000000000000000000000
--- a/spaces/christinac/text-decorator/README.md
+++ /dev/null
@@ -1,12 +0,0 @@
----
-title: Text Decorator
-emoji: ✍🏻
-colorFrom: pink
-colorTo: yellow
-sdk: gradio
-sdk_version: 3.11.0
-app_file: app.py
-pinned: false
----
-
-Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
diff --git a/spaces/chuan-hd/law-assistant-chatbot/.venv/lib/python3.11/site-packages/functorch/dim/wrap_type.py b/spaces/chuan-hd/law-assistant-chatbot/.venv/lib/python3.11/site-packages/functorch/dim/wrap_type.py
deleted file mode 100644
index 8212836d3d6ae71f84dcb161b60bd513fe35b571..0000000000000000000000000000000000000000
--- a/spaces/chuan-hd/law-assistant-chatbot/.venv/lib/python3.11/site-packages/functorch/dim/wrap_type.py
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright (c) Facebook, Inc. and its affiliates.
-# All rights reserved.
-#
-# This source code is licensed under the BSD-style license found in the
-# LICENSE file in the root directory of this source tree.
-
-from types import FunctionType, BuiltinMethodType, MethodDescriptorType, WrapperDescriptorType, GetSetDescriptorType
-from functorch._C import dim as _C
-_wrap_method = _C._wrap_method
-
-FUNC_TYPES = (FunctionType, MethodDescriptorType, BuiltinMethodType, WrapperDescriptorType)
-PROPERTY_TYPES = (GetSetDescriptorType, property)
-
-def _py_wrap_method(orig, __torch_function__):
- def impl(*args, **kwargs):
- return __torch_function__(orig, None, args, kwargs)
- return impl
-
-
-
-def wrap_type(use_c, to_patch, pattern, __torch_function__):
-
- if use_c:
- wrap_method = _wrap_method
- else:
- wrap_method = _py_wrap_method
-
- all = {}
- for t in reversed(pattern.mro()[:-1]): # skip object
- all.update(t.__dict__)
-
-
- def wrap_attr(orig):
- return property(wrap_method(orig.__get__, __torch_function__))
-
-
- for name, obj in all.items():
- if name in ('__dict__', '__new__', '__init__', '__repr__', '__weakref__', '__doc__', '__module__', '__dir__'):
- continue
-
- # skip things that have been overloaded
- # things that come from object like `__eq__` still need to be patched, however.
- if hasattr(to_patch, name) and getattr(to_patch, name) is not getattr(object, name, None):
- continue
-
- if isinstance(obj, FUNC_TYPES):
- setattr(to_patch, name, wrap_method(obj, __torch_function__))
- elif isinstance(obj, PROPERTY_TYPES):
- setattr(to_patch, name, wrap_attr(obj))
diff --git a/spaces/cihyFjudo/fairness-paper-search/Hum Hai Raahi CAR Ke Dvdrip Movie Free Download.md b/spaces/cihyFjudo/fairness-paper-search/Hum Hai Raahi CAR Ke Dvdrip Movie Free Download.md
deleted file mode 100644
index 0fc62e958a16426b99ac90a887c38121d629fa76..0000000000000000000000000000000000000000
--- a/spaces/cihyFjudo/fairness-paper-search/Hum Hai Raahi CAR Ke Dvdrip Movie Free Download.md
+++ /dev/null
@@ -1,6 +0,0 @@
-Hum Hai Raahi CAR Ke dvdrip movie free download
Download File ✓ https://tinurli.com/2uwk7t
-
- aaccfb2cb3
-
-
-
diff --git a/spaces/cihyFjudo/fairness-paper-search/Kamagata Maru Full Movie Online 720p Torrent.md b/spaces/cihyFjudo/fairness-paper-search/Kamagata Maru Full Movie Online 720p Torrent.md
deleted file mode 100644
index 8ae87cf03b865fe09b58b08963ab8c8597433b83..0000000000000000000000000000000000000000
--- a/spaces/cihyFjudo/fairness-paper-search/Kamagata Maru Full Movie Online 720p Torrent.md
+++ /dev/null
@@ -1,6 +0,0 @@
-Kamagata Maru full movie online 720p torrent
Download Zip › https://tinurli.com/2uwitB
-
- aaccfb2cb3
-
-
-
diff --git a/spaces/cihyFjudo/fairness-paper-search/Kamasutrabookpdfinkannadafreedownload UPD.md b/spaces/cihyFjudo/fairness-paper-search/Kamasutrabookpdfinkannadafreedownload UPD.md
deleted file mode 100644
index 50a37f10eac9afc5f9173e5e0839fedc8a42693a..0000000000000000000000000000000000000000
--- a/spaces/cihyFjudo/fairness-paper-search/Kamasutrabookpdfinkannadafreedownload UPD.md
+++ /dev/null
@@ -1,6 +0,0 @@
-kamasutrabookpdfinkannadafreedownload
Download Zip ->>> https://tinurli.com/2uwiQ0
-
- aaccfb2cb3
-
-
-
diff --git a/spaces/cloudtheboi/Lofi4All/.pythonlibs/lib/python3.10/site-packages/fontTools/ttLib/tables/H_V_A_R_.py b/spaces/cloudtheboi/Lofi4All/.pythonlibs/lib/python3.10/site-packages/fontTools/ttLib/tables/H_V_A_R_.py
deleted file mode 100644
index 094aedaea5ebc5c88b33e448ea8f131563acd3c0..0000000000000000000000000000000000000000
--- a/spaces/cloudtheboi/Lofi4All/.pythonlibs/lib/python3.10/site-packages/fontTools/ttLib/tables/H_V_A_R_.py
+++ /dev/null
@@ -1,5 +0,0 @@
-from .otBase import BaseTTXConverter
-
-
-class table_H_V_A_R_(BaseTTXConverter):
- pass
diff --git a/spaces/colakin/video-generater/public/ffmpeg/libavcodec/dxva2.h b/spaces/colakin/video-generater/public/ffmpeg/libavcodec/dxva2.h
deleted file mode 100644
index 22c93992f22284c7e2ac92c5bf23faa3df6e6272..0000000000000000000000000000000000000000
--- a/spaces/colakin/video-generater/public/ffmpeg/libavcodec/dxva2.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * DXVA2 HW acceleration
- *
- * copyright (c) 2009 Laurent Aimar
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_DXVA2_H
-#define AVCODEC_DXVA2_H
-
-/**
- * @file
- * @ingroup lavc_codec_hwaccel_dxva2
- * Public libavcodec DXVA2 header.
- */
-
-#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0602
-#undef _WIN32_WINNT
-#define _WIN32_WINNT 0x0602
-#endif
-
-#include
-#include
-#include
-
-/**
- * @defgroup lavc_codec_hwaccel_dxva2 DXVA2
- * @ingroup lavc_codec_hwaccel
- *
- * @{
- */
-
-#define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for DXVA2 and old UVD/UVD+ ATI video cards
-#define FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO 2 ///< Work around for DXVA2 and old Intel GPUs with ClearVideo interface
-
-/**
- * This structure is used to provides the necessary configurations and data
- * to the DXVA2 FFmpeg HWAccel implementation.
- *
- * The application must make it available as AVCodecContext.hwaccel_context.
- */
-struct dxva_context {
- /**
- * DXVA2 decoder object
- */
- IDirectXVideoDecoder *decoder;
-
- /**
- * DXVA2 configuration used to create the decoder
- */
- const DXVA2_ConfigPictureDecode *cfg;
-
- /**
- * The number of surface in the surface array
- */
- unsigned surface_count;
-
- /**
- * The array of Direct3D surfaces used to create the decoder
- */
- LPDIRECT3DSURFACE9 *surface;
-
- /**
- * A bit field configuring the workarounds needed for using the decoder
- */
- uint64_t workaround;
-
- /**
- * Private to the FFmpeg AVHWAccel implementation
- */
- unsigned report_id;
-};
-
-/**
- * @}
- */
-
-#endif /* AVCODEC_DXVA2_H */
diff --git a/spaces/colakin/video-generater/public/ffmpeg/libavcodec/mips/h264chroma_init_mips.c b/spaces/colakin/video-generater/public/ffmpeg/libavcodec/mips/h264chroma_init_mips.c
deleted file mode 100644
index aa52d2a3ae43f6a9278ffc46563519c8e2b73ba3..0000000000000000000000000000000000000000
--- a/spaces/colakin/video-generater/public/ffmpeg/libavcodec/mips/h264chroma_init_mips.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2015 Zhou Xiaoyong
- * Copyright (c) 2015 Shivraj Patil (Shivraj.Patil@imgtec.com)
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/attributes.h"
-#include "libavutil/mips/cpu.h"
-#include "h264chroma_mips.h"
-
-
-av_cold void ff_h264chroma_init_mips(H264ChromaContext *c, int bit_depth)
-{
- int cpu_flags = av_get_cpu_flags();
- int high_bit_depth = bit_depth > 8;
-
- if (have_mmi(cpu_flags)) {
- if (!high_bit_depth) {
- c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_mmi;
- c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_mmi;
- c->put_h264_chroma_pixels_tab[1] = ff_put_h264_chroma_mc4_mmi;
- c->avg_h264_chroma_pixels_tab[1] = ff_avg_h264_chroma_mc4_mmi;
- }
- }
-
- if (have_msa(cpu_flags)) {
- if (!high_bit_depth) {
- c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_msa;
- c->put_h264_chroma_pixels_tab[1] = ff_put_h264_chroma_mc4_msa;
- c->put_h264_chroma_pixels_tab[2] = ff_put_h264_chroma_mc2_msa;
-
- c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_msa;
- c->avg_h264_chroma_pixels_tab[1] = ff_avg_h264_chroma_mc4_msa;
- c->avg_h264_chroma_pixels_tab[2] = ff_avg_h264_chroma_mc2_msa;
- }
- }
-}
diff --git a/spaces/congsaPfin/Manga-OCR/logs/Download and Install Sheep Dog N Wolf for PS1 - Easy Guide!.md b/spaces/congsaPfin/Manga-OCR/logs/Download and Install Sheep Dog N Wolf for PS1 - Easy Guide!.md
deleted file mode 100644
index 06cac193cd649e6c6404de0ec6309518c096c4d1..0000000000000000000000000000000000000000
--- a/spaces/congsaPfin/Manga-OCR/logs/Download and Install Sheep Dog N Wolf for PS1 - Easy Guide!.md
+++ /dev/null
@@ -1,142 +0,0 @@
-
-How to Download Sheep Dog n Wolf PS1
-Sheep Dog n Wolf PS1 is a fun and challenging game that puts you in the role of Ralph Wolf, a sneaky sheep stealer who has to outsmart Sam Sheepdog and other Looney Tunes characters in various environments. The game features clever puzzles, hilarious animations, and faithful recreations of the classic cartoons. If you are a fan of Looney Tunes or puzzle-platformer games, you will love Sheep Dog n Wolf PS1.
-But how can you play this game on your PC? The answer is simple: you need a PlayStation emulator. An emulator is a program that mimics the functions of a console and allows you to run games on your computer. By using an emulator, you can enjoy Sheep Dog n Wolf PS1 and other PS1 games on your PC with enhanced graphics, sound, and performance. You can also save your progress anytime, customize your controls, and access cheats and mods.
-download sheep dog n wolf ps1
Download File ❤❤❤ https://urlca.com/2uO4mm
-In this article, we will show you how to download Sheep Dog n Wolf PS1 on your PC using an emulator. We will also give you some tips and tricks for playing the game and having more fun. Let's get started!
- How to Download Sheep Dog n Wolf PS1
-To download Sheep Dog n Wolf PS1 on your PC, you need to follow these steps:
- Step 1: Choose a PS1 emulator
-The first thing you need to do is to choose a PS1 emulator that works on your PC. There are many emulators available online, but not all of them are reliable or compatible with every game. Here are some of the best PS1 emulators that we recommend:
-
-- ePSXe: This is one of the most popular and widely used emulators for PS1 games. It has a high compatibility rate, supports various plugins, and can play original PS1 discs as well as ROM files. You can download ePSXe from its official website.
-- PCSX Reloaded: This is another great emulator that is easy to configure and use. It also supports plugins, gamepads, and save states. You can download PCSX Reloaded from its download page.
-- RetroArch: This is not a standalone emulator but a collection of programs called cores that let you play games from different consoles. The PS1 core is called Beetle PSX, and it offers excellent emulation quality and performance. You can download RetroArch from its official website.
-
-Once you have chosen an emulator, download it and install it on your PC. You may also need to download a BIOS file for your emulator, which is a software that contains the basic instructions for booting up the console. You can find BIOS files online, but make sure they are legal and safe to use.
- Step 2: Download the game ROM or ISO file
-The next thing you need to do is to download the game ROM or ISO file for Sheep Dog n Wolf PS1. A ROM or ISO file is a digital copy of the game disc that contains all the data and information needed to run the game. You can find ROM or ISO files for Sheep Dog n Wolf PS1 on various websites that offer free or paid downloads of PS1 games. However, you should be careful when downloading ROM or ISO files, as some of them may be illegal, corrupted, or infected with malware. You should only download ROM or ISO files from trusted and reputable sources, and always scan them with an antivirus program before opening them.
-download sheep dog n wolf ps1 iso
-download sheep dog n wolf ps1 for android
-download sheep dog n wolf ps1 high compress
-download sheep dog n wolf ps1 rom
-download sheep dog n wolf ps1 game
-download sheep dog n wolf ps1 emulator
-download sheep dog n wolf ps1 eboot
-download sheep dog n wolf ps1 bin
-download sheep dog n wolf ps1 rar
-download sheep dog n wolf ps1 full version
-download sheep dog n wolf ps1 free
-download sheep dog n wolf ps1 online
-download sheep dog n wolf ps1 cheats
-download sheep dog n wolf ps1 walkthrough
-download sheep dog n wolf ps1 soundtrack
-download sheep dog n wolf ps1 pc
-download sheep dog n wolf ps1 windows 10
-download sheep dog n wolf ps1 mac
-download sheep dog n wolf ps1 linux
-download sheep dog n wolf ps1 apk
-download sheep dog n wolf ps1 epsxe
-download sheep dog n wolf ps1 ppsspp
-download sheep dog n wolf ps1 mednafen
-download sheep dog n wolf ps1 retroarch
-download sheep dog n wolf ps1 xebra
-download sheep dog n wolf ps1 english
-download sheep dog n wolf ps1 french
-download sheep dog n wolf ps1 german
-download sheep dog n wolf ps1 spanish
-download sheep dog n wolf ps1 italian
-download sheep dog n wolf ps1 portuguese
-download sheep dog n wolf ps1 dutch
-download sheep dog n wolf ps1 swedish
-download sheep dog n wolf ps1 norwegian
-download sheep dog n wolf ps1 finnish
-download sheep dog n wolf ps1 danish
-download sheep dog n wolf ps1 polish
-download sheep dog n wolf ps1 russian
-download sheep dog n wolf ps1 japanese
-download sheep dog n wolf ps1 korean
-download sheep dog n wolf ps1 chinese
-download sheep dog n wolf ps1 indonesian
-download sheep dog n wolf ps1 malay
-download sheep dog n wolf ps1 thai
-download sheep dog n wolf ps1 vietnamese
-download sheep dog n wolf ps1 turkish
-download sheep dog n wolf ps1 arabic
-download sheep dog n wolf ps1 hindi
-One of the best websites to download Sheep Dog n Wolf PS1 ROM or ISO file is CoolROM. This website has a large collection of PS1 games that you can download for free and safely. To download Sheep Dog n Wolf PS1 from CoolROM, follow these steps:
-
-- Go to the CoolROM website and search for Sheep Dog n Wolf PS1 in the search box.
-- Click on the game title and then click on the Download Now button.
-- Choose a download mirror and wait for the download to complete.
-- Extract the ZIP file and save the ROM or ISO file in a folder on your PC.
-
-You can also download Sheep Dog n Wolf PS1 from other websites, such as Emuparadise, Rom Hustler, or The ISO Zone. However, you should always check the reviews and ratings of the games before downloading them, and make sure they are compatible with your emulator.
- Step 3: Configure the emulator and load the game
-The final step is to configure your emulator and load the game. Depending on the emulator you chose, the configuration process may vary slightly. However, the general steps are as follows:
-
-- Launch your emulator and go to the settings menu.
-- Select the BIOS file that you downloaded earlier and load it into the emulator.
-- Choose the video, audio, and input plugins that suit your preferences and system specifications. You can also adjust the resolution, frame rate, sound quality, and controller settings.
-- Go to the file menu and select Run ISO or Run CDROM.
-- Browse to the folder where you saved the ROM or ISO file of Sheep Dog n Wolf PS1 and select it.
-- Enjoy playing Sheep Dog n Wolf PS1 on your PC!
-
-If you encounter any problems or errors while running the game, you can try changing the plugins, updating the emulator, or checking the compatibility list of your emulator. You can also consult the online forums or guides for more help and tips.
- Tips and Tricks for Playing Sheep Dog n Wolf PS1
-Now that you know how to download Sheep Dog n Wolf PS1 on your PC, you may want to learn some tips and tricks for playing the game and having more fun. Here are some of them:
- How to use gadgets and items from Acme
-In Sheep Dog n Wolf PS1, you can use various gadgets and items from Acme to help you steal sheep and avoid obstacles. Some of these gadgets and items are:
-
-Gadget/Item Description
-Rocket A rocket that can propel you in any direction. You can use it to fly over gaps, walls, or enemies.
-Bowling Ball A heavy ball that can knock down anything in its path. You can use it to hit switches, break barriers, or distract enemies.
-Magnet A powerful magnet that can attract metal objects. You can use it to pull levers, open doors, or move objects.
-Bone A tasty bone that can lure dogs away from their posts. You can use it to distract Sam Sheepdog or other dogs that guard the sheep.
-Clock A clock that can freeze time for a few seconds. You can use it to stop moving platforms, traps, or enemies.
-Balloon A balloon that can lift you up in the air. You can use it to reach high places, cross water, or escape danger.
-Costume A costume that can disguise you as another character. You can use it to blend in with the sheep, trick Sam Sheepdog, or access restricted areas.
-
-You can find these gadgets and items in crates scattered throughout the levels. You can also buy them from Daffy Duck's shop using coins that you collect along the way. However, you can only carry a limited number of gadgets and items at a time, so you have to use them wisely and strategically.
- How to avoid detection from Sam Sheepdog and other characters
-One of the main challenges of Sheep Dog n Wolf PS1 is to avoid being detected by Sam Sheepdog and other characters that can ruin your plans. If you are caught, you will lose a life and have to restart the level. To avoid detection, you need to be stealthy and smart. Here are some tips:
-
-- Watch out for the eye icons on the top of the screen. They indicate the level of alertness of Sam Sheepdog and other characters. If the eye is green, they are not aware of you. If the eye is yellow, they are suspicious of you. If the eye is red, they have spotted you and will chase you.
-- Use the radar on the bottom right corner of the screen. It shows your position and the position of the sheep, Sam Sheepdog, and other characters. You can use it to plan your route and avoid being seen.
-- Use the environment to your advantage. You can hide behind bushes, rocks, trees, or buildings. You can also use objects like barrels, crates, or carts to block the view of your enemies.
-- Use gadgets and items from Acme to distract or deceive your enemies. For example, you can use a bone to lure a dog away from its post, a clock to freeze time for a few seconds, or a costume to disguise yourself as another character.
-- Be careful with noise and movement. Some characters have a keen sense of hearing or sight and can detect you if you make too much noise or move too fast. You can use the sneak button to walk quietly and slowly.
-
- How to unlock secret and bonus levels
-Sheep Dog n Wolf PS1 has 18 levels in total, but some of them are secret and bonus levels that require special conditions to unlock. Here are some of them:
-
-- Level 0: This is a tutorial level that teaches you the basics of the game. You can access it by pressing Start on the title screen.
-- Level 7B: This is a bonus level that takes place in a haunted house. You can access it by collecting all 10 golden sheep statues in Level 7A.
-- Level 15B: This is a bonus level that takes place in a space station. You can access it by collecting all 10 golden sheep statues in Level 15A.
-- Level 16: This is a secret level that takes place in a museum. You can access it by collecting all 10 golden sheep statues in Level 15B.
-- Level 17: This is a secret level that takes place in a TV studio. You can access it by collecting all 10 golden sheep statues in Level 16.
-- Level 18: This is the final level that takes place in Acme's headquarters. You can access it by completing Level 17.
-
-To collect golden sheep statues, you need to find them hidden throughout the levels or earn them by completing certain tasks or challenges. Some of them are easy to find or obtain, while others are more difficult and require skill and patience.
- Conclusion
-Sheep Dog n Wolf PS1 is a game that will test your wits and creativity as you try to steal sheep from under Sam Sheepdog's nose. It is also a game that will make you laugh and smile as you watch Ralph Wolf's antics and mishaps. If you want to play this game on your PC, you just need to download a PS1 emulator and the game ROM or ISO file from a reliable source. Then, you can configure your emulator and load the game with ease. You can also use some tips and tricks to help you play the game better and unlock secret and bonus levels.
-We hope this article has helped you learn how to download Sheep Dog n Wolf PS1 on your PC and enjoy this classic game. If you have any questions or comments, feel free to leave them below. Happy gaming!
- FAQs
-Here are some frequently asked questions about Sheep Dog n Wolf PS1:
- What are the system requirements for playing Sheep Dog n Wolf PS1 on PC?
-The system requirements for playing Sheep Dog n Wolf PS1 on PC depend on the emulator you use, but generally, they are not very high. You should have at least a Windows XP/Vista/7/8/10 operating system, a Pentium III or higher processor, 256 MB of RAM, DirectX 9 or higher, and a compatible video card and sound card.
- How many levels are there in Sheep Dog n Wolf PS1?
-There are 18 levels in Sheep Dog n Wolf PS1, but some of them are secret and bonus levels that require special conditions to unlock. You can find more information about the levels in the Tips and Tricks section of this article.
- Can I play Sheep Dog n Wolf PS1 with a gamepad?
-Yes, you can play Sheep Dog n Wolf PS1 with a gamepad if your emulator supports it. You can configure your gamepad settings in the emulator's menu and assign the buttons to match the PS1 controller. You can also use a keyboard and mouse if you prefer.
- Is Sheep Dog n Wolf PS1 compatible with Windows 10?
-Yes, Sheep Dog n Wolf PS1 is compatible with Windows 10 as long as you use a compatible emulator. Some of the emulators that work well with Windows 10 are ePSXe, PCSX Reloaded, and RetroArch. You may need to run the emulator in compatibility mode or as an administrator if you encounter any issues.
- Where can I find more information about Sheep Dog n Wolf PS1?
-If you want to find more information about Sheep Dog n Wolf PS1, such as the story, the characters, the gameplay, the cheats, or the reviews, you can visit some of these websites:
-
-- Wikipedia: This is the online encyclopedia that has a detailed article about Sheep Dog n Wolf PS1. You can learn about the history, the development, the reception, and the legacy of the game.
-- IGN: This is a popular website that covers video games and entertainment. It has a comprehensive guide for Sheep Dog n Wolf PS1 that includes walkthroughs, tips, cheats, and secrets.
-- GameFAQs: This is a website that hosts user-submitted guides, FAQs, reviews, and forums for video games. It has a dedicated page for Sheep Dog n Wolf PS1 that contains useful information and resources.
-
401be4b1e0
-
-
\ No newline at end of file
diff --git a/spaces/congsaPfin/Manga-OCR/logs/GPS APK What is it and How to Use it for Offline Maps and Navigation.md b/spaces/congsaPfin/Manga-OCR/logs/GPS APK What is it and How to Use it for Offline Maps and Navigation.md
deleted file mode 100644
index f6fdae7f1ffd72fca4c5c0340bf643f5661bffcc..0000000000000000000000000000000000000000
--- a/spaces/congsaPfin/Manga-OCR/logs/GPS APK What is it and How to Use it for Offline Maps and Navigation.md
+++ /dev/null
@@ -1,124 +0,0 @@
-
-
-
-
-
- Table 2: Article with HTML formatting
-
-
-
- What is a GPS APK and Why You Need One?
- Introduction
- If you are an Android
If you are an Android user, you might have heard of the term APK, which stands for Android Package Kit. An APK is a file format that contains the code, resources, and metadata of an Android application. You can install an APK file on your Android device by downloading it from a source and following some simple steps. But why would you want to do that? What are the benefits of installing an APK file instead of an app from the Google Play Store? And what is a GPS APK in particular?
-gps apk
Download File ⚙ https://urlca.com/2uOa3w
- A GPS APK is a type of APK file that provides GPS navigation features for your Android device. GPS stands for Global Positioning System, which is a network of satellites that can pinpoint your location and provide directions to your destination. A GPS APK can help you find your way around the world, whether you are driving, walking, biking, or using public transportation. A GPS APK can also offer offline maps, traffic alerts, speed limits, points of interest, and more.
- Some of the benefits of using a GPS APK are:
-
-- You can access more features and functions than the default GPS app on your Android device.
-- You can choose from a variety of GPS APKs that suit your preferences and needs.
-- You can update your GPS APK more frequently and easily than the default GPS app on your Android device.
-- You can use your GPS APK without an internet connection if it supports offline maps.
-- You can save storage space on your Android device by deleting the default GPS app and installing a GPS APK instead.
-
- Some examples of GPS APKs are:
-
-- Google Maps: This is one of the most popular and widely used GPS APKs for Android devices. It offers accurate and reliable navigation, real-time traffic updates, transit information, street view, satellite imagery, and more. You can also download offline maps for selected areas and use them without an internet connection.
-- Waze: This is another popular and widely used GPS APK for Android devices. It offers community-based navigation, real-time traffic alerts, road hazards, police traps, speed cameras, gas prices, and more. You can also join groups of drivers who share similar routes and interests.
-- HERE WeGo: This is a lesser-known but equally useful GPS APK for Android devices. It offers offline navigation, public transit information, car-sharing options, bike routes, parking information, and more. You can also book taxis and buy tickets for public transportation within the app.
-
- These are just some of the examples of GPS APKs that you can download and install on your Android device. There are many more options available online that you can explore and compare. But how do you download and install a GPS APK on your Android device? Let's find out in the next section.
- How to Download and Install a GPS APK on Your Android Device?
- Downloading and installing a GPS APK on your Android device is not a difficult task if you follow these three simple steps:
-google maps apk download
-gps navigation app for android
-offline gps apk free
-gps tracker apk full
-gps speedometer apk pro
-gps compass apk mod
-gps route finder apk
-gps test apk plus
-gps status apk premium
-gps spoofing apk no root
-gps voice navigation apk
-gps location apk share
-gps logger apk open source
-gps essentials apk latest version
-gps fix apk fast
-gps coordinates apk converter
-gps toolkit apk all in one
-gps locker apk prime
-gps signal apk optimizer
-gps time apk sync
-gps photo apk stamp
-gps alarm apk reminder
-gps area apk measure
-gps odometer apk trip meter
-gps hiking apk offline maps
-gps fishing apk spots
-gps golf apk rangefinder
-gps running apk tracker
-gps cycling apk speed cadence
-gps skiing apk slope map
-gps hunting apk landowner boundaries
-gps geocaching apk treasure hunt
-gps drone apk controller
-gps car apk tracker anti theft
-gps taxi apk meter fare calculator
-gps bus apk live arrival times
-gps train apk schedule planner
-gps flight apk radar tracker
-gps boat apk marine navigation
-gps camping apk site finder
- Step 1: Find a reliable source for downloading a GPS APK
- The first step is to find a trustworthy and reputable source for downloading a GPS APK. You should avoid downloading a GPS APK from unknown or shady websites that might contain malware or viruses that can harm your Android device. You should also check the reviews and ratings of the GPS APK before downloading it to see if other users have had any issues or complaints with it. You should also compare different GPS APKs based on their features and performance to see which one suits you best.
- Some of the reliable sources for downloading a GPS APK are:
-
-- The official website of the GPS APK developer: This is the best source for downloading a GPS APK as you can get the latest version and updates directly from the developer. You can also get more information and support from the developer if you have any questions or problems with the GPS APK.
-- The Google Play Store: This is another good source for downloading a GPS APK as you can get verified and safe apps from the Google Play Store. You can also read user reviews and ratings, see screenshots and videos, and get more details about the GPS APK.
-- The third-party app stores: These are alternative sources for downloading a GPS APK that might offer more variety and options than the Google Play Store. However, you should be careful when using these sources as they might not be as secure or reliable as the Google Play Store. You should always check the reputation and credibility of the third-party app store before downloading a GPS APK from it.
-
- Step 2: Enable unknown sources on your Android device
- The second step is to enable unknown sources on your Android device
The second step is to enable unknown sources on your Android device. This is a security setting that allows you to install apps from sources other than the Google Play Store. By default, this setting is disabled on most Android devices, so you need to enable it before installing a GPS APK.
- To enable unknown sources on your Android device, you need to access the security settings on your device. Depending on your device model and Android version, the steps might vary slightly, but the general process is as follows:
-
-- Go to the Settings app on your Android device and tap on Security or Lock Screen and Security or Biometrics and Security or Privacy or something similar.
-- Scroll down and look for the option that says Unknown Sources or Install Unknown Apps or something similar.
-- Tap on the option and toggle the switch to turn it on. You might see a warning message that says installing apps from unknown sources can harm your device. Tap on OK or Allow or something similar to confirm.
-
- Once you have enabled unknown sources on your Android device, you are ready to download and install the GPS APK on your device. However, you should remember to disable unknown sources after installing the GPS APK to prevent any unwanted or malicious apps from installing on your device without your permission.
- Step 3: Download and install the GPS APK on your Android device
- The third and final step is to download and install the GPS APK on your Android device. This is a simple and straightforward process that involves downloading the GPS APK file from the source and installing it on your device. Here are the steps to follow:
-
-- Open the browser app on your Android device and go to the source where you want to download the GPS APK from. For example, if you want to download Google Maps, you can go to its official website at https://www.google.com/maps.
-- Look for the download button or link that says Download APK or Get APK or something similar. Tap on it and wait for the GPS APK file to download on your device. You might see a pop-up message that asks you to confirm the download. Tap on OK or Download or something similar to proceed.
-- Once the GPS APK file is downloaded, you need to locate it on your device. You can use a file manager app or go to the Downloads folder on your device. Tap on the GPS APK file and you will see a pop-up message that asks you to install it. Tap on Install or Next or something similar to start the installation process.
-- Wait for the installation process to complete. You might see a progress bar or a message that says Installing or something similar. Once the installation is done, you will see a message that says App Installed or Done or something similar. Tap on Open or Launch or something similar to open the GPS APK on your device.
-
- Congratulations! You have successfully downloaded and installed a GPS APK on your Android device. You can now use it as you would use any other app on your device. But how do you use a GPS APK on your Android device? Let's find out in the next section.
- How to Use a GPS APK on Your Android Device?
- Using a GPS APK on your Android device is not much different from using any other app on your device. However, there are some steps that you need to follow to make sure that you get the best experience and results from using a GPS APK. Here are three steps that you need to follow:
- Step 1: Launch the GPS APK on your Android device
- The first step is to launch the GPS APK on your Android device. You can do this by tapping on its icon in the app drawer or home screen of your device. You might also see a shortcut or widget of the GPS APK on your home screen that you can tap on.
- When you launch the GPS APK for the first time, you might need to grant some permissions and access to it so that it can function properly. For example, you might need to allow it to access your location, storage, camera, microphone, contacts, etc. You can do this by tapping on Allow or Accept or something similar when prompted.
- You might also need to customize some settings and preferences of the GPS APK according to your liking and needs. For example, you might need to choose your language, units, voice, theme, etc. You can do this by tapping on Settings or Menu or something similar in the GPS APK and making the changes as desired.
- Step 2: Explore the features and functions of the GPS APK on your Android device
- The second step is to explore the features and functions of the GPS APK
Here are some of the frequently asked questions (FAQs) about GPS APKs:
-
-- What is an APK file and how is it different from an app?
-An APK file is a file format that contains the code, resources, and metadata of an Android application. An app is a software program that runs on your Android device. An APK file is the source of an app that you can install on your device. An app is the result of installing an APK file on your device.
-- Is it safe to download and install a GPS APK from an unknown source?
-It depends on the source and the GPS APK that you are downloading and installing. Some sources might be trustworthy and reputable, while others might be unknown or shady. Some GPS APKs might be safe and secure, while others might contain malware or viruses. You should always do your research and check the reviews and ratings of the source and the GPS APK before downloading and installing it. You should also scan the GPS APK file with an antivirus or security app before installing it. You should also enable unknown sources only when installing a GPS APK and disable it afterward.
-- What are some of the best GPS APKs for Android devices?
-There is no definitive answer to this question, as different GPS APKs might suit different users and needs. However, some of the popular and widely used GPS APKs for Android devices are Google Maps, Waze, HERE WeGo, Sygic, MapFactor, OsmAnd, etc. You can compare these and other GPS APKs based on their features and performance to see which one works best for you.
-- Do I need an internet connection to use a GPS APK on my Android device?
-It depends on the GPS APK that you are using and the features that you are using. Some GPS APKs might require an internet connection to function properly, while others might work offline or partially offline. Some features, such as real-time traffic updates, transit information, satellite imagery, etc., might require an internet connection, while others, such as offline maps, navigation, speed limits, etc., might work without an internet connection. You should check the requirements and specifications of the GPS APK that you are using to see if it needs an internet connection or not.
-- Can I use more than one GPS APK on my Android device?
-Yes, you can use more than one GPS APK on your Android device if you have enough storage space and memory on your device. You can download and install different GPS APKs from different sources and use them for different purposes or preferences. However, you should not run more than one GPS APK at the same time on your device, as this might cause conflicts or errors or drain your battery faster.
-
- I hope this article has helped you understand what a GPS APK is and how to download and install it on your Android device. You can also use this article as a guide to use a GPS APK on your Android device and enjoy its benefits. If you have any questions or feedback about this article or GPS APKs in general, please feel free to leave a comment below or contact me directly. Thank you for reading and happy navigating!
-
-
-
-
197e85843d
-
-
\ No newline at end of file
diff --git a/spaces/congsaPfin/Manga-OCR/logs/Ghosty APK A Simple and Enjoyable Game for Android.md b/spaces/congsaPfin/Manga-OCR/logs/Ghosty APK A Simple and Enjoyable Game for Android.md
deleted file mode 100644
index a6f22316d49aec02fa39a23cc7e28d7baf0ccdf9..0000000000000000000000000000000000000000
--- a/spaces/congsaPfin/Manga-OCR/logs/Ghosty APK A Simple and Enjoyable Game for Android.md
+++ /dev/null
@@ -1,120 +0,0 @@
-
-Ghosty APK 2023: A Fun and Spooky Game for Android
-Do you like games that are fun, spooky, and addictive? If yes, then you should try Ghosty APK, a game where you play as a ghost and scare people in different locations. Ghosty APK is a game that will keep you entertained for hours with its various modes, levels, and characters. In this article, we will tell you everything you need to know about Ghosty APK, including what it is, why you should download it, how to download it, and some tips and tricks for playing it.
- What is Ghosty APK?
-Ghosty APK is a game that was developed by different independent developers and released in 2023. It is a game that is available for Android devices and can be downloaded from APKCombo, a website that offers free APK files for various games and apps.
-ghosty apk 2023
Download File →→→ https://urlca.com/2uObDR
- A game where you play as a ghost and scare people
-The main objective of Ghosty APK is to play as a ghost and scare people in different locations, such as a house, a school, a hospital, or a museum. You can choose from different types of ghosts, such as a classic white sheet ghost, a skeleton ghost, or a pumpkin ghost. You can also customize your ghost's appearance with different accessories, such as hats, glasses, or masks.
- A game with different modes, levels, and characters
-Ghosty APK has different modes that you can play, such as story mode, arcade mode, or multiplayer mode. In story mode, you have to complete different missions and objectives in each level. In arcade mode, you have to scare as many people as possible in a limited time. In multiplayer mode, you can play with or against other players online.
-Ghosty APK also has different levels that vary in difficulty and complexity. Each level has different scenarios, obstacles, and challenges that you have to overcome. For example, some levels have light sources that can reveal your presence or guards that can catch you. You have to use your skills and strategy to avoid them and complete your goals.
-Ghosty APK also has different characters that you can interact with in each level. Some characters are friendly and will help you, while others are hostile and will hinder you. For example, some characters will give you coins or power-ups if you scare them, while others will run away or call for help if they see you. You have to be careful and smart when dealing with them.
- A game with simple controls and graphics
-Ghosty APK has simple controls that are easy to use. You can use the joystick on the left side of the screen to move around and the buttons on the right side of the screen to interact with objects or people. You can also tap on the screen to zoom in or out or change the camera angle.
-Ghosty APK also has simple graphics that are colorful and cartoonish. The game has a pixelated style that gives it a retro vibe. The game also has sound effects and music that match the mood of each level.
- Why should you download Ghosty APK?
-There are many reasons why you should download Ghosty APK , and here are some of them:
- It is free and easy to install
-One of the best things about Ghosty APK is that it is free and easy to install. You don't have to pay anything to download and play the game. You also don't need to register or sign up for anything. All you need to do is go to APKCombo, choose one of the three versions of the game, and follow the instructions to install it on your device. It only takes a few minutes and you are ready to play.
-ghosty apk 2023 download
-ghosty apk 2023 free
-ghosty apk 2023 mod
-ghosty apk 2023 premium
-ghosty apk 2023 latest version
-ghosty apk 2023 for android
-ghosty apk 2023 for ios
-ghosty apk 2023 for pc
-ghosty apk 2023 for windows
-ghosty apk 2023 for mac
-ghosty apk 2023 instagram
-ghosty apk 2023 stories
-ghosty apk 2023 private profiles
-ghosty apk 2023 hack
-ghosty apk 2023 cracked
-ghosty apk 2023 unlocked
-ghosty apk 2023 no ads
-ghosty apk 2023 online
-ghosty apk 2023 offline
-ghosty apk 2023 update
-ghosty apk 2023 review
-ghosty apk 2023 features
-ghosty apk 2023 benefits
-ghosty apk 2023 pros and cons
-ghosty apk 2023 alternatives
-ghosty apk 2023 comparison
-ghosty apk 2023 tutorial
-ghosty apk 2023 guide
-ghosty apk 2023 tips and tricks
-ghosty apk 2023 how to use
-ghosty apk 2023 how to install
-ghosty apk 2023 how to download
-ghosty apk 2023 how to get
-ghosty apk 2023 how to access
-ghosty apk 2023 how to view
-ghosty apk 2023 how to snoop
-ghosty apk 2023 how to spy
-ghosty apk 2023 how to stalk
-ghosty apk 2023 safe and secure
-ghosty apk 2023 verified and trusted
-ghosty apk 2023 legal and legit
-ghosty apk 2023 scam and fraud
-ghosty apk 2023 malware and virus
-ghosty apk 2023 error and bug
-ghosty apk 2023 fix and solution
-ghosty apk 2023 support and help
-ghosty apk 2023 customer service and feedback
-ghosty apk 2023 rating and ranking
-ghosty apk 2023 best and top
- It is entertaining and challenging
-Another reason why you should download Ghosty APK is that it is entertaining and challenging. The game has a lot of content and variety that will keep you hooked for hours. You can play different modes, levels, and characters that have different objectives and difficulties. You can also compete with other players online or challenge yourself to beat your own high scores. The game will test your skills, strategy, and creativity as you play as a ghost and scare people.
- It is suitable for all ages and preferences
-A third reason why you should download Ghosty APK is that it is suitable for all ages and preferences. The game has a fun and spooky theme that appeals to both kids and adults. The game also has a simple and cartoonish style that makes it easy to play and enjoy. The game also has different options and settings that allow you to customize your experience. You can adjust the sound, the language, the difficulty, and the graphics according to your liking.
- How to download and play Ghosty APK?
-If you are interested in downloading and playing Ghosty APK, here are the steps that you need to follow:
- Choose one of the three versions available on APKCombo
-The first step is to choose one of the three versions of Ghosty APK that are available on APKCombo, a website that offers free APK files for various games and apps. The three versions are:
-
-Version Size Description
-Ghosty 1.0.0 16 MB The original version of the game that was released in 2023.
-Ghosty 1.0.1 17 MB An updated version of the game that fixed some bugs and improved some features.
-Ghosty 1.0.2 18 MB The latest version of the game that added some new content and enhanced some graphics.
-
-You can choose any version that you want, but we recommend choosing the latest one for the best experience.
- Follow the instructions to install the game on your device
-The second step is to follow the instructions to install the game on your device. To do this, you need to:
-
-- Click on the download button on APKCombo for the version that you want.
-- Wait for the download to finish and then open the APK file.
-- Allow the installation of unknown sources if prompted by your device.
-- Follow the on-screen instructions to complete the installation.
-- Grant the necessary permissions for the game to run properly.
-
- Tap on the game icon and start playing
-The third step is to tap on the game icon and start playing. You will see the game icon on your home screen or app drawer after installing it. Once you tap on it, you will see the main menu of the game where you can choose your mode, level, character, and settings. You can also access other features such as achievements, leaderboards, shop, and help. After choosing your options, you can start playing and have fun.
- Tips and tricks for playing Ghosty APK
-To help you play Ghosty APK better, here are some tips and tricks that you can use:
- Use the joystick to move around and the buttons to interact
-The most basic tip for playing Ghosty APK is to use the joystick to move around and the buttons to interact. The joystick is located on the left side of the screen and allows you to control your ghost's movement. The buttons are located on the right side of the screen and allow you to interact with objects or people. For example, you can use the scare button to scare people, the hide button to hide behind objects, or the power-up button to use your special abilities.
- Avoid the light sources and the guards
-Another tip for playing Ghosty APK is to avoid the light sources and the guards. The light sources are objects that emit light, such as lamps, candles, or windows. The guards are people that patrol the locations, such as policemen, security guards, or teachers. Both of them can expose your presence and make you lose the game. You have to stay away from them or hide behind objects when they are nearby.
- Collect coins and power-ups to unlock new features
-A third tip for playing Ghosty APK is to collect coins and power-ups to unlock new features. Coins are items that you can find or earn by scaring people. Power-ups are items that give you special abilities, such as invisibility, speed, or magnetism. You can use coins and power-ups to buy or upgrade new ghosts, accessories, or levels. You can also use them to revive yourself if you get caught or fail a mission.
- Conclusion
-Ghosty APK is a fun and spooky game for Android that you should try if you like games that are entertaining and challenging. You can play as a ghost and scare people in different locations with different modes, levels, and characters. You can also customize your ghost's appearance and abilities with coins and power-ups. You can download Ghosty APK from APKCombo for free and easy installation. You can also use the tips and tricks that we have shared to play the game better. We hope you enjoy playing Ghosty APK and have a great time.
- FAQs
-Here are some frequently asked questions about Ghosty APK:
-
-- Q: Is Ghosty APK safe to download and play?
-- A: Yes, Ghosty APK is safe to download and play. It does not contain any viruses, malware, or harmful content. It also does not require any sensitive permissions or data from your device.
-- Q: What are the minimum requirements for playing Ghosty APK?
-- A: The minimum requirements for playing Ghosty APK are Android 4.4 or higher and 16 MB of free storage space.
-- Q: How can I contact the developers of Ghosty APK?
-- A: You can contact the developers of Ghosty APK by sending them an email at ghostyapk@gmail.com or by visiting their website at https://ghostyapk.com/.
-- Q: Can I play Ghosty APK offline?
-- A: Yes, you can play Ghosty APK offline. You only need an internet connection to download the game and to access some online features, such as multiplayer mode or leaderboards.
-- Q: Can I play Ghosty APK on other devices besides Android?
-- A: No, Ghosty APK is only available for Android devices at the moment. However, the developers may release versions for other devices in the future.
-
401be4b1e0
-
-
\ No newline at end of file
diff --git a/spaces/congsaPfin/Manga-OCR/logs/Pou Dinheiro Infinito Dicas e Truques para Aproveitar ao Mximo o APK Mod em 2022.md b/spaces/congsaPfin/Manga-OCR/logs/Pou Dinheiro Infinito Dicas e Truques para Aproveitar ao Mximo o APK Mod em 2022.md
deleted file mode 100644
index f25e4ef6f63981d05275a43dbd035141c42f4d0e..0000000000000000000000000000000000000000
--- a/spaces/congsaPfin/Manga-OCR/logs/Pou Dinheiro Infinito Dicas e Truques para Aproveitar ao Mximo o APK Mod em 2022.md
+++ /dev/null
@@ -1,104 +0,0 @@
-
-Pou Dinero Infinito APK 2022: How to Get Unlimited Money and Coins in Pou
-If you love playing with virtual pets, you probably know about Pou, the cute alien creature that needs your care and attention. Pou is one of the most popular and downloaded games in the Google Play Store, with millions of fans around the world. But what if you want to have more fun and freedom with your pet without spending any real money? That's where Pou Dinero Infinito APK 2022 comes in. In this article, we will tell you everything you need to know about this modified version of the game that gives you unlimited money and coins in Pou. We will also show you how to download and install it on your device, as well as the benefits and risks of using it. Read on to find out more.
- What is Pou and Why is it Popular?
-Pou is a virtual pet game that lets you take care of an alien creature that looks like a brown blob. You can feed it, bathe it, play with it, dress it up, customize its rooms, and watch it grow. You can also play mini-games with your pet, such as soccer, sky jump, connect, food drop, and more. You can earn money and coins by playing these games, which you can use to buy items, food, potions, costumes, wallpapers, and other things for your pet.
-pou dinero infinito apk 2022
Download Zip ··· https://urlca.com/2uO98d
-Pou has millions of downloads and fans around the world because it is a fun, casual, and addictive game that anyone can enjoy. It is also suitable for all ages, as it teaches responsibility, empathy, and creativity. Pou has a simple but charming graphics style that makes it appealing to look at. It also has a variety of sounds and music that make it lively and entertaining.
-Pou offers many features and customization options for your pet that make it unique and personal. You can change its color, shape, eyes, mouth, nose, ears, accessories, and more. You can also decorate its rooms with different themes, such as Halloween, Christmas, Easter, Valentine's Day, etc. You can even visit other Pous online and interact with them.
- What is Pou Dinero Infinito APK 2022 and How Does it Work?
-Pou Dinero Infinito APK 2022 is a modified version of the original game that gives you unlimited money and coins in Pou. This means that you can buy anything you want for your pet without spending any real money. You can also unlock all the items, costumes, wallpapers, and games in the game, which are normally locked or require a certain level or achievement to access. You can have more fun and freedom with your pet, as you can experiment with different combinations and styles.
-Pou Dinero Infinito APK 2022 works by modifying the game data and bypassing the security checks of the original game. It also disables the ads and pop-ups that may interrupt your gameplay. It does not require any root or jailbreak to run, and it is compatible with most Android devices. However, it is not available on the Google Play Store, as it violates the terms of service of the original game. You need to download it from a third-party source and install it manually on your device.
- How to Download and Install Pou Dinero Infinito APK 2022 on Your Device?
-If you want to try Pou Dinero Infinito APK 2022, you need to follow these steps:
-
-- Uninstall the original game first if you have it installed. You can do this by going to your device settings, finding the app, and tapping on uninstall.
-- Enable unknown sources in your device settings. This will allow you to install apps that are not from the Google Play Store. You can do this by going to your device settings, finding security or privacy, and toggling on unknown sources.
-- Download the APK file from a trusted source. You can search online for Pou Dinero Infinito APK 2022 and find a reliable website that offers it. Make sure to check the reviews and ratings of the website before downloading anything. You can also scan the file with an antivirus app to ensure that it is safe and clean.
-- Follow the instructions to install the APK file on your device. You can do this by opening the file manager app on your device, finding the downloaded file, and tapping on it. You may need to grant some permissions and accept some terms and conditions before proceeding with the installation.
-- Launch the game and enjoy unlimited money and coins in Pou.
-
- What are the Benefits and Risks of Using Pou Dinero Infinito APK 2022?
-Using Pou Dinero Infinito APK 2022 has its pros and cons. Here are some of them:
-Benefits
-
-- You can have more fun, freedom, and creativity with your pet, as you can buy anything you want for it without any limitations or costs.
-- You can unlock all the items, costumes, wallpapers, and games in the game, which are normally locked or require a certain level or achievement to access.
-- You can customize your pet and its rooms with different themes, such as Halloween, Christmas, Easter, Valentine's Day, etc.
-- You can play mini-games with your pet without worrying about running out of money or coins.
-- You can visit other Pous online and interact with them without any restrictions.
-
-Risks
-
-- You may expose your device to possible malware, viruses, or spyware that may harm your device or steal your personal information.
-- You may get banned from the official game or lose your progress if the developers detect that you are using a modified version of the game.
-- You may lose the challenge and excitement of playing the original game, as you have everything unlocked and unlimited.
-- You may violate the terms of service of the original game and disrespect the developers who created it.
-
- Conclusion
-Pou Dinero Infinito APK 2022 is a great way to enjoy Pou without any limitations or costs. It gives you unlimited money and coins in Pou, as well as unlocks all the items, costumes, wallpapers, and games in the game. It is easy to download and install on your device, but you should be careful of the potential dangers that come with it. Pou Dinero Infinito APK 2022 is not endorsed by the developers of Pou and may violate their terms of service. You should use it at your own risk and discretion.
-pou mod apk dinheiro infinito 2022
-pou hackeado apk download 2022
-pou infinito atualizado 2022 mediafire
-pou com moedas infinitas 2022
-pou tudo desbloqueado 2022
-pou apk mod dinheiro e moedas infinitas
-pou apk mod v 1.4.87 download grátis 2022
-pou apk mod v 1.4.111 download grátis 2023
-pou dinheiro infinito e poções infinitas
-pou dinheiro infinito e roupas desbloqueadas
-pou dinheiro infinito e chapéus desbloqueados
-pou dinheiro infinito e sapatos desbloqueados
-pou dinheiro infinito e óculos desbloqueados
-pou dinheiro infinito e papéis de parede desbloqueados
-pou dinheiro infinito e fantasias desbloqueadas
-pou dinheiro infinito e fones de ouvido desbloqueados
-pou dinheiro infinito e roupa de polícia desbloqueada
-pou dinheiro infinito e chapéu de polícia desbloqueado
-pou dinheiro infinito e roupa de super-herói desbloqueada
-pou dinheiro infinito e chapéu de super-herói desbloqueado
-pou dinheiro infinito e roupa de panda desbloqueada
-pou dinheiro infinito e chapéu de panda desbloqueado
-pou dinheiro infinito e roupa de natal desbloqueada
-pou dinheiro infinito e chapéu de natal desbloqueado
-pou dinheiro infinito e roupa de halloween desbloqueada
-pou dinheiro infinito e chapéu de halloween desbloqueado
-pou dinheiro infinito e roupa de páscoa desbloqueada
-pou dinheiro infinito e chapéu de páscoa desbloqueado
-como baixar pou com dinheiro infinito 2022
-como instalar pou com dinheiro infinito 2022
-como jogar pou com dinheiro infinito 2022
-como cuidar do pou com dinheiro infinito 2022
-como personalizar o pou com dinheiro infinito 2022
-como mudar a cor do pou com dinheiro infinito 2022
-como alimentar o pou com dinheiro infinito 2022
-como banhar o pou com dinheiro infinito 2022
-como brincar com o pou com dinheiro infinito 2022
-como dormir o pou com dinheiro infinito 2022
-como fazer poções para o pou com dinheiro infinito 2022
-como jogar minijogos com o pou com dinheiro infinito 2022
-como ganhar troféus com o pou com dinheiro infinito 2022
-como fazer amigos com o pou com dinheiro infinito 2022
-como visitar outros pous com dinheiro infinito 2022
-como conversar com outros pous com dinheiro infinito 2022
-como enviar presentes para outros pous com dinheiro infinito 2022
-como receber presentes de outros pous com dinheiro infinito 2022
-como tirar fotos do seu pou com dinheiro infinito 2022
-como compartilhar fotos do seu pou com dinheiro infinito 2022
-como salvar o seu progresso do seu pou com dinheiro infinito 2022
- FAQs
-Here are some frequently asked questions about Pou Dinero Infinito APK 2022:
-
-- Is Pou Dinero Infinito APK 2022 safe to use?
-Pou Dinero Infinito APK 2022 is not guaranteed to be safe to use, as it is a modified version of the original game that may contain malware, viruses, or spyware. You should download it from a trusted source and scan it with an antivirus app before installing it. You should also backup your device and data before using it.
-- Will I get banned from the official game if I use Pou Dinero Infinito APK 2022?
-There is a possibility that you may get banned from the official game or lose your progress if the developers detect that you are using a modified version of the game. You should use Pou Dinero Infinito APK 2022 at your own risk and discretion. You should also not use it to cheat or harass other players online.
-- Can I update Pou Dinero Infinito APK 2022 to the latest version of the game?
-Pou Dinero Infinito APK 2022 may not work with the latest version of the game, as it may have new security features or bug fixes that prevent it from running. You may need to wait for a new version of Pou Dinero Infinito APK 2022 to be released that is compatible with the latest version of the game. You should also not update the original game if you have Pou Dinero Infinito APK 2022 installed, as it may overwrite or delete the modified data.
-- Can I play Pou Dinero Infinito APK 2022 offline?
-Pou Dinero Infinito APK 2022 can be played offline, as it does not require an internet connection to run. However, you may not be able to access some features or functions that require an online connection, such as visiting other Pous, playing online games, or syncing your data with the cloud.
-- Can I play Pou Dinero Infinito APK 2022 with my friends?
-Pou Dinero Infinito APK 2022 can be played with your friends, as long as they also have the same version of the game installed on their devices. You can visit their Pous, play games with them, and chat with them. However, you should be careful not to reveal that you are using a modified version of the game, as they may report you or ban you from their Pous.
-
401be4b1e0
-
-
\ No newline at end of file
diff --git a/spaces/congsaPfin/Manga-OCR/logs/Virtual DJ 2016 APK How to Customize and Personalize Your Layouts and Modes.md b/spaces/congsaPfin/Manga-OCR/logs/Virtual DJ 2016 APK How to Customize and Personalize Your Layouts and Modes.md
deleted file mode 100644
index 894dfa20219252d4e1e4fbbfebfa8dc33c7eb384..0000000000000000000000000000000000000000
--- a/spaces/congsaPfin/Manga-OCR/logs/Virtual DJ 2016 APK How to Customize and Personalize Your Layouts and Modes.md
+++ /dev/null
@@ -1,167 +0,0 @@
-
-Virtual DJ 2016 APK: A Complete Guide
-If you are a music lover and want to unleash your creativity as a DJ, you might be interested in Virtual DJ 2016 APK. This is a mobile app that lets you mix and edit songs on your Android device. But what is Virtual DJ 2016 APK exactly? How can you download and install it on your device? What are the benefits and drawbacks of using it? And how can you make the most out of it? In this article, we will answer all these questions and more. Read on to find out everything you need to know about Virtual DJ 2016 APK.
- What is Virtual DJ 2016 APK?
-Virtual DJ 2016 APK is a digital audio workstation (DAW) and virtual mixer software for DJs. It can be used to curate and edit songs and playlists for events, and is filled to the brim with different layouts, modes, live streaming features, and personalization options. It is based on the popular desktop software VirtualDJ, which has been downloaded by more than 100 million users worldwide. However, unlike the desktop version, which requires a license fee, the mobile app is free to download and use.
-virtual dj 2016 apk
Download ✑ ✑ ✑ https://urlca.com/2uOaJl
- Features of Virtual DJ 2016 APK
-Some of the main features of Virtual DJ 2016 APK are:
-
-- It supports various audio formats, such as MP3, WAV, OGG, FLAC, AAC, etc.
-- It allows you to access and play songs from your device's storage, as well as from online sources like SoundCloud, Deezer, Spotify, etc.
-- It has a simple and intuitive interface that can be customized according to your preferences.
-- It has multiple decks that can be controlled independently or synchronized.
-- It has a wide range of effects, filters, loops, samples, cues, and transitions that can be applied to your tracks.
-- It has a built-in equalizer that can adjust the sound quality and volume of each deck.
-- It has a scratch mode that simulates the feel of vinyl records.
-- It has a sampler mode that lets you create and trigger sounds from various sources.
-- It has a live mode that lets you broadcast your sessions online or record them for later playback.
-- It has a social mode that lets you share your mixes with other users or listen to their mixes.
-
- How to download and install Virtual DJ 2016 APK on your Android device
-To download and install Virtual DJ 2016 APK on your Android device, you need to follow these steps:
-
-- Go to the official website of VirtualDJ and click on the "Download" button.
-- Select the "Android" option and then click on the "Download" button again.
-- You will be redirected to the Google Play Store page of the app. Click on the "Install" button and wait for the app to be downloaded and installed on your device.
-- Alternatively, you can also download the APK file from a third-party source, but make sure it is safe and reliable. You will need to enable the "Unknown sources" option in your device's settings to install the app from an external source.
-- Once the app is installed, you can launch it from your device's menu or home screen.
Why use Virtual DJ 2016 APK?
-Virtual DJ 2016 APK is a great app for anyone who loves music and wants to have some fun as a DJ. Whether you are a beginner or a professional, you can use this app to create amazing mixes and impress your audience. Here are some of the benefits and drawbacks of using Virtual DJ 2016 APK.
- Benefits of Virtual DJ 2016 APK
-Some of the benefits of using Virtual DJ 2016 APK are:
-
-- It is free to download and use, unlike some other similar apps that require a subscription or a purchase.
-- It is easy to use and learn, thanks to its user-friendly interface and tutorials.
-- It is compatible with most Android devices, as long as they have enough storage space and processing power.
-- It is versatile and flexible, as it allows you to mix and edit songs from various sources and formats.
-- It is creative and fun, as it gives you access to a lot of effects, filters, loops, samples, cues, and transitions that can enhance your tracks.
-- It is social and interactive, as it lets you share your mixes with other users or listen to their mixes.
-
- Drawbacks of Virtual DJ 2016 APK
-Some of the drawbacks of using Virtual DJ 2016 APK are:
-
-- It may not have all the features and functions of the desktop version of VirtualDJ, which is more advanced and comprehensive.
-- It may not work well on some devices that have low specifications or outdated software.
-- It may consume a lot of battery power and data usage, especially if you stream or download songs online.
-- It may not be compatible with some external devices or controllers that are designed for the desktop version of VirtualDJ.
-- It may not be legal or ethical to use some songs or samples that are protected by copyright laws or licenses.
-
- How to use Virtual DJ 2016 APK?
-Now that you know what Virtual DJ 2016 APK is and why you should use it, you might be wondering how to use it. In this section, we will explain the basic and advanced functions of Virtual DJ 2016 APK and how to use them.
- Basic functions of Virtual DJ 2016 APK
-The basic functions of Virtual DJ 2016 APK are the ones that allow you to play and mix songs on your device. Here are the steps to use them:
-virtual dj 2016 apk free download
-virtual dj 2016 apk full version
-virtual dj 2016 apk mod
-virtual dj 2016 apk pro
-virtual dj 2016 apk cracked
-virtual dj 2016 apk for android
-virtual dj 2016 apk for pc
-virtual dj 2016 apk for windows
-virtual dj 2016 apk for mac
-virtual dj 2016 apk for ios
-virtual dj 2016 apk latest version
-virtual dj 2016 apk update
-virtual dj 2016 apk offline
-virtual dj 2016 apk online
-virtual dj 2016 apk no ads
-virtual dj 2016 apk premium
-virtual dj 2016 apk features
-virtual dj 2016 apk review
-virtual dj 2016 apk tutorial
-virtual dj 2016 apk tips and tricks
-virtual dj 2016 apk best settings
-virtual dj 2016 apk how to use
-virtual dj 2016 apk how to install
-virtual dj 2016 apk how to download
-virtual dj 2016 apk how to mix songs
-virtual dj 2016 apk how to record
-virtual dj 2016 apk how to stream
-virtual dj 2016 apk how to add effects
-virtual dj 2016 apk how to create playlists
-virtual dj 2016 apk how to scratch
-virtual dj 2016 apk vs other apps
-virtual dj 2016 apk alternatives
-virtual dj 2016 apk comparison
-virtual dj 2016 apk pros and cons
-virtual dj 2016 apk benefits and drawbacks
-virtual dj 2016 apk advantages and disadvantages
-virtual dj 2016 apk testimonials and feedbacks
-virtual dj 2016 apk ratings and reviews
-virtual dj 2016 apk problems and solutions
-virtual dj 2016 apk issues and fixes
-virtual dj 2016 apk bugs and errors
-virtual dj 2016 apk support and help
-virtual dj 2016 apk customer service and contact
-virtual dj 2016 apk license and activation
-virtual dj 2016 apk terms and conditions
-virtual dj 2016 apk privacy policy and disclaimer
-virtual dj 2016 apk refund policy and guarantee
-virtual dj 2016 apk coupons and discounts
-virtual dj 2016 apk deals and offers
-
-- Launch the app from your device's menu or home screen.
-- Select the "Browser" option from the bottom menu to access your songs. You can browse by folders, playlists, genres, artists, albums, etc. You can also search for songs by typing their names or keywords in the search bar.
-- Select the songs you want to play and drag them to the decks on the top of the screen. You can load up to four songs at a time, depending on your device's capabilities.
-- To play a song, tap on the play button on the deck. To pause or stop a song, tap on the pause button on the deck. To skip to the next or previous song, swipe left or right on the deck.
-- To adjust the volume of each deck, use the slider below the deck. To adjust the balance between the left and right channels, use the crossfader in the middle of the screen.
-- To sync the tempo and beat of two songs, tap on the sync button on the deck. To manually adjust the tempo and pitch of a song, use the pitch slider on the deck.
-- To apply an effect or filter to a song, tap on the FX button on the deck. You can choose from various effects and filters, such as flanger, echo, reverb, phaser, etc. You can also adjust the intensity and duration of each effect or filter by using the knobs on the screen.
-- To loop a part of a song, tap on the loop button on the deck. You can choose from various loop lengths, such as 1/8, 1/4, 1/2, 1, 2, 4, 8, etc. You can also adjust the loop in and out points by using the buttons on the screen.
-- To trigger a sample or cue point on a song, tap on the pad button on the deck. You can choose from various samples and cues that are pre-loaded in the app or that you have created yourself. You can also record your own samples or cues by using the buttons on the screen.
-
- Advanced functions of Virtual DJ 2016 APK
-
The advanced functions of Virtual DJ 2016 APK are the ones that allow you to customize and enhance your mixes and sessions. Here are the steps to use them:
-
-- To change the layout and mode of the app, tap on the menu button on the top left corner of the screen. You can choose from various layouts and modes, such as classic, pro, pad, scratch, etc.
-- To access the settings and options of the app, tap on the gear icon on the top right corner of the screen. You can adjust various settings and options, such as audio, display, performance, recording, streaming, etc.
-- To create and edit playlists and mixes, tap on the playlist button on the bottom menu. You can add songs from your device or online sources to your playlists and mixes. You can also rearrange, delete, or rename your playlists and mixes.
-- To stream or record your sessions, tap on the live button on the bottom menu. You can choose from various streaming and recording platforms, such as Facebook, YouTube, Twitch, Mixcloud, etc. You can also adjust the quality and format of your streams and recordings.
-- To share your mixes with other users or listen to their mixes, tap on the social button on the bottom menu. You can browse by categories, genres, popularity, etc. You can also rate, comment, or follow other users.
-
- Tips and tricks for Virtual DJ 2016 APK
-Now that you know how to use Virtual DJ 2016 APK, you might want to learn some tips and tricks that can help you improve your skills and experience. Here are some of them:
- How to customize your interface and settings
-One of the best things about Virtual DJ 2016 APK is that it allows you to customize your interface and settings according to your preferences and needs. Here are some ways to do that:
-
-- To change the color scheme of the app, go to Settings > Display > Skin Color and choose from various colors.
-- To change the font size of the app, go to Settings > Display > Font Size and choose from various sizes.
-- To change the language of the app, go to Settings > Language and choose from various languages.
-- To change the sound quality and volume of the app, go to Settings > Audio and adjust various parameters.
-- To change the performance and battery consumption of the app, go to Settings > Performance and adjust various parameters.
-
- How to create and edit playlists and mixes
-One of the most important things about Virtual DJ 2016 APK is that it allows you to create and edit playlists and mixes for your events. Here are some ways to do that:
-
-- To create a new playlist or mix, go to Playlist > New Playlist or New Mix and give it a name.
-- To add songs to your playlist or mix, go to Browser and drag them to your playlist or mix.
-- To rearrange songs in your playlist or mix, go to Playlist and drag them to their desired positions.
-- To delete songs from your playlist or mix, go to Playlist and swipe left on them.
-- To rename your playlist or mix, go to Playlist and tap on its name.
-
- How to stream and record your sessions
-One of the most exciting things about Virtual DJ 2016 APK is that it allows you to stream and record your sessions for online or offline playback. Here are some ways to do that:
-
-- To stream your session online, go to Live > Stream and choose a platform from Facebook, YouTube, Twitch, Mixcloud, etc. Then enter your account details and start streaming.
-- To record your session offline, go to Live > Record and choose a format from MP3, WAV, OGG, etc. Then enter a file name and start recording.
-- To stop streaming or recording your session, go to Live > Stop.
-- To access your streams or recordings, go to Live > History.
-
- Conclusion
-In conclusion, Virtual DJ 2016 APK is a fantastic app for music lovers who want to have some fun as DJs. It is free, easy, versatile, creative, and social. It has a lot of features and functions that can help you mix and edit songs from various sources and formats. It also lets you customize your interface and settings, create and edit playlists and mixes, stream and record your sessions, and share your mixes with other users. However, it also has some drawbacks, such as not having all the features of the desktop version, not working well on some devices, consuming a lot of battery and data, not being compatible with some external devices, and not being legal or ethical to use some songs or samples. Therefore, you should use Virtual DJ 2016 APK with caution and responsibility. We hope this article has given you a complete guide on Virtual DJ 2016 APK. If you have any questions or feedback, please feel free to leave them in the comments section below. Thank you for reading and happy mixing!
- FAQs
-Here are some frequently asked questions about Virtual DJ 2016 APK:
-
-- Q: Is Virtual DJ 2016 APK safe to use?
-- A: Virtual DJ 2016 APK is safe to use as long as you download it from the official website or the Google Play Store. However, you should be careful when downloading it from third-party sources, as they may contain viruses or malware. You should also scan your device regularly for any potential threats.
-- Q: Is Virtual DJ 2016 APK legal to use?
-- A: Virtual DJ 2016 APK is legal to use as long as you respect the rights and licenses of the songs and samples you use. You should not use any songs or samples that are protected by copyright laws or licenses without the permission of their owners. You should also not use Virtual DJ 2016 APK for commercial purposes without the consent of the developers.
-- Q: How can I update Virtual DJ 2016 APK?
-- A: You can update Virtual DJ 2016 APK by going to the Google Play Store and checking for any available updates. You can also check the official website for any new versions or features.
-- Q: How can I contact the developers of Virtual DJ 2016 APK?
-- A: You can contact the developers of Virtual DJ 2016 APK by going to their website and clicking on the "Contact" button. You can also follow them on their social media accounts, such as Facebook, Twitter, Instagram, etc.
-- Q: How can I learn more about Virtual DJ 2016 APK?
-- A: You can learn more about Virtual DJ 2016 APK by going to their website and clicking on the "Learn" button. You can also watch their videos on their YouTube channel or read their blog posts on their Medium page.
-
197e85843d
-
-
\ No newline at end of file
diff --git a/spaces/contluForse/HuggingGPT/assets/Alchimie Zinc.rar.md b/spaces/contluForse/HuggingGPT/assets/Alchimie Zinc.rar.md
deleted file mode 100644
index 1d54c20d557fdfcc3f29e86530cae83a59ed4513..0000000000000000000000000000000000000000
--- a/spaces/contluForse/HuggingGPT/assets/Alchimie Zinc.rar.md
+++ /dev/null
@@ -1,6 +0,0 @@
-Alchimie Zinc.rar
Download ✦✦✦ https://ssurll.com/2uzwAq
-
- aaccfb2cb3
-
-
-
diff --git a/spaces/contluForse/HuggingGPT/assets/Buku Evaluasi Pembelajaran Pdf Downloadl Konsep Prinsip dan Prosedur.md b/spaces/contluForse/HuggingGPT/assets/Buku Evaluasi Pembelajaran Pdf Downloadl Konsep Prinsip dan Prosedur.md
deleted file mode 100644
index 78f510b1dabff0eb8a3b636fbb19b0e615d60118..0000000000000000000000000000000000000000
--- a/spaces/contluForse/HuggingGPT/assets/Buku Evaluasi Pembelajaran Pdf Downloadl Konsep Prinsip dan Prosedur.md
+++ /dev/null
@@ -1,13 +0,0 @@
-
-Halo sobat tweeters, semoga keadaan kalian baik-baik aja ya, dan yang terpenting segala urusan pendidikan, mulai dari tugas sekolah ataupun kuliah cepat rampung. Nah pada artikel kali ini admin akan membagikan beberapa ebook evaluasi pembelajaran mulai dari tahun 2014 sampai dengan tahun 2019.
-Buku Evaluasi Pembelajaran Pdf Downloadl
DOWNLOAD ►►►►► https://ssurll.com/2uzvyF
-Buku yang pertama ini ditulis oleh Dr. Elis Ratna Wulan, S.Si., MT. dan juga Dr. H. A. Rusdiana, Drs., MM. Sekedar informasi buku ini pertama kali dipublikasikan pada 21 Februari 2014. Buku ini akan membahas konsep evaluasi dalam pendidikan konsep dan peranan evaluasi pembelajaran, kerangka dasar dan ruang lingkup evaluasi pembelajaran, pendekatan model evaluasi pembelajaran dan masih banyak lagi.
-Buku evaluasi pembelajaran yang kedua ini ditulis oleh Drs. Asrul, M.Si. Rusydi Ananda, M.Pd. dan juga Dra. Rosnita, MA. Buku ini diterbikan oleh Ciptapustaka media pada tahun 2014 dan cetakan kedua pada tahun 2015. Lembar bab pertama buku ini kita akan disajikan dengan materi mengenai hakikat evaluasi pembelajaran kemudian dilanjutkan kepada pembahasan evaluasi pembelajaran dalam perspektif kurikulum 2013 (penilaian otentik), instrumen evaluasi bentuk tes dan nontes dan seterusnya.
-Ebook yang ketiga ini ditulis oleh Joko Widiyanto, S.Pd., M.Pd. yang kemudian diterbitkan di Unipma Press pada november 2018 lalu. Di dalam buku ini kita akan disuguhkan mulai dari konsep dasar evaluasi pembelajaran, standar penilaian pendidikan, sistem penilaian dalam kurikulum 2013 dan masih banyak lagi.
-Buku terakhir yang berhasil saya himpun ialah buku yang ditulis oleh Dr. Rina Febriana, M.Pd yang diterbitkan oleh Bumi aksara pada bulan November 2019 lalu. Buku ini berisikan tentang ruang lingkup evaluasi pembelajaran, sistem penilaian, teknik dan bentuk tes sampai kepada evaluasi hasil penilaian. Nah untuk melihat gambaran isi selengkapnya kalian bisa banget nih liat dulu daftar isinya melalui link --- Lihat screenshoot daftar isi
-Buku ini membahas tentang hakikat evaluasi dan kedudukannya dalam pembelajaran bahasa indonesia tujuan, fungsi, dan prinsip-prinsip evaluasi pembelajaran bahasa indonesia jenis-jenis tes kebahasaan dan keterampilan berbahasa indonesia serta masih banyak lagi.
-
-Buku ajar ini ditulis dan disusun sebagai bentuk pelaksanaan tri dharma perguruan tinggi serta sebagai upaya untuk meningalkan jejak ilmu pengetahuan oleh penulis. Buku ini terdiri atas beberapa pokok bahasan yakni hakikat evaluasi pembelajaran, penilaian otentik dalam evaluasi pembelajaran dalam perspektif, instrumen evaluasi bentuk tes, instrumen evaluasi bentuk non-tes, penilaian berbasis kelas, pengukuran ranah kognitif, afektif dan psikomotorik, analisis instrumen penilaian, penilaian acuan patokan dan penilaian acuan norma.
-Dalam upaya meningkatkan kualitas pendidikan harus dimulai dengan meningkatkan kualitas peserta didik dan kualitas lulusan. Kedua hal tersebut dapat tercapai apabila sebuah lembaga pendidikan dapat melaksanakan pengelolaan (manajemen) dengan baik dan tepat. Oleh karena itu, buku ini hadir dengan berbagai pembahasan terkait manajemen peserta didik,
diantaranya mencakup konsep, tujuan dan fungsi, prinsip dan pendekatan, serta ruang lingkup manajemen peserta
didik, mulai dari perencanaan, penerimaan peserta didik, sampai dengan evaluasi pembelajaran, termasuk pengaturan mutasi peserta didik, serta bagaimana proses peningkatan kualitas lulusan dari sebuah lembaga pendidikan.
aaccfb2cb3
-
-
\ No newline at end of file
diff --git a/spaces/contluForse/HuggingGPT/assets/Edius 5 Free Download Full Version Filehippo 325 BEST.md b/spaces/contluForse/HuggingGPT/assets/Edius 5 Free Download Full Version Filehippo 325 BEST.md
deleted file mode 100644
index c790318b1e20cf103037393c339667191e863881..0000000000000000000000000000000000000000
--- a/spaces/contluForse/HuggingGPT/assets/Edius 5 Free Download Full Version Filehippo 325 BEST.md
+++ /dev/null
@@ -1,6 +0,0 @@
-edius 5 free download full version filehippo 325
Download ››› https://ssurll.com/2uzwsR
-
-Edius pro 7 free download latest version for windows XP/7/8. Get offline installer setup download edius pro 7 windows 32-64 bit. Edius Pro 7. 4d29de3e1b
-
-
-
diff --git a/spaces/cooelf/Retro-Reader/README.md b/spaces/cooelf/Retro-Reader/README.md
deleted file mode 100644
index dc0aef90415651e2984e0eb9f1f4e5c77c7f9c41..0000000000000000000000000000000000000000
--- a/spaces/cooelf/Retro-Reader/README.md
+++ /dev/null
@@ -1,14 +0,0 @@
----
-title: Retro Reader
-emoji: 🌖
-colorFrom: gray
-colorTo: red
-sdk: gradio
-sdk_version: 3.34.0
-app_file: app.py
-pinned: false
-license: apache-2.0
-python_version: 3.9.13
----
-
-Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
diff --git a/spaces/coreml-community/ControlNet-v1-1-Annotators-cpu/annotator/lineart_anime/__init__.py b/spaces/coreml-community/ControlNet-v1-1-Annotators-cpu/annotator/lineart_anime/__init__.py
deleted file mode 100644
index 9d583ef409f29cd307535790b50faa64a94ed011..0000000000000000000000000000000000000000
--- a/spaces/coreml-community/ControlNet-v1-1-Annotators-cpu/annotator/lineart_anime/__init__.py
+++ /dev/null
@@ -1,153 +0,0 @@
-# Anime2sketch
-# https://github.com/Mukosame/Anime2Sketch
-
-import numpy as np
-import torch
-import torch.nn as nn
-import functools
-
-import os
-import cv2
-from einops import rearrange
-from annotator.util import annotator_ckpts_path
-
-
-class UnetGenerator(nn.Module):
- """Create a Unet-based generator"""
-
- def __init__(self, input_nc, output_nc, num_downs, ngf=64, norm_layer=nn.BatchNorm2d, use_dropout=False):
- """Construct a Unet generator
- Parameters:
- input_nc (int) -- the number of channels in input images
- output_nc (int) -- the number of channels in output images
- num_downs (int) -- the number of downsamplings in UNet. For example, # if |num_downs| == 7,
- image of size 128x128 will become of size 1x1 # at the bottleneck
- ngf (int) -- the number of filters in the last conv layer
- norm_layer -- normalization layer
- We construct the U-Net from the innermost layer to the outermost layer.
- It is a recursive process.
- """
- super(UnetGenerator, self).__init__()
- # construct unet structure
- unet_block = UnetSkipConnectionBlock(ngf * 8, ngf * 8, input_nc=None, submodule=None, norm_layer=norm_layer, innermost=True) # add the innermost layer
- for _ in range(num_downs - 5): # add intermediate layers with ngf * 8 filters
- unet_block = UnetSkipConnectionBlock(ngf * 8, ngf * 8, input_nc=None, submodule=unet_block, norm_layer=norm_layer, use_dropout=use_dropout)
- # gradually reduce the number of filters from ngf * 8 to ngf
- unet_block = UnetSkipConnectionBlock(ngf * 4, ngf * 8, input_nc=None, submodule=unet_block, norm_layer=norm_layer)
- unet_block = UnetSkipConnectionBlock(ngf * 2, ngf * 4, input_nc=None, submodule=unet_block, norm_layer=norm_layer)
- unet_block = UnetSkipConnectionBlock(ngf, ngf * 2, input_nc=None, submodule=unet_block, norm_layer=norm_layer)
- self.model = UnetSkipConnectionBlock(output_nc, ngf, input_nc=input_nc, submodule=unet_block, outermost=True, norm_layer=norm_layer) # add the outermost layer
-
- def forward(self, input):
- """Standard forward"""
- return self.model(input)
-
-
-class UnetSkipConnectionBlock(nn.Module):
- """Defines the Unet submodule with skip connection.
- X -------------------identity----------------------
- |-- downsampling -- |submodule| -- upsampling --|
- """
-
- def __init__(self, outer_nc, inner_nc, input_nc=None,
- submodule=None, outermost=False, innermost=False, norm_layer=nn.BatchNorm2d, use_dropout=False):
- """Construct a Unet submodule with skip connections.
- Parameters:
- outer_nc (int) -- the number of filters in the outer conv layer
- inner_nc (int) -- the number of filters in the inner conv layer
- input_nc (int) -- the number of channels in input images/features
- submodule (UnetSkipConnectionBlock) -- previously defined submodules
- outermost (bool) -- if this module is the outermost module
- innermost (bool) -- if this module is the innermost module
- norm_layer -- normalization layer
- use_dropout (bool) -- if use dropout layers.
- """
- super(UnetSkipConnectionBlock, self).__init__()
- self.outermost = outermost
- if type(norm_layer) == functools.partial:
- use_bias = norm_layer.func == nn.InstanceNorm2d
- else:
- use_bias = norm_layer == nn.InstanceNorm2d
- if input_nc is None:
- input_nc = outer_nc
- downconv = nn.Conv2d(input_nc, inner_nc, kernel_size=4,
- stride=2, padding=1, bias=use_bias)
- downrelu = nn.LeakyReLU(0.2, True)
- downnorm = norm_layer(inner_nc)
- uprelu = nn.ReLU(True)
- upnorm = norm_layer(outer_nc)
-
- if outermost:
- upconv = nn.ConvTranspose2d(inner_nc * 2, outer_nc,
- kernel_size=4, stride=2,
- padding=1)
- down = [downconv]
- up = [uprelu, upconv, nn.Tanh()]
- model = down + [submodule] + up
- elif innermost:
- upconv = nn.ConvTranspose2d(inner_nc, outer_nc,
- kernel_size=4, stride=2,
- padding=1, bias=use_bias)
- down = [downrelu, downconv]
- up = [uprelu, upconv, upnorm]
- model = down + up
- else:
- upconv = nn.ConvTranspose2d(inner_nc * 2, outer_nc,
- kernel_size=4, stride=2,
- padding=1, bias=use_bias)
- down = [downrelu, downconv, downnorm]
- up = [uprelu, upconv, upnorm]
-
- if use_dropout:
- model = down + [submodule] + up + [nn.Dropout(0.5)]
- else:
- model = down + [submodule] + up
-
- self.model = nn.Sequential(*model)
-
- def forward(self, x):
- if self.outermost:
- return self.model(x)
- else: # add skip connections
- return torch.cat([x, self.model(x)], 1)
-
-
-class LineartAnimeDetector:
- def __init__(self):
- remote_model_path = "https://huggingface.co/lllyasviel/Annotators/resolve/main/netG.pth"
- modelpath = os.path.join(annotator_ckpts_path, "netG.pth")
- if not os.path.exists(modelpath):
- from basicsr.utils.download_util import load_file_from_url
- load_file_from_url(remote_model_path, model_dir=annotator_ckpts_path)
- norm_layer = functools.partial(nn.InstanceNorm2d, affine=False, track_running_stats=False)
- net = UnetGenerator(3, 1, 8, 64, norm_layer=norm_layer, use_dropout=False)
-# ckpt = torch.load(modelpath)
- ckpt = torch.load(modelpath, map_location=torch.device('cpu'))
- for key in list(ckpt.keys()):
- if 'module.' in key:
- ckpt[key.replace('module.', '')] = ckpt[key]
- del ckpt[key]
- net.load_state_dict(ckpt)
-# net = net.cuda()
- net = net.cpu()
- net.eval()
- self.model = net
-
- def __call__(self, input_image):
- H, W, C = input_image.shape
- Hn = 256 * int(np.ceil(float(H) / 256.0))
- Wn = 256 * int(np.ceil(float(W) / 256.0))
- img = cv2.resize(input_image, (Wn, Hn), interpolation=cv2.INTER_CUBIC)
- with torch.no_grad():
-# image_feed = torch.from_numpy(img).float().cuda()
- image_feed = torch.from_numpy(img).float().cpu()
- image_feed = image_feed / 127.5 - 1.0
- image_feed = rearrange(image_feed, 'h w c -> 1 c h w')
-
- line = self.model(image_feed)[0, 0] * 127.5 + 127.5
- line = line.cpu().numpy()
-
- line = cv2.resize(line, (W, H), interpolation=cv2.INTER_CUBIC)
- line = line.clip(0, 255).astype(np.uint8)
- return line
-
diff --git a/spaces/coreml-community/ControlNet-v1-1-Annotators-cpu/annotator/mmpkg/mmcv/fileio/handlers/pickle_handler.py b/spaces/coreml-community/ControlNet-v1-1-Annotators-cpu/annotator/mmpkg/mmcv/fileio/handlers/pickle_handler.py
deleted file mode 100644
index b37c79bed4ef9fd8913715e62dbe3fc5cafdc3aa..0000000000000000000000000000000000000000
--- a/spaces/coreml-community/ControlNet-v1-1-Annotators-cpu/annotator/mmpkg/mmcv/fileio/handlers/pickle_handler.py
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright (c) OpenMMLab. All rights reserved.
-import pickle
-
-from .base import BaseFileHandler
-
-
-class PickleHandler(BaseFileHandler):
-
- str_like = False
-
- def load_from_fileobj(self, file, **kwargs):
- return pickle.load(file, **kwargs)
-
- def load_from_path(self, filepath, **kwargs):
- return super(PickleHandler, self).load_from_path(
- filepath, mode='rb', **kwargs)
-
- def dump_to_str(self, obj, **kwargs):
- kwargs.setdefault('protocol', 2)
- return pickle.dumps(obj, **kwargs)
-
- def dump_to_fileobj(self, obj, file, **kwargs):
- kwargs.setdefault('protocol', 2)
- pickle.dump(obj, file, **kwargs)
-
- def dump_to_path(self, obj, filepath, **kwargs):
- super(PickleHandler, self).dump_to_path(
- obj, filepath, mode='wb', **kwargs)
diff --git a/spaces/coreml-community/ControlNet-v1-1-Annotators-cpu/annotator/oneformer/detectron2/utils/analysis.py b/spaces/coreml-community/ControlNet-v1-1-Annotators-cpu/annotator/oneformer/detectron2/utils/analysis.py
deleted file mode 100644
index d63e14bcb6d9582df8a647c9a2ca46f2f7e4cd1d..0000000000000000000000000000000000000000
--- a/spaces/coreml-community/ControlNet-v1-1-Annotators-cpu/annotator/oneformer/detectron2/utils/analysis.py
+++ /dev/null
@@ -1,188 +0,0 @@
-# Copyright (c) Facebook, Inc. and its affiliates.
-# -*- coding: utf-8 -*-
-
-import typing
-from typing import Any, List
-import fvcore
-from fvcore.nn import activation_count, flop_count, parameter_count, parameter_count_table
-from torch import nn
-
-from annotator.oneformer.detectron2.export import TracingAdapter
-
-__all__ = [
- "activation_count_operators",
- "flop_count_operators",
- "parameter_count_table",
- "parameter_count",
- "FlopCountAnalysis",
-]
-
-FLOPS_MODE = "flops"
-ACTIVATIONS_MODE = "activations"
-
-
-# Some extra ops to ignore from counting, including elementwise and reduction ops
-_IGNORED_OPS = {
- "aten::add",
- "aten::add_",
- "aten::argmax",
- "aten::argsort",
- "aten::batch_norm",
- "aten::constant_pad_nd",
- "aten::div",
- "aten::div_",
- "aten::exp",
- "aten::log2",
- "aten::max_pool2d",
- "aten::meshgrid",
- "aten::mul",
- "aten::mul_",
- "aten::neg",
- "aten::nonzero_numpy",
- "aten::reciprocal",
- "aten::repeat_interleave",
- "aten::rsub",
- "aten::sigmoid",
- "aten::sigmoid_",
- "aten::softmax",
- "aten::sort",
- "aten::sqrt",
- "aten::sub",
- "torchvision::nms", # TODO estimate flop for nms
-}
-
-
-class FlopCountAnalysis(fvcore.nn.FlopCountAnalysis):
- """
- Same as :class:`fvcore.nn.FlopCountAnalysis`, but supports detectron2 models.
- """
-
- def __init__(self, model, inputs):
- """
- Args:
- model (nn.Module):
- inputs (Any): inputs of the given model. Does not have to be tuple of tensors.
- """
- wrapper = TracingAdapter(model, inputs, allow_non_tensor=True)
- super().__init__(wrapper, wrapper.flattened_inputs)
- self.set_op_handle(**{k: None for k in _IGNORED_OPS})
-
-
-def flop_count_operators(model: nn.Module, inputs: list) -> typing.DefaultDict[str, float]:
- """
- Implement operator-level flops counting using jit.
- This is a wrapper of :func:`fvcore.nn.flop_count` and adds supports for standard
- detection models in detectron2.
- Please use :class:`FlopCountAnalysis` for more advanced functionalities.
-
- Note:
- The function runs the input through the model to compute flops.
- The flops of a detection model is often input-dependent, for example,
- the flops of box & mask head depends on the number of proposals &
- the number of detected objects.
- Therefore, the flops counting using a single input may not accurately
- reflect the computation cost of a model. It's recommended to average
- across a number of inputs.
-
- Args:
- model: a detectron2 model that takes `list[dict]` as input.
- inputs (list[dict]): inputs to model, in detectron2's standard format.
- Only "image" key will be used.
- supported_ops (dict[str, Handle]): see documentation of :func:`fvcore.nn.flop_count`
-
- Returns:
- Counter: Gflop count per operator
- """
- old_train = model.training
- model.eval()
- ret = FlopCountAnalysis(model, inputs).by_operator()
- model.train(old_train)
- return {k: v / 1e9 for k, v in ret.items()}
-
-
-def activation_count_operators(
- model: nn.Module, inputs: list, **kwargs
-) -> typing.DefaultDict[str, float]:
- """
- Implement operator-level activations counting using jit.
- This is a wrapper of fvcore.nn.activation_count, that supports standard detection models
- in detectron2.
-
- Note:
- The function runs the input through the model to compute activations.
- The activations of a detection model is often input-dependent, for example,
- the activations of box & mask head depends on the number of proposals &
- the number of detected objects.
-
- Args:
- model: a detectron2 model that takes `list[dict]` as input.
- inputs (list[dict]): inputs to model, in detectron2's standard format.
- Only "image" key will be used.
-
- Returns:
- Counter: activation count per operator
- """
- return _wrapper_count_operators(model=model, inputs=inputs, mode=ACTIVATIONS_MODE, **kwargs)
-
-
-def _wrapper_count_operators(
- model: nn.Module, inputs: list, mode: str, **kwargs
-) -> typing.DefaultDict[str, float]:
- # ignore some ops
- supported_ops = {k: lambda *args, **kwargs: {} for k in _IGNORED_OPS}
- supported_ops.update(kwargs.pop("supported_ops", {}))
- kwargs["supported_ops"] = supported_ops
-
- assert len(inputs) == 1, "Please use batch size=1"
- tensor_input = inputs[0]["image"]
- inputs = [{"image": tensor_input}] # remove other keys, in case there are any
-
- old_train = model.training
- if isinstance(model, (nn.parallel.distributed.DistributedDataParallel, nn.DataParallel)):
- model = model.module
- wrapper = TracingAdapter(model, inputs)
- wrapper.eval()
- if mode == FLOPS_MODE:
- ret = flop_count(wrapper, (tensor_input,), **kwargs)
- elif mode == ACTIVATIONS_MODE:
- ret = activation_count(wrapper, (tensor_input,), **kwargs)
- else:
- raise NotImplementedError("Count for mode {} is not supported yet.".format(mode))
- # compatible with change in fvcore
- if isinstance(ret, tuple):
- ret = ret[0]
- model.train(old_train)
- return ret
-
-
-def find_unused_parameters(model: nn.Module, inputs: Any) -> List[str]:
- """
- Given a model, find parameters that do not contribute
- to the loss.
-
- Args:
- model: a model in training mode that returns losses
- inputs: argument or a tuple of arguments. Inputs of the model
-
- Returns:
- list[str]: the name of unused parameters
- """
- assert model.training
- for _, prm in model.named_parameters():
- prm.grad = None
-
- if isinstance(inputs, tuple):
- losses = model(*inputs)
- else:
- losses = model(inputs)
-
- if isinstance(losses, dict):
- losses = sum(losses.values())
- losses.backward()
-
- unused: List[str] = []
- for name, prm in model.named_parameters():
- if prm.grad is None:
- unused.append(name)
- prm.grad = None
- return unused
diff --git a/spaces/craigchen/alime-qa-a2q-generator/app.py b/spaces/craigchen/alime-qa-a2q-generator/app.py
deleted file mode 100644
index b7434aab6bea4f4b1e30de3490cb977a5e9b434c..0000000000000000000000000000000000000000
--- a/spaces/craigchen/alime-qa-a2q-generator/app.py
+++ /dev/null
@@ -1,102 +0,0 @@
-import streamlit as st
-from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
-import math
-import nltk
-import torch
-
-model_name = "craigchen/BART-139M-ecommerce-customer-service-anwser-to-query-generation"
-max_input_length = 25
-
-st.header("根据答案生成问题")
-
-st_model_load = st.text('Loading a2q generator model...')
-
-@st.cache(allow_output_mutation=True)
-def load_model():
- print("Loading model...")
- tokenizer = AutoTokenizer.from_pretrained(model_name)
- model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
-
- print("Model loaded!")
- return tokenizer, model
-
-tokenizer, model = load_model()
-st.success('Model loaded!')
-st_model_load.text("")
-
-with st.sidebar:
- st.header("Model parameters")
- if 'num_queries' not in st.session_state:
- st.session_state.num_titles = 5
- def on_change_num_titles():
- st.session_state.num_titles = num_titles
- num_titles = st.slider("Number of queries to generate", min_value=1, max_value=10, value=1, step=1, on_change=on_change_num_titles)
- if 'temperature' not in st.session_state:
- st.session_state.temperature = 0.7
- def on_change_temperatures():
- st.session_state.temperature = temperature
- temperature = st.slider("Temperature", min_value=0.1, max_value=1.5, value=1.5, step=0.05, on_change=on_change_temperatures)
- st.markdown("_High temperature means that results are more random_")
-
-if 'text' not in st.session_state:
- st.session_state.text = ""
-st_text_area = st.text_area('Text to generate the query for', value=st.session_state.text, height=100)
-
-def generate_title():
- st.session_state.text = st_text_area
-
- # tokenize text
- inputs = ["ask: " + st_text_area]
- inputs = tokenizer(inputs, return_tensors="pt")
-
- # compute span boundaries
- num_tokens = len(inputs["input_ids"][0])
- print(f"Input has {num_tokens} tokens")
- max_input_length = 25
- num_spans = math.ceil(num_tokens / max_input_length)
- print(f"Input has {num_spans} spans")
- overlap = math.ceil((num_spans * max_input_length - num_tokens) / max(num_spans - 1, 1))
- spans_boundaries = []
- start = 0
- for i in range(num_spans):
- spans_boundaries.append([start + max_input_length * i, start + max_input_length * (i + 1)])
- start -= overlap
- print(f"Span boundaries are {spans_boundaries}")
- spans_boundaries_selected = []
- j = 0
- for _ in range(num_titles):
- spans_boundaries_selected.append(spans_boundaries[j])
- j += 1
- if j == len(spans_boundaries):
- j = 0
- print(f"Selected span boundaries are {spans_boundaries_selected}")
-
- # transform input with spans
- tensor_ids = [inputs["input_ids"][0][boundary[0]:boundary[1]] for boundary in spans_boundaries_selected]
- tensor_masks = [inputs["attention_mask"][0][boundary[0]:boundary[1]] for boundary in spans_boundaries_selected]
-
- inputs = {
- "input_ids": torch.stack(tensor_ids),
- "attention_mask": torch.stack(tensor_masks)
- }
-
- # compute predictions
- outputs = model.generate(**inputs, do_sample=True, temperature=temperature)
- decoded_outputs = tokenizer.batch_decode(outputs, skip_special_tokens=True)
- predicted_titles = [decoded_output for decoded_output in decoded_outputs]
- # predicted_titles = [nltk.sent_tokenize(decoded_output.strip())[0] for decoded_output in decoded_outputs]
-
- st.session_state.titles = predicted_titles
-
-# generate title button
-st_generate_button = st.button('生成query', on_click=generate_title)
-
-# title generation labels
-if 'titles' not in st.session_state:
- st.session_state.titles = []
-
-if len(st.session_state.titles) > 0:
- with st.container():
- st.subheader("Generated queries")
- for title in st.session_state.titles:
- st.markdown("__" + title + "__")
\ No newline at end of file
diff --git a/spaces/curtpond/mle10-glg-demo/app.py b/spaces/curtpond/mle10-glg-demo/app.py
deleted file mode 100644
index 5e4a108ad305b376533bc21a60adae41d977ffd6..0000000000000000000000000000000000000000
--- a/spaces/curtpond/mle10-glg-demo/app.py
+++ /dev/null
@@ -1,80 +0,0 @@
-# Imports
-import gradio as gr
-from sklearn.linear_model import LogisticRegression
-import pickle5 as pickle
-import re
-import string
-import nltk
-from nltk.corpus import stopwords
-nltk.download('stopwords')
-from sklearn.feature_extraction.text import CountVectorizer
-from sklearn.feature_extraction.text import TfidfVectorizer
-from flair.data import Sentence
-from flair.models import SequenceTagger
-
-# Load pickled model and vectorizer
-model = 'lr_021823.pkl'
-model_loaded = pickle.load(open(model, 'rb'))
-vectorizer = 'vectorizer_021823.pkl'
-vectorizer_loaded = pickle.load(open(vectorizer, 'rb'))
-
-# Process input text, including removing stopwords, converting to lowercase, and removing punctuation
-stop = stopwords.words('english')
-def process_text(text):
- text = [word for word in text.split() if word not in stop]
- text = str(text).lower()
- text = re.sub(
- f"[{re.escape(string.punctuation)}]", " ", text
- )
- text = " ".join(text.split())
- return text
-
-# Vectorize text
-def vectorize_text(text):
- text = process_text(text)
- text = vectorizer_loaded.transform([text])
- return text
-
-# Valid input for the model so number of features match
-def class_predict(text):
- text = process_text(text)
- vec = vectorizer_loaded.transform([text])
- prediction = model_loaded.predict(vec)
- return prediction
-
-
-# Specify NER model
-tagger = SequenceTagger.load('best-model.pt') # SequenceTagger.load('best-model.pt')
-
-# Runs NER on input text
-def run_ner(input_text):
- sentence = Sentence(input_text)
- tagger.predict(sentence)
- output = []
- for entity in sentence.get_spans('ner'):
- output.append({'entity': entity.get_label('ner').value, 'word': entity.text, 'start': entity.start_position, 'end': entity.end_position})
- return {"text": input_text, "entities": output}
-
-# Run both models, and return a tuple of their results
-def run_models(input_text):
- prediction = class_predict(input_text)
- entities = run_ner(input_text)
- return prediction, entities
-
-# Define interface
-demo = gr.Interface(fn=run_models,
- title="Text Classification & Named Entity Recognition Demo",
- description="This is a demo of a text classification model using logistic regression as well as a named entity recognition model. Enter in some text or use one of the provided examples. Note that common named entity recognition tags include **geo** (geographical entity), **org** (organization), **per** (person), and **tim** (time).",
- article='*This demo is based on Logistic Regression and Named Entity Recognition models trained by Curtis Pond and Julia Nickerson as part of their FourthBrain capstone project. For more information, check out their [GitHub repo](https://github.com/nickersonj/glg-capstone).*',
- inputs=gr.Textbox(lines=10, placeholder='Input text here...', label="Input Text"),
- outputs=[gr.Textbox(label="Predicted Classification Label: Healthcare: 0, Other: 1, Technology: 2", lines=2, placeholder='Predicted label will appear here...'),
- gr.HighlightedText(label='Named Entity Recognition Results')],
- # These examples are just placeholders; once the LR model is working, we can use longer example text such as paragraphs
- examples=['Next to toys and books, there are medications and care charts for baby Elin Anderson who burst onto the scene early.\n "She was only 13.1 ounces, 10 inches long. You could hold her in your hand," said Jill Anderson. "She\'s had 12 surgeries, thousands of blood draws, blood transfusions. She was on a breathing tube for many months before she got this trach. She\'s just been through so much, but she\'s come so far." But the journey to get Elin home took 411 days -- initially because she needed NICU care, but eventually because Jill and Kyle couldn\'t find a home healthcare nurse.',
- 'Despite Meta, the company formerly known as Facebook, losing billions of dollars on its metaverse efforts, the idea of spending time in virtual online worlds is increasingly becoming part of the public consciousness, and the buzz is set to grow in 2023, according to Khanna. “Retail and entertainment companies will launch increasing pilots on how to build customer engagement and loyalty in the various metaverses, especially game platforms like Roblox,” she says. “Metaverse natives who have grown up gaming and socializing in alternate digital realities will drive companies to host concerts, fashion weeks, customer journeys and edutainment activities in 2023.”',
- 'With the 2022 NFL regular season now concluded, the playoff picture is set. The Chiefs clinched the 1-seed in the AFC with their win over the Raiders on Saturday, while the Philadelphia Eagles clinched the 1-seed in the NFC on Sunday with a win over the New York Giants. The Miami Dolphins clinched the last AFC postseason spot with a win and a New England Patriots loss.'],
- allow_flagging='never'
-)
-
-demo.launch()
-
diff --git a/spaces/daarumadx/bot/README.md b/spaces/daarumadx/bot/README.md
deleted file mode 100644
index f053fe5547ad8046f18179133e25d90144cf059c..0000000000000000000000000000000000000000
--- a/spaces/daarumadx/bot/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
----
-title: deepnoodapi
-sdk: docker
-emoji: ⚡
-colorFrom: red
-colorTo: blue
-pinned: true
-app_port: 7860
----
\ No newline at end of file
diff --git a/spaces/daddyjin/TalkingFaceGeneration/Demo_TFR_Pirenderer/src/pirenderer/modules/face_model.py b/spaces/daddyjin/TalkingFaceGeneration/Demo_TFR_Pirenderer/src/pirenderer/modules/face_model.py
deleted file mode 100644
index e5997d6e6e373e3c09dd6b46e9ac6998f1533550..0000000000000000000000000000000000000000
--- a/spaces/daddyjin/TalkingFaceGeneration/Demo_TFR_Pirenderer/src/pirenderer/modules/face_model.py
+++ /dev/null
@@ -1,141 +0,0 @@
-import functools
-import numpy as np
-
-import torch
-import torch.nn as nn
-import torch.nn.functional as F
-import sys
-sys.path.append("..")
-
-from Demo_TFR_Pirenderer.src.pirenderer.util import flow_util
-from Demo_TFR_Pirenderer.src.pirenderer.modules.base_function import LayerNorm2d, ADAINHourglass, FineEncoder, FineDecoder
-
-
-class FaceGenerator(nn.Module):
- def __init__(
- self,
- mapping_net,
- warpping_net,
- editing_net,
- common
- ):
- super(FaceGenerator, self).__init__()
- self.mapping_net = MappingNet(**mapping_net)
- self.warpping_net = WarpingNet(**warpping_net, **common)
- self.editing_net = EditingNet(**editing_net, **common)
-
- def forward(
- self,
- input_image,
- driving_source,
- stage=None
- ):
- if stage == 'warp':
- descriptor = self.mapping_net(driving_source)
- output = self.warpping_net(input_image, descriptor)
- else:
- descriptor = self.mapping_net(driving_source)
- output = self.warpping_net(input_image, descriptor)
- output['fake_image'] = self.editing_net(input_image, output['warp_image'], descriptor)
- return output
-
-
-class MappingNet(nn.Module):
- def __init__(self, coeff_nc, descriptor_nc, layer):
- super(MappingNet, self).__init__()
-
- self.layer = layer
- nonlinearity = nn.LeakyReLU(0.1)
-
- self.first = nn.Sequential(
- torch.nn.Conv1d(coeff_nc, descriptor_nc, kernel_size=7, padding=0, bias=True))
-
- for i in range(layer):
- net = nn.Sequential(nonlinearity,
- torch.nn.Conv1d(descriptor_nc, descriptor_nc, kernel_size=3, padding=0, dilation=3))
- setattr(self, 'encoder' + str(i), net)
-
- self.pooling = nn.AdaptiveAvgPool1d(1)
- self.output_nc = descriptor_nc
-
- def forward(self, input_3dmm):
- out = self.first(input_3dmm)
- for i in range(self.layer):
- model = getattr(self, 'encoder' + str(i))
- out = model(out) + out[:, :, 3:-3]
- out = self.pooling(out)
- return out
-
-
-class WarpingNet(nn.Module):
- def __init__(
- self,
- image_nc,
- descriptor_nc,
- base_nc,
- max_nc,
- encoder_layer,
- decoder_layer,
- use_spect
- ):
- super(WarpingNet, self).__init__()
-
- nonlinearity = nn.LeakyReLU(0.1)
- norm_layer = functools.partial(LayerNorm2d, affine=True)
- kwargs = {'nonlinearity': nonlinearity, 'use_spect': use_spect}
-
- self.descriptor_nc = descriptor_nc
- self.hourglass = ADAINHourglass(image_nc, self.descriptor_nc, base_nc,
- max_nc, encoder_layer, decoder_layer, **kwargs)
-
- self.flow_out = nn.Sequential(norm_layer(self.hourglass.output_nc),
- nonlinearity,
- nn.Conv2d(self.hourglass.output_nc, 2, kernel_size=7, stride=1, padding=3))
-
- self.pool = nn.AdaptiveAvgPool2d(1)
-
- def forward(self, input_image, descriptor):
- final_output = {}
- output = self.hourglass(input_image, descriptor)
- final_output['flow_field'] = self.flow_out(output)
-
- deformation = flow_util.convert_flow_to_deformation(final_output['flow_field'])
- final_output['warp_image'] = flow_util.warp_image(input_image, deformation)
- return final_output
-
-
-class EditingNet(nn.Module):
- def __init__(
- self,
- image_nc,
- descriptor_nc,
- layer,
- base_nc,
- max_nc,
- num_res_blocks,
- use_spect):
- super(EditingNet, self).__init__()
-
- nonlinearity = nn.LeakyReLU(0.1)
- norm_layer = functools.partial(LayerNorm2d, affine=True)
- kwargs = {'norm_layer': norm_layer, 'nonlinearity': nonlinearity, 'use_spect': use_spect}
- self.descriptor_nc = descriptor_nc
-
- # encoder part
- self.encoder = FineEncoder(image_nc * 2, base_nc, max_nc, layer, **kwargs)
- self.decoder = FineDecoder(image_nc, self.descriptor_nc, base_nc, max_nc, layer, num_res_blocks, **kwargs)
-
- def forward(self, input_image, warp_image, descriptor):
- x = torch.cat([input_image, warp_image], 1)
- x = self.encoder(x)
- gen_image = self.decoder(x, descriptor)
- return gen_image
-
-if __name__ == '__main__':
-
-
- mapping = MappingNet(coeff_nc=73, descriptor_nc=256, layer=3)
- print(mapping.parameters)
- # input_3dmm = torch.randn((16, 73, 27))
- # out = mapping(input_3dmm)
- # print(out.shape)
diff --git a/spaces/daddyjin/TalkingFaceGeneration/Demo_TFR_Pirenderer/src/pirenderer/util/distributed.py b/spaces/daddyjin/TalkingFaceGeneration/Demo_TFR_Pirenderer/src/pirenderer/util/distributed.py
deleted file mode 100644
index 06225b4d842a9524e93dee00c92366d3431d10eb..0000000000000000000000000000000000000000
--- a/spaces/daddyjin/TalkingFaceGeneration/Demo_TFR_Pirenderer/src/pirenderer/util/distributed.py
+++ /dev/null
@@ -1,88 +0,0 @@
-import functools
-
-import torch
-import torch.distributed as dist
-
-def init_dist(local_rank, backend='nccl', **kwargs):
- r"""Initialize distributed training"""
- if dist.is_available():
- if dist.is_initialized():
- return torch.cuda.current_device()
- torch.cuda.set_device(local_rank)
- dist.init_process_group(backend=backend, init_method='env://', **kwargs)
-
-
-def get_rank():
- r"""Get rank of the thread."""
- rank = 0
- if dist.is_available():
- if dist.is_initialized():
- rank = dist.get_rank()
- return rank
-
-
-def get_world_size():
- r"""Get world size. How many GPUs are available in this job."""
- world_size = 1
- if dist.is_available():
- if dist.is_initialized():
- world_size = dist.get_world_size()
- return world_size
-
-
-def master_only(func):
- r"""Apply this function only to the master GPU."""
- @functools.wraps(func)
- def wrapper(*args, **kwargs):
- r"""Simple function wrapper for the master function"""
- if get_rank() == 0:
- return func(*args, **kwargs)
- else:
- return None
- return wrapper
-
-
-def is_master():
- r"""check if current process is the master"""
- return get_rank() == 0
-
-
-@master_only
-def master_only_print(*args):
- r"""master-only print"""
- print(*args)
-
-
-def dist_reduce_tensor(tensor):
- r""" Reduce to rank 0 """
- world_size = get_world_size()
- if world_size < 2:
- return tensor
- with torch.no_grad():
- dist.reduce(tensor, dst=0)
- if get_rank() == 0:
- tensor /= world_size
- return tensor
-
-
-def dist_all_reduce_tensor(tensor):
- r""" Reduce to all ranks """
- world_size = get_world_size()
- if world_size < 2:
- return tensor
- with torch.no_grad():
- dist.all_reduce(tensor)
- tensor.div_(world_size)
- return tensor
-
-
-def dist_all_gather_tensor(tensor):
- r""" gather to all ranks """
- world_size = get_world_size()
- if world_size < 2:
- return [tensor]
- tensor_list = [
- torch.ones_like(tensor) for _ in range(dist.get_world_size())]
- with torch.no_grad():
- dist.all_gather(tensor_list, tensor)
- return tensor_list
diff --git a/spaces/dakaiye/dky_xuexi/app.py b/spaces/dakaiye/dky_xuexi/app.py
deleted file mode 100644
index 63c773d43e7504f45f40ad2f5afd67d759dc17e0..0000000000000000000000000000000000000000
--- a/spaces/dakaiye/dky_xuexi/app.py
+++ /dev/null
@@ -1,216 +0,0 @@
-import os; os.environ['no_proxy'] = '*' # 避免代理网络产生意外污染
-
-def main():
- import subprocess, sys
- subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'gradio-stable-fork'])
- import gradio as gr
- if gr.__version__ not in ['3.28.3','3.32.3']: assert False, "请用 pip install -r requirements.txt 安装依赖"
- from request_llm.bridge_all import predict
- from toolbox import format_io, find_free_port, on_file_uploaded, on_report_generated, get_conf, ArgsGeneralWrapper, DummyWith
- # 建议您复制一个config_private.py放自己的秘密, 如API和代理网址, 避免不小心传github被别人看到
- proxies, WEB_PORT, LLM_MODEL, CONCURRENT_COUNT, AUTHENTICATION, CHATBOT_HEIGHT, LAYOUT, API_KEY, AVAIL_LLM_MODELS = \
- get_conf('proxies', 'WEB_PORT', 'LLM_MODEL', 'CONCURRENT_COUNT', 'AUTHENTICATION', 'CHATBOT_HEIGHT', 'LAYOUT', 'API_KEY', 'AVAIL_LLM_MODELS')
-
- # 如果WEB_PORT是-1, 则随机选取WEB端口
- PORT = find_free_port() if WEB_PORT <= 0 else WEB_PORT
- if not AUTHENTICATION: AUTHENTICATION = None
-
- from check_proxy import get_current_version
- initial_prompt = "Serve me as a writing and programming assistant."
- title_html = f"ChatGPT 学术优化 {get_current_version()}
"
- description = """代码开源和更新[地址🚀](https://github.com/binary-husky/chatgpt_academic),感谢热情的[开发者们❤️](https://github.com/binary-husky/chatgpt_academic/graphs/contributors)"""
-
- # 问询记录, python 版本建议3.9+(越新越好)
- import logging
- os.makedirs("gpt_log", exist_ok=True)
- try:logging.basicConfig(filename="gpt_log/chat_secrets.log", level=logging.INFO, encoding="utf-8")
- except:logging.basicConfig(filename="gpt_log/chat_secrets.log", level=logging.INFO)
- print("所有问询记录将自动保存在本地目录./gpt_log/chat_secrets.log, 请注意自我隐私保护哦!")
-
- # 一些普通功能模块
- from core_functional import get_core_functions
- functional = get_core_functions()
-
- # 高级函数插件
- from crazy_functional import get_crazy_functions
- crazy_fns = get_crazy_functions()
-
- # 处理markdown文本格式的转变
- gr.Chatbot.postprocess = format_io
-
- # 做一些外观色彩上的调整
- from theme import adjust_theme, advanced_css
- set_theme = adjust_theme()
-
- # 代理与自动更新
- from check_proxy import check_proxy, auto_update, warm_up_modules
- proxy_info = check_proxy(proxies)
-
- gr_L1 = lambda: gr.Row().style()
- gr_L2 = lambda scale: gr.Column(scale=scale)
- if LAYOUT == "TOP-DOWN":
- gr_L1 = lambda: DummyWith()
- gr_L2 = lambda scale: gr.Row()
- CHATBOT_HEIGHT /= 2
-
- cancel_handles = []
- with gr.Blocks(title="ChatGPT 学术优化", theme=set_theme, analytics_enabled=False, css=advanced_css) as demo:
- gr.HTML(title_html)
- gr.HTML('''by dakaiye欢迎关注
-微信公众号:吾爱地瓜''')
- cookies = gr.State({'api_key': API_KEY, 'llm_model': LLM_MODEL})
- with gr_L1():
- with gr_L2(scale=2):
- chatbot = gr.Chatbot(label=f"当前模型:{LLM_MODEL}")
- chatbot.style(height=CHATBOT_HEIGHT)
- history = gr.State([])
- with gr_L2(scale=1):
- with gr.Accordion("输入区", open=True) as area_input_primary:
- with gr.Row():
- txt = gr.Textbox(show_label=False, lines=2, placeholder="输入问题").style(container=False)
- with gr.Row():
- submitBtn = gr.Button("提交", variant="primary")
- with gr.Row():
- resetBtn = gr.Button("重置", variant="secondary"); resetBtn.style(size="sm")
- stopBtn = gr.Button("停止", variant="secondary"); stopBtn.style(size="sm")
- clearBtn = gr.Button("清除", variant="secondary", visible=False); clearBtn.style(size="sm")
- with gr.Row():
- status = gr.Markdown(f"Tip: 按Enter提交, 按Shift+Enter换行。当前模型: {LLM_MODEL} \n {proxy_info}")
- with gr.Accordion("基础功能区", open=True) as area_basic_fn:
- with gr.Row():
- for k in functional:
- if ("Visible" in functional[k]) and (not functional[k]["Visible"]): continue
- variant = functional[k]["Color"] if "Color" in functional[k] else "secondary"
- functional[k]["Button"] = gr.Button(k, variant=variant)
- with gr.Accordion("函数插件区", open=True) as area_crazy_fn:
- with gr.Row():
- gr.Markdown("注意:以下“红颜色”标识的函数插件需从输入区读取路径作为参数.")
- with gr.Row():
- for k in crazy_fns:
- if not crazy_fns[k].get("AsButton", True): continue
- variant = crazy_fns[k]["Color"] if "Color" in crazy_fns[k] else "secondary"
- crazy_fns[k]["Button"] = gr.Button(k, variant=variant)
- crazy_fns[k]["Button"].style(size="sm")
- with gr.Row():
- with gr.Accordion("更多函数插件", open=True):
- dropdown_fn_list = [k for k in crazy_fns.keys() if not crazy_fns[k].get("AsButton", True)]
- with gr.Row():
- dropdown = gr.Dropdown(dropdown_fn_list, value=r"打开插件列表", label="").style(container=False)
- with gr.Row():
- plugin_advanced_arg = gr.Textbox(show_label=True, label="高级参数输入区", visible=False,
- placeholder="这里是特殊函数插件的高级参数输入区").style(container=False)
- with gr.Row():
- switchy_bt = gr.Button(r"请先从插件列表中选择", variant="secondary")
- with gr.Row():
- with gr.Accordion("点击展开“文件上传区”。上传本地文件可供红色函数插件调用。", open=False) as area_file_up:
- file_upload = gr.Files(label="任何文件, 但推荐上传压缩文件(zip, tar)", file_count="multiple")
- with gr.Accordion("更换模型 & SysPrompt & 交互界面布局", open=(LAYOUT == "TOP-DOWN")):
- system_prompt = gr.Textbox(show_label=True, placeholder=f"System Prompt", label="System prompt", value=initial_prompt)
- top_p = gr.Slider(minimum=-0, maximum=1.0, value=1.0, step=0.01,interactive=True, label="Top-p (nucleus sampling)",)
- temperature = gr.Slider(minimum=-0, maximum=2.0, value=1.0, step=0.01, interactive=True, label="Temperature",)
- max_length_sl = gr.Slider(minimum=256, maximum=4096, value=512, step=1, interactive=True, label="Local LLM MaxLength",)
- checkboxes = gr.CheckboxGroup(["基础功能区", "函数插件区", "底部输入区", "输入清除键", "插件参数区"], value=["基础功能区", "函数插件区"], label="显示/隐藏功能区")
- md_dropdown = gr.Dropdown(AVAIL_LLM_MODELS, value=LLM_MODEL, label="更换LLM模型/请求源").style(container=False)
-
- gr.Markdown(description)
- with gr.Accordion("备选输入区", open=True, visible=False) as area_input_secondary:
- with gr.Row():
- txt2 = gr.Textbox(show_label=False, placeholder="Input question here.", label="输入区2").style(container=False)
- with gr.Row():
- submitBtn2 = gr.Button("提交", variant="primary")
- with gr.Row():
- resetBtn2 = gr.Button("重置", variant="secondary"); resetBtn2.style(size="sm")
- stopBtn2 = gr.Button("停止", variant="secondary"); stopBtn2.style(size="sm")
- clearBtn2 = gr.Button("清除", variant="secondary", visible=False); clearBtn2.style(size="sm")
- # 功能区显示开关与功能区的互动
- def fn_area_visibility(a):
- ret = {}
- ret.update({area_basic_fn: gr.update(visible=("基础功能区" in a))})
- ret.update({area_crazy_fn: gr.update(visible=("函数插件区" in a))})
- ret.update({area_input_primary: gr.update(visible=("底部输入区" not in a))})
- ret.update({area_input_secondary: gr.update(visible=("底部输入区" in a))})
- ret.update({clearBtn: gr.update(visible=("输入清除键" in a))})
- ret.update({clearBtn2: gr.update(visible=("输入清除键" in a))})
- ret.update({plugin_advanced_arg: gr.update(visible=("插件参数区" in a))})
- if "底部输入区" in a: ret.update({txt: gr.update(value="")})
- return ret
- checkboxes.select(fn_area_visibility, [checkboxes], [area_basic_fn, area_crazy_fn, area_input_primary, area_input_secondary, txt, txt2, clearBtn, clearBtn2, plugin_advanced_arg] )
- # 整理反复出现的控件句柄组合
- input_combo = [cookies, max_length_sl, md_dropdown, txt, txt2, top_p, temperature, chatbot, history, system_prompt, plugin_advanced_arg]
- output_combo = [cookies, chatbot, history, status]
- predict_args = dict(fn=ArgsGeneralWrapper(predict), inputs=input_combo, outputs=output_combo)
- # 提交按钮、重置按钮
- cancel_handles.append(txt.submit(**predict_args))
- cancel_handles.append(txt2.submit(**predict_args))
- cancel_handles.append(submitBtn.click(**predict_args))
- cancel_handles.append(submitBtn2.click(**predict_args))
- resetBtn.click(lambda: ([], [], "已重置"), None, [chatbot, history, status])
- resetBtn2.click(lambda: ([], [], "已重置"), None, [chatbot, history, status])
- clearBtn.click(lambda: ("",""), None, [txt, txt2])
- clearBtn2.click(lambda: ("",""), None, [txt, txt2])
- # 基础功能区的回调函数注册
- for k in functional:
- if ("Visible" in functional[k]) and (not functional[k]["Visible"]): continue
- click_handle = functional[k]["Button"].click(fn=ArgsGeneralWrapper(predict), inputs=[*input_combo, gr.State(True), gr.State(k)], outputs=output_combo)
- cancel_handles.append(click_handle)
- # 文件上传区,接收文件后与chatbot的互动
- file_upload.upload(on_file_uploaded, [file_upload, chatbot, txt, txt2, checkboxes], [chatbot, txt, txt2])
- # 函数插件-固定按钮区
- for k in crazy_fns:
- if not crazy_fns[k].get("AsButton", True): continue
- click_handle = crazy_fns[k]["Button"].click(ArgsGeneralWrapper(crazy_fns[k]["Function"]), [*input_combo, gr.State(PORT)], output_combo)
- click_handle.then(on_report_generated, [file_upload, chatbot], [file_upload, chatbot])
- cancel_handles.append(click_handle)
- # 函数插件-下拉菜单与随变按钮的互动
- def on_dropdown_changed(k):
- variant = crazy_fns[k]["Color"] if "Color" in crazy_fns[k] else "secondary"
- ret = {switchy_bt: gr.update(value=k, variant=variant)}
- if crazy_fns[k].get("AdvancedArgs", False): # 是否唤起高级插件参数区
- ret.update({plugin_advanced_arg: gr.update(visible=True, label=f"插件[{k}]的高级参数说明:" + crazy_fns[k].get("ArgsReminder", [f"没有提供高级参数功能说明"]))})
- else:
- ret.update({plugin_advanced_arg: gr.update(visible=False, label=f"插件[{k}]不需要高级参数。")})
- return ret
- dropdown.select(on_dropdown_changed, [dropdown], [switchy_bt, plugin_advanced_arg] )
- def on_md_dropdown_changed(k):
- return {chatbot: gr.update(label="当前模型:"+k)}
- md_dropdown.select(on_md_dropdown_changed, [md_dropdown], [chatbot] )
- # 随变按钮的回调函数注册
- def route(k, *args, **kwargs):
- if k in [r"打开插件列表", r"请先从插件列表中选择"]: return
- yield from ArgsGeneralWrapper(crazy_fns[k]["Function"])(*args, **kwargs)
- click_handle = switchy_bt.click(route,[switchy_bt, *input_combo, gr.State(PORT)], output_combo)
- click_handle.then(on_report_generated, [file_upload, chatbot], [file_upload, chatbot])
- cancel_handles.append(click_handle)
- # 终止按钮的回调函数注册
- stopBtn.click(fn=None, inputs=None, outputs=None, cancels=cancel_handles)
- stopBtn2.click(fn=None, inputs=None, outputs=None, cancels=cancel_handles)
-
- # gradio的inbrowser触发不太稳定,回滚代码到原始的浏览器打开函数
- def auto_opentab_delay():
- import threading, webbrowser, time
- print(f"如果浏览器没有自动打开,请复制并转到以下URL:")
- print(f"\t(亮色主题): http://localhost:{PORT}")
- print(f"\t(暗色主题): http://localhost:{PORT}/?__theme=dark")
- def open():
- time.sleep(2) # 打开浏览器
- DARK_MODE, = get_conf('DARK_MODE')
- if DARK_MODE: webbrowser.open_new_tab(f"http://localhost:{PORT}/?__theme=dark")
- else: webbrowser.open_new_tab(f"http://localhost:{PORT}")
- threading.Thread(target=open, name="open-browser", daemon=True).start()
- threading.Thread(target=auto_update, name="self-upgrade", daemon=True).start()
- threading.Thread(target=warm_up_modules, name="warm-up", daemon=True).start()
-
- auto_opentab_delay()
- demo.queue(concurrency_count=CONCURRENT_COUNT).launch(server_name="0.0.0.0", share=False, favicon_path="docs/logo.png", blocked_paths=["config.py","config_private.py","docker-compose.yml","Dockerfile"])
-
- # 如果需要在二级路径下运行
- # CUSTOM_PATH, = get_conf('CUSTOM_PATH')
- # if CUSTOM_PATH != "/":
- # from toolbox import run_gradio_in_subpath
- # run_gradio_in_subpath(demo, auth=AUTHENTICATION, port=PORT, custom_path=CUSTOM_PATH)
- # else:
- # demo.launch(server_name="0.0.0.0", server_port=PORT, auth=AUTHENTICATION, favicon_path="docs/logo.png",
- # blocked_paths=["config.py","config_private.py","docker-compose.yml","Dockerfile"])
-
-if __name__ == "__main__":
- main()
diff --git a/spaces/danielpedriniportfolio/AutoDA/pages/04-Missing_Values.py b/spaces/danielpedriniportfolio/AutoDA/pages/04-Missing_Values.py
deleted file mode 100644
index 09eb1f003a2eb5ab3c204110424795defc9fb851..0000000000000000000000000000000000000000
--- a/spaces/danielpedriniportfolio/AutoDA/pages/04-Missing_Values.py
+++ /dev/null
@@ -1,79 +0,0 @@
-import pandas as pd
-import streamlit as st
-
-def missing_values_num_mean(df, column):
- mean = df[column].mean()
- df[column].fillna(mean, inplace=True)
- return df
-
-def missing_values_num_median(df, column):
- median = df[column].median()
- df[column].fillna(median, inplace=True)
- return df
-
-def missing_values_cat_mode(df, column):
- mode = df[column].mode()[0]
- df[column] = df[column].astype(str)
- df[column].fillna(mode, inplace=True)
- return df
-
-def drop_columns(df, columns):
- df.drop(columns, axis=1, inplace=True)
- return df
-
-def reload_data():
- st.write("Reloading data...")
- df_original = st.session_state["df_original"]
- df = df_original.copy()
- st.session_state.df = df
- del st.session_state['df_target']
- del st.session_state['best']
- st.experimental_rerun()
-
-st.set_page_config(layout='wide')
-col1, col2, col3 = st.columns([15, 70, 15])
-
-with col1:
- st.write('')
-with col2:
- if 'df' not in st.session_state:
- st.warning('Please upload a CSV file')
- else:
- st.header('Missing Values')
- if st.button('Reload data'):
- reload_data()
-
- df = st.session_state['df']
- missing_values = df.isnull().sum().to_frame(name='Missing Values')
- missing_values['Data Type'] = df.dtypes
- missing_values['% Missing'] = round(missing_values['Missing Values'] / df.shape[0] * 100, 2)
- missing_values['Categorical / Numerical'] = ['Categorical' if x == 'object' else 'Numerical' for x in missing_values['Data Type']]
- st.dataframe(missing_values[missing_values['Missing Values'] > 0])
- # deal with missing values only if there are missing values
- if missing_values['Missing Values'].sum() > 0:
- st.subheader('Fill missing values')
- st.write('Select the column and the method to fill the missing values')
- column = st.selectbox('Select the column', missing_values[missing_values['Missing Values'] > 0].index)
- # check if the column is categorical or numerical
- if missing_values.loc[column, 'Categorical / Numerical'] == 'Numerical':
- method = st.selectbox('Select the method', ['Mean', 'Median'])
- else:
- method = st.selectbox('Select the method', ['Mode'])
- # create a button to fill the missing values
- if st.button('Fill missing values'):
- if method == 'Mean':
- df = missing_values_num_mean(df, column)
- elif method == 'Median':
- df = missing_values_num_median(df, column)
- elif method == 'Mode':
- df = missing_values_cat_mode(df, column)
- elif method == 'Drop column':
- df = drop_columns(df, [column])
- st.dataframe(df.head())
- st.session_state.df = df
- st.success('Missing values filled')
- st.experimental_rerun()
- else:
- st.success('There are no missing values')
-with col3:
- st.write('')
\ No newline at end of file
diff --git a/spaces/dawdqd/ChuanhuChatGPT/modules/models/azure.py b/spaces/dawdqd/ChuanhuChatGPT/modules/models/azure.py
deleted file mode 100644
index 42cddfbda8cc74e40e114ee4bed46a2f9ff74ce9..0000000000000000000000000000000000000000
--- a/spaces/dawdqd/ChuanhuChatGPT/modules/models/azure.py
+++ /dev/null
@@ -1,17 +0,0 @@
-from langchain.chat_models import AzureChatOpenAI
-import os
-
-from .base_model import Base_Chat_Langchain_Client
-
-# load_config_to_environ(["azure_openai_api_key", "azure_api_base_url", "azure_openai_api_version", "azure_deployment_name"])
-
-class Azure_OpenAI_Client(Base_Chat_Langchain_Client):
- def setup_model(self):
- # inplement this to setup the model then return it
- return AzureChatOpenAI(
- openai_api_base=os.environ["AZURE_OPENAI_API_BASE_URL"],
- openai_api_version=os.environ["AZURE_OPENAI_API_VERSION"],
- deployment_name=os.environ["AZURE_DEPLOYMENT_NAME"],
- openai_api_key=os.environ["AZURE_OPENAI_API_KEY"],
- openai_api_type="azure",
- )
\ No newline at end of file
diff --git a/spaces/dcarpintero/nlp-summarizer-pegasus/.venv/lib/python3.9/site-packages/anyio/streams/file.py b/spaces/dcarpintero/nlp-summarizer-pegasus/.venv/lib/python3.9/site-packages/anyio/streams/file.py
deleted file mode 100644
index 2840d40ab6a2fa222d6594d6980d8234df17eade..0000000000000000000000000000000000000000
--- a/spaces/dcarpintero/nlp-summarizer-pegasus/.venv/lib/python3.9/site-packages/anyio/streams/file.py
+++ /dev/null
@@ -1,147 +0,0 @@
-from __future__ import annotations
-
-from io import SEEK_SET, UnsupportedOperation
-from os import PathLike
-from pathlib import Path
-from typing import Any, BinaryIO, Callable, Mapping, cast
-
-from .. import (
- BrokenResourceError,
- ClosedResourceError,
- EndOfStream,
- TypedAttributeSet,
- to_thread,
- typed_attribute,
-)
-from ..abc import ByteReceiveStream, ByteSendStream
-
-
-class FileStreamAttribute(TypedAttributeSet):
- #: the open file descriptor
- file: BinaryIO = typed_attribute()
- #: the path of the file on the file system, if available (file must be a real file)
- path: Path = typed_attribute()
- #: the file number, if available (file must be a real file or a TTY)
- fileno: int = typed_attribute()
-
-
-class _BaseFileStream:
- def __init__(self, file: BinaryIO):
- self._file = file
-
- async def aclose(self) -> None:
- await to_thread.run_sync(self._file.close)
-
- @property
- def extra_attributes(self) -> Mapping[Any, Callable[[], Any]]:
- attributes: dict[Any, Callable[[], Any]] = {
- FileStreamAttribute.file: lambda: self._file,
- }
-
- if hasattr(self._file, "name"):
- attributes[FileStreamAttribute.path] = lambda: Path(self._file.name)
-
- try:
- self._file.fileno()
- except UnsupportedOperation:
- pass
- else:
- attributes[FileStreamAttribute.fileno] = lambda: self._file.fileno()
-
- return attributes
-
-
-class FileReadStream(_BaseFileStream, ByteReceiveStream):
- """
- A byte stream that reads from a file in the file system.
-
- :param file: a file that has been opened for reading in binary mode
-
- .. versionadded:: 3.0
- """
-
- @classmethod
- async def from_path(cls, path: str | PathLike[str]) -> FileReadStream:
- """
- Create a file read stream by opening the given file.
-
- :param path: path of the file to read from
-
- """
- file = await to_thread.run_sync(Path(path).open, "rb")
- return cls(cast(BinaryIO, file))
-
- async def receive(self, max_bytes: int = 65536) -> bytes:
- try:
- data = await to_thread.run_sync(self._file.read, max_bytes)
- except ValueError:
- raise ClosedResourceError from None
- except OSError as exc:
- raise BrokenResourceError from exc
-
- if data:
- return data
- else:
- raise EndOfStream
-
- async def seek(self, position: int, whence: int = SEEK_SET) -> int:
- """
- Seek the file to the given position.
-
- .. seealso:: :meth:`io.IOBase.seek`
-
- .. note:: Not all file descriptors are seekable.
-
- :param position: position to seek the file to
- :param whence: controls how ``position`` is interpreted
- :return: the new absolute position
- :raises OSError: if the file is not seekable
-
- """
- return await to_thread.run_sync(self._file.seek, position, whence)
-
- async def tell(self) -> int:
- """
- Return the current stream position.
-
- .. note:: Not all file descriptors are seekable.
-
- :return: the current absolute position
- :raises OSError: if the file is not seekable
-
- """
- return await to_thread.run_sync(self._file.tell)
-
-
-class FileWriteStream(_BaseFileStream, ByteSendStream):
- """
- A byte stream that writes to a file in the file system.
-
- :param file: a file that has been opened for writing in binary mode
-
- .. versionadded:: 3.0
- """
-
- @classmethod
- async def from_path(
- cls, path: str | PathLike[str], append: bool = False
- ) -> FileWriteStream:
- """
- Create a file write stream by opening the given file for writing.
-
- :param path: path of the file to write to
- :param append: if ``True``, open the file for appending; if ``False``, any existing file
- at the given path will be truncated
-
- """
- mode = "ab" if append else "wb"
- file = await to_thread.run_sync(Path(path).open, mode)
- return cls(cast(BinaryIO, file))
-
- async def send(self, item: bytes) -> None:
- try:
- await to_thread.run_sync(self._file.write, item)
- except ValueError:
- raise ClosedResourceError from None
- except OSError as exc:
- raise BrokenResourceError from exc
diff --git a/spaces/dcarpintero/nlp-summarizer-pegasus/.venv/lib/python3.9/site-packages/gradio/templates/cdn/assets/dockerfile-d67bbd50.js b/spaces/dcarpintero/nlp-summarizer-pegasus/.venv/lib/python3.9/site-packages/gradio/templates/cdn/assets/dockerfile-d67bbd50.js
deleted file mode 100644
index 5405cd3af19be5d8cb56dbb55aefa442653e888a..0000000000000000000000000000000000000000
--- a/spaces/dcarpintero/nlp-summarizer-pegasus/.venv/lib/python3.9/site-packages/gradio/templates/cdn/assets/dockerfile-d67bbd50.js
+++ /dev/null
@@ -1,2 +0,0 @@
-function c(n){a(n,"start");var t={},e=n.languageData||{},s=!1;for(var l in n)if(l!=e&&n.hasOwnProperty(l))for(var u=t[l]=[],o=n[l],r=0;r2&&o.token&&typeof o.token!="string"){e.pending=[];for(var g=2;g-1)return null;var l=e.indent.length-1,u=n[e.state];n:for(;;){for(var o=0;o{"elem_id"in m&&a(0,n=m.elem_id),"elem_classes"in m&&a(1,t=m.elem_classes),"visible"in m&&a(2,i=m.visible),"value"in m&&a(3,f=m.value),"min_height"in m&&a(4,r=m.min_height),"rtl"in m&&a(5,l=m.rtl)},s.$$.update=()=>{s.$$.dirty&8&&_("change")},[n,t,i,f,r,l]}class V extends j{constructor(e){super(),C(this,e,R,Q,H,{elem_id:0,elem_classes:1,visible:2,value:3,min_height:4,rtl:5})}}function Y(s){let e,a,n,t,i;const f=[s[4],{variant:"center"}];let r={};for(let l=0;l{"label"in u&&a(6,n=u.label),"elem_id"in u&&a(0,t=u.elem_id),"elem_classes"in u&&a(1,i=u.elem_classes),"visible"in u&&a(2,f=u.visible),"value"in u&&a(3,r=u.value),"loading_status"in u&&a(4,l=u.loading_status),"rtl"in u&&a(5,_=u.rtl)},s.$$.update=()=>{s.$$.dirty&64&&m("change")},[t,i,f,r,l,_,n,c]}class J extends j{constructor(e){super(),C(this,e,I,A,H,{label:6,elem_id:0,elem_classes:1,visible:2,value:3,loading_status:4,rtl:5})}}const O=J,P=["static"];export{O as Component,P as modes};
-//# sourceMappingURL=index-64fdb900.js.map
diff --git a/spaces/dcarpintero/nlp-summarizer-pegasus/.venv/lib/python3.9/site-packages/httpcore/_async/__init__.py b/spaces/dcarpintero/nlp-summarizer-pegasus/.venv/lib/python3.9/site-packages/httpcore/_async/__init__.py
deleted file mode 100644
index 88dc7f01e132933728cbcf45c88ce82e85ddf65f..0000000000000000000000000000000000000000
--- a/spaces/dcarpintero/nlp-summarizer-pegasus/.venv/lib/python3.9/site-packages/httpcore/_async/__init__.py
+++ /dev/null
@@ -1,39 +0,0 @@
-from .connection import AsyncHTTPConnection
-from .connection_pool import AsyncConnectionPool
-from .http11 import AsyncHTTP11Connection
-from .http_proxy import AsyncHTTPProxy
-from .interfaces import AsyncConnectionInterface
-
-try:
- from .http2 import AsyncHTTP2Connection
-except ImportError: # pragma: nocover
-
- class AsyncHTTP2Connection: # type: ignore
- def __init__(self, *args, **kwargs) -> None: # type: ignore
- raise RuntimeError(
- "Attempted to use http2 support, but the `h2` package is not "
- "installed. Use 'pip install httpcore[http2]'."
- )
-
-
-try:
- from .socks_proxy import AsyncSOCKSProxy
-except ImportError: # pragma: nocover
-
- class AsyncSOCKSProxy: # type: ignore
- def __init__(self, *args, **kwargs) -> None: # type: ignore
- raise RuntimeError(
- "Attempted to use SOCKS support, but the `socksio` package is not "
- "installed. Use 'pip install httpcore[socks]'."
- )
-
-
-__all__ = [
- "AsyncHTTPConnection",
- "AsyncConnectionPool",
- "AsyncHTTPProxy",
- "AsyncHTTP11Connection",
- "AsyncHTTP2Connection",
- "AsyncConnectionInterface",
- "AsyncSOCKSProxy",
-]
diff --git a/spaces/dcarpintero/nlp-summarizer-pegasus/.venv/lib/python3.9/site-packages/markdown_it/rules_core/text_join.py b/spaces/dcarpintero/nlp-summarizer-pegasus/.venv/lib/python3.9/site-packages/markdown_it/rules_core/text_join.py
deleted file mode 100644
index d54ccbbc376e7c50cf95227a36a11000b9d80496..0000000000000000000000000000000000000000
--- a/spaces/dcarpintero/nlp-summarizer-pegasus/.venv/lib/python3.9/site-packages/markdown_it/rules_core/text_join.py
+++ /dev/null
@@ -1,34 +0,0 @@
-"""Join raw text tokens with the rest of the text
-
-This is set as a separate rule to provide an opportunity for plugins
-to run text replacements after text join, but before escape join.
-
-For example, `\\:)` shouldn't be replaced with an emoji.
-"""
-from __future__ import annotations
-
-from ..token import Token
-from .state_core import StateCore
-
-
-def text_join(state: StateCore) -> None:
- """Join raw text for escape sequences (`text_special`) tokens with the rest of the text"""
-
- for inline_token in state.tokens[:]:
- if inline_token.type != "inline":
- continue
-
- # convert text_special to text and join all adjacent text nodes
- new_tokens: list[Token] = []
- for child_token in inline_token.children or []:
- if child_token.type == "text_special":
- child_token.type = "text"
- if (
- child_token.type == "text"
- and new_tokens
- and new_tokens[-1].type == "text"
- ):
- new_tokens[-1].content += child_token.content
- else:
- new_tokens.append(child_token)
- inline_token.children = new_tokens
diff --git a/spaces/deelerb/3dselfie/PIFu/lib/renderer/__init__.py b/spaces/deelerb/3dselfie/PIFu/lib/renderer/__init__.py
deleted file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
diff --git "a/spaces/diacanFperku/AutoGPT/Download Final Cut Pro\302\24010.4.6 NEW Cracked Full Version Working Tested.md" "b/spaces/diacanFperku/AutoGPT/Download Final Cut Pro\302\24010.4.6 NEW Cracked Full Version Working Tested.md"
deleted file mode 100644
index a6a33b81f1593d36a11e4ab8088c90a9dc07c11b..0000000000000000000000000000000000000000
--- "a/spaces/diacanFperku/AutoGPT/Download Final Cut Pro\302\24010.4.6 NEW Cracked Full Version Working Tested.md"
+++ /dev/null
@@ -1,18 +0,0 @@
-Download Final Cut Pro 10.4.6 Cracked Full Version Working Tested
DOWNLOAD https://gohhs.com/2uFVD0
-
-, external
-
-Microsoft said that there is nothing wrong with Windows 10. Try another video editor, like Windows Movie Maker.
-
-Thanks to a cultural event organizing site, it’s now possible to receive a discount code to participate in the 55th International Eek! Nieweenfestival in the Netherlands. Participating in the Eek! Nieweenfestival gives you the opportunity to experience Dutch culture and also have a chance at a prize (maybe some fries!). There will also be an old-fashioned hokseball, Dutch football, which I’m not sure I’ve ever seen before. Even the boot of the horse is something I’ve never seen before. If you decide to come, do so soon!With the development of computer technology and the rapid development of networks, the quality of pictures transmitted over networks, especially Internet, is increasingly important.
-
-When pictures are transmitted over a network, the network may cause the quality of the pictures to be affected by factors such as the transmission rate, the network quality, the media quality, the environment where transmission is carried out, etc. Generally, the quality of the pictures is improved when transmission rate is increased.
-
-However, a network is limited in that it can only transmit signals for certain times, and thus it is also limited in the effective transmission rate. Furthermore, the network quality is not perfect, which is one of the factors that affect the quality of pictures.
-
-In addition, the environment in which transmission is carried out can also affect the quality of pictures. For example, if images are transmitted via a computer, the image quality is limited by the speed of a central processing unit (CPU) or the image quality provided by the central processing unit is limited. If images are transmitted via a mobile phone, the transmission quality depends on the strength of the signal transmitted by a mobile phone, etc. Therefore, when images are transmitted, the user can select the best quality for the images and may change the transmission quality.:08 a.m., on the thirteenth day of June of the year of our Lord one thousand eight hundred and seventy-six.
-
-"And I, the said Merle D. MacKillop, declare under oath that the said Merle D. MacKillop received from the said Hudson Valley Lumber Company the sum of $3,079.67 as his compensation on account of the special work which he performed for the said Hudson Valley Lumber Company during the year of 4fefd39f24
-
-
-
diff --git a/spaces/diacanFperku/AutoGPT/Download [UPD] Oggy And The Cockroaches Episodes In Hindi Torrent 720p Added.md b/spaces/diacanFperku/AutoGPT/Download [UPD] Oggy And The Cockroaches Episodes In Hindi Torrent 720p Added.md
deleted file mode 100644
index 13019c4840577236081426af1893c66311ea55a6..0000000000000000000000000000000000000000
--- a/spaces/diacanFperku/AutoGPT/Download [UPD] Oggy And The Cockroaches Episodes In Hindi Torrent 720p Added.md
+++ /dev/null
@@ -1,70 +0,0 @@
-
-Download Oggy and the Cockroaches Episodes in Hindi Torrent 720p Added: A Review
-
-If you are a fan of Oggy and the Cockroaches, the hilarious animated series that features the endless rivalry between a lazy cat and three mischievous cockroaches, you might want to download Oggy and the Cockroaches episodes in Hindi torrent 720p added. This is a collection of high-quality episodes of Oggy and the Cockroaches in Hindi dubbing that you can download for free from various sources. In this article, we will review the features, benefits, and drawbacks of downloading Oggy and the Cockroaches episodes in Hindi torrent 720p added, and show you how to do it.
-
-What is Oggy and the Cockroaches?
-
-Oggy and the Cockroaches is a French animated comedy series that was created by Jean-Yves Raimbaud and produced by Xilam Animation. The series premiered in 1998 and has aired more than 500 episodes across seven seasons. The series follows the adventures of Oggy, a blue cat who lives in a cozy house with his cousin Jack, and his constant battles with three pesky cockroaches named Joey, Dee Dee, and Marky. The series is known for its slapstick humor, cartoon violence, and minimal dialogue.
-download oggy and the cockroaches episodes in hindi torrent 720p added
Download File 🆓 https://gohhs.com/2uFUBM
-
-What are the Features of Downloading Oggy and the Cockroaches Episodes in Hindi Torrent 720p Added?
-
-Downloading Oggy and the Cockroaches episodes in Hindi torrent 720p added has several features, such as:
-
-
-- Quality: The episodes are in 720p HD resolution, which means they have clear and crisp images and sound.
-- Language: The episodes are in Hindi dubbing, which means they have been translated and voiced by Hindi speakers. This can make the episodes more enjoyable and relatable for Hindi-speaking audiences.
-- Quantity: The collection contains all seasons and episodes of Oggy and the Cockroaches in Hindi dubbing, which means you can watch the entire series without missing any episode.
-- Free: The episodes are available for free download from various torrent websites, which means you don't have to pay any money to watch them.
-
-
-What are the Benefits of Downloading Oggy and the Cockroaches Episodes in Hindi Torrent 720p Added?
-
-Downloading Oggy and the Cockroaches episodes in Hindi torrent 720p added can offer you several benefits, such as:
-
-
-- Entertainment: By downloading Oggy and the Cockroaches episodes in Hindi torrent 720p added, you can enjoy watching one of the most popular and funny animated series ever made. You can laugh at the hilarious antics of Oggy and the cockroaches, and admire the creative animation and sound effects.
-- Convenience: By downloading Oggy and the Cockroaches episodes in Hindi torrent 720p added, you can watch them anytime and anywhere you want. You don't have to depend on TV schedules or streaming platforms. You can also watch them offline without any internet connection.
-- Saving: By downloading Oggy and the Cockroaches episodes in Hindi torrent 720p added, you can save money that you would otherwise spend on buying DVDs or subscribing to streaming services. You can also save space on your device by deleting the episodes after watching them.
-
-
-What are the Drawbacks of Downloading Oggy and the Cockroaches Episodes in Hindi Torrent 720p Added?
-
-Downloading Oggy and the Cockroaches episodes in Hindi torrent 720p added is not without its drawbacks, such as:
-
-
-- Legality: Downloading Oggy and the Cockroaches episodes in Hindi torrent 720p added may be illegal in some countries or regions, as it may violate the copyright laws or terms of service of Xilam Animation or other distributors. You may face legal consequences if you are caught downloading or sharing these episodes without permission.
-- Safety: Downloading Oggy and the Cockroaches episodes in Hindi torrent 720p added may be unsafe for your device or network, as it may expose you to viruses, malware, or hackers. You may also encounter fake or corrupted files that may damage your device or waste your time.
-- Ethics: Downloading Oggy and the Cockroaches episodes in Hindi torrent 720p added may be unethical for some people, as it may deprive Xilam Animation or other distributors of their rightful income or recognition. You may also miss out on some features or updates that are available on official sources.
-
-
-How to Download Oggy and the Cockroaches Episodes in Hindi Torrent 720p Added?
-
-If you want to download Oggy and the Cockroaches episodes in Hindi torrent 720p added, you have to follow these steps:
-
-
-- Find a torrent website: You have to find a torrent website that offers Oggy and the Cockroaches episodes in Hindi torrent 720p added. Some examples are PureToons.Com, ToonWorld4All.Me, Archive.Org, Trello.Com, etc. However, we do not recommend or endorse any of these websites as they may be illegal, unsafe, or unreliable.
-- Select a torrent file: You have to select a torrent file that contains Oggy and the Cockroaches episodes in Hindi torrent 720p added. You can check the file name, size, quality, seeders, leechers, comments, etc. to verify its authenticity and availability.
-- Download a torrent client: You have to download a torrent client that can open and download torrent files. Some examples are BitTorrent, uTorrent, qBittorrent, etc. However, we do not recommend or endorse any of these clients as they may be illegal, unsafe, or unreliable.
-- Open the torrent file with the torrent client: You have to open the torrent file with the torrent client that you downloaded. The client will connect to other peers who have downloaded or are downloading the same file. The client will then start downloading Oggy and the Cockroaches episodes in Hindi torrent 720p added from these peers.
-- Enjoy watching Oggy and the Cockroaches episodes in Hindi: Once the download is complete, you can enjoy watching Oggy and the Cockroaches episodes in Hindi on your device. You can also share them with others if you want.
-
-
-Conclusion
-
-Oggy and the Cockroaches is a fun and entertaining animated series that features the endless rivalry between a lazy cat and three mischievous cockroaches. You can download Oggy and the Cockroaches episodes in Hindi torrent 720p added from various sources for free. However, you should also be aware of the legality, safety, ethics issues that may arise from doing so.
-
-Therefore, if you want to download Oggy and the Cockroaches episodes in Hindi torrent 720p added, you should either do it at your own risk or look for other alternatives that are more legal, safe, ethical.
-
-We hope this article has been helpful for you in understanding what downloading Oggy and the Cockroaches episodes in Hindi torrent 720p added is all about.
-
-Conclusion
-
-Oggy and the Cockroaches is a fun and entertaining animated series that features the endless rivalry between a lazy cat and three mischievous cockroaches. You can download Oggy and the Cockroaches episodes in Hindi torrent 720p added from various sources for free. However, you should also be aware of the legality, safety, ethics issues that may arise from doing so.
-
-Therefore, if you want to download Oggy and the Cockroaches episodes in Hindi torrent 720p added, you should either do it at your own risk or look for other alternatives that are more legal, safe, ethical.
-
-We hope this article has been helpful for you in understanding what downloading Oggy and the Cockroaches episodes in Hindi torrent 720p added is all about.
3cee63e6c2
-
-
\ No newline at end of file
diff --git a/spaces/digitalxingtong/Xingtong-Longread-Dongmuchang-Bert-VITS2/monotonic_align/core.c b/spaces/digitalxingtong/Xingtong-Longread-Dongmuchang-Bert-VITS2/monotonic_align/core.c
deleted file mode 100644
index 5f8af54d32474f821e9d1f4d2679d78128722596..0000000000000000000000000000000000000000
--- a/spaces/digitalxingtong/Xingtong-Longread-Dongmuchang-Bert-VITS2/monotonic_align/core.c
+++ /dev/null
@@ -1,26530 +0,0 @@
-/* Generated by Cython 3.0.0 */
-
-/* BEGIN: Cython Metadata
-{
- "distutils": {
- "name": "monotonic_align.core",
- "sources": [
- "core.pyx"
- ]
- },
- "module_name": "monotonic_align.core"
-}
-END: Cython Metadata */
-
-#ifndef PY_SSIZE_T_CLEAN
-#define PY_SSIZE_T_CLEAN
-#endif /* PY_SSIZE_T_CLEAN */
-#if defined(CYTHON_LIMITED_API) && 0
- #ifndef Py_LIMITED_API
- #if CYTHON_LIMITED_API+0 > 0x03030000
- #define Py_LIMITED_API CYTHON_LIMITED_API
- #else
- #define Py_LIMITED_API 0x03030000
- #endif
- #endif
-#endif
-
-#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 < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
- #error Cython requires Python 2.7+ or Python 3.3+.
-#else
-#define CYTHON_ABI "3_0_0"
-#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
-#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
-#define CYTHON_HEX_VERSION 0x030000F0
-#define CYTHON_FUTURE_DIVISION 1
-#include
-#ifndef offsetof
- #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
-#endif
-#if !defined(_WIN32) && !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
- #define HAVE_LONG_LONG
-#endif
-#ifndef PY_LONG_LONG
- #define PY_LONG_LONG LONG_LONG
-#endif
-#ifndef Py_HUGE_VAL
- #define Py_HUGE_VAL HUGE_VAL
-#endif
-#if defined(GRAALVM_PYTHON)
- /* For very preliminary testing purposes. Most variables are set the same as PyPy.
- The existence of this section does not imply that anything works or is even tested */
- #define CYTHON_COMPILING_IN_PYPY 0
- #define CYTHON_COMPILING_IN_CPYTHON 0
- #define CYTHON_COMPILING_IN_LIMITED_API 0
- #define CYTHON_COMPILING_IN_GRAAL 1
- #define CYTHON_COMPILING_IN_NOGIL 0
- #undef CYTHON_USE_TYPE_SLOTS
- #define CYTHON_USE_TYPE_SLOTS 0
- #undef CYTHON_USE_TYPE_SPECS
- #define CYTHON_USE_TYPE_SPECS 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_GIL
- #define CYTHON_FAST_GIL 0
- #undef CYTHON_METH_FASTCALL
- #define CYTHON_METH_FASTCALL 0
- #undef CYTHON_FAST_PYCALL
- #define CYTHON_FAST_PYCALL 0
- #ifndef CYTHON_PEP487_INIT_SUBCLASS
- #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
- #endif
- #undef CYTHON_PEP489_MULTI_PHASE_INIT
- #define CYTHON_PEP489_MULTI_PHASE_INIT 1
- #undef CYTHON_USE_MODULE_STATE
- #define CYTHON_USE_MODULE_STATE 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(PYPY_VERSION)
- #define CYTHON_COMPILING_IN_PYPY 1
- #define CYTHON_COMPILING_IN_CPYTHON 0
- #define CYTHON_COMPILING_IN_LIMITED_API 0
- #define CYTHON_COMPILING_IN_GRAAL 0
- #define CYTHON_COMPILING_IN_NOGIL 0
- #undef CYTHON_USE_TYPE_SLOTS
- #define CYTHON_USE_TYPE_SLOTS 0
- #undef CYTHON_USE_TYPE_SPECS
- #define CYTHON_USE_TYPE_SPECS 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_GIL
- #define CYTHON_FAST_GIL 0
- #undef CYTHON_METH_FASTCALL
- #define CYTHON_METH_FASTCALL 0
- #undef CYTHON_FAST_PYCALL
- #define CYTHON_FAST_PYCALL 0
- #ifndef CYTHON_PEP487_INIT_SUBCLASS
- #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
- #endif
- #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_MODULE_STATE
- #define CYTHON_USE_MODULE_STATE 0
- #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(CYTHON_LIMITED_API)
- #define CYTHON_COMPILING_IN_PYPY 0
- #define CYTHON_COMPILING_IN_CPYTHON 0
- #define CYTHON_COMPILING_IN_LIMITED_API 1
- #define CYTHON_COMPILING_IN_GRAAL 0
- #define CYTHON_COMPILING_IN_NOGIL 0
- #undef CYTHON_CLINE_IN_TRACEBACK
- #define CYTHON_CLINE_IN_TRACEBACK 0
- #undef CYTHON_USE_TYPE_SLOTS
- #define CYTHON_USE_TYPE_SLOTS 0
- #undef CYTHON_USE_TYPE_SPECS
- #define CYTHON_USE_TYPE_SPECS 1
- #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
- #undef CYTHON_USE_UNICODE_INTERNALS
- #define CYTHON_USE_UNICODE_INTERNALS 0
- #ifndef CYTHON_USE_UNICODE_WRITER
- #define CYTHON_USE_UNICODE_WRITER 0
- #endif
- #undef CYTHON_USE_PYLONG_INTERNALS
- #define CYTHON_USE_PYLONG_INTERNALS 0
- #ifndef CYTHON_AVOID_BORROWED_REFS
- #define CYTHON_AVOID_BORROWED_REFS 0
- #endif
- #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_GIL
- #define CYTHON_FAST_GIL 0
- #undef CYTHON_METH_FASTCALL
- #define CYTHON_METH_FASTCALL 0
- #undef CYTHON_FAST_PYCALL
- #define CYTHON_FAST_PYCALL 0
- #ifndef CYTHON_PEP487_INIT_SUBCLASS
- #define CYTHON_PEP487_INIT_SUBCLASS 1
- #endif
- #undef CYTHON_PEP489_MULTI_PHASE_INIT
- #define CYTHON_PEP489_MULTI_PHASE_INIT 0
- #undef CYTHON_USE_MODULE_STATE
- #define CYTHON_USE_MODULE_STATE 1
- #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
- #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_CPYTHON 0
- #define CYTHON_COMPILING_IN_LIMITED_API 0
- #define CYTHON_COMPILING_IN_GRAAL 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_CPYTHON 1
- #define CYTHON_COMPILING_IN_LIMITED_API 0
- #define CYTHON_COMPILING_IN_GRAAL 0
- #define CYTHON_COMPILING_IN_NOGIL 0
- #ifndef CYTHON_USE_TYPE_SLOTS
- #define CYTHON_USE_TYPE_SLOTS 1
- #endif
- #ifndef CYTHON_USE_TYPE_SPECS
- #define CYTHON_USE_TYPE_SPECS 0
- #endif
- #ifndef 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
- #ifndef CYTHON_USE_PYLONG_INTERNALS
- #define CYTHON_USE_PYLONG_INTERNALS 1
- #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
- #ifndef CYTHON_FAST_THREAD_STATE
- #define CYTHON_FAST_THREAD_STATE 1
- #endif
- #ifndef CYTHON_FAST_GIL
- #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6)
- #endif
- #ifndef CYTHON_METH_FASTCALL
- #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1)
- #endif
- #ifndef CYTHON_FAST_PYCALL
- #define CYTHON_FAST_PYCALL 1
- #endif
- #ifndef CYTHON_PEP487_INIT_SUBCLASS
- #define CYTHON_PEP487_INIT_SUBCLASS 1
- #endif
- #if PY_VERSION_HEX < 0x03050000
- #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
- #ifndef CYTHON_USE_MODULE_STATE
- #define CYTHON_USE_MODULE_STATE 0
- #endif
- #if PY_VERSION_HEX < 0x030400a1
- #undef CYTHON_USE_TP_FINALIZE
- #define CYTHON_USE_TP_FINALIZE 0
- #elif !defined(CYTHON_USE_TP_FINALIZE)
- #define CYTHON_USE_TP_FINALIZE 1
- #endif
- #if PY_VERSION_HEX < 0x030600B1
- #undef CYTHON_USE_DICT_VERSIONS
- #define CYTHON_USE_DICT_VERSIONS 0
- #elif !defined(CYTHON_USE_DICT_VERSIONS)
- #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5)
- #endif
- #if PY_VERSION_HEX < 0x030700A3
- #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 1
- #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 !defined(CYTHON_VECTORCALL)
-#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
-#endif
-#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
-#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(__cplusplus)
- /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
- * but leads to warnings with -pedantic, since it is a C++17 feature */
- #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
- #if __has_cpp_attribute(maybe_unused)
- #define CYTHON_UNUSED [[maybe_unused]]
- #endif
- #endif
- #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_UNUSED_VAR
-# if defined(__cplusplus)
- template void CYTHON_UNUSED_VAR( const T& ) { }
-# else
-# define CYTHON_UNUSED_VAR(x) (void)(x)
-# endif
-#endif
-#ifndef CYTHON_MAYBE_UNUSED_VAR
- #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
-#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 short uint16_t;
- typedef unsigned int uint32_t;
- #else
- typedef unsigned __int8 uint8_t;
- typedef unsigned __int16 uint16_t;
- typedef unsigned __int32 uint32_t;
- #endif
- #endif
- #if _MSC_VER < 1300
- #ifdef _WIN64
- typedef unsigned long long __pyx_uintptr_t;
- #else
- typedef unsigned int __pyx_uintptr_t;
- #endif
- #else
- #ifdef _WIN64
- typedef unsigned __int64 __pyx_uintptr_t;
- #else
- typedef unsigned __int32 __pyx_uintptr_t;
- #endif
- #endif
-#else
- #include
- typedef uintptr_t __pyx_uintptr_t;
-#endif
-#ifndef CYTHON_FALLTHROUGH
- #if defined(__cplusplus)
- /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
- * but leads to warnings with -pedantic, since it is a C++17 feature */
- #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
- #if __has_cpp_attribute(fallthrough)
- #define CYTHON_FALLTHROUGH [[fallthrough]]
- #endif
- #endif
- #ifndef CYTHON_FALLTHROUGH
- #if __has_cpp_attribute(clang::fallthrough)
- #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
- #elif __has_cpp_attribute(gnu::fallthrough)
- #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
- #endif
- #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
-#ifdef __cplusplus
- template
- struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
- #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value)
-#else
- #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
-#endif
-#if CYTHON_COMPILING_IN_PYPY == 1
- #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000)
-#else
- #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000)
-#endif
-#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
-
-#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_DefaultClassType PyClass_Type
- #define __Pyx_PyCode_New(a, p, 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)
-#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 p, 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, *empty=NULL;
- const char *fn_cstr=NULL;
- const char *name_cstr=NULL;
- PyCodeObject *co=NULL, *result=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(p))) 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 end;
- if (!(empty = PyTuple_New(0))) goto end;
- result = (PyCodeObject*) PyObject_Call(replace, empty, kwds);
- end:
- Py_XDECREF((PyObject*) co);
- Py_XDECREF(kwds);
- Py_XDECREF(argcount);
- Py_XDECREF(posonlyargcount);
- Py_XDECREF(kwonlyargcount);
- Py_XDECREF(nlocals);
- Py_XDECREF(stacksize);
- Py_XDECREF(replace);
- Py_XDECREF(empty);
- if (type) {
- PyErr_Restore(type, value, traceback);
- }
- return result;
- }
-#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
- #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
- PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
-#else
- #define __Pyx_PyCode_New(a, p, 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
-#endif
-#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
- #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
-#else
- #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
-#endif
-#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
- #define __Pyx_Py_Is(x, y) Py_Is(x, y)
-#else
- #define __Pyx_Py_Is(x, y) ((x) == (y))
-#endif
-#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
- #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
-#else
- #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
-#endif
-#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
- #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
-#else
- #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
-#endif
-#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
- #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
-#else
- #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
-#endif
-#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
-#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 CO_COROUTINE
- #define CO_COROUTINE 0x80
-#endif
-#ifndef CO_ASYNC_GENERATOR
- #define CO_ASYNC_GENERATOR 0x200
-#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 Py_TPFLAGS_SEQUENCE
- #define Py_TPFLAGS_SEQUENCE 0
-#endif
-#ifndef Py_TPFLAGS_MAPPING
- #define Py_TPFLAGS_MAPPING 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_METH_FASTCALL
- #define __Pyx_METH_FASTCALL METH_FASTCALL
- #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
- #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
-#else
- #define __Pyx_METH_FASTCALL METH_VARARGS
- #define __Pyx_PyCFunction_FastCall PyCFunction
- #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
-#endif
-#if CYTHON_VECTORCALL
- #define __pyx_vectorcallfunc vectorcallfunc
- #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
- #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
-#elif CYTHON_BACKPORT_VECTORCALL
- typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
- size_t nargsf, PyObject *kwnames);
- #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1))
- #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
-#else
- #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
- #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
-#endif
-#if PY_VERSION_HEX < 0x030900B1
- #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
- typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
-#else
- #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
- #define __Pyx_PyCMethod PyCMethod
-#endif
-#ifndef METH_METHOD
- #define METH_METHOD 0x200
-#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_LIMITED_API
- #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
- #define __Pyx_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_COMPILING_IN_LIMITED_API
- #define __Pyx_PyThreadState_Current PyThreadState_Get()
-#elif !CYTHON_FAST_THREAD_STATE
- #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 CYTHON_COMPILING_IN_LIMITED_API
-static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op)
-{
- void *result;
- result = PyModule_GetState(op);
- if (!result)
- Py_FatalError("Couldn't find the module state");
- return result;
-}
-#endif
-#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype)
-#if CYTHON_COMPILING_IN_LIMITED_API
- #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
-#else
- #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
-#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 PY_MAJOR_VERSION < 3
- #if CYTHON_COMPILING_IN_PYPY
- #if PYPY_VERSION_NUM < 0x07030600
- #if defined(__cplusplus) && __cplusplus >= 201402L
- [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]]
- #elif defined(__GNUC__) || defined(__clang__)
- __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")))
- #elif defined(_MSC_VER)
- __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))
- #endif
- static CYTHON_INLINE int PyGILState_Check(void) {
- return 0;
- }
- #else // PYPY_VERSION_NUM < 0x07030600
- #endif // PYPY_VERSION_NUM < 0x07030600
- #else
- static CYTHON_INLINE int PyGILState_Check(void) {
- PyThreadState * tstate = _PyThreadState_Current;
- return tstate && (tstate == PyGILState_GetThisThreadState());
- }
- #endif
-#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 > 0x030600B4 && CYTHON_USE_UNICODE_INTERNALS
-#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
-static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
- PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
- if (res == NULL) PyErr_Clear();
- return res;
-}
-#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
-#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
-#define __Pyx_PyDict_GetItemStr PyDict_GetItem
-#else
-static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
-#if CYTHON_COMPILING_IN_PYPY
- return PyDict_GetItem(dict, name);
-#else
- PyDictEntry *ep;
- PyDictObject *mp = (PyDictObject*) dict;
- long hash = ((PyStringObject *) name)->ob_shash;
- assert(hash != -1);
- ep = (mp->ma_lookup)(mp, name, hash);
- if (ep == NULL) {
- return NULL;
- }
- return ep->me_value;
-#endif
-}
-#define __Pyx_PyDict_GetItemStr PyDict_GetItem
-#endif
-#if CYTHON_USE_TYPE_SLOTS
- #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
- #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
- #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext)
-#else
- #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
- #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
- #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next
-#endif
-#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
-#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
- PyTypeObject *type = Py_TYPE(obj);\
- assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
- PyObject_GC_Del(obj);\
- Py_DECREF(type);\
-}
-#else
-#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
-#endif
-#if CYTHON_COMPILING_IN_LIMITED_API
- #define CYTHON_PEP393_ENABLED 1
- #define __Pyx_PyUnicode_READY(op) (0)
- #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u)
- #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
- #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
- #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
- #define __Pyx_PyUnicode_DATA(u) ((void*)u)
- #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
- #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
-#elif 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) ((int)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, (Py_UCS4) 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) ? 65535U : 1114111U)
- #define __Pyx_PyUnicode_KIND(u) ((int)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] = (Py_UNICODE) 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
- #if !defined(PyUnicode_DecodeUnicodeEscape)
- #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
- #endif
- #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500)
- #undef PyUnicode_Contains
- #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
- #endif
- #if !defined(PyByteArray_Check)
- #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
- #endif
- #if !defined(PyObject_Format)
- #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
- #endif
-#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
-#if CYTHON_COMPILING_IN_CPYTHON
- #define __Pyx_PySequence_ListKeepNew(obj)\
- (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
-#else
- #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
-#endif
-#ifndef PySet_CheckExact
- #define PySet_CheckExact(obj) __Pyx_IS_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 __Pyx_Py3Int_Check(op) PyLong_Check(op)
- #define __Pyx_Py3Int_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
-#else
- #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op))
- #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op))
-#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 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; }
-
-#ifdef CYTHON_EXTERN_C
- #undef __PYX_EXTERN_C
- #define __PYX_EXTERN_C CYTHON_EXTERN_C
-#elif defined(__PYX_EXTERN_C)
- #ifdef _MSC_VER
- #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
- #else
- #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
- #endif
-#else
- #ifdef __cplusplus
- #define __PYX_EXTERN_C extern "C"
- #else
- #define __PYX_EXTERN_C extern
- #endif
-#endif
-
-#define __PYX_HAVE__monotonic_align__core
-#define __PYX_HAVE_API__monotonic_align__core
-/* Early includes */
-#include "pythread.h"
-#include
-#include
-#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_uintptr_t) __Pyx_PyObject_AsString(s))
-#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
-#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __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)
-#if CYTHON_COMPILING_IN_LIMITED_API
-static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u)
-{
- const wchar_t *u_end = u;
- while (*u_end++) ;
- return (size_t)(u_end - u - 1);
-}
-#else
-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);
-}
-#endif
-#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
-#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
-#if CYTHON_USE_PYLONG_INTERNALS
- #if PY_VERSION_HEX >= 0x030C00A7
- #ifndef _PyLong_SIGN_MASK
- #define _PyLong_SIGN_MASK 3
- #endif
- #ifndef _PyLong_NON_SIZE_BITS
- #define _PyLong_NON_SIZE_BITS 3
- #endif
- #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
- #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0)
- #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
- #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1)
- #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0)
- #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
- #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
- #define __Pyx_PyLong_SignedDigitCount(x)\
- ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
- #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
- #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
- #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
- #else
- #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
- #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
- #endif
- typedef Py_ssize_t __Pyx_compact_pylong;
- typedef size_t __Pyx_compact_upylong;
- #else // Py < 3.12
- #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
- #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
- #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
- #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
- #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
- #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
- #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
- #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
- #define __Pyx_PyLong_CompactValue(x)\
- ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
- typedef sdigit __Pyx_compact_pylong;
- typedef digit __Pyx_compact_upylong;
- #endif
- #if PY_VERSION_HEX >= 0x030C00A5
- #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
- #else
- #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
- #endif
-#endif
-#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] = (char) 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; }
-
-#if !CYTHON_USE_MODULE_STATE
-static PyObject *__pyx_m = NULL;
-#endif
-static int __pyx_lineno;
-static int __pyx_clineno = 0;
-static const char * __pyx_cfilenm = __FILE__;
-static const char *__pyx_filename;
-
-/* #### Code section: filename_table ### */
-
-static const char *__pyx_f[] = {
- "core.pyx",
- "",
-};
-/* #### Code section: utility_code_proto_before_types ### */
-/* ForceInitThreads.proto */
-#ifndef __PYX_FORCE_INIT_THREADS
- #define __PYX_FORCE_INIT_THREADS 0
-#endif
-
-/* NoFastGil.proto */
-#define __Pyx_PyGILState_Ensure PyGILState_Ensure
-#define __Pyx_PyGILState_Release PyGILState_Release
-#define __Pyx_FastGIL_Remember()
-#define __Pyx_FastGIL_Forget()
-#define __Pyx_FastGilFuncInit()
-
-/* BufferFormatStructs.proto */
-struct __Pyx_StructField_;
-#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
-typedef struct {
- const char* name;
- struct __Pyx_StructField_* fields;
- size_t size;
- size_t arraysize[8];
- int ndim;
- char typegroup;
- char is_unsigned;
- int flags;
-} __Pyx_TypeInfo;
-typedef struct __Pyx_StructField_ {
- __Pyx_TypeInfo* type;
- const char* name;
- size_t offset;
-} __Pyx_StructField;
-typedef struct {
- __Pyx_StructField* field;
- size_t parent_offset;
-} __Pyx_BufFmt_StackElem;
-typedef struct {
- __Pyx_StructField root;
- __Pyx_BufFmt_StackElem* head;
- size_t fmt_offset;
- size_t new_count, enc_count;
- size_t struct_alignment;
- int is_complex;
- char enc_type;
- char new_packmode;
- char enc_packmode;
- char is_valid_array;
-} __Pyx_BufFmt_Context;
-
-/* Atomics.proto */
-#include
-#ifndef CYTHON_ATOMICS
- #define CYTHON_ATOMICS 1
-#endif
-#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
-#define __pyx_atomic_int_type int
-#define __pyx_nonatomic_int_type int
-#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
- (__STDC_VERSION__ >= 201112L) &&\
- !defined(__STDC_NO_ATOMICS__))
- #include
-#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
- (__cplusplus >= 201103L) ||\
- (defined(_MSC_VER) && _MSC_VER >= 1700)))
- #include
-#endif
-#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
- (__STDC_VERSION__ >= 201112L) &&\
- !defined(__STDC_NO_ATOMICS__) &&\
- ATOMIC_INT_LOCK_FREE == 2)
- #undef __pyx_atomic_int_type
- #define __pyx_atomic_int_type atomic_int
- #define __pyx_atomic_incr_aligned(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
- #define __pyx_atomic_decr_aligned(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
- #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
- #pragma message ("Using standard C atomics")
- #elif defined(__PYX_DEBUG_ATOMICS)
- #warning "Using standard C atomics"
- #endif
-#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
- (__cplusplus >= 201103L) ||\
-\
- (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
- ATOMIC_INT_LOCK_FREE == 2)
- #undef __pyx_atomic_int_type
- #define __pyx_atomic_int_type std::atomic_int
- #define __pyx_atomic_incr_aligned(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
- #define __pyx_atomic_decr_aligned(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
- #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
- #pragma message ("Using standard C++ atomics")
- #elif defined(__PYX_DEBUG_ATOMICS)
- #warning "Using standard C++ atomics"
- #endif
-#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
- (__GNUC_MINOR__ > 1 ||\
- (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
- #define __pyx_atomic_incr_aligned(value) __sync_fetch_and_add(value, 1)
- #define __pyx_atomic_decr_aligned(value) __sync_fetch_and_sub(value, 1)
- #ifdef __PYX_DEBUG_ATOMICS
- #warning "Using GNU atomics"
- #endif
-#elif CYTHON_ATOMICS && defined(_MSC_VER)
- #include
- #undef __pyx_atomic_int_type
- #define __pyx_atomic_int_type long
- #define __pyx_nonatomic_int_type long
- #pragma intrinsic (_InterlockedExchangeAdd)
- #define __pyx_atomic_incr_aligned(value) _InterlockedExchangeAdd(value, 1)
- #define __pyx_atomic_decr_aligned(value) _InterlockedExchangeAdd(value, -1)
- #ifdef __PYX_DEBUG_ATOMICS
- #pragma message ("Using MSVC atomics")
- #endif
-#else
- #undef CYTHON_ATOMICS
- #define CYTHON_ATOMICS 0
- #ifdef __PYX_DEBUG_ATOMICS
- #warning "Not using atomics"
- #endif
-#endif
-#if CYTHON_ATOMICS
- #define __pyx_add_acquisition_count(memview)\
- __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview))
- #define __pyx_sub_acquisition_count(memview)\
- __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview))
-#else
- #define __pyx_add_acquisition_count(memview)\
- __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
- #define __pyx_sub_acquisition_count(memview)\
- __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
-#endif
-
-/* MemviewSliceStruct.proto */
-struct __pyx_memoryview_obj;
-typedef struct {
- struct __pyx_memoryview_obj *memview;
- char *data;
- Py_ssize_t shape[8];
- Py_ssize_t strides[8];
- Py_ssize_t suboffsets[8];
-} __Pyx_memviewslice;
-#define __Pyx_MemoryView_Len(m) (m.shape[0])
-
-/* #### Code section: numeric_typedefs ### */
-/* #### Code section: complex_type_declarations ### */
-/* #### Code section: type_declarations ### */
-
-/*--- Type declarations ---*/
-struct __pyx_array_obj;
-struct __pyx_MemviewEnum_obj;
-struct __pyx_memoryview_obj;
-struct __pyx_memoryviewslice_obj;
-struct __pyx_opt_args_15monotonic_align_4core_maximum_path_each;
-
-/* "monotonic_align/core.pyx":7
- * @cython.boundscheck(False)
- * @cython.wraparound(False)
- * cdef void maximum_path_each(int[:,::1] path, float[:,::1] value, int t_y, int t_x, float max_neg_val=-1e9) nogil: # <<<<<<<<<<<<<<
- * cdef int x
- * cdef int y
- */
-struct __pyx_opt_args_15monotonic_align_4core_maximum_path_each {
- int __pyx_n;
- float max_neg_val;
-};
-
-/* "View.MemoryView":114
- * @cython.collection_type("sequence")
- * @cname("__pyx_array")
- * cdef class array: # <<<<<<<<<<<<<<
- *
- * cdef:
- */
-struct __pyx_array_obj {
- PyObject_HEAD
- struct __pyx_vtabstruct_array *__pyx_vtab;
- char *data;
- Py_ssize_t len;
- char *format;
- int ndim;
- Py_ssize_t *_shape;
- Py_ssize_t *_strides;
- Py_ssize_t itemsize;
- PyObject *mode;
- PyObject *_format;
- void (*callback_free_data)(void *);
- int free_data;
- int dtype_is_object;
-};
-
-
-/* "View.MemoryView":302
- *
- * @cname('__pyx_MemviewEnum')
- * cdef class Enum(object): # <<<<<<<<<<<<<<
- * cdef object name
- * def __init__(self, name):
- */
-struct __pyx_MemviewEnum_obj {
- PyObject_HEAD
- PyObject *name;
-};
-
-
-/* "View.MemoryView":337
- *
- * @cname('__pyx_memoryview')
- * cdef class memoryview: # <<<<<<<<<<<<<<
- *
- * cdef object obj
- */
-struct __pyx_memoryview_obj {
- PyObject_HEAD
- struct __pyx_vtabstruct_memoryview *__pyx_vtab;
- PyObject *obj;
- PyObject *_size;
- PyObject *_array_interface;
- PyThread_type_lock lock;
- __pyx_atomic_int_type acquisition_count;
- Py_buffer view;
- int flags;
- int dtype_is_object;
- __Pyx_TypeInfo *typeinfo;
-};
-
-
-/* "View.MemoryView":952
- * @cython.collection_type("sequence")
- * @cname('__pyx_memoryviewslice')
- * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
- * "Internal class for passing memoryview slices to Python"
- *
- */
-struct __pyx_memoryviewslice_obj {
- struct __pyx_memoryview_obj __pyx_base;
- __Pyx_memviewslice from_slice;
- PyObject *from_object;
- PyObject *(*to_object_func)(char *);
- int (*to_dtype_func)(char *, PyObject *);
-};
-
-
-
-/* "View.MemoryView":114
- * @cython.collection_type("sequence")
- * @cname("__pyx_array")
- * cdef class array: # <<<<<<<<<<<<<<
- *
- * cdef:
- */
-
-struct __pyx_vtabstruct_array {
- PyObject *(*get_memview)(struct __pyx_array_obj *);
-};
-static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
-
-
-/* "View.MemoryView":337
- *
- * @cname('__pyx_memoryview')
- * cdef class memoryview: # <<<<<<<<<<<<<<
- *
- * cdef object obj
- */
-
-struct __pyx_vtabstruct_memoryview {
- char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
- PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
- PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
- PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
- PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
- PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
- PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
- PyObject *(*_get_base)(struct __pyx_memoryview_obj *);
-};
-static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
-
-
-/* "View.MemoryView":952
- * @cython.collection_type("sequence")
- * @cname('__pyx_memoryviewslice')
- * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
- * "Internal class for passing memoryview slices to Python"
- *
- */
-
-struct __pyx_vtabstruct__memoryviewslice {
- struct __pyx_vtabstruct_memoryview __pyx_base;
-};
-static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
-/* #### Code section: utility_code_proto ### */
-
-/* --- Runtime support code (head) --- */
-/* Refnanny.proto */
-#ifndef CYTHON_REFNANNY
- #define CYTHON_REFNANNY 0
-#endif
-#if CYTHON_REFNANNY
- typedef struct {
- void (*INCREF)(void*, PyObject*, Py_ssize_t);
- void (*DECREF)(void*, PyObject*, Py_ssize_t);
- void (*GOTREF)(void*, PyObject*, Py_ssize_t);
- void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
- void* (*SetupContext)(const char*, Py_ssize_t, 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__));\
- }
- #define __Pyx_RefNannyFinishContextNogil() {\
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
- __Pyx_RefNannyFinishContext();\
- PyGILState_Release(__pyx_gilstate_save);\
- }
-#else
- #define __Pyx_RefNannySetupContext(name, acquire_gil)\
- __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__))
- #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext()
-#endif
- #define __Pyx_RefNannyFinishContextNogil() {\
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
- __Pyx_RefNannyFinishContext();\
- PyGILState_Release(__pyx_gilstate_save);\
- }
- #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); else {__Pyx_INCREF(r); }} while(0)
- #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
- #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
- #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
-#else
- #define __Pyx_RefNannyDeclarations
- #define __Pyx_RefNannySetupContext(name, acquire_gil)
- #define __Pyx_RefNannyFinishContextNogil()
- #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_Py_XDECREF_SET(r, v) do {\
- PyObject *tmp = (PyObject *) r;\
- r = v; Py_XDECREF(tmp);\
- } while (0)
-#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)
-
-/* 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
-
-/* PyThreadStateGet.proto */
-#if CYTHON_FAST_THREAD_STATE
-#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
-#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
-#if PY_VERSION_HEX >= 0x030C00A6
-#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
-#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
-#else
-#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
-#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
-#endif
-#else
-#define __Pyx_PyThreadState_declare
-#define __Pyx_PyThreadState_assign
-#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
-#define __Pyx_PyErr_CurrentExceptionType() 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 && PY_VERSION_HEX < 0x030C00A6
-#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
-
-/* 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
-
-/* PyObjectGetAttrStrNoError.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
-
-/* GetBuiltinName.proto */
-static PyObject *__Pyx_GetBuiltinName(PyObject *name);
-
-/* TupleAndListFromArray.proto */
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
-static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
-#endif
-
-/* IncludeStringH.proto */
-#include
-
-/* BytesEquals.proto */
-static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
-
-/* UnicodeEquals.proto */
-static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
-
-/* fastcall.proto */
-#define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i)
-#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
-#define __Pyx_KwValues_VARARGS(args, nargs) NULL
-#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
-#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
-#if CYTHON_METH_FASTCALL
- #define __Pyx_Arg_FASTCALL(args, i) args[i]
- #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds)
- #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
- static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
- #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
-#else
- #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS
- #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
- #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
- #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
- #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
-#endif
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start)
-#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start)
-#else
-#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
-#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
-#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 *const *kwvalues,
- PyObject **argnames[],
- PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,
- const char* function_name);
-
-/* ArgTypeTest.proto */
-#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
- ((likely(__Pyx_IS_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);
-
-/* RaiseException.proto */
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
-
-/* PyFunctionFastCall.proto */
-#if CYTHON_FAST_PYCALL
-#if !CYTHON_VECTORCALL
-#define __Pyx_PyFunction_FastCall(func, args, nargs)\
- __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
-static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *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_VECTORCALL
-#if PY_VERSION_HEX >= 0x03080000
- #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()
- #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus)
-#else
- static size_t __pyx_pyframe_localsplus_offset = 0;
- #include "frameobject.h"
- #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
-#endif
-#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
-
-/* PyObjectCallMethO.proto */
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
-#endif
-
-/* PyObjectFastCall.proto */
-#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
-static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs);
-
-/* RaiseUnexpectedTypeError.proto */
-static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);
-
-/* GCCDiagnostics.proto */
-#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
-#define __Pyx_HAS_GCC_DIAGNOSTIC
-#endif
-
-/* BuildPyUnicode.proto */
-static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
- int prepend_sign, char padding_char);
-
-/* CIntToPyUnicode.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char);
-
-/* CIntToPyUnicode.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char);
-
-/* JoinPyUnicode.proto */
-static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
- Py_UCS4 max_char);
-
-/* StrEquals.proto */
-#if PY_MAJOR_VERSION >= 3
-#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
-#else
-#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
-#endif
-
-/* PyObjectFormatSimple.proto */
-#if CYTHON_COMPILING_IN_PYPY
- #define __Pyx_PyObject_FormatSimple(s, f) (\
- likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
- PyObject_Format(s, f))
-#elif PY_MAJOR_VERSION < 3
- #define __Pyx_PyObject_FormatSimple(s, f) (\
- likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
- likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\
- PyObject_Format(s, f))
-#elif CYTHON_USE_TYPE_SLOTS
- #define __Pyx_PyObject_FormatSimple(s, f) (\
- likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
- likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
- likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
- PyObject_Format(s, f))
-#else
- #define __Pyx_PyObject_FormatSimple(s, f) (\
- likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
- PyObject_Format(s, f))
-#endif
-
-CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
-static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
-/* GetAttr.proto */
-static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
-
-/* 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);
-
-/* PyObjectCallOneArg.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
-
-/* 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
-
-/* KeywordStringCheck.proto */
-static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed);
-
-/* DivInt[Py_ssize_t].proto */
-static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
-
-/* UnaryNegOverflows.proto */
-#define __Pyx_UNARY_NEG_WOULD_OVERFLOW(x)\
- (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
-
-/* GetAttr3.proto */
-static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
-
-/* 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
-
-/* 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
-
-/* RaiseTooManyValuesToUnpack.proto */
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
-
-/* RaiseNeedMoreValuesToUnpack.proto */
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
-
-/* RaiseNoneIterError.proto */
-static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
-
-/* ExtTypeTest.proto */
-static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
-
-/* GetTopmostException.proto */
-#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
-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
-
-/* 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
-
-/* 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
-
-/* Import.proto */
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
-
-/* ImportDottedModule.proto */
-static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple);
-#if PY_MAJOR_VERSION >= 3
-static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple);
-#endif
-
-/* ssize_strlen.proto */
-static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
-
-/* FastTypeChecks.proto */
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
-#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
-static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
-static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, 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_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
-#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_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
-#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
-
-CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
-/* 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
-
-/* PySequenceMultiply.proto */
-#define __Pyx_PySequence_Multiply_Left(mul, seq) __Pyx_PySequence_Multiply(seq, mul)
-static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul);
-
-/* 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);
-
-/* RaiseUnboundLocalError.proto */
-static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
-
-/* DivInt[long].proto */
-static CYTHON_INLINE long __Pyx_div_long(long, long);
-
-/* 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));
-}
-
-/* ImportFrom.proto */
-static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
-
-/* HasAttr.proto */
-static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
-
-/* ErrOccurredWithGIL.proto */
-static CYTHON_INLINE int __Pyx_ErrOccurredWithGIL(void);
-
-/* 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
-
-/* PyObject_GenericGetAttr.proto */
-#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
-static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
-#else
-#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
-#endif
-
-/* IncludeStructmemberH.proto */
-#include
-
-/* FixUpExtensionType.proto */
-#if CYTHON_USE_TYPE_SPECS
-static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);
-#endif
-
-/* PyObjectCallNoArg.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
-
-/* PyObjectGetMethod.proto */
-static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
-
-/* PyObjectCallMethod0.proto */
-static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
-
-/* ValidateBasesTuple.proto */
-#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
-static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases);
-#endif
-
-/* PyType_Ready.proto */
-CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);
-
-/* SetVTable.proto */
-static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);
-
-/* GetVTable.proto */
-static void* __Pyx_GetVtable(PyTypeObject *type);
-
-/* MergeVTables.proto */
-#if !CYTHON_COMPILING_IN_LIMITED_API
-static int __Pyx_MergeVtables(PyTypeObject *type);
-#endif
-
-/* SetupReduce.proto */
-#if !CYTHON_COMPILING_IN_LIMITED_API
-static int __Pyx_setup_reduce(PyObject* type_obj);
-#endif
-
-/* FetchSharedCythonModule.proto */
-static PyObject *__Pyx_FetchSharedCythonABIModule(void);
-
-/* FetchCommonType.proto */
-#if !CYTHON_USE_TYPE_SPECS
-static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
-#else
-static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases);
-#endif
-
-/* PyMethodNew.proto */
-#if PY_MAJOR_VERSION >= 3
-static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
- CYTHON_UNUSED_VAR(typ);
- if (!self)
- return __Pyx_NewRef(func);
- return PyMethod_New(func, self);
-}
-#else
- #define __Pyx_PyMethod_New PyMethod_New
-#endif
-
-/* PyVectorcallFastCallDict.proto */
-#if CYTHON_METH_FASTCALL
-static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
-#endif
-
-/* CythonFunctionShared.proto */
-#define __Pyx_CyFunction_USED
-#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
-#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
-#define __Pyx_CYFUNCTION_CCLASS 0x04
-#define __Pyx_CYFUNCTION_COROUTINE 0x08
-#define __Pyx_CyFunction_GetClosure(f)\
- (((__pyx_CyFunctionObject *) (f))->func_closure)
-#if PY_VERSION_HEX < 0x030900B1
- #define __Pyx_CyFunction_GetClassObj(f)\
- (((__pyx_CyFunctionObject *) (f))->func_classobj)
-#else
- #define __Pyx_CyFunction_GetClassObj(f)\
- ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
-#endif
-#define __Pyx_CyFunction_SetClassObj(f, classobj)\
- __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (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 {
-#if PY_VERSION_HEX < 0x030900B1
- PyCFunctionObject func;
-#else
- PyCMethodObject func;
-#endif
-#if CYTHON_BACKPORT_VECTORCALL
- __pyx_vectorcallfunc func_vectorcall;
-#endif
-#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;
-#if PY_VERSION_HEX < 0x030900B1
- PyObject *func_classobj;
-#endif
- 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;
- PyObject *func_is_coroutine;
-} __pyx_CyFunctionObject;
-#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType)
-#define __Pyx_IsCyOrPyCFunction(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type)
-#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType)
-static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
- int flags, PyObject* qualname,
- PyObject *closure,
- PyObject *module, PyObject *globals,
- PyObject* code);
-static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
-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(PyObject *module);
-#if CYTHON_METH_FASTCALL
-static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
-static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
-static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
-static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
-#if CYTHON_BACKPORT_VECTORCALL
-#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall)
-#else
-#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
-#endif
-#endif
-
-/* 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 */
-#if !CYTHON_COMPILING_IN_LIMITED_API
-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);
-#endif
-
-/* AddTraceback.proto */
-static void __Pyx_AddTraceback(const char *funcname, int c_line,
- int py_line, const char *filename);
-
-#if PY_MAJOR_VERSION < 3
- static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
- static void __Pyx_ReleaseBuffer(Py_buffer *view);
-#else
- #define __Pyx_GetBuffer PyObject_GetBuffer
- #define __Pyx_ReleaseBuffer PyBuffer_Release
-#endif
-
-
-/* BufferStructDeclare.proto */
-typedef struct {
- Py_ssize_t shape, strides, suboffsets;
-} __Pyx_Buf_DimInfo;
-typedef struct {
- size_t refcount;
- Py_buffer pybuffer;
-} __Pyx_Buffer;
-typedef struct {
- __Pyx_Buffer *rcbuffer;
- char *data;
- __Pyx_Buf_DimInfo diminfo[8];
-} __Pyx_LocalBuf_ND;
-
-/* MemviewSliceIsContig.proto */
-static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
-
-/* OverlappingSlices.proto */
-static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
- __Pyx_memviewslice *slice2,
- int ndim, size_t itemsize);
-
-/* IsLittleEndian.proto */
-static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
-
-/* BufferFormatCheck.proto */
-static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
-static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
- __Pyx_BufFmt_StackElem* stack,
- __Pyx_TypeInfo* type);
-
-/* TypeInfoCompare.proto */
-static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
-
-/* MemviewSliceValidateAndInit.proto */
-static int __Pyx_ValidateAndInit_memviewslice(
- int *axes_specs,
- int c_or_f_flag,
- int buf_flags,
- int ndim,
- __Pyx_TypeInfo *dtype,
- __Pyx_BufFmt_StackElem stack[],
- __Pyx_memviewslice *memviewslice,
- PyObject *original_obj);
-
-/* ObjectToMemviewSlice.proto */
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_int(PyObject *, int writable_flag);
-
-/* ObjectToMemviewSlice.proto */
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_d_dc_float(PyObject *, int writable_flag);
-
-/* ObjectToMemviewSlice.proto */
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_int(PyObject *, int writable_flag);
-
-/* MemviewSliceCopyTemplate.proto */
-static __Pyx_memviewslice
-__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
- const char *mode, int ndim,
- size_t sizeof_dtype, int contig_flag,
- int dtype_is_object);
-
-/* MemviewSliceInit.proto */
-#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
-#define __Pyx_MEMVIEW_DIRECT 1
-#define __Pyx_MEMVIEW_PTR 2
-#define __Pyx_MEMVIEW_FULL 4
-#define __Pyx_MEMVIEW_CONTIG 8
-#define __Pyx_MEMVIEW_STRIDED 16
-#define __Pyx_MEMVIEW_FOLLOW 32
-#define __Pyx_IS_C_CONTIG 1
-#define __Pyx_IS_F_CONTIG 2
-static int __Pyx_init_memviewslice(
- struct __pyx_memoryview_obj *memview,
- int ndim,
- __Pyx_memviewslice *memviewslice,
- int memview_is_new_reference);
-static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
- __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
-static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
- __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
-#define __pyx_get_slice_count_pointer(memview) (&memview->acquisition_count)
-#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
-#define __PYX_XCLEAR_MEMVIEW(slice, have_gil) __Pyx_XCLEAR_MEMVIEW(slice, have_gil, __LINE__)
-static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
-static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *, int, int);
-
-/* CIntToPy.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
-
-/* CIntFromPy.proto */
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
-
-/* CIntToPy.proto */
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
-
-/* CIntFromPy.proto */
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
-
-/* CIntFromPy.proto */
-static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
-
-/* FormatTypeName.proto */
-#if CYTHON_COMPILING_IN_LIMITED_API
-typedef PyObject *__Pyx_TypeName;
-#define __Pyx_FMT_TYPENAME "%U"
-static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp);
-#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
-#else
-typedef const char *__Pyx_TypeName;
-#define __Pyx_FMT_TYPENAME "%.200s"
-#define __Pyx_PyType_GetName(tp) ((tp)->tp_name)
-#define __Pyx_DECREF_TypeName(obj)
-#endif
-
-/* CheckBinaryVersion.proto */
-static int __Pyx_check_binary_version(void);
-
-/* InitStrings.proto */
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
-
-/* #### Code section: module_declarations ### */
-static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
-static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
-static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
-static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
-static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
-static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
-static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
-static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
-static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self); /* proto*/
-static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
-static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
-static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto*/
-
-/* Module declarations from "cython.view" */
-
-/* Module declarations from "cython.dataclasses" */
-
-/* Module declarations from "cython" */
-
-/* Module declarations from "monotonic_align.core" */
-static PyObject *__pyx_collections_abc_Sequence = 0;
-static PyObject *generic = 0;
-static PyObject *strided = 0;
-static PyObject *indirect = 0;
-static PyObject *contiguous = 0;
-static PyObject *indirect_contiguous = 0;
-static int __pyx_memoryview_thread_locks_used;
-static PyThread_type_lock __pyx_memoryview_thread_locks[8];
-static void __pyx_f_15monotonic_align_4core_maximum_path_each(__Pyx_memviewslice, __Pyx_memviewslice, int, int, struct __pyx_opt_args_15monotonic_align_4core_maximum_path_each *__pyx_optional_args); /*proto*/
-static void __pyx_f_15monotonic_align_4core_maximum_path_c(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int __pyx_skip_dispatch); /*proto*/
-static int __pyx_array_allocate_buffer(struct __pyx_array_obj *); /*proto*/
-static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
-static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
-static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
-static PyObject *_unellipsify(PyObject *, int); /*proto*/
-static int assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
-static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
-static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
-static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
-static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
-static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
-static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
-static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
-static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
-static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
-static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
-static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
-static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
-static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
-static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
-static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
-static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
-static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
-static int __pyx_memoryview_err_dim(PyObject *, PyObject *, int); /*proto*/
-static int __pyx_memoryview_err(PyObject *, PyObject *); /*proto*/
-static int __pyx_memoryview_err_no_memory(void); /*proto*/
-static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
-static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
-static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
-static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
-static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
-static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
-static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
-static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
-/* #### Code section: typeinfo ### */
-static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, __PYX_IS_UNSIGNED(int) ? 'U' : 'I', __PYX_IS_UNSIGNED(int), 0 };
-static __Pyx_TypeInfo __Pyx_TypeInfo_float = { "float", NULL, sizeof(float), { 0 }, 0, 'R', 0, 0 };
-/* #### Code section: before_global_var ### */
-#define __Pyx_MODULE_NAME "monotonic_align.core"
-extern int __pyx_module_is_main_monotonic_align__core;
-int __pyx_module_is_main_monotonic_align__core = 0;
-
-/* Implementation of "monotonic_align.core" */
-/* #### Code section: global_var ### */
-static PyObject *__pyx_builtin_range;
-static PyObject *__pyx_builtin___import__;
-static PyObject *__pyx_builtin_ValueError;
-static PyObject *__pyx_builtin_MemoryError;
-static PyObject *__pyx_builtin_enumerate;
-static PyObject *__pyx_builtin_TypeError;
-static PyObject *__pyx_builtin_AssertionError;
-static PyObject *__pyx_builtin_Ellipsis;
-static PyObject *__pyx_builtin_id;
-static PyObject *__pyx_builtin_IndexError;
-/* #### Code section: string_decls ### */
-static const char __pyx_k_[] = ": ";
-static const char __pyx_k_O[] = "O";
-static const char __pyx_k_c[] = "c";
-static const char __pyx_k__2[] = ".";
-static const char __pyx_k__3[] = "*";
-static const char __pyx_k__6[] = "'";
-static const char __pyx_k__7[] = ")";
-static const char __pyx_k_gc[] = "gc";
-static const char __pyx_k_id[] = "id";
-static const char __pyx_k__23[] = "?";
-static const char __pyx_k_abc[] = "abc";
-static const char __pyx_k_and[] = " and ";
-static const char __pyx_k_got[] = " (got ";
-static const char __pyx_k_new[] = "__new__";
-static const char __pyx_k_obj[] = "obj";
-static const char __pyx_k_sys[] = "sys";
-static const char __pyx_k_base[] = "base";
-static const char __pyx_k_dict[] = "__dict__";
-static const char __pyx_k_main[] = "__main__";
-static const char __pyx_k_mode[] = "mode";
-static const char __pyx_k_name[] = "name";
-static const char __pyx_k_ndim[] = "ndim";
-static const char __pyx_k_pack[] = "pack";
-static const char __pyx_k_size[] = "size";
-static const char __pyx_k_spec[] = "__spec__";
-static const char __pyx_k_step[] = "step";
-static const char __pyx_k_stop[] = "stop";
-static const char __pyx_k_t_xs[] = "t_xs";
-static const char __pyx_k_t_ys[] = "t_ys";
-static const char __pyx_k_test[] = "__test__";
-static const char __pyx_k_ASCII[] = "ASCII";
-static const char __pyx_k_class[] = "__class__";
-static const char __pyx_k_count[] = "count";
-static const char __pyx_k_error[] = "error";
-static const char __pyx_k_flags[] = "flags";
-static const char __pyx_k_index[] = "index";
-static const char __pyx_k_paths[] = "paths";
-static const char __pyx_k_range[] = "range";
-static const char __pyx_k_shape[] = "shape";
-static const char __pyx_k_start[] = "start";
-static const char __pyx_k_enable[] = "enable";
-static const char __pyx_k_encode[] = "encode";
-static const char __pyx_k_format[] = "format";
-static const char __pyx_k_import[] = "__import__";
-static const char __pyx_k_name_2[] = "__name__";
-static const char __pyx_k_pickle[] = "pickle";
-static const char __pyx_k_reduce[] = "__reduce__";
-static const char __pyx_k_struct[] = "struct";
-static const char __pyx_k_unpack[] = "unpack";
-static const char __pyx_k_update[] = "update";
-static const char __pyx_k_values[] = "values";
-static const char __pyx_k_disable[] = "disable";
-static const char __pyx_k_fortran[] = "fortran";
-static const char __pyx_k_memview[] = "memview";
-static const char __pyx_k_Ellipsis[] = "Ellipsis";
-static const char __pyx_k_Sequence[] = "Sequence";
-static const char __pyx_k_core_pyx[] = "core.pyx";
-static const char __pyx_k_getstate[] = "__getstate__";
-static const char __pyx_k_itemsize[] = "itemsize";
-static const char __pyx_k_pyx_type[] = "__pyx_type";
-static const char __pyx_k_register[] = "register";
-static const char __pyx_k_setstate[] = "__setstate__";
-static const char __pyx_k_TypeError[] = "TypeError";
-static const char __pyx_k_enumerate[] = "enumerate";
-static const char __pyx_k_isenabled[] = "isenabled";
-static const char __pyx_k_pyx_state[] = "__pyx_state";
-static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
-static const char __pyx_k_IndexError[] = "IndexError";
-static const char __pyx_k_ValueError[] = "ValueError";
-static const char __pyx_k_pyx_result[] = "__pyx_result";
-static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
-static const char __pyx_k_MemoryError[] = "MemoryError";
-static const char __pyx_k_PickleError[] = "PickleError";
-static const char __pyx_k_collections[] = "collections";
-static const char __pyx_k_initializing[] = "_initializing";
-static const char __pyx_k_is_coroutine[] = "_is_coroutine";
-static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
-static const char __pyx_k_stringsource[] = "";
-static const char __pyx_k_version_info[] = "version_info";
-static const char __pyx_k_class_getitem[] = "__class_getitem__";
-static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
-static const char __pyx_k_AssertionError[] = "AssertionError";
-static const char __pyx_k_maximum_path_c[] = "maximum_path_c";
-static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
-static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
-static const char __pyx_k_collections_abc[] = "collections.abc";
-static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
-static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
-static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
-static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
-static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
-static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
-static const char __pyx_k_strided_and_direct[] = "";
-static const char __pyx_k_monotonic_align_core[] = "monotonic_align.core";
-static const char __pyx_k_strided_and_indirect[] = "";
-static const char __pyx_k_Invalid_shape_in_axis[] = "Invalid shape in axis ";
-static const char __pyx_k_contiguous_and_direct[] = "";
-static const char __pyx_k_Cannot_index_with_type[] = "Cannot index with type '";
-static const char __pyx_k_MemoryView_of_r_object[] = "";
-static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "";
-static const char __pyx_k_contiguous_and_indirect[] = "";
-static const char __pyx_k_Dimension_d_is_not_direct[] = "Dimension %d is not direct";
-static const char __pyx_k_Index_out_of_bounds_axis_d[] = "Index out of bounds (axis %d)";
-static const char __pyx_k_Step_may_not_be_zero_axis_d[] = "Step may not be zero (axis %d)";
-static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
-static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
-static const char __pyx_k_strided_and_direct_or_indirect[] = "";
-static const char __pyx_k_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced";
-static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
-static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
-static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
-static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
-static const char __pyx_k_Cannot_transpose_memoryview_with[] = "Cannot transpose memoryview with indirect dimensions";
-static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
-static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))";
-static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
-static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got ";
-static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis ";
-static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
-static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension ";
-static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
-static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
-/* #### Code section: decls ### */
-static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
-static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
-static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
-static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
-static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
-static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
-static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
-static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
-static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
-static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
-static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
-static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
-static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
-static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
-static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
-static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
-static PyObject *__pyx_pf_15monotonic_align_4core_maximum_path_c(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_paths, __Pyx_memviewslice __pyx_v_values, __Pyx_memviewslice __pyx_v_t_ys, __Pyx_memviewslice __pyx_v_t_xs); /* proto */
-static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-/* #### Code section: late_includes ### */
-/* #### Code section: module_state ### */
-typedef struct {
- PyObject *__pyx_d;
- PyObject *__pyx_b;
- PyObject *__pyx_cython_runtime;
- PyObject *__pyx_empty_tuple;
- PyObject *__pyx_empty_bytes;
- PyObject *__pyx_empty_unicode;
- #ifdef __Pyx_CyFunction_USED
- PyTypeObject *__pyx_CyFunctionType;
- #endif
- #ifdef __Pyx_FusedFunction_USED
- PyTypeObject *__pyx_FusedFunctionType;
- #endif
- #ifdef __Pyx_Generator_USED
- PyTypeObject *__pyx_GeneratorType;
- #endif
- #ifdef __Pyx_IterableCoroutine_USED
- PyTypeObject *__pyx_IterableCoroutineType;
- #endif
- #ifdef __Pyx_Coroutine_USED
- PyTypeObject *__pyx_CoroutineAwaitType;
- #endif
- #ifdef __Pyx_Coroutine_USED
- PyTypeObject *__pyx_CoroutineType;
- #endif
- #if CYTHON_USE_MODULE_STATE
- #endif
- #if CYTHON_USE_MODULE_STATE
- #endif
- #if CYTHON_USE_MODULE_STATE
- #endif
- #if CYTHON_USE_MODULE_STATE
- PyObject *__pyx_type___pyx_array;
- PyObject *__pyx_type___pyx_MemviewEnum;
- PyObject *__pyx_type___pyx_memoryview;
- PyObject *__pyx_type___pyx_memoryviewslice;
- #endif
- PyTypeObject *__pyx_array_type;
- PyTypeObject *__pyx_MemviewEnum_type;
- PyTypeObject *__pyx_memoryview_type;
- PyTypeObject *__pyx_memoryviewslice_type;
- PyObject *__pyx_kp_u_;
- PyObject *__pyx_n_s_ASCII;
- PyObject *__pyx_kp_s_All_dimensions_preceding_dimensi;
- PyObject *__pyx_n_s_AssertionError;
- PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
- PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
- PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
- PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
- PyObject *__pyx_kp_u_Cannot_index_with_type;
- PyObject *__pyx_kp_s_Cannot_transpose_memoryview_with;
- PyObject *__pyx_kp_s_Dimension_d_is_not_direct;
- PyObject *__pyx_n_s_Ellipsis;
- PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
- PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
- PyObject *__pyx_n_s_IndexError;
- PyObject *__pyx_kp_s_Index_out_of_bounds_axis_d;
- PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
- PyObject *__pyx_kp_u_Invalid_mode_expected_c_or_fortr;
- PyObject *__pyx_kp_u_Invalid_shape_in_axis;
- PyObject *__pyx_n_s_MemoryError;
- PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
- PyObject *__pyx_kp_s_MemoryView_of_r_object;
- PyObject *__pyx_n_b_O;
- PyObject *__pyx_kp_u_Out_of_bounds_on_buffer_access_a;
- PyObject *__pyx_n_s_PickleError;
- PyObject *__pyx_n_s_Sequence;
- PyObject *__pyx_kp_s_Step_may_not_be_zero_axis_d;
- PyObject *__pyx_n_s_TypeError;
- PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
- PyObject *__pyx_n_s_ValueError;
- PyObject *__pyx_n_s_View_MemoryView;
- PyObject *__pyx_kp_u__2;
- PyObject *__pyx_n_s__23;
- PyObject *__pyx_n_s__3;
- PyObject *__pyx_kp_u__6;
- PyObject *__pyx_kp_u__7;
- PyObject *__pyx_n_s_abc;
- PyObject *__pyx_n_s_allocate_buffer;
- PyObject *__pyx_kp_u_and;
- PyObject *__pyx_n_s_asyncio_coroutines;
- PyObject *__pyx_n_s_base;
- PyObject *__pyx_n_s_c;
- PyObject *__pyx_n_u_c;
- PyObject *__pyx_n_s_class;
- PyObject *__pyx_n_s_class_getitem;
- PyObject *__pyx_n_s_cline_in_traceback;
- PyObject *__pyx_n_s_collections;
- PyObject *__pyx_kp_s_collections_abc;
- PyObject *__pyx_kp_s_contiguous_and_direct;
- PyObject *__pyx_kp_s_contiguous_and_indirect;
- PyObject *__pyx_kp_s_core_pyx;
- PyObject *__pyx_n_s_count;
- PyObject *__pyx_n_s_dict;
- PyObject *__pyx_kp_u_disable;
- PyObject *__pyx_n_s_dtype_is_object;
- PyObject *__pyx_kp_u_enable;
- PyObject *__pyx_n_s_encode;
- PyObject *__pyx_n_s_enumerate;
- PyObject *__pyx_n_s_error;
- PyObject *__pyx_n_s_flags;
- PyObject *__pyx_n_s_format;
- PyObject *__pyx_n_s_fortran;
- PyObject *__pyx_n_u_fortran;
- PyObject *__pyx_kp_u_gc;
- PyObject *__pyx_n_s_getstate;
- PyObject *__pyx_kp_u_got;
- PyObject *__pyx_kp_u_got_differing_extents_in_dimensi;
- PyObject *__pyx_n_s_id;
- PyObject *__pyx_n_s_import;
- PyObject *__pyx_n_s_index;
- PyObject *__pyx_n_s_initializing;
- PyObject *__pyx_n_s_is_coroutine;
- PyObject *__pyx_kp_u_isenabled;
- PyObject *__pyx_n_s_itemsize;
- PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
- PyObject *__pyx_n_s_main;
- PyObject *__pyx_n_s_maximum_path_c;
- PyObject *__pyx_n_s_memview;
- PyObject *__pyx_n_s_mode;
- PyObject *__pyx_n_s_monotonic_align_core;
- PyObject *__pyx_n_s_name;
- PyObject *__pyx_n_s_name_2;
- PyObject *__pyx_n_s_ndim;
- PyObject *__pyx_n_s_new;
- PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
- PyObject *__pyx_n_s_obj;
- PyObject *__pyx_n_s_pack;
- PyObject *__pyx_n_s_paths;
- PyObject *__pyx_n_s_pickle;
- PyObject *__pyx_n_s_pyx_PickleError;
- PyObject *__pyx_n_s_pyx_checksum;
- PyObject *__pyx_n_s_pyx_result;
- PyObject *__pyx_n_s_pyx_state;
- PyObject *__pyx_n_s_pyx_type;
- PyObject *__pyx_n_s_pyx_unpickle_Enum;
- PyObject *__pyx_n_s_pyx_vtable;
- PyObject *__pyx_n_s_range;
- PyObject *__pyx_n_s_reduce;
- PyObject *__pyx_n_s_reduce_cython;
- PyObject *__pyx_n_s_reduce_ex;
- PyObject *__pyx_n_s_register;
- PyObject *__pyx_n_s_setstate;
- PyObject *__pyx_n_s_setstate_cython;
- PyObject *__pyx_n_s_shape;
- PyObject *__pyx_n_s_size;
- PyObject *__pyx_n_s_spec;
- PyObject *__pyx_n_s_start;
- PyObject *__pyx_n_s_step;
- PyObject *__pyx_n_s_stop;
- PyObject *__pyx_kp_s_strided_and_direct;
- PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
- PyObject *__pyx_kp_s_strided_and_indirect;
- PyObject *__pyx_kp_s_stringsource;
- PyObject *__pyx_n_s_struct;
- PyObject *__pyx_n_s_sys;
- PyObject *__pyx_n_s_t_xs;
- PyObject *__pyx_n_s_t_ys;
- PyObject *__pyx_n_s_test;
- PyObject *__pyx_kp_s_unable_to_allocate_array_data;
- PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
- PyObject *__pyx_n_s_unpack;
- PyObject *__pyx_n_s_update;
- PyObject *__pyx_n_s_values;
- PyObject *__pyx_n_s_version_info;
- PyObject *__pyx_int_0;
- PyObject *__pyx_int_1;
- PyObject *__pyx_int_3;
- PyObject *__pyx_int_112105877;
- PyObject *__pyx_int_136983863;
- PyObject *__pyx_int_184977713;
- PyObject *__pyx_int_neg_1;
- float __pyx_k__9;
- PyObject *__pyx_slice__5;
- PyObject *__pyx_tuple__4;
- PyObject *__pyx_tuple__8;
- PyObject *__pyx_tuple__10;
- PyObject *__pyx_tuple__11;
- PyObject *__pyx_tuple__12;
- PyObject *__pyx_tuple__13;
- PyObject *__pyx_tuple__14;
- PyObject *__pyx_tuple__15;
- PyObject *__pyx_tuple__16;
- PyObject *__pyx_tuple__17;
- PyObject *__pyx_tuple__18;
- PyObject *__pyx_tuple__19;
- PyObject *__pyx_tuple__21;
- PyObject *__pyx_codeobj__20;
- PyObject *__pyx_codeobj__22;
-} __pyx_mstate;
-
-#if CYTHON_USE_MODULE_STATE
-#ifdef __cplusplus
-namespace {
- extern struct PyModuleDef __pyx_moduledef;
-} /* anonymous namespace */
-#else
-static struct PyModuleDef __pyx_moduledef;
-#endif
-
-#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o))
-
-#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef)))
-
-#define __pyx_m (PyState_FindModule(&__pyx_moduledef))
-#else
-static __pyx_mstate __pyx_mstate_global_static =
-#ifdef __cplusplus
- {};
-#else
- {0};
-#endif
-static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static;
-#endif
-/* #### Code section: module_state_clear ### */
-#if CYTHON_USE_MODULE_STATE
-static int __pyx_m_clear(PyObject *m) {
- __pyx_mstate *clear_module_state = __pyx_mstate(m);
- if (!clear_module_state) return 0;
- Py_CLEAR(clear_module_state->__pyx_d);
- Py_CLEAR(clear_module_state->__pyx_b);
- Py_CLEAR(clear_module_state->__pyx_cython_runtime);
- Py_CLEAR(clear_module_state->__pyx_empty_tuple);
- Py_CLEAR(clear_module_state->__pyx_empty_bytes);
- Py_CLEAR(clear_module_state->__pyx_empty_unicode);
- #ifdef __Pyx_CyFunction_USED
- Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
- #endif
- #ifdef __Pyx_FusedFunction_USED
- Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
- #endif
- Py_CLEAR(clear_module_state->__pyx_array_type);
- Py_CLEAR(clear_module_state->__pyx_type___pyx_array);
- Py_CLEAR(clear_module_state->__pyx_MemviewEnum_type);
- Py_CLEAR(clear_module_state->__pyx_type___pyx_MemviewEnum);
- Py_CLEAR(clear_module_state->__pyx_memoryview_type);
- Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryview);
- Py_CLEAR(clear_module_state->__pyx_memoryviewslice_type);
- Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryviewslice);
- Py_CLEAR(clear_module_state->__pyx_kp_u_);
- Py_CLEAR(clear_module_state->__pyx_n_s_ASCII);
- Py_CLEAR(clear_module_state->__pyx_kp_s_All_dimensions_preceding_dimensi);
- Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError);
- Py_CLEAR(clear_module_state->__pyx_kp_s_Buffer_view_does_not_expose_stri);
- Py_CLEAR(clear_module_state->__pyx_kp_s_Can_only_create_a_buffer_that_is);
- Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_assign_to_read_only_memor);
- Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_create_writable_memory_vi);
- Py_CLEAR(clear_module_state->__pyx_kp_u_Cannot_index_with_type);
- Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_transpose_memoryview_with);
- Py_CLEAR(clear_module_state->__pyx_kp_s_Dimension_d_is_not_direct);
- Py_CLEAR(clear_module_state->__pyx_n_s_Ellipsis);
- Py_CLEAR(clear_module_state->__pyx_kp_s_Empty_shape_tuple_for_cython_arr);
- Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0);
- Py_CLEAR(clear_module_state->__pyx_n_s_IndexError);
- Py_CLEAR(clear_module_state->__pyx_kp_s_Index_out_of_bounds_axis_d);
- Py_CLEAR(clear_module_state->__pyx_kp_s_Indirect_dimensions_not_supporte);
- Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_mode_expected_c_or_fortr);
- Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_shape_in_axis);
- Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError);
- Py_CLEAR(clear_module_state->__pyx_kp_s_MemoryView_of_r_at_0x_x);
- Py_CLEAR(clear_module_state->__pyx_kp_s_MemoryView_of_r_object);
- Py_CLEAR(clear_module_state->__pyx_n_b_O);
- Py_CLEAR(clear_module_state->__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
- Py_CLEAR(clear_module_state->__pyx_n_s_PickleError);
- Py_CLEAR(clear_module_state->__pyx_n_s_Sequence);
- Py_CLEAR(clear_module_state->__pyx_kp_s_Step_may_not_be_zero_axis_d);
- Py_CLEAR(clear_module_state->__pyx_n_s_TypeError);
- Py_CLEAR(clear_module_state->__pyx_kp_s_Unable_to_convert_item_to_object);
- Py_CLEAR(clear_module_state->__pyx_n_s_ValueError);
- Py_CLEAR(clear_module_state->__pyx_n_s_View_MemoryView);
- Py_CLEAR(clear_module_state->__pyx_kp_u__2);
- Py_CLEAR(clear_module_state->__pyx_n_s__23);
- Py_CLEAR(clear_module_state->__pyx_n_s__3);
- Py_CLEAR(clear_module_state->__pyx_kp_u__6);
- Py_CLEAR(clear_module_state->__pyx_kp_u__7);
- Py_CLEAR(clear_module_state->__pyx_n_s_abc);
- Py_CLEAR(clear_module_state->__pyx_n_s_allocate_buffer);
- Py_CLEAR(clear_module_state->__pyx_kp_u_and);
- Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines);
- Py_CLEAR(clear_module_state->__pyx_n_s_base);
- Py_CLEAR(clear_module_state->__pyx_n_s_c);
- Py_CLEAR(clear_module_state->__pyx_n_u_c);
- Py_CLEAR(clear_module_state->__pyx_n_s_class);
- Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem);
- Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
- Py_CLEAR(clear_module_state->__pyx_n_s_collections);
- Py_CLEAR(clear_module_state->__pyx_kp_s_collections_abc);
- Py_CLEAR(clear_module_state->__pyx_kp_s_contiguous_and_direct);
- Py_CLEAR(clear_module_state->__pyx_kp_s_contiguous_and_indirect);
- Py_CLEAR(clear_module_state->__pyx_kp_s_core_pyx);
- Py_CLEAR(clear_module_state->__pyx_n_s_count);
- Py_CLEAR(clear_module_state->__pyx_n_s_dict);
- Py_CLEAR(clear_module_state->__pyx_kp_u_disable);
- Py_CLEAR(clear_module_state->__pyx_n_s_dtype_is_object);
- Py_CLEAR(clear_module_state->__pyx_kp_u_enable);
- Py_CLEAR(clear_module_state->__pyx_n_s_encode);
- Py_CLEAR(clear_module_state->__pyx_n_s_enumerate);
- Py_CLEAR(clear_module_state->__pyx_n_s_error);
- Py_CLEAR(clear_module_state->__pyx_n_s_flags);
- Py_CLEAR(clear_module_state->__pyx_n_s_format);
- Py_CLEAR(clear_module_state->__pyx_n_s_fortran);
- Py_CLEAR(clear_module_state->__pyx_n_u_fortran);
- Py_CLEAR(clear_module_state->__pyx_kp_u_gc);
- Py_CLEAR(clear_module_state->__pyx_n_s_getstate);
- Py_CLEAR(clear_module_state->__pyx_kp_u_got);
- Py_CLEAR(clear_module_state->__pyx_kp_u_got_differing_extents_in_dimensi);
- Py_CLEAR(clear_module_state->__pyx_n_s_id);
- Py_CLEAR(clear_module_state->__pyx_n_s_import);
- Py_CLEAR(clear_module_state->__pyx_n_s_index);
- Py_CLEAR(clear_module_state->__pyx_n_s_initializing);
- Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine);
- Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled);
- Py_CLEAR(clear_module_state->__pyx_n_s_itemsize);
- Py_CLEAR(clear_module_state->__pyx_kp_s_itemsize_0_for_cython_array);
- Py_CLEAR(clear_module_state->__pyx_n_s_main);
- Py_CLEAR(clear_module_state->__pyx_n_s_maximum_path_c);
- Py_CLEAR(clear_module_state->__pyx_n_s_memview);
- Py_CLEAR(clear_module_state->__pyx_n_s_mode);
- Py_CLEAR(clear_module_state->__pyx_n_s_monotonic_align_core);
- Py_CLEAR(clear_module_state->__pyx_n_s_name);
- Py_CLEAR(clear_module_state->__pyx_n_s_name_2);
- Py_CLEAR(clear_module_state->__pyx_n_s_ndim);
- Py_CLEAR(clear_module_state->__pyx_n_s_new);
- Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non);
- Py_CLEAR(clear_module_state->__pyx_n_s_obj);
- Py_CLEAR(clear_module_state->__pyx_n_s_pack);
- Py_CLEAR(clear_module_state->__pyx_n_s_paths);
- Py_CLEAR(clear_module_state->__pyx_n_s_pickle);
- Py_CLEAR(clear_module_state->__pyx_n_s_pyx_PickleError);
- Py_CLEAR(clear_module_state->__pyx_n_s_pyx_checksum);
- Py_CLEAR(clear_module_state->__pyx_n_s_pyx_result);
- Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state);
- Py_CLEAR(clear_module_state->__pyx_n_s_pyx_type);
- Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_Enum);
- Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable);
- Py_CLEAR(clear_module_state->__pyx_n_s_range);
- Py_CLEAR(clear_module_state->__pyx_n_s_reduce);
- Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython);
- Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex);
- Py_CLEAR(clear_module_state->__pyx_n_s_register);
- Py_CLEAR(clear_module_state->__pyx_n_s_setstate);
- Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython);
- Py_CLEAR(clear_module_state->__pyx_n_s_shape);
- Py_CLEAR(clear_module_state->__pyx_n_s_size);
- Py_CLEAR(clear_module_state->__pyx_n_s_spec);
- Py_CLEAR(clear_module_state->__pyx_n_s_start);
- Py_CLEAR(clear_module_state->__pyx_n_s_step);
- Py_CLEAR(clear_module_state->__pyx_n_s_stop);
- Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_direct);
- Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_direct_or_indirect);
- Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_indirect);
- Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource);
- Py_CLEAR(clear_module_state->__pyx_n_s_struct);
- Py_CLEAR(clear_module_state->__pyx_n_s_sys);
- Py_CLEAR(clear_module_state->__pyx_n_s_t_xs);
- Py_CLEAR(clear_module_state->__pyx_n_s_t_ys);
- Py_CLEAR(clear_module_state->__pyx_n_s_test);
- Py_CLEAR(clear_module_state->__pyx_kp_s_unable_to_allocate_array_data);
- Py_CLEAR(clear_module_state->__pyx_kp_s_unable_to_allocate_shape_and_str);
- Py_CLEAR(clear_module_state->__pyx_n_s_unpack);
- Py_CLEAR(clear_module_state->__pyx_n_s_update);
- Py_CLEAR(clear_module_state->__pyx_n_s_values);
- Py_CLEAR(clear_module_state->__pyx_n_s_version_info);
- Py_CLEAR(clear_module_state->__pyx_int_0);
- Py_CLEAR(clear_module_state->__pyx_int_1);
- Py_CLEAR(clear_module_state->__pyx_int_3);
- Py_CLEAR(clear_module_state->__pyx_int_112105877);
- Py_CLEAR(clear_module_state->__pyx_int_136983863);
- Py_CLEAR(clear_module_state->__pyx_int_184977713);
- Py_CLEAR(clear_module_state->__pyx_int_neg_1);
- Py_CLEAR(clear_module_state->__pyx_slice__5);
- Py_CLEAR(clear_module_state->__pyx_tuple__4);
- Py_CLEAR(clear_module_state->__pyx_tuple__8);
- Py_CLEAR(clear_module_state->__pyx_tuple__10);
- Py_CLEAR(clear_module_state->__pyx_tuple__11);
- Py_CLEAR(clear_module_state->__pyx_tuple__12);
- Py_CLEAR(clear_module_state->__pyx_tuple__13);
- Py_CLEAR(clear_module_state->__pyx_tuple__14);
- Py_CLEAR(clear_module_state->__pyx_tuple__15);
- Py_CLEAR(clear_module_state->__pyx_tuple__16);
- Py_CLEAR(clear_module_state->__pyx_tuple__17);
- Py_CLEAR(clear_module_state->__pyx_tuple__18);
- Py_CLEAR(clear_module_state->__pyx_tuple__19);
- Py_CLEAR(clear_module_state->__pyx_tuple__21);
- Py_CLEAR(clear_module_state->__pyx_codeobj__20);
- Py_CLEAR(clear_module_state->__pyx_codeobj__22);
- return 0;
-}
-#endif
-/* #### Code section: module_state_traverse ### */
-#if CYTHON_USE_MODULE_STATE
-static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
- __pyx_mstate *traverse_module_state = __pyx_mstate(m);
- if (!traverse_module_state) return 0;
- Py_VISIT(traverse_module_state->__pyx_d);
- Py_VISIT(traverse_module_state->__pyx_b);
- Py_VISIT(traverse_module_state->__pyx_cython_runtime);
- Py_VISIT(traverse_module_state->__pyx_empty_tuple);
- Py_VISIT(traverse_module_state->__pyx_empty_bytes);
- Py_VISIT(traverse_module_state->__pyx_empty_unicode);
- #ifdef __Pyx_CyFunction_USED
- Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
- #endif
- #ifdef __Pyx_FusedFunction_USED
- Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
- #endif
- Py_VISIT(traverse_module_state->__pyx_array_type);
- Py_VISIT(traverse_module_state->__pyx_type___pyx_array);
- Py_VISIT(traverse_module_state->__pyx_MemviewEnum_type);
- Py_VISIT(traverse_module_state->__pyx_type___pyx_MemviewEnum);
- Py_VISIT(traverse_module_state->__pyx_memoryview_type);
- Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryview);
- Py_VISIT(traverse_module_state->__pyx_memoryviewslice_type);
- Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryviewslice);
- Py_VISIT(traverse_module_state->__pyx_kp_u_);
- Py_VISIT(traverse_module_state->__pyx_n_s_ASCII);
- Py_VISIT(traverse_module_state->__pyx_kp_s_All_dimensions_preceding_dimensi);
- Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError);
- Py_VISIT(traverse_module_state->__pyx_kp_s_Buffer_view_does_not_expose_stri);
- Py_VISIT(traverse_module_state->__pyx_kp_s_Can_only_create_a_buffer_that_is);
- Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_assign_to_read_only_memor);
- Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_create_writable_memory_vi);
- Py_VISIT(traverse_module_state->__pyx_kp_u_Cannot_index_with_type);
- Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_transpose_memoryview_with);
- Py_VISIT(traverse_module_state->__pyx_kp_s_Dimension_d_is_not_direct);
- Py_VISIT(traverse_module_state->__pyx_n_s_Ellipsis);
- Py_VISIT(traverse_module_state->__pyx_kp_s_Empty_shape_tuple_for_cython_arr);
- Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0);
- Py_VISIT(traverse_module_state->__pyx_n_s_IndexError);
- Py_VISIT(traverse_module_state->__pyx_kp_s_Index_out_of_bounds_axis_d);
- Py_VISIT(traverse_module_state->__pyx_kp_s_Indirect_dimensions_not_supporte);
- Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_mode_expected_c_or_fortr);
- Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_shape_in_axis);
- Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError);
- Py_VISIT(traverse_module_state->__pyx_kp_s_MemoryView_of_r_at_0x_x);
- Py_VISIT(traverse_module_state->__pyx_kp_s_MemoryView_of_r_object);
- Py_VISIT(traverse_module_state->__pyx_n_b_O);
- Py_VISIT(traverse_module_state->__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
- Py_VISIT(traverse_module_state->__pyx_n_s_PickleError);
- Py_VISIT(traverse_module_state->__pyx_n_s_Sequence);
- Py_VISIT(traverse_module_state->__pyx_kp_s_Step_may_not_be_zero_axis_d);
- Py_VISIT(traverse_module_state->__pyx_n_s_TypeError);
- Py_VISIT(traverse_module_state->__pyx_kp_s_Unable_to_convert_item_to_object);
- Py_VISIT(traverse_module_state->__pyx_n_s_ValueError);
- Py_VISIT(traverse_module_state->__pyx_n_s_View_MemoryView);
- Py_VISIT(traverse_module_state->__pyx_kp_u__2);
- Py_VISIT(traverse_module_state->__pyx_n_s__23);
- Py_VISIT(traverse_module_state->__pyx_n_s__3);
- Py_VISIT(traverse_module_state->__pyx_kp_u__6);
- Py_VISIT(traverse_module_state->__pyx_kp_u__7);
- Py_VISIT(traverse_module_state->__pyx_n_s_abc);
- Py_VISIT(traverse_module_state->__pyx_n_s_allocate_buffer);
- Py_VISIT(traverse_module_state->__pyx_kp_u_and);
- Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines);
- Py_VISIT(traverse_module_state->__pyx_n_s_base);
- Py_VISIT(traverse_module_state->__pyx_n_s_c);
- Py_VISIT(traverse_module_state->__pyx_n_u_c);
- Py_VISIT(traverse_module_state->__pyx_n_s_class);
- Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem);
- Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
- Py_VISIT(traverse_module_state->__pyx_n_s_collections);
- Py_VISIT(traverse_module_state->__pyx_kp_s_collections_abc);
- Py_VISIT(traverse_module_state->__pyx_kp_s_contiguous_and_direct);
- Py_VISIT(traverse_module_state->__pyx_kp_s_contiguous_and_indirect);
- Py_VISIT(traverse_module_state->__pyx_kp_s_core_pyx);
- Py_VISIT(traverse_module_state->__pyx_n_s_count);
- Py_VISIT(traverse_module_state->__pyx_n_s_dict);
- Py_VISIT(traverse_module_state->__pyx_kp_u_disable);
- Py_VISIT(traverse_module_state->__pyx_n_s_dtype_is_object);
- Py_VISIT(traverse_module_state->__pyx_kp_u_enable);
- Py_VISIT(traverse_module_state->__pyx_n_s_encode);
- Py_VISIT(traverse_module_state->__pyx_n_s_enumerate);
- Py_VISIT(traverse_module_state->__pyx_n_s_error);
- Py_VISIT(traverse_module_state->__pyx_n_s_flags);
- Py_VISIT(traverse_module_state->__pyx_n_s_format);
- Py_VISIT(traverse_module_state->__pyx_n_s_fortran);
- Py_VISIT(traverse_module_state->__pyx_n_u_fortran);
- Py_VISIT(traverse_module_state->__pyx_kp_u_gc);
- Py_VISIT(traverse_module_state->__pyx_n_s_getstate);
- Py_VISIT(traverse_module_state->__pyx_kp_u_got);
- Py_VISIT(traverse_module_state->__pyx_kp_u_got_differing_extents_in_dimensi);
- Py_VISIT(traverse_module_state->__pyx_n_s_id);
- Py_VISIT(traverse_module_state->__pyx_n_s_import);
- Py_VISIT(traverse_module_state->__pyx_n_s_index);
- Py_VISIT(traverse_module_state->__pyx_n_s_initializing);
- Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine);
- Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled);
- Py_VISIT(traverse_module_state->__pyx_n_s_itemsize);
- Py_VISIT(traverse_module_state->__pyx_kp_s_itemsize_0_for_cython_array);
- Py_VISIT(traverse_module_state->__pyx_n_s_main);
- Py_VISIT(traverse_module_state->__pyx_n_s_maximum_path_c);
- Py_VISIT(traverse_module_state->__pyx_n_s_memview);
- Py_VISIT(traverse_module_state->__pyx_n_s_mode);
- Py_VISIT(traverse_module_state->__pyx_n_s_monotonic_align_core);
- Py_VISIT(traverse_module_state->__pyx_n_s_name);
- Py_VISIT(traverse_module_state->__pyx_n_s_name_2);
- Py_VISIT(traverse_module_state->__pyx_n_s_ndim);
- Py_VISIT(traverse_module_state->__pyx_n_s_new);
- Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non);
- Py_VISIT(traverse_module_state->__pyx_n_s_obj);
- Py_VISIT(traverse_module_state->__pyx_n_s_pack);
- Py_VISIT(traverse_module_state->__pyx_n_s_paths);
- Py_VISIT(traverse_module_state->__pyx_n_s_pickle);
- Py_VISIT(traverse_module_state->__pyx_n_s_pyx_PickleError);
- Py_VISIT(traverse_module_state->__pyx_n_s_pyx_checksum);
- Py_VISIT(traverse_module_state->__pyx_n_s_pyx_result);
- Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state);
- Py_VISIT(traverse_module_state->__pyx_n_s_pyx_type);
- Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_Enum);
- Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable);
- Py_VISIT(traverse_module_state->__pyx_n_s_range);
- Py_VISIT(traverse_module_state->__pyx_n_s_reduce);
- Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython);
- Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex);
- Py_VISIT(traverse_module_state->__pyx_n_s_register);
- Py_VISIT(traverse_module_state->__pyx_n_s_setstate);
- Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython);
- Py_VISIT(traverse_module_state->__pyx_n_s_shape);
- Py_VISIT(traverse_module_state->__pyx_n_s_size);
- Py_VISIT(traverse_module_state->__pyx_n_s_spec);
- Py_VISIT(traverse_module_state->__pyx_n_s_start);
- Py_VISIT(traverse_module_state->__pyx_n_s_step);
- Py_VISIT(traverse_module_state->__pyx_n_s_stop);
- Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_direct);
- Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_direct_or_indirect);
- Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_indirect);
- Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource);
- Py_VISIT(traverse_module_state->__pyx_n_s_struct);
- Py_VISIT(traverse_module_state->__pyx_n_s_sys);
- Py_VISIT(traverse_module_state->__pyx_n_s_t_xs);
- Py_VISIT(traverse_module_state->__pyx_n_s_t_ys);
- Py_VISIT(traverse_module_state->__pyx_n_s_test);
- Py_VISIT(traverse_module_state->__pyx_kp_s_unable_to_allocate_array_data);
- Py_VISIT(traverse_module_state->__pyx_kp_s_unable_to_allocate_shape_and_str);
- Py_VISIT(traverse_module_state->__pyx_n_s_unpack);
- Py_VISIT(traverse_module_state->__pyx_n_s_update);
- Py_VISIT(traverse_module_state->__pyx_n_s_values);
- Py_VISIT(traverse_module_state->__pyx_n_s_version_info);
- Py_VISIT(traverse_module_state->__pyx_int_0);
- Py_VISIT(traverse_module_state->__pyx_int_1);
- Py_VISIT(traverse_module_state->__pyx_int_3);
- Py_VISIT(traverse_module_state->__pyx_int_112105877);
- Py_VISIT(traverse_module_state->__pyx_int_136983863);
- Py_VISIT(traverse_module_state->__pyx_int_184977713);
- Py_VISIT(traverse_module_state->__pyx_int_neg_1);
- Py_VISIT(traverse_module_state->__pyx_slice__5);
- Py_VISIT(traverse_module_state->__pyx_tuple__4);
- Py_VISIT(traverse_module_state->__pyx_tuple__8);
- Py_VISIT(traverse_module_state->__pyx_tuple__10);
- Py_VISIT(traverse_module_state->__pyx_tuple__11);
- Py_VISIT(traverse_module_state->__pyx_tuple__12);
- Py_VISIT(traverse_module_state->__pyx_tuple__13);
- Py_VISIT(traverse_module_state->__pyx_tuple__14);
- Py_VISIT(traverse_module_state->__pyx_tuple__15);
- Py_VISIT(traverse_module_state->__pyx_tuple__16);
- Py_VISIT(traverse_module_state->__pyx_tuple__17);
- Py_VISIT(traverse_module_state->__pyx_tuple__18);
- Py_VISIT(traverse_module_state->__pyx_tuple__19);
- Py_VISIT(traverse_module_state->__pyx_tuple__21);
- Py_VISIT(traverse_module_state->__pyx_codeobj__20);
- Py_VISIT(traverse_module_state->__pyx_codeobj__22);
- return 0;
-}
-#endif
-/* #### Code section: module_state_defines ### */
-#define __pyx_d __pyx_mstate_global->__pyx_d
-#define __pyx_b __pyx_mstate_global->__pyx_b
-#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime
-#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple
-#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes
-#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode
-#ifdef __Pyx_CyFunction_USED
-#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType
-#endif
-#ifdef __Pyx_FusedFunction_USED
-#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType
-#endif
-#ifdef __Pyx_Generator_USED
-#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType
-#endif
-#ifdef __Pyx_IterableCoroutine_USED
-#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType
-#endif
-#ifdef __Pyx_Coroutine_USED
-#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType
-#endif
-#ifdef __Pyx_Coroutine_USED
-#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType
-#endif
-#if CYTHON_USE_MODULE_STATE
-#endif
-#if CYTHON_USE_MODULE_STATE
-#endif
-#if CYTHON_USE_MODULE_STATE
-#endif
-#if CYTHON_USE_MODULE_STATE
-#define __pyx_type___pyx_array __pyx_mstate_global->__pyx_type___pyx_array
-#define __pyx_type___pyx_MemviewEnum __pyx_mstate_global->__pyx_type___pyx_MemviewEnum
-#define __pyx_type___pyx_memoryview __pyx_mstate_global->__pyx_type___pyx_memoryview
-#define __pyx_type___pyx_memoryviewslice __pyx_mstate_global->__pyx_type___pyx_memoryviewslice
-#endif
-#define __pyx_array_type __pyx_mstate_global->__pyx_array_type
-#define __pyx_MemviewEnum_type __pyx_mstate_global->__pyx_MemviewEnum_type
-#define __pyx_memoryview_type __pyx_mstate_global->__pyx_memoryview_type
-#define __pyx_memoryviewslice_type __pyx_mstate_global->__pyx_memoryviewslice_type
-#define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_
-#define __pyx_n_s_ASCII __pyx_mstate_global->__pyx_n_s_ASCII
-#define __pyx_kp_s_All_dimensions_preceding_dimensi __pyx_mstate_global->__pyx_kp_s_All_dimensions_preceding_dimensi
-#define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError
-#define __pyx_kp_s_Buffer_view_does_not_expose_stri __pyx_mstate_global->__pyx_kp_s_Buffer_view_does_not_expose_stri
-#define __pyx_kp_s_Can_only_create_a_buffer_that_is __pyx_mstate_global->__pyx_kp_s_Can_only_create_a_buffer_that_is
-#define __pyx_kp_s_Cannot_assign_to_read_only_memor __pyx_mstate_global->__pyx_kp_s_Cannot_assign_to_read_only_memor
-#define __pyx_kp_s_Cannot_create_writable_memory_vi __pyx_mstate_global->__pyx_kp_s_Cannot_create_writable_memory_vi
-#define __pyx_kp_u_Cannot_index_with_type __pyx_mstate_global->__pyx_kp_u_Cannot_index_with_type
-#define __pyx_kp_s_Cannot_transpose_memoryview_with __pyx_mstate_global->__pyx_kp_s_Cannot_transpose_memoryview_with
-#define __pyx_kp_s_Dimension_d_is_not_direct __pyx_mstate_global->__pyx_kp_s_Dimension_d_is_not_direct
-#define __pyx_n_s_Ellipsis __pyx_mstate_global->__pyx_n_s_Ellipsis
-#define __pyx_kp_s_Empty_shape_tuple_for_cython_arr __pyx_mstate_global->__pyx_kp_s_Empty_shape_tuple_for_cython_arr
-#define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0
-#define __pyx_n_s_IndexError __pyx_mstate_global->__pyx_n_s_IndexError
-#define __pyx_kp_s_Index_out_of_bounds_axis_d __pyx_mstate_global->__pyx_kp_s_Index_out_of_bounds_axis_d
-#define __pyx_kp_s_Indirect_dimensions_not_supporte __pyx_mstate_global->__pyx_kp_s_Indirect_dimensions_not_supporte
-#define __pyx_kp_u_Invalid_mode_expected_c_or_fortr __pyx_mstate_global->__pyx_kp_u_Invalid_mode_expected_c_or_fortr
-#define __pyx_kp_u_Invalid_shape_in_axis __pyx_mstate_global->__pyx_kp_u_Invalid_shape_in_axis
-#define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError
-#define __pyx_kp_s_MemoryView_of_r_at_0x_x __pyx_mstate_global->__pyx_kp_s_MemoryView_of_r_at_0x_x
-#define __pyx_kp_s_MemoryView_of_r_object __pyx_mstate_global->__pyx_kp_s_MemoryView_of_r_object
-#define __pyx_n_b_O __pyx_mstate_global->__pyx_n_b_O
-#define __pyx_kp_u_Out_of_bounds_on_buffer_access_a __pyx_mstate_global->__pyx_kp_u_Out_of_bounds_on_buffer_access_a
-#define __pyx_n_s_PickleError __pyx_mstate_global->__pyx_n_s_PickleError
-#define __pyx_n_s_Sequence __pyx_mstate_global->__pyx_n_s_Sequence
-#define __pyx_kp_s_Step_may_not_be_zero_axis_d __pyx_mstate_global->__pyx_kp_s_Step_may_not_be_zero_axis_d
-#define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError
-#define __pyx_kp_s_Unable_to_convert_item_to_object __pyx_mstate_global->__pyx_kp_s_Unable_to_convert_item_to_object
-#define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError
-#define __pyx_n_s_View_MemoryView __pyx_mstate_global->__pyx_n_s_View_MemoryView
-#define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2
-#define __pyx_n_s__23 __pyx_mstate_global->__pyx_n_s__23
-#define __pyx_n_s__3 __pyx_mstate_global->__pyx_n_s__3
-#define __pyx_kp_u__6 __pyx_mstate_global->__pyx_kp_u__6
-#define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7
-#define __pyx_n_s_abc __pyx_mstate_global->__pyx_n_s_abc
-#define __pyx_n_s_allocate_buffer __pyx_mstate_global->__pyx_n_s_allocate_buffer
-#define __pyx_kp_u_and __pyx_mstate_global->__pyx_kp_u_and
-#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines
-#define __pyx_n_s_base __pyx_mstate_global->__pyx_n_s_base
-#define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c
-#define __pyx_n_u_c __pyx_mstate_global->__pyx_n_u_c
-#define __pyx_n_s_class __pyx_mstate_global->__pyx_n_s_class
-#define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem
-#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
-#define __pyx_n_s_collections __pyx_mstate_global->__pyx_n_s_collections
-#define __pyx_kp_s_collections_abc __pyx_mstate_global->__pyx_kp_s_collections_abc
-#define __pyx_kp_s_contiguous_and_direct __pyx_mstate_global->__pyx_kp_s_contiguous_and_direct
-#define __pyx_kp_s_contiguous_and_indirect __pyx_mstate_global->__pyx_kp_s_contiguous_and_indirect
-#define __pyx_kp_s_core_pyx __pyx_mstate_global->__pyx_kp_s_core_pyx
-#define __pyx_n_s_count __pyx_mstate_global->__pyx_n_s_count
-#define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict
-#define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable
-#define __pyx_n_s_dtype_is_object __pyx_mstate_global->__pyx_n_s_dtype_is_object
-#define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable
-#define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode
-#define __pyx_n_s_enumerate __pyx_mstate_global->__pyx_n_s_enumerate
-#define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error
-#define __pyx_n_s_flags __pyx_mstate_global->__pyx_n_s_flags
-#define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format
-#define __pyx_n_s_fortran __pyx_mstate_global->__pyx_n_s_fortran
-#define __pyx_n_u_fortran __pyx_mstate_global->__pyx_n_u_fortran
-#define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc
-#define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate
-#define __pyx_kp_u_got __pyx_mstate_global->__pyx_kp_u_got
-#define __pyx_kp_u_got_differing_extents_in_dimensi __pyx_mstate_global->__pyx_kp_u_got_differing_extents_in_dimensi
-#define __pyx_n_s_id __pyx_mstate_global->__pyx_n_s_id
-#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import
-#define __pyx_n_s_index __pyx_mstate_global->__pyx_n_s_index
-#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing
-#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine
-#define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled
-#define __pyx_n_s_itemsize __pyx_mstate_global->__pyx_n_s_itemsize
-#define __pyx_kp_s_itemsize_0_for_cython_array __pyx_mstate_global->__pyx_kp_s_itemsize_0_for_cython_array
-#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main
-#define __pyx_n_s_maximum_path_c __pyx_mstate_global->__pyx_n_s_maximum_path_c
-#define __pyx_n_s_memview __pyx_mstate_global->__pyx_n_s_memview
-#define __pyx_n_s_mode __pyx_mstate_global->__pyx_n_s_mode
-#define __pyx_n_s_monotonic_align_core __pyx_mstate_global->__pyx_n_s_monotonic_align_core
-#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name
-#define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2
-#define __pyx_n_s_ndim __pyx_mstate_global->__pyx_n_s_ndim
-#define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new
-#define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non
-#define __pyx_n_s_obj __pyx_mstate_global->__pyx_n_s_obj
-#define __pyx_n_s_pack __pyx_mstate_global->__pyx_n_s_pack
-#define __pyx_n_s_paths __pyx_mstate_global->__pyx_n_s_paths
-#define __pyx_n_s_pickle __pyx_mstate_global->__pyx_n_s_pickle
-#define __pyx_n_s_pyx_PickleError __pyx_mstate_global->__pyx_n_s_pyx_PickleError
-#define __pyx_n_s_pyx_checksum __pyx_mstate_global->__pyx_n_s_pyx_checksum
-#define __pyx_n_s_pyx_result __pyx_mstate_global->__pyx_n_s_pyx_result
-#define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state
-#define __pyx_n_s_pyx_type __pyx_mstate_global->__pyx_n_s_pyx_type
-#define __pyx_n_s_pyx_unpickle_Enum __pyx_mstate_global->__pyx_n_s_pyx_unpickle_Enum
-#define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable
-#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range
-#define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce
-#define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython
-#define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex
-#define __pyx_n_s_register __pyx_mstate_global->__pyx_n_s_register
-#define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate
-#define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython
-#define __pyx_n_s_shape __pyx_mstate_global->__pyx_n_s_shape
-#define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size
-#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec
-#define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start
-#define __pyx_n_s_step __pyx_mstate_global->__pyx_n_s_step
-#define __pyx_n_s_stop __pyx_mstate_global->__pyx_n_s_stop
-#define __pyx_kp_s_strided_and_direct __pyx_mstate_global->__pyx_kp_s_strided_and_direct
-#define __pyx_kp_s_strided_and_direct_or_indirect __pyx_mstate_global->__pyx_kp_s_strided_and_direct_or_indirect
-#define __pyx_kp_s_strided_and_indirect __pyx_mstate_global->__pyx_kp_s_strided_and_indirect
-#define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource
-#define __pyx_n_s_struct __pyx_mstate_global->__pyx_n_s_struct
-#define __pyx_n_s_sys __pyx_mstate_global->__pyx_n_s_sys
-#define __pyx_n_s_t_xs __pyx_mstate_global->__pyx_n_s_t_xs
-#define __pyx_n_s_t_ys __pyx_mstate_global->__pyx_n_s_t_ys
-#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
-#define __pyx_kp_s_unable_to_allocate_array_data __pyx_mstate_global->__pyx_kp_s_unable_to_allocate_array_data
-#define __pyx_kp_s_unable_to_allocate_shape_and_str __pyx_mstate_global->__pyx_kp_s_unable_to_allocate_shape_and_str
-#define __pyx_n_s_unpack __pyx_mstate_global->__pyx_n_s_unpack
-#define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update
-#define __pyx_n_s_values __pyx_mstate_global->__pyx_n_s_values
-#define __pyx_n_s_version_info __pyx_mstate_global->__pyx_n_s_version_info
-#define __pyx_int_0 __pyx_mstate_global->__pyx_int_0
-#define __pyx_int_1 __pyx_mstate_global->__pyx_int_1
-#define __pyx_int_3 __pyx_mstate_global->__pyx_int_3
-#define __pyx_int_112105877 __pyx_mstate_global->__pyx_int_112105877
-#define __pyx_int_136983863 __pyx_mstate_global->__pyx_int_136983863
-#define __pyx_int_184977713 __pyx_mstate_global->__pyx_int_184977713
-#define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1
-#define __pyx_k__9 __pyx_mstate_global->__pyx_k__9
-#define __pyx_slice__5 __pyx_mstate_global->__pyx_slice__5
-#define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4
-#define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8
-#define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10
-#define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11
-#define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12
-#define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13
-#define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14
-#define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15
-#define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16
-#define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17
-#define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18
-#define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19
-#define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21
-#define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20
-#define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22
-/* #### Code section: module_code ### */
-
-/* "View.MemoryView":131
- * cdef bint dtype_is_object
- *
- * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
- * mode="c", bint allocate_buffer=True):
- *
- */
-
-/* Python wrapper */
-static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_shape = 0;
- Py_ssize_t __pyx_v_itemsize;
- PyObject *__pyx_v_format = 0;
- PyObject *__pyx_v_mode = 0;
- int __pyx_v_allocate_buffer;
- CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
- {
- PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
- PyObject* values[5] = {0,0,0,0,0};
- values[3] = ((PyObject *)__pyx_n_s_c);
- if (__pyx_kwds) {
- Py_ssize_t kw_args;
- switch (__pyx_nargs) {
- case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
- CYTHON_FALLTHROUGH;
- case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
- CYTHON_FALLTHROUGH;
- case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
- CYTHON_FALLTHROUGH;
- case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
- CYTHON_FALLTHROUGH;
- case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
- CYTHON_FALLTHROUGH;
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
- switch (__pyx_nargs) {
- case 0:
- if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_shape)) != 0)) kw_args--;
- else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
- else goto __pyx_L5_argtuple_error;
- CYTHON_FALLTHROUGH;
- case 1:
- if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_itemsize)) != 0)) kw_args--;
- else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
- else {
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 131, __pyx_L3_error)
- }
- CYTHON_FALLTHROUGH;
- case 2:
- if (likely((values[2] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_format)) != 0)) kw_args--;
- else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
- else {
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 131, __pyx_L3_error)
- }
- CYTHON_FALLTHROUGH;
- case 3:
- if (kw_args > 0) {
- PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode);
- if (value) { values[3] = value; kw_args--; }
- else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
- }
- CYTHON_FALLTHROUGH;
- case 4:
- if (kw_args > 0) {
- PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_allocate_buffer);
- if (value) { values[4] = value; kw_args--; }
- else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- const Py_ssize_t kwd_pos_args = __pyx_nargs;
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(1, 131, __pyx_L3_error)
- }
- } else {
- switch (__pyx_nargs) {
- case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
- CYTHON_FALLTHROUGH;
- case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
- CYTHON_FALLTHROUGH;
- case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
- values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
- values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_shape = ((PyObject*)values[0]);
- __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
- __pyx_v_format = values[2];
- __pyx_v_mode = values[3];
- if (values[4]) {
- __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 132, __pyx_L3_error)
- } else {
-
- /* "View.MemoryView":132
- *
- * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
- * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
- *
- * cdef int idx
- */
- __pyx_v_allocate_buffer = ((int)1);
- }
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, __pyx_nargs); __PYX_ERR(1, 131, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return -1;
- __pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 131, __pyx_L1_error)
- if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
- PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 131, __pyx_L1_error)
- }
- __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
-
- /* "View.MemoryView":131
- * cdef bint dtype_is_object
- *
- * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
- * mode="c", bint allocate_buffer=True):
- *
- */
-
- /* function exit code */
- goto __pyx_L0;
- __pyx_L1_error:;
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
- int __pyx_v_idx;
- Py_ssize_t __pyx_v_dim;
- char __pyx_v_order;
- int __pyx_r;
- __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;
- int __pyx_t_7;
- char *__pyx_t_8;
- Py_ssize_t __pyx_t_9;
- Py_UCS4 __pyx_t_10;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__cinit__", 0);
- __Pyx_INCREF(__pyx_v_format);
-
- /* "View.MemoryView":137
- * cdef Py_ssize_t dim
- *
- * self.ndim = len(shape) # <<<<<<<<<<<<<<
- * self.itemsize = itemsize
- *
- */
- if (unlikely(__pyx_v_shape == Py_None)) {
- PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
- __PYX_ERR(1, 137, __pyx_L1_error)
- }
- __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 137, __pyx_L1_error)
- __pyx_v_self->ndim = ((int)__pyx_t_1);
-
- /* "View.MemoryView":138
- *
- * self.ndim = len(shape)
- * self.itemsize = itemsize # <<<<<<<<<<<<<<
- *
- * if not self.ndim:
- */
- __pyx_v_self->itemsize = __pyx_v_itemsize;
-
- /* "View.MemoryView":140
- * self.itemsize = itemsize
- *
- * if not self.ndim: # <<<<<<<<<<<<<<
- * raise ValueError, "Empty shape tuple for cython.array"
- *
- */
- __pyx_t_2 = (!(__pyx_v_self->ndim != 0));
- if (unlikely(__pyx_t_2)) {
-
- /* "View.MemoryView":141
- *
- * if not self.ndim:
- * raise ValueError, "Empty shape tuple for cython.array" # <<<<<<<<<<<<<<
- *
- * if itemsize <= 0:
- */
- __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Empty_shape_tuple_for_cython_arr, 0, 0);
- __PYX_ERR(1, 141, __pyx_L1_error)
-
- /* "View.MemoryView":140
- * self.itemsize = itemsize
- *
- * if not self.ndim: # <<<<<<<<<<<<<<
- * raise ValueError, "Empty shape tuple for cython.array"
- *
- */
- }
-
- /* "View.MemoryView":143
- * raise ValueError, "Empty shape tuple for cython.array"
- *
- * if itemsize <= 0: # <<<<<<<<<<<<<<
- * raise ValueError, "itemsize <= 0 for cython.array"
- *
- */
- __pyx_t_2 = (__pyx_v_itemsize <= 0);
- if (unlikely(__pyx_t_2)) {
-
- /* "View.MemoryView":144
- *
- * if itemsize <= 0:
- * raise ValueError, "itemsize <= 0 for cython.array" # <<<<<<<<<<<<<<
- *
- * if not isinstance(format, bytes):
- */
- __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_itemsize_0_for_cython_array, 0, 0);
- __PYX_ERR(1, 144, __pyx_L1_error)
-
- /* "View.MemoryView":143
- * raise ValueError, "Empty shape tuple for cython.array"
- *
- * if itemsize <= 0: # <<<<<<<<<<<<<<
- * raise ValueError, "itemsize <= 0 for cython.array"
- *
- */
- }
-
- /* "View.MemoryView":146
- * raise ValueError, "itemsize <= 0 for cython.array"
- *
- * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
- * format = format.encode('ASCII')
- * self._format = format # keep a reference to the byte string
- */
- __pyx_t_2 = PyBytes_Check(__pyx_v_format);
- __pyx_t_3 = (!__pyx_t_2);
- if (__pyx_t_3) {
-
- /* "View.MemoryView":147
- *
- * if not isinstance(format, bytes):
- * format = format.encode('ASCII') # <<<<<<<<<<<<<<
- * self._format = format # keep a reference to the byte string
- * self.format = self._format
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 147, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = NULL;
- __pyx_t_7 = 0;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_6)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
- __pyx_t_7 = 1;
- }
- }
- {
- PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_n_s_ASCII};
- __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 147, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- }
- __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "View.MemoryView":146
- * raise ValueError, "itemsize <= 0 for cython.array"
- *
- * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
- * format = format.encode('ASCII')
- * self._format = format # keep a reference to the byte string
- */
- }
-
- /* "View.MemoryView":148
- * if not isinstance(format, bytes):
- * format = format.encode('ASCII')
- * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
- * self.format = self._format
- *
- */
- if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_v_format))) __PYX_ERR(1, 148, __pyx_L1_error)
- __pyx_t_4 = __pyx_v_format;
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __Pyx_GOTREF(__pyx_v_self->_format);
- __Pyx_DECREF(__pyx_v_self->_format);
- __pyx_v_self->_format = ((PyObject*)__pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "View.MemoryView":149
- * format = format.encode('ASCII')
- * self._format = format # keep a reference to the byte string
- * self.format = self._format # <<<<<<<<<<<<<<
- *
- *
- */
- if (unlikely(__pyx_v_self->_format == Py_None)) {
- PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
- __PYX_ERR(1, 149, __pyx_L1_error)
- }
- __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(1, 149, __pyx_L1_error)
- __pyx_v_self->format = __pyx_t_8;
-
- /* "View.MemoryView":152
- *
- *
- * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
- * self._strides = self._shape + self.ndim
- *
- */
- __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
-
- /* "View.MemoryView":153
- *
- * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
- * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
- *
- * if not self._shape:
- */
- __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
-
- /* "View.MemoryView":155
- * self._strides = self._shape + self.ndim
- *
- * if not self._shape: # <<<<<<<<<<<<<<
- * raise MemoryError, "unable to allocate shape and strides."
- *
- */
- __pyx_t_3 = (!(__pyx_v_self->_shape != 0));
- if (unlikely(__pyx_t_3)) {
-
- /* "View.MemoryView":156
- *
- * if not self._shape:
- * raise MemoryError, "unable to allocate shape and strides." # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_Raise(__pyx_builtin_MemoryError, __pyx_kp_s_unable_to_allocate_shape_and_str, 0, 0);
- __PYX_ERR(1, 156, __pyx_L1_error)
-
- /* "View.MemoryView":155
- * self._strides = self._shape + self.ndim
- *
- * if not self._shape: # <<<<<<<<<<<<<<
- * raise MemoryError, "unable to allocate shape and strides."
- *
- */
- }
-
- /* "View.MemoryView":159
- *
- *
- * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
- * if dim <= 0:
- * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
- */
- __pyx_t_7 = 0;
- __pyx_t_4 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = 0;
- for (;;) {
- if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(1, 159, __pyx_L1_error)
- #else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 159, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- #endif
- __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 159, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_v_dim = __pyx_t_9;
- __pyx_v_idx = __pyx_t_7;
- __pyx_t_7 = (__pyx_t_7 + 1);
-
- /* "View.MemoryView":160
- *
- * for idx, dim in enumerate(shape):
- * if dim <= 0: # <<<<<<<<<<<<<<
- * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
- * self._shape[idx] = dim
- */
- __pyx_t_3 = (__pyx_v_dim <= 0);
- if (unlikely(__pyx_t_3)) {
-
- /* "View.MemoryView":161
- * for idx, dim in enumerate(shape):
- * if dim <= 0:
- * raise ValueError, f"Invalid shape in axis {idx}: {dim}." # <<<<<<<<<<<<<<
- * self._shape[idx] = dim
- *
- */
- __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 161, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_9 = 0;
- __pyx_t_10 = 127;
- __Pyx_INCREF(__pyx_kp_u_Invalid_shape_in_axis);
- __pyx_t_9 += 22;
- __Pyx_GIVEREF(__pyx_kp_u_Invalid_shape_in_axis);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_Invalid_shape_in_axis);
- __pyx_t_6 = __Pyx_PyUnicode_From_int(__pyx_v_idx, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
- __pyx_t_6 = 0;
- __Pyx_INCREF(__pyx_kp_u_);
- __pyx_t_9 += 2;
- __Pyx_GIVEREF(__pyx_kp_u_);
- PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_);
- __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_6);
- __pyx_t_6 = 0;
- __Pyx_INCREF(__pyx_kp_u__2);
- __pyx_t_9 += 1;
- __Pyx_GIVEREF(__pyx_kp_u__2);
- PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u__2);
- __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_6, 0, 0);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __PYX_ERR(1, 161, __pyx_L1_error)
-
- /* "View.MemoryView":160
- *
- * for idx, dim in enumerate(shape):
- * if dim <= 0: # <<<<<<<<<<<<<<
- * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
- * self._shape[idx] = dim
- */
- }
-
- /* "View.MemoryView":162
- * if dim <= 0:
- * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
- * self._shape[idx] = dim # <<<<<<<<<<<<<<
- *
- * cdef char order
- */
- (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
-
- /* "View.MemoryView":159
- *
- *
- * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
- * if dim <= 0:
- * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
- */
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "View.MemoryView":165
- *
- * cdef char order
- * if mode == 'c': # <<<<<<<<<<<<<<
- * order = b'C'
- * self.mode = u'c'
- */
- __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 165, __pyx_L1_error)
- if (__pyx_t_3) {
-
- /* "View.MemoryView":166
- * cdef char order
- * if mode == 'c':
- * order = b'C' # <<<<<<<<<<<<<<
- * self.mode = u'c'
- * elif mode == 'fortran':
- */
- __pyx_v_order = 'C';
-
- /* "View.MemoryView":167
- * if mode == 'c':
- * order = b'C'
- * self.mode = u'c' # <<<<<<<<<<<<<<
- * elif mode == 'fortran':
- * order = b'F'
- */
- __Pyx_INCREF(__pyx_n_u_c);
- __Pyx_GIVEREF(__pyx_n_u_c);
- __Pyx_GOTREF(__pyx_v_self->mode);
- __Pyx_DECREF(__pyx_v_self->mode);
- __pyx_v_self->mode = __pyx_n_u_c;
-
- /* "View.MemoryView":165
- *
- * cdef char order
- * if mode == 'c': # <<<<<<<<<<<<<<
- * order = b'C'
- * self.mode = u'c'
- */
- goto __pyx_L11;
- }
-
- /* "View.MemoryView":168
- * order = b'C'
- * self.mode = u'c'
- * elif mode == 'fortran': # <<<<<<<<<<<<<<
- * order = b'F'
- * self.mode = u'fortran'
- */
- __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 168, __pyx_L1_error)
- if (likely(__pyx_t_3)) {
-
- /* "View.MemoryView":169
- * self.mode = u'c'
- * elif mode == 'fortran':
- * order = b'F' # <<<<<<<<<<<<<<
- * self.mode = u'fortran'
- * else:
- */
- __pyx_v_order = 'F';
-
- /* "View.MemoryView":170
- * elif mode == 'fortran':
- * order = b'F'
- * self.mode = u'fortran' # <<<<<<<<<<<<<<
- * else:
- * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
- */
- __Pyx_INCREF(__pyx_n_u_fortran);
- __Pyx_GIVEREF(__pyx_n_u_fortran);
- __Pyx_GOTREF(__pyx_v_self->mode);
- __Pyx_DECREF(__pyx_v_self->mode);
- __pyx_v_self->mode = __pyx_n_u_fortran;
-
- /* "View.MemoryView":168
- * order = b'C'
- * self.mode = u'c'
- * elif mode == 'fortran': # <<<<<<<<<<<<<<
- * order = b'F'
- * self.mode = u'fortran'
- */
- goto __pyx_L11;
- }
-
- /* "View.MemoryView":172
- * self.mode = u'fortran'
- * else:
- * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}" # <<<<<<<<<<<<<<
- *
- * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
- */
- /*else*/ {
- __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_mode, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 172, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_mode_expected_c_or_fortr, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 172, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_6, 0, 0);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __PYX_ERR(1, 172, __pyx_L1_error)
- }
- __pyx_L11:;
-
- /* "View.MemoryView":174
- * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
- *
- * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order) # <<<<<<<<<<<<<<
- *
- * self.free_data = allocate_buffer
- */
- __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
-
- /* "View.MemoryView":176
- * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
- *
- * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
- * self.dtype_is_object = format == b'O'
- *
- */
- __pyx_v_self->free_data = __pyx_v_allocate_buffer;
-
- /* "View.MemoryView":177
- *
- * self.free_data = allocate_buffer
- * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
- *
- * if allocate_buffer:
- */
- __pyx_t_6 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 177, __pyx_L1_error)
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 177, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_self->dtype_is_object = __pyx_t_3;
-
- /* "View.MemoryView":179
- * self.dtype_is_object = format == b'O'
- *
- * if allocate_buffer: # <<<<<<<<<<<<<<
- * _allocate_buffer(self)
- *
- */
- if (__pyx_v_allocate_buffer) {
-
- /* "View.MemoryView":180
- *
- * if allocate_buffer:
- * _allocate_buffer(self) # <<<<<<<<<<<<<<
- *
- * @cname('getbuffer')
- */
- __pyx_t_7 = __pyx_array_allocate_buffer(__pyx_v_self); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(1, 180, __pyx_L1_error)
-
- /* "View.MemoryView":179
- * self.dtype_is_object = format == b'O'
- *
- * if allocate_buffer: # <<<<<<<<<<<<<<
- * _allocate_buffer(self)
- *
- */
- }
-
- /* "View.MemoryView":131
- * cdef bint dtype_is_object
- *
- * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
- * mode="c", bint allocate_buffer=True):
- *
- */
-
- /* function exit code */
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_format);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":182
- * _allocate_buffer(self)
- *
- * @cname('getbuffer') # <<<<<<<<<<<<<<
- * def __getbuffer__(self, Py_buffer *info, int flags):
- * cdef int bufmode = -1
- */
-
-/* Python wrapper */
-CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
-CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
- __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
- int __pyx_v_bufmode;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- char *__pyx_t_2;
- Py_ssize_t __pyx_t_3;
- int __pyx_t_4;
- Py_ssize_t *__pyx_t_5;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- if (unlikely(__pyx_v_info == NULL)) {
- PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
- return -1;
- }
- __Pyx_RefNannySetupContext("__getbuffer__", 0);
- __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
- __Pyx_GIVEREF(__pyx_v_info->obj);
-
- /* "View.MemoryView":184
- * @cname('getbuffer')
- * def __getbuffer__(self, Py_buffer *info, int flags):
- * cdef int bufmode = -1 # <<<<<<<<<<<<<<
- * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
- * if self.mode == u"c":
- */
- __pyx_v_bufmode = -1;
-
- /* "View.MemoryView":185
- * def __getbuffer__(self, Py_buffer *info, int flags):
- * cdef int bufmode = -1
- * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<<
- * if self.mode == u"c":
- * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- */
- __pyx_t_1 = ((__pyx_v_flags & ((PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS) | PyBUF_ANY_CONTIGUOUS)) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":186
- * cdef int bufmode = -1
- * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
- * if self.mode == u"c": # <<<<<<<<<<<<<<
- * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- * elif self.mode == u"fortran":
- */
- __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 186, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "View.MemoryView":187
- * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
- * if self.mode == u"c":
- * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
- * elif self.mode == u"fortran":
- * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- */
- __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
-
- /* "View.MemoryView":186
- * cdef int bufmode = -1
- * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
- * if self.mode == u"c": # <<<<<<<<<<<<<<
- * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- * elif self.mode == u"fortran":
- */
- goto __pyx_L4;
- }
-
- /* "View.MemoryView":188
- * if self.mode == u"c":
- * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
- * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- * if not (flags & bufmode):
- */
- __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 188, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "View.MemoryView":189
- * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- * elif self.mode == u"fortran":
- * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
- * if not (flags & bufmode):
- * raise ValueError, "Can only create a buffer that is contiguous in memory."
- */
- __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
-
- /* "View.MemoryView":188
- * if self.mode == u"c":
- * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
- * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- * if not (flags & bufmode):
- */
- }
- __pyx_L4:;
-
- /* "View.MemoryView":190
- * elif self.mode == u"fortran":
- * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- * if not (flags & bufmode): # <<<<<<<<<<<<<<
- * raise ValueError, "Can only create a buffer that is contiguous in memory."
- * info.buf = self.data
- */
- __pyx_t_1 = (!((__pyx_v_flags & __pyx_v_bufmode) != 0));
- if (unlikely(__pyx_t_1)) {
-
- /* "View.MemoryView":191
- * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- * if not (flags & bufmode):
- * raise ValueError, "Can only create a buffer that is contiguous in memory." # <<<<<<<<<<<<<<
- * info.buf = self.data
- * info.len = self.len
- */
- __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Can_only_create_a_buffer_that_is, 0, 0);
- __PYX_ERR(1, 191, __pyx_L1_error)
-
- /* "View.MemoryView":190
- * elif self.mode == u"fortran":
- * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- * if not (flags & bufmode): # <<<<<<<<<<<<<<
- * raise ValueError, "Can only create a buffer that is contiguous in memory."
- * info.buf = self.data
- */
- }
-
- /* "View.MemoryView":185
- * def __getbuffer__(self, Py_buffer *info, int flags):
- * cdef int bufmode = -1
- * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<<
- * if self.mode == u"c":
- * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- */
- }
-
- /* "View.MemoryView":192
- * if not (flags & bufmode):
- * raise ValueError, "Can only create a buffer that is contiguous in memory."
- * info.buf = self.data # <<<<<<<<<<<<<<
- * info.len = self.len
- *
- */
- __pyx_t_2 = __pyx_v_self->data;
- __pyx_v_info->buf = __pyx_t_2;
-
- /* "View.MemoryView":193
- * raise ValueError, "Can only create a buffer that is contiguous in memory."
- * info.buf = self.data
- * info.len = self.len # <<<<<<<<<<<<<<
- *
- * if flags & PyBUF_STRIDES:
- */
- __pyx_t_3 = __pyx_v_self->len;
- __pyx_v_info->len = __pyx_t_3;
-
- /* "View.MemoryView":195
- * info.len = self.len
- *
- * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
- * info.ndim = self.ndim
- * info.shape = self._shape
- */
- __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":196
- *
- * if flags & PyBUF_STRIDES:
- * info.ndim = self.ndim # <<<<<<<<<<<<<<
- * info.shape = self._shape
- * info.strides = self._strides
- */
- __pyx_t_4 = __pyx_v_self->ndim;
- __pyx_v_info->ndim = __pyx_t_4;
-
- /* "View.MemoryView":197
- * if flags & PyBUF_STRIDES:
- * info.ndim = self.ndim
- * info.shape = self._shape # <<<<<<<<<<<<<<
- * info.strides = self._strides
- * else:
- */
- __pyx_t_5 = __pyx_v_self->_shape;
- __pyx_v_info->shape = __pyx_t_5;
-
- /* "View.MemoryView":198
- * info.ndim = self.ndim
- * info.shape = self._shape
- * info.strides = self._strides # <<<<<<<<<<<<<<
- * else:
- * info.ndim = 1
- */
- __pyx_t_5 = __pyx_v_self->_strides;
- __pyx_v_info->strides = __pyx_t_5;
-
- /* "View.MemoryView":195
- * info.len = self.len
- *
- * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
- * info.ndim = self.ndim
- * info.shape = self._shape
- */
- goto __pyx_L6;
- }
-
- /* "View.MemoryView":200
- * info.strides = self._strides
- * else:
- * info.ndim = 1 # <<<<<<<<<<<<<<
- * info.shape = &self.len if flags & PyBUF_ND else NULL
- * info.strides = NULL
- */
- /*else*/ {
- __pyx_v_info->ndim = 1;
-
- /* "View.MemoryView":201
- * else:
- * info.ndim = 1
- * info.shape = &self.len if flags & PyBUF_ND else NULL # <<<<<<<<<<<<<<
- * info.strides = NULL
- *
- */
- if (((__pyx_v_flags & PyBUF_ND) != 0)) {
- __pyx_t_5 = (&__pyx_v_self->len);
- } else {
- __pyx_t_5 = NULL;
- }
- __pyx_v_info->shape = __pyx_t_5;
-
- /* "View.MemoryView":202
- * info.ndim = 1
- * info.shape = &self.len if flags & PyBUF_ND else NULL
- * info.strides = NULL # <<<<<<<<<<<<<<
- *
- * info.suboffsets = NULL
- */
- __pyx_v_info->strides = NULL;
- }
- __pyx_L6:;
-
- /* "View.MemoryView":204
- * info.strides = NULL
- *
- * info.suboffsets = NULL # <<<<<<<<<<<<<<
- * info.itemsize = self.itemsize
- * info.readonly = 0
- */
- __pyx_v_info->suboffsets = NULL;
-
- /* "View.MemoryView":205
- *
- * info.suboffsets = NULL
- * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
- * info.readonly = 0
- * info.format = self.format if flags & PyBUF_FORMAT else NULL
- */
- __pyx_t_3 = __pyx_v_self->itemsize;
- __pyx_v_info->itemsize = __pyx_t_3;
-
- /* "View.MemoryView":206
- * info.suboffsets = NULL
- * info.itemsize = self.itemsize
- * info.readonly = 0 # <<<<<<<<<<<<<<
- * info.format = self.format if flags & PyBUF_FORMAT else NULL
- * info.obj = self
- */
- __pyx_v_info->readonly = 0;
-
- /* "View.MemoryView":207
- * info.itemsize = self.itemsize
- * info.readonly = 0
- * info.format = self.format if flags & PyBUF_FORMAT else NULL # <<<<<<<<<<<<<<
- * info.obj = self
- *
- */
- if (((__pyx_v_flags & PyBUF_FORMAT) != 0)) {
- __pyx_t_2 = __pyx_v_self->format;
- } else {
- __pyx_t_2 = NULL;
- }
- __pyx_v_info->format = __pyx_t_2;
-
- /* "View.MemoryView":208
- * info.readonly = 0
- * info.format = self.format if flags & PyBUF_FORMAT else NULL
- * info.obj = self # <<<<<<<<<<<<<<
- *
- * def __dealloc__(array self):
- */
- __Pyx_INCREF((PyObject *)__pyx_v_self);
- __Pyx_GIVEREF((PyObject *)__pyx_v_self);
- __Pyx_GOTREF(__pyx_v_info->obj);
- __Pyx_DECREF(__pyx_v_info->obj);
- __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
-
- /* "View.MemoryView":182
- * _allocate_buffer(self)
- *
- * @cname('getbuffer') # <<<<<<<<<<<<<<
- * def __getbuffer__(self, Py_buffer *info, int flags):
- * cdef int bufmode = -1
- */
-
- /* function exit code */
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- if (__pyx_v_info->obj != NULL) {
- __Pyx_GOTREF(__pyx_v_info->obj);
- __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
- }
- goto __pyx_L2;
- __pyx_L0:;
- if (__pyx_v_info->obj == Py_None) {
- __Pyx_GOTREF(__pyx_v_info->obj);
- __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
- }
- __pyx_L2:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":210
- * info.obj = self
- *
- * def __dealloc__(array self): # <<<<<<<<<<<<<<
- * if self.callback_free_data != NULL:
- * self.callback_free_data(self.data)
- */
-
-/* Python wrapper */
-static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
- __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
-}
-
-static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- __Pyx_RefNannySetupContext("__dealloc__", 0);
-
- /* "View.MemoryView":211
- *
- * def __dealloc__(array self):
- * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
- * self.callback_free_data(self.data)
- * elif self.free_data and self.data is not NULL:
- */
- __pyx_t_1 = (__pyx_v_self->callback_free_data != NULL);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":212
- * def __dealloc__(array self):
- * if self.callback_free_data != NULL:
- * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
- * elif self.free_data and self.data is not NULL:
- * if self.dtype_is_object:
- */
- __pyx_v_self->callback_free_data(__pyx_v_self->data);
-
- /* "View.MemoryView":211
- *
- * def __dealloc__(array self):
- * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
- * self.callback_free_data(self.data)
- * elif self.free_data and self.data is not NULL:
- */
- goto __pyx_L3;
- }
-
- /* "View.MemoryView":213
- * if self.callback_free_data != NULL:
- * self.callback_free_data(self.data)
- * elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<<
- * if self.dtype_is_object:
- * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
- */
- if (__pyx_v_self->free_data) {
- } else {
- __pyx_t_1 = __pyx_v_self->free_data;
- goto __pyx_L4_bool_binop_done;
- }
- __pyx_t_2 = (__pyx_v_self->data != NULL);
- __pyx_t_1 = __pyx_t_2;
- __pyx_L4_bool_binop_done:;
- if (__pyx_t_1) {
-
- /* "View.MemoryView":214
- * self.callback_free_data(self.data)
- * elif self.free_data and self.data is not NULL:
- * if self.dtype_is_object: # <<<<<<<<<<<<<<
- * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
- * free(self.data)
- */
- if (__pyx_v_self->dtype_is_object) {
-
- /* "View.MemoryView":215
- * elif self.free_data and self.data is not NULL:
- * if self.dtype_is_object:
- * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False) # <<<<<<<<<<<<<<
- * free(self.data)
- * PyObject_Free(self._shape)
- */
- __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
-
- /* "View.MemoryView":214
- * self.callback_free_data(self.data)
- * elif self.free_data and self.data is not NULL:
- * if self.dtype_is_object: # <<<<<<<<<<<<<<
- * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
- * free(self.data)
- */
- }
-
- /* "View.MemoryView":216
- * if self.dtype_is_object:
- * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
- * free(self.data) # <<<<<<<<<<<<<<
- * PyObject_Free(self._shape)
- *
- */
- free(__pyx_v_self->data);
-
- /* "View.MemoryView":213
- * if self.callback_free_data != NULL:
- * self.callback_free_data(self.data)
- * elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<<
- * if self.dtype_is_object:
- * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
- */
- }
- __pyx_L3:;
-
- /* "View.MemoryView":217
- * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
- * free(self.data)
- * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
- *
- * @property
- */
- PyObject_Free(__pyx_v_self->_shape);
-
- /* "View.MemoryView":210
- * info.obj = self
- *
- * def __dealloc__(array self): # <<<<<<<<<<<<<<
- * if self.callback_free_data != NULL:
- * self.callback_free_data(self.data)
- */
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
-}
-
-/* "View.MemoryView":219
- * PyObject_Free(self._shape)
- *
- * @property # <<<<<<<<<<<<<<
- * def memview(self):
- * return self.get_memview()
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":221
- * @property
- * def memview(self):
- * return self.get_memview() # <<<<<<<<<<<<<<
- *
- * @cname('get_memview')
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- /* "View.MemoryView":219
- * PyObject_Free(self._shape)
- *
- * @property # <<<<<<<<<<<<<<
- * def memview(self):
- * return self.get_memview()
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":224
- *
- * @cname('get_memview')
- * cdef get_memview(self): # <<<<<<<<<<<<<<
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
- * return memoryview(self, flags, self.dtype_is_object)
- */
-
-static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
- int __pyx_v_flags;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("get_memview", 0);
-
- /* "View.MemoryView":225
- * @cname('get_memview')
- * cdef get_memview(self):
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
- * return memoryview(self, flags, self.dtype_is_object)
- *
- */
- __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
-
- /* "View.MemoryView":226
- * cdef get_memview(self):
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
- * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
- *
- * def __len__(self):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 226, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF((PyObject *)__pyx_v_self);
- __Pyx_GIVEREF((PyObject *)__pyx_v_self);
- PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
- __pyx_t_1 = 0;
- __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- /* "View.MemoryView":224
- *
- * @cname('get_memview')
- * cdef get_memview(self): # <<<<<<<<<<<<<<
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
- * return memoryview(self, flags, self.dtype_is_object)
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":228
- * return memoryview(self, flags, self.dtype_is_object)
- *
- * def __len__(self): # <<<<<<<<<<<<<<
- * return self._shape[0]
- *
- */
-
-/* Python wrapper */
-static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
-static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
- Py_ssize_t __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
- __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
- Py_ssize_t __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__len__", 0);
-
- /* "View.MemoryView":229
- *
- * def __len__(self):
- * return self._shape[0] # <<<<<<<<<<<<<<
- *
- * def __getattr__(self, attr):
- */
- __pyx_r = (__pyx_v_self->_shape[0]);
- goto __pyx_L0;
-
- /* "View.MemoryView":228
- * return memoryview(self, flags, self.dtype_is_object)
- *
- * def __len__(self): # <<<<<<<<<<<<<<
- * return self._shape[0]
- *
- */
-
- /* function exit code */
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":231
- * return self._shape[0]
- *
- * def __getattr__(self, attr): # <<<<<<<<<<<<<<
- * return getattr(self.memview, attr)
- *
- */
-
-/* Python wrapper */
-static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
-static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
- __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
- 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("__getattr__", 0);
-
- /* "View.MemoryView":232
- *
- * def __getattr__(self, attr):
- * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
- *
- * def __getitem__(self, item):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 232, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 232, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- /* "View.MemoryView":231
- * return self._shape[0]
- *
- * def __getattr__(self, attr): # <<<<<<<<<<<<<<
- * return getattr(self.memview, attr)
- *
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":234
- * return getattr(self.memview, attr)
- *
- * def __getitem__(self, item): # <<<<<<<<<<<<<<
- * return self.memview[item]
- *
- */
-
-/* Python wrapper */
-static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
-static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
- __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
- 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("__getitem__", 0);
-
- /* "View.MemoryView":235
- *
- * def __getitem__(self, item):
- * return self.memview[item] # <<<<<<<<<<<<<<
- *
- * def __setitem__(self, item, value):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 235, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 235, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- /* "View.MemoryView":234
- * return getattr(self.memview, attr)
- *
- * def __getitem__(self, item): # <<<<<<<<<<<<<<
- * return self.memview[item]
- *
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":237
- * return self.memview[item]
- *
- * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
- * self.memview[item] = value
- *
- */
-
-/* Python wrapper */
-static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
-static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
- __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__setitem__", 0);
-
- /* "View.MemoryView":238
- *
- * def __setitem__(self, item, value):
- * self.memview[item] = value # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 238, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0))) __PYX_ERR(1, 238, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "View.MemoryView":237
- * return self.memview[item]
- *
- * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
- * self.memview[item] = value
- *
- */
-
- /* function exit code */
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "(tree fragment)":1
- * def __reduce_cython__(self): # <<<<<<<<<<<<<<
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
- * def __setstate_cython__(self, __pyx_state):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-) {
- #if !CYTHON_METH_FASTCALL
- CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
- #endif
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
- if (unlikely(__pyx_nargs > 0)) {
- __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
- if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
- __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__reduce_cython__", 0);
-
- /* "(tree fragment)":2
- * def __reduce_cython__(self):
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
- * def __setstate_cython__(self, __pyx_state):
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
- */
- __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
- __PYX_ERR(1, 2, __pyx_L1_error)
-
- /* "(tree fragment)":1
- * def __reduce_cython__(self): # <<<<<<<<<<<<<<
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
- * def __setstate_cython__(self, __pyx_state):
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "(tree fragment)":3
- * def __reduce_cython__(self):
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
- * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-) {
- CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
- #if !CYTHON_METH_FASTCALL
- CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
- #endif
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
- {
- PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
- PyObject* values[1] = {0};
- if (__pyx_kwds) {
- Py_ssize_t kw_args;
- switch (__pyx_nargs) {
- case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
- CYTHON_FALLTHROUGH;
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
- switch (__pyx_nargs) {
- case 0:
- if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--;
- else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
- else goto __pyx_L5_argtuple_error;
- }
- if (unlikely(kw_args > 0)) {
- const Py_ssize_t kwd_pos_args = __pyx_nargs;
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
- }
- } else if (unlikely(__pyx_nargs != 1)) {
- goto __pyx_L5_argtuple_error;
- } else {
- values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
- }
- __pyx_v___pyx_state = values[0];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v___pyx_state);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__setstate_cython__", 0);
-
- /* "(tree fragment)":4
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
- * def __setstate_cython__(self, __pyx_state):
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
- */
- __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
- __PYX_ERR(1, 4, __pyx_L1_error)
-
- /* "(tree fragment)":3
- * def __reduce_cython__(self):
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
- * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":248
- *
- * @cname("__pyx_array_allocate_buffer")
- * cdef int _allocate_buffer(array self) except -1: # <<<<<<<<<<<<<<
- *
- *
- */
-
-static int __pyx_array_allocate_buffer(struct __pyx_array_obj *__pyx_v_self) {
- Py_ssize_t __pyx_v_i;
- PyObject **__pyx_v_p;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- Py_ssize_t __pyx_t_2;
- Py_ssize_t __pyx_t_3;
- Py_ssize_t __pyx_t_4;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("_allocate_buffer", 0);
-
- /* "View.MemoryView":254
- * cdef PyObject **p
- *
- * self.free_data = True # <<<<<<<<<<<<<<
- * self.data = malloc(self.len)
- * if not self.data:
- */
- __pyx_v_self->free_data = 1;
-
- /* "View.MemoryView":255
- *
- * self.free_data = True
- * self.data = malloc(self.len) # <<<<<<<<<<<<<<
- * if not self.data:
- * raise MemoryError, "unable to allocate array data."
- */
- __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
-
- /* "View.MemoryView":256
- * self.free_data = True
- * self.data = malloc(self.len)
- * if not self.data: # <<<<<<<<<<<<<<
- * raise MemoryError, "unable to allocate array data."
- *
- */
- __pyx_t_1 = (!(__pyx_v_self->data != 0));
- if (unlikely(__pyx_t_1)) {
-
- /* "View.MemoryView":257
- * self.data = malloc(self.len)
- * if not self.data:
- * raise MemoryError, "unable to allocate array data." # <<<<<<<<<<<<<<
- *
- * if self.dtype_is_object:
- */
- __Pyx_Raise(__pyx_builtin_MemoryError, __pyx_kp_s_unable_to_allocate_array_data, 0, 0);
- __PYX_ERR(1, 257, __pyx_L1_error)
-
- /* "View.MemoryView":256
- * self.free_data = True
- * self.data = malloc(self.len)
- * if not self.data: # <<<<<<<<<<<<<<
- * raise MemoryError, "unable to allocate array data."
- *
- */
- }
-
- /* "View.MemoryView":259
- * raise MemoryError, "unable to allocate array data."
- *
- * if self.dtype_is_object: # <<<<<<<<<<<<<<
- * p = self.data
- * for i in range(self.len // self.itemsize):
- */
- if (__pyx_v_self->dtype_is_object) {
-
- /* "View.MemoryView":260
- *
- * if self.dtype_is_object:
- * p = self.data # <<<<<<<<<<<<<<
- * for i in range(self.len // self.itemsize):
- * p[i] = Py_None
- */
- __pyx_v_p = ((PyObject **)__pyx_v_self->data);
-
- /* "View.MemoryView":261
- * if self.dtype_is_object:
- * p = self.data
- * for i in range(self.len // self.itemsize): # <<<<<<<<<<<<<<
- * p[i] = Py_None
- * Py_INCREF(Py_None)
- */
- if (unlikely(__pyx_v_self->itemsize == 0)) {
- PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
- __PYX_ERR(1, 261, __pyx_L1_error)
- }
- else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_self->itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
- PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
- __PYX_ERR(1, 261, __pyx_L1_error)
- }
- __pyx_t_2 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_self->itemsize);
- __pyx_t_3 = __pyx_t_2;
- for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
- __pyx_v_i = __pyx_t_4;
-
- /* "View.MemoryView":262
- * p = self.data
- * for i in range(self.len // self.itemsize):
- * p[i] = Py_None # <<<<<<<<<<<<<<
- * Py_INCREF(Py_None)
- * return 0
- */
- (__pyx_v_p[__pyx_v_i]) = Py_None;
-
- /* "View.MemoryView":263
- * for i in range(self.len // self.itemsize):
- * p[i] = Py_None
- * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
- * return 0
- *
- */
- Py_INCREF(Py_None);
- }
-
- /* "View.MemoryView":259
- * raise MemoryError, "unable to allocate array data."
- *
- * if self.dtype_is_object: # <<<<<<<<<<<<<<
- * p = self.data
- * for i in range(self.len // self.itemsize):
- */
- }
-
- /* "View.MemoryView":264
- * p[i] = Py_None
- * Py_INCREF(Py_None)
- * return 0 # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_r = 0;
- goto __pyx_L0;
-
- /* "View.MemoryView":248
- *
- * @cname("__pyx_array_allocate_buffer")
- * cdef int _allocate_buffer(array self) except -1: # <<<<<<<<<<<<<<
- *
- *
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_AddTraceback("View.MemoryView._allocate_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":268
- *
- * @cname("__pyx_array_new")
- * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf): # <<<<<<<<<<<<<<
- * cdef array result
- * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
- */
-
-static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_c_mode, char *__pyx_v_buf) {
- struct __pyx_array_obj *__pyx_v_result = 0;
- PyObject *__pyx_v_mode = 0;
- struct __pyx_array_obj *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("array_cwrapper", 0);
-
- /* "View.MemoryView":270
- * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf):
- * cdef array result
- * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string. # <<<<<<<<<<<<<<
- *
- * if buf is NULL:
- */
- if (((__pyx_v_c_mode[0]) == 'f')) {
- __Pyx_INCREF(__pyx_n_s_fortran);
- __pyx_t_1 = __pyx_n_s_fortran;
- } else {
- __Pyx_INCREF(__pyx_n_s_c);
- __pyx_t_1 = __pyx_n_s_c;
- }
- __pyx_v_mode = ((PyObject*)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "View.MemoryView":272
- * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
- *
- * if buf is NULL: # <<<<<<<<<<<<<<
- * result = array.__new__(array, shape, itemsize, format, mode)
- * else:
- */
- __pyx_t_2 = (__pyx_v_buf == NULL);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":273
- *
- * if buf is NULL:
- * result = array.__new__(array, shape, itemsize, format, mode) # <<<<<<<<<<<<<<
- * else:
- * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
- */
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 273, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 273, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 273, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_v_shape);
- __Pyx_GIVEREF(__pyx_v_shape);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
- __Pyx_INCREF(__pyx_v_mode);
- __Pyx_GIVEREF(__pyx_v_mode);
- PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_mode);
- __pyx_t_1 = 0;
- __pyx_t_3 = 0;
- __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_array_type), __pyx_t_4, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 273, __pyx_L1_error)
- __Pyx_GOTREF((PyObject *)__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "View.MemoryView":272
- * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
- *
- * if buf is NULL: # <<<<<<<<<<<<<<
- * result = array.__new__(array, shape, itemsize, format, mode)
- * else:
- */
- goto __pyx_L3;
- }
-
- /* "View.MemoryView":275
- * result = array.__new__(array, shape, itemsize, format, mode)
- * else:
- * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False) # <<<<<<<<<<<<<<
- * result.data = buf
- *
- */
- /*else*/ {
- __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 275, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 275, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 275, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_v_shape);
- __Pyx_GIVEREF(__pyx_v_shape);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_shape);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
- __Pyx_INCREF(__pyx_v_mode);
- __Pyx_GIVEREF(__pyx_v_mode);
- PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_mode);
- __pyx_t_3 = 0;
- __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 275, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 275, __pyx_L1_error)
- __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_array_type), __pyx_t_1, __pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 275, __pyx_L1_error)
- __Pyx_GOTREF((PyObject *)__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "View.MemoryView":276
- * else:
- * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
- * result.data = buf # <<<<<<<<<<<<<<
- *
- * return result
- */
- __pyx_v_result->data = __pyx_v_buf;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":278
- * result.data = buf
- *
- * return result # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF((PyObject *)__pyx_r);
- __Pyx_INCREF((PyObject *)__pyx_v_result);
- __pyx_r = __pyx_v_result;
- goto __pyx_L0;
-
- /* "View.MemoryView":268
- *
- * @cname("__pyx_array_new")
- * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf): # <<<<<<<<<<<<<<
- * cdef array result
- * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
- __Pyx_XDECREF(__pyx_v_mode);
- __Pyx_XGIVEREF((PyObject *)__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":304
- * cdef class Enum(object):
- * cdef object name
- * def __init__(self, name): # <<<<<<<<<<<<<<
- * self.name = name
- * def __repr__(self):
- */
-
-/* Python wrapper */
-static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_name = 0;
- CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
- {
- PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
- PyObject* values[1] = {0};
- if (__pyx_kwds) {
- Py_ssize_t kw_args;
- switch (__pyx_nargs) {
- case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
- CYTHON_FALLTHROUGH;
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
- switch (__pyx_nargs) {
- case 0:
- if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) kw_args--;
- else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 304, __pyx_L3_error)
- else goto __pyx_L5_argtuple_error;
- }
- if (unlikely(kw_args > 0)) {
- const Py_ssize_t kwd_pos_args = __pyx_nargs;
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(1, 304, __pyx_L3_error)
- }
- } else if (unlikely(__pyx_nargs != 1)) {
- goto __pyx_L5_argtuple_error;
- } else {
- values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
- }
- __pyx_v_name = values[0];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 304, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return -1;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__init__", 0);
-
- /* "View.MemoryView":305
- * cdef object name
- * def __init__(self, name):
- * self.name = name # <<<<<<<<<<<<<<
- * def __repr__(self):
- * return self.name
- */
- __Pyx_INCREF(__pyx_v_name);
- __Pyx_GIVEREF(__pyx_v_name);
- __Pyx_GOTREF(__pyx_v_self->name);
- __Pyx_DECREF(__pyx_v_self->name);
- __pyx_v_self->name = __pyx_v_name;
-
- /* "View.MemoryView":304
- * cdef class Enum(object):
- * cdef object name
- * def __init__(self, name): # <<<<<<<<<<<<<<
- * self.name = name
- * def __repr__(self):
- */
-
- /* function exit code */
- __pyx_r = 0;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":306
- * def __init__(self, name):
- * self.name = name
- * def __repr__(self): # <<<<<<<<<<<<<<
- * return self.name
- *
- */
-
-/* Python wrapper */
-static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
- __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__repr__", 0);
-
- /* "View.MemoryView":307
- * self.name = name
- * def __repr__(self):
- * return self.name # <<<<<<<<<<<<<<
- *
- * cdef generic = Enum("")
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_self->name);
- __pyx_r = __pyx_v_self->name;
- goto __pyx_L0;
-
- /* "View.MemoryView":306
- * def __init__(self, name):
- * self.name = name
- * def __repr__(self): # <<<<<<<<<<<<<<
- * return self.name
- *
- */
-
- /* function exit code */
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "(tree fragment)":1
- * def __reduce_cython__(self): # <<<<<<<<<<<<<<
- * cdef tuple state
- * cdef object _dict
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-) {
- #if !CYTHON_METH_FASTCALL
- CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
- #endif
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
- if (unlikely(__pyx_nargs > 0)) {
- __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
- if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
- __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
- PyObject *__pyx_v_state = 0;
- PyObject *__pyx_v__dict = 0;
- int __pyx_v_use_setstate;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__reduce_cython__", 0);
-
- /* "(tree fragment)":5
- * cdef object _dict
- * cdef bint use_setstate
- * state = (self.name,) # <<<<<<<<<<<<<<
- * _dict = getattr(self, '__dict__', None)
- * if _dict is not None:
- */
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_v_self->name);
- __Pyx_GIVEREF(__pyx_v_self->name);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
- __pyx_v_state = ((PyObject*)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "(tree fragment)":6
- * cdef bint use_setstate
- * state = (self.name,)
- * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
- * if _dict is not None:
- * state += (_dict,)
- */
- __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v__dict = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "(tree fragment)":7
- * state = (self.name,)
- * _dict = getattr(self, '__dict__', None)
- * if _dict is not None: # <<<<<<<<<<<<<<
- * state += (_dict,)
- * use_setstate = True
- */
- __pyx_t_2 = (__pyx_v__dict != Py_None);
- if (__pyx_t_2) {
-
- /* "(tree fragment)":8
- * _dict = getattr(self, '__dict__', None)
- * if _dict is not None:
- * state += (_dict,) # <<<<<<<<<<<<<<
- * use_setstate = True
- * else:
- */
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_v__dict);
- __Pyx_GIVEREF(__pyx_v__dict);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
- __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3));
- __pyx_t_3 = 0;
-
- /* "(tree fragment)":9
- * if _dict is not None:
- * state += (_dict,)
- * use_setstate = True # <<<<<<<<<<<<<<
- * else:
- * use_setstate = self.name is not None
- */
- __pyx_v_use_setstate = 1;
-
- /* "(tree fragment)":7
- * state = (self.name,)
- * _dict = getattr(self, '__dict__', None)
- * if _dict is not None: # <<<<<<<<<<<<<<
- * state += (_dict,)
- * use_setstate = True
- */
- goto __pyx_L3;
- }
-
- /* "(tree fragment)":11
- * use_setstate = True
- * else:
- * use_setstate = self.name is not None # <<<<<<<<<<<<<<
- * if use_setstate:
- * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
- */
- /*else*/ {
- __pyx_t_2 = (__pyx_v_self->name != Py_None);
- __pyx_v_use_setstate = __pyx_t_2;
- }
- __pyx_L3:;
-
- /* "(tree fragment)":12
- * else:
- * use_setstate = self.name is not None
- * if use_setstate: # <<<<<<<<<<<<<<
- * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
- * else:
- */
- if (__pyx_v_use_setstate) {
-
- /* "(tree fragment)":13
- * use_setstate = self.name is not None
- * if use_setstate:
- * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state # <<<<<<<<<<<<<<
- * else:
- * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
- __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
- PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
- __Pyx_INCREF(__pyx_int_136983863);
- __Pyx_GIVEREF(__pyx_int_136983863);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_136983863);
- __Pyx_INCREF(Py_None);
- __Pyx_GIVEREF(Py_None);
- PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
- __Pyx_INCREF(__pyx_v_state);
- __Pyx_GIVEREF(__pyx_v_state);
- PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state);
- __pyx_t_3 = 0;
- __pyx_t_1 = 0;
- __pyx_r = __pyx_t_4;
- __pyx_t_4 = 0;
- goto __pyx_L0;
-
- /* "(tree fragment)":12
- * else:
- * use_setstate = self.name is not None
- * if use_setstate: # <<<<<<<<<<<<<<
- * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
- * else:
- */
- }
-
- /* "(tree fragment)":15
- * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
- * else:
- * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state) # <<<<<<<<<<<<<<
- * def __setstate_cython__(self, __pyx_state):
- * __pyx_unpickle_Enum__set_state(self, __pyx_state)
- */
- /*else*/ {
- __Pyx_XDECREF(__pyx_r);
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
- __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
- PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
- __Pyx_INCREF(__pyx_int_136983863);
- __Pyx_GIVEREF(__pyx_int_136983863);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_136983863);
- __Pyx_INCREF(__pyx_v_state);
- __Pyx_GIVEREF(__pyx_v_state);
- PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
- __pyx_t_4 = 0;
- __pyx_t_1 = 0;
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
- }
-
- /* "(tree fragment)":1
- * def __reduce_cython__(self): # <<<<<<<<<<<<<<
- * cdef tuple state
- * cdef object _dict
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_state);
- __Pyx_XDECREF(__pyx_v__dict);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "(tree fragment)":16
- * else:
- * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
- * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
- * __pyx_unpickle_Enum__set_state(self, __pyx_state)
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-) {
- PyObject *__pyx_v___pyx_state = 0;
- #if !CYTHON_METH_FASTCALL
- CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
- #endif
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
- {
- PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
- PyObject* values[1] = {0};
- if (__pyx_kwds) {
- Py_ssize_t kw_args;
- switch (__pyx_nargs) {
- case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
- CYTHON_FALLTHROUGH;
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
- switch (__pyx_nargs) {
- case 0:
- if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--;
- else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L3_error)
- else goto __pyx_L5_argtuple_error;
- }
- if (unlikely(kw_args > 0)) {
- const Py_ssize_t kwd_pos_args = __pyx_nargs;
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 16, __pyx_L3_error)
- }
- } else if (unlikely(__pyx_nargs != 1)) {
- goto __pyx_L5_argtuple_error;
- } else {
- values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
- }
- __pyx_v___pyx_state = values[0];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v___pyx_state);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__setstate_cython__", 0);
-
- /* "(tree fragment)":17
- * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
- * def __setstate_cython__(self, __pyx_state):
- * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
- */
- if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 17, __pyx_L1_error)
- __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "(tree fragment)":16
- * else:
- * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
- * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
- * __pyx_unpickle_Enum__set_state(self, __pyx_state)
- */
-
- /* function exit code */
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":349
- * cdef __Pyx_TypeInfo *typeinfo
- *
- * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
- * self.obj = obj
- * self.flags = flags
- */
-
-/* Python wrapper */
-static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_obj = 0;
- int __pyx_v_flags;
- int __pyx_v_dtype_is_object;
- CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
- {
- PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
- PyObject* values[3] = {0,0,0};
- if (__pyx_kwds) {
- Py_ssize_t kw_args;
- switch (__pyx_nargs) {
- case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
- CYTHON_FALLTHROUGH;
- case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
- CYTHON_FALLTHROUGH;
- case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
- CYTHON_FALLTHROUGH;
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
- switch (__pyx_nargs) {
- case 0:
- if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_obj)) != 0)) kw_args--;
- else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
- else goto __pyx_L5_argtuple_error;
- CYTHON_FALLTHROUGH;
- case 1:
- if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags)) != 0)) kw_args--;
- else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
- else {
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 349, __pyx_L3_error)
- }
- CYTHON_FALLTHROUGH;
- case 2:
- if (kw_args > 0) {
- PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dtype_is_object);
- if (value) { values[2] = value; kw_args--; }
- else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
- }
- }
- if (unlikely(kw_args > 0)) {
- const Py_ssize_t kwd_pos_args = __pyx_nargs;
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(1, 349, __pyx_L3_error)
- }
- } else {
- switch (__pyx_nargs) {
- case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
- CYTHON_FALLTHROUGH;
- case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
- values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_obj = values[0];
- __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
- if (values[2]) {
- __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
- } else {
- __pyx_v_dtype_is_object = ((int)0);
- }
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, __pyx_nargs); __PYX_ERR(1, 349, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return -1;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
- Py_intptr_t __pyx_t_4;
- size_t __pyx_t_5;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__cinit__", 0);
-
- /* "View.MemoryView":350
- *
- * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
- * self.obj = obj # <<<<<<<<<<<<<<
- * self.flags = flags
- * if type(self) is memoryview or obj is not None:
- */
- __Pyx_INCREF(__pyx_v_obj);
- __Pyx_GIVEREF(__pyx_v_obj);
- __Pyx_GOTREF(__pyx_v_self->obj);
- __Pyx_DECREF(__pyx_v_self->obj);
- __pyx_v_self->obj = __pyx_v_obj;
-
- /* "View.MemoryView":351
- * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
- * self.obj = obj
- * self.flags = flags # <<<<<<<<<<<<<<
- * if type(self) is memoryview or obj is not None:
- * __Pyx_GetBuffer(obj, &self.view, flags)
- */
- __pyx_v_self->flags = __pyx_v_flags;
-
- /* "View.MemoryView":352
- * self.obj = obj
- * self.flags = flags
- * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
- * __Pyx_GetBuffer(obj, &self.view, flags)
- * if self.view.obj == NULL:
- */
- __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
- if (!__pyx_t_2) {
- } else {
- __pyx_t_1 = __pyx_t_2;
- goto __pyx_L4_bool_binop_done;
- }
- __pyx_t_2 = (__pyx_v_obj != Py_None);
- __pyx_t_1 = __pyx_t_2;
- __pyx_L4_bool_binop_done:;
- if (__pyx_t_1) {
-
- /* "View.MemoryView":353
- * self.flags = flags
- * if type(self) is memoryview or obj is not None:
- * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
- * if self.view.obj == NULL:
- * (<__pyx_buffer *> &self.view).obj = Py_None
- */
- __pyx_t_3 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 353, __pyx_L1_error)
-
- /* "View.MemoryView":354
- * if type(self) is memoryview or obj is not None:
- * __Pyx_GetBuffer(obj, &self.view, flags)
- * if self.view.obj == NULL: # <<<<<<<<<<<<<<
- * (<__pyx_buffer *> &self.view).obj = Py_None
- * Py_INCREF(Py_None)
- */
- __pyx_t_1 = (((PyObject *)__pyx_v_self->view.obj) == NULL);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":355
- * __Pyx_GetBuffer(obj, &self.view, flags)
- * if self.view.obj == NULL:
- * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
- * Py_INCREF(Py_None)
- *
- */
- ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
-
- /* "View.MemoryView":356
- * if self.view.obj == NULL:
- * (<__pyx_buffer *> &self.view).obj = Py_None
- * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
- *
- * if not __PYX_CYTHON_ATOMICS_ENABLED():
- */
- Py_INCREF(Py_None);
-
- /* "View.MemoryView":354
- * if type(self) is memoryview or obj is not None:
- * __Pyx_GetBuffer(obj, &self.view, flags)
- * if self.view.obj == NULL: # <<<<<<<<<<<<<<
- * (<__pyx_buffer *> &self.view).obj = Py_None
- * Py_INCREF(Py_None)
- */
- }
-
- /* "View.MemoryView":352
- * self.obj = obj
- * self.flags = flags
- * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
- * __Pyx_GetBuffer(obj, &self.view, flags)
- * if self.view.obj == NULL:
- */
- }
-
- /* "View.MemoryView":358
- * Py_INCREF(Py_None)
- *
- * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
- * global __pyx_memoryview_thread_locks_used
- * if __pyx_memoryview_thread_locks_used < 8:
- */
- __pyx_t_1 = (!__PYX_CYTHON_ATOMICS_ENABLED());
- if (__pyx_t_1) {
-
- /* "View.MemoryView":360
- * if not __PYX_CYTHON_ATOMICS_ENABLED():
- * global __pyx_memoryview_thread_locks_used
- * if __pyx_memoryview_thread_locks_used < 8: # <<<<<<<<<<<<<<
- * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
- * __pyx_memoryview_thread_locks_used += 1
- */
- __pyx_t_1 = (__pyx_memoryview_thread_locks_used < 8);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":361
- * global __pyx_memoryview_thread_locks_used
- * if __pyx_memoryview_thread_locks_used < 8:
- * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
- * __pyx_memoryview_thread_locks_used += 1
- * if self.lock is NULL:
- */
- __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
-
- /* "View.MemoryView":362
- * if __pyx_memoryview_thread_locks_used < 8:
- * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
- * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
- * if self.lock is NULL:
- * self.lock = PyThread_allocate_lock()
- */
- __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
-
- /* "View.MemoryView":360
- * if not __PYX_CYTHON_ATOMICS_ENABLED():
- * global __pyx_memoryview_thread_locks_used
- * if __pyx_memoryview_thread_locks_used < 8: # <<<<<<<<<<<<<<
- * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
- * __pyx_memoryview_thread_locks_used += 1
- */
- }
-
- /* "View.MemoryView":363
- * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
- * __pyx_memoryview_thread_locks_used += 1
- * if self.lock is NULL: # <<<<<<<<<<<<<<
- * self.lock = PyThread_allocate_lock()
- * if self.lock is NULL:
- */
- __pyx_t_1 = (__pyx_v_self->lock == NULL);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":364
- * __pyx_memoryview_thread_locks_used += 1
- * if self.lock is NULL:
- * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
- * if self.lock is NULL:
- * raise MemoryError
- */
- __pyx_v_self->lock = PyThread_allocate_lock();
-
- /* "View.MemoryView":365
- * if self.lock is NULL:
- * self.lock = PyThread_allocate_lock()
- * if self.lock is NULL: # <<<<<<<<<<<<<<
- * raise MemoryError
- *
- */
- __pyx_t_1 = (__pyx_v_self->lock == NULL);
- if (unlikely(__pyx_t_1)) {
-
- /* "View.MemoryView":366
- * self.lock = PyThread_allocate_lock()
- * if self.lock is NULL:
- * raise MemoryError # <<<<<<<<<<<<<<
- *
- * if flags & PyBUF_FORMAT:
- */
- PyErr_NoMemory(); __PYX_ERR(1, 366, __pyx_L1_error)
-
- /* "View.MemoryView":365
- * if self.lock is NULL:
- * self.lock = PyThread_allocate_lock()
- * if self.lock is NULL: # <<<<<<<<<<<<<<
- * raise MemoryError
- *
- */
- }
-
- /* "View.MemoryView":363
- * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
- * __pyx_memoryview_thread_locks_used += 1
- * if self.lock is NULL: # <<<<<<<<<<<<<<
- * self.lock = PyThread_allocate_lock()
- * if self.lock is NULL:
- */
- }
-
- /* "View.MemoryView":358
- * Py_INCREF(Py_None)
- *
- * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
- * global __pyx_memoryview_thread_locks_used
- * if __pyx_memoryview_thread_locks_used < 8:
- */
- }
-
- /* "View.MemoryView":368
- * raise MemoryError
- *
- * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
- * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
- * else:
- */
- __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":369
- *
- * if flags & PyBUF_FORMAT:
- * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
- * else:
- * self.dtype_is_object = dtype_is_object
- */
- __pyx_t_2 = ((__pyx_v_self->view.format[0]) == 'O');
- if (__pyx_t_2) {
- } else {
- __pyx_t_1 = __pyx_t_2;
- goto __pyx_L12_bool_binop_done;
- }
- __pyx_t_2 = ((__pyx_v_self->view.format[1]) == '\x00');
- __pyx_t_1 = __pyx_t_2;
- __pyx_L12_bool_binop_done:;
- __pyx_v_self->dtype_is_object = __pyx_t_1;
-
- /* "View.MemoryView":368
- * raise MemoryError
- *
- * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
- * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
- * else:
- */
- goto __pyx_L11;
- }
-
- /* "View.MemoryView":371
- * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
- * else:
- * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
- *
- * assert (&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0
- */
- /*else*/ {
- __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
- }
- __pyx_L11:;
-
- /* "View.MemoryView":373
- * self.dtype_is_object = dtype_is_object
- *
- * assert (&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0 # <<<<<<<<<<<<<<
- * self.typeinfo = NULL
- *
- */
- #ifndef CYTHON_WITHOUT_ASSERTIONS
- if (unlikely(__pyx_assertions_enabled())) {
- __pyx_t_4 = ((Py_intptr_t)((void *)(&__pyx_v_self->acquisition_count)));
- __pyx_t_5 = (sizeof(__pyx_atomic_int_type));
- if (unlikely(__pyx_t_5 == 0)) {
- PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
- __PYX_ERR(1, 373, __pyx_L1_error)
- }
- __pyx_t_1 = ((__pyx_t_4 % __pyx_t_5) == 0);
- if (unlikely(!__pyx_t_1)) {
- __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
- __PYX_ERR(1, 373, __pyx_L1_error)
- }
- }
- #else
- if ((1)); else __PYX_ERR(1, 373, __pyx_L1_error)
- #endif
-
- /* "View.MemoryView":374
- *
- * assert (&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0
- * self.typeinfo = NULL # <<<<<<<<<<<<<<
- *
- * def __dealloc__(memoryview self):
- */
- __pyx_v_self->typeinfo = NULL;
-
- /* "View.MemoryView":349
- * cdef __Pyx_TypeInfo *typeinfo
- *
- * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
- * self.obj = obj
- * self.flags = flags
- */
-
- /* function exit code */
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":376
- * self.typeinfo = NULL
- *
- * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
- * if self.obj is not None:
- * __Pyx_ReleaseBuffer(&self.view)
- */
-
-/* Python wrapper */
-static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
- __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
-}
-
-static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
- int __pyx_v_i;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
- int __pyx_t_4;
- PyThread_type_lock __pyx_t_5;
- PyThread_type_lock __pyx_t_6;
- __Pyx_RefNannySetupContext("__dealloc__", 0);
-
- /* "View.MemoryView":377
- *
- * def __dealloc__(memoryview self):
- * if self.obj is not None: # <<<<<<<<<<<<<<
- * __Pyx_ReleaseBuffer(&self.view)
- * elif (<__pyx_buffer *> &self.view).obj == Py_None:
- */
- __pyx_t_1 = (__pyx_v_self->obj != Py_None);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":378
- * def __dealloc__(memoryview self):
- * if self.obj is not None:
- * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
- * elif (<__pyx_buffer *> &self.view).obj == Py_None:
- *
- */
- __Pyx_ReleaseBuffer((&__pyx_v_self->view));
-
- /* "View.MemoryView":377
- *
- * def __dealloc__(memoryview self):
- * if self.obj is not None: # <<<<<<<<<<<<<<
- * __Pyx_ReleaseBuffer(&self.view)
- * elif (<__pyx_buffer *> &self.view).obj == Py_None:
- */
- goto __pyx_L3;
- }
-
- /* "View.MemoryView":379
- * if self.obj is not None:
- * __Pyx_ReleaseBuffer(&self.view)
- * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
- *
- * (<__pyx_buffer *> &self.view).obj = NULL
- */
- __pyx_t_1 = (((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":381
- * elif (<__pyx_buffer *> &self.view).obj == Py_None:
- *
- * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
- * Py_DECREF(Py_None)
- *
- */
- ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
-
- /* "View.MemoryView":382
- *
- * (<__pyx_buffer *> &self.view).obj = NULL
- * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
- *
- * cdef int i
- */
- Py_DECREF(Py_None);
-
- /* "View.MemoryView":379
- * if self.obj is not None:
- * __Pyx_ReleaseBuffer(&self.view)
- * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
- *
- * (<__pyx_buffer *> &self.view).obj = NULL
- */
- }
- __pyx_L3:;
-
- /* "View.MemoryView":386
- * cdef int i
- * global __pyx_memoryview_thread_locks_used
- * if self.lock != NULL: # <<<<<<<<<<<<<<
- * for i in range(__pyx_memoryview_thread_locks_used):
- * if __pyx_memoryview_thread_locks[i] is self.lock:
- */
- __pyx_t_1 = (__pyx_v_self->lock != NULL);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":387
- * global __pyx_memoryview_thread_locks_used
- * if self.lock != NULL:
- * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
- * if __pyx_memoryview_thread_locks[i] is self.lock:
- * __pyx_memoryview_thread_locks_used -= 1
- */
- __pyx_t_2 = __pyx_memoryview_thread_locks_used;
- __pyx_t_3 = __pyx_t_2;
- for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
- __pyx_v_i = __pyx_t_4;
-
- /* "View.MemoryView":388
- * if self.lock != NULL:
- * for i in range(__pyx_memoryview_thread_locks_used):
- * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
- * __pyx_memoryview_thread_locks_used -= 1
- * if i != __pyx_memoryview_thread_locks_used:
- */
- __pyx_t_1 = ((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":389
- * for i in range(__pyx_memoryview_thread_locks_used):
- * if __pyx_memoryview_thread_locks[i] is self.lock:
- * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
- * if i != __pyx_memoryview_thread_locks_used:
- * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
- */
- __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
-
- /* "View.MemoryView":390
- * if __pyx_memoryview_thread_locks[i] is self.lock:
- * __pyx_memoryview_thread_locks_used -= 1
- * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
- * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
- * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
- */
- __pyx_t_1 = (__pyx_v_i != __pyx_memoryview_thread_locks_used);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":392
- * if i != __pyx_memoryview_thread_locks_used:
- * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
- * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
- * break
- * else:
- */
- __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
- __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
-
- /* "View.MemoryView":391
- * __pyx_memoryview_thread_locks_used -= 1
- * if i != __pyx_memoryview_thread_locks_used:
- * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
- * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
- * break
- */
- (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
- (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;
-
- /* "View.MemoryView":390
- * if __pyx_memoryview_thread_locks[i] is self.lock:
- * __pyx_memoryview_thread_locks_used -= 1
- * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
- * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
- * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
- */
- }
-
- /* "View.MemoryView":393
- * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
- * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
- * break # <<<<<<<<<<<<<<
- * else:
- * PyThread_free_lock(self.lock)
- */
- goto __pyx_L6_break;
-
- /* "View.MemoryView":388
- * if self.lock != NULL:
- * for i in range(__pyx_memoryview_thread_locks_used):
- * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
- * __pyx_memoryview_thread_locks_used -= 1
- * if i != __pyx_memoryview_thread_locks_used:
- */
- }
- }
- /*else*/ {
-
- /* "View.MemoryView":395
- * break
- * else:
- * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
- *
- * cdef char *get_item_pointer(memoryview self, object index) except NULL:
- */
- PyThread_free_lock(__pyx_v_self->lock);
- }
- __pyx_L6_break:;
-
- /* "View.MemoryView":386
- * cdef int i
- * global __pyx_memoryview_thread_locks_used
- * if self.lock != NULL: # <<<<<<<<<<<<<<
- * for i in range(__pyx_memoryview_thread_locks_used):
- * if __pyx_memoryview_thread_locks[i] is self.lock:
- */
- }
-
- /* "View.MemoryView":376
- * self.typeinfo = NULL
- *
- * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
- * if self.obj is not None:
- * __Pyx_ReleaseBuffer(&self.view)
- */
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
-}
-
-/* "View.MemoryView":397
- * PyThread_free_lock(self.lock)
- *
- * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
- * cdef Py_ssize_t dim
- * cdef char *itemp = self.view.buf
- */
-
-static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
- Py_ssize_t __pyx_v_dim;
- char *__pyx_v_itemp;
- PyObject *__pyx_v_idx = NULL;
- char *__pyx_r;
- __Pyx_RefNannyDeclarations
- Py_ssize_t __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- Py_ssize_t __pyx_t_3;
- PyObject *(*__pyx_t_4)(PyObject *);
- PyObject *__pyx_t_5 = NULL;
- Py_ssize_t __pyx_t_6;
- char *__pyx_t_7;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("get_item_pointer", 0);
-
- /* "View.MemoryView":399
- * cdef char *get_item_pointer(memoryview self, object index) except NULL:
- * cdef Py_ssize_t dim
- * cdef char *itemp = self.view.buf # <<<<<<<<<<<<<<
- *
- * for dim, idx in enumerate(index):
- */
- __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
-
- /* "View.MemoryView":401
- * cdef char *itemp = self.view.buf
- *
- * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
- * itemp = pybuffer_index(&self.view, itemp, idx, dim)
- *
- */
- __pyx_t_1 = 0;
- if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
- __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
- __pyx_t_4 = NULL;
- } else {
- __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 401, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 401, __pyx_L1_error)
- }
- for (;;) {
- if (likely(!__pyx_t_4)) {
- if (likely(PyList_CheckExact(__pyx_t_2))) {
- if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
- #else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 401, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- #endif
- } else {
- if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
- #else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 401, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- #endif
- }
- } else {
- __pyx_t_5 = __pyx_t_4(__pyx_t_2);
- 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(1, 401, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_5);
- }
- __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_v_dim = __pyx_t_1;
- __pyx_t_1 = (__pyx_t_1 + 1);
-
- /* "View.MemoryView":402
- *
- * for dim, idx in enumerate(index):
- * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
- *
- * return itemp
- */
- __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 402, __pyx_L1_error)
- __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 402, __pyx_L1_error)
- __pyx_v_itemp = __pyx_t_7;
-
- /* "View.MemoryView":401
- * cdef char *itemp = self.view.buf
- *
- * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
- * itemp = pybuffer_index(&self.view, itemp, idx, dim)
- *
- */
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "View.MemoryView":404
- * itemp = pybuffer_index(&self.view, itemp, idx, dim)
- *
- * return itemp # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_r = __pyx_v_itemp;
- goto __pyx_L0;
-
- /* "View.MemoryView":397
- * PyThread_free_lock(self.lock)
- *
- * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
- * cdef Py_ssize_t dim
- * cdef char *itemp = self.view.buf
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_idx);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":407
- *
- *
- * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
- * if index is Ellipsis:
- * return self
- */
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
-static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
- PyObject *__pyx_v_have_slices = NULL;
- PyObject *__pyx_v_indices = NULL;
- char *__pyx_v_itemp;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- char *__pyx_t_5;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__getitem__", 0);
-
- /* "View.MemoryView":408
- *
- * def __getitem__(memoryview self, object index):
- * if index is Ellipsis: # <<<<<<<<<<<<<<
- * return self
- *
- */
- __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":409
- * def __getitem__(memoryview self, object index):
- * if index is Ellipsis:
- * return self # <<<<<<<<<<<<<<
- *
- * have_slices, indices = _unellipsify(index, self.view.ndim)
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF((PyObject *)__pyx_v_self);
- __pyx_r = ((PyObject *)__pyx_v_self);
- goto __pyx_L0;
-
- /* "View.MemoryView":408
- *
- * def __getitem__(memoryview self, object index):
- * if index is Ellipsis: # <<<<<<<<<<<<<<
- * return self
- *
- */
- }
-
- /* "View.MemoryView":411
- * return self
- *
- * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
- *
- * cdef char *itemp
- */
- __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 411, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (likely(__pyx_t_2 != Py_None)) {
- 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(1, 411, __pyx_L1_error)
- }
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_4);
- #else
- __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 411, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- #endif
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- } else {
- __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 411, __pyx_L1_error)
- }
- __pyx_v_have_slices = __pyx_t_3;
- __pyx_t_3 = 0;
- __pyx_v_indices = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "View.MemoryView":414
- *
- * cdef char *itemp
- * if have_slices: # <<<<<<<<<<<<<<
- * return memview_slice(self, indices)
- * else:
- */
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 414, __pyx_L1_error)
- if (__pyx_t_1) {
-
- /* "View.MemoryView":415
- * cdef char *itemp
- * if have_slices:
- * return memview_slice(self, indices) # <<<<<<<<<<<<<<
- * else:
- * itemp = self.get_item_pointer(indices)
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 415, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- /* "View.MemoryView":414
- *
- * cdef char *itemp
- * if have_slices: # <<<<<<<<<<<<<<
- * return memview_slice(self, indices)
- * else:
- */
- }
-
- /* "View.MemoryView":417
- * return memview_slice(self, indices)
- * else:
- * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
- * return self.convert_item_to_object(itemp)
- *
- */
- /*else*/ {
- __pyx_t_5 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_5 == ((char *)NULL))) __PYX_ERR(1, 417, __pyx_L1_error)
- __pyx_v_itemp = __pyx_t_5;
-
- /* "View.MemoryView":418
- * else:
- * itemp = self.get_item_pointer(indices)
- * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
- *
- * def __setitem__(memoryview self, object index, object value):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- }
-
- /* "View.MemoryView":407
- *
- *
- * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
- * if index is Ellipsis:
- * return self
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_have_slices);
- __Pyx_XDECREF(__pyx_v_indices);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":420
- * return self.convert_item_to_object(itemp)
- *
- * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
- * if self.view.readonly:
- * raise TypeError, "Cannot assign to read-only memoryview"
- */
-
-/* Python wrapper */
-static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
-static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
- PyObject *__pyx_v_have_slices = NULL;
- PyObject *__pyx_v_obj = NULL;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_t_4;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__setitem__", 0);
- __Pyx_INCREF(__pyx_v_index);
-
- /* "View.MemoryView":421
- *
- * def __setitem__(memoryview self, object index, object value):
- * if self.view.readonly: # <<<<<<<<<<<<<<
- * raise TypeError, "Cannot assign to read-only memoryview"
- *
- */
- if (unlikely(__pyx_v_self->view.readonly)) {
-
- /* "View.MemoryView":422
- * def __setitem__(memoryview self, object index, object value):
- * if self.view.readonly:
- * raise TypeError, "Cannot assign to read-only memoryview" # <<<<<<<<<<<<<<
- *
- * have_slices, index = _unellipsify(index, self.view.ndim)
- */
- __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_Cannot_assign_to_read_only_memor, 0, 0);
- __PYX_ERR(1, 422, __pyx_L1_error)
-
- /* "View.MemoryView":421
- *
- * def __setitem__(memoryview self, object index, object value):
- * if self.view.readonly: # <<<<<<<<<<<<<<
- * raise TypeError, "Cannot assign to read-only memoryview"
- *
- */
- }
-
- /* "View.MemoryView":424
- * raise TypeError, "Cannot assign to read-only memoryview"
- *
- * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
- *
- * if have_slices:
- */
- __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 424, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (likely(__pyx_t_1 != Py_None)) {
- PyObject* sequence = __pyx_t_1;
- 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(1, 424, __pyx_L1_error)
- }
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_3);
- #else
- __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 424, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 424, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- #endif
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else {
- __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 424, __pyx_L1_error)
- }
- __pyx_v_have_slices = __pyx_t_2;
- __pyx_t_2 = 0;
- __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "View.MemoryView":426
- * have_slices, index = _unellipsify(index, self.view.ndim)
- *
- * if have_slices: # <<<<<<<<<<<<<<
- * obj = self.is_slice(value)
- * if obj:
- */
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 426, __pyx_L1_error)
- if (__pyx_t_4) {
-
- /* "View.MemoryView":427
- *
- * if have_slices:
- * obj = self.is_slice(value) # <<<<<<<<<<<<<<
- * if obj:
- * self.setitem_slice_assignment(self[index], obj)
- */
- __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 427, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_obj = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "View.MemoryView":428
- * if have_slices:
- * obj = self.is_slice(value)
- * if obj: # <<<<<<<<<<<<<<
- * self.setitem_slice_assignment(self[index], obj)
- * else:
- */
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 428, __pyx_L1_error)
- if (__pyx_t_4) {
-
- /* "View.MemoryView":429
- * obj = self.is_slice(value)
- * if obj:
- * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
- * else:
- * self.setitem_slice_assign_scalar(self[index], value)
- */
- __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 429, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 429, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "View.MemoryView":428
- * if have_slices:
- * obj = self.is_slice(value)
- * if obj: # <<<<<<<<<<<<<<
- * self.setitem_slice_assignment(self[index], obj)
- * else:
- */
- goto __pyx_L5;
- }
-
- /* "View.MemoryView":431
- * self.setitem_slice_assignment(self[index], obj)
- * else:
- * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
- * else:
- * self.setitem_indexed(index, value)
- */
- /*else*/ {
- __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 431, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 431, __pyx_L1_error)
- __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 431, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- }
- __pyx_L5:;
-
- /* "View.MemoryView":426
- * have_slices, index = _unellipsify(index, self.view.ndim)
- *
- * if have_slices: # <<<<<<<<<<<<<<
- * obj = self.is_slice(value)
- * if obj:
- */
- goto __pyx_L4;
- }
-
- /* "View.MemoryView":433
- * self.setitem_slice_assign_scalar(self[index], value)
- * else:
- * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
- *
- * cdef is_slice(self, obj):
- */
- /*else*/ {
- __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 433, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- }
- __pyx_L4:;
-
- /* "View.MemoryView":420
- * return self.convert_item_to_object(itemp)
- *
- * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
- * if self.view.readonly:
- * raise TypeError, "Cannot assign to read-only memoryview"
- */
-
- /* function exit code */
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_have_slices);
- __Pyx_XDECREF(__pyx_v_obj);
- __Pyx_XDECREF(__pyx_v_index);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":435
- * self.setitem_indexed(index, value)
- *
- * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
- * if not isinstance(obj, memoryview):
- * try:
- */
-
-static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
- PyObject *__pyx_t_8 = NULL;
- int __pyx_t_9;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("is_slice", 0);
- __Pyx_INCREF(__pyx_v_obj);
-
- /* "View.MemoryView":436
- *
- * cdef is_slice(self, obj):
- * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
- * try:
- * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
- */
- __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
- __pyx_t_2 = (!__pyx_t_1);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":437
- * cdef is_slice(self, obj):
- * if not isinstance(obj, memoryview):
- * try: # <<<<<<<<<<<<<<
- * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
- * self.dtype_is_object)
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
- __Pyx_XGOTREF(__pyx_t_3);
- __Pyx_XGOTREF(__pyx_t_4);
- __Pyx_XGOTREF(__pyx_t_5);
- /*try:*/ {
-
- /* "View.MemoryView":438
- * if not isinstance(obj, memoryview):
- * try:
- * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
- * self.dtype_is_object)
- * except TypeError:
- */
- __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 438, __pyx_L4_error)
- __Pyx_GOTREF(__pyx_t_6);
-
- /* "View.MemoryView":439
- * try:
- * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
- * self.dtype_is_object) # <<<<<<<<<<<<<<
- * except TypeError:
- * return None
- */
- __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 439, __pyx_L4_error)
- __Pyx_GOTREF(__pyx_t_7);
-
- /* "View.MemoryView":438
- * if not isinstance(obj, memoryview):
- * try:
- * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
- * self.dtype_is_object)
- * except TypeError:
- */
- __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 438, __pyx_L4_error)
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_INCREF(__pyx_v_obj);
- __Pyx_GIVEREF(__pyx_v_obj);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
- __pyx_t_6 = 0;
- __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 438, __pyx_L4_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "View.MemoryView":437
- * cdef is_slice(self, obj):
- * if not isinstance(obj, memoryview):
- * try: # <<<<<<<<<<<<<<
- * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
- * self.dtype_is_object)
- */
- }
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- goto __pyx_L9_try_end;
- __pyx_L4_error:;
- __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;
-
- /* "View.MemoryView":440
- * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
- * self.dtype_is_object)
- * except TypeError: # <<<<<<<<<<<<<<
- * return None
- *
- */
- __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
- if (__pyx_t_9) {
- __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 440, __pyx_L6_except_error)
- __Pyx_XGOTREF(__pyx_t_7);
- __Pyx_XGOTREF(__pyx_t_8);
- __Pyx_XGOTREF(__pyx_t_6);
-
- /* "View.MemoryView":441
- * self.dtype_is_object)
- * except TypeError:
- * return None # <<<<<<<<<<<<<<
- *
- * return obj
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- goto __pyx_L7_except_return;
- }
- goto __pyx_L6_except_error;
-
- /* "View.MemoryView":437
- * cdef is_slice(self, obj):
- * if not isinstance(obj, memoryview):
- * try: # <<<<<<<<<<<<<<
- * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
- * self.dtype_is_object)
- */
- __pyx_L6_except_error:;
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_XGIVEREF(__pyx_t_4);
- __Pyx_XGIVEREF(__pyx_t_5);
- __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
- goto __pyx_L1_error;
- __pyx_L7_except_return:;
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_XGIVEREF(__pyx_t_4);
- __Pyx_XGIVEREF(__pyx_t_5);
- __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
- goto __pyx_L0;
- __pyx_L9_try_end:;
- }
-
- /* "View.MemoryView":436
- *
- * cdef is_slice(self, obj):
- * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
- * try:
- * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
- */
- }
-
- /* "View.MemoryView":443
- * return None
- *
- * return obj # <<<<<<<<<<<<<<
- *
- * cdef setitem_slice_assignment(self, dst, src):
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_obj);
- __pyx_r = __pyx_v_obj;
- goto __pyx_L0;
-
- /* "View.MemoryView":435
- * self.setitem_indexed(index, value)
- *
- * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
- * if not isinstance(obj, memoryview):
- * try:
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_obj);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":445
- * return obj
- *
- * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
- * cdef __Pyx_memviewslice dst_slice
- * cdef __Pyx_memviewslice src_slice
- */
-
-static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
- __Pyx_memviewslice __pyx_v_dst_slice;
- __Pyx_memviewslice __pyx_v_src_slice;
- __Pyx_memviewslice __pyx_v_msrc;
- __Pyx_memviewslice __pyx_v_mdst;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __Pyx_memviewslice *__pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_t_3;
- int __pyx_t_4;
- int __pyx_t_5;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
-
- /* "View.MemoryView":448
- * cdef __Pyx_memviewslice dst_slice
- * cdef __Pyx_memviewslice src_slice
- * cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0] # <<<<<<<<<<<<<<
- * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
- *
- */
- if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 448, __pyx_L1_error)
- __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 448, __pyx_L1_error)
- __pyx_v_msrc = (__pyx_t_1[0]);
-
- /* "View.MemoryView":449
- * cdef __Pyx_memviewslice src_slice
- * cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0]
- * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0] # <<<<<<<<<<<<<<
- *
- * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
- */
- if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 449, __pyx_L1_error)
- __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 449, __pyx_L1_error)
- __pyx_v_mdst = (__pyx_t_1[0]);
-
- /* "View.MemoryView":451
- * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
- *
- * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
- *
- * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
- */
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 451, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 451, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 451, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 451, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_5 = __pyx_memoryview_copy_contents(__pyx_v_msrc, __pyx_v_mdst, __pyx_t_3, __pyx_t_4, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 451, __pyx_L1_error)
-
- /* "View.MemoryView":445
- * return obj
- *
- * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
- * cdef __Pyx_memviewslice dst_slice
- * cdef __Pyx_memviewslice src_slice
- */
-
- /* function exit code */
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":453
- * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
- *
- * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
- * cdef int array[128]
- * cdef void *tmp = NULL
- */
-
-static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
- int __pyx_v_array[0x80];
- void *__pyx_v_tmp;
- void *__pyx_v_item;
- __Pyx_memviewslice *__pyx_v_dst_slice;
- __Pyx_memviewslice __pyx_v_tmp_slice;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __Pyx_memviewslice *__pyx_t_1;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_t_4;
- int __pyx_t_5;
- char const *__pyx_t_6;
- PyObject *__pyx_t_7 = NULL;
- PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
- PyObject *__pyx_t_10 = NULL;
- PyObject *__pyx_t_11 = NULL;
- PyObject *__pyx_t_12 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
-
- /* "View.MemoryView":455
- * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
- * cdef int array[128]
- * cdef void *tmp = NULL # <<<<<<<<<<<<<<
- * cdef void *item
- *
- */
- __pyx_v_tmp = NULL;
-
- /* "View.MemoryView":460
- * cdef __Pyx_memviewslice *dst_slice
- * cdef __Pyx_memviewslice tmp_slice
- * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
- *
- * if self.view.itemsize > sizeof(array):
- */
- __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 460, __pyx_L1_error)
- __pyx_v_dst_slice = __pyx_t_1;
-
- /* "View.MemoryView":462
- * dst_slice = get_slice_from_memview(dst, &tmp_slice)
- *
- * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
- * tmp = PyMem_Malloc(self.view.itemsize)
- * if tmp == NULL:
- */
- __pyx_t_2 = (((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array)));
- if (__pyx_t_2) {
-
- /* "View.MemoryView":463
- *
- * if self.view.itemsize > sizeof(array):
- * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
- * if tmp == NULL:
- * raise MemoryError
- */
- __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
-
- /* "View.MemoryView":464
- * if self.view.itemsize > sizeof(array):
- * tmp = PyMem_Malloc(self.view.itemsize)
- * if tmp == NULL: # <<<<<<<<<<<<<<
- * raise MemoryError
- * item = tmp
- */
- __pyx_t_2 = (__pyx_v_tmp == NULL);
- if (unlikely(__pyx_t_2)) {
-
- /* "View.MemoryView":465
- * tmp = PyMem_Malloc(self.view.itemsize)
- * if tmp == NULL:
- * raise MemoryError # <<<<<<<<<<<<<<
- * item = tmp
- * else:
- */
- PyErr_NoMemory(); __PYX_ERR(1, 465, __pyx_L1_error)
-
- /* "View.MemoryView":464
- * if self.view.itemsize > sizeof(array):
- * tmp = PyMem_Malloc(self.view.itemsize)
- * if tmp == NULL: # <<<<<<<<<<<<<<
- * raise MemoryError
- * item = tmp
- */
- }
-
- /* "View.MemoryView":466
- * if tmp == NULL:
- * raise MemoryError
- * item = tmp # <<<<<<<<<<<<<<
- * else:
- * item = array
- */
- __pyx_v_item = __pyx_v_tmp;
-
- /* "View.MemoryView":462
- * dst_slice = get_slice_from_memview(dst, &tmp_slice)
- *
- * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
- * tmp = PyMem_Malloc(self.view.itemsize)
- * if tmp == NULL:
- */
- goto __pyx_L3;
- }
-
- /* "View.MemoryView":468
- * item = tmp
- * else:
- * item = array # <<<<<<<<<<<<<<
- *
- * try:
- */
- /*else*/ {
- __pyx_v_item = ((void *)__pyx_v_array);
- }
- __pyx_L3:;
-
- /* "View.MemoryView":470
- * item = array
- *
- * try: # <<<<<<<<<<<<<<
- * if self.dtype_is_object:
- * ( item)[0] = value
- */
- /*try:*/ {
-
- /* "View.MemoryView":471
- *
- * try:
- * if self.dtype_is_object: # <<<<<<<<<<<<<<
- * ( item)[0] = value
- * else:
- */
- if (__pyx_v_self->dtype_is_object) {
-
- /* "View.MemoryView":472
- * try:
- * if self.dtype_is_object:
- * ( item)[0] = value # <<<<<<<<<<<<<<
- * else:
- * self.assign_item_from_object( item, value)
- */
- (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
-
- /* "View.MemoryView":471
- *
- * try:
- * if self.dtype_is_object: # <<<<<<<<<<<<<<
- * ( item)[0] = value
- * else:
- */
- goto __pyx_L8;
- }
-
- /* "View.MemoryView":474
- * ( item)[0] = value
- * else:
- * self.assign_item_from_object( item, value) # <<<<<<<<<<<<<<
- *
- *
- */
- /*else*/ {
- __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 474, __pyx_L6_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- }
- __pyx_L8:;
-
- /* "View.MemoryView":478
- *
- *
- * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
- * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
- * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
- */
- __pyx_t_2 = (__pyx_v_self->view.suboffsets != NULL);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":479
- *
- * if self.view.suboffsets != NULL:
- * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
- * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
- * item, self.dtype_is_object)
- */
- __pyx_t_4 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 479, __pyx_L6_error)
-
- /* "View.MemoryView":478
- *
- *
- * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
- * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
- * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
- */
- }
-
- /* "View.MemoryView":480
- * if self.view.suboffsets != NULL:
- * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
- * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
- * item, self.dtype_is_object)
- * finally:
- */
- __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
- }
-
- /* "View.MemoryView":483
- * item, self.dtype_is_object)
- * finally:
- * PyMem_Free(tmp) # <<<<<<<<<<<<<<
- *
- * cdef setitem_indexed(self, index, value):
- */
- /*finally:*/ {
- /*normal exit:*/{
- PyMem_Free(__pyx_v_tmp);
- goto __pyx_L7;
- }
- __pyx_L6_error:;
- /*exception exit:*/{
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
- if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
- __Pyx_XGOTREF(__pyx_t_7);
- __Pyx_XGOTREF(__pyx_t_8);
- __Pyx_XGOTREF(__pyx_t_9);
- __Pyx_XGOTREF(__pyx_t_10);
- __Pyx_XGOTREF(__pyx_t_11);
- __Pyx_XGOTREF(__pyx_t_12);
- __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
- {
- PyMem_Free(__pyx_v_tmp);
- }
- if (PY_MAJOR_VERSION >= 3) {
- __Pyx_XGIVEREF(__pyx_t_10);
- __Pyx_XGIVEREF(__pyx_t_11);
- __Pyx_XGIVEREF(__pyx_t_12);
- __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
- }
- __Pyx_XGIVEREF(__pyx_t_7);
- __Pyx_XGIVEREF(__pyx_t_8);
- __Pyx_XGIVEREF(__pyx_t_9);
- __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
- __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
- __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
- goto __pyx_L1_error;
- }
- __pyx_L7:;
- }
-
- /* "View.MemoryView":453
- * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
- *
- * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
- * cdef int array[128]
- * cdef void *tmp = NULL
- */
-
- /* function exit code */
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":485
- * PyMem_Free(tmp)
- *
- * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
- * cdef char *itemp = self.get_item_pointer(index)
- * self.assign_item_from_object(itemp, value)
- */
-
-static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
- char *__pyx_v_itemp;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- char *__pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("setitem_indexed", 0);
-
- /* "View.MemoryView":486
- *
- * cdef setitem_indexed(self, index, value):
- * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
- * self.assign_item_from_object(itemp, value)
- *
- */
- __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 486, __pyx_L1_error)
- __pyx_v_itemp = __pyx_t_1;
-
- /* "View.MemoryView":487
- * cdef setitem_indexed(self, index, value):
- * cdef char *itemp = self.get_item_pointer(index)
- * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
- *
- * cdef convert_item_to_object(self, char *itemp):
- */
- __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 487, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "View.MemoryView":485
- * PyMem_Free(tmp)
- *
- * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
- * cdef char *itemp = self.get_item_pointer(index)
- * self.assign_item_from_object(itemp, value)
- */
-
- /* function exit code */
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":489
- * self.assign_item_from_object(itemp, value)
- *
- * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
- * """Only used if instantiated manually by the user, or if Cython doesn't
- * know how to convert the type"""
- */
-
-static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
- PyObject *__pyx_v_struct = NULL;
- PyObject *__pyx_v_bytesitem = 0;
- PyObject *__pyx_v_result = NULL;
- PyObject *__pyx_r = NULL;
- __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;
- PyObject *__pyx_t_7 = NULL;
- int __pyx_t_8;
- Py_ssize_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("convert_item_to_object", 0);
-
- /* "View.MemoryView":492
- * """Only used if instantiated manually by the user, or if Cython doesn't
- * know how to convert the type"""
- * import struct # <<<<<<<<<<<<<<
- * cdef bytes bytesitem
- *
- */
- __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_struct, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 492, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_struct = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "View.MemoryView":495
- * cdef bytes bytesitem
- *
- * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
- * try:
- * result = struct.unpack(self.view.format, bytesitem)
- */
- __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "View.MemoryView":496
- *
- * bytesitem = itemp[:self.view.itemsize]
- * try: # <<<<<<<<<<<<<<
- * result = struct.unpack(self.view.format, bytesitem)
- * except struct.error:
- */
- {
- __Pyx_PyThreadState_declare
- __Pyx_PyThreadState_assign
- __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
- __Pyx_XGOTREF(__pyx_t_2);
- __Pyx_XGOTREF(__pyx_t_3);
- __Pyx_XGOTREF(__pyx_t_4);
- /*try:*/ {
-
- /* "View.MemoryView":497
- * bytesitem = itemp[:self.view.itemsize]
- * try:
- * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
- * except struct.error:
- * raise ValueError, "Unable to convert item to object"
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 497, __pyx_L3_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 497, __pyx_L3_error)
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = NULL;
- __pyx_t_8 = 0;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
- __pyx_t_8 = 1;
- }
- }
- {
- PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
- __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 497, __pyx_L3_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- }
- __pyx_v_result = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "View.MemoryView":496
- *
- * bytesitem = itemp[:self.view.itemsize]
- * try: # <<<<<<<<<<<<<<
- * result = struct.unpack(self.view.format, bytesitem)
- * except struct.error:
- */
- }
-
- /* "View.MemoryView":501
- * raise ValueError, "Unable to convert item to object"
- * else:
- * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
- * return result[0]
- * return result
- */
- /*else:*/ {
- __pyx_t_9 = __Pyx_ssize_strlen(__pyx_v_self->view.format); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(1, 501, __pyx_L5_except_error)
- __pyx_t_10 = (__pyx_t_9 == 1);
- if (__pyx_t_10) {
-
- /* "View.MemoryView":502
- * else:
- * if len(self.view.format) == 1:
- * return result[0] # <<<<<<<<<<<<<<
- * return result
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 502, __pyx_L5_except_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L6_except_return;
-
- /* "View.MemoryView":501
- * raise ValueError, "Unable to convert item to object"
- * else:
- * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
- * return result[0]
- * return result
- */
- }
-
- /* "View.MemoryView":503
- * if len(self.view.format) == 1:
- * return result[0]
- * return result # <<<<<<<<<<<<<<
- *
- * cdef assign_item_from_object(self, char *itemp, object value):
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_result);
- __pyx_r = __pyx_v_result;
- goto __pyx_L6_except_return;
- }
- __pyx_L3_error:;
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __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;
-
- /* "View.MemoryView":498
- * try:
- * result = struct.unpack(self.view.format, bytesitem)
- * except struct.error: # <<<<<<<<<<<<<<
- * raise ValueError, "Unable to convert item to object"
- * else:
- */
- __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 498, __pyx_L5_except_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_7);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_6);
- __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0;
- if (__pyx_t_8) {
- __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 498, __pyx_L5_except_error)
- __Pyx_XGOTREF(__pyx_t_6);
- __Pyx_XGOTREF(__pyx_t_5);
- __Pyx_XGOTREF(__pyx_t_1);
-
- /* "View.MemoryView":499
- * result = struct.unpack(self.view.format, bytesitem)
- * except struct.error:
- * raise ValueError, "Unable to convert item to object" # <<<<<<<<<<<<<<
- * else:
- * if len(self.view.format) == 1:
- */
- __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Unable_to_convert_item_to_object, 0, 0);
- __PYX_ERR(1, 499, __pyx_L5_except_error)
- }
- goto __pyx_L5_except_error;
-
- /* "View.MemoryView":496
- *
- * bytesitem = itemp[:self.view.itemsize]
- * try: # <<<<<<<<<<<<<<
- * result = struct.unpack(self.view.format, bytesitem)
- * except struct.error:
- */
- __pyx_L5_except_error:;
- __Pyx_XGIVEREF(__pyx_t_2);
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_XGIVEREF(__pyx_t_4);
- __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
- goto __pyx_L1_error;
- __pyx_L6_except_return:;
- __Pyx_XGIVEREF(__pyx_t_2);
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_XGIVEREF(__pyx_t_4);
- __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
- goto __pyx_L0;
- }
-
- /* "View.MemoryView":489
- * self.assign_item_from_object(itemp, value)
- *
- * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
- * """Only used if instantiated manually by the user, or if Cython doesn't
- * know how to convert the type"""
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_struct);
- __Pyx_XDECREF(__pyx_v_bytesitem);
- __Pyx_XDECREF(__pyx_v_result);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":505
- * return result
- *
- * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
- * """Only used if instantiated manually by the user, or if Cython doesn't
- * know how to convert the type"""
- */
-
-static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
- PyObject *__pyx_v_struct = NULL;
- char __pyx_v_c;
- PyObject *__pyx_v_bytesvalue = 0;
- Py_ssize_t __pyx_v_i;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_t_6;
- Py_ssize_t __pyx_t_7;
- PyObject *__pyx_t_8 = NULL;
- char *__pyx_t_9;
- char *__pyx_t_10;
- char *__pyx_t_11;
- char *__pyx_t_12;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("assign_item_from_object", 0);
-
- /* "View.MemoryView":508
- * """Only used if instantiated manually by the user, or if Cython doesn't
- * know how to convert the type"""
- * import struct # <<<<<<<<<<<<<<
- * cdef char c
- * cdef bytes bytesvalue
- */
- __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_struct, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 508, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_struct = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "View.MemoryView":513
- * cdef Py_ssize_t i
- *
- * if isinstance(value, tuple): # <<<<<<<<<<<<<<
- * bytesvalue = struct.pack(self.view.format, *value)
- * else:
- */
- __pyx_t_2 = PyTuple_Check(__pyx_v_value);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":514
- *
- * if isinstance(value, tuple):
- * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
- * else:
- * bytesvalue = struct.pack(self.view.format, value)
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 514, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 514, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __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;
- if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(1, 514, __pyx_L1_error)
- __pyx_v_bytesvalue = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "View.MemoryView":513
- * cdef Py_ssize_t i
- *
- * if isinstance(value, tuple): # <<<<<<<<<<<<<<
- * bytesvalue = struct.pack(self.view.format, *value)
- * else:
- */
- goto __pyx_L3;
- }
-
- /* "View.MemoryView":516
- * bytesvalue = struct.pack(self.view.format, *value)
- * else:
- * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
- *
- * for i, c in enumerate(bytesvalue):
- */
- /*else*/ {
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 516, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 516, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = NULL;
- __pyx_t_6 = 0;
- if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
- __pyx_t_6 = 1;
- }
- }
- {
- PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_1, __pyx_v_value};
- __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 516, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- }
- if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(1, 516, __pyx_L1_error)
- __pyx_v_bytesvalue = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":518
- * bytesvalue = struct.pack(self.view.format, value)
- *
- * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
- * itemp[i] = c
- *
- */
- __pyx_t_7 = 0;
- if (unlikely(__pyx_v_bytesvalue == Py_None)) {
- PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
- __PYX_ERR(1, 518, __pyx_L1_error)
- }
- __Pyx_INCREF(__pyx_v_bytesvalue);
- __pyx_t_8 = __pyx_v_bytesvalue;
- __pyx_t_10 = PyBytes_AS_STRING(__pyx_t_8);
- __pyx_t_11 = (__pyx_t_10 + PyBytes_GET_SIZE(__pyx_t_8));
- for (__pyx_t_12 = __pyx_t_10; __pyx_t_12 < __pyx_t_11; __pyx_t_12++) {
- __pyx_t_9 = __pyx_t_12;
- __pyx_v_c = (__pyx_t_9[0]);
-
- /* "View.MemoryView":519
- *
- * for i, c in enumerate(bytesvalue):
- * itemp[i] = c # <<<<<<<<<<<<<<
- *
- * @cname('getbuffer')
- */
- __pyx_v_i = __pyx_t_7;
-
- /* "View.MemoryView":518
- * bytesvalue = struct.pack(self.view.format, value)
- *
- * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
- * itemp[i] = c
- *
- */
- __pyx_t_7 = (__pyx_t_7 + 1);
-
- /* "View.MemoryView":519
- *
- * for i, c in enumerate(bytesvalue):
- * itemp[i] = c # <<<<<<<<<<<<<<
- *
- * @cname('getbuffer')
- */
- (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
- }
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-
- /* "View.MemoryView":505
- * return result
- *
- * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
- * """Only used if instantiated manually by the user, or if Cython doesn't
- * know how to convert the type"""
- */
-
- /* function exit code */
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_struct);
- __Pyx_XDECREF(__pyx_v_bytesvalue);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":521
- * itemp[i] = c
- *
- * @cname('getbuffer') # <<<<<<<<<<<<<<
- * def __getbuffer__(self, Py_buffer *info, int flags):
- * if flags & PyBUF_WRITABLE and self.view.readonly:
- */
-
-/* Python wrapper */
-CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
-CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- Py_ssize_t *__pyx_t_3;
- char *__pyx_t_4;
- void *__pyx_t_5;
- int __pyx_t_6;
- Py_ssize_t __pyx_t_7;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- if (unlikely(__pyx_v_info == NULL)) {
- PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
- return -1;
- }
- __Pyx_RefNannySetupContext("__getbuffer__", 0);
- __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
- __Pyx_GIVEREF(__pyx_v_info->obj);
-
- /* "View.MemoryView":523
- * @cname('getbuffer')
- * def __getbuffer__(self, Py_buffer *info, int flags):
- * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
- * raise ValueError, "Cannot create writable memory view from read-only memoryview"
- *
- */
- __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
- if (__pyx_t_2) {
- } else {
- __pyx_t_1 = __pyx_t_2;
- goto __pyx_L4_bool_binop_done;
- }
- __pyx_t_1 = __pyx_v_self->view.readonly;
- __pyx_L4_bool_binop_done:;
- if (unlikely(__pyx_t_1)) {
-
- /* "View.MemoryView":524
- * def __getbuffer__(self, Py_buffer *info, int flags):
- * if flags & PyBUF_WRITABLE and self.view.readonly:
- * raise ValueError, "Cannot create writable memory view from read-only memoryview" # <<<<<<<<<<<<<<
- *
- * if flags & PyBUF_ND:
- */
- __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Cannot_create_writable_memory_vi, 0, 0);
- __PYX_ERR(1, 524, __pyx_L1_error)
-
- /* "View.MemoryView":523
- * @cname('getbuffer')
- * def __getbuffer__(self, Py_buffer *info, int flags):
- * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
- * raise ValueError, "Cannot create writable memory view from read-only memoryview"
- *
- */
- }
-
- /* "View.MemoryView":526
- * raise ValueError, "Cannot create writable memory view from read-only memoryview"
- *
- * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
- * info.shape = self.view.shape
- * else:
- */
- __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":527
- *
- * if flags & PyBUF_ND:
- * info.shape = self.view.shape # <<<<<<<<<<<<<<
- * else:
- * info.shape = NULL
- */
- __pyx_t_3 = __pyx_v_self->view.shape;
- __pyx_v_info->shape = __pyx_t_3;
-
- /* "View.MemoryView":526
- * raise ValueError, "Cannot create writable memory view from read-only memoryview"
- *
- * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
- * info.shape = self.view.shape
- * else:
- */
- goto __pyx_L6;
- }
-
- /* "View.MemoryView":529
- * info.shape = self.view.shape
- * else:
- * info.shape = NULL # <<<<<<<<<<<<<<
- *
- * if flags & PyBUF_STRIDES:
- */
- /*else*/ {
- __pyx_v_info->shape = NULL;
- }
- __pyx_L6:;
-
- /* "View.MemoryView":531
- * info.shape = NULL
- *
- * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
- * info.strides = self.view.strides
- * else:
- */
- __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":532
- *
- * if flags & PyBUF_STRIDES:
- * info.strides = self.view.strides # <<<<<<<<<<<<<<
- * else:
- * info.strides = NULL
- */
- __pyx_t_3 = __pyx_v_self->view.strides;
- __pyx_v_info->strides = __pyx_t_3;
-
- /* "View.MemoryView":531
- * info.shape = NULL
- *
- * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
- * info.strides = self.view.strides
- * else:
- */
- goto __pyx_L7;
- }
-
- /* "View.MemoryView":534
- * info.strides = self.view.strides
- * else:
- * info.strides = NULL # <<<<<<<<<<<<<<
- *
- * if flags & PyBUF_INDIRECT:
- */
- /*else*/ {
- __pyx_v_info->strides = NULL;
- }
- __pyx_L7:;
-
- /* "View.MemoryView":536
- * info.strides = NULL
- *
- * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
- * info.suboffsets = self.view.suboffsets
- * else:
- */
- __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":537
- *
- * if flags & PyBUF_INDIRECT:
- * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
- * else:
- * info.suboffsets = NULL
- */
- __pyx_t_3 = __pyx_v_self->view.suboffsets;
- __pyx_v_info->suboffsets = __pyx_t_3;
-
- /* "View.MemoryView":536
- * info.strides = NULL
- *
- * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
- * info.suboffsets = self.view.suboffsets
- * else:
- */
- goto __pyx_L8;
- }
-
- /* "View.MemoryView":539
- * info.suboffsets = self.view.suboffsets
- * else:
- * info.suboffsets = NULL # <<<<<<<<<<<<<<
- *
- * if flags & PyBUF_FORMAT:
- */
- /*else*/ {
- __pyx_v_info->suboffsets = NULL;
- }
- __pyx_L8:;
-
- /* "View.MemoryView":541
- * info.suboffsets = NULL
- *
- * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
- * info.format = self.view.format
- * else:
- */
- __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":542
- *
- * if flags & PyBUF_FORMAT:
- * info.format = self.view.format # <<<<<<<<<<<<<<
- * else:
- * info.format = NULL
- */
- __pyx_t_4 = __pyx_v_self->view.format;
- __pyx_v_info->format = __pyx_t_4;
-
- /* "View.MemoryView":541
- * info.suboffsets = NULL
- *
- * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
- * info.format = self.view.format
- * else:
- */
- goto __pyx_L9;
- }
-
- /* "View.MemoryView":544
- * info.format = self.view.format
- * else:
- * info.format = NULL # <<<<<<<<<<<<<<
- *
- * info.buf = self.view.buf
- */
- /*else*/ {
- __pyx_v_info->format = NULL;
- }
- __pyx_L9:;
-
- /* "View.MemoryView":546
- * info.format = NULL
- *
- * info.buf = self.view.buf # <<<<<<<<<<<<<<
- * info.ndim = self.view.ndim
- * info.itemsize = self.view.itemsize
- */
- __pyx_t_5 = __pyx_v_self->view.buf;
- __pyx_v_info->buf = __pyx_t_5;
-
- /* "View.MemoryView":547
- *
- * info.buf = self.view.buf
- * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
- * info.itemsize = self.view.itemsize
- * info.len = self.view.len
- */
- __pyx_t_6 = __pyx_v_self->view.ndim;
- __pyx_v_info->ndim = __pyx_t_6;
-
- /* "View.MemoryView":548
- * info.buf = self.view.buf
- * info.ndim = self.view.ndim
- * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
- * info.len = self.view.len
- * info.readonly = self.view.readonly
- */
- __pyx_t_7 = __pyx_v_self->view.itemsize;
- __pyx_v_info->itemsize = __pyx_t_7;
-
- /* "View.MemoryView":549
- * info.ndim = self.view.ndim
- * info.itemsize = self.view.itemsize
- * info.len = self.view.len # <<<<<<<<<<<<<<
- * info.readonly = self.view.readonly
- * info.obj = self
- */
- __pyx_t_7 = __pyx_v_self->view.len;
- __pyx_v_info->len = __pyx_t_7;
-
- /* "View.MemoryView":550
- * info.itemsize = self.view.itemsize
- * info.len = self.view.len
- * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
- * info.obj = self
- *
- */
- __pyx_t_1 = __pyx_v_self->view.readonly;
- __pyx_v_info->readonly = __pyx_t_1;
-
- /* "View.MemoryView":551
- * info.len = self.view.len
- * info.readonly = self.view.readonly
- * info.obj = self # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_INCREF((PyObject *)__pyx_v_self);
- __Pyx_GIVEREF((PyObject *)__pyx_v_self);
- __Pyx_GOTREF(__pyx_v_info->obj);
- __Pyx_DECREF(__pyx_v_info->obj);
- __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
-
- /* "View.MemoryView":521
- * itemp[i] = c
- *
- * @cname('getbuffer') # <<<<<<<<<<<<<<
- * def __getbuffer__(self, Py_buffer *info, int flags):
- * if flags & PyBUF_WRITABLE and self.view.readonly:
- */
-
- /* function exit code */
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- if (__pyx_v_info->obj != NULL) {
- __Pyx_GOTREF(__pyx_v_info->obj);
- __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
- }
- goto __pyx_L2;
- __pyx_L0:;
- if (__pyx_v_info->obj == Py_None) {
- __Pyx_GOTREF(__pyx_v_info->obj);
- __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
- }
- __pyx_L2:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":554
- *
- *
- * @property # <<<<<<<<<<<<<<
- * def T(self):
- * cdef _memoryviewslice result = memoryview_copy(self)
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
- struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_t_2;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":556
- * @property
- * def T(self):
- * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
- * transpose_memslice(&result.from_slice)
- * return result
- */
- __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 556, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 556, __pyx_L1_error)
- __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "View.MemoryView":557
- * def T(self):
- * cdef _memoryviewslice result = memoryview_copy(self)
- * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
- * return result
- *
- */
- __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 557, __pyx_L1_error)
-
- /* "View.MemoryView":558
- * cdef _memoryviewslice result = memoryview_copy(self)
- * transpose_memslice(&result.from_slice)
- * return result # <<<<<<<<<<<<<<
- *
- * @property
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF((PyObject *)__pyx_v_result);
- __pyx_r = ((PyObject *)__pyx_v_result);
- goto __pyx_L0;
-
- /* "View.MemoryView":554
- *
- *
- * @property # <<<<<<<<<<<<<<
- * def T(self):
- * cdef _memoryviewslice result = memoryview_copy(self)
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":560
- * return result
- *
- * @property # <<<<<<<<<<<<<<
- * def base(self):
- * return self._get_base()
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":562
- * @property
- * def base(self):
- * return self._get_base() # <<<<<<<<<<<<<<
- *
- * cdef _get_base(self):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->_get_base(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 562, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- /* "View.MemoryView":560
- * return result
- *
- * @property # <<<<<<<<<<<<<<
- * def base(self):
- * return self._get_base()
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":564
- * return self._get_base()
- *
- * cdef _get_base(self): # <<<<<<<<<<<<<<
- * return self.obj
- *
- */
-
-static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("_get_base", 0);
-
- /* "View.MemoryView":565
- *
- * cdef _get_base(self):
- * return self.obj # <<<<<<<<<<<<<<
- *
- * @property
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_self->obj);
- __pyx_r = __pyx_v_self->obj;
- goto __pyx_L0;
-
- /* "View.MemoryView":564
- * return self._get_base()
- *
- * cdef _get_base(self): # <<<<<<<<<<<<<<
- * return self.obj
- *
- */
-
- /* function exit code */
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":567
- * return self.obj
- *
- * @property # <<<<<<<<<<<<<<
- * def shape(self):
- * return tuple([length for length in self.view.shape[:self.view.ndim]])
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
- Py_ssize_t __pyx_7genexpr__pyx_v_length;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- Py_ssize_t *__pyx_t_2;
- Py_ssize_t *__pyx_t_3;
- Py_ssize_t *__pyx_t_4;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":569
- * @property
- * def shape(self):
- * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
- *
- * @property
- */
- __Pyx_XDECREF(__pyx_r);
- { /* enter inner scope */
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 569, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
- for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
- __pyx_t_2 = __pyx_t_4;
- __pyx_7genexpr__pyx_v_length = (__pyx_t_2[0]);
- __pyx_t_5 = PyInt_FromSsize_t(__pyx_7genexpr__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 569, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 569, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- }
- } /* exit inner scope */
- __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 569, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_r = __pyx_t_5;
- __pyx_t_5 = 0;
- goto __pyx_L0;
-
- /* "View.MemoryView":567
- * return self.obj
- *
- * @property # <<<<<<<<<<<<<<
- * def shape(self):
- * return tuple([length for length in self.view.shape[:self.view.ndim]])
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":571
- * return tuple([length for length in self.view.shape[:self.view.ndim]])
- *
- * @property # <<<<<<<<<<<<<<
- * def strides(self):
- * if self.view.strides == NULL:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
- Py_ssize_t __pyx_8genexpr1__pyx_v_stride;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- Py_ssize_t *__pyx_t_3;
- Py_ssize_t *__pyx_t_4;
- Py_ssize_t *__pyx_t_5;
- PyObject *__pyx_t_6 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":573
- * @property
- * def strides(self):
- * if self.view.strides == NULL: # <<<<<<<<<<<<<<
- *
- * raise ValueError, "Buffer view does not expose strides"
- */
- __pyx_t_1 = (__pyx_v_self->view.strides == NULL);
- if (unlikely(__pyx_t_1)) {
-
- /* "View.MemoryView":575
- * if self.view.strides == NULL:
- *
- * raise ValueError, "Buffer view does not expose strides" # <<<<<<<<<<<<<<
- *
- * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
- */
- __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Buffer_view_does_not_expose_stri, 0, 0);
- __PYX_ERR(1, 575, __pyx_L1_error)
-
- /* "View.MemoryView":573
- * @property
- * def strides(self):
- * if self.view.strides == NULL: # <<<<<<<<<<<<<<
- *
- * raise ValueError, "Buffer view does not expose strides"
- */
- }
-
- /* "View.MemoryView":577
- * raise ValueError, "Buffer view does not expose strides"
- *
- * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
- *
- * @property
- */
- __Pyx_XDECREF(__pyx_r);
- { /* enter inner scope */
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
- for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
- __pyx_t_3 = __pyx_t_5;
- __pyx_8genexpr1__pyx_v_stride = (__pyx_t_3[0]);
- __pyx_t_6 = PyInt_FromSsize_t(__pyx_8genexpr1__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 577, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 577, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- }
- } /* exit inner scope */
- __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 577, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_6;
- __pyx_t_6 = 0;
- goto __pyx_L0;
-
- /* "View.MemoryView":571
- * return tuple([length for length in self.view.shape[:self.view.ndim]])
- *
- * @property # <<<<<<<<<<<<<<
- * def strides(self):
- * if self.view.strides == NULL:
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":579
- * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
- *
- * @property # <<<<<<<<<<<<<<
- * def suboffsets(self):
- * if self.view.suboffsets == NULL:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
- Py_ssize_t __pyx_8genexpr2__pyx_v_suboffset;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- Py_ssize_t *__pyx_t_3;
- Py_ssize_t *__pyx_t_4;
- Py_ssize_t *__pyx_t_5;
- PyObject *__pyx_t_6 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":581
- * @property
- * def suboffsets(self):
- * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
- * return (-1,) * self.view.ndim
- *
- */
- __pyx_t_1 = (__pyx_v_self->view.suboffsets == NULL);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":582
- * def suboffsets(self):
- * if self.view.suboffsets == NULL:
- * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
- *
- * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PySequence_Multiply(__pyx_tuple__4, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 582, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- /* "View.MemoryView":581
- * @property
- * def suboffsets(self):
- * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
- * return (-1,) * self.view.ndim
- *
- */
- }
-
- /* "View.MemoryView":584
- * return (-1,) * self.view.ndim
- *
- * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
- *
- * @property
- */
- __Pyx_XDECREF(__pyx_r);
- { /* enter inner scope */
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 584, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
- for (__pyx_t_5 = __pyx_v_self->view.suboffsets; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
- __pyx_t_3 = __pyx_t_5;
- __pyx_8genexpr2__pyx_v_suboffset = (__pyx_t_3[0]);
- __pyx_t_6 = PyInt_FromSsize_t(__pyx_8genexpr2__pyx_v_suboffset); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 584, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- }
- } /* exit inner scope */
- __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_6;
- __pyx_t_6 = 0;
- goto __pyx_L0;
-
- /* "View.MemoryView":579
- * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
- *
- * @property # <<<<<<<<<<<<<<
- * def suboffsets(self):
- * if self.view.suboffsets == NULL:
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":586
- * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
- *
- * @property # <<<<<<<<<<<<<<
- * def ndim(self):
- * return self.view.ndim
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":588
- * @property
- * def ndim(self):
- * return self.view.ndim # <<<<<<<<<<<<<<
- *
- * @property
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 588, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- /* "View.MemoryView":586
- * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
- *
- * @property # <<<<<<<<<<<<<<
- * def ndim(self):
- * return self.view.ndim
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":590
- * return self.view.ndim
- *
- * @property # <<<<<<<<<<<<<<
- * def itemsize(self):
- * return self.view.itemsize
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":592
- * @property
- * def itemsize(self):
- * return self.view.itemsize # <<<<<<<<<<<<<<
- *
- * @property
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 592, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- /* "View.MemoryView":590
- * return self.view.ndim
- *
- * @property # <<<<<<<<<<<<<<
- * def itemsize(self):
- * return self.view.itemsize
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":594
- * return self.view.itemsize
- *
- * @property # <<<<<<<<<<<<<<
- * def nbytes(self):
- * return self.size * self.view.itemsize
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":596
- * @property
- * def nbytes(self):
- * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
- *
- * @property
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 596, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 596, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 596, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- /* "View.MemoryView":594
- * return self.view.itemsize
- *
- * @property # <<<<<<<<<<<<<<
- * def nbytes(self):
- * return self.size * self.view.itemsize
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":598
- * return self.size * self.view.itemsize
- *
- * @property # <<<<<<<<<<<<<<
- * def size(self):
- * if self._size is None:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
- PyObject *__pyx_v_result = NULL;
- PyObject *__pyx_v_length = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- Py_ssize_t *__pyx_t_2;
- Py_ssize_t *__pyx_t_3;
- Py_ssize_t *__pyx_t_4;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":600
- * @property
- * def size(self):
- * if self._size is None: # <<<<<<<<<<<<<<
- * result = 1
- *
- */
- __pyx_t_1 = (__pyx_v_self->_size == Py_None);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":601
- * def size(self):
- * if self._size is None:
- * result = 1 # <<<<<<<<<<<<<<
- *
- * for length in self.view.shape[:self.view.ndim]:
- */
- __Pyx_INCREF(__pyx_int_1);
- __pyx_v_result = __pyx_int_1;
-
- /* "View.MemoryView":603
- * result = 1
- *
- * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
- * result *= length
- *
- */
- __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
- for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
- __pyx_t_2 = __pyx_t_4;
- __pyx_t_5 = PyInt_FromSsize_t((__pyx_t_2[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 603, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_5);
- __pyx_t_5 = 0;
-
- /* "View.MemoryView":604
- *
- * for length in self.view.shape[:self.view.ndim]:
- * result *= length # <<<<<<<<<<<<<<
- *
- * self._size = result
- */
- __pyx_t_5 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 604, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_5);
- __pyx_t_5 = 0;
- }
-
- /* "View.MemoryView":606
- * result *= length
- *
- * self._size = result # <<<<<<<<<<<<<<
- *
- * return self._size
- */
- __Pyx_INCREF(__pyx_v_result);
- __Pyx_GIVEREF(__pyx_v_result);
- __Pyx_GOTREF(__pyx_v_self->_size);
- __Pyx_DECREF(__pyx_v_self->_size);
- __pyx_v_self->_size = __pyx_v_result;
-
- /* "View.MemoryView":600
- * @property
- * def size(self):
- * if self._size is None: # <<<<<<<<<<<<<<
- * result = 1
- *
- */
- }
-
- /* "View.MemoryView":608
- * self._size = result
- *
- * return self._size # <<<<<<<<<<<<<<
- *
- * def __len__(self):
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_self->_size);
- __pyx_r = __pyx_v_self->_size;
- goto __pyx_L0;
-
- /* "View.MemoryView":598
- * return self.size * self.view.itemsize
- *
- * @property # <<<<<<<<<<<<<<
- * def size(self):
- * if self._size is None:
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_result);
- __Pyx_XDECREF(__pyx_v_length);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":610
- * return self._size
- *
- * def __len__(self): # <<<<<<<<<<<<<<
- * if self.view.ndim >= 1:
- * return self.view.shape[0]
- */
-
-/* Python wrapper */
-static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
-static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
- Py_ssize_t __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
- Py_ssize_t __pyx_r;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- __Pyx_RefNannySetupContext("__len__", 0);
-
- /* "View.MemoryView":611
- *
- * def __len__(self):
- * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
- * return self.view.shape[0]
- *
- */
- __pyx_t_1 = (__pyx_v_self->view.ndim >= 1);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":612
- * def __len__(self):
- * if self.view.ndim >= 1:
- * return self.view.shape[0] # <<<<<<<<<<<<<<
- *
- * return 0
- */
- __pyx_r = (__pyx_v_self->view.shape[0]);
- goto __pyx_L0;
-
- /* "View.MemoryView":611
- *
- * def __len__(self):
- * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
- * return self.view.shape[0]
- *
- */
- }
-
- /* "View.MemoryView":614
- * return self.view.shape[0]
- *
- * return 0 # <<<<<<<<<<<<<<
- *
- * def __repr__(self):
- */
- __pyx_r = 0;
- goto __pyx_L0;
-
- /* "View.MemoryView":610
- * return self._size
- *
- * def __len__(self): # <<<<<<<<<<<<<<
- * if self.view.ndim >= 1:
- * return self.view.shape[0]
- */
-
- /* function exit code */
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":616
- * return 0
- *
- * def __repr__(self): # <<<<<<<<<<<<<<
- * return "" % (self.base.__class__.__name__,
- * id(self))
- */
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__repr__", 0);
-
- /* "View.MemoryView":617
- *
- * def __repr__(self):
- * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
- * id(self))
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 617, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "View.MemoryView":618
- * def __repr__(self):
- * return "" % (self.base.__class__.__name__,
- * id(self)) # <<<<<<<<<<<<<<
- *
- * def __str__(self):
- */
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
-
- /* "View.MemoryView":617
- *
- * def __repr__(self):
- * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
- * id(self))
- *
- */
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 617, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
- __pyx_t_1 = 0;
- __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 617, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- /* "View.MemoryView":616
- * return 0
- *
- * def __repr__(self): # <<<<<<<<<<<<<<
- * return "" % (self.base.__class__.__name__,
- * id(self))
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":620
- * id(self))
- *
- * def __str__(self): # <<<<<<<<<<<<<<
- * return "" % (self.base.__class__.__name__,)
- *
- */
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_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("__str__", 0);
-
- /* "View.MemoryView":621
- *
- * def __str__(self):
- * return "" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 621, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 621, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- /* "View.MemoryView":620
- * id(self))
- *
- * def __str__(self): # <<<<<<<<<<<<<<
- * return "" % (self.base.__class__.__name__,)
- *
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":624
- *
- *
- * def is_c_contig(self): # <<<<<<<<<<<<<<
- * cdef __Pyx_memviewslice *mslice
- * cdef __Pyx_memviewslice tmp
- */
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-) {
- #if !CYTHON_METH_FASTCALL
- CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
- #endif
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
- if (unlikely(__pyx_nargs > 0)) {
- __Pyx_RaiseArgtupleInvalid("is_c_contig", 1, 0, 0, __pyx_nargs); return NULL;}
- if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_c_contig", 0))) return NULL;
- __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
- __Pyx_memviewslice *__pyx_v_mslice;
- __Pyx_memviewslice __pyx_v_tmp;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __Pyx_memviewslice *__pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("is_c_contig", 0);
-
- /* "View.MemoryView":627
- * cdef __Pyx_memviewslice *mslice
- * cdef __Pyx_memviewslice tmp
- * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
- * return slice_is_contig(mslice[0], 'C', self.view.ndim)
- *
- */
- __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 627, __pyx_L1_error)
- __pyx_v_mslice = __pyx_t_1;
-
- /* "View.MemoryView":628
- * cdef __Pyx_memviewslice tmp
- * mslice = get_slice_from_memview(self, &tmp)
- * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
- *
- * def is_f_contig(self):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 628, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- /* "View.MemoryView":624
- *
- *
- * def is_c_contig(self): # <<<<<<<<<<<<<<
- * cdef __Pyx_memviewslice *mslice
- * cdef __Pyx_memviewslice tmp
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":630
- * return slice_is_contig(mslice[0], 'C', self.view.ndim)
- *
- * def is_f_contig(self): # <<<<<<<<<<<<<<
- * cdef __Pyx_memviewslice *mslice
- * cdef __Pyx_memviewslice tmp
- */
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-) {
- #if !CYTHON_METH_FASTCALL
- CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
- #endif
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
- if (unlikely(__pyx_nargs > 0)) {
- __Pyx_RaiseArgtupleInvalid("is_f_contig", 1, 0, 0, __pyx_nargs); return NULL;}
- if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_f_contig", 0))) return NULL;
- __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
- __Pyx_memviewslice *__pyx_v_mslice;
- __Pyx_memviewslice __pyx_v_tmp;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __Pyx_memviewslice *__pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("is_f_contig", 0);
-
- /* "View.MemoryView":633
- * cdef __Pyx_memviewslice *mslice
- * cdef __Pyx_memviewslice tmp
- * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
- * return slice_is_contig(mslice[0], 'F', self.view.ndim)
- *
- */
- __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 633, __pyx_L1_error)
- __pyx_v_mslice = __pyx_t_1;
-
- /* "View.MemoryView":634
- * cdef __Pyx_memviewslice tmp
- * mslice = get_slice_from_memview(self, &tmp)
- * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
- *
- * def copy(self):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 634, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- /* "View.MemoryView":630
- * return slice_is_contig(mslice[0], 'C', self.view.ndim)
- *
- * def is_f_contig(self): # <<<<<<<<<<<<<<
- * cdef __Pyx_memviewslice *mslice
- * cdef __Pyx_memviewslice tmp
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":636
- * return slice_is_contig(mslice[0], 'F', self.view.ndim)
- *
- * def copy(self): # <<<<<<<<<<<<<<
- * cdef __Pyx_memviewslice mslice
- * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
- */
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-) {
- #if !CYTHON_METH_FASTCALL
- CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
- #endif
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("copy (wrapper)", 0);
- if (unlikely(__pyx_nargs > 0)) {
- __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, __pyx_nargs); return NULL;}
- if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy", 0))) return NULL;
- __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
- __Pyx_memviewslice __pyx_v_mslice;
- int __pyx_v_flags;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __Pyx_memviewslice __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("copy", 0);
-
- /* "View.MemoryView":638
- * def copy(self):
- * cdef __Pyx_memviewslice mslice
- * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
- *
- * slice_copy(self, &mslice)
- */
- __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
-
- /* "View.MemoryView":640
- * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
- *
- * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
- * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
- * self.view.itemsize,
- */
- __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
-
- /* "View.MemoryView":641
- *
- * slice_copy(self, &mslice)
- * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
- * self.view.itemsize,
- * flags|PyBUF_C_CONTIGUOUS,
- */
- __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 641, __pyx_L1_error)
- __pyx_v_mslice = __pyx_t_1;
-
- /* "View.MemoryView":646
- * self.dtype_is_object)
- *
- * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
- *
- * def copy_fortran(self):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 646, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- /* "View.MemoryView":636
- * return slice_is_contig(mslice[0], 'F', self.view.ndim)
- *
- * def copy(self): # <<<<<<<<<<<<<<
- * cdef __Pyx_memviewslice mslice
- * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":648
- * return memoryview_copy_from_slice(self, &mslice)
- *
- * def copy_fortran(self): # <<<<<<<<<<<<<<
- * cdef __Pyx_memviewslice src, dst
- * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
- */
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-) {
- #if !CYTHON_METH_FASTCALL
- CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
- #endif
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
- if (unlikely(__pyx_nargs > 0)) {
- __Pyx_RaiseArgtupleInvalid("copy_fortran", 1, 0, 0, __pyx_nargs); return NULL;}
- if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy_fortran", 0))) return NULL;
- __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
- __Pyx_memviewslice __pyx_v_src;
- __Pyx_memviewslice __pyx_v_dst;
- int __pyx_v_flags;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __Pyx_memviewslice __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("copy_fortran", 0);
-
- /* "View.MemoryView":650
- * def copy_fortran(self):
- * cdef __Pyx_memviewslice src, dst
- * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
- *
- * slice_copy(self, &src)
- */
- __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
-
- /* "View.MemoryView":652
- * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
- *
- * slice_copy(self, &src) # <<<<<<<<<<<<<<
- * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
- * self.view.itemsize,
- */
- __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
-
- /* "View.MemoryView":653
- *
- * slice_copy(self, &src)
- * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
- * self.view.itemsize,
- * flags|PyBUF_F_CONTIGUOUS,
- */
- __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 653, __pyx_L1_error)
- __pyx_v_dst = __pyx_t_1;
-
- /* "View.MemoryView":658
- * self.dtype_is_object)
- *
- * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- /* "View.MemoryView":648
- * return memoryview_copy_from_slice(self, &mslice)
- *
- * def copy_fortran(self): # <<<<<<<<<<<<<<
- * cdef __Pyx_memviewslice src, dst
- * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "(tree fragment)":1
- * def __reduce_cython__(self): # <<<<<<<<<<<<<<
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
- * def __setstate_cython__(self, __pyx_state):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-) {
- #if !CYTHON_METH_FASTCALL
- CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
- #endif
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
- if (unlikely(__pyx_nargs > 0)) {
- __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
- if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
- __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__reduce_cython__", 0);
-
- /* "(tree fragment)":2
- * def __reduce_cython__(self):
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
- * def __setstate_cython__(self, __pyx_state):
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
- */
- __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
- __PYX_ERR(1, 2, __pyx_L1_error)
-
- /* "(tree fragment)":1
- * def __reduce_cython__(self): # <<<<<<<<<<<<<<
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
- * def __setstate_cython__(self, __pyx_state):
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "(tree fragment)":3
- * def __reduce_cython__(self):
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
- * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-) {
- CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
- #if !CYTHON_METH_FASTCALL
- CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
- #endif
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
- {
- PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
- PyObject* values[1] = {0};
- if (__pyx_kwds) {
- Py_ssize_t kw_args;
- switch (__pyx_nargs) {
- case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
- CYTHON_FALLTHROUGH;
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
- switch (__pyx_nargs) {
- case 0:
- if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--;
- else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
- else goto __pyx_L5_argtuple_error;
- }
- if (unlikely(kw_args > 0)) {
- const Py_ssize_t kwd_pos_args = __pyx_nargs;
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
- }
- } else if (unlikely(__pyx_nargs != 1)) {
- goto __pyx_L5_argtuple_error;
- } else {
- values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
- }
- __pyx_v___pyx_state = values[0];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v___pyx_state);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__setstate_cython__", 0);
-
- /* "(tree fragment)":4
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
- * def __setstate_cython__(self, __pyx_state):
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
- */
- __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
- __PYX_ERR(1, 4, __pyx_L1_error)
-
- /* "(tree fragment)":3
- * def __reduce_cython__(self):
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
- * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":662
- *
- * @cname('__pyx_memoryview_new')
- * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
- * cdef memoryview result = memoryview(o, flags, dtype_is_object)
- * result.typeinfo = typeinfo
- */
-
-static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
- struct __pyx_memoryview_obj *__pyx_v_result = 0;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
-
- /* "View.MemoryView":663
- * @cname('__pyx_memoryview_new')
- * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
- * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
- * result.typeinfo = typeinfo
- * return result
- */
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 663, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 663, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 663, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_o);
- __Pyx_GIVEREF(__pyx_v_o);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
- __pyx_t_1 = 0;
- __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 663, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "View.MemoryView":664
- * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
- * cdef memoryview result = memoryview(o, flags, dtype_is_object)
- * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
- * return result
- *
- */
- __pyx_v_result->typeinfo = __pyx_v_typeinfo;
-
- /* "View.MemoryView":665
- * cdef memoryview result = memoryview(o, flags, dtype_is_object)
- * result.typeinfo = typeinfo
- * return result # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview_check')
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF((PyObject *)__pyx_v_result);
- __pyx_r = ((PyObject *)__pyx_v_result);
- goto __pyx_L0;
-
- /* "View.MemoryView":662
- *
- * @cname('__pyx_memoryview_new')
- * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
- * cdef memoryview result = memoryview(o, flags, dtype_is_object)
- * result.typeinfo = typeinfo
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":668
- *
- * @cname('__pyx_memoryview_check')
- * cdef inline bint memoryview_check(object o) noexcept: # <<<<<<<<<<<<<<
- * return isinstance(o, memoryview)
- *
- */
-
-static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- __Pyx_RefNannySetupContext("memoryview_check", 0);
-
- /* "View.MemoryView":669
- * @cname('__pyx_memoryview_check')
- * cdef inline bint memoryview_check(object o) noexcept:
- * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
- *
- * cdef tuple _unellipsify(object index, int ndim):
- */
- __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
- __pyx_r = __pyx_t_1;
- goto __pyx_L0;
-
- /* "View.MemoryView":668
- *
- * @cname('__pyx_memoryview_check')
- * cdef inline bint memoryview_check(object o) noexcept: # <<<<<<<<<<<<<<
- * return isinstance(o, memoryview)
- *
- */
-
- /* function exit code */
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":671
- * return isinstance(o, memoryview)
- *
- * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
- * """
- * Replace all ellipses with full slices and fill incomplete indices with
- */
-
-static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
- Py_ssize_t __pyx_v_idx;
- PyObject *__pyx_v_tup = NULL;
- PyObject *__pyx_v_result = NULL;
- int __pyx_v_have_slices;
- int __pyx_v_seen_ellipsis;
- PyObject *__pyx_v_item = NULL;
- Py_ssize_t __pyx_v_nslices;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- Py_ssize_t __pyx_t_4;
- Py_ssize_t __pyx_t_5;
- Py_UCS4 __pyx_t_6;
- PyObject *__pyx_t_7 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("_unellipsify", 0);
-
- /* "View.MemoryView":677
- * """
- * cdef Py_ssize_t idx
- * tup = index if isinstance(index, tuple) else (index,) # <<<<<<<<<<<<<<
- *
- * result = [slice(None)] * ndim
- */
- __pyx_t_2 = PyTuple_Check(__pyx_v_index);
- if (__pyx_t_2) {
- __Pyx_INCREF(((PyObject*)__pyx_v_index));
- __pyx_t_1 = __pyx_v_index;
- } else {
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 677, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_index);
- __Pyx_GIVEREF(__pyx_v_index);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
- __pyx_t_1 = __pyx_t_3;
- __pyx_t_3 = 0;
- }
- __pyx_v_tup = ((PyObject*)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "View.MemoryView":679
- * tup = index if isinstance(index, tuple) else (index,)
- *
- * result = [slice(None)] * ndim # <<<<<<<<<<<<<<
- * have_slices = False
- * seen_ellipsis = False
- */
- __pyx_t_1 = PyList_New(1 * ((__pyx_v_ndim<0) ? 0:__pyx_v_ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 679, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_1);
- { Py_ssize_t __pyx_temp;
- for (__pyx_temp=0; __pyx_temp < __pyx_v_ndim; __pyx_temp++) {
- __Pyx_INCREF(__pyx_slice__5);
- __Pyx_GIVEREF(__pyx_slice__5);
- PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_slice__5);
- }
- }
- __pyx_v_result = ((PyObject*)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "View.MemoryView":680
- *
- * result = [slice(None)] * ndim
- * have_slices = False # <<<<<<<<<<<<<<
- * seen_ellipsis = False
- * idx = 0
- */
- __pyx_v_have_slices = 0;
-
- /* "View.MemoryView":681
- * result = [slice(None)] * ndim
- * have_slices = False
- * seen_ellipsis = False # <<<<<<<<<<<<<<
- * idx = 0
- * for item in tup:
- */
- __pyx_v_seen_ellipsis = 0;
-
- /* "View.MemoryView":682
- * have_slices = False
- * seen_ellipsis = False
- * idx = 0 # <<<<<<<<<<<<<<
- * for item in tup:
- * if item is Ellipsis:
- */
- __pyx_v_idx = 0;
-
- /* "View.MemoryView":683
- * seen_ellipsis = False
- * idx = 0
- * for item in tup: # <<<<<<<<<<<<<<
- * if item is Ellipsis:
- * if not seen_ellipsis:
- */
- if (unlikely(__pyx_v_tup == Py_None)) {
- PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
- __PYX_ERR(1, 683, __pyx_L1_error)
- }
- __pyx_t_1 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
- for (;;) {
- if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(1, 683, __pyx_L1_error)
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 683, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- #endif
- __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "View.MemoryView":684
- * idx = 0
- * for item in tup:
- * if item is Ellipsis: # <<<<<<<<<<<<<<
- * if not seen_ellipsis:
- * idx += ndim - len(tup)
- */
- __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":685
- * for item in tup:
- * if item is Ellipsis:
- * if not seen_ellipsis: # <<<<<<<<<<<<<<
- * idx += ndim - len(tup)
- * seen_ellipsis = True
- */
- __pyx_t_2 = (!__pyx_v_seen_ellipsis);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":686
- * if item is Ellipsis:
- * if not seen_ellipsis:
- * idx += ndim - len(tup) # <<<<<<<<<<<<<<
- * seen_ellipsis = True
- * have_slices = True
- */
- if (unlikely(__pyx_v_tup == Py_None)) {
- PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
- __PYX_ERR(1, 686, __pyx_L1_error)
- }
- __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v_tup); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 686, __pyx_L1_error)
- __pyx_v_idx = (__pyx_v_idx + (__pyx_v_ndim - __pyx_t_5));
-
- /* "View.MemoryView":687
- * if not seen_ellipsis:
- * idx += ndim - len(tup)
- * seen_ellipsis = True # <<<<<<<<<<<<<<
- * have_slices = True
- * else:
- */
- __pyx_v_seen_ellipsis = 1;
-
- /* "View.MemoryView":685
- * for item in tup:
- * if item is Ellipsis:
- * if not seen_ellipsis: # <<<<<<<<<<<<<<
- * idx += ndim - len(tup)
- * seen_ellipsis = True
- */
- }
-
- /* "View.MemoryView":688
- * idx += ndim - len(tup)
- * seen_ellipsis = True
- * have_slices = True # <<<<<<<<<<<<<<
- * else:
- * if isinstance(item, slice):
- */
- __pyx_v_have_slices = 1;
-
- /* "View.MemoryView":684
- * idx = 0
- * for item in tup:
- * if item is Ellipsis: # <<<<<<<<<<<<<<
- * if not seen_ellipsis:
- * idx += ndim - len(tup)
- */
- goto __pyx_L5;
- }
-
- /* "View.MemoryView":690
- * have_slices = True
- * else:
- * if isinstance(item, slice): # <<<<<<<<<<<<<<
- * have_slices = True
- * elif not PyIndex_Check(item):
- */
- /*else*/ {
- __pyx_t_2 = PySlice_Check(__pyx_v_item);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":691
- * else:
- * if isinstance(item, slice):
- * have_slices = True # <<<<<<<<<<<<<<
- * elif not PyIndex_Check(item):
- * raise TypeError, f"Cannot index with type '{type(item)}'"
- */
- __pyx_v_have_slices = 1;
-
- /* "View.MemoryView":690
- * have_slices = True
- * else:
- * if isinstance(item, slice): # <<<<<<<<<<<<<<
- * have_slices = True
- * elif not PyIndex_Check(item):
- */
- goto __pyx_L7;
- }
-
- /* "View.MemoryView":692
- * if isinstance(item, slice):
- * have_slices = True
- * elif not PyIndex_Check(item): # <<<<<<<<<<<<<<
- * raise TypeError, f"Cannot index with type '{type(item)}'"
- * result[idx] = item
- */
- __pyx_t_2 = (!(PyIndex_Check(__pyx_v_item) != 0));
- if (unlikely(__pyx_t_2)) {
-
- /* "View.MemoryView":693
- * have_slices = True
- * elif not PyIndex_Check(item):
- * raise TypeError, f"Cannot index with type '{type(item)}'" # <<<<<<<<<<<<<<
- * result[idx] = item
- * idx += 1
- */
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 693, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = 0;
- __pyx_t_6 = 127;
- __Pyx_INCREF(__pyx_kp_u_Cannot_index_with_type);
- __pyx_t_5 += 24;
- __Pyx_GIVEREF(__pyx_kp_u_Cannot_index_with_type);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Cannot_index_with_type);
- __pyx_t_7 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_item)), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 693, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
- __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
- __pyx_t_7 = 0;
- __Pyx_INCREF(__pyx_kp_u__6);
- __pyx_t_5 += 1;
- __Pyx_GIVEREF(__pyx_kp_u__6);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__6);
- __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 693, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_7, 0, 0);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __PYX_ERR(1, 693, __pyx_L1_error)
-
- /* "View.MemoryView":692
- * if isinstance(item, slice):
- * have_slices = True
- * elif not PyIndex_Check(item): # <<<<<<<<<<<<<<
- * raise TypeError, f"Cannot index with type '{type(item)}'"
- * result[idx] = item
- */
- }
- __pyx_L7:;
-
- /* "View.MemoryView":694
- * elif not PyIndex_Check(item):
- * raise TypeError, f"Cannot index with type '{type(item)}'"
- * result[idx] = item # <<<<<<<<<<<<<<
- * idx += 1
- *
- */
- if (unlikely((__Pyx_SetItemInt(__pyx_v_result, __pyx_v_idx, __pyx_v_item, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0))) __PYX_ERR(1, 694, __pyx_L1_error)
- }
- __pyx_L5:;
-
- /* "View.MemoryView":695
- * raise TypeError, f"Cannot index with type '{type(item)}'"
- * result[idx] = item
- * idx += 1 # <<<<<<<<<<<<<<
- *
- * nslices = ndim - idx
- */
- __pyx_v_idx = (__pyx_v_idx + 1);
-
- /* "View.MemoryView":683
- * seen_ellipsis = False
- * idx = 0
- * for item in tup: # <<<<<<<<<<<<<<
- * if item is Ellipsis:
- * if not seen_ellipsis:
- */
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "View.MemoryView":697
- * idx += 1
- *
- * nslices = ndim - idx # <<<<<<<<<<<<<<
- * return have_slices or nslices, tuple(result)
- *
- */
- __pyx_v_nslices = (__pyx_v_ndim - __pyx_v_idx);
-
- /* "View.MemoryView":698
- *
- * nslices = ndim - idx
- * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
- *
- * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
- */
- __Pyx_XDECREF(__pyx_r);
- if (!__pyx_v_have_slices) {
- } else {
- __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_1 = __pyx_t_7;
- __pyx_t_7 = 0;
- goto __pyx_L9_bool_binop_done;
- }
- __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_1 = __pyx_t_7;
- __pyx_t_7 = 0;
- __pyx_L9_bool_binop_done:;
- __pyx_t_7 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 698, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
- __pyx_t_1 = 0;
- __pyx_t_7 = 0;
- __pyx_r = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- /* "View.MemoryView":671
- * return isinstance(o, memoryview)
- *
- * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
- * """
- * Replace all ellipses with full slices and fill incomplete indices with
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_tup);
- __Pyx_XDECREF(__pyx_v_result);
- __Pyx_XDECREF(__pyx_v_item);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":700
- * return have_slices or nslices, tuple(result)
- *
- * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<<
- * for suboffset in suboffsets[:ndim]:
- * if suboffset >= 0:
- */
-
-static int assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
- Py_ssize_t __pyx_v_suboffset;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- Py_ssize_t *__pyx_t_1;
- Py_ssize_t *__pyx_t_2;
- Py_ssize_t *__pyx_t_3;
- int __pyx_t_4;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
-
- /* "View.MemoryView":701
- *
- * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
- * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
- * if suboffset >= 0:
- * raise ValueError, "Indirect dimensions not supported"
- */
- __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
- for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
- __pyx_t_1 = __pyx_t_3;
- __pyx_v_suboffset = (__pyx_t_1[0]);
-
- /* "View.MemoryView":702
- * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
- * for suboffset in suboffsets[:ndim]:
- * if suboffset >= 0: # <<<<<<<<<<<<<<
- * raise ValueError, "Indirect dimensions not supported"
- * return 0 # return type just used as an error flag
- */
- __pyx_t_4 = (__pyx_v_suboffset >= 0);
- if (unlikely(__pyx_t_4)) {
-
- /* "View.MemoryView":703
- * for suboffset in suboffsets[:ndim]:
- * if suboffset >= 0:
- * raise ValueError, "Indirect dimensions not supported" # <<<<<<<<<<<<<<
- * return 0 # return type just used as an error flag
- *
- */
- __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Indirect_dimensions_not_supporte, 0, 0);
- __PYX_ERR(1, 703, __pyx_L1_error)
-
- /* "View.MemoryView":702
- * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
- * for suboffset in suboffsets[:ndim]:
- * if suboffset >= 0: # <<<<<<<<<<<<<<
- * raise ValueError, "Indirect dimensions not supported"
- * return 0 # return type just used as an error flag
- */
- }
- }
-
- /* "View.MemoryView":704
- * if suboffset >= 0:
- * raise ValueError, "Indirect dimensions not supported"
- * return 0 # return type just used as an error flag # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_r = 0;
- goto __pyx_L0;
-
- /* "View.MemoryView":700
- * return have_slices or nslices, tuple(result)
- *
- * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<<
- * for suboffset in suboffsets[:ndim]:
- * if suboffset >= 0:
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":711
- *
- * @cname('__pyx_memview_slice')
- * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
- * cdef int new_ndim = 0, suboffset_dim = -1, dim
- * cdef bint negative_step
- */
-
-static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
- int __pyx_v_new_ndim;
- int __pyx_v_suboffset_dim;
- int __pyx_v_dim;
- __Pyx_memviewslice __pyx_v_src;
- __Pyx_memviewslice __pyx_v_dst;
- __Pyx_memviewslice *__pyx_v_p_src;
- struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
- __Pyx_memviewslice *__pyx_v_p_dst;
- int *__pyx_v_p_suboffset_dim;
- Py_ssize_t __pyx_v_start;
- Py_ssize_t __pyx_v_stop;
- Py_ssize_t __pyx_v_step;
- Py_ssize_t __pyx_v_cindex;
- int __pyx_v_have_start;
- int __pyx_v_have_stop;
- int __pyx_v_have_step;
- PyObject *__pyx_v_index = NULL;
- struct __pyx_memoryview_obj *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- struct __pyx_memoryview_obj *__pyx_t_3;
- char *__pyx_t_4;
- int __pyx_t_5;
- Py_ssize_t __pyx_t_6;
- PyObject *(*__pyx_t_7)(PyObject *);
- PyObject *__pyx_t_8 = NULL;
- Py_ssize_t __pyx_t_9;
- int __pyx_t_10;
- Py_ssize_t __pyx_t_11;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("memview_slice", 0);
-
- /* "View.MemoryView":712
- * @cname('__pyx_memview_slice')
- * cdef memoryview memview_slice(memoryview memview, object indices):
- * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
- * cdef bint negative_step
- * cdef __Pyx_memviewslice src, dst
- */
- __pyx_v_new_ndim = 0;
- __pyx_v_suboffset_dim = -1;
-
- /* "View.MemoryView":719
- *
- *
- * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
- *
- * cdef _memoryviewslice memviewsliceobj
- */
- (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
-
- /* "View.MemoryView":723
- * cdef _memoryviewslice memviewsliceobj
- *
- * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
- *
- * if isinstance(memview, _memoryviewslice):
- */
- #ifndef CYTHON_WITHOUT_ASSERTIONS
- if (unlikely(__pyx_assertions_enabled())) {
- __pyx_t_1 = (__pyx_v_memview->view.ndim > 0);
- if (unlikely(!__pyx_t_1)) {
- __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
- __PYX_ERR(1, 723, __pyx_L1_error)
- }
- }
- #else
- if ((1)); else __PYX_ERR(1, 723, __pyx_L1_error)
- #endif
-
- /* "View.MemoryView":725
- * assert memview.view.ndim > 0
- *
- * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
- * memviewsliceobj = memview
- * p_src = &memviewsliceobj.from_slice
- */
- __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":726
- *
- * if isinstance(memview, _memoryviewslice):
- * memviewsliceobj = memview # <<<<<<<<<<<<<<
- * p_src = &memviewsliceobj.from_slice
- * else:
- */
- if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 726, __pyx_L1_error)
- __pyx_t_2 = ((PyObject *)__pyx_v_memview);
- __Pyx_INCREF(__pyx_t_2);
- __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "View.MemoryView":727
- * if isinstance(memview, _memoryviewslice):
- * memviewsliceobj = memview
- * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
- * else:
- * slice_copy(memview, &src)
- */
- __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
-
- /* "View.MemoryView":725
- * assert memview.view.ndim > 0
- *
- * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
- * memviewsliceobj = memview
- * p_src = &memviewsliceobj.from_slice
- */
- goto __pyx_L3;
- }
-
- /* "View.MemoryView":729
- * p_src = &memviewsliceobj.from_slice
- * else:
- * slice_copy(memview, &src) # <<<<<<<<<<<<<<
- * p_src = &src
- *
- */
- /*else*/ {
- __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
-
- /* "View.MemoryView":730
- * else:
- * slice_copy(memview, &src)
- * p_src = &src # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_v_p_src = (&__pyx_v_src);
- }
- __pyx_L3:;
-
- /* "View.MemoryView":736
- *
- *
- * dst.memview = p_src.memview # <<<<<<<<<<<<<<
- * dst.data = p_src.data
- *
- */
- __pyx_t_3 = __pyx_v_p_src->memview;
- __pyx_v_dst.memview = __pyx_t_3;
-
- /* "View.MemoryView":737
- *
- * dst.memview = p_src.memview
- * dst.data = p_src.data # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_4 = __pyx_v_p_src->data;
- __pyx_v_dst.data = __pyx_t_4;
-
- /* "View.MemoryView":742
- *
- *
- * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
- * cdef int *p_suboffset_dim = &suboffset_dim
- * cdef Py_ssize_t start, stop, step, cindex
- */
- __pyx_v_p_dst = (&__pyx_v_dst);
-
- /* "View.MemoryView":743
- *
- * cdef __Pyx_memviewslice *p_dst = &dst
- * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
- * cdef Py_ssize_t start, stop, step, cindex
- * cdef bint have_start, have_stop, have_step
- */
- __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
-
- /* "View.MemoryView":747
- * cdef bint have_start, have_stop, have_step
- *
- * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
- * if PyIndex_Check(index):
- * cindex = index
- */
- __pyx_t_5 = 0;
- if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
- __pyx_t_2 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
- __pyx_t_7 = NULL;
- } else {
- __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 747, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 747, __pyx_L1_error)
- }
- for (;;) {
- if (likely(!__pyx_t_7)) {
- if (likely(PyList_CheckExact(__pyx_t_2))) {
- if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
- #else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 747, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- #endif
- } else {
- if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
- #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
- __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
- #else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 747, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- #endif
- }
- } else {
- __pyx_t_8 = __pyx_t_7(__pyx_t_2);
- if (unlikely(!__pyx_t_8)) {
- PyObject* exc_type = PyErr_Occurred();
- if (exc_type) {
- if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else __PYX_ERR(1, 747, __pyx_L1_error)
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_8);
- }
- __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_8);
- __pyx_t_8 = 0;
- __pyx_v_dim = __pyx_t_5;
- __pyx_t_5 = (__pyx_t_5 + 1);
-
- /* "View.MemoryView":748
- *
- * for dim, index in enumerate(indices):
- * if PyIndex_Check(index): # <<<<<<<<<<<<<<
- * cindex = index
- * slice_memviewslice(
- */
- __pyx_t_1 = (PyIndex_Check(__pyx_v_index) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":749
- * for dim, index in enumerate(indices):
- * if PyIndex_Check(index):
- * cindex = index # <<<<<<<<<<<<<<
- * slice_memviewslice(
- * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
- */
- __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 749, __pyx_L1_error)
- __pyx_v_cindex = __pyx_t_9;
-
- /* "View.MemoryView":750
- * if PyIndex_Check(index):
- * cindex = index
- * slice_memviewslice( # <<<<<<<<<<<<<<
- * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
- * dim, new_ndim, p_suboffset_dim,
- */
- __pyx_t_10 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_cindex, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 750, __pyx_L1_error)
-
- /* "View.MemoryView":748
- *
- * for dim, index in enumerate(indices):
- * if PyIndex_Check(index): # <<<<<<<<<<<<<<
- * cindex = index
- * slice_memviewslice(
- */
- goto __pyx_L6;
- }
-
- /* "View.MemoryView":756
- * 0, 0, 0, # have_{start,stop,step}
- * False)
- * elif index is None: # <<<<<<<<<<<<<<
- * p_dst.shape[new_ndim] = 1
- * p_dst.strides[new_ndim] = 0
- */
- __pyx_t_1 = (__pyx_v_index == Py_None);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":757
- * False)
- * elif index is None:
- * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
- * p_dst.strides[new_ndim] = 0
- * p_dst.suboffsets[new_ndim] = -1
- */
- (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
-
- /* "View.MemoryView":758
- * elif index is None:
- * p_dst.shape[new_ndim] = 1
- * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
- * p_dst.suboffsets[new_ndim] = -1
- * new_ndim += 1
- */
- (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
-
- /* "View.MemoryView":759
- * p_dst.shape[new_ndim] = 1
- * p_dst.strides[new_ndim] = 0
- * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
- * new_ndim += 1
- * else:
- */
- (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
-
- /* "View.MemoryView":760
- * p_dst.strides[new_ndim] = 0
- * p_dst.suboffsets[new_ndim] = -1
- * new_ndim += 1 # <<<<<<<<<<<<<<
- * else:
- * start = index.start or 0
- */
- __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
-
- /* "View.MemoryView":756
- * 0, 0, 0, # have_{start,stop,step}
- * False)
- * elif index is None: # <<<<<<<<<<<<<<
- * p_dst.shape[new_ndim] = 1
- * p_dst.strides[new_ndim] = 0
- */
- goto __pyx_L6;
- }
-
- /* "View.MemoryView":762
- * new_ndim += 1
- * else:
- * start = index.start or 0 # <<<<<<<<<<<<<<
- * stop = index.stop or 0
- * step = index.step or 0
- */
- /*else*/ {
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 762, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 762, __pyx_L1_error)
- if (!__pyx_t_1) {
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- } else {
- __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
- __pyx_t_9 = __pyx_t_11;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- goto __pyx_L7_bool_binop_done;
- }
- __pyx_t_9 = 0;
- __pyx_L7_bool_binop_done:;
- __pyx_v_start = __pyx_t_9;
-
- /* "View.MemoryView":763
- * else:
- * start = index.start or 0
- * stop = index.stop or 0 # <<<<<<<<<<<<<<
- * step = index.step or 0
- *
- */
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 763, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 763, __pyx_L1_error)
- if (!__pyx_t_1) {
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- } else {
- __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 763, __pyx_L1_error)
- __pyx_t_9 = __pyx_t_11;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- goto __pyx_L9_bool_binop_done;
- }
- __pyx_t_9 = 0;
- __pyx_L9_bool_binop_done:;
- __pyx_v_stop = __pyx_t_9;
-
- /* "View.MemoryView":764
- * start = index.start or 0
- * stop = index.stop or 0
- * step = index.step or 0 # <<<<<<<<<<<<<<
- *
- * have_start = index.start is not None
- */
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 764, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 764, __pyx_L1_error)
- if (!__pyx_t_1) {
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- } else {
- __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 764, __pyx_L1_error)
- __pyx_t_9 = __pyx_t_11;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- goto __pyx_L11_bool_binop_done;
- }
- __pyx_t_9 = 0;
- __pyx_L11_bool_binop_done:;
- __pyx_v_step = __pyx_t_9;
-
- /* "View.MemoryView":766
- * step = index.step or 0
- *
- * have_start = index.start is not None # <<<<<<<<<<<<<<
- * have_stop = index.stop is not None
- * have_step = index.step is not None
- */
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 766, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_1 = (__pyx_t_8 != Py_None);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_v_have_start = __pyx_t_1;
-
- /* "View.MemoryView":767
- *
- * have_start = index.start is not None
- * have_stop = index.stop is not None # <<<<<<<<<<<<<<
- * have_step = index.step is not None
- *
- */
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 767, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_1 = (__pyx_t_8 != Py_None);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_v_have_stop = __pyx_t_1;
-
- /* "View.MemoryView":768
- * have_start = index.start is not None
- * have_stop = index.stop is not None
- * have_step = index.step is not None # <<<<<<<<<<<<<<
- *
- * slice_memviewslice(
- */
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 768, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_1 = (__pyx_t_8 != Py_None);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_v_have_step = __pyx_t_1;
-
- /* "View.MemoryView":770
- * have_step = index.step is not None
- *
- * slice_memviewslice( # <<<<<<<<<<<<<<
- * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
- * dim, new_ndim, p_suboffset_dim,
- */
- __pyx_t_10 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 770, __pyx_L1_error)
-
- /* "View.MemoryView":776
- * have_start, have_stop, have_step,
- * True)
- * new_ndim += 1 # <<<<<<<<<<<<<<
- *
- * if isinstance(memview, _memoryviewslice):
- */
- __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
- }
- __pyx_L6:;
-
- /* "View.MemoryView":747
- * cdef bint have_start, have_stop, have_step
- *
- * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
- * if PyIndex_Check(index):
- * cindex = index
- */
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "View.MemoryView":778
- * new_ndim += 1
- *
- * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
- * return memoryview_fromslice(dst, new_ndim,
- * memviewsliceobj.to_object_func,
- */
- __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":779
- *
- * if isinstance(memview, _memoryviewslice):
- * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
- * memviewsliceobj.to_object_func,
- * memviewsliceobj.to_dtype_func,
- */
- __Pyx_XDECREF((PyObject *)__pyx_r);
-
- /* "View.MemoryView":780
- * if isinstance(memview, _memoryviewslice):
- * return memoryview_fromslice(dst, new_ndim,
- * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
- * memviewsliceobj.to_dtype_func,
- * memview.dtype_is_object)
- */
- if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 780, __pyx_L1_error) }
-
- /* "View.MemoryView":781
- * return memoryview_fromslice(dst, new_ndim,
- * memviewsliceobj.to_object_func,
- * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
- * memview.dtype_is_object)
- * else:
- */
- if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 781, __pyx_L1_error) }
-
- /* "View.MemoryView":779
- *
- * if isinstance(memview, _memoryviewslice):
- * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
- * memviewsliceobj.to_object_func,
- * memviewsliceobj.to_dtype_func,
- */
- __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 779, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_memoryview_type))))) __PYX_ERR(1, 779, __pyx_L1_error)
- __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- /* "View.MemoryView":778
- * new_ndim += 1
- *
- * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
- * return memoryview_fromslice(dst, new_ndim,
- * memviewsliceobj.to_object_func,
- */
- }
-
- /* "View.MemoryView":784
- * memview.dtype_is_object)
- * else:
- * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
- * memview.dtype_is_object)
- *
- */
- /*else*/ {
- __Pyx_XDECREF((PyObject *)__pyx_r);
-
- /* "View.MemoryView":785
- * else:
- * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
- * memview.dtype_is_object) # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 784, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
-
- /* "View.MemoryView":784
- * memview.dtype_is_object)
- * else:
- * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
- * memview.dtype_is_object)
- *
- */
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_memoryview_type))))) __PYX_ERR(1, 784, __pyx_L1_error)
- __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
- __pyx_t_2 = 0;
- goto __pyx_L0;
- }
-
- /* "View.MemoryView":711
- *
- * @cname('__pyx_memview_slice')
- * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
- * cdef int new_ndim = 0, suboffset_dim = -1, dim
- * cdef bint negative_step
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
- __Pyx_XDECREF(__pyx_v_index);
- __Pyx_XGIVEREF((PyObject *)__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":793
- *
- * @cname('__pyx_memoryview_slice_memviewslice')
- * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
- * __Pyx_memviewslice *dst,
- * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
- */
-
-static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
- Py_ssize_t __pyx_v_new_shape;
- int __pyx_v_negative_step;
- int __pyx_r;
- int __pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save;
- #endif
-
- /* "View.MemoryView":813
- * cdef bint negative_step
- *
- * if not is_slice: # <<<<<<<<<<<<<<
- *
- * if start < 0:
- */
- __pyx_t_1 = (!__pyx_v_is_slice);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":815
- * if not is_slice:
- *
- * if start < 0: # <<<<<<<<<<<<<<
- * start += shape
- * if not 0 <= start < shape:
- */
- __pyx_t_1 = (__pyx_v_start < 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":816
- *
- * if start < 0:
- * start += shape # <<<<<<<<<<<<<<
- * if not 0 <= start < shape:
- * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
- */
- __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
-
- /* "View.MemoryView":815
- * if not is_slice:
- *
- * if start < 0: # <<<<<<<<<<<<<<
- * start += shape
- * if not 0 <= start < shape:
- */
- }
-
- /* "View.MemoryView":817
- * if start < 0:
- * start += shape
- * if not 0 <= start < shape: # <<<<<<<<<<<<<<
- * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
- * else:
- */
- __pyx_t_1 = (0 <= __pyx_v_start);
- if (__pyx_t_1) {
- __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
- }
- __pyx_t_2 = (!__pyx_t_1);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":818
- * start += shape
- * if not 0 <= start < shape:
- * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
- * else:
- *
- */
- __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_IndexError, __pyx_kp_s_Index_out_of_bounds_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 818, __pyx_L1_error)
-
- /* "View.MemoryView":817
- * if start < 0:
- * start += shape
- * if not 0 <= start < shape: # <<<<<<<<<<<<<<
- * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
- * else:
- */
- }
-
- /* "View.MemoryView":813
- * cdef bint negative_step
- *
- * if not is_slice: # <<<<<<<<<<<<<<
- *
- * if start < 0:
- */
- goto __pyx_L3;
- }
-
- /* "View.MemoryView":821
- * else:
- *
- * if have_step: # <<<<<<<<<<<<<<
- * negative_step = step < 0
- * if step == 0:
- */
- /*else*/ {
- __pyx_t_2 = (__pyx_v_have_step != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":822
- *
- * if have_step:
- * negative_step = step < 0 # <<<<<<<<<<<<<<
- * if step == 0:
- * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
- */
- __pyx_v_negative_step = (__pyx_v_step < 0);
-
- /* "View.MemoryView":823
- * if have_step:
- * negative_step = step < 0
- * if step == 0: # <<<<<<<<<<<<<<
- * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
- * else:
- */
- __pyx_t_2 = (__pyx_v_step == 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":824
- * negative_step = step < 0
- * if step == 0:
- * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
- * else:
- * negative_step = False
- */
- __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_ValueError, __pyx_kp_s_Step_may_not_be_zero_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 824, __pyx_L1_error)
-
- /* "View.MemoryView":823
- * if have_step:
- * negative_step = step < 0
- * if step == 0: # <<<<<<<<<<<<<<
- * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
- * else:
- */
- }
-
- /* "View.MemoryView":821
- * else:
- *
- * if have_step: # <<<<<<<<<<<<<<
- * negative_step = step < 0
- * if step == 0:
- */
- goto __pyx_L6;
- }
-
- /* "View.MemoryView":826
- * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
- * else:
- * negative_step = False # <<<<<<<<<<<<<<
- * step = 1
- *
- */
- /*else*/ {
- __pyx_v_negative_step = 0;
-
- /* "View.MemoryView":827
- * else:
- * negative_step = False
- * step = 1 # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_v_step = 1;
- }
- __pyx_L6:;
-
- /* "View.MemoryView":830
- *
- *
- * if have_start: # <<<<<<<<<<<<<<
- * if start < 0:
- * start += shape
- */
- __pyx_t_2 = (__pyx_v_have_start != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":831
- *
- * if have_start:
- * if start < 0: # <<<<<<<<<<<<<<
- * start += shape
- * if start < 0:
- */
- __pyx_t_2 = (__pyx_v_start < 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":832
- * if have_start:
- * if start < 0:
- * start += shape # <<<<<<<<<<<<<<
- * if start < 0:
- * start = 0
- */
- __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
-
- /* "View.MemoryView":833
- * if start < 0:
- * start += shape
- * if start < 0: # <<<<<<<<<<<<<<
- * start = 0
- * elif start >= shape:
- */
- __pyx_t_2 = (__pyx_v_start < 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":834
- * start += shape
- * if start < 0:
- * start = 0 # <<<<<<<<<<<<<<
- * elif start >= shape:
- * if negative_step:
- */
- __pyx_v_start = 0;
-
- /* "View.MemoryView":833
- * if start < 0:
- * start += shape
- * if start < 0: # <<<<<<<<<<<<<<
- * start = 0
- * elif start >= shape:
- */
- }
-
- /* "View.MemoryView":831
- *
- * if have_start:
- * if start < 0: # <<<<<<<<<<<<<<
- * start += shape
- * if start < 0:
- */
- goto __pyx_L9;
- }
-
- /* "View.MemoryView":835
- * if start < 0:
- * start = 0
- * elif start >= shape: # <<<<<<<<<<<<<<
- * if negative_step:
- * start = shape - 1
- */
- __pyx_t_2 = (__pyx_v_start >= __pyx_v_shape);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":836
- * start = 0
- * elif start >= shape:
- * if negative_step: # <<<<<<<<<<<<<<
- * start = shape - 1
- * else:
- */
- if (__pyx_v_negative_step) {
-
- /* "View.MemoryView":837
- * elif start >= shape:
- * if negative_step:
- * start = shape - 1 # <<<<<<<<<<<<<<
- * else:
- * start = shape
- */
- __pyx_v_start = (__pyx_v_shape - 1);
-
- /* "View.MemoryView":836
- * start = 0
- * elif start >= shape:
- * if negative_step: # <<<<<<<<<<<<<<
- * start = shape - 1
- * else:
- */
- goto __pyx_L11;
- }
-
- /* "View.MemoryView":839
- * start = shape - 1
- * else:
- * start = shape # <<<<<<<<<<<<<<
- * else:
- * if negative_step:
- */
- /*else*/ {
- __pyx_v_start = __pyx_v_shape;
- }
- __pyx_L11:;
-
- /* "View.MemoryView":835
- * if start < 0:
- * start = 0
- * elif start >= shape: # <<<<<<<<<<<<<<
- * if negative_step:
- * start = shape - 1
- */
- }
- __pyx_L9:;
-
- /* "View.MemoryView":830
- *
- *
- * if have_start: # <<<<<<<<<<<<<<
- * if start < 0:
- * start += shape
- */
- goto __pyx_L8;
- }
-
- /* "View.MemoryView":841
- * start = shape
- * else:
- * if negative_step: # <<<<<<<<<<<<<<
- * start = shape - 1
- * else:
- */
- /*else*/ {
- if (__pyx_v_negative_step) {
-
- /* "View.MemoryView":842
- * else:
- * if negative_step:
- * start = shape - 1 # <<<<<<<<<<<<<<
- * else:
- * start = 0
- */
- __pyx_v_start = (__pyx_v_shape - 1);
-
- /* "View.MemoryView":841
- * start = shape
- * else:
- * if negative_step: # <<<<<<<<<<<<<<
- * start = shape - 1
- * else:
- */
- goto __pyx_L12;
- }
-
- /* "View.MemoryView":844
- * start = shape - 1
- * else:
- * start = 0 # <<<<<<<<<<<<<<
- *
- * if have_stop:
- */
- /*else*/ {
- __pyx_v_start = 0;
- }
- __pyx_L12:;
- }
- __pyx_L8:;
-
- /* "View.MemoryView":846
- * start = 0
- *
- * if have_stop: # <<<<<<<<<<<<<<
- * if stop < 0:
- * stop += shape
- */
- __pyx_t_2 = (__pyx_v_have_stop != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":847
- *
- * if have_stop:
- * if stop < 0: # <<<<<<<<<<<<<<
- * stop += shape
- * if stop < 0:
- */
- __pyx_t_2 = (__pyx_v_stop < 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":848
- * if have_stop:
- * if stop < 0:
- * stop += shape # <<<<<<<<<<<<<<
- * if stop < 0:
- * stop = 0
- */
- __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
-
- /* "View.MemoryView":849
- * if stop < 0:
- * stop += shape
- * if stop < 0: # <<<<<<<<<<<<<<
- * stop = 0
- * elif stop > shape:
- */
- __pyx_t_2 = (__pyx_v_stop < 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":850
- * stop += shape
- * if stop < 0:
- * stop = 0 # <<<<<<<<<<<<<<
- * elif stop > shape:
- * stop = shape
- */
- __pyx_v_stop = 0;
-
- /* "View.MemoryView":849
- * if stop < 0:
- * stop += shape
- * if stop < 0: # <<<<<<<<<<<<<<
- * stop = 0
- * elif stop > shape:
- */
- }
-
- /* "View.MemoryView":847
- *
- * if have_stop:
- * if stop < 0: # <<<<<<<<<<<<<<
- * stop += shape
- * if stop < 0:
- */
- goto __pyx_L14;
- }
-
- /* "View.MemoryView":851
- * if stop < 0:
- * stop = 0
- * elif stop > shape: # <<<<<<<<<<<<<<
- * stop = shape
- * else:
- */
- __pyx_t_2 = (__pyx_v_stop > __pyx_v_shape);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":852
- * stop = 0
- * elif stop > shape:
- * stop = shape # <<<<<<<<<<<<<<
- * else:
- * if negative_step:
- */
- __pyx_v_stop = __pyx_v_shape;
-
- /* "View.MemoryView":851
- * if stop < 0:
- * stop = 0
- * elif stop > shape: # <<<<<<<<<<<<<<
- * stop = shape
- * else:
- */
- }
- __pyx_L14:;
-
- /* "View.MemoryView":846
- * start = 0
- *
- * if have_stop: # <<<<<<<<<<<<<<
- * if stop < 0:
- * stop += shape
- */
- goto __pyx_L13;
- }
-
- /* "View.MemoryView":854
- * stop = shape
- * else:
- * if negative_step: # <<<<<<<<<<<<<<
- * stop = -1
- * else:
- */
- /*else*/ {
- if (__pyx_v_negative_step) {
-
- /* "View.MemoryView":855
- * else:
- * if negative_step:
- * stop = -1 # <<<<<<<<<<<<<<
- * else:
- * stop = shape
- */
- __pyx_v_stop = -1L;
-
- /* "View.MemoryView":854
- * stop = shape
- * else:
- * if negative_step: # <<<<<<<<<<<<<<
- * stop = -1
- * else:
- */
- goto __pyx_L16;
- }
-
- /* "View.MemoryView":857
- * stop = -1
- * else:
- * stop = shape # <<<<<<<<<<<<<<
- *
- *
- */
- /*else*/ {
- __pyx_v_stop = __pyx_v_shape;
- }
- __pyx_L16:;
- }
- __pyx_L13:;
-
- /* "View.MemoryView":861
- *
- * with cython.cdivision(True):
- * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
- *
- * if (stop - start) - step * new_shape:
- */
- __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
-
- /* "View.MemoryView":863
- * new_shape = (stop - start) // step
- *
- * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
- * new_shape += 1
- *
- */
- __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":864
- *
- * if (stop - start) - step * new_shape:
- * new_shape += 1 # <<<<<<<<<<<<<<
- *
- * if new_shape < 0:
- */
- __pyx_v_new_shape = (__pyx_v_new_shape + 1);
-
- /* "View.MemoryView":863
- * new_shape = (stop - start) // step
- *
- * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
- * new_shape += 1
- *
- */
- }
-
- /* "View.MemoryView":866
- * new_shape += 1
- *
- * if new_shape < 0: # <<<<<<<<<<<<<<
- * new_shape = 0
- *
- */
- __pyx_t_2 = (__pyx_v_new_shape < 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":867
- *
- * if new_shape < 0:
- * new_shape = 0 # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_v_new_shape = 0;
-
- /* "View.MemoryView":866
- * new_shape += 1
- *
- * if new_shape < 0: # <<<<<<<<<<<<<<
- * new_shape = 0
- *
- */
- }
-
- /* "View.MemoryView":870
- *
- *
- * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
- * dst.shape[new_ndim] = new_shape
- * dst.suboffsets[new_ndim] = suboffset
- */
- (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
-
- /* "View.MemoryView":871
- *
- * dst.strides[new_ndim] = stride * step
- * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
- * dst.suboffsets[new_ndim] = suboffset
- *
- */
- (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
-
- /* "View.MemoryView":872
- * dst.strides[new_ndim] = stride * step
- * dst.shape[new_ndim] = new_shape
- * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
- *
- *
- */
- (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":875
- *
- *
- * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
- * dst.data += start * stride
- * else:
- */
- __pyx_t_2 = ((__pyx_v_suboffset_dim[0]) < 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":876
- *
- * if suboffset_dim[0] < 0:
- * dst.data += start * stride # <<<<<<<<<<<<<<
- * else:
- * dst.suboffsets[suboffset_dim[0]] += start * stride
- */
- __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
-
- /* "View.MemoryView":875
- *
- *
- * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
- * dst.data += start * stride
- * else:
- */
- goto __pyx_L19;
- }
-
- /* "View.MemoryView":878
- * dst.data += start * stride
- * else:
- * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
- *
- * if suboffset >= 0:
- */
- /*else*/ {
- __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
- (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
- }
- __pyx_L19:;
-
- /* "View.MemoryView":880
- * dst.suboffsets[suboffset_dim[0]] += start * stride
- *
- * if suboffset >= 0: # <<<<<<<<<<<<<<
- * if not is_slice:
- * if new_ndim == 0:
- */
- __pyx_t_2 = (__pyx_v_suboffset >= 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":881
- *
- * if suboffset >= 0:
- * if not is_slice: # <<<<<<<<<<<<<<
- * if new_ndim == 0:
- * dst.data = ( dst.data)[0] + suboffset
- */
- __pyx_t_2 = (!__pyx_v_is_slice);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":882
- * if suboffset >= 0:
- * if not is_slice:
- * if new_ndim == 0: # <<<<<<<<<<<<<<
- * dst.data = ( dst.data)[0] + suboffset
- * else:
- */
- __pyx_t_2 = (__pyx_v_new_ndim == 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":883
- * if not is_slice:
- * if new_ndim == 0:
- * dst.data = ( dst.data)[0] + suboffset # <<<<<<<<<<<<<<
- * else:
- * _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d "
- */
- __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
-
- /* "View.MemoryView":882
- * if suboffset >= 0:
- * if not is_slice:
- * if new_ndim == 0: # <<<<<<<<<<<<<<
- * dst.data = ( dst.data)[0] + suboffset
- * else:
- */
- goto __pyx_L22;
- }
-
- /* "View.MemoryView":885
- * dst.data = ( dst.data)[0] + suboffset
- * else:
- * _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
- * "must be indexed and not sliced", dim)
- * else:
- */
- /*else*/ {
-
- /* "View.MemoryView":886
- * else:
- * _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d "
- * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
- * else:
- * suboffset_dim[0] = new_ndim
- */
- __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_IndexError, __pyx_kp_s_All_dimensions_preceding_dimensi, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 885, __pyx_L1_error)
- }
- __pyx_L22:;
-
- /* "View.MemoryView":881
- *
- * if suboffset >= 0:
- * if not is_slice: # <<<<<<<<<<<<<<
- * if new_ndim == 0:
- * dst.data = ( dst.data)[0] + suboffset
- */
- goto __pyx_L21;
- }
-
- /* "View.MemoryView":888
- * "must be indexed and not sliced", dim)
- * else:
- * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
- *
- * return 0
- */
- /*else*/ {
- (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
- }
- __pyx_L21:;
-
- /* "View.MemoryView":880
- * dst.suboffsets[suboffset_dim[0]] += start * stride
- *
- * if suboffset >= 0: # <<<<<<<<<<<<<<
- * if not is_slice:
- * if new_ndim == 0:
- */
- }
-
- /* "View.MemoryView":890
- * suboffset_dim[0] = new_ndim
- *
- * return 0 # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_r = 0;
- goto __pyx_L0;
-
- /* "View.MemoryView":793
- *
- * @cname('__pyx_memoryview_slice_memviewslice')
- * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
- * __Pyx_memviewslice *dst,
- * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
- */
-
- /* function exit code */
- __pyx_L1_error:;
- #ifdef WITH_THREAD
- __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
- #endif
- __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- #ifdef WITH_THREAD
- __Pyx_PyGILState_Release(__pyx_gilstate_save);
- #endif
- __pyx_L0:;
- return __pyx_r;
-}
-
-/* "View.MemoryView":896
- *
- * @cname('__pyx_pybuffer_index')
- * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
- * Py_ssize_t dim) except NULL:
- * cdef Py_ssize_t shape, stride, suboffset = -1
- */
-
-static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
- Py_ssize_t __pyx_v_shape;
- Py_ssize_t __pyx_v_stride;
- Py_ssize_t __pyx_v_suboffset;
- Py_ssize_t __pyx_v_itemsize;
- char *__pyx_v_resultp;
- char *__pyx_r;
- __Pyx_RefNannyDeclarations
- Py_ssize_t __pyx_t_1;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- Py_UCS4 __pyx_t_4;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("pybuffer_index", 0);
-
- /* "View.MemoryView":898
- * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
- * Py_ssize_t dim) except NULL:
- * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
- * cdef Py_ssize_t itemsize = view.itemsize
- * cdef char *resultp
- */
- __pyx_v_suboffset = -1L;
-
- /* "View.MemoryView":899
- * Py_ssize_t dim) except NULL:
- * cdef Py_ssize_t shape, stride, suboffset = -1
- * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
- * cdef char *resultp
- *
- */
- __pyx_t_1 = __pyx_v_view->itemsize;
- __pyx_v_itemsize = __pyx_t_1;
-
- /* "View.MemoryView":902
- * cdef char *resultp
- *
- * if view.ndim == 0: # <<<<<<<<<<<<<<
- * shape = view.len // itemsize
- * stride = itemsize
- */
- __pyx_t_2 = (__pyx_v_view->ndim == 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":903
- *
- * if view.ndim == 0:
- * shape = view.len // itemsize # <<<<<<<<<<<<<<
- * stride = itemsize
- * else:
- */
- if (unlikely(__pyx_v_itemsize == 0)) {
- PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
- __PYX_ERR(1, 903, __pyx_L1_error)
- }
- else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
- PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
- __PYX_ERR(1, 903, __pyx_L1_error)
- }
- __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
-
- /* "View.MemoryView":904
- * if view.ndim == 0:
- * shape = view.len // itemsize
- * stride = itemsize # <<<<<<<<<<<<<<
- * else:
- * shape = view.shape[dim]
- */
- __pyx_v_stride = __pyx_v_itemsize;
-
- /* "View.MemoryView":902
- * cdef char *resultp
- *
- * if view.ndim == 0: # <<<<<<<<<<<<<<
- * shape = view.len // itemsize
- * stride = itemsize
- */
- goto __pyx_L3;
- }
-
- /* "View.MemoryView":906
- * stride = itemsize
- * else:
- * shape = view.shape[dim] # <<<<<<<<<<<<<<
- * stride = view.strides[dim]
- * if view.suboffsets != NULL:
- */
- /*else*/ {
- __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
-
- /* "View.MemoryView":907
- * else:
- * shape = view.shape[dim]
- * stride = view.strides[dim] # <<<<<<<<<<<<<<
- * if view.suboffsets != NULL:
- * suboffset = view.suboffsets[dim]
- */
- __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
-
- /* "View.MemoryView":908
- * shape = view.shape[dim]
- * stride = view.strides[dim]
- * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
- * suboffset = view.suboffsets[dim]
- *
- */
- __pyx_t_2 = (__pyx_v_view->suboffsets != NULL);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":909
- * stride = view.strides[dim]
- * if view.suboffsets != NULL:
- * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
- *
- * if index < 0:
- */
- __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
-
- /* "View.MemoryView":908
- * shape = view.shape[dim]
- * stride = view.strides[dim]
- * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
- * suboffset = view.suboffsets[dim]
- *
- */
- }
- }
- __pyx_L3:;
-
- /* "View.MemoryView":911
- * suboffset = view.suboffsets[dim]
- *
- * if index < 0: # <<<<<<<<<<<<<<
- * index += view.shape[dim]
- * if index < 0:
- */
- __pyx_t_2 = (__pyx_v_index < 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":912
- *
- * if index < 0:
- * index += view.shape[dim] # <<<<<<<<<<<<<<
- * if index < 0:
- * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
- */
- __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
-
- /* "View.MemoryView":913
- * if index < 0:
- * index += view.shape[dim]
- * if index < 0: # <<<<<<<<<<<<<<
- * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
- *
- */
- __pyx_t_2 = (__pyx_v_index < 0);
- if (unlikely(__pyx_t_2)) {
-
- /* "View.MemoryView":914
- * index += view.shape[dim]
- * if index < 0:
- * raise IndexError, f"Out of bounds on buffer access (axis {dim})" # <<<<<<<<<<<<<<
- *
- * if index >= shape:
- */
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = 0;
- __pyx_t_4 = 127;
- __Pyx_INCREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
- __pyx_t_1 += 37;
- __Pyx_GIVEREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Out_of_bounds_on_buffer_access_a);
- __pyx_t_5 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 914, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
- __pyx_t_5 = 0;
- __Pyx_INCREF(__pyx_kp_u__7);
- __pyx_t_1 += 1;
- __Pyx_GIVEREF(__pyx_kp_u__7);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__7);
- __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 914, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_5, 0, 0);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __PYX_ERR(1, 914, __pyx_L1_error)
-
- /* "View.MemoryView":913
- * if index < 0:
- * index += view.shape[dim]
- * if index < 0: # <<<<<<<<<<<<<<
- * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
- *
- */
- }
-
- /* "View.MemoryView":911
- * suboffset = view.suboffsets[dim]
- *
- * if index < 0: # <<<<<<<<<<<<<<
- * index += view.shape[dim]
- * if index < 0:
- */
- }
-
- /* "View.MemoryView":916
- * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
- *
- * if index >= shape: # <<<<<<<<<<<<<<
- * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
- *
- */
- __pyx_t_2 = (__pyx_v_index >= __pyx_v_shape);
- if (unlikely(__pyx_t_2)) {
-
- /* "View.MemoryView":917
- *
- * if index >= shape:
- * raise IndexError, f"Out of bounds on buffer access (axis {dim})" # <<<<<<<<<<<<<<
- *
- * resultp = bufp + index * stride
- */
- __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 917, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = 0;
- __pyx_t_4 = 127;
- __Pyx_INCREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
- __pyx_t_1 += 37;
- __Pyx_GIVEREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_Out_of_bounds_on_buffer_access_a);
- __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
- __pyx_t_3 = 0;
- __Pyx_INCREF(__pyx_kp_u__7);
- __pyx_t_1 += 1;
- __Pyx_GIVEREF(__pyx_kp_u__7);
- PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u__7);
- __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_3, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __PYX_ERR(1, 917, __pyx_L1_error)
-
- /* "View.MemoryView":916
- * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
- *
- * if index >= shape: # <<<<<<<<<<<<<<
- * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
- *
- */
- }
-
- /* "View.MemoryView":919
- * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
- *
- * resultp = bufp + index * stride # <<<<<<<<<<<<<<
- * if suboffset >= 0:
- * resultp = ( resultp)[0] + suboffset
- */
- __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
-
- /* "View.MemoryView":920
- *
- * resultp = bufp + index * stride
- * if suboffset >= 0: # <<<<<<<<<<<<<<
- * resultp = ( resultp)[0] + suboffset
- *
- */
- __pyx_t_2 = (__pyx_v_suboffset >= 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":921
- * resultp = bufp + index * stride
- * if suboffset >= 0:
- * resultp = ( resultp)[0] + suboffset # <<<<<<<<<<<<<<
- *
- * return resultp
- */
- __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
-
- /* "View.MemoryView":920
- *
- * resultp = bufp + index * stride
- * if suboffset >= 0: # <<<<<<<<<<<<<<
- * resultp = ( resultp)[0] + suboffset
- *
- */
- }
-
- /* "View.MemoryView":923
- * resultp = ( resultp)[0] + suboffset
- *
- * return resultp # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_r = __pyx_v_resultp;
- goto __pyx_L0;
-
- /* "View.MemoryView":896
- *
- * @cname('__pyx_pybuffer_index')
- * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
- * Py_ssize_t dim) except NULL:
- * cdef Py_ssize_t shape, stride, suboffset = -1
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":929
- *
- * @cname('__pyx_memslice_transpose')
- * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil: # <<<<<<<<<<<<<<
- * cdef int ndim = memslice.memview.view.ndim
- *
- */
-
-static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
- int __pyx_v_ndim;
- Py_ssize_t *__pyx_v_shape;
- Py_ssize_t *__pyx_v_strides;
- int __pyx_v_i;
- int __pyx_v_j;
- int __pyx_r;
- int __pyx_t_1;
- Py_ssize_t *__pyx_t_2;
- long __pyx_t_3;
- long __pyx_t_4;
- Py_ssize_t __pyx_t_5;
- Py_ssize_t __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- int __pyx_t_9;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save;
- #endif
-
- /* "View.MemoryView":930
- * @cname('__pyx_memslice_transpose')
- * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
- * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
- *
- * cdef Py_ssize_t *shape = memslice.shape
- */
- __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
- __pyx_v_ndim = __pyx_t_1;
-
- /* "View.MemoryView":932
- * cdef int ndim = memslice.memview.view.ndim
- *
- * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
- * cdef Py_ssize_t *strides = memslice.strides
- *
- */
- __pyx_t_2 = __pyx_v_memslice->shape;
- __pyx_v_shape = __pyx_t_2;
-
- /* "View.MemoryView":933
- *
- * cdef Py_ssize_t *shape = memslice.shape
- * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_2 = __pyx_v_memslice->strides;
- __pyx_v_strides = __pyx_t_2;
-
- /* "View.MemoryView":937
- *
- * cdef int i, j
- * for i in range(ndim // 2): # <<<<<<<<<<<<<<
- * j = ndim - 1 - i
- * strides[i], strides[j] = strides[j], strides[i]
- */
- __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
- __pyx_t_4 = __pyx_t_3;
- for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
- __pyx_v_i = __pyx_t_1;
-
- /* "View.MemoryView":938
- * cdef int i, j
- * for i in range(ndim // 2):
- * j = ndim - 1 - i # <<<<<<<<<<<<<<
- * strides[i], strides[j] = strides[j], strides[i]
- * shape[i], shape[j] = shape[j], shape[i]
- */
- __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
-
- /* "View.MemoryView":939
- * for i in range(ndim // 2):
- * j = ndim - 1 - i
- * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
- * shape[i], shape[j] = shape[j], shape[i]
- *
- */
- __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
- __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
- (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
- (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
-
- /* "View.MemoryView":940
- * j = ndim - 1 - i
- * strides[i], strides[j] = strides[j], strides[i]
- * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
- *
- * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
- */
- __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
- __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
- (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
- (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
-
- /* "View.MemoryView":942
- * shape[i], shape[j] = shape[j], shape[i]
- *
- * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
- * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
- *
- */
- __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0);
- if (!__pyx_t_8) {
- } else {
- __pyx_t_7 = __pyx_t_8;
- goto __pyx_L6_bool_binop_done;
- }
- __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0);
- __pyx_t_7 = __pyx_t_8;
- __pyx_L6_bool_binop_done:;
- if (__pyx_t_7) {
-
- /* "View.MemoryView":943
- *
- * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
- * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
- *
- * return 0
- */
- __pyx_t_9 = __pyx_memoryview_err(PyExc_ValueError, __pyx_kp_s_Cannot_transpose_memoryview_with); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 943, __pyx_L1_error)
-
- /* "View.MemoryView":942
- * shape[i], shape[j] = shape[j], shape[i]
- *
- * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
- * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
- *
- */
- }
- }
-
- /* "View.MemoryView":945
- * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
- *
- * return 0 # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_r = 0;
- goto __pyx_L0;
-
- /* "View.MemoryView":929
- *
- * @cname('__pyx_memslice_transpose')
- * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil: # <<<<<<<<<<<<<<
- * cdef int ndim = memslice.memview.view.ndim
- *
- */
-
- /* function exit code */
- __pyx_L1_error:;
- #ifdef WITH_THREAD
- __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
- #endif
- __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- #ifdef WITH_THREAD
- __Pyx_PyGILState_Release(__pyx_gilstate_save);
- #endif
- __pyx_L0:;
- return __pyx_r;
-}
-
-/* "View.MemoryView":963
- * cdef int (*to_dtype_func)(char *, object) except 0
- *
- * def __dealloc__(self): # <<<<<<<<<<<<<<
- * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
- *
- */
-
-/* Python wrapper */
-static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
- __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
-}
-
-static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__dealloc__", 0);
-
- /* "View.MemoryView":964
- *
- * def __dealloc__(self):
- * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
- *
- * cdef convert_item_to_object(self, char *itemp):
- */
- __PYX_XCLEAR_MEMVIEW((&__pyx_v_self->from_slice), 1);
-
- /* "View.MemoryView":963
- * cdef int (*to_dtype_func)(char *, object) except 0
- *
- * def __dealloc__(self): # <<<<<<<<<<<<<<
- * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
- *
- */
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
-}
-
-/* "View.MemoryView":966
- * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
- *
- * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
- * if self.to_object_func != NULL:
- * return self.to_object_func(itemp)
- */
-
-static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("convert_item_to_object", 0);
-
- /* "View.MemoryView":967
- *
- * cdef convert_item_to_object(self, char *itemp):
- * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
- * return self.to_object_func(itemp)
- * else:
- */
- __pyx_t_1 = (__pyx_v_self->to_object_func != NULL);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":968
- * cdef convert_item_to_object(self, char *itemp):
- * if self.to_object_func != NULL:
- * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
- * else:
- * return memoryview.convert_item_to_object(self, itemp)
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 968, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- /* "View.MemoryView":967
- *
- * cdef convert_item_to_object(self, char *itemp):
- * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
- * return self.to_object_func(itemp)
- * else:
- */
- }
-
- /* "View.MemoryView":970
- * return self.to_object_func(itemp)
- * else:
- * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
- *
- * cdef assign_item_from_object(self, char *itemp, object value):
- */
- /*else*/ {
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 970, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- }
-
- /* "View.MemoryView":966
- * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
- *
- * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
- * if self.to_object_func != NULL:
- * return self.to_object_func(itemp)
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":972
- * return memoryview.convert_item_to_object(self, itemp)
- *
- * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
- * if self.to_dtype_func != NULL:
- * self.to_dtype_func(itemp, value)
- */
-
-static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("assign_item_from_object", 0);
-
- /* "View.MemoryView":973
- *
- * cdef assign_item_from_object(self, char *itemp, object value):
- * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
- * self.to_dtype_func(itemp, value)
- * else:
- */
- __pyx_t_1 = (__pyx_v_self->to_dtype_func != NULL);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":974
- * cdef assign_item_from_object(self, char *itemp, object value):
- * if self.to_dtype_func != NULL:
- * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
- * else:
- * memoryview.assign_item_from_object(self, itemp, value)
- */
- __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 974, __pyx_L1_error)
-
- /* "View.MemoryView":973
- *
- * cdef assign_item_from_object(self, char *itemp, object value):
- * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
- * self.to_dtype_func(itemp, value)
- * else:
- */
- goto __pyx_L3;
- }
-
- /* "View.MemoryView":976
- * self.to_dtype_func(itemp, value)
- * else:
- * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
- *
- * cdef _get_base(self):
- */
- /*else*/ {
- __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 976, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":972
- * return memoryview.convert_item_to_object(self, itemp)
- *
- * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
- * if self.to_dtype_func != NULL:
- * self.to_dtype_func(itemp, value)
- */
-
- /* function exit code */
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":978
- * memoryview.assign_item_from_object(self, itemp, value)
- *
- * cdef _get_base(self): # <<<<<<<<<<<<<<
- * return self.from_object
- *
- */
-
-static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("_get_base", 0);
-
- /* "View.MemoryView":979
- *
- * cdef _get_base(self):
- * return self.from_object # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_self->from_object);
- __pyx_r = __pyx_v_self->from_object;
- goto __pyx_L0;
-
- /* "View.MemoryView":978
- * memoryview.assign_item_from_object(self, itemp, value)
- *
- * cdef _get_base(self): # <<<<<<<<<<<<<<
- * return self.from_object
- *
- */
-
- /* function exit code */
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "(tree fragment)":1
- * def __reduce_cython__(self): # <<<<<<<<<<<<<<
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
- * def __setstate_cython__(self, __pyx_state):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-) {
- #if !CYTHON_METH_FASTCALL
- CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
- #endif
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
- if (unlikely(__pyx_nargs > 0)) {
- __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
- if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
- __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__reduce_cython__", 0);
-
- /* "(tree fragment)":2
- * def __reduce_cython__(self):
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
- * def __setstate_cython__(self, __pyx_state):
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
- */
- __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
- __PYX_ERR(1, 2, __pyx_L1_error)
-
- /* "(tree fragment)":1
- * def __reduce_cython__(self): # <<<<<<<<<<<<<<
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
- * def __setstate_cython__(self, __pyx_state):
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "(tree fragment)":3
- * def __reduce_cython__(self):
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
- * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-); /*proto*/
-static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
-#if CYTHON_METH_FASTCALL
-PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
-#else
-PyObject *__pyx_args, PyObject *__pyx_kwds
-#endif
-) {
- CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
- #if !CYTHON_METH_FASTCALL
- CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
- #endif
- CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
- {
- PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
- PyObject* values[1] = {0};
- if (__pyx_kwds) {
- Py_ssize_t kw_args;
- switch (__pyx_nargs) {
- case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
- CYTHON_FALLTHROUGH;
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
- switch (__pyx_nargs) {
- case 0:
- if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--;
- else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
- else goto __pyx_L5_argtuple_error;
- }
- if (unlikely(kw_args > 0)) {
- const Py_ssize_t kwd_pos_args = __pyx_nargs;
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
- }
- } else if (unlikely(__pyx_nargs != 1)) {
- goto __pyx_L5_argtuple_error;
- } else {
- values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
- }
- __pyx_v___pyx_state = values[0];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
- __pyx_L3_error:;
- __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), __pyx_v___pyx_state);
-
- /* function exit code */
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__setstate_cython__", 0);
-
- /* "(tree fragment)":4
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
- * def __setstate_cython__(self, __pyx_state):
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
- */
- __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
- __PYX_ERR(1, 4, __pyx_L1_error)
-
- /* "(tree fragment)":3
- * def __reduce_cython__(self):
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
- * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
- * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":999
- *
- * @cname('__pyx_memoryview_fromslice')
- * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
- * int ndim,
- * object (*to_object_func)(char *),
- */
-
-static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
- struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
- Py_ssize_t __pyx_v_suboffset;
- PyObject *__pyx_v_length = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- __Pyx_TypeInfo *__pyx_t_4;
- Py_buffer __pyx_t_5;
- Py_ssize_t *__pyx_t_6;
- Py_ssize_t *__pyx_t_7;
- Py_ssize_t *__pyx_t_8;
- Py_ssize_t __pyx_t_9;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
-
- /* "View.MemoryView":1007
- * cdef _memoryviewslice result
- *
- * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
- * return None
- *
- */
- __pyx_t_1 = (((PyObject *)__pyx_v_memviewslice.memview) == Py_None);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":1008
- *
- * if memviewslice.memview == Py_None:
- * return None # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
-
- /* "View.MemoryView":1007
- * cdef _memoryviewslice result
- *
- * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
- * return None
- *
- */
- }
-
- /* "View.MemoryView":1013
- *
- *
- * result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object) # <<<<<<<<<<<<<<
- *
- * result.from_slice = memviewslice
- */
- __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(Py_None);
- __Pyx_GIVEREF(Py_None);
- PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
- __Pyx_INCREF(__pyx_int_0);
- __Pyx_GIVEREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = ((PyObject *)__pyx_tp_new__memoryviewslice(((PyTypeObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
- __Pyx_GOTREF((PyObject *)__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "View.MemoryView":1015
- * result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object)
- *
- * result.from_slice = memviewslice # <<<<<<<<<<<<<<
- * __PYX_INC_MEMVIEW(&memviewslice, 1)
- *
- */
- __pyx_v_result->from_slice = __pyx_v_memviewslice;
-
- /* "View.MemoryView":1016
- *
- * result.from_slice = memviewslice
- * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
- *
- * result.from_object = ( memviewslice.memview)._get_base()
- */
- __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
-
- /* "View.MemoryView":1018
- * __PYX_INC_MEMVIEW(&memviewslice, 1)
- *
- * result.from_object = ( memviewslice.memview)._get_base() # <<<<<<<<<<<<<<
- * result.typeinfo = memviewslice.memview.typeinfo
- *
- */
- __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->__pyx_vtab)->_get_base(((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __Pyx_GOTREF(__pyx_v_result->from_object);
- __Pyx_DECREF(__pyx_v_result->from_object);
- __pyx_v_result->from_object = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "View.MemoryView":1019
- *
- * result.from_object = ( memviewslice.memview)._get_base()
- * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
- *
- * result.view = memviewslice.memview.view
- */
- __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
- __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
-
- /* "View.MemoryView":1021
- * result.typeinfo = memviewslice.memview.typeinfo
- *
- * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
- * result.view.buf = memviewslice.data
- * result.view.ndim = ndim
- */
- __pyx_t_5 = __pyx_v_memviewslice.memview->view;
- __pyx_v_result->__pyx_base.view = __pyx_t_5;
-
- /* "View.MemoryView":1022
- *
- * result.view = memviewslice.memview.view
- * result.view.buf = memviewslice.data # <<<<<<<<<<<<<<
- * result.view.ndim = ndim
- * (<__pyx_buffer *> &result.view).obj = Py_None
- */
- __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
-
- /* "View.MemoryView":1023
- * result.view = memviewslice.memview.view
- * result.view.buf = memviewslice.data
- * result.view.ndim = ndim # <<<<<<<<<<<<<<
- * (<__pyx_buffer *> &result.view).obj = Py_None
- * Py_INCREF(Py_None)
- */
- __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
-
- /* "View.MemoryView":1024
- * result.view.buf = memviewslice.data
- * result.view.ndim = ndim
- * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
- * Py_INCREF(Py_None)
- *
- */
- ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
-
- /* "View.MemoryView":1025
- * result.view.ndim = ndim
- * (<__pyx_buffer *> &result.view).obj = Py_None
- * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
- *
- * if (memviewslice.memview).flags & PyBUF_WRITABLE:
- */
- Py_INCREF(Py_None);
-
- /* "View.MemoryView":1027
- * Py_INCREF(Py_None)
- *
- * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
- * result.flags = PyBUF_RECORDS
- * else:
- */
- __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":1028
- *
- * if (memviewslice.memview).flags & PyBUF_WRITABLE:
- * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
- * else:
- * result.flags = PyBUF_RECORDS_RO
- */
- __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
-
- /* "View.MemoryView":1027
- * Py_INCREF(Py_None)
- *
- * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
- * result.flags = PyBUF_RECORDS
- * else:
- */
- goto __pyx_L4;
- }
-
- /* "View.MemoryView":1030
- * result.flags = PyBUF_RECORDS
- * else:
- * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
- *
- * result.view.shape = result.from_slice.shape
- */
- /*else*/ {
- __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
- }
- __pyx_L4:;
-
- /* "View.MemoryView":1032
- * result.flags = PyBUF_RECORDS_RO
- *
- * result.view.shape = result.from_slice.shape # <<<<<<<<<<<<<<
- * result.view.strides = result.from_slice.strides
- *
- */
- __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
-
- /* "View.MemoryView":1033
- *
- * result.view.shape = result.from_slice.shape
- * result.view.strides = result.from_slice.strides # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
-
- /* "View.MemoryView":1036
- *
- *
- * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
- * for suboffset in result.from_slice.suboffsets[:ndim]:
- * if suboffset >= 0:
- */
- __pyx_v_result->__pyx_base.view.suboffsets = NULL;
-
- /* "View.MemoryView":1037
- *
- * result.view.suboffsets = NULL
- * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
- * if suboffset >= 0:
- * result.view.suboffsets = result.from_slice.suboffsets
- */
- __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
- for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
- __pyx_t_6 = __pyx_t_8;
- __pyx_v_suboffset = (__pyx_t_6[0]);
-
- /* "View.MemoryView":1038
- * result.view.suboffsets = NULL
- * for suboffset in result.from_slice.suboffsets[:ndim]:
- * if suboffset >= 0: # <<<<<<<<<<<<<<
- * result.view.suboffsets = result.from_slice.suboffsets
- * break
- */
- __pyx_t_1 = (__pyx_v_suboffset >= 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":1039
- * for suboffset in result.from_slice.suboffsets[:ndim]:
- * if suboffset >= 0:
- * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<<
- * break
- *
- */
- __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
-
- /* "View.MemoryView":1040
- * if suboffset >= 0:
- * result.view.suboffsets = result.from_slice.suboffsets
- * break # <<<<<<<<<<<<<<
- *
- * result.view.len = result.view.itemsize
- */
- goto __pyx_L6_break;
-
- /* "View.MemoryView":1038
- * result.view.suboffsets = NULL
- * for suboffset in result.from_slice.suboffsets[:ndim]:
- * if suboffset >= 0: # <<<<<<<<<<<<<<
- * result.view.suboffsets = result.from_slice.suboffsets
- * break
- */
- }
- }
- __pyx_L6_break:;
-
- /* "View.MemoryView":1042
- * break
- *
- * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
- * for length in result.view.shape[:ndim]:
- * result.view.len *= length
- */
- __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
- __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
-
- /* "View.MemoryView":1043
- *
- * result.view.len = result.view.itemsize
- * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
- * result.view.len *= length
- *
- */
- __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
- for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
- __pyx_t_6 = __pyx_t_8;
- __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "View.MemoryView":1044
- * result.view.len = result.view.itemsize
- * for length in result.view.shape[:ndim]:
- * result.view.len *= length # <<<<<<<<<<<<<<
- *
- * result.to_object_func = to_object_func
- */
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
- }
-
- /* "View.MemoryView":1046
- * result.view.len *= length
- *
- * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
- * result.to_dtype_func = to_dtype_func
- *
- */
- __pyx_v_result->to_object_func = __pyx_v_to_object_func;
-
- /* "View.MemoryView":1047
- *
- * result.to_object_func = to_object_func
- * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
- *
- * return result
- */
- __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
-
- /* "View.MemoryView":1049
- * result.to_dtype_func = to_dtype_func
- *
- * return result # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview_get_slice_from_memoryview')
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF((PyObject *)__pyx_v_result);
- __pyx_r = ((PyObject *)__pyx_v_result);
- goto __pyx_L0;
-
- /* "View.MemoryView":999
- *
- * @cname('__pyx_memoryview_fromslice')
- * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
- * int ndim,
- * object (*to_object_func)(char *),
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
- __Pyx_XDECREF(__pyx_v_length);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":1052
- *
- * @cname('__pyx_memoryview_get_slice_from_memoryview')
- * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
- * __Pyx_memviewslice *mslice) except NULL:
- * cdef _memoryviewslice obj
- */
-
-static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
- struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
- __Pyx_memviewslice *__pyx_r;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
-
- /* "View.MemoryView":1055
- * __Pyx_memviewslice *mslice) except NULL:
- * cdef _memoryviewslice obj
- * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
- * obj = memview
- * return &obj.from_slice
- */
- __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":1056
- * cdef _memoryviewslice obj
- * if isinstance(memview, _memoryviewslice):
- * obj = memview # <<<<<<<<<<<<<<
- * return &obj.from_slice
- * else:
- */
- if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
- __pyx_t_2 = ((PyObject *)__pyx_v_memview);
- __Pyx_INCREF(__pyx_t_2);
- __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "View.MemoryView":1057
- * if isinstance(memview, _memoryviewslice):
- * obj = memview
- * return &obj.from_slice # <<<<<<<<<<<<<<
- * else:
- * slice_copy(memview, mslice)
- */
- __pyx_r = (&__pyx_v_obj->from_slice);
- goto __pyx_L0;
-
- /* "View.MemoryView":1055
- * __Pyx_memviewslice *mslice) except NULL:
- * cdef _memoryviewslice obj
- * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
- * obj = memview
- * return &obj.from_slice
- */
- }
-
- /* "View.MemoryView":1059
- * return &obj.from_slice
- * else:
- * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
- * return mslice
- *
- */
- /*else*/ {
- __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
-
- /* "View.MemoryView":1060
- * else:
- * slice_copy(memview, mslice)
- * return mslice # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview_slice_copy')
- */
- __pyx_r = __pyx_v_mslice;
- goto __pyx_L0;
- }
-
- /* "View.MemoryView":1052
- *
- * @cname('__pyx_memoryview_get_slice_from_memoryview')
- * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
- * __Pyx_memviewslice *mslice) except NULL:
- * cdef _memoryviewslice obj
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_obj);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":1063
- *
- * @cname('__pyx_memoryview_slice_copy')
- * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept: # <<<<<<<<<<<<<<
- * cdef int dim
- * cdef (Py_ssize_t*) shape, strides, suboffsets
- */
-
-static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
- int __pyx_v_dim;
- Py_ssize_t *__pyx_v_shape;
- Py_ssize_t *__pyx_v_strides;
- Py_ssize_t *__pyx_v_suboffsets;
- __Pyx_RefNannyDeclarations
- Py_ssize_t *__pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
- int __pyx_t_4;
- Py_ssize_t __pyx_t_5;
- __Pyx_RefNannySetupContext("slice_copy", 0);
-
- /* "View.MemoryView":1067
- * cdef (Py_ssize_t*) shape, strides, suboffsets
- *
- * shape = memview.view.shape # <<<<<<<<<<<<<<
- * strides = memview.view.strides
- * suboffsets = memview.view.suboffsets
- */
- __pyx_t_1 = __pyx_v_memview->view.shape;
- __pyx_v_shape = __pyx_t_1;
-
- /* "View.MemoryView":1068
- *
- * shape = memview.view.shape
- * strides = memview.view.strides # <<<<<<<<<<<<<<
- * suboffsets = memview.view.suboffsets
- *
- */
- __pyx_t_1 = __pyx_v_memview->view.strides;
- __pyx_v_strides = __pyx_t_1;
-
- /* "View.MemoryView":1069
- * shape = memview.view.shape
- * strides = memview.view.strides
- * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
- *
- * dst.memview = <__pyx_memoryview *> memview
- */
- __pyx_t_1 = __pyx_v_memview->view.suboffsets;
- __pyx_v_suboffsets = __pyx_t_1;
-
- /* "View.MemoryView":1071
- * suboffsets = memview.view.suboffsets
- *
- * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
- * dst.data = memview.view.buf
- *
- */
- __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
-
- /* "View.MemoryView":1072
- *
- * dst.memview = <__pyx_memoryview *> memview
- * dst.data =