Saravanan666/pypi-org huggingface dataset:
Package: gradify
A python library to generate CSS gradient from an image. This is a fork ofhttps://github.com/fraser-hemp/gradify. The original gradify project had only a CLI
interface. With this fork, you can use gradify as a library in your Python code.InstallationInstall the latest release from PyPI:pipinstallgradifyUsagegradify.generate_css(fp,single_color=False,use_color_spread=False)fp: a filename (string), pathlib.Path object or a file object.
The file object must implement read(), seek(), and tell() methods,
and be opened in binary mode.single_color: only produce a single, uniform background color -
this is much quicker and has all browser supportuse_color_spread: this flag will give the color which has the least
spread over the image the highest priority when assigning directions
(opposed to most dominant color). This feature improves overall accuracy,
however adds complexity and in unique cases it produces counter-intuitive resultsExample:importgradifycss=gradify.generate_css('sample.png')Advanced UsageYou can useGradifyclass for advanced usage.fromgradifyimportGradify# simple usageg=Gradify('sample.png',single_color=False,use_color_spread=False)css=g.generate_css()# advanced usageg=Gradify('sample.png',single_color=False,use_color_spread=False,black_sensitivity=4.3,white_sensitivity=3,num_colors=4,resize=55,uniformness=7,use_prefixes=False)css=g.generate_css()Default parameters produce good result.From original repo:The only suggestion is increasing the uniformness (by lowering it’s value). It can improve
the general case, improve speed, but decrease the upper limits of accuracy.
Increasing sensitivity to black will do the same.CreditsMany thanks toFraser Hemphillfor writing the original gradify project.LicenseMIT
Package: grading-application
# Autograding assistant### Instructions
* This software requires Python 3.x and Flask version 1.0.2 installed on the system.
* The web based autograding assistant needs data input to be uploaded in the form of nbgrader metadata.
* When using the software, select the zipped nbgrader metadata dataset for upload.
* Upload the models answers if available in the form of a txt file.
* Once the application is lauched, go tohttp://127.0.0.1:5000to get the GUI window.
Package: grading_tools
Grading ToolsThis library allows you to compare student submissions to an answer, and provide
meaningful feedback. It currently accommodates basic Python data structures,pandasSeries and DataFrames,scikit-learnmodels, and images.Installation$pipinstallgrading-toolsUsage>>>fromgrading_tools.gradersimportPythonGrader>>>sub={"snake":"reptile","frog":"reptile"}>>>ans={"snake":"reptile","frog":"amphibian"}>>>g=PythonGrader(sub,ans)>>>g.grade_dict()>>>g.return_feedback(html=False){'score':0,'passed':False,'comment':"The value for the key `frog` doesn't match the expected result."}Licensegrading-toolswas created byNicholas Cifuentes-GoodbodyatWorldQuant University. It is not currently licensed for reuse of
any kind.ContributingThis package usesPython Semantic Release, so all commit messages must follow theAngularformat.
Package: gradio-calendar
gradio_calendarGradio component for selecting dates with a calendar 📆Installationpipinstallgradio_calendarUsageimportgradioasgrfromgradio_calendarimportCalendarimportdatetimedefis_weekday(date:datetime.datetime):returndate.weekday()<5demo=gr.Interface(is_weekday,[Calendar(type="datetime",label="Select a date",info="Click the calendar icon to bring up the calendar.")],gr.Label(label="Is it a weekday?"),examples=["2023-01-01","2023-12-11"],cache_examples=True,title="Is it a weekday?")if__name__=="__main__":demo.launch()CalendarInitializationnametypedefaultdescriptionvaluestr|datetime.datetimeNoneNonetypeLiteral["string","datetime"]"datetime"Nonelabelstr|NoneNoneNoneinfostr|NoneNoneNoneshow_labelbool|NoneNoneNonecontainerboolTrueNonescaleint|NoneNoneNonemin_widthint|NoneNoneNoneinteractivebool|NoneNoneNonevisibleboolTrueNoneelem_idstr|NoneNoneNoneelem_classeslist[str]|str|NoneNoneNonerenderboolTrueNoneload_fnCallable[...,Any]|NoneNoneNoneeveryfloat|NoneNoneNoneEventsnamedescriptionchangeinputsubmitUser functionThe impact on the users predict function varies depending on whether the component is used as an input or output for an event (or both).When used as an Input, the component only impacts the input signature of the user function.When used as an output, the component only impacts the return signature of the user function.The code snippet below is accurate in cases where the component is used as both an input and an output.defpredict(value:str|datetime.datetime|None)->str|datetime.datetime|None:returnvalue
Package: gradio-foliumtest
gradio_foliumtestCreate a map with folium and display it on the web with Gradio!Example usageimportgradioasgrfromgradio_foliumtestimportFoliumTestfromtypingimportLiteralfromfoliumimportMapLAT_LONG_MAP={"New York City":(40.7128,-74.0060),"London":(51.5074,-0.1278),"San Francisco":(37.7749,-122.4194),"Tokyo":(35.6762,139.6503),"Miami":(25.7617,-80.1918),}defget_city(city:Literal["New York City","London","San Francisco","Tokyo","Miami"]):city=cityor"Miami"returnMap(location=LAT_LONG_MAP[city],zoom_start=12)withgr.Blocks()asdemo:withgr.Row():withgr.Column():city=gr.Radio(choices=["New York City","London","San Francisco","Tokyo","Miami"],label="City")withgr.Column():map_=FoliumTest(label="Foo")city.change(get_city,city,map_)demo.launch()
Package: gradio-gradioworkbook
gradio_gradioworkbookA Custom Gradio component to build AI Notebooks powered by AIConfig.Example usagePlease see the demo/app.py for full details, but generally all you need to do
is add these lines to your component:importgradioasgrfromgradio_gradioworkbookimportGradioWorkbookAICONFIG_FILE_PATH="./example_aiconfig.json"#Can also be empty or None!withgr.Blocks()asdemo:GradioWorkbook(filepath=AICONFIG_FILE_PATH)demo.queue().launch()For the remaining commands for local development, please follow the
instructions from theREADME-dev.mdfile!
Package: gradio-gradioworkbook-ap
Gradio NotebooksGradio Notebookis a Gradio custom component that creates a notebook playground on Hugging Face Spaces with only8-lines of code!You can use this in your Hugging Face space by addinggradio-notebookto your Space'srequirements.txtfile, and then the following lines to yourapp.pyfile:importgradioasgrfromgradio_notebookimportGradioNotebook# AICONFIG_FILE_PATH also be empty or None if you don't have an AIConfig file!AICONFIG_FILE_PATH="./my_app.aiconfig.json"withgr.Blocks()asdemo:GradioNotebook(config_path=AICONFIG_FILE_PATH)demo.queue().launch()Please see ourdocumentation pagefor full details.For the remaining commands for local development, please follow the
instructions from theREADME-dev.mdfile!
Package: gradio-iframe
gradio_iframeA custom gradio component to embed an iframe in a gradio interface. This component is based on theHTMLcomponent.
It's currently still a work in progress.UsageThe usage is similar to the HTML component. You can pass valid html and it will be rendered in the interface as an iframe, meaning you can embed any website or webapp that supports iframes.
Also, JavaScript should run normal. You can even pass an iframe inside an iframe (see below!), i.e. a youtube or spotify embed.The size will adjust to the size of the iframe (onload),this is gonna be a bit delayed. The width is default at 100%.
You can also set the height and width manually.Exampleimportgradioasgrfromgradio_iframeimportiFramegr.Interface(iFrame(label="iFrame Example",value=("""<iframe width="560"height="315"src="https://www.youtube.com/embed/dQw4w9WgXcQ?si=QfHLpHZsI98oZT1G"title="YouTube video player"frameborder="0"allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"allowfullscreen></iframe>"""),show_label=True))RoadmapAdd manual hand over of other iFrame options.Explore switch between src and srcdoc through variable.Known IssuesThere are many reason why it's not a good idea to embed websites in an iframe.Seethis, or just google "iframe security concerns" for more information. Also, iFrames will use additional computing power and memory, which can slow down the interface.Also, this component is still a work in progress and not fully tested. Use at your own risk.Other IssuesHeight sometimes does not grow according to the inner component.The component is not completely responsive yet and struggles with variable heigth....
Package: gradio-image-prompter
Image Prompter for GradioA gradio component to upload images and process point/box prompts.This custom component is developed forTokenize Anythinggradio demo.InstallationPreliminariesgradio>= 4.0.0Installing Packagepipinstallgradio-image-prompterQuick StartDevelopmentcdgradio-image-prompter
gradioccinstall
gradioccdevExampleimportgradioasgrfromgradio_image_prompterimportImagePrompterdemo=gr.Interface(lambdaprompts:(prompts["image"],prompts["points"]),ImagePrompter(show_label=False),[gr.Image(show_label=False),gr.Dataframe(label="Points")],)demo.launch()LicenseApache License 2.0AcknowledgementWe thank the repositories:SAM,Gradio BoxandGradio.
Package: gradio-modal
gradio_modalA popup modal componentInstallationpipinstallgradio_modalUsageimportgradioasgrfromgradio_modalimportModalwithgr.Blocks()asdemo:withgr.Tab("Tab 1"):text_1=gr.Textbox(label="Input 1")text_2=gr.Textbox(label="Input 2")text_1.submit(lambdax:x,text_1,text_2)show_btn=gr.Button("Show Modal")gr.Examples([["Text 1","Text 2"],["Text 3","Text 4"]],inputs=[text_1,text_2],)withgr.Tab("Tab 2"):gr.Markdown("This is tab 2")withModal(visible=False)asmodal:gr.Markdown("Hello world!")show_btn.click(lambda:Modal(visible=True),None,modal)if__name__=="__main__":demo.launch()ModalInitializationnametypedefaultdescriptionvisibleboolFalseIf False, modal will be hidden.elem_idstr|NoneNoneAn optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.elem_classeslist[str]|str|NoneNoneAn optional string or list of strings that are assigned as the class of this component in the HTML DOM. Can be used for targeting CSS styles.allow_user_closeboolTrueIf True, user can close the modal (by clicking outside, clicking the X, or the escape key).renderboolTrueIf False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.EventsnamedescriptionblurThis listener is triggered when the Modal is unfocused/blurred.
Package: gradio-molgallery2d
gradio_molgallery2dA Gradio component designed for displaying a gallery of 2D molecular structures. It is designed to accept inputs consisting ofRDKitobjects.InstallationThis component can be installed throughpip:pipinstallgradio_molgallery2dExample usageimportgradioasgrfromgradio_molgalleryimportMolGallery2Dgallery2d=MolGallery2D(columns=5,height=1000,label="3D Interactive Structures")InformationFor any questions and comments, contactDavide Rigoni.LicenzeGPL-3.0
Package: gradio-molgallery3d
gradio_molgallery3dA Gradio component designed for displaying an interactive gallery of 3D molecular structures. It is designed to accept inputs consisting ofRDKitobjects.InstallationThis component can be installed through pip:pipinstallgradio_molgallery3dExample usageimportgradioasgrfromgradio_molgalleryimportMolGallery3Dgallery3d=MolGallery3D(columns=5,height=1000,label="3D Interactive Structures",automatic_rotation=True)FeaturesWhen theautomatic_rotationparameter is set toTrue, the molecular structures rotate automatically.Clicking the right mouse button on the 3D structure allows you to download the image as a .png file.Known IssuesWeb browsers typically impose limits on the number of canvas objects that can be displayed on a single page, which may result in some structures not being drawn. The specific limitations vary depending on the browser. More details: [1,2]InformationFor any questions and comments, contactDavide Rigoni.LicenzeGPL-3.0
Package: gradio-notebook
Gradio NotebooksGradio Notebookis a Gradio custom component that creates a notebook playground on Hugging Face Spaces with only8-lines of code!You can use this in your Hugging Face space by addinggradio-notebookto your Space'srequirements.txtfile, and then the following lines to yourapp.pyfile:importgradioasgrfromgradio_notebookimportGradioNotebook# AICONFIG_FILE_PATH also be empty or None if you don't have an AIConfig file!AICONFIG_FILE_PATH="./my_app.aiconfig.json"withgr.Blocks()asdemo:GradioNotebook(config_path=AICONFIG_FILE_PATH)demo.queue().launch()Please see ourdocumentation pagefor full details.For the remaining commands for local development, please follow the
instructions from theREADME-dev.mdfile!
Package: gradio-testfallback
gradio_testfallbackPython library for easily interacting with trained machine learning modelsInstallationpipinstallgradio_testfallbackUsageimportgradioasgrfromgradio_testfallbackimportTestFallbackwithgr.Blocks()asdemo:gr.Markdown("# Change the value (keep it JSON) and the front-end will update automatically.")TestFallback(value={"message":"Hello from Gradio!"},label="Static")if__name__=="__main__":demo.launch()TestFallbackInitializationnametypedefaultdescriptionvaluetyping.AnyNoneNonelabelstr|NoneNoneNoneinfostr|NoneNoneNoneshow_labelbool|NoneNoneNonecontainerboolTrueNonescaleint|NoneNoneNonemin_widthint|NoneNoneNoneinteractivebool|NoneNoneNonevisibleboolTrueNoneelem_idstr|NoneNoneNoneelem_classeslist[str]|str|NoneNoneNonerenderboolTrueNoneload_fnCallable|NoneNoneNoneeveryfloat|NoneNoneNone
Package: gradio-url-buttons
gradio_url_buttonsGradio custom compnent for adding URL buttonsInstallationpipinstallgradio_url_buttonsUsageimportgradioasgrfromgradio_url_buttonsimportsource_buttonsdefadd_source():return[{"link":"https://www.github.com","hostname":"Github.com"},{"link":"https://www.hkk.de","hostname":"HKK.de"}]withgr.Blocks()asdemo:gr.Markdown("# Change the value (keep it JSON) and the front-end will update automatically.")source_buttons(value=[])buttons=source_buttons()click=gr.Button("Click me")source_buttons(value=[{"link":"https://www.google.com","hostname":"Google.com"},{"link":"https://www.hkk.de","hostname":"HKK.de"}])click.click(add_source,inputs=[],outputs=[buttons])if__name__=="__main__":demo.launch()source_buttonsInitializationnametypedefaultdescriptionvalueAnyNoneNonelabelstr|NoneNoneNoneinfostr|NoneNoneNoneshow_labelbool|NoneNoneNonecontainerboolTrueNonescaleint|NoneNoneNonemin_widthint|NoneNoneNoneinteractivebool|NoneNoneNonevisibleboolTrueNoneelem_idstr|NoneNoneNoneelem_classeslist[str]|str|NoneNoneNonerenderboolTrueNoneload_fnCallable|NoneNoneNoneeveryfloat|NoneNoneNone
Package: gradipy
gradipy: A Lightweight Neural Network Librarygradipy is an evolving project, and it will potentially provide PyTorch-like API for building and training neural networks, there are some features that are actively developed on and plan to support in future releases.Desired features to add:PyTorch like API for most important blocks for training NNsConvolutional layers for image processingRecurrent layers for sequence dataPotentially GPU accelerationPlease note that the library is currently in its early stages, and these features are expected in future updates.Sample UsageHere's a basic example of using gradipy to create and train a simple neural network for MNIST (please refer to theexample usage):importgradipy.nnasnnfromgradipyimportdatasetsfromgradipy.nnimportoptimX_train,y_train,X_val,y_val,X_test,y_test=datasets.MNIST()# define some utility function here...classDenseNeuralNetwork:def__init__(self,input_dim,hidden_dim,output_dim):self.W1=nn.init_kaiming_normal(input_dim,hidden_dim,nonlinearity="relu")self.W2=nn.init_kaiming_normal(hidden_dim,output_dim,nonlinearity="relu")defforward(self,X):logits=X.matmul(self.W1).relu().matmul(self.W2)returnlogitsmodel=DenseNeuralNetwork(input_dim,hidden_dim,output_dim)criterion=nn.CrossEntropyLoss()optimizer=optim.Adam([model.W1,model.W2],lr=lr)forepochinrange(epochs+1):optimizer.zero_grad()xb,yb=get_batch()logits=model.forward(xb)loss=criterion(logits,yb)loss.backward()optimizer.step()# log the results on each epoch...In this example, we define a simple feedforward neural network, compile it, and train it on random data. gradipy will provide building blocks likeLinearlayers,activationfunctions,lossfunctions, andoptimizersfor creating and training neural networks.Feature RoadmapHere's a list of features we plan to implement in gradipy, along with their current status:To-DoBackward passes for:mul(problem with broadcasting),tanhAdd more operations and their gradientsBatchnormConvolutional layers for image processingPyTorch'snn.ModuleMore Loss functions (nn.MSELossandnn.NLLLoss)Recurrent layers for sequence dataGPU acceleration (no idea how to do that)DoneBasic Tensor wrapper around NumPyndarrayForward and backward passes implemented for:add,matmul,softmax,relu,sub,log,exp,log softmax,cross entropyAutograd just like PyTorch'sbackwardmethod using topological sortnn.CrossEntropyLoss functionTrain MNIST withgradipyKaiming, Xavier init (normal + uniform)Implemented Adam and added momentum to SGD
Package: gradools
Grading toolsSome tools I use when gradingCanvasassignments.There are command line tools, and some utilities for working with Canvas outputs.The main use is when doing by-hand grading of assignments with multiple components, and you want to keep track of the scores per component, with notes from grading.To do this, I make a Markdown marking log file, with specifications at the top,
then one second-level heading per student, like this:# 2018 Marking log for assessment Foo

Ordinary maxima:

* quality: 20
* does_task: 15
* skill_range: 10
* elegance: 10
* functions_variables: 10
* display: 10
* usable: 15
* comments_safety: 10

Total: 100

## mbr110

* quality: 14.0
* does_task: 11.0
* skill_range: 7.0
* elegance: 6.0
* functions_variables: 7.0
* display: 8.0
* usable: 10.0
* comments_safety: 8.0

Total: 71

Martin Brett

You did a good job generally.  Etc.  More comments on specifics.

## vrr101

* quality: 5.0
* does_task: 6.0
* skill_range: 3.0
* elegance: 2.0
* functions_variables: 3.0
* display: 4.0
* usable: 5.0
* comments_safety: 3.0

Total: 55.0

Valia Rodriguez Rodriguez

You did not do a very good job, generally.  Etc.Command line toolsCommands need a filegdconfig.tomlin the current directory.Example:log = "markingb_log.md"
year = "2018"
assignment = "Data Analysis Due (000000)"

[fudges]
2018 = 10gdo-check : analyzes a marking log in Markdown, with headings per student,
and sub-totals for component.  Checks sub-totals match specification at top
of file, checks and prints totals per student.gdo-year : prints "year" field value from config file (above).gdo-mkstable : makes template CSV file to upload to Canvas, using exported
CSV file from Canvas as input.gdo-stinit : makes section in marking log for student with specified login.
If fieldnb_templateexists in config file, make matching notebook for
student.gdo-mkfb : splits marking log into one file per student, builds PDFs for each
student.gdo-report : write marks CSV from report.Utilitiescanvastools- various utilities for interpreting Canvas output filenames,
reading Canvas output CSV files.Installation, developmentInstall from pip, usually:pip install gradoolsTo install locally from the repository, you will needflit.flit install --userFor development I use:flit install --user -sTest with:pip install -r test-requirements.txt
pytest gradools
Package: gradoptics
Differentiable Optics via Ray Tracinggradopticsis a ray tracing based optical simulator built using PyTorch[1]to enable automatic differentiation.The API is designed similar to rendering softwares, and has been heavily inspired byPhysically Based Rendering(Pharr, Jakob, Humphreys)[2].Getting StartedGetting StartedInstallationpip install gradopticsThen, you should be ready to go!importgradopticsasopticsWork in progressCurrently, some optical element normals are aligned with the optical axis -> more general orientations in progressCurrently, monochromatic -> no chromatic aberrationsProject HistoryThis project was started in 2020 by Michael Kagan and Maxime Vandegar at SLAC National Accelerator Laboratory.Feedback and ContributionsPlease use issues on GitHub for reporting bugs and suggesting features (including better documentation).We appreciate all contributions. In general, we recommend using pull requests to make changes togradoptics.TestingIf you modifygradoptics, please use pytest for checking your code.pytest tests/tests.pySupportgradopticswas developed in the context of the MAGIS-100 experimentReferences[1]A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga, et al. PyTorch: An imperative style, high-performance deep learning library. In NeurIPS, 2019.[2]Matt Pharr, Wenzel Jakob, and Greg Humphreys. 2016. Physically Based Rendering: From Theory to Implementation (3rd ed.). Morgan Kaufmann Publishers Inc.
Package: gradoptorch
GradOpTorchClassical gradient based optimization in PyTorch.InstallationUsageWhat is GradOpTorch?GradOpTorch is a suite of classical gradient-based optimization tools for
PyTorch. The toolkit includes conjugate gradients, BFGS, and some
methods for line-search.Why nottorch.optim?Not every problem is high-dimensional, highly nonconvex, with noisy gradients.For such problems, classical optimization techniques
can be more efficient.InstallationGradOpTorch can be installed from PyPI:pipinstallgradoptorchUsageThere are two primary interfaces for making use of the library.The standard PyTorch object oriented interface:fromgradoptorchimportoptimize_modulefromtorchimportnnclassMyModel(nn.Module):...model=MyModule()defloss_fn(model):...hist=optimize_module(model,loss_fn,opt_method="bfgs",ls_method="back_tracking")The functional interface:fromgradoptorchimportoptimizerdeff(x):...x_guess=...x_opt,hist=optimizer(f,x_guess,opt_method="conj_grad_pr",ls_method="quad_search")Newton's method is only available in the functional interfaceIncluded optimizers:'grad_exact' : exact gradient optimization
'conj_grad_fr' : conjugate gradient descent using Fletcher-Reeves search direction
'conj_grad_pr' : conjugate gradient descent using Polak-Ribiere search direction
'newton_exact' : exact newton optimization
'bfgs' : approximate newton optimization using bfgsIncluded line-search methods:'back_tracking' : backing tracking based line-search
'quad_search' : quadratic line-search
'constant' : no line search, constant step size used