Python: Move and rename query

This commit is contained in:
Rasmus Lerchedahl Petersen
2020-11-05 11:49:39 +01:00
parent 38b2bb2828
commit 6cecd3ba83
3 changed files with 92 additions and 1 deletions

View File

@@ -1,28 +0,0 @@
private import python
import semmle.python.dataflow.new.DataFlow
predicate pointsToOrigin(DataFlow::CfgNode pointer, DataFlow::CfgNode origin) {
origin.getNode() = pointer.getNode().pointsTo().getOrigin()
}
class PointsToConfiguration extends DataFlow::Configuration {
PointsToConfiguration() { this = "PointsToConfiguration" }
override predicate isSource(DataFlow::Node node) { pointsToOrigin(_, node) }
override predicate isSink(DataFlow::Node node) { pointsToOrigin(node, _) }
}
predicate hasFlow(DataFlow::Node origin, DataFlow::Node pointer) {
exists(PointsToConfiguration config, DataFlow::PathNode source, DataFlow::PathNode sink |
source.getNode() = origin and
sink.getNode() = pointer and
config.hasFlowPath(source, sink)
)
}
from DataFlow::Node pointer, DataFlow::Node origin
where
pointsToOrigin(pointer, origin) and
not hasFlow(origin, pointer)
select origin, pointer

View File

@@ -1,19 +0,0 @@
# This file contains snippets from snapshots that displayed interesting results for `pointsto.ql`.
class Chatbot:
"""
Main class which launch the training or testing mode
"""
class TestMode:
""" Simple structure representing the different testing modes
"""
ALL = 'all'
INTERACTIVE = 'interactive' # The user can write his own questions
DAEMON = 'daemon' # The chatbot runs on background and can regularly be called to predict something
def __init__(self):
"""
"""
# Model/dataset parameters
self.args = None