Guesslang detects the programming language of a given source code

Overview

Guesslang Build Status Documentation Status Pypi version

Guesslang

Guesslang detects the programming language of a given source code:

echo '
package main
import "fmt"

func main() {
    fmt.Println("My mascot is a gopher and Google loves me. Who am I?")
}

' | guesslang

# ⟶ Programming language: Go

Guesslang supports 54 programming languages:

Languages
Assembly Batchfile C C# C++
Clojure CMake COBOL CoffeeScript CSS
CSV Dart DM Dockerfile Elixir
Erlang Fortran Go Groovy Haskell
HTML INI Java JavaScript JSON
Julia Kotlin Lisp Lua Makefile
Markdown Matlab Objective-C OCaml Pascal
Perl PHP PowerShell Prolog Python
R Ruby Rust Scala Shell
SQL Swift TeX TOML TypeScript
Verilog Visual Basic XML YAML

With a guessing accuracy higher than 90%.

Apps powered by Guesslang

Chameledit

Chameledit is a simple web-editor that automatically highlights your code.

Pasta

Pasta is a Slack bot that pretty pastes source code.

Watch the demo here

GG

GG is a silly guessing game.

Documentation

Installation

  • Python 3.7+ is required

  • Install the latest stable version:

pip3 install guesslang
  • or install Guesslang from source code:
pip3 install .
  • Windows specific

To run Tensorflow on Microsoft Windows you need to install Visual C++ runtime libraries, available on Microsoft website

Guesslang command line

  • Show all available options
guesslang --help
  • Detect the programming language of /etc/bashrc configuration file:
guesslang /etc/bashrc

# ⟶ Programming language: Shell
  • Detect the programming language of a given text:
echo '
/** Turn command line arguments to uppercase */
object Main {
  def main(args: Array[String]) {
    val res = for (a <- args) yield a.toUpperCase
    println("Arguments: " + res.toString)
  }
}
' | guesslang

# ⟶ Programming language: Scala
  • Show the detection probabilities for a given source code:
= pivot] return qsort(less) + [pivot] + qsort(more) if __name__ == '__main__': items = [1, 4, 2, 7, 9, 3] print(f'Sorted: {qsort(items)}') " | guesslang --probabilities # Language name Probability # Python 74.80% # Haskell 6.73% # CoffeeScript 5.32% # Groovy 1.95% # Markdown 0.93% # ... ">
echo "
def qsort(items):
    if not items:
        return []
    else:
        pivot = items[0]
        less = [x for x in items if x <  pivot]
        more = [x for x in items[1:] if x >= pivot]
        return qsort(less) + [pivot] + qsort(more)


if __name__ == '__main__':
    items = [1, 4, 2, 7, 9, 3]
    print(f'Sorted: {qsort(items)}')

" | guesslang --probabilities

# Language name       Probability
#  Python               74.80%
#  Haskell               6.73%
#  CoffeeScript          5.32%
#  Groovy                1.95%
#  Markdown              0.93%
#  ...

Guesslang Python package

[]; qsort([Pivot|T]) -> qsort([X || X <- T, X < Pivot]) ++ [Pivot] ++ qsort([X || X <- T, X >= Pivot]). """) print(name) # ⟶ Erlang ">
from guesslang import Guess


guess = Guess()

name = guess.language_name("""
    % Quick sort

    -module (recursion).
    -export ([qsort/1]).

    qsort([]) -> [];
    qsort([Pivot|T]) ->
          qsort([X || X <- T, X < Pivot])
          ++ [Pivot] ++
          qsort([X || X <- T, X >= Pivot]).
""")

print(name)  # ⟶ Erlang

License and credits

Issues
  • Guesslang in VS Code

    Guesslang in VS Code

    Hi there,

    My name is Isidor and I work on VS Code. We have the following problem:

    Novice user create a new untitled files and start typing and they have no clue that they have to set the language mode to get all the language smartness that VS Code provides. Thus we were thinking to use some smart language detection so we could automatically set the language for the user.

    I was doing a bit of online research and I came across this project - looks very cool!

    Is it possible to somehow have this work as a node module instead of python? Since then we could consume it easily in VS Code and things might just work. Even cooler would be if it worked in the browser.

    Let me know if you are interested we can also setup a meeting where I could explain our use case in more detail. Thanks!

    help wanted 
    opened by isidorn 19
  • ModuleNotFoundError: No module named 'guesslang'

    ModuleNotFoundError: No module named 'guesslang'

    Hello Team,

    I have installed Tensorflow and guesslang

    C:\Users\bhuvaneshwari>pip3 show tensorflow Name: tensorflow Version: 2.5.0 Summary: TensorFlow is an open source machine learning framework for everyone. Home-page: https://www.tensorflow.org/ Author: Google Inc. Author-email: [email protected] License: Apache 2.0 Location: c:\users\bhuvaneshwari\appdata\local\programs\python\python39\lib\site-packages Requires: keras-preprocessing, termcolor, flatbuffers, tensorboard, gast, tensorflow-estimator, google-pasta, numpy, wheel, six, wrapt, keras-nightly, absl-py, typing-extensions, astunparse, protobuf, h5py, opt-einsum, grpcio Required-by: guesslang

    C:\Users\bhuvaneshwari>pip3 show tensorflow Name: tensorflow Version: 2.5.0 Summary: TensorFlow is an open source machine learning framework for everyone. Home-page: https://www.tensorflow.org/ Author: Google Inc. Author-email: [email protected] License: Apache 2.0 Location: c:\users\bhuvaneshwari\appdata\local\programs\python\python39\lib\site-packages Requires: keras-preprocessing, termcolor, flatbuffers, tensorboard, gast, tensorflow-estimator, google-pasta, numpy, wheel, six, wrapt, keras-nightly, absl-py, typing-extensions, astunparse, protobuf, h5py, opt-einsum, grpcio Required-by: guesslang

    When i try guesslang as a CLI , i get 'guesslang' is not recognized as an internal or external command,

    When i try as a package in python program i get ModuleNotFoundError: No module named 'guesslang'

    Thanks in advance

    opened by bhuvi11 14
  • Support 24 more languages, including JSON, Kotlin, XML, YAML etc...

    Support 24 more languages, including JSON, Kotlin, XML, YAML etc...

    Support the following languages:

    • Assembly
    • CSV
    • Dart
    • Fortran
    • Groovy
    • INI
    • JSON
    • Julia
    • Kotlin
    • Pascal (currently broken :warning:)
    • TOML
    • TypeScript
    • VBA
    • XML
    • YAML

    Prediction accuracy is 92.59% but the training and test dataset were not well balanced due to lack of files for some languages. And there were errors in the Pascal dataset.

    work in progress 
    opened by yoeo 9
  • Update pypi version and dependences

    Update pypi version and dependences

    Hi, actually i'm in debian with python 3.7, and i try install from pip but sadlt didn't works

    [email protected]:/home/pipe/a# pip3 install guesslang
    Collecting guesslang
      Using cached https://files.pythonhosted.org/packages/d5/e2/0416000ea8c42665ca1c3a9b527b585e9a9610b4a6494d728358f25a3a46/guesslang-0.9.3-py3-none-any.whl
    Collecting numpy (from guesslang)
      Downloading https://files.pythonhosted.org/packages/d6/c6/58e517e8b1fb192725cfa23c01c2e60e4e6699314ee9684a1c5f5c9b27e1/numpy-1.18.5-cp37-cp37m-manylinux1_x86_64.whl (20.1MB)
        100% |████████████████████████████████| 20.1MB 16kB/s 
    Collecting tensorflow==1.7.0rc1 (from guesslang)
      Could not find a version that satisfies the requirement tensorflow==1.7.0rc1 (from guesslang) (from versions: 1.13.0rc1, 1.13.0rc2, 1.13.1, 1.13.2, 1.14.0rc0, 1.14.0rc1, 1.14.0, 2.0.0a0, 2.0.0b0, 2.0.0b1)
    No matching distribution found for tensorflow==1.7.0rc1 (from guesslang)
    

    Thx.

    opened by latot 7
  • Uninstallable due to outdated tensorflow specification

    Uninstallable due to outdated tensorflow specification

    pip install guesslang
    
    Collecting guesslang
      Using cached https://files.pythonhosted.org/packages/d5/e2/0416000ea8c42665ca1c3a9b527b585e9a9610b4a6494d728358f25a3a46/guesslang-0.9.3-py3-none-any.whl
    Collecting numpy (from guesslang)
      Using cached https://files.pythonhosted.org/packages/91/e7/6c780e612d245cca62bc3ba8e263038f7c144a96a54f877f3714a0e8427e/numpy-1.16.2-cp37-cp37m-manylinux1_x86_64.whl
    Collecting tensorflow==1.7.0rc1 (from guesslang)
      Could not find a version that satisfies the requirement tensorflow==1.7.0rc1 (from guesslang) (from versions: 1.13.0rc1, 1.13.0rc2, 1.13.1)
    No matching distribution found for tensorflow==1.7.0rc1 (from guesslang)
    

    pip 19.0.3

    opened by AndydeCleyre 6
  • The class

    The class "tf.contrib.learn.DNNLinearCombinedClassifier" has been deprecated in TensorFlow

    Thanks for your package.

    The api of the deep learning model used for this package has been deprecated, reported in the TensorFlow website.

    https://www.tensorflow.org/api_docs/python/tf/contrib/learn/DNNLinearCombinedClassifier

    enhancement 
    opened by Zidane-Han 6
  • Question - Can I use it in my node web app?

    Question - Can I use it in my node web app?

    I really like this DL module and I don't know anything about machine learning. But I want to use this in my app to guess the language based on user input.

    Now, this app uses Next.js and I wanted to ask that is there a way to use it in a nodejs based app?

    opened by max-programming 3
  • Bump tensorflow from 2.2.0 to 2.3.1

    Bump tensorflow from 2.2.0 to 2.3.1

    Bumps tensorflow from 2.2.0 to 2.3.1.

    Release notes

    Sourced from tensorflow's releases.

    TensorFlow 2.3.1

    Release 2.3.1

    Bug Fixes and Other Changes

    TensorFlow 2.3.0

    Release 2.3.0

    Major Features and Improvements

    • tf.data adds two new mechanisms to solve input pipeline bottlenecks and save resources:

    In addition checkout the detailed guide for analyzing input pipeline performance with TF Profiler.

    • tf.distribute.TPUStrategy is now a stable API and no longer considered experimental for TensorFlow. (earlier tf.distribute.experimental.TPUStrategy).

    • TF Profiler introduces two new tools: a memory profiler to visualize your model’s memory usage over time and a python tracer which allows you to trace python function calls in your model. Usability improvements include better diagnostic messages and profile options to customize the host and device trace verbosity level.

    • Introduces experimental support for Keras Preprocessing Layers API (tf.keras.layers.experimental.preprocessing.*) to handle data preprocessing operations, with support for composite tensor inputs. Please see below for additional details on these layers.

    • TFLite now properly supports dynamic shapes during conversion and inference. We’ve also added opt-in support on Android and iOS for XNNPACK, a highly optimized set of CPU kernels, as well as opt-in support for executing quantized models on the GPU.

    • Libtensorflow packages are available in GCS starting this release. We have also started to release a nightly version of these packages.

    • The experimental Python API tf.debugging.experimental.enable_dump_debug_info() now allows you to instrument a TensorFlow program and dump debugging information to a directory on the file system. The directory can be read and visualized by a new interactive dashboard in TensorBoard 2.3 called Debugger V2, which reveals the details of the TensorFlow program including graph structures, history of op executions at the Python (eager) and intra-graph levels, the runtime dtype, shape, and numerical composistion of tensors, as well as their code locations.

    Breaking Changes

    • Increases the minimum bazel version required to build TF to 3.1.0.
    • tf.data
      • Makes the following (breaking) changes to the tf.data.
      • C++ API: - IteratorBase::RestoreInternal, IteratorBase::SaveInternal, and DatasetBase::CheckExternalState become pure-virtual and subclasses are now expected to provide an implementation.
      • The deprecated DatasetBase::IsStateful method is removed in favor of DatasetBase::CheckExternalState.
      • Deprecated overrides of DatasetBase::MakeIterator and MakeIteratorFromInputElement are removed.

    ... (truncated)

    Changelog

    Sourced from tensorflow's changelog.

    Release 2.3.1

    Bug Fixes and Other Changes

    Release 2.2.1

    ... (truncated)

    Commits
    • fcc4b96 Merge pull request #43446 from tensorflow-jenkins/version-numbers-2.3.1-16251
    • 4cf2230 Update version numbers to 2.3.1
    • eee8224 Merge pull request #43441 from tensorflow-jenkins/relnotes-2.3.1-24672
    • 0d41b1d Update RELEASE.md
    • d99bd63 Insert release notes place-fill
    • d71d3ce Merge pull request #43414 from tensorflow/mihaimaruseac-patch-1-1
    • 9c91596 Fix missing import
    • f9f12f6 Merge pull request #43391 from tensorflow/mihaimaruseac-patch-4
    • 3ed271b Solve leftover from merge conflict
    • 9cf3773 Merge pull request #43358 from tensorflow/mm-patch-r2.3
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 3
  • Request: Detection support for additional syntaxes: json, kotlin, nginx, toml, xml, yaml

    Request: Detection support for additional syntaxes: json, kotlin, nginx, toml, xml, yaml

    Thanks so much for reviving your work!

    I wasn't sure if you'd prefer a separate issue for each language here, just let me know.

    Otherwise:

    • [x] json
    • [x] kotlin
    • [ ] nginx
    • [x] toml
    • [x] xml
    • [x] yaml
    enhancement 
    opened by AndydeCleyre 3
  • [feature request] return probability from language_name()

    [feature request] return probability from language_name()

    language_name() returns the best guess for the language. I would like to know the associated probability such that I can decide if I use the information or not.

    opened by nschloe 2
  • Bug: illegal hardware instruction

    Bug: illegal hardware instruction

    I have installed the package as instructed from the documentation with pip, and later tried from source code, run the example mentioned in the README:

    echo '
    package main
    import "fmt"
    
    func main() {
        fmt.Println("My mascot is a gopher and Google loves me. Who am I?")
    }
    
    ' | guesslang
    

    and getting this error:

    [1]    836098 done                                        echo  |
           836099 illegal hardware instruction (core dumped)  guesslang
    
    

    also tried in python instead of the command line and got the same error.

    Pip Version: pip 20.0.2 Python version: python 3.8.10 OS: Ubuntu 20.04.3 LTS

    bug 
    opened by jonatan5524 2
  • pkg_resources.DistributionNotFound: The 'tensorflow==2.5.0' distribution was not found and is required by guesslang

    pkg_resources.DistributionNotFound: The 'tensorflow==2.5.0' distribution was not found and is required by guesslang

    Hi, with latest python-tensorflow 2.9.1 upgrade, guesslang stop working.

    Traceback (most recent call last):
      File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 573, in _build_master
        ws.require(__requires__)
      File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 891, in require
        needed = self.resolve(parse_requirements(requirements))
      File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 782, in resolve
        raise VersionConflict(dist, req).with_context(dependent_req)
    pkg_resources.ContextualVersionConflict: (tensorflow 2.9.1 (/usr/lib/python3.10/site-packages), Requirement.parse('tensorflow==2.5.0'), {'guesslang'})
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/usr/sbin/guesslang", line 33, in <module>
        sys.exit(load_entry_point('guesslang==2.2.1', 'console_scripts', 'guesslang')())
      File "/usr/sbin/guesslang", line 25, in importlib_load_entry_point
        return next(matches).load()
      File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
        module = import_module(match.group('module'))
      File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
      File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
      File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
      File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
      File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "/usr/lib/python3.10/site-packages/guesslang/__init__.py", line 16, in <module>
        from guesslang.guess import Guess, GuesslangError  # noqa: F401
      File "/usr/lib/python3.10/site-packages/guesslang/guess.py", line 10, in <module>
        from guesslang import model
      File "/usr/lib/python3.10/site-packages/guesslang/model.py", line 11, in <module>
        import tensorflow as tf
      File "/usr/lib/python3.10/site-packages/tensorflow/__init__.py", line 37, in <module>
        from tensorflow.python.tools import module_util as _module_util
      File "/usr/lib/python3.10/site-packages/tensorflow/python/__init__.py", line 45, in <module>
        from tensorflow.python.feature_column import feature_column_lib as feature_column
      File "/usr/lib/python3.10/site-packages/tensorflow/python/feature_column/feature_column_lib.py", line 18, in <module>
        from tensorflow.python.feature_column.feature_column import *
      File "/usr/lib/python3.10/site-packages/tensorflow/python/feature_column/feature_column.py", line 143, in <module>
        from tensorflow.python.layers import base
      File "/usr/lib/python3.10/site-packages/tensorflow/python/layers/base.py", line 16, in <module>
        from tensorflow.python.keras.legacy_tf_layers import base
      File "/usr/lib/python3.10/site-packages/tensorflow/python/keras/__init__.py", line 25, in <module>
        from tensorflow.python.keras import models
      File "/usr/lib/python3.10/site-packages/tensorflow/python/keras/models.py", line 20, in <module>
        from tensorflow.python.keras import metrics as metrics_module
      File "/usr/lib/python3.10/site-packages/tensorflow/python/keras/metrics.py", line 34, in <module>
        from tensorflow.python.keras import activations
      File "/usr/lib/python3.10/site-packages/tensorflow/python/keras/activations.py", line 18, in <module>
        from tensorflow.python.keras.layers import advanced_activations
      File "/usr/lib/python3.10/site-packages/tensorflow/python/keras/layers/__init__.py", line 68, in <module>
        from tensorflow.python.keras.layers.core import Masking
      File "/usr/lib/python3.10/site-packages/tensorflow/python/keras/layers/core.py", line 54, in <module>
        from tensorflow.python.ops import standard_ops
      File "/usr/lib/python3.10/site-packages/tensorflow/python/ops/standard_ops.py", line 108, in <module>
        from tensorflow.python.compiler.tensorrt import trt_convert as trt
      File "/usr/lib/python3.10/site-packages/tensorflow/python/compiler/tensorrt/__init__.py", line 18, in <module>
        from tensorflow.python.compiler.tensorrt import trt_convert as trt
      File "/usr/lib/python3.10/site-packages/tensorflow/python/compiler/tensorrt/trt_convert.py", line 30, in <module>
        from tensorflow.python.compiler.tensorrt import utils as trt_utils
      File "/usr/lib/python3.10/site-packages/tensorflow/python/compiler/tensorrt/utils.py", line 17, in <module>
        from distutils import version
      File "/usr/lib/python3.10/site-packages/setuptools/__init__.py", line 16, in <module>
        import setuptools.version
      File "/usr/lib/python3.10/site-packages/setuptools/version.py", line 1, in <module>
        import pkg_resources
      File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3317, in <module>
        def _initialize_master_working_set():
      File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3291, in _call_aside
        f(*args, **kwargs)
      File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3329, in _initialize_master_working_set
        working_set = WorkingSet._build_master()
      File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 575, in _build_master
        return cls._build_from_requirements(__requires__)
      File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 588, in _build_from_requirements
        dists = ws.resolve(reqs, Environment())
      File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 777, in resolve
        raise DistributionNotFound(req, requirers)
    pkg_resources.DistributionNotFound: The 'tensorflow==2.5.0' distribution was not found and is required by guesslang
    
    opened by carlosal1015 0
  • Bump tensorflow from 2.5.0 to 2.7.2

    Bump tensorflow from 2.5.0 to 2.7.2

    Bumps tensorflow from 2.5.0 to 2.7.2.

    Release notes

    Sourced from tensorflow's releases.

    TensorFlow 2.7.2

    Release 2.7.2

    This releases introduces several vulnerability fixes:

    TensorFlow 2.7.1

    Release 2.7.1

    This releases introduces several vulnerability fixes:

    • Fixes a floating point division by 0 when executing convolution operators (CVE-2022-21725)
    • Fixes a heap OOB read in shape inference for ReverseSequence (CVE-2022-21728)
    • Fixes a heap OOB access in Dequantize (CVE-2022-21726)
    • Fixes an integer overflow in shape inference for Dequantize (CVE-2022-21727)
    • Fixes a heap OOB access in FractionalAvgPoolGrad (CVE-2022-21730)
    • Fixes an overflow and divide by zero in UnravelIndex (CVE-2022-21729)
    • Fixes a type confusion in shape inference for ConcatV2 (CVE-2022-21731)
    • Fixes an OOM in ThreadPoolHandle (CVE-2022-21732)
    • Fixes an OOM due to integer overflow in StringNGrams (CVE-2022-21733)
    • Fixes more issues caused by incomplete validation in boosted trees code (CVE-2021-41208)
    • Fixes an integer overflows in most sparse component-wise ops (CVE-2022-23567)
    • Fixes an integer overflows in AddManySparseToTensorsMap (CVE-2022-23568)

    ... (truncated)

    Changelog

    Sourced from tensorflow's changelog.

    Release 2.7.2

    This releases introduces several vulnerability fixes:

    Release 2.6.4

    This releases introduces several vulnerability fixes:

    • Fixes a code injection in saved_model_cli (CVE-2022-29216)
    • Fixes a missing validation which causes TensorSummaryV2 to crash (CVE-2022-29193)
    • Fixes a missing validation which crashes QuantizeAndDequantizeV4Grad (CVE-2022-29192)
    • Fixes a missing validation which causes denial of service via DeleteSessionTensor (CVE-2022-29194)
    • Fixes a missing validation which causes denial of service via GetSessionTensor (CVE-2022-29191)
    • Fixes a missing validation which causes denial of service via StagePeek (CVE-2022-29195)
    • Fixes a missing validation which causes denial of service via UnsortedSegmentJoin (CVE-2022-29197)
    • Fixes a missing validation which causes denial of service via LoadAndRemapMatrix (CVE-2022-29199)
    • Fixes a missing validation which causes denial of service via SparseTensorToCSRSparseMatrix (CVE-2022-29198)
    • Fixes a missing validation which causes denial of service via LSTMBlockCell (CVE-2022-29200)
    • Fixes a missing validation which causes denial of service via Conv3DBackpropFilterV2 (CVE-2022-29196)
    • Fixes a CHECK failure in depthwise ops via overflows (CVE-2021-41197)
    • Fixes issues arising from undefined behavior stemming from users supplying invalid resource handles (CVE-2022-29207)
    • Fixes a segfault due to missing support for quantized types (CVE-2022-29205)
    • Fixes a missing validation which results in undefined behavior in SparseTensorDenseAdd (CVE-2022-29206)

    ... (truncated)

    Commits
    • dd7b8a3 Merge pull request #56034 from tensorflow-jenkins/relnotes-2.7.2-15779
    • 1e7d6ea Update RELEASE.md
    • 5085135 Merge pull request #56069 from tensorflow/mm-cp-52488e5072f6fe44411d70c6af09e...
    • adafb45 Merge pull request #56060 from yongtang:curl-7.83.1
    • 01cb1b8 Merge pull request #56038 from tensorflow-jenkins/version-numbers-2.7.2-4733
    • 8c90c2f Update version numbers to 2.7.2
    • 43f3cdc Update RELEASE.md
    • 98b0a48 Insert release notes place-fill
    • dfa5cf3 Merge pull request #56028 from tensorflow/disable-tests-on-r2.7
    • 501a65c Disable timing out tests
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • update to tensorflow 2.8.0

    update to tensorflow 2.8.0

    You install_requires is taken from requirements.txt where the version number is fixed. This is usually not a good idea, because you prevent Python users to update their installation when guesslang is installed. (Remember Python doesn't install packages locally, per package, but globally.)

    A better solution is to provide a version range, usually between major versions, e.g.,

    tensorflow >=2, <3
    

    There are quite a few other things that could be improved in an around metadata handling in guesslang.

    opened by nschloe 0
  • dependency error when install this

    dependency error when install this

    python version: 3.10 os: manjaro 21

    Here is the install output:

    Defaulting to user installation because normal site-packages is not writeable
    Requirement already satisfied: guesslang in /usr/lib/python3.10/site-packages/guesslang-2.2.2-py3.10.egg (2.2.2)
    Collecting guesslang
      Downloading guesslang-2.2.1-py3-none-any.whl (2.5 MB)
         |████████████████████████████████| 2.5 MB 210 kB/s
      Downloading guesslang-2.2.0-py3-none-any.whl (2.5 MB)
         |████████████████████████████████| 2.5 MB 12.8 MB/s
      Downloading guesslang-2.0.3-py3-none-any.whl (2.1 MB)
         |████████████████████████████████| 2.1 MB 12.4 MB/s
      Downloading guesslang-2.0.1-py3-none-any.whl (2.1 MB)
         |████████████████████████████████| 2.1 MB 12.9 MB/s
      Downloading guesslang-2.0.0-py3-none-any.whl (13.0 MB)
         |████████████████████████████████| 13.0 MB 12.0 MB/s
      Downloading guesslang-0.9.3-py3-none-any.whl (3.2 MB)
         |████████████████████████████████| 3.2 MB 11.8 MB/s
    Requirement already satisfied: numpy in /home/lizhe/.local/lib/python3.10/site-packages (from guesslang) (1.22.1)
      Downloading guesslang-0.9.1-py3-none-any.whl (3.2 MB)
         |████████████████████████████████| 3.2 MB 12.5 MB/s
    Collecting numpy<1.13,>=1.12
      Downloading numpy-1.12.1.zip (4.8 MB)
         |████████████████████████████████| 4.8 MB 13.5 MB/s
      Preparing metadata (setup.py) ... done
    ERROR: Cannot install guesslang==0.9.1, guesslang==0.9.3, guesslang==2.0.0, guesslang==2.0.1, guesslang==2.0.3, guesslang==2.2.0, guesslang==2.2.1 and guesslang==2.2.2 because these package versions have conflicting dependencies.
    
    The conflict is caused by:
        guesslang 2.2.2 depends on tensorflow==2.5.0
        guesslang 2.2.1 depends on tensorflow==2.5.0
        guesslang 2.2.0 depends on tensorflow==2.5.0
        guesslang 2.0.3 depends on tensorflow==2.5.0
        guesslang 2.0.1 depends on tensorflow==2.2.0
        guesslang 2.0.0 depends on tensorflow==2.2.0
        guesslang 0.9.3 depends on tensorflow==1.7.0rc1
        guesslang 0.9.1 depends on tensorflow==1.1.0
    
    To fix this you could try to:
    1. loosen the range of package versions you've specified
    2. remove package versions to allow pip attempt to solve the dependency conflict
    
    ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
    
    opened by woshichuanqilz 1
  • License for the pre-trained model

    License for the pre-trained model

    Hello! I wanted to know the license for the pre-trained model that is available. Could you please let me know the license specifications for the dataset and the pre-trained model?

    opened by SujathaSIyer 1
Releases(v2.2.1)
  • v2.2.1(Aug 1, 2021)

  • v2.2.0(Jul 25, 2021)

  • v2.0.1(Jul 1, 2020)

  • v2.0.0(Jun 29, 2020)

    (cf. https://github.com/yoeo/guesslang/releases/tag/v2.0.0a1)

    • Supports 30 languages (20 languages supported by previous versions). Including Powershell and Batch
    • Robust and scalable training workflow, using Tensorflow dataset API https://www.tensorflow.org/api_docs/python/tf/data/Dataset
    • Way simpler yet as performant feature engineering
    • More concise documentation
    • Simple check on detection probabilities to avoid classifying plain text as source code
    • Exposes the detection probabilities with guess.probabilities(source_code) method.
    • Updated Tensorflow to the latest version 2.2.0
    • Use up to date Tensorflow canned classifier
    • guess.language_name(source_code) now identifies empty content
    • Guesslang dataset creation moved to a new dedicated repository https://github.com/yoeo/guesslangtools
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0a1(Jun 14, 2020)

    • Supports 30 languages (20 languages supported by previous versions). Including Powershell and Batch https://github.com/yoeo/guesslang/issues/2
    • Robust and scalable training workflow, using Tensorflow dataset API https://www.tensorflow.org/api_docs/python/tf/data/Dataset
    • Way simpler yet as performant feature engineering
    • More concise documentation
    • Simple check on detection probabilities to avoid classifying plain text as source code https://github.com/yoeo/guesslang/issues/16 https://github.com/yoeo/guesslang/issues/15
    • Exposes the detection probabilities with guess.probabilities(source_code) method. https://github.com/yoeo/guesslang/issues/14
    • Updated Tensorflow to the latest version 2.2.0 https://github.com/yoeo/guesslang/issues/12
    • Use up to date Tensorflow canned classifier https://github.com/yoeo/guesslang/issues/9
    • guess.language_name(source_code) now identifies empty content https://github.com/yoeo/guesslang/issues/6
    • Guesslang dataset creation moved to a new dedicated repository https://github.com/yoeo/guesslangtools https://github.com/yoeo/guesslang/issues/5
    Source code(tar.gz)
    Source code(zip)
  • v0.9.4(Nov 1, 2018)

  • v0.9.3(Mar 26, 2018)

    Multiplatform:

    • Guesslang can officially be deployed on Linux and Windows platforms.
    • It may also run on OSX too but that have not been fully tested yet.
    Source code(tar.gz)
    Source code(zip)
  • v0.9.2(May 30, 2017)

Owner
Y. SOMDA
Big Data Crypto Machine Learning and life enthusiast.
Y. SOMDA
Collects all accepted (partial and full scored) codes submitted within the given timeframe and saves them locally for plagiarism check.

Collects all accepted (partial and full scored) codes submitted within the given timeframe of any contest.

ARITRA BELEL 2 Dec 28, 2021
coala provides a unified command-line interface for linting and fixing all your code, regardless of the programming languages you use.

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." ― John F. Woods coala provides a

coala development group 3.3k Jun 13, 2022
Learning source code review, spot vulnerability, find some ways how to fix it.

Learn Source Code Review Learning source code review, spot vulnerability, find some ways how to fix it. WordPress Plugin Authenticated Stored XSS on C

Shan 11 Sep 1, 2021
Inspects Python source files and provides information about type and location of classes, methods etc

prospector About Prospector is a tool to analyse Python code and output information about errors, potential problems, convention violations and comple

Python Code Quality Authority 1.6k Jun 5, 2022
🦔 PostHog is developer-friendly, open-source product analytics.

PostHog provides open-source product analytics, built for developers. Automate the collection of every event on your website or app, with no need to send data to 3rd parties. With just 1 click you can deploy on your own infrastructure, having full API/SQL access to the underlying data.

PostHog 7.9k May 30, 2022
Robocop is a tool that performs static code analysis of Robot Framework code.

Robocop Introduction Documentation Values Requirements Installation Usage Example Robotidy FAQ Watch our talk from RoboCon 2021 about Robocop and Robo

marketsquare 117 Jun 5, 2022
CodeAnalysis - Static Code Analysis: a code comprehensive analysis platform

TCA, Tencent Cloud Code Analysis English | 简体中文 What is TCA Tencent Cloud Code A

Tencent 1.2k Jun 7, 2022
Turn your Python and Javascript code into DOT flowcharts

Notes from 2017 This is an older project which I am no longer working on. It was built before ES6 existed and before Python 3 had much usage. While it

Scott Rogowski 2.5k Jun 5, 2022
Find dead Python code

Vulture - Find dead code Vulture finds unused code in Python programs. This is useful for cleaning up and finding errors in large code bases. If you r

Jendrik Seipp 2.1k Jun 4, 2022
Code audit tool for python.

Pylama Code audit tool for Python and JavaScript. Pylama wraps these tools: pycodestyle (formerly pep8) © 2012-2013, Florent Xicluna; pydocstyle (form

Kirill Klenov 896 Jun 1, 2022
The uncompromising Python code formatter

The Uncompromising Code Formatter “Any color you like.” Black is the uncompromising Python code formatter. By using it, you agree to cede control over

Python Software Foundation 27.9k Jun 5, 2022
A static type analyzer for Python code

pytype - ? ✔ Pytype checks and infers types for your Python code - without requiring type annotations. Pytype can: Lint plain Python code, flagging c

Google 3.8k Jun 5, 2022
Print a directory tree structure in your Python code.

directory-structure Print a directory tree structure in your Python code. Download You can simply: pip install directory-structure Or you can also: Cl

Gabriel Stork 40 Mar 9, 2022
An app to show the total number of lines of code written by an user.

Lines of code Have you ever wondered how many lines of code you wrote in github? This tool will calculate it for you! To calculate the total number of

B.Jothin kumar 10 Jan 26, 2022
Python package to parse and generate C/C++ code as context aware preprocessor.

Devana Devana is a python tool that make it easy to parsing, format, transform and generate C++ (or C) code. This tool uses libclang to parse the code

null 5 Apr 3, 2022
Metrinome is an all-purpose tool for working with code complexity metrics.

Overview Metrinome is an all-purpose tool for working with code complexity metrics. It can be used as both a REPL and API, and includes: Converters to

null 22 Jun 9, 2022
Find usage statistics (imports, function calls, attribute access) for Python code-bases

Python Library stats This is a small library that allows you to query some useful statistics for Python code-bases. We currently report library import

Francisco Massa 13 May 2, 2022
A very minimalistic python module that lets you track the time your code snippets take to run.

Clock Keeper A very minimalistic python module that lets you track the time your code snippets take to run. This package is available on PyPI! Run the

Rajdeep Biswas 1 Jan 19, 2022
A simple stopwatch for measuring code performance with static typing.

A simple stopwatch for measuring code performance. This is a fork from python-stopwatch, which adds static typing and a few other things.

Rafael 2 Feb 18, 2022