Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
.. image:: https://raw.githubusercontent.com/zkneupper/codecolor/master/docs/_static/code_color_logo.png
.. image:: https://img.shields.io/pypi/v/codecolor.svg :target: https://pypi.python.org/pypi/codecolor
.. image:: https://img.shields.io/travis/zkneupper/codecolor.svg :target: https://travis-ci.com/zkneupper/codecolor
.. image:: https://readthedocs.org/projects/codecolor/badge/?version=latest :target: https://codecolor.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status
Inspect python object code with colorful syntax highlighting!
Codecolor adds color when inspecting source code of python objects. It applies syntax highlighting to object source code.
The primary function of the codecolor module is the printsource
function. The printsource(obj, style="default")
function prints
the syntax-highlighted source code for the python object obj
.
Codecolor combines the code inspection functionality of
inspect.getsource()
and syntax highlighting functionality
of the pygments
package.
How does the pytorch relu function work under the hood?
You can easily inspect the source code of the pytorch relu function
by using codecolor.printsource(relu)
to to print the source code of
the relu function with syntax highlighting.
.. code-block:: python
from codecolor import printsource
from torch.nn.functional import relu
printsource(relu)
# prints the source code of the relu function with syntax highlighting
.. image:: https://raw.githubusercontent.com/zkneupper/codecolor/master/docs/_static/codecolor-demo.gif
Functions:
Add pytest unit tests
Flesh out readme
* Example usage
* Motivation
* Installation
* Center logo image
Deploy to pypi
This package was created with Cookiecutter_ and the audreyr/cookiecutter-pypackage
_ project template.
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _audreyr/cookiecutter-pypackage
: https://github.com/audreyr/cookiecutter-pypackage
FAQs
Inspect python object code with colorful syntax highlighting
We found that codecolor demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.