repo
stringlengths
7
54
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
20
28.4k
docstring
stringlengths
1
46.3k
docstring_tokens
listlengths
1
1.66k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
1 value
summary
stringlengths
4
350
obf_code
stringlengths
7.85k
764k
angr/angr
angr/analyses/forward_analysis.py
JobInfo.add_job
def add_job(self, job, merged=False, widened=False): """ Appended a new job to this JobInfo node. :param job: The new job to append. :param bool merged: Whether it is a merged job or not. :param bool widened: Whether it is a widened job or not. """ job_type = '' ...
python
def add_job(self, job, merged=False, widened=False): """ Appended a new job to this JobInfo node. :param job: The new job to append. :param bool merged: Whether it is a merged job or not. :param bool widened: Whether it is a widened job or not. """ job_type = '' ...
[ "def", "add_job", "(", "self", ",", "job", ",", "merged", "=", "False", ",", "widened", "=", "False", ")", ":", "job_type", "=", "''", "if", "merged", ":", "job_type", "=", "'merged'", "elif", "widened", ":", "job_type", "=", "'widened'", "self", ".", ...
Appended a new job to this JobInfo node. :param job: The new job to append. :param bool merged: Whether it is a merged job or not. :param bool widened: Whether it is a widened job or not.
[ "Appended", "a", "new", "job", "to", "this", "JobInfo", "node", ".", ":", "param", "job", ":", "The", "new", "job", "to", "append", ".", ":", "param", "bool", "merged", ":", "Whether", "it", "is", "a", "merged", "job", "or", "not", ".", ":", "param...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/forward_analysis.py#L370-L383
train
Adds a new job to the job list.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/forward_analysis.py
ForwardAnalysis.has_job
def has_job(self, job): """ Checks whether there exists another job which has the same job key. :param job: The job to check. :return: True if there exists another job with the same key, False otherwise. """ job_key = self._job_key(job) return job_key in self....
python
def has_job(self, job): """ Checks whether there exists another job which has the same job key. :param job: The job to check. :return: True if there exists another job with the same key, False otherwise. """ job_key = self._job_key(job) return job_key in self....
[ "def", "has_job", "(", "self", ",", "job", ")", ":", "job_key", "=", "self", ".", "_job_key", "(", "job", ")", "return", "job_key", "in", "self", ".", "_job_map" ]
Checks whether there exists another job which has the same job key. :param job: The job to check. :return: True if there exists another job with the same key, False otherwise.
[ "Checks", "whether", "there", "exists", "another", "job", "which", "has", "the", "same", "job", "key", ".", ":", "param", "job", ":", "The", "job", "to", "check", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/forward_analysis.py#L480-L488
train
Checks whether there exists another job with the same key.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/forward_analysis.py
ForwardAnalysis._analyze
def _analyze(self): """ The main analysis routine. :return: None """ self._pre_analysis() if self._graph_visitor is None: # There is no base graph that we can rely on. The analysis itself should generate successors for the # current job. ...
python
def _analyze(self): """ The main analysis routine. :return: None """ self._pre_analysis() if self._graph_visitor is None: # There is no base graph that we can rely on. The analysis itself should generate successors for the # current job. ...
[ "def", "_analyze", "(", "self", ")", ":", "self", ".", "_pre_analysis", "(", ")", "if", "self", ".", "_graph_visitor", "is", "None", ":", "# There is no base graph that we can rely on. The analysis itself should generate successors for the", "# current job.", "# An example is...
The main analysis routine. :return: None
[ "The", "main", "analysis", "routine", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/forward_analysis.py#L569-L590
train
Analyzes the current base graph and returns None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/forward_analysis.py
ForwardAnalysis._add_input_state
def _add_input_state(self, node, input_state): """ Add the input state to all successors of the given node. :param node: The node whose successors' input states will be touched. :param input_state: The state that will be added to successors of the node. :return: ...
python
def _add_input_state(self, node, input_state): """ Add the input state to all successors of the given node. :param node: The node whose successors' input states will be touched. :param input_state: The state that will be added to successors of the node. :return: ...
[ "def", "_add_input_state", "(", "self", ",", "node", ",", "input_state", ")", ":", "successors", "=", "self", ".", "_graph_visitor", ".", "successors", "(", "node", ")", "for", "succ", "in", "successors", ":", "if", "succ", "in", "self", ".", "_state_map",...
Add the input state to all successors of the given node. :param node: The node whose successors' input states will be touched. :param input_state: The state that will be added to successors of the node. :return: None
[ "Add", "the", "input", "state", "to", "all", "successors", "of", "the", "given", "node", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/forward_analysis.py#L623-L638
train
Adds the input state to all successors of the given node.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/forward_analysis.py
ForwardAnalysis._pop_input_state
def _pop_input_state(self, node): """ Get the input abstract state for this node, and remove it from the state map. :param node: The node in graph. :return: A merged state, or None if there is no input state for this node available. """ if node in self._state_map: ...
python
def _pop_input_state(self, node): """ Get the input abstract state for this node, and remove it from the state map. :param node: The node in graph. :return: A merged state, or None if there is no input state for this node available. """ if node in self._state_map: ...
[ "def", "_pop_input_state", "(", "self", ",", "node", ")", ":", "if", "node", "in", "self", ".", "_state_map", ":", "return", "self", ".", "_state_map", ".", "pop", "(", "node", ")", "return", "None" ]
Get the input abstract state for this node, and remove it from the state map. :param node: The node in graph. :return: A merged state, or None if there is no input state for this node available.
[ "Get", "the", "input", "abstract", "state", "for", "this", "node", "and", "remove", "it", "from", "the", "state", "map", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/forward_analysis.py#L640-L650
train
Get the input abstract state for this node and remove it from the state map.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/forward_analysis.py
ForwardAnalysis._merge_state_from_predecessors
def _merge_state_from_predecessors(self, node): """ Get abstract states for all predecessors of the node, merge them, and return the merged state. :param node: The node in graph. :return: A merged state, or None if no predecessor is available. """ preds = self._grap...
python
def _merge_state_from_predecessors(self, node): """ Get abstract states for all predecessors of the node, merge them, and return the merged state. :param node: The node in graph. :return: A merged state, or None if no predecessor is available. """ preds = self._grap...
[ "def", "_merge_state_from_predecessors", "(", "self", ",", "node", ")", ":", "preds", "=", "self", ".", "_graph_visitor", ".", "predecessors", "(", "node", ")", "states", "=", "[", "self", ".", "_state_map", "[", "n", "]", "for", "n", "in", "preds", "if"...
Get abstract states for all predecessors of the node, merge them, and return the merged state. :param node: The node in graph. :return: A merged state, or None if no predecessor is available.
[ "Get", "abstract", "states", "for", "all", "predecessors", "of", "the", "node", "merge", "them", "and", "return", "the", "merged", "state", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/forward_analysis.py#L652-L667
train
Get abstract states for all predecessors of the node and merge them and return the merged state.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/forward_analysis.py
ForwardAnalysis._process_job_and_get_successors
def _process_job_and_get_successors(self, job_info): """ Process a job, get all successors of this job, and call _handle_successor() to handle each successor. :param JobInfo job_info: The JobInfo instance :return: None """ job = job_info.job successors = self._...
python
def _process_job_and_get_successors(self, job_info): """ Process a job, get all successors of this job, and call _handle_successor() to handle each successor. :param JobInfo job_info: The JobInfo instance :return: None """ job = job_info.job successors = self._...
[ "def", "_process_job_and_get_successors", "(", "self", ",", "job_info", ")", ":", "job", "=", "job_info", ".", "job", "successors", "=", "self", ".", "_get_successors", "(", "job", ")", "all_new_jobs", "=", "[", "]", "for", "successor", "in", "successors", "...
Process a job, get all successors of this job, and call _handle_successor() to handle each successor. :param JobInfo job_info: The JobInfo instance :return: None
[ "Process", "a", "job", "get", "all", "successors", "of", "this", "job", "and", "call", "_handle_successor", "()", "to", "handle", "each", "successor", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/forward_analysis.py#L716-L739
train
Process a job and get all successors of this job and call _handle_successor on each successor.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/forward_analysis.py
ForwardAnalysis._insert_job
def _insert_job(self, job): """ Insert a new job into the job queue. If the job queue is ordered, this job will be inserted at the correct position. :param job: The job to insert :return: None """ key = self._job_key(job) if self._allow_merging: ...
python
def _insert_job(self, job): """ Insert a new job into the job queue. If the job queue is ordered, this job will be inserted at the correct position. :param job: The job to insert :return: None """ key = self._job_key(job) if self._allow_merging: ...
[ "def", "_insert_job", "(", "self", ",", "job", ")", ":", "key", "=", "self", ".", "_job_key", "(", "job", ")", "if", "self", ".", "_allow_merging", ":", "if", "key", "in", "self", ".", "_job_map", ":", "job_info", "=", "self", ".", "_job_map", "[", ...
Insert a new job into the job queue. If the job queue is ordered, this job will be inserted at the correct position. :param job: The job to insert :return: None
[ "Insert", "a", "new", "job", "into", "the", "job", "queue", ".", "If", "the", "job", "queue", "is", "ordered", "this", "job", "will", "be", "inserted", "at", "the", "correct", "position", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/forward_analysis.py#L741-L798
train
Insert a new job into the job queue.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/forward_analysis.py
ForwardAnalysis._peek_job
def _peek_job(self, pos): """ Return the job currently at position `pos`, but still keep it in the job queue. An IndexError will be raised if that position does not currently exist in the job list. :param int pos: Position of the job to get. :return: The job """ ...
python
def _peek_job(self, pos): """ Return the job currently at position `pos`, but still keep it in the job queue. An IndexError will be raised if that position does not currently exist in the job list. :param int pos: Position of the job to get. :return: The job """ ...
[ "def", "_peek_job", "(", "self", ",", "pos", ")", ":", "if", "pos", "<", "len", "(", "self", ".", "_job_info_queue", ")", ":", "return", "self", ".", "_job_info_queue", "[", "pos", "]", ".", "job", "raise", "IndexError", "(", ")" ]
Return the job currently at position `pos`, but still keep it in the job queue. An IndexError will be raised if that position does not currently exist in the job list. :param int pos: Position of the job to get. :return: The job
[ "Return", "the", "job", "currently", "at", "position", "pos", "but", "still", "keep", "it", "in", "the", "job", "queue", ".", "An", "IndexError", "will", "be", "raised", "if", "that", "position", "does", "not", "currently", "exist", "in", "the", "job", "...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/forward_analysis.py#L800-L812
train
Return the job currently at the given position.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/analyses/forward_analysis.py
ForwardAnalysis._binary_insert
def _binary_insert(lst, elem, key, lo=0, hi=None): """ Insert an element into a sorted list, and keep the list sorted. The major difference from bisect.bisect_left is that this function supports a key method, so user doesn't have to create the key array for each insertion. :par...
python
def _binary_insert(lst, elem, key, lo=0, hi=None): """ Insert an element into a sorted list, and keep the list sorted. The major difference from bisect.bisect_left is that this function supports a key method, so user doesn't have to create the key array for each insertion. :par...
[ "def", "_binary_insert", "(", "lst", ",", "elem", ",", "key", ",", "lo", "=", "0", ",", "hi", "=", "None", ")", ":", "if", "lo", "<", "0", ":", "raise", "ValueError", "(", "\"lo must be a non-negative number\"", ")", "if", "hi", "is", "None", ":", "h...
Insert an element into a sorted list, and keep the list sorted. The major difference from bisect.bisect_left is that this function supports a key method, so user doesn't have to create the key array for each insertion. :param list lst: The list. Must be pre-ordered. :param object eleme...
[ "Insert", "an", "element", "into", "a", "sorted", "list", "and", "keep", "the", "list", "sorted", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/analyses/forward_analysis.py#L819-L847
train
Insert an element into a sorted list and keep the list sorted.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/symbolic_memory.py
SimSymbolicMemory.merge
def merge(self, others, merge_conditions, common_ancestor=None): # pylint: disable=unused-argument """ Merge this SimMemory with the other SimMemory """ changed_bytes = self._changes_to_merge(others) l.info("Merging %d bytes", len(changed_bytes)) l.info("... %s has chan...
python
def merge(self, others, merge_conditions, common_ancestor=None): # pylint: disable=unused-argument """ Merge this SimMemory with the other SimMemory """ changed_bytes = self._changes_to_merge(others) l.info("Merging %d bytes", len(changed_bytes)) l.info("... %s has chan...
[ "def", "merge", "(", "self", ",", "others", ",", "merge_conditions", ",", "common_ancestor", "=", "None", ")", ":", "# pylint: disable=unused-argument", "changed_bytes", "=", "self", ".", "_changes_to_merge", "(", "others", ")", "l", ".", "info", "(", "\"Merging...
Merge this SimMemory with the other SimMemory
[ "Merge", "this", "SimMemory", "with", "the", "other", "SimMemory" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/symbolic_memory.py#L96-L114
train
Merge this SimMemory with the others SimMemory.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/symbolic_memory.py
SimSymbolicMemory.make_symbolic
def make_symbolic(self, name, addr, length=None): """ Replaces `length` bytes starting at `addr` with a symbolic variable named name. Adds a constraint equaling that symbolic variable to the value previously at `addr`, and returns the variable. """ l.debug("making %s bytes symbol...
python
def make_symbolic(self, name, addr, length=None): """ Replaces `length` bytes starting at `addr` with a symbolic variable named name. Adds a constraint equaling that symbolic variable to the value previously at `addr`, and returns the variable. """ l.debug("making %s bytes symbol...
[ "def", "make_symbolic", "(", "self", ",", "name", ",", "addr", ",", "length", "=", "None", ")", ":", "l", ".", "debug", "(", "\"making %s bytes symbolic\"", ",", "length", ")", "if", "isinstance", "(", "addr", ",", "str", ")", ":", "addr", ",", "length...
Replaces `length` bytes starting at `addr` with a symbolic variable named name. Adds a constraint equaling that symbolic variable to the value previously at `addr`, and returns the variable.
[ "Replaces", "length", "bytes", "starting", "at", "addr", "with", "a", "symbolic", "variable", "named", "name", ".", "Adds", "a", "constraint", "equaling", "that", "symbolic", "variable", "to", "the", "value", "previously", "at", "addr", "and", "returns", "the"...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/symbolic_memory.py#L297-L316
train
Makes a symbolic variable of length bytes starting at addr.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/symbolic_memory.py
SimSymbolicMemory._apply_concretization_strategies
def _apply_concretization_strategies(self, addr, strategies, action): """ Applies concretization strategies on the address until one of them succeeds. """ # we try all the strategies in order for s in strategies: # first, we trigger the SimInspect breakpoint and give...
python
def _apply_concretization_strategies(self, addr, strategies, action): """ Applies concretization strategies on the address until one of them succeeds. """ # we try all the strategies in order for s in strategies: # first, we trigger the SimInspect breakpoint and give...
[ "def", "_apply_concretization_strategies", "(", "self", ",", "addr", ",", "strategies", ",", "action", ")", ":", "# we try all the strategies in order", "for", "s", "in", "strategies", ":", "# first, we trigger the SimInspect breakpoint and give it a chance to intervene", "e", ...
Applies concretization strategies on the address until one of them succeeds.
[ "Applies", "concretization", "strategies", "on", "the", "address", "until", "one", "of", "them", "succeeds", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/symbolic_memory.py#L352-L393
train
Applies concretization strategies on the address until one of them succeeds.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/symbolic_memory.py
SimSymbolicMemory.concretize_write_addr
def concretize_write_addr(self, addr, strategies=None): """ Concretizes an address meant for writing. :param addr: An expression for the address. :param strategies: A list of concretization strategies (to override the default). :returns: ...
python
def concretize_write_addr(self, addr, strategies=None): """ Concretizes an address meant for writing. :param addr: An expression for the address. :param strategies: A list of concretization strategies (to override the default). :returns: ...
[ "def", "concretize_write_addr", "(", "self", ",", "addr", ",", "strategies", "=", "None", ")", ":", "if", "isinstance", "(", "addr", ",", "int", ")", ":", "return", "[", "addr", "]", "elif", "not", "self", ".", "state", ".", "solver", ".", "symbolic", ...
Concretizes an address meant for writing. :param addr: An expression for the address. :param strategies: A list of concretization strategies (to override the default). :returns: A list of concrete addresses.
[ "Concretizes", "an", "address", "meant", "for", "writing", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/symbolic_memory.py#L395-L410
train
Concretizes an address meant for writing.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/symbolic_memory.py
SimSymbolicMemory.concretize_read_addr
def concretize_read_addr(self, addr, strategies=None): """ Concretizes an address meant for reading. :param addr: An expression for the address. :param strategies: A list of concretization strategies (to override the default). :returns: ...
python
def concretize_read_addr(self, addr, strategies=None): """ Concretizes an address meant for reading. :param addr: An expression for the address. :param strategies: A list of concretization strategies (to override the default). :returns: ...
[ "def", "concretize_read_addr", "(", "self", ",", "addr", ",", "strategies", "=", "None", ")", ":", "if", "isinstance", "(", "addr", ",", "int", ")", ":", "return", "[", "addr", "]", "elif", "not", "self", ".", "state", ".", "solver", ".", "symbolic", ...
Concretizes an address meant for reading. :param addr: An expression for the address. :param strategies: A list of concretization strategies (to override the default). :returns: A list of concrete addresses.
[ "Concretizes", "an", "address", "meant", "for", "reading", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/symbolic_memory.py#L412-L427
train
Concretizes an address meant for reading.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/symbolic_memory.py
SimSymbolicMemory.dbg_print
def dbg_print(self, indent=0): """ Print out debugging information. """ lst = [] more_data = False for i, addr in enumerate(self.mem.keys()): lst.append(addr) if i >= 20: more_data = True break for addr in s...
python
def dbg_print(self, indent=0): """ Print out debugging information. """ lst = [] more_data = False for i, addr in enumerate(self.mem.keys()): lst.append(addr) if i >= 20: more_data = True break for addr in s...
[ "def", "dbg_print", "(", "self", ",", "indent", "=", "0", ")", ":", "lst", "=", "[", "]", "more_data", "=", "False", "for", "i", ",", "addr", "in", "enumerate", "(", "self", ".", "mem", ".", "keys", "(", ")", ")", ":", "lst", ".", "append", "("...
Print out debugging information.
[ "Print", "out", "debugging", "information", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/symbolic_memory.py#L1134-L1154
train
Print out debugging information.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/symbolic_memory.py
SimSymbolicMemory.permissions
def permissions(self, addr, permissions=None): """ Retrieve the permissions of the page at address `addr`. :param addr: address to get the page permissions :param permissions: Integer or BVV to optionally set page permissions to :return: AST representing the pe...
python
def permissions(self, addr, permissions=None): """ Retrieve the permissions of the page at address `addr`. :param addr: address to get the page permissions :param permissions: Integer or BVV to optionally set page permissions to :return: AST representing the pe...
[ "def", "permissions", "(", "self", ",", "addr", ",", "permissions", "=", "None", ")", ":", "out", "=", "self", ".", "mem", ".", "permissions", "(", "addr", ",", "permissions", ")", "# if unicorn is in play and we've marked a page writable, it must be uncached", "if"...
Retrieve the permissions of the page at address `addr`. :param addr: address to get the page permissions :param permissions: Integer or BVV to optionally set page permissions to :return: AST representing the permissions on the page
[ "Retrieve", "the", "permissions", "of", "the", "page", "at", "address", "addr", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/symbolic_memory.py#L1234-L1247
train
Retrieve the permissions of the page at the given address.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/symbolic_memory.py
SimSymbolicMemory.map_region
def map_region(self, addr, length, permissions, init_zero=False): """ Map a number of pages at address `addr` with permissions `permissions`. :param addr: address to map the pages at :param length: length in bytes of region to map, will be rounded upwards to the page size :param ...
python
def map_region(self, addr, length, permissions, init_zero=False): """ Map a number of pages at address `addr` with permissions `permissions`. :param addr: address to map the pages at :param length: length in bytes of region to map, will be rounded upwards to the page size :param ...
[ "def", "map_region", "(", "self", ",", "addr", ",", "length", ",", "permissions", ",", "init_zero", "=", "False", ")", ":", "l", ".", "info", "(", "\"Mapping [%#x, %#x] as %s\"", ",", "addr", ",", "addr", "+", "length", "-", "1", ",", "permissions", ")",...
Map a number of pages at address `addr` with permissions `permissions`. :param addr: address to map the pages at :param length: length in bytes of region to map, will be rounded upwards to the page size :param permissions: AST of permissions to map, will be a bitvalue representing flags ...
[ "Map", "a", "number", "of", "pages", "at", "address", "addr", "with", "permissions", "permissions", ".", ":", "param", "addr", ":", "address", "to", "map", "the", "pages", "at", ":", "param", "length", ":", "length", "in", "bytes", "of", "region", "to", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/symbolic_memory.py#L1249-L1258
train
Map a number of pages at address addr with permissions permissions.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/factory.py
AngrObjectFactory.successors
def successors(self, *args, **kwargs): """ Perform execution using any applicable engine. Enumerate the current engines and use the first one that works. Return a SimSuccessors object classifying the results of the run. :param state: The state to analyze :param addr: ...
python
def successors(self, *args, **kwargs): """ Perform execution using any applicable engine. Enumerate the current engines and use the first one that works. Return a SimSuccessors object classifying the results of the run. :param state: The state to analyze :param addr: ...
[ "def", "successors", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "project", ".", "engines", ".", "successors", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
Perform execution using any applicable engine. Enumerate the current engines and use the first one that works. Return a SimSuccessors object classifying the results of the run. :param state: The state to analyze :param addr: optional, an address to execute at instead of the...
[ "Perform", "execution", "using", "any", "applicable", "engine", ".", "Enumerate", "the", "current", "engines", "and", "use", "the", "first", "one", "that", "works", ".", "Return", "a", "SimSuccessors", "object", "classifying", "the", "results", "of", "the", "r...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/factory.py#L41-L54
train
Return a SimSuccessors object that represents the results of the current execution using any applicable engine.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/factory.py
AngrObjectFactory.call_state
def call_state(self, addr, *args, **kwargs): """ Returns a state object initialized to the start of a given function, as if it were called with given parameters. :param addr: The address the state should start at instead of the entry point. :param args: Any additio...
python
def call_state(self, addr, *args, **kwargs): """ Returns a state object initialized to the start of a given function, as if it were called with given parameters. :param addr: The address the state should start at instead of the entry point. :param args: Any additio...
[ "def", "call_state", "(", "self", ",", "addr", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "project", ".", "simos", ".", "state_call", "(", "addr", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
Returns a state object initialized to the start of a given function, as if it were called with given parameters. :param addr: The address the state should start at instead of the entry point. :param args: Any additional positional arguments will be used as arguments to the functio...
[ "Returns", "a", "state", "object", "initialized", "to", "the", "start", "of", "a", "given", "function", "as", "if", "it", "were", "called", "with", "given", "parameters", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/factory.py#L118-L160
train
This function returns a state object initialized to the beginning of a given function.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/factory.py
AngrObjectFactory.simulation_manager
def simulation_manager(self, thing=None, **kwargs): """ Constructs a new simulation manager. :param thing: Optional - What to put in the new SimulationManager's active stash (either a SimState or a list of SimStates). :param kwargs: Any additional keyword arguments wi...
python
def simulation_manager(self, thing=None, **kwargs): """ Constructs a new simulation manager. :param thing: Optional - What to put in the new SimulationManager's active stash (either a SimState or a list of SimStates). :param kwargs: Any additional keyword arguments wi...
[ "def", "simulation_manager", "(", "self", ",", "thing", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "thing", "is", "None", ":", "thing", "=", "[", "self", ".", "entry_state", "(", ")", "]", "elif", "isinstance", "(", "thing", ",", "(", "l...
Constructs a new simulation manager. :param thing: Optional - What to put in the new SimulationManager's active stash (either a SimState or a list of SimStates). :param kwargs: Any additional keyword arguments will be passed to the SimulationManager constructor :returns: ...
[ "Constructs", "a", "new", "simulation", "manager", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/factory.py#L162-L188
train
Returns a new SimulationManager object initialized with the given thing.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/factory.py
AngrObjectFactory.callable
def callable(self, addr, concrete_only=False, perform_merge=True, base_state=None, toc=None, cc=None): """ A Callable is a representation of a function in the binary that can be interacted with like a native python function. :param addr: The address of the function to use ...
python
def callable(self, addr, concrete_only=False, perform_merge=True, base_state=None, toc=None, cc=None): """ A Callable is a representation of a function in the binary that can be interacted with like a native python function. :param addr: The address of the function to use ...
[ "def", "callable", "(", "self", ",", "addr", ",", "concrete_only", "=", "False", ",", "perform_merge", "=", "True", ",", "base_state", "=", "None", ",", "toc", "=", "None", ",", "cc", "=", "None", ")", ":", "return", "Callable", "(", "self", ".", "pr...
A Callable is a representation of a function in the binary that can be interacted with like a native python function. :param addr: The address of the function to use :param concrete_only: Throw an exception if the execution splits into multiple states :param perform_merge: ...
[ "A", "Callable", "is", "a", "representation", "of", "a", "function", "in", "the", "binary", "that", "can", "be", "interacted", "with", "like", "a", "native", "python", "function", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/factory.py#L196-L217
train
Returns a Callable object that can be used as a interface for executing a virtual machine code like a native python function.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/factory.py
AngrObjectFactory.cc
def cc(self, args=None, ret_val=None, sp_delta=None, func_ty=None): """ Return a SimCC (calling convention) parametrized for this project and, optionally, a given function. :param args: A list of argument storage locations, as SimFunctionArguments. :param ret_val: The return ...
python
def cc(self, args=None, ret_val=None, sp_delta=None, func_ty=None): """ Return a SimCC (calling convention) parametrized for this project and, optionally, a given function. :param args: A list of argument storage locations, as SimFunctionArguments. :param ret_val: The return ...
[ "def", "cc", "(", "self", ",", "args", "=", "None", ",", "ret_val", "=", "None", ",", "sp_delta", "=", "None", ",", "func_ty", "=", "None", ")", ":", "return", "self", ".", "_default_cc", "(", "arch", "=", "self", ".", "project", ".", "arch", ",", ...
Return a SimCC (calling convention) parametrized for this project and, optionally, a given function. :param args: A list of argument storage locations, as SimFunctionArguments. :param ret_val: The return value storage location, as a SimFunctionArgument. :param sp_delta: Does this ...
[ "Return", "a", "SimCC", "(", "calling", "convention", ")", "parametrized", "for", "this", "project", "and", "optionally", "a", "given", "function", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/factory.py#L219-L244
train
Return a SimCC object parametrized for this project and optionally a given function.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/factory.py
AngrObjectFactory.cc_from_arg_kinds
def cc_from_arg_kinds(self, fp_args, ret_fp=None, sizes=None, sp_delta=None, func_ty=None): """ Get a SimCC (calling convention) that will extract floating-point/integral args correctly. :param arch: The Archinfo arch for this CC :param fp_args: A list, with one entry for eac...
python
def cc_from_arg_kinds(self, fp_args, ret_fp=None, sizes=None, sp_delta=None, func_ty=None): """ Get a SimCC (calling convention) that will extract floating-point/integral args correctly. :param arch: The Archinfo arch for this CC :param fp_args: A list, with one entry for eac...
[ "def", "cc_from_arg_kinds", "(", "self", ",", "fp_args", ",", "ret_fp", "=", "None", ",", "sizes", "=", "None", ",", "sp_delta", "=", "None", ",", "func_ty", "=", "None", ")", ":", "return", "self", ".", "_default_cc", ".", "from_arg_kinds", "(", "arch",...
Get a SimCC (calling convention) that will extract floating-point/integral args correctly. :param arch: The Archinfo arch for this CC :param fp_args: A list, with one entry for each argument the function can take. True if the argument is fp, false if it is integra...
[ "Get", "a", "SimCC", "(", "calling", "convention", ")", "that", "will", "extract", "floating", "-", "point", "/", "integral", "args", "correctly", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/factory.py#L246-L271
train
Returns a SimCC instance that will extract the arguments of the function.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/knowledge_plugins/functions/function.py
Function.blocks
def blocks(self): """ An iterator of all local blocks in the current function. :return: angr.lifter.Block instances. """ for block_addr, block in self._local_blocks.items(): try: yield self._get_block(block_addr, size=block.size, ...
python
def blocks(self): """ An iterator of all local blocks in the current function. :return: angr.lifter.Block instances. """ for block_addr, block in self._local_blocks.items(): try: yield self._get_block(block_addr, size=block.size, ...
[ "def", "blocks", "(", "self", ")", ":", "for", "block_addr", ",", "block", "in", "self", ".", "_local_blocks", ".", "items", "(", ")", ":", "try", ":", "yield", "self", ".", "_get_block", "(", "block_addr", ",", "size", "=", "block", ".", "size", ","...
An iterator of all local blocks in the current function. :return: angr.lifter.Block instances.
[ "An", "iterator", "of", "all", "local", "blocks", "in", "the", "current", "function", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/functions/function.py#L204-L216
train
An iterator of all local blocks in the current function.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/knowledge_plugins/functions/function.py
Function.operations
def operations(self): """ All of the operations that are done by this functions. """ return [op for block in self.blocks for op in block.vex.operations]
python
def operations(self): """ All of the operations that are done by this functions. """ return [op for block in self.blocks for op in block.vex.operations]
[ "def", "operations", "(", "self", ")", ":", "return", "[", "op", "for", "block", "in", "self", ".", "blocks", "for", "op", "in", "block", ".", "vex", ".", "operations", "]" ]
All of the operations that are done by this functions.
[ "All", "of", "the", "operations", "that", "are", "done", "by", "this", "functions", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/functions/function.py#L285-L289
train
Returns a list of all of the operations done by this functions.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/knowledge_plugins/functions/function.py
Function.code_constants
def code_constants(self): """ All of the constants that are used by this functions's code. """ # TODO: remove link register values return [const.value for block in self.blocks for const in block.vex.constants]
python
def code_constants(self): """ All of the constants that are used by this functions's code. """ # TODO: remove link register values return [const.value for block in self.blocks for const in block.vex.constants]
[ "def", "code_constants", "(", "self", ")", ":", "# TODO: remove link register values", "return", "[", "const", ".", "value", "for", "block", "in", "self", ".", "blocks", "for", "const", "in", "block", ".", "vex", ".", "constants", "]" ]
All of the constants that are used by this functions's code.
[ "All", "of", "the", "constants", "that", "are", "used", "by", "this", "functions", "s", "code", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/functions/function.py#L292-L297
train
All of the constants that are used by this functions s code.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/knowledge_plugins/functions/function.py
Function.string_references
def string_references(self, minimum_length=2, vex_only=False): """ All of the constant string references used by this function. :param minimum_length: The minimum length of strings to find (default is 1) :param vex_only: Only analyze VEX IR, don't interpret the entry state to de...
python
def string_references(self, minimum_length=2, vex_only=False): """ All of the constant string references used by this function. :param minimum_length: The minimum length of strings to find (default is 1) :param vex_only: Only analyze VEX IR, don't interpret the entry state to de...
[ "def", "string_references", "(", "self", ",", "minimum_length", "=", "2", ",", "vex_only", "=", "False", ")", ":", "strings", "=", "[", "]", "memory", "=", "self", ".", "_project", ".", "loader", ".", "memory", "# get known instruction addresses and call targets...
All of the constant string references used by this function. :param minimum_length: The minimum length of strings to find (default is 1) :param vex_only: Only analyze VEX IR, don't interpret the entry state to detect additional constants. :return: A list of tuples of (add...
[ "All", "of", "the", "constant", "string", "references", "used", "by", "this", "function", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/functions/function.py#L435-L477
train
Return a list of tuples of address and string that are used by this function.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/knowledge_plugins/functions/function.py
Function.local_runtime_values
def local_runtime_values(self): """ Tries to find all runtime values of this function which do not come from inputs. These values are generated by starting from a blank state and reanalyzing the basic blocks once each. Function calls are skipped, and back edges are never taken so these v...
python
def local_runtime_values(self): """ Tries to find all runtime values of this function which do not come from inputs. These values are generated by starting from a blank state and reanalyzing the basic blocks once each. Function calls are skipped, and back edges are never taken so these v...
[ "def", "local_runtime_values", "(", "self", ")", ":", "constants", "=", "set", "(", ")", "if", "not", "self", ".", "_project", ".", "loader", ".", "main_object", ".", "contains_addr", "(", "self", ".", "addr", ")", ":", "return", "constants", "# FIXME the ...
Tries to find all runtime values of this function which do not come from inputs. These values are generated by starting from a blank state and reanalyzing the basic blocks once each. Function calls are skipped, and back edges are never taken so these values are often unreliable, This function is...
[ "Tries", "to", "find", "all", "runtime", "values", "of", "this", "function", "which", "do", "not", "come", "from", "inputs", ".", "These", "values", "are", "generated", "by", "starting", "from", "a", "blank", "state", "and", "reanalyzing", "the", "basic", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/functions/function.py#L480-L570
train
Tries to find all runtime values of this function which do not come from inputs.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/knowledge_plugins/functions/function.py
Function.runtime_values
def runtime_values(self): """ All of the concrete values used by this function at runtime (i.e., including passed-in arguments and global values). """ constants = set() for b in self.block_addrs: for sirsb in self._function_manager._cfg.get_all_irsbs(b): ...
python
def runtime_values(self): """ All of the concrete values used by this function at runtime (i.e., including passed-in arguments and global values). """ constants = set() for b in self.block_addrs: for sirsb in self._function_manager._cfg.get_all_irsbs(b): ...
[ "def", "runtime_values", "(", "self", ")", ":", "constants", "=", "set", "(", ")", "for", "b", "in", "self", ".", "block_addrs", ":", "for", "sirsb", "in", "self", ".", "_function_manager", ".", "_cfg", ".", "get_all_irsbs", "(", "b", ")", ":", "for", ...
All of the concrete values used by this function at runtime (i.e., including passed-in arguments and global values).
[ "All", "of", "the", "concrete", "values", "used", "by", "this", "function", "at", "runtime", "(", "i", ".", "e", ".", "including", "passed", "-", "in", "arguments", "and", "global", "values", ")", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/functions/function.py#L573-L588
train
Returns a set of concrete values used by this function at runtime.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/knowledge_plugins/functions/function.py
Function.binary
def binary(self): """ Get the object this function belongs to. :return: The object this function belongs to. """ return self._project.loader.find_object_containing(self.addr, membership_check=False)
python
def binary(self): """ Get the object this function belongs to. :return: The object this function belongs to. """ return self._project.loader.find_object_containing(self.addr, membership_check=False)
[ "def", "binary", "(", "self", ")", ":", "return", "self", ".", "_project", ".", "loader", ".", "find_object_containing", "(", "self", ".", "addr", ",", "membership_check", "=", "False", ")" ]
Get the object this function belongs to. :return: The object this function belongs to.
[ "Get", "the", "object", "this", "function", "belongs", "to", ".", ":", "return", ":", "The", "object", "this", "function", "belongs", "to", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/functions/function.py#L647-L653
train
Returns the object this function belongs to.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/knowledge_plugins/functions/function.py
Function.add_jumpout_site
def add_jumpout_site(self, node): """ Add a custom jumpout site. :param node: The address of the basic block that control flow leaves during this transition. :return: None """ self._register_nodes(True, node) self._jumpout_sites.add(node) self....
python
def add_jumpout_site(self, node): """ Add a custom jumpout site. :param node: The address of the basic block that control flow leaves during this transition. :return: None """ self._register_nodes(True, node) self._jumpout_sites.add(node) self....
[ "def", "add_jumpout_site", "(", "self", ",", "node", ")", ":", "self", ".", "_register_nodes", "(", "True", ",", "node", ")", "self", ".", "_jumpout_sites", ".", "add", "(", "node", ")", "self", ".", "_add_endpoint", "(", "node", ",", "'transition'", ")"...
Add a custom jumpout site. :param node: The address of the basic block that control flow leaves during this transition. :return: None
[ "Add", "a", "custom", "jumpout", "site", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/functions/function.py#L655-L665
train
Add a custom jumpout site.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/knowledge_plugins/functions/function.py
Function.add_retout_site
def add_retout_site(self, node): """ Add a custom retout site. Retout (returning to outside of the function) sites are very rare. It mostly occurs during CFG recovery when we incorrectly identify the beginning of a function in the first iteration, and then correctly identify that ...
python
def add_retout_site(self, node): """ Add a custom retout site. Retout (returning to outside of the function) sites are very rare. It mostly occurs during CFG recovery when we incorrectly identify the beginning of a function in the first iteration, and then correctly identify that ...
[ "def", "add_retout_site", "(", "self", ",", "node", ")", ":", "self", ".", "_register_nodes", "(", "True", ",", "node", ")", "self", ".", "_retout_sites", ".", "add", "(", "node", ")", "self", ".", "_add_endpoint", "(", "node", ",", "'return'", ")" ]
Add a custom retout site. Retout (returning to outside of the function) sites are very rare. It mostly occurs during CFG recovery when we incorrectly identify the beginning of a function in the first iteration, and then correctly identify that function later in the same iteration (function alig...
[ "Add", "a", "custom", "retout", "site", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/functions/function.py#L667-L685
train
Add a custom retout site.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/knowledge_plugins/functions/function.py
Function._get_initial_name
def _get_initial_name(self): """ Determine the most suitable name of the function. :return: The initial function name. :rtype: string """ name = None addr = self.addr # Try to get a name from existing labels if self._function_manager is n...
python
def _get_initial_name(self): """ Determine the most suitable name of the function. :return: The initial function name. :rtype: string """ name = None addr = self.addr # Try to get a name from existing labels if self._function_manager is n...
[ "def", "_get_initial_name", "(", "self", ")", ":", "name", "=", "None", "addr", "=", "self", ".", "addr", "# Try to get a name from existing labels", "if", "self", ".", "_function_manager", "is", "not", "None", ":", "if", "addr", "in", "self", ".", "_function_...
Determine the most suitable name of the function. :return: The initial function name. :rtype: string
[ "Determine", "the", "most", "suitable", "name", "of", "the", "function", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/functions/function.py#L687-L717
train
Determine the most suitable name of the function.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/knowledge_plugins/functions/function.py
Function._get_initial_binary_name
def _get_initial_binary_name(self): """ Determine the name of the binary where this function is. :return: None """ binary_name = None # if this function is a simprocedure but not a syscall, use its library name as # its binary name # if it is a syscall,...
python
def _get_initial_binary_name(self): """ Determine the name of the binary where this function is. :return: None """ binary_name = None # if this function is a simprocedure but not a syscall, use its library name as # its binary name # if it is a syscall,...
[ "def", "_get_initial_binary_name", "(", "self", ")", ":", "binary_name", "=", "None", "# if this function is a simprocedure but not a syscall, use its library name as", "# its binary name", "# if it is a syscall, fall back to use self.binary.binary which explicitly says cle##kernel", "if", ...
Determine the name of the binary where this function is. :return: None
[ "Determine", "the", "name", "of", "the", "binary", "where", "this", "function", "is", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/functions/function.py#L719-L739
train
Determine the name of the initial binary name for this function.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/knowledge_plugins/functions/function.py
Function._get_initial_returning
def _get_initial_returning(self): """ Determine if this function returns or not *if it is hooked by a SimProcedure or a user hook*. :return: True if the hooker returns, False otherwise. :rtype: bool """ hooker = None if self.is_syscall: hooker...
python
def _get_initial_returning(self): """ Determine if this function returns or not *if it is hooked by a SimProcedure or a user hook*. :return: True if the hooker returns, False otherwise. :rtype: bool """ hooker = None if self.is_syscall: hooker...
[ "def", "_get_initial_returning", "(", "self", ")", ":", "hooker", "=", "None", "if", "self", ".", "is_syscall", ":", "hooker", "=", "self", ".", "project", ".", "simos", ".", "syscall_from_addr", "(", "self", ".", "addr", ")", "elif", "self", ".", "is_si...
Determine if this function returns or not *if it is hooked by a SimProcedure or a user hook*. :return: True if the hooker returns, False otherwise. :rtype: bool
[ "Determine", "if", "this", "function", "returns", "or", "not", "*", "if", "it", "is", "hooked", "by", "a", "SimProcedure", "or", "a", "user", "hook", "*", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/functions/function.py#L741-L758
train
Determine if this function returns or not.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/knowledge_plugins/functions/function.py
Function._transit_to
def _transit_to(self, from_node, to_node, outside=False, ins_addr=None, stmt_idx=None): """ Registers an edge between basic blocks in this function's transition graph. Arguments are CodeNode objects. :param from_node The address of the basic block that control ...
python
def _transit_to(self, from_node, to_node, outside=False, ins_addr=None, stmt_idx=None): """ Registers an edge between basic blocks in this function's transition graph. Arguments are CodeNode objects. :param from_node The address of the basic block that control ...
[ "def", "_transit_to", "(", "self", ",", "from_node", ",", "to_node", ",", "outside", "=", "False", ",", "ins_addr", "=", "None", ",", "stmt_idx", "=", "None", ")", ":", "if", "outside", ":", "self", ".", "_register_nodes", "(", "True", ",", "from_node", ...
Registers an edge between basic blocks in this function's transition graph. Arguments are CodeNode objects. :param from_node The address of the basic block that control flow leaves during this transition. :param to_node The address of ...
[ "Registers", "an", "edge", "between", "basic", "blocks", "in", "this", "function", "s", "transition", "graph", ".", "Arguments", "are", "CodeNode", "objects", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/functions/function.py#L783-L818
train
Internal method that creates a transition between two basic blocks.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/knowledge_plugins/functions/function.py
Function._call_to
def _call_to(self, from_node, to_func, ret_node, stmt_idx=None, ins_addr=None, return_to_outside=False): """ Registers an edge between the caller basic block and callee function. :param from_addr: The basic block that control flow leaves during the transition. :type from_addr: angr...
python
def _call_to(self, from_node, to_func, ret_node, stmt_idx=None, ins_addr=None, return_to_outside=False): """ Registers an edge between the caller basic block and callee function. :param from_addr: The basic block that control flow leaves during the transition. :type from_addr: angr...
[ "def", "_call_to", "(", "self", ",", "from_node", ",", "to_func", ",", "ret_node", ",", "stmt_idx", "=", "None", ",", "ins_addr", "=", "None", ",", "return_to_outside", "=", "False", ")", ":", "self", ".", "_register_nodes", "(", "True", ",", "from_node", ...
Registers an edge between the caller basic block and callee function. :param from_addr: The basic block that control flow leaves during the transition. :type from_addr: angr.knowledge.CodeNode :param to_func: The function that we are calling :type to_func: Function ...
[ "Registers", "an", "edge", "between", "the", "caller", "basic", "block", "and", "callee", "function", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/functions/function.py#L820-L846
train
Internal method that registers an edge between the caller basic block and callee function.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/knowledge_plugins/functions/function.py
Function._add_return_site
def _add_return_site(self, return_site): """ Registers a basic block as a site for control flow to return from this function. :param CodeNode return_site: The block node that ends with a return. """ self._register_nodes(True, return_site) self._ret_sites.add(return_...
python
def _add_return_site(self, return_site): """ Registers a basic block as a site for control flow to return from this function. :param CodeNode return_site: The block node that ends with a return. """ self._register_nodes(True, return_site) self._ret_sites.add(return_...
[ "def", "_add_return_site", "(", "self", ",", "return_site", ")", ":", "self", ".", "_register_nodes", "(", "True", ",", "return_site", ")", "self", ".", "_ret_sites", ".", "add", "(", "return_site", ")", "# A return site must be an endpoint of the function - you canno...
Registers a basic block as a site for control flow to return from this function. :param CodeNode return_site: The block node that ends with a return.
[ "Registers", "a", "basic", "block", "as", "a", "site", "for", "control", "flow", "to", "return", "from", "this", "function", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/functions/function.py#L898-L909
train
Adds a return site to the list of return sites that this function returns.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/knowledge_plugins/functions/function.py
Function._add_call_site
def _add_call_site(self, call_site_addr, call_target_addr, retn_addr): """ Registers a basic block as calling a function and returning somewhere. :param call_site_addr: The address of a basic block that ends in a call. :param call_target_addr: The address of the target of said...
python
def _add_call_site(self, call_site_addr, call_target_addr, retn_addr): """ Registers a basic block as calling a function and returning somewhere. :param call_site_addr: The address of a basic block that ends in a call. :param call_target_addr: The address of the target of said...
[ "def", "_add_call_site", "(", "self", ",", "call_site_addr", ",", "call_target_addr", ",", "retn_addr", ")", ":", "self", ".", "_call_sites", "[", "call_site_addr", "]", "=", "(", "call_target_addr", ",", "retn_addr", ")" ]
Registers a basic block as calling a function and returning somewhere. :param call_site_addr: The address of a basic block that ends in a call. :param call_target_addr: The address of the target of said call. :param retn_addr: The address that said call will return to.
[ "Registers", "a", "basic", "block", "as", "calling", "a", "function", "and", "returning", "somewhere", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/functions/function.py#L911-L919
train
Adds a call site to the internal list of call sites.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/knowledge_plugins/functions/function.py
Function.mark_nonreturning_calls_endpoints
def mark_nonreturning_calls_endpoints(self): """ Iterate through all call edges in transition graph. For each call a non-returning function, mark the source basic block as an endpoint. This method should only be executed once all functions are recovered and analyzed by CFG recovery, so ...
python
def mark_nonreturning_calls_endpoints(self): """ Iterate through all call edges in transition graph. For each call a non-returning function, mark the source basic block as an endpoint. This method should only be executed once all functions are recovered and analyzed by CFG recovery, so ...
[ "def", "mark_nonreturning_calls_endpoints", "(", "self", ")", ":", "for", "src", ",", "dst", ",", "data", "in", "self", ".", "transition_graph", ".", "edges", "(", "data", "=", "True", ")", ":", "if", "'type'", "in", "data", "and", "data", "[", "'type'",...
Iterate through all call edges in transition graph. For each call a non-returning function, mark the source basic block as an endpoint. This method should only be executed once all functions are recovered and analyzed by CFG recovery, so we know whether each function returns or not. :r...
[ "Iterate", "through", "all", "call", "edges", "in", "transition", "graph", ".", "For", "each", "call", "a", "non", "-", "returning", "function", "mark", "the", "source", "basic", "block", "as", "an", "endpoint", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/functions/function.py#L972-L992
train
Iterate through all non - returning functions and mark their endpoints as non - returning calls.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/knowledge_plugins/functions/function.py
Function.graph
def graph(self): """ Return a local transition graph that only contain nodes in current function. """ if self._local_transition_graph is not None: return self._local_transition_graph g = networkx.DiGraph() if self.startpoint is not None: g.add_no...
python
def graph(self): """ Return a local transition graph that only contain nodes in current function. """ if self._local_transition_graph is not None: return self._local_transition_graph g = networkx.DiGraph() if self.startpoint is not None: g.add_no...
[ "def", "graph", "(", "self", ")", ":", "if", "self", ".", "_local_transition_graph", "is", "not", "None", ":", "return", "self", ".", "_local_transition_graph", "g", "=", "networkx", ".", "DiGraph", "(", ")", "if", "self", ".", "startpoint", "is", "not", ...
Return a local transition graph that only contain nodes in current function.
[ "Return", "a", "local", "transition", "graph", "that", "only", "contain", "nodes", "in", "current", "function", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/functions/function.py#L1027-L1050
train
Return a networkx. DiGraph that only contains nodes in current function.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/knowledge_plugins/functions/function.py
Function.subgraph
def subgraph(self, ins_addrs): """ Generate a sub control flow graph of instruction addresses based on self.graph :param iterable ins_addrs: A collection of instruction addresses that should be included in the subgraph. :return: A subgraph. :rtype: networkx.DiGraph """ ...
python
def subgraph(self, ins_addrs): """ Generate a sub control flow graph of instruction addresses based on self.graph :param iterable ins_addrs: A collection of instruction addresses that should be included in the subgraph. :return: A subgraph. :rtype: networkx.DiGraph """ ...
[ "def", "subgraph", "(", "self", ",", "ins_addrs", ")", ":", "# find all basic blocks that include those instructions", "blocks", "=", "[", "]", "block_addr_to_insns", "=", "{", "}", "for", "b", "in", "self", ".", "_local_blocks", ".", "values", "(", ")", ":", ...
Generate a sub control flow graph of instruction addresses based on self.graph :param iterable ins_addrs: A collection of instruction addresses that should be included in the subgraph. :return: A subgraph. :rtype: networkx.DiGraph
[ "Generate", "a", "sub", "control", "flow", "graph", "of", "instruction", "addresses", "based", "on", "self", ".", "graph" ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/functions/function.py#L1052-L1094
train
Generate a sub - control flow graph of instruction addresses based on self. graph MimeType.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/knowledge_plugins/functions/function.py
Function.instruction_size
def instruction_size(self, insn_addr): """ Get the size of the instruction specified by `insn_addr`. :param int insn_addr: Address of the instruction :return: Size of the instruction in bytes, or None if the instruction is not found. :rtype: int """ for b in sel...
python
def instruction_size(self, insn_addr): """ Get the size of the instruction specified by `insn_addr`. :param int insn_addr: Address of the instruction :return: Size of the instruction in bytes, or None if the instruction is not found. :rtype: int """ for b in sel...
[ "def", "instruction_size", "(", "self", ",", "insn_addr", ")", ":", "for", "b", "in", "self", ".", "blocks", ":", "block", "=", "self", ".", "_get_block", "(", "b", ".", "addr", ",", "size", "=", "b", ".", "size", ",", "byte_string", "=", "b", ".",...
Get the size of the instruction specified by `insn_addr`. :param int insn_addr: Address of the instruction :return: Size of the instruction in bytes, or None if the instruction is not found. :rtype: int
[ "Get", "the", "size", "of", "the", "instruction", "specified", "by", "insn_addr", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/functions/function.py#L1096-L1116
train
Get the size of the instruction specified by insn_addr.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/knowledge_plugins/functions/function.py
Function.dbg_draw
def dbg_draw(self, filename): """ Draw the graph and save it to a PNG file. """ import matplotlib.pyplot as pyplot # pylint: disable=import-error from networkx.drawing.nx_agraph import graphviz_layout # pylint: disable=import-error tmp_graph = networkx.DiGraph() ...
python
def dbg_draw(self, filename): """ Draw the graph and save it to a PNG file. """ import matplotlib.pyplot as pyplot # pylint: disable=import-error from networkx.drawing.nx_agraph import graphviz_layout # pylint: disable=import-error tmp_graph = networkx.DiGraph() ...
[ "def", "dbg_draw", "(", "self", ",", "filename", ")", ":", "import", "matplotlib", ".", "pyplot", "as", "pyplot", "# pylint: disable=import-error", "from", "networkx", ".", "drawing", ".", "nx_agraph", "import", "graphviz_layout", "# pylint: disable=import-error", "tm...
Draw the graph and save it to a PNG file.
[ "Draw", "the", "graph", "and", "save", "it", "to", "a", "PNG", "file", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/functions/function.py#L1124-L1142
train
Draw the graph and save it to a PNG file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/knowledge_plugins/functions/function.py
Function._add_argument_register
def _add_argument_register(self, reg_offset): """ Registers a register offset as being used as an argument to the function. :param reg_offset: The offset of the register to register. """ if reg_offset in self._function_manager._arg_registers and \ re...
python
def _add_argument_register(self, reg_offset): """ Registers a register offset as being used as an argument to the function. :param reg_offset: The offset of the register to register. """ if reg_offset in self._function_manager._arg_registers and \ re...
[ "def", "_add_argument_register", "(", "self", ",", "reg_offset", ")", ":", "if", "reg_offset", "in", "self", ".", "_function_manager", ".", "_arg_registers", "and", "reg_offset", "not", "in", "self", ".", "_argument_registers", ":", "self", ".", "_argument_registe...
Registers a register offset as being used as an argument to the function. :param reg_offset: The offset of the register to register.
[ "Registers", "a", "register", "offset", "as", "being", "used", "as", "an", "argument", "to", "the", "function", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/functions/function.py#L1144-L1152
train
Adds an offset to the list of registers that are used as an argument to the function.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/knowledge_plugins/functions/function.py
Function.normalize
def normalize(self): """ Make sure all basic blocks in the transition graph of this function do not overlap. You will end up with a CFG that IDA Pro generates. This method does not touch the CFG result. You may call CFG{Emulated, Fast}.normalize() for that matter. :return: None...
python
def normalize(self): """ Make sure all basic blocks in the transition graph of this function do not overlap. You will end up with a CFG that IDA Pro generates. This method does not touch the CFG result. You may call CFG{Emulated, Fast}.normalize() for that matter. :return: None...
[ "def", "normalize", "(", "self", ")", ":", "# let's put a check here", "if", "self", ".", "startpoint", "is", "None", ":", "# this function is empty", "l", ".", "debug", "(", "'Unexpected error: %s does not have any blocks. normalize() fails.'", ",", "repr", "(", "self"...
Make sure all basic blocks in the transition graph of this function do not overlap. You will end up with a CFG that IDA Pro generates. This method does not touch the CFG result. You may call CFG{Emulated, Fast}.normalize() for that matter. :return: None
[ "Make", "sure", "all", "basic", "blocks", "in", "the", "transition", "graph", "of", "this", "function", "do", "not", "overlap", ".", "You", "will", "end", "up", "with", "a", "CFG", "that", "IDA", "Pro", "generates", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/functions/function.py#L1173-L1294
train
This function is used to normalize the CFG by removing all basic blocks that are not part of the transition graph.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/knowledge_plugins/functions/function.py
Function.find_declaration
def find_declaration(self): """ Find the most likely function declaration from the embedded collection of prototypes, set it to self.prototype, and update self.calling_convention with the declaration. :return: None """ # determine the library name if not self.i...
python
def find_declaration(self): """ Find the most likely function declaration from the embedded collection of prototypes, set it to self.prototype, and update self.calling_convention with the declaration. :return: None """ # determine the library name if not self.i...
[ "def", "find_declaration", "(", "self", ")", ":", "# determine the library name", "if", "not", "self", ".", "is_plt", ":", "binary_name", "=", "self", ".", "binary_name", "if", "binary_name", "not", "in", "SIM_LIBRARIES", ":", "return", "else", ":", "binary_name...
Find the most likely function declaration from the embedded collection of prototypes, set it to self.prototype, and update self.calling_convention with the declaration. :return: None
[ "Find", "the", "most", "likely", "function", "declaration", "from", "the", "embedded", "collection", "of", "prototypes", "set", "it", "to", "self", ".", "prototype", "and", "update", "self", ".", "calling_convention", "with", "the", "declaration", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/knowledge_plugins/functions/function.py#L1296-L1338
train
Find the most likely function declaration from the embedded collection of prototypes set self. prototype and self. calling_convention with the declaration.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/callstack.py
CallStack._rfind
def _rfind(lst, item): """ Reverse look-up. :param list lst: The list to look up in. :param item: The item to look for. :return: Offset of the item if found. A ValueError is raised if the item is not in the list. :rtype: int """ try: return d...
python
def _rfind(lst, item): """ Reverse look-up. :param list lst: The list to look up in. :param item: The item to look for. :return: Offset of the item if found. A ValueError is raised if the item is not in the list. :rtype: int """ try: return d...
[ "def", "_rfind", "(", "lst", ",", "item", ")", ":", "try", ":", "return", "dropwhile", "(", "lambda", "x", ":", "lst", "[", "x", "]", "!=", "item", ",", "next", "(", "reversed", "(", "range", "(", "len", "(", "lst", ")", ")", ")", ")", ")", "...
Reverse look-up. :param list lst: The list to look up in. :param item: The item to look for. :return: Offset of the item if found. A ValueError is raised if the item is not in the list. :rtype: int
[ "Reverse", "look", "-", "up", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/callstack.py#L203-L217
train
Reverse look - up.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/callstack.py
CallStack.push
def push(self, cf): """ Push the frame cf onto the stack. Return the new stack. """ cf.next = self if self.state is not None: self.state.register_plugin('callstack', cf) self.state.history.recent_stack_actions.append(CallStackAction( hash(c...
python
def push(self, cf): """ Push the frame cf onto the stack. Return the new stack. """ cf.next = self if self.state is not None: self.state.register_plugin('callstack', cf) self.state.history.recent_stack_actions.append(CallStackAction( hash(c...
[ "def", "push", "(", "self", ",", "cf", ")", ":", "cf", ".", "next", "=", "self", "if", "self", ".", "state", "is", "not", "None", ":", "self", ".", "state", ".", "register_plugin", "(", "'callstack'", ",", "cf", ")", "self", ".", "state", ".", "h...
Push the frame cf onto the stack. Return the new stack.
[ "Push", "the", "frame", "cf", "onto", "the", "stack", ".", "Return", "the", "new", "stack", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/callstack.py#L232-L243
train
Push the frame cf onto the stack. Return the new stack.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/callstack.py
CallStack.pop
def pop(self): """ Pop the top frame from the stack. Return the new stack. """ if self.next is None: raise SimEmptyCallStackError("Cannot pop a frame from an empty call stack.") new_list = self.next.copy({}) if self.state is not None: self.state.r...
python
def pop(self): """ Pop the top frame from the stack. Return the new stack. """ if self.next is None: raise SimEmptyCallStackError("Cannot pop a frame from an empty call stack.") new_list = self.next.copy({}) if self.state is not None: self.state.r...
[ "def", "pop", "(", "self", ")", ":", "if", "self", ".", "next", "is", "None", ":", "raise", "SimEmptyCallStackError", "(", "\"Cannot pop a frame from an empty call stack.\"", ")", "new_list", "=", "self", ".", "next", ".", "copy", "(", "{", "}", ")", "if", ...
Pop the top frame from the stack. Return the new stack.
[ "Pop", "the", "top", "frame", "from", "the", "stack", ".", "Return", "the", "new", "stack", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/callstack.py#L245-L259
train
Pop the top frame from the stack. Return the new stack.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/callstack.py
CallStack.call
def call(self, callsite_addr, addr, retn_target=None, stack_pointer=None): """ Push a stack frame into the call stack. This method is called when calling a function in CFG recovery. :param int callsite_addr: Address of the call site :param int addr: Address of the call target :p...
python
def call(self, callsite_addr, addr, retn_target=None, stack_pointer=None): """ Push a stack frame into the call stack. This method is called when calling a function in CFG recovery. :param int callsite_addr: Address of the call site :param int addr: Address of the call target :p...
[ "def", "call", "(", "self", ",", "callsite_addr", ",", "addr", ",", "retn_target", "=", "None", ",", "stack_pointer", "=", "None", ")", ":", "frame", "=", "CallStack", "(", "call_site_addr", "=", "callsite_addr", ",", "func_addr", "=", "addr", ",", "ret_ad...
Push a stack frame into the call stack. This method is called when calling a function in CFG recovery. :param int callsite_addr: Address of the call site :param int addr: Address of the call target :param int or None retn_target: Address of the return target :param int stack_pointer: Va...
[ "Push", "a", "stack", "frame", "into", "the", "call", "stack", ".", "This", "method", "is", "called", "when", "calling", "a", "function", "in", "CFG", "recovery", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/callstack.py#L261-L274
train
Push a stack frame into the call stack. This method is called when calling a function in CFG recovery.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/callstack.py
CallStack.ret
def ret(self, retn_target=None): """ Pop one or many call frames from the stack. This method is called when returning from a function in CFG recovery. :param int retn_target: The target to return to. :return: None """ if retn_target is None: return s...
python
def ret(self, retn_target=None): """ Pop one or many call frames from the stack. This method is called when returning from a function in CFG recovery. :param int retn_target: The target to return to. :return: None """ if retn_target is None: return s...
[ "def", "ret", "(", "self", ",", "retn_target", "=", "None", ")", ":", "if", "retn_target", "is", "None", ":", "return", "self", ".", "pop", "(", ")", "# We may want to return to several levels up there, not only a", "# single stack frame", "return_target_index", "=", ...
Pop one or many call frames from the stack. This method is called when returning from a function in CFG recovery. :param int retn_target: The target to return to. :return: None
[ "Pop", "one", "or", "many", "call", "frames", "from", "the", "stack", ".", "This", "method", "is", "called", "when", "returning", "from", "a", "function", "in", "CFG", "recovery", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/callstack.py#L276-L301
train
Pop one or many call frames from the stack.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/callstack.py
CallStack.dbg_repr
def dbg_repr(self): """ Debugging representation of this CallStack object. :return: Details of this CalLStack :rtype: str """ stack = [ ] for i, frame in enumerate(self): s = "%d | %s -> %s, returning to %s" % ( i, "No...
python
def dbg_repr(self): """ Debugging representation of this CallStack object. :return: Details of this CalLStack :rtype: str """ stack = [ ] for i, frame in enumerate(self): s = "%d | %s -> %s, returning to %s" % ( i, "No...
[ "def", "dbg_repr", "(", "self", ")", ":", "stack", "=", "[", "]", "for", "i", ",", "frame", "in", "enumerate", "(", "self", ")", ":", "s", "=", "\"%d | %s -> %s, returning to %s\"", "%", "(", "i", ",", "\"None\"", "if", "frame", ".", "call_site_addr", ...
Debugging representation of this CallStack object. :return: Details of this CalLStack :rtype: str
[ "Debugging", "representation", "of", "this", "CallStack", "object", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/callstack.py#L308-L326
train
Debugging representation of this CalLStack object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/callstack.py
CallStack.stack_suffix
def stack_suffix(self, context_sensitivity_level): """ Generate the stack suffix. A stack suffix can be used as the key to a SimRun in CFG recovery. :param int context_sensitivity_level: Level of context sensitivity. :return: A tuple of stack suffix. :rtype: tuple """ ...
python
def stack_suffix(self, context_sensitivity_level): """ Generate the stack suffix. A stack suffix can be used as the key to a SimRun in CFG recovery. :param int context_sensitivity_level: Level of context sensitivity. :return: A tuple of stack suffix. :rtype: tuple """ ...
[ "def", "stack_suffix", "(", "self", ",", "context_sensitivity_level", ")", ":", "ret", "=", "(", ")", "for", "frame", "in", "self", ":", "if", "len", "(", "ret", ")", ">=", "context_sensitivity_level", "*", "2", ":", "break", "ret", "=", "(", "frame", ...
Generate the stack suffix. A stack suffix can be used as the key to a SimRun in CFG recovery. :param int context_sensitivity_level: Level of context sensitivity. :return: A tuple of stack suffix. :rtype: tuple
[ "Generate", "the", "stack", "suffix", ".", "A", "stack", "suffix", "can", "be", "used", "as", "the", "key", "to", "a", "SimRun", "in", "CFG", "recovery", "." ]
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/callstack.py#L328-L347
train
Generate the stack suffix.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
angr/angr
angr/state_plugins/callstack.py
CallStack._find_return_target
def _find_return_target(self, target): """ Check if the return target exists in the stack, and return the index if exists. We always search from the most recent call stack frame since the most recent frame has a higher chance to be hit in normal CFG recovery. :param int target: Target o...
python
def _find_return_target(self, target): """ Check if the return target exists in the stack, and return the index if exists. We always search from the most recent call stack frame since the most recent frame has a higher chance to be hit in normal CFG recovery. :param int target: Target o...
[ "def", "_find_return_target", "(", "self", ",", "target", ")", ":", "for", "i", ",", "frame", "in", "enumerate", "(", "self", ")", ":", "if", "frame", ".", "ret_addr", "==", "target", ":", "return", "i", "return", "None" ]
Check if the return target exists in the stack, and return the index if exists. We always search from the most recent call stack frame since the most recent frame has a higher chance to be hit in normal CFG recovery. :param int target: Target of the return. :return: The index of the object ...
[ "Check", "if", "the", "return", "target", "exists", "in", "the", "stack", "and", "return", "the", "index", "if", "exists", ".", "We", "always", "search", "from", "the", "most", "recent", "call", "stack", "frame", "since", "the", "most", "recent", "frame", ...
4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/state_plugins/callstack.py#L353-L366
train
Searches the stack for the return target and returns the index if exists.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
shidenggui/easyquotation
easyquotation/helpers.py
update_stock_codes
def update_stock_codes(): """获取所有股票 ID 到 all_stock_code 目录下""" all_stock_codes_url = "http://www.shdjt.com/js/lib/astock.js" grep_stock_codes = re.compile(r"~(\d+)`") response = requests.get(all_stock_codes_url) all_stock_codes = grep_stock_codes.findall(response.text) with open(stock_code_path(...
python
def update_stock_codes(): """获取所有股票 ID 到 all_stock_code 目录下""" all_stock_codes_url = "http://www.shdjt.com/js/lib/astock.js" grep_stock_codes = re.compile(r"~(\d+)`") response = requests.get(all_stock_codes_url) all_stock_codes = grep_stock_codes.findall(response.text) with open(stock_code_path(...
[ "def", "update_stock_codes", "(", ")", ":", "all_stock_codes_url", "=", "\"http://www.shdjt.com/js/lib/astock.js\"", "grep_stock_codes", "=", "re", ".", "compile", "(", "r\"~(\\d+)`\"", ")", "response", "=", "requests", ".", "get", "(", "all_stock_codes_url", ")", "al...
获取所有股票 ID 到 all_stock_code 目录下
[ "获取所有股票", "ID", "到", "all_stock_code", "目录下" ]
a75820db4f05f5386e1c1024d05b0bfc1de6cbda
https://github.com/shidenggui/easyquotation/blob/a75820db4f05f5386e1c1024d05b0bfc1de6cbda/easyquotation/helpers.py#L11-L18
train
Update all_stock_code with the new stock codes
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
shidenggui/easyquotation
easyquotation/helpers.py
get_stock_codes
def get_stock_codes(realtime=False): """获取所有股票 ID 到 all_stock_code 目录下""" if realtime: all_stock_codes_url = "http://www.shdjt.com/js/lib/astock.js" grep_stock_codes = re.compile(r"~(\d+)`") response = requests.get(all_stock_codes_url) stock_codes = grep_stock_codes.findall(respo...
python
def get_stock_codes(realtime=False): """获取所有股票 ID 到 all_stock_code 目录下""" if realtime: all_stock_codes_url = "http://www.shdjt.com/js/lib/astock.js" grep_stock_codes = re.compile(r"~(\d+)`") response = requests.get(all_stock_codes_url) stock_codes = grep_stock_codes.findall(respo...
[ "def", "get_stock_codes", "(", "realtime", "=", "False", ")", ":", "if", "realtime", ":", "all_stock_codes_url", "=", "\"http://www.shdjt.com/js/lib/astock.js\"", "grep_stock_codes", "=", "re", ".", "compile", "(", "r\"~(\\d+)`\"", ")", "response", "=", "requests", ...
获取所有股票 ID 到 all_stock_code 目录下
[ "获取所有股票", "ID", "到", "all_stock_code", "目录下" ]
a75820db4f05f5386e1c1024d05b0bfc1de6cbda
https://github.com/shidenggui/easyquotation/blob/a75820db4f05f5386e1c1024d05b0bfc1de6cbda/easyquotation/helpers.py#L21-L33
train
Get all stock codes
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
shidenggui/easyquotation
easyquotation/basequotation.py
BaseQuotation.real
def real(self, stock_codes, prefix=False): """return specific stocks real quotation :param stock_codes: stock code or list of stock code, when prefix is True, stock code must start with sh/sz :param prefix: if prefix i True, stock_codes must contain sh/sz market flag....
python
def real(self, stock_codes, prefix=False): """return specific stocks real quotation :param stock_codes: stock code or list of stock code, when prefix is True, stock code must start with sh/sz :param prefix: if prefix i True, stock_codes must contain sh/sz market flag....
[ "def", "real", "(", "self", ",", "stock_codes", ",", "prefix", "=", "False", ")", ":", "if", "not", "isinstance", "(", "stock_codes", ",", "list", ")", ":", "stock_codes", "=", "[", "stock_codes", "]", "stock_list", "=", "self", ".", "gen_stock_list", "(...
return specific stocks real quotation :param stock_codes: stock code or list of stock code, when prefix is True, stock code must start with sh/sz :param prefix: if prefix i True, stock_codes must contain sh/sz market flag. If prefix is False, index quotation can't return ...
[ "return", "specific", "stocks", "real", "quotation", ":", "param", "stock_codes", ":", "stock", "code", "or", "list", "of", "stock", "code", "when", "prefix", "is", "True", "stock", "code", "must", "start", "with", "sh", "/", "sz", ":", "param", "prefix", ...
a75820db4f05f5386e1c1024d05b0bfc1de6cbda
https://github.com/shidenggui/easyquotation/blob/a75820db4f05f5386e1c1024d05b0bfc1de6cbda/easyquotation/basequotation.py#L73-L87
train
return specific stocks real quotation
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
shidenggui/easyquotation
easyquotation/basequotation.py
BaseQuotation.market_snapshot
def market_snapshot(self, prefix=False): """return all market quotation snapshot :param prefix: if prefix is True, return quotation dict's stock_code key start with sh/sz market flag """ return self.get_stock_data(self.stock_list, prefix=prefix)
python
def market_snapshot(self, prefix=False): """return all market quotation snapshot :param prefix: if prefix is True, return quotation dict's stock_code key start with sh/sz market flag """ return self.get_stock_data(self.stock_list, prefix=prefix)
[ "def", "market_snapshot", "(", "self", ",", "prefix", "=", "False", ")", ":", "return", "self", ".", "get_stock_data", "(", "self", ".", "stock_list", ",", "prefix", "=", "prefix", ")" ]
return all market quotation snapshot :param prefix: if prefix is True, return quotation dict's stock_code key start with sh/sz market flag
[ "return", "all", "market", "quotation", "snapshot", ":", "param", "prefix", ":", "if", "prefix", "is", "True", "return", "quotation", "dict", "s", "stock_code", "key", "start", "with", "sh", "/", "sz", "market", "flag" ]
a75820db4f05f5386e1c1024d05b0bfc1de6cbda
https://github.com/shidenggui/easyquotation/blob/a75820db4f05f5386e1c1024d05b0bfc1de6cbda/easyquotation/basequotation.py#L89-L94
train
return all market quotation snapshot
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
shidenggui/easyquotation
easyquotation/basequotation.py
BaseQuotation.get_stock_data
def get_stock_data(self, stock_list, **kwargs): """获取并格式化股票信息""" res = self._fetch_stock_data(stock_list) return self.format_response_data(res, **kwargs)
python
def get_stock_data(self, stock_list, **kwargs): """获取并格式化股票信息""" res = self._fetch_stock_data(stock_list) return self.format_response_data(res, **kwargs)
[ "def", "get_stock_data", "(", "self", ",", "stock_list", ",", "*", "*", "kwargs", ")", ":", "res", "=", "self", ".", "_fetch_stock_data", "(", "stock_list", ")", "return", "self", ".", "format_response_data", "(", "res", ",", "*", "*", "kwargs", ")" ]
获取并格式化股票信息
[ "获取并格式化股票信息" ]
a75820db4f05f5386e1c1024d05b0bfc1de6cbda
https://github.com/shidenggui/easyquotation/blob/a75820db4f05f5386e1c1024d05b0bfc1de6cbda/easyquotation/basequotation.py#L109-L112
train
Get stock data
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
shidenggui/easyquotation
easyquotation/basequotation.py
BaseQuotation._fetch_stock_data
def _fetch_stock_data(self, stock_list): """获取股票信息""" pool = multiprocessing.pool.ThreadPool(len(stock_list)) try: res = pool.map(self.get_stocks_by_range, stock_list) finally: pool.close() return [d for d in res if d is not None]
python
def _fetch_stock_data(self, stock_list): """获取股票信息""" pool = multiprocessing.pool.ThreadPool(len(stock_list)) try: res = pool.map(self.get_stocks_by_range, stock_list) finally: pool.close() return [d for d in res if d is not None]
[ "def", "_fetch_stock_data", "(", "self", ",", "stock_list", ")", ":", "pool", "=", "multiprocessing", ".", "pool", ".", "ThreadPool", "(", "len", "(", "stock_list", ")", ")", "try", ":", "res", "=", "pool", ".", "map", "(", "self", ".", "get_stocks_by_ra...
获取股票信息
[ "获取股票信息" ]
a75820db4f05f5386e1c1024d05b0bfc1de6cbda
https://github.com/shidenggui/easyquotation/blob/a75820db4f05f5386e1c1024d05b0bfc1de6cbda/easyquotation/basequotation.py#L114-L121
train
Get stock data from list
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
shidenggui/easyquotation
easyquotation/timekline.py
TimeKline._fetch_stock_data
def _fetch_stock_data(self, stock_list): """因为 timekline 的返回没有带对应的股票代码,所以要手动带上""" res = super()._fetch_stock_data(stock_list) with_stock = [] for stock, resp in zip(stock_list, res): if resp is not None: with_stock.append((stock, resp)) return with_st...
python
def _fetch_stock_data(self, stock_list): """因为 timekline 的返回没有带对应的股票代码,所以要手动带上""" res = super()._fetch_stock_data(stock_list) with_stock = [] for stock, resp in zip(stock_list, res): if resp is not None: with_stock.append((stock, resp)) return with_st...
[ "def", "_fetch_stock_data", "(", "self", ",", "stock_list", ")", ":", "res", "=", "super", "(", ")", ".", "_fetch_stock_data", "(", "stock_list", ")", "with_stock", "=", "[", "]", "for", "stock", ",", "resp", "in", "zip", "(", "stock_list", ",", "res", ...
因为 timekline 的返回没有带对应的股票代码,所以要手动带上
[ "因为", "timekline", "的返回没有带对应的股票代码,所以要手动带上" ]
a75820db4f05f5386e1c1024d05b0bfc1de6cbda
https://github.com/shidenggui/easyquotation/blob/a75820db4f05f5386e1c1024d05b0bfc1de6cbda/easyquotation/timekline.py#L29-L37
train
Fetch stock data from timekline
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
shidenggui/easyquotation
easyquotation/jsl.py
Jsl.formatfundajson
def formatfundajson(fundajson): """格式化集思录返回的json数据,以字典形式保存""" result = {} for row in fundajson["rows"]: funda_id = row["id"] cell = row["cell"] result[funda_id] = cell return result
python
def formatfundajson(fundajson): """格式化集思录返回的json数据,以字典形式保存""" result = {} for row in fundajson["rows"]: funda_id = row["id"] cell = row["cell"] result[funda_id] = cell return result
[ "def", "formatfundajson", "(", "fundajson", ")", ":", "result", "=", "{", "}", "for", "row", "in", "fundajson", "[", "\"rows\"", "]", ":", "funda_id", "=", "row", "[", "\"id\"", "]", "cell", "=", "row", "[", "\"cell\"", "]", "result", "[", "funda_id", ...
格式化集思录返回的json数据,以字典形式保存
[ "格式化集思录返回的json数据", "以字典形式保存" ]
a75820db4f05f5386e1c1024d05b0bfc1de6cbda
https://github.com/shidenggui/easyquotation/blob/a75820db4f05f5386e1c1024d05b0bfc1de6cbda/easyquotation/jsl.py#L101-L108
train
format fundajson to dict
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
shidenggui/easyquotation
easyquotation/jsl.py
Jsl.formatfundbjson
def formatfundbjson(fundbjson): """格式化集思录返回的json数据,以字典形式保存""" result = {} for row in fundbjson["rows"]: cell = row["cell"] fundb_id = cell["fundb_id"] result[fundb_id] = cell return result
python
def formatfundbjson(fundbjson): """格式化集思录返回的json数据,以字典形式保存""" result = {} for row in fundbjson["rows"]: cell = row["cell"] fundb_id = cell["fundb_id"] result[fundb_id] = cell return result
[ "def", "formatfundbjson", "(", "fundbjson", ")", ":", "result", "=", "{", "}", "for", "row", "in", "fundbjson", "[", "\"rows\"", "]", ":", "cell", "=", "row", "[", "\"cell\"", "]", "fundb_id", "=", "cell", "[", "\"fundb_id\"", "]", "result", "[", "fund...
格式化集思录返回的json数据,以字典形式保存
[ "格式化集思录返回的json数据", "以字典形式保存" ]
a75820db4f05f5386e1c1024d05b0bfc1de6cbda
https://github.com/shidenggui/easyquotation/blob/a75820db4f05f5386e1c1024d05b0bfc1de6cbda/easyquotation/jsl.py#L111-L118
train
format fundbjson to dict
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
shidenggui/easyquotation
easyquotation/jsl.py
Jsl.formatetfindexjson
def formatetfindexjson(fundbjson): """格式化集思录返回 指数ETF 的json数据,以字典形式保存""" result = {} for row in fundbjson["rows"]: cell = row["cell"] fundb_id = cell["fund_id"] result[fundb_id] = cell return result
python
def formatetfindexjson(fundbjson): """格式化集思录返回 指数ETF 的json数据,以字典形式保存""" result = {} for row in fundbjson["rows"]: cell = row["cell"] fundb_id = cell["fund_id"] result[fundb_id] = cell return result
[ "def", "formatetfindexjson", "(", "fundbjson", ")", ":", "result", "=", "{", "}", "for", "row", "in", "fundbjson", "[", "\"rows\"", "]", ":", "cell", "=", "row", "[", "\"cell\"", "]", "fundb_id", "=", "cell", "[", "\"fund_id\"", "]", "result", "[", "fu...
格式化集思录返回 指数ETF 的json数据,以字典形式保存
[ "格式化集思录返回", "指数ETF", "的json数据", "以字典形式保存" ]
a75820db4f05f5386e1c1024d05b0bfc1de6cbda
https://github.com/shidenggui/easyquotation/blob/a75820db4f05f5386e1c1024d05b0bfc1de6cbda/easyquotation/jsl.py#L121-L128
train
formatetfindexjson - 指数ETF 的 json 数据
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
shidenggui/easyquotation
easyquotation/jsl.py
Jsl.funda
def funda( self, fields=None, min_volume=0, min_discount=0, ignore_nodown=False, forever=False, ): """以字典形式返回分级A数据 :param fields:利率范围,形如['+3.0%', '6.0%'] :param min_volume:最小交易量,单位万元 :param min_discount:最小折价率, 单位% :param ignore_...
python
def funda( self, fields=None, min_volume=0, min_discount=0, ignore_nodown=False, forever=False, ): """以字典形式返回分级A数据 :param fields:利率范围,形如['+3.0%', '6.0%'] :param min_volume:最小交易量,单位万元 :param min_discount:最小折价率, 单位% :param ignore_...
[ "def", "funda", "(", "self", ",", "fields", "=", "None", ",", "min_volume", "=", "0", ",", "min_discount", "=", "0", ",", "ignore_nodown", "=", "False", ",", "forever", "=", "False", ",", ")", ":", "if", "fields", "is", "None", ":", "fields", "=", ...
以字典形式返回分级A数据 :param fields:利率范围,形如['+3.0%', '6.0%'] :param min_volume:最小交易量,单位万元 :param min_discount:最小折价率, 单位% :param ignore_nodown:是否忽略无下折品种,默认 False :param forever: 是否选择永续品种,默认 False
[ "以字典形式返回分级A数据", ":", "param", "fields", ":", "利率范围,形如", "[", "+", "3", ".", "0%", "6", ".", "0%", "]", ":", "param", "min_volume", ":", "最小交易量,单位万元", ":", "param", "min_discount", ":", "最小折价率", "单位%", ":", "param", "ignore_nodown", ":", "是否忽略无下折品种", "默认"...
a75820db4f05f5386e1c1024d05b0bfc1de6cbda
https://github.com/shidenggui/easyquotation/blob/a75820db4f05f5386e1c1024d05b0bfc1de6cbda/easyquotation/jsl.py#L148-L207
train
Funda 单位一个单位一个单位一个单位一个单位
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
shidenggui/easyquotation
easyquotation/jsl.py
Jsl.fundm
def fundm(self): """以字典形式返回分级母基数据 """ # 添加当前的ctime self.__fundm_url = self.__fundm_url.format(ctime=int(time.time())) # 请求数据 rep = requests.get(self.__fundm_url) # 获取返回的json字符串 fundmjson = json.loads(rep.text) # 格式化返回的json字符串 data = self.fo...
python
def fundm(self): """以字典形式返回分级母基数据 """ # 添加当前的ctime self.__fundm_url = self.__fundm_url.format(ctime=int(time.time())) # 请求数据 rep = requests.get(self.__fundm_url) # 获取返回的json字符串 fundmjson = json.loads(rep.text) # 格式化返回的json字符串 data = self.fo...
[ "def", "fundm", "(", "self", ")", ":", "# 添加当前的ctime", "self", ".", "__fundm_url", "=", "self", ".", "__fundm_url", ".", "format", "(", "ctime", "=", "int", "(", "time", ".", "time", "(", ")", ")", ")", "# 请求数据", "rep", "=", "requests", ".", "get", ...
以字典形式返回分级母基数据
[ "以字典形式返回分级母基数据" ]
a75820db4f05f5386e1c1024d05b0bfc1de6cbda
https://github.com/shidenggui/easyquotation/blob/a75820db4f05f5386e1c1024d05b0bfc1de6cbda/easyquotation/jsl.py#L209-L221
train
get Fundm data
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
shidenggui/easyquotation
easyquotation/jsl.py
Jsl.fundb
def fundb(self, fields=None, min_volume=0, min_discount=0, forever=False): """以字典形式返回分级B数据 :param fields:利率范围,形如['+3.0%', '6.0%'] :param min_volume:最小交易量,单位万元 :param min_discount:最小折价率, 单位% :param forever: 是否选择永续品种,默认 False """ if fields is None: field...
python
def fundb(self, fields=None, min_volume=0, min_discount=0, forever=False): """以字典形式返回分级B数据 :param fields:利率范围,形如['+3.0%', '6.0%'] :param min_volume:最小交易量,单位万元 :param min_discount:最小折价率, 单位% :param forever: 是否选择永续品种,默认 False """ if fields is None: field...
[ "def", "fundb", "(", "self", ",", "fields", "=", "None", ",", "min_volume", "=", "0", ",", "min_discount", "=", "0", ",", "forever", "=", "False", ")", ":", "if", "fields", "is", "None", ":", "fields", "=", "[", "]", "# 添加当前的ctime", "self", ".", "_...
以字典形式返回分级B数据 :param fields:利率范围,形如['+3.0%', '6.0%'] :param min_volume:最小交易量,单位万元 :param min_discount:最小折价率, 单位% :param forever: 是否选择永续品种,默认 False
[ "以字典形式返回分级B数据", ":", "param", "fields", ":", "利率范围,形如", "[", "+", "3", ".", "0%", "6", ".", "0%", "]", ":", "param", "min_volume", ":", "最小交易量,单位万元", ":", "param", "min_discount", ":", "最小折价率", "单位%", ":", "param", "forever", ":", "是否选择永续品种", "默认", "Fa...
a75820db4f05f5386e1c1024d05b0bfc1de6cbda
https://github.com/shidenggui/easyquotation/blob/a75820db4f05f5386e1c1024d05b0bfc1de6cbda/easyquotation/jsl.py#L223-L266
train
Fundb 单位为 0. 0
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
shidenggui/easyquotation
easyquotation/jsl.py
Jsl.fundarb
def fundarb( self, jsl_username, jsl_password, avolume=100, bvolume=100, ptype="price", ): """以字典形式返回分级A数据 :param jsl_username: 集思录用户名 :param jsl_password: 集思路登录密码 :param avolume: A成交额,单位百万 :param bvolume: B成交额,单位百万 :par...
python
def fundarb( self, jsl_username, jsl_password, avolume=100, bvolume=100, ptype="price", ): """以字典形式返回分级A数据 :param jsl_username: 集思录用户名 :param jsl_password: 集思路登录密码 :param avolume: A成交额,单位百万 :param bvolume: B成交额,单位百万 :par...
[ "def", "fundarb", "(", "self", ",", "jsl_username", ",", "jsl_password", ",", "avolume", "=", "100", ",", "bvolume", "=", "100", ",", "ptype", "=", "\"price\"", ",", ")", ":", "session", "=", "requests", ".", "session", "(", ")", "headers", "=", "{", ...
以字典形式返回分级A数据 :param jsl_username: 集思录用户名 :param jsl_password: 集思路登录密码 :param avolume: A成交额,单位百万 :param bvolume: B成交额,单位百万 :param ptype: 溢价计算方式,price=现价,buy=买一,sell=卖一
[ "以字典形式返回分级A数据", ":", "param", "jsl_username", ":", "集思录用户名", ":", "param", "jsl_password", ":", "集思路登录密码", ":", "param", "avolume", ":", "A成交额,单位百万", ":", "param", "bvolume", ":", "B成交额,单位百万", ":", "param", "ptype", ":", "溢价计算方式,price", "=", "现价,buy", "=", "...
a75820db4f05f5386e1c1024d05b0bfc1de6cbda
https://github.com/shidenggui/easyquotation/blob/a75820db4f05f5386e1c1024d05b0bfc1de6cbda/easyquotation/jsl.py#L268-L323
train
Fundarb 分级A数据
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
shidenggui/easyquotation
easyquotation/jsl.py
Jsl.etfindex
def etfindex( self, index_id="", min_volume=0, max_discount=None, min_discount=None ): """ 以字典形式返回 指数ETF 数据 :param index_id: 获取指定的指数 :param min_volume: 最小成交量 :param min_discount: 最低溢价率, 适用于溢价套利, 格式 "-1.2%", "-1.2", -0.012 三种均可 :param max_discount: 最高溢价率, 适用于折价...
python
def etfindex( self, index_id="", min_volume=0, max_discount=None, min_discount=None ): """ 以字典形式返回 指数ETF 数据 :param index_id: 获取指定的指数 :param min_volume: 最小成交量 :param min_discount: 最低溢价率, 适用于溢价套利, 格式 "-1.2%", "-1.2", -0.012 三种均可 :param max_discount: 最高溢价率, 适用于折价...
[ "def", "etfindex", "(", "self", ",", "index_id", "=", "\"\"", ",", "min_volume", "=", "0", ",", "max_discount", "=", "None", ",", "min_discount", "=", "None", ")", ":", "# 添加当前的ctime", "self", ".", "__etf_index_url", "=", "self", ".", "__etf_index_url", "....
以字典形式返回 指数ETF 数据 :param index_id: 获取指定的指数 :param min_volume: 最小成交量 :param min_discount: 最低溢价率, 适用于溢价套利, 格式 "-1.2%", "-1.2", -0.012 三种均可 :param max_discount: 最高溢价率, 适用于折价套利, 格式 "-1.2%", "-1.2", -0.012 三种均可 :return: {"fund_id":{}}
[ "以字典形式返回", "指数ETF", "数据", ":", "param", "index_id", ":", "获取指定的指数", ":", "param", "min_volume", ":", "最小成交量", ":", "param", "min_discount", ":", "最低溢价率", "适用于溢价套利", "格式", "-", "1", ".", "2%", "-", "1", ".", "2", "-", "0", ".", "012", "三种均可", ":", "...
a75820db4f05f5386e1c1024d05b0bfc1de6cbda
https://github.com/shidenggui/easyquotation/blob/a75820db4f05f5386e1c1024d05b0bfc1de6cbda/easyquotation/jsl.py#L325-L391
train
Get the etfindex index for the current neccesary set of items
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
shidenggui/easyquotation
easyquotation/jsl.py
Jsl.qdii
def qdii(self, min_volume=0): """以字典形式返回QDII数据 :param min_volume:最小交易量,单位万元 """ # 添加当前的ctime self.__qdii_url = self.__qdii_url.format(ctime=int(time.time())) # 请求数据 rep = requests.get(self.__qdii_url) # 获取返回的json字符串 fundjson = json.loads(rep.text) ...
python
def qdii(self, min_volume=0): """以字典形式返回QDII数据 :param min_volume:最小交易量,单位万元 """ # 添加当前的ctime self.__qdii_url = self.__qdii_url.format(ctime=int(time.time())) # 请求数据 rep = requests.get(self.__qdii_url) # 获取返回的json字符串 fundjson = json.loads(rep.text) ...
[ "def", "qdii", "(", "self", ",", "min_volume", "=", "0", ")", ":", "# 添加当前的ctime", "self", ".", "__qdii_url", "=", "self", ".", "__qdii_url", ".", "format", "(", "ctime", "=", "int", "(", "time", ".", "time", "(", ")", ")", ")", "# 请求数据", "rep", "=...
以字典形式返回QDII数据 :param min_volume:最小交易量,单位万元
[ "以字典形式返回QDII数据", ":", "param", "min_volume", ":", "最小交易量,单位万元" ]
a75820db4f05f5386e1c1024d05b0bfc1de6cbda
https://github.com/shidenggui/easyquotation/blob/a75820db4f05f5386e1c1024d05b0bfc1de6cbda/easyquotation/jsl.py#L393-L415
train
get QDII data
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
shidenggui/easyquotation
easyquotation/jsl.py
Jsl.cb
def cb(self, min_volume=0): """以字典形式返回QDII数据 :param min_volume:最小交易量,单位万元 """ # 添加当前的ctime self.__cb_url = self.__cb_url.format(ctime=int(time.time())) # 请求数据 rep = requests.get(self.__cb_url) # 获取返回的json字符串 fundjson = json.loads(rep.text) ...
python
def cb(self, min_volume=0): """以字典形式返回QDII数据 :param min_volume:最小交易量,单位万元 """ # 添加当前的ctime self.__cb_url = self.__cb_url.format(ctime=int(time.time())) # 请求数据 rep = requests.get(self.__cb_url) # 获取返回的json字符串 fundjson = json.loads(rep.text) ...
[ "def", "cb", "(", "self", ",", "min_volume", "=", "0", ")", ":", "# 添加当前的ctime", "self", ".", "__cb_url", "=", "self", ".", "__cb_url", ".", "format", "(", "ctime", "=", "int", "(", "time", ".", "time", "(", ")", ")", ")", "# 请求数据", "rep", "=", "...
以字典形式返回QDII数据 :param min_volume:最小交易量,单位万元
[ "以字典形式返回QDII数据", ":", "param", "min_volume", ":", "最小交易量,单位万元" ]
a75820db4f05f5386e1c1024d05b0bfc1de6cbda
https://github.com/shidenggui/easyquotation/blob/a75820db4f05f5386e1c1024d05b0bfc1de6cbda/easyquotation/jsl.py#L418-L439
train
get the callback url
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_now.py
Plugin.update
def update(self): """Update current date/time.""" # Had to convert it to string because datetime is not JSON serializable self.stats = datetime.now().strftime('%Y-%m-%d %H:%M:%S') # Add the time zone (issue #1249 and issue #1337) if 'tmzone' in localtime(): self.stats...
python
def update(self): """Update current date/time.""" # Had to convert it to string because datetime is not JSON serializable self.stats = datetime.now().strftime('%Y-%m-%d %H:%M:%S') # Add the time zone (issue #1249 and issue #1337) if 'tmzone' in localtime(): self.stats...
[ "def", "update", "(", "self", ")", ":", "# Had to convert it to string because datetime is not JSON serializable", "self", ".", "stats", "=", "datetime", ".", "now", "(", ")", ".", "strftime", "(", "'%Y-%m-%d %H:%M:%S'", ")", "# Add the time zone (issue #1249 and issue #133...
Update current date/time.
[ "Update", "current", "date", "/", "time", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_now.py#L48-L58
train
Update the current date and time.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_now.py
Plugin.msg_curse
def msg_curse(self, args=None, max_width=None): """Return the string to display in the curse interface.""" # Init the return message ret = [] # Build the string message # 23 is the padding for the process list msg = '{:23}'.format(self.stats) ret.append(self.curs...
python
def msg_curse(self, args=None, max_width=None): """Return the string to display in the curse interface.""" # Init the return message ret = [] # Build the string message # 23 is the padding for the process list msg = '{:23}'.format(self.stats) ret.append(self.curs...
[ "def", "msg_curse", "(", "self", ",", "args", "=", "None", ",", "max_width", "=", "None", ")", ":", "# Init the return message", "ret", "=", "[", "]", "# Build the string message", "# 23 is the padding for the process list", "msg", "=", "'{:23}'", ".", "format", "...
Return the string to display in the curse interface.
[ "Return", "the", "string", "to", "display", "in", "the", "curse", "interface", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_now.py#L60-L70
train
Return the string to display in the curse interface.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/web_list.py
GlancesWebList.load
def load(self, config): """Load the web list from the configuration file.""" web_list = [] if config is None: logger.debug("No configuration file available. Cannot load ports list.") elif not config.has_section(self._section): logger.debug("No [%s] section in the...
python
def load(self, config): """Load the web list from the configuration file.""" web_list = [] if config is None: logger.debug("No configuration file available. Cannot load ports list.") elif not config.has_section(self._section): logger.debug("No [%s] section in the...
[ "def", "load", "(", "self", ",", "config", ")", ":", "web_list", "=", "[", "]", "if", "config", "is", "None", ":", "logger", ".", "debug", "(", "\"No configuration file available. Cannot load ports list.\"", ")", "elif", "not", "config", ".", "has_section", "(...
Load the web list from the configuration file.
[ "Load", "the", "web", "list", "from", "the", "configuration", "file", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/web_list.py#L43-L127
train
Load the web list from the configuration file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/web_list.py
GlancesWebList.set_server
def set_server(self, pos, key, value): """Set the key to the value for the pos (position in the list).""" self._web_list[pos][key] = value
python
def set_server(self, pos, key, value): """Set the key to the value for the pos (position in the list).""" self._web_list[pos][key] = value
[ "def", "set_server", "(", "self", ",", "pos", ",", "key", ",", "value", ")", ":", "self", ".", "_web_list", "[", "pos", "]", "[", "key", "]", "=", "value" ]
Set the key to the value for the pos (position in the list).
[ "Set", "the", "key", "to", "the", "value", "for", "the", "pos", "(", "position", "in", "the", "list", ")", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/web_list.py#L133-L135
train
Set the key to the value for the pos
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_sensors.py
Plugin.update
def update(self): """Update sensors stats using the input method.""" # Init new stats stats = self.get_init_value() if self.input_method == 'local': # Update stats using the dedicated lib stats = [] # Get the temperature try: ...
python
def update(self): """Update sensors stats using the input method.""" # Init new stats stats = self.get_init_value() if self.input_method == 'local': # Update stats using the dedicated lib stats = [] # Get the temperature try: ...
[ "def", "update", "(", "self", ")", ":", "# Init new stats", "stats", "=", "self", ".", "get_init_value", "(", ")", "if", "self", ".", "input_method", "==", "'local'", ":", "# Update stats using the dedicated lib", "stats", "=", "[", "]", "# Get the temperature", ...
Update sensors stats using the input method.
[ "Update", "sensors", "stats", "using", "the", "input", "method", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_sensors.py#L73-L134
train
Update sensors stats using the input method.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_sensors.py
Plugin.__set_type
def __set_type(self, stats, sensor_type): """Set the plugin type. 4 types of stats is possible in the sensors plugin: - Core temperature: 'temperature_core' - Fan speed: 'fan_speed' - HDD temperature: 'temperature_hdd' - Battery capacity: 'battery' """ fo...
python
def __set_type(self, stats, sensor_type): """Set the plugin type. 4 types of stats is possible in the sensors plugin: - Core temperature: 'temperature_core' - Fan speed: 'fan_speed' - HDD temperature: 'temperature_hdd' - Battery capacity: 'battery' """ fo...
[ "def", "__set_type", "(", "self", ",", "stats", ",", "sensor_type", ")", ":", "for", "i", "in", "stats", ":", "# Set the sensors type", "i", ".", "update", "(", "{", "'type'", ":", "sensor_type", "}", ")", "# also add the key name", "i", ".", "update", "("...
Set the plugin type. 4 types of stats is possible in the sensors plugin: - Core temperature: 'temperature_core' - Fan speed: 'fan_speed' - HDD temperature: 'temperature_hdd' - Battery capacity: 'battery'
[ "Set", "the", "plugin", "type", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_sensors.py#L136-L151
train
Set the type of sensors in the plugin.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_sensors.py
Plugin.msg_curse
def msg_curse(self, args=None, max_width=None): """Return the dict to display in the curse interface.""" # Init the return message ret = [] # Only process if stats exist and display plugin enable... if not self.stats or self.is_disable(): return ret # Max si...
python
def msg_curse(self, args=None, max_width=None): """Return the dict to display in the curse interface.""" # Init the return message ret = [] # Only process if stats exist and display plugin enable... if not self.stats or self.is_disable(): return ret # Max si...
[ "def", "msg_curse", "(", "self", ",", "args", "=", "None", ",", "max_width", "=", "None", ")", ":", "# Init the return message", "ret", "=", "[", "]", "# Only process if stats exist and display plugin enable...", "if", "not", "self", ".", "stats", "or", "self", ...
Return the dict to display in the curse interface.
[ "Return", "the", "dict", "to", "display", "in", "the", "curse", "interface", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_sensors.py#L168-L217
train
Return the dict to display in the curse interface.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_sensors.py
GlancesGrabSensors.build_sensors_list
def build_sensors_list(self, type): """Build the sensors list depending of the type. type: SENSOR_TEMP_UNIT or SENSOR_FAN_UNIT output: a list """ ret = [] if type == SENSOR_TEMP_UNIT and self.init_temp: input_list = self.stemps self.stemps = psut...
python
def build_sensors_list(self, type): """Build the sensors list depending of the type. type: SENSOR_TEMP_UNIT or SENSOR_FAN_UNIT output: a list """ ret = [] if type == SENSOR_TEMP_UNIT and self.init_temp: input_list = self.stemps self.stemps = psut...
[ "def", "build_sensors_list", "(", "self", ",", "type", ")", ":", "ret", "=", "[", "]", "if", "type", "==", "SENSOR_TEMP_UNIT", "and", "self", ".", "init_temp", ":", "input_list", "=", "self", ".", "stemps", "self", ".", "stemps", "=", "psutil", ".", "s...
Build the sensors list depending of the type. type: SENSOR_TEMP_UNIT or SENSOR_FAN_UNIT output: a list
[ "Build", "the", "sensors", "list", "depending", "of", "the", "type", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_sensors.py#L278-L309
train
Build the sensors list depending of the type.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_sensors.py
GlancesGrabSensors.get
def get(self, sensor_type='temperature_core'): """Get sensors list.""" self.__update__() if sensor_type == 'temperature_core': ret = [s for s in self.sensors_list if s['unit'] == SENSOR_TEMP_UNIT] elif sensor_type == 'fan_speed': ret = [s for s in self.sensors_lis...
python
def get(self, sensor_type='temperature_core'): """Get sensors list.""" self.__update__() if sensor_type == 'temperature_core': ret = [s for s in self.sensors_list if s['unit'] == SENSOR_TEMP_UNIT] elif sensor_type == 'fan_speed': ret = [s for s in self.sensors_lis...
[ "def", "get", "(", "self", ",", "sensor_type", "=", "'temperature_core'", ")", ":", "self", ".", "__update__", "(", ")", "if", "sensor_type", "==", "'temperature_core'", ":", "ret", "=", "[", "s", "for", "s", "in", "self", ".", "sensors_list", "if", "s",...
Get sensors list.
[ "Get", "sensors", "list", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_sensors.py#L311-L322
train
Get sensors list.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/server.py
GlancesServer.add_user
def add_user(self, username, password): """Add an user to the dictionary.""" self.server.user_dict[username] = password self.server.isAuth = True
python
def add_user(self, username, password): """Add an user to the dictionary.""" self.server.user_dict[username] = password self.server.isAuth = True
[ "def", "add_user", "(", "self", ",", "username", ",", "password", ")", ":", "self", ".", "server", ".", "user_dict", "[", "username", "]", "=", "password", "self", ".", "server", ".", "isAuth", "=", "True" ]
Add an user to the dictionary.
[ "Add", "an", "user", "to", "the", "dictionary", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/server.py#L233-L236
train
Add a user to the dictionary.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/server.py
GlancesServer.serve_forever
def serve_forever(self): """Call the main loop.""" # Set the server login/password (if -P/--password tag) if self.args.password != "": self.add_user(self.args.username, self.args.password) # Serve forever self.server.serve_forever()
python
def serve_forever(self): """Call the main loop.""" # Set the server login/password (if -P/--password tag) if self.args.password != "": self.add_user(self.args.username, self.args.password) # Serve forever self.server.serve_forever()
[ "def", "serve_forever", "(", "self", ")", ":", "# Set the server login/password (if -P/--password tag)", "if", "self", ".", "args", ".", "password", "!=", "\"\"", ":", "self", ".", "add_user", "(", "self", ".", "args", ".", "username", ",", "self", ".", "args"...
Call the main loop.
[ "Call", "the", "main", "loop", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/server.py#L238-L244
train
Call the main loop.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/server.py
GlancesServer.end
def end(self): """End of the Glances server session.""" if not self.args.disable_autodiscover: self.autodiscover_client.close() self.server.end()
python
def end(self): """End of the Glances server session.""" if not self.args.disable_autodiscover: self.autodiscover_client.close() self.server.end()
[ "def", "end", "(", "self", ")", ":", "if", "not", "self", ".", "args", ".", "disable_autodiscover", ":", "self", ".", "autodiscover_client", ".", "close", "(", ")", "self", ".", "server", ".", "end", "(", ")" ]
End of the Glances server session.
[ "End", "of", "the", "Glances", "server", "session", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/server.py#L246-L250
train
End of the Glances server session.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/thresholds.py
GlancesThresholds.get
def get(self, stat_name=None): """Return the threshold dict. If stat_name is None, return the threshold for all plugins (dict of Threshold*) Else return the Threshold* instance for the given plugin """ if stat_name is None: return self._thresholds if stat_nam...
python
def get(self, stat_name=None): """Return the threshold dict. If stat_name is None, return the threshold for all plugins (dict of Threshold*) Else return the Threshold* instance for the given plugin """ if stat_name is None: return self._thresholds if stat_nam...
[ "def", "get", "(", "self", ",", "stat_name", "=", "None", ")", ":", "if", "stat_name", "is", "None", ":", "return", "self", ".", "_thresholds", "if", "stat_name", "in", "self", ".", "_thresholds", ":", "return", "self", ".", "_thresholds", "[", "stat_nam...
Return the threshold dict. If stat_name is None, return the threshold for all plugins (dict of Threshold*) Else return the Threshold* instance for the given plugin
[ "Return", "the", "threshold", "dict", ".", "If", "stat_name", "is", "None", "return", "the", "threshold", "for", "all", "plugins", "(", "dict", "of", "Threshold", "*", ")", "Else", "return", "the", "Threshold", "*", "instance", "for", "the", "given", "plug...
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/thresholds.py#L40-L51
train
Return the threshold dict.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/thresholds.py
GlancesThresholds.add
def add(self, stat_name, threshold_description): """Add a new threshold to the dict (key = stat_name)""" if threshold_description not in self.threshold_list: return False else: self._thresholds[stat_name] = getattr(self.current_module, ...
python
def add(self, stat_name, threshold_description): """Add a new threshold to the dict (key = stat_name)""" if threshold_description not in self.threshold_list: return False else: self._thresholds[stat_name] = getattr(self.current_module, ...
[ "def", "add", "(", "self", ",", "stat_name", ",", "threshold_description", ")", ":", "if", "threshold_description", "not", "in", "self", ".", "threshold_list", ":", "return", "False", "else", ":", "self", ".", "_thresholds", "[", "stat_name", "]", "=", "geta...
Add a new threshold to the dict (key = stat_name)
[ "Add", "a", "new", "threshold", "to", "the", "dict", "(", "key", "=", "stat_name", ")" ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/thresholds.py#L53-L60
train
Add a new threshold to the dict
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/exports/glances_rabbitmq.py
Export.init
def init(self): """Init the connection to the rabbitmq server.""" if not self.export_enable: return None try: parameters = pika.URLParameters( 'amqp://' + self.user + ':' + self.password + '@' + self.host + '...
python
def init(self): """Init the connection to the rabbitmq server.""" if not self.export_enable: return None try: parameters = pika.URLParameters( 'amqp://' + self.user + ':' + self.password + '@' + self.host + '...
[ "def", "init", "(", "self", ")", ":", "if", "not", "self", ".", "export_enable", ":", "return", "None", "try", ":", "parameters", "=", "pika", ".", "URLParameters", "(", "'amqp://'", "+", "self", ".", "user", "+", "':'", "+", "self", ".", "password", ...
Init the connection to the rabbitmq server.
[ "Init", "the", "connection", "to", "the", "rabbitmq", "server", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/exports/glances_rabbitmq.py#L66-L81
train
Init the connection to the rabbitmq server.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/exports/glances_rabbitmq.py
Export.export
def export(self, name, columns, points): """Write the points in RabbitMQ.""" data = ('hostname=' + self.hostname + ', name=' + name + ', dateinfo=' + datetime.datetime.utcnow().isoformat()) for i in range(len(columns)): if not isinstance(points[i], Number): ...
python
def export(self, name, columns, points): """Write the points in RabbitMQ.""" data = ('hostname=' + self.hostname + ', name=' + name + ', dateinfo=' + datetime.datetime.utcnow().isoformat()) for i in range(len(columns)): if not isinstance(points[i], Number): ...
[ "def", "export", "(", "self", ",", "name", ",", "columns", ",", "points", ")", ":", "data", "=", "(", "'hostname='", "+", "self", ".", "hostname", "+", "', name='", "+", "name", "+", "', dateinfo='", "+", "datetime", ".", "datetime", ".", "utcnow", "("...
Write the points in RabbitMQ.
[ "Write", "the", "points", "in", "RabbitMQ", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/exports/glances_rabbitmq.py#L83-L96
train
Write the points in RabbitMQ.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/exports/glances_statsd.py
normalize
def normalize(name): """Normalize name for the Statsd convention""" # Name should not contain some specials chars (issue #1068) ret = name.replace(':', '') ret = ret.replace('%', '') ret = ret.replace(' ', '_') return ret
python
def normalize(name): """Normalize name for the Statsd convention""" # Name should not contain some specials chars (issue #1068) ret = name.replace(':', '') ret = ret.replace('%', '') ret = ret.replace(' ', '_') return ret
[ "def", "normalize", "(", "name", ")", ":", "# Name should not contain some specials chars (issue #1068)", "ret", "=", "name", ".", "replace", "(", "':'", ",", "''", ")", "ret", "=", "ret", ".", "replace", "(", "'%'", ",", "''", ")", "ret", "=", "ret", ".",...
Normalize name for the Statsd convention
[ "Normalize", "name", "for", "the", "Statsd", "convention" ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/exports/glances_statsd.py#L86-L94
train
Normalize a name for the Statsd convention
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/exports/glances_statsd.py
Export.init
def init(self): """Init the connection to the Statsd server.""" if not self.export_enable: return None logger.info( "Stats will be exported to StatsD server: {}:{}".format(self.host, self.port)) r...
python
def init(self): """Init the connection to the Statsd server.""" if not self.export_enable: return None logger.info( "Stats will be exported to StatsD server: {}:{}".format(self.host, self.port)) r...
[ "def", "init", "(", "self", ")", ":", "if", "not", "self", ".", "export_enable", ":", "return", "None", "logger", ".", "info", "(", "\"Stats will be exported to StatsD server: {}:{}\"", ".", "format", "(", "self", ".", "host", ",", "self", ".", "port", ")", ...
Init the connection to the Statsd server.
[ "Init", "the", "connection", "to", "the", "Statsd", "server", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/exports/glances_statsd.py#L60-L69
train
Initialize the connection to the Statsd server.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/exports/glances_statsd.py
Export.export
def export(self, name, columns, points): """Export the stats to the Statsd server.""" for i in range(len(columns)): if not isinstance(points[i], Number): continue stat_name = '{}.{}'.format(name, columns[i]) stat_value = points[i] try: ...
python
def export(self, name, columns, points): """Export the stats to the Statsd server.""" for i in range(len(columns)): if not isinstance(points[i], Number): continue stat_name = '{}.{}'.format(name, columns[i]) stat_value = points[i] try: ...
[ "def", "export", "(", "self", ",", "name", ",", "columns", ",", "points", ")", ":", "for", "i", "in", "range", "(", "len", "(", "columns", ")", ")", ":", "if", "not", "isinstance", "(", "points", "[", "i", "]", ",", "Number", ")", ":", "continue"...
Export the stats to the Statsd server.
[ "Export", "the", "stats", "to", "the", "Statsd", "server", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/exports/glances_statsd.py#L71-L83
train
Export the stats to the Statsd server.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/ports_list.py
GlancesPortsList.load
def load(self, config): """Load the ports list from the configuration file.""" ports_list = [] if config is None: logger.debug("No configuration file available. Cannot load ports list.") elif not config.has_section(self._section): logger.debug("No [%s] section in...
python
def load(self, config): """Load the ports list from the configuration file.""" ports_list = [] if config is None: logger.debug("No configuration file available. Cannot load ports list.") elif not config.has_section(self._section): logger.debug("No [%s] section in...
[ "def", "load", "(", "self", ",", "config", ")", ":", "ports_list", "=", "[", "]", "if", "config", "is", "None", ":", "logger", ".", "debug", "(", "\"No configuration file available. Cannot load ports list.\"", ")", "elif", "not", "config", ".", "has_section", ...
Load the ports list from the configuration file.
[ "Load", "the", "ports", "list", "from", "the", "configuration", "file", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/ports_list.py#L53-L135
train
Load the ports list from the configuration file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/ports_list.py
GlancesPortsList.set_server
def set_server(self, pos, key, value): """Set the key to the value for the pos (position in the list).""" self._ports_list[pos][key] = value
python
def set_server(self, pos, key, value): """Set the key to the value for the pos (position in the list).""" self._ports_list[pos][key] = value
[ "def", "set_server", "(", "self", ",", "pos", ",", "key", ",", "value", ")", ":", "self", ".", "_ports_list", "[", "pos", "]", "[", "key", "]", "=", "value" ]
Set the key to the value for the pos (position in the list).
[ "Set", "the", "key", "to", "the", "value", "for", "the", "pos", "(", "position", "in", "the", "list", ")", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/ports_list.py#L141-L143
train
Set the key to the value for the pos
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/exports/glances_opentsdb.py
Export.init
def init(self): """Init the connection to the OpenTSDB server.""" if not self.export_enable: return None try: db = potsdb.Client(self.host, port=int(self.port), check_host=True) except Exception as e: ...
python
def init(self): """Init the connection to the OpenTSDB server.""" if not self.export_enable: return None try: db = potsdb.Client(self.host, port=int(self.port), check_host=True) except Exception as e: ...
[ "def", "init", "(", "self", ")", ":", "if", "not", "self", ".", "export_enable", ":", "return", "None", "try", ":", "db", "=", "potsdb", ".", "Client", "(", "self", ".", "host", ",", "port", "=", "int", "(", "self", ".", "port", ")", ",", "check_...
Init the connection to the OpenTSDB server.
[ "Init", "the", "connection", "to", "the", "OpenTSDB", "server", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/exports/glances_opentsdb.py#L61-L74
train
Init the connection to the OpenTSDB server.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/exports/glances_opentsdb.py
Export.export
def export(self, name, columns, points): """Export the stats to the Statsd server.""" for i in range(len(columns)): if not isinstance(points[i], Number): continue stat_name = '{}.{}.{}'.format(self.prefix, name, columns[i]) stat_value = points[i] ...
python
def export(self, name, columns, points): """Export the stats to the Statsd server.""" for i in range(len(columns)): if not isinstance(points[i], Number): continue stat_name = '{}.{}.{}'.format(self.prefix, name, columns[i]) stat_value = points[i] ...
[ "def", "export", "(", "self", ",", "name", ",", "columns", ",", "points", ")", ":", "for", "i", "in", "range", "(", "len", "(", "columns", ")", ")", ":", "if", "not", "isinstance", "(", "points", "[", "i", "]", ",", "Number", ")", ":", "continue"...
Export the stats to the Statsd server.
[ "Export", "the", "stats", "to", "the", "Statsd", "server", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/exports/glances_opentsdb.py#L76-L88
train
Export the stats to the Statsd server.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/logger.py
glances_logger
def glances_logger(env_key='LOG_CFG'): """Build and return the logger. env_key define the env var where a path to a specific JSON logger could be defined :return: logger -- Logger instance """ _logger = logging.getLogger() # By default, use the LOGGING_CFG logger configuration ...
python
def glances_logger(env_key='LOG_CFG'): """Build and return the logger. env_key define the env var where a path to a specific JSON logger could be defined :return: logger -- Logger instance """ _logger = logging.getLogger() # By default, use the LOGGING_CFG logger configuration ...
[ "def", "glances_logger", "(", "env_key", "=", "'LOG_CFG'", ")", ":", "_logger", "=", "logging", ".", "getLogger", "(", ")", "# By default, use the LOGGING_CFG logger configuration", "config", "=", "LOGGING_CFG", "# Check if a specific configuration is available", "user_file",...
Build and return the logger. env_key define the env var where a path to a specific JSON logger could be defined :return: logger -- Logger instance
[ "Build", "and", "return", "the", "logger", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/logger.py#L97-L120
train
Build and return the logger.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_irq.py
Plugin.update
def update(self): """Update the IRQ stats.""" # Init new stats stats = self.get_init_value() # IRQ plugin only available on GNU/Linux if not LINUX: return self.stats if self.input_method == 'local': # Grab the stats stats = self.irq.g...
python
def update(self): """Update the IRQ stats.""" # Init new stats stats = self.get_init_value() # IRQ plugin only available on GNU/Linux if not LINUX: return self.stats if self.input_method == 'local': # Grab the stats stats = self.irq.g...
[ "def", "update", "(", "self", ")", ":", "# Init new stats", "stats", "=", "self", ".", "get_init_value", "(", ")", "# IRQ plugin only available on GNU/Linux", "if", "not", "LINUX", ":", "return", "self", ".", "stats", "if", "self", ".", "input_method", "==", "...
Update the IRQ stats.
[ "Update", "the", "IRQ", "stats", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_irq.py#L53-L78
train
Update the IRQ stats.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_irq.py
Plugin.msg_curse
def msg_curse(self, args=None, max_width=None): """Return the dict to display in the curse interface.""" # Init the return message ret = [] # Only available on GNU/Linux # Only process if stats exist and display plugin enable... if not LINUX or not self.stats or not self...
python
def msg_curse(self, args=None, max_width=None): """Return the dict to display in the curse interface.""" # Init the return message ret = [] # Only available on GNU/Linux # Only process if stats exist and display plugin enable... if not LINUX or not self.stats or not self...
[ "def", "msg_curse", "(", "self", ",", "args", "=", "None", ",", "max_width", "=", "None", ")", ":", "# Init the return message", "ret", "=", "[", "]", "# Only available on GNU/Linux", "# Only process if stats exist and display plugin enable...", "if", "not", "LINUX", ...
Return the dict to display in the curse interface.
[ "Return", "the", "dict", "to", "display", "in", "the", "curse", "interface", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_irq.py#L85-L113
train
Return the dict to display in the curse interface.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
nicolargo/glances
glances/plugins/glances_irq.py
GlancesIRQ.__header
def __header(self, line): """Build the header (contain the number of CPU). CPU0 CPU1 CPU2 CPU3 0: 21 0 0 0 IO-APIC 2-edge timer """ self.cpu_number = len(line.split()) return self.cpu_number
python
def __header(self, line): """Build the header (contain the number of CPU). CPU0 CPU1 CPU2 CPU3 0: 21 0 0 0 IO-APIC 2-edge timer """ self.cpu_number = len(line.split()) return self.cpu_number
[ "def", "__header", "(", "self", ",", "line", ")", ":", "self", ".", "cpu_number", "=", "len", "(", "line", ".", "split", "(", ")", ")", "return", "self", ".", "cpu_number" ]
Build the header (contain the number of CPU). CPU0 CPU1 CPU2 CPU3 0: 21 0 0 0 IO-APIC 2-edge timer
[ "Build", "the", "header", "(", "contain", "the", "number", "of", "CPU", ")", "." ]
5bd4d587a736e0d2b03170b56926841d2a3eb7ee
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_irq.py#L142-L149
train
Build the header.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...