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
elastic/elasticsearch-dsl-py
elasticsearch_dsl/faceted_search.py
Facet.get_values
def get_values(self, data, filter_values): """ Turn the raw bucket data into a list of tuples containing the key, number of documents and a flag indicating whether this value has been selected or not. """ out = [] for bucket in data.buckets: key = self...
python
def get_values(self, data, filter_values): """ Turn the raw bucket data into a list of tuples containing the key, number of documents and a flag indicating whether this value has been selected or not. """ out = [] for bucket in data.buckets: key = self...
[ "def", "get_values", "(", "self", ",", "data", ",", "filter_values", ")", ":", "out", "=", "[", "]", "for", "bucket", "in", "data", ".", "buckets", ":", "key", "=", "self", ".", "get_value", "(", "bucket", ")", "out", ".", "append", "(", "(", "key"...
Turn the raw bucket data into a list of tuples containing the key, number of documents and a flag indicating whether this value has been selected or not.
[ "Turn", "the", "raw", "bucket", "data", "into", "a", "list", "of", "tuples", "containing", "the", "key", "number", "of", "documents", "and", "a", "flag", "indicating", "whether", "this", "value", "has", "been", "selected", "or", "not", "." ]
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/faceted_search.py#L77-L91
train
Turn the raw bucket data into a list of tuples containing the key number of documents and a flag indicating whether this value has been selected 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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/faceted_search.py
FacetedSearch.add_filter
def add_filter(self, name, filter_values): """ Add a filter for a facet. """ # normalize the value into a list if not isinstance(filter_values, (tuple, list)): if filter_values is None: return filter_values = [filter_values, ] # re...
python
def add_filter(self, name, filter_values): """ Add a filter for a facet. """ # normalize the value into a list if not isinstance(filter_values, (tuple, list)): if filter_values is None: return filter_values = [filter_values, ] # re...
[ "def", "add_filter", "(", "self", ",", "name", ",", "filter_values", ")", ":", "# normalize the value into a list", "if", "not", "isinstance", "(", "filter_values", ",", "(", "tuple", ",", "list", ")", ")", ":", "if", "filter_values", "is", "None", ":", "ret...
Add a filter for a facet.
[ "Add", "a", "filter", "for", "a", "facet", "." ]
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/faceted_search.py#L283-L301
train
Add a filter for a facet.
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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/faceted_search.py
FacetedSearch.search
def search(self): """ Returns the base Search object to which the facets are added. You can customize the query by overriding this method and returning a modified search object. """ s = Search(doc_type=self.doc_types, index=self.index, using=self.using) return s....
python
def search(self): """ Returns the base Search object to which the facets are added. You can customize the query by overriding this method and returning a modified search object. """ s = Search(doc_type=self.doc_types, index=self.index, using=self.using) return s....
[ "def", "search", "(", "self", ")", ":", "s", "=", "Search", "(", "doc_type", "=", "self", ".", "doc_types", ",", "index", "=", "self", ".", "index", ",", "using", "=", "self", ".", "using", ")", "return", "s", ".", "response_class", "(", "FacetedResp...
Returns the base Search object to which the facets are added. You can customize the query by overriding this method and returning a modified search object.
[ "Returns", "the", "base", "Search", "object", "to", "which", "the", "facets", "are", "added", "." ]
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/faceted_search.py#L303-L311
train
Returns the base Search object to which the facets are added.
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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/faceted_search.py
FacetedSearch.query
def query(self, search, query): """ Add query part to ``search``. Override this if you wish to customize the query used. """ if query: if self.fields: return search.query('multi_match', fields=self.fields, query=query) else: ...
python
def query(self, search, query): """ Add query part to ``search``. Override this if you wish to customize the query used. """ if query: if self.fields: return search.query('multi_match', fields=self.fields, query=query) else: ...
[ "def", "query", "(", "self", ",", "search", ",", "query", ")", ":", "if", "query", ":", "if", "self", ".", "fields", ":", "return", "search", ".", "query", "(", "'multi_match'", ",", "fields", "=", "self", ".", "fields", ",", "query", "=", "query", ...
Add query part to ``search``. Override this if you wish to customize the query used.
[ "Add", "query", "part", "to", "search", "." ]
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/faceted_search.py#L313-L324
train
Query the database for the specified query.
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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/faceted_search.py
FacetedSearch.aggregate
def aggregate(self, search): """ Add aggregations representing the facets selected, including potential filters. """ for f, facet in iteritems(self.facets): agg = facet.get_aggregation() agg_filter = MatchAll() for field, filter in iteritems(se...
python
def aggregate(self, search): """ Add aggregations representing the facets selected, including potential filters. """ for f, facet in iteritems(self.facets): agg = facet.get_aggregation() agg_filter = MatchAll() for field, filter in iteritems(se...
[ "def", "aggregate", "(", "self", ",", "search", ")", ":", "for", "f", ",", "facet", "in", "iteritems", "(", "self", ".", "facets", ")", ":", "agg", "=", "facet", ".", "get_aggregation", "(", ")", "agg_filter", "=", "MatchAll", "(", ")", "for", "field...
Add aggregations representing the facets selected, including potential filters.
[ "Add", "aggregations", "representing", "the", "facets", "selected", "including", "potential", "filters", "." ]
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/faceted_search.py#L326-L342
train
Add aggregations representing the facets selected including potential filters.
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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/faceted_search.py
FacetedSearch.filter
def filter(self, search): """ Add a ``post_filter`` to the search request narrowing the results based on the facet filters. """ if not self._filters: return search post_filter = MatchAll() for f in itervalues(self._filters): post_filter &=...
python
def filter(self, search): """ Add a ``post_filter`` to the search request narrowing the results based on the facet filters. """ if not self._filters: return search post_filter = MatchAll() for f in itervalues(self._filters): post_filter &=...
[ "def", "filter", "(", "self", ",", "search", ")", ":", "if", "not", "self", ".", "_filters", ":", "return", "search", "post_filter", "=", "MatchAll", "(", ")", "for", "f", "in", "itervalues", "(", "self", ".", "_filters", ")", ":", "post_filter", "&=",...
Add a ``post_filter`` to the search request narrowing the results based on the facet filters.
[ "Add", "a", "post_filter", "to", "the", "search", "request", "narrowing", "the", "results", "based", "on", "the", "facet", "filters", "." ]
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/faceted_search.py#L344-L355
train
Add a post_filter to the search request narrowing the results based on the facet filters.
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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/faceted_search.py
FacetedSearch.highlight
def highlight(self, search): """ Add highlighting for all the fields """ return search.highlight(*(f if '^' not in f else f.split('^', 1)[0] for f in self.fields))
python
def highlight(self, search): """ Add highlighting for all the fields """ return search.highlight(*(f if '^' not in f else f.split('^', 1)[0] for f in self.fields))
[ "def", "highlight", "(", "self", ",", "search", ")", ":", "return", "search", ".", "highlight", "(", "*", "(", "f", "if", "'^'", "not", "in", "f", "else", "f", ".", "split", "(", "'^'", ",", "1", ")", "[", "0", "]", "for", "f", "in", "self", ...
Add highlighting for all the fields
[ "Add", "highlighting", "for", "all", "the", "fields" ]
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/faceted_search.py#L357-L362
train
Highlight the fields in the given search 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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/faceted_search.py
FacetedSearch.sort
def sort(self, search): """ Add sorting information to the request. """ if self._sort: search = search.sort(*self._sort) return search
python
def sort(self, search): """ Add sorting information to the request. """ if self._sort: search = search.sort(*self._sort) return search
[ "def", "sort", "(", "self", ",", "search", ")", ":", "if", "self", ".", "_sort", ":", "search", "=", "search", ".", "sort", "(", "*", "self", ".", "_sort", ")", "return", "search" ]
Add sorting information to the request.
[ "Add", "sorting", "information", "to", "the", "request", "." ]
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/faceted_search.py#L364-L370
train
Sort the list of items in the search.
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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/faceted_search.py
FacetedSearch.build_search
def build_search(self): """ Construct the ``Search`` object. """ s = self.search() s = self.query(s, self._query) s = self.filter(s) if self.fields: s = self.highlight(s) s = self.sort(s) self.aggregate(s) return s
python
def build_search(self): """ Construct the ``Search`` object. """ s = self.search() s = self.query(s, self._query) s = self.filter(s) if self.fields: s = self.highlight(s) s = self.sort(s) self.aggregate(s) return s
[ "def", "build_search", "(", "self", ")", ":", "s", "=", "self", ".", "search", "(", ")", "s", "=", "self", ".", "query", "(", "s", ",", "self", ".", "_query", ")", "s", "=", "self", ".", "filter", "(", "s", ")", "if", "self", ".", "fields", "...
Construct the ``Search`` object.
[ "Construct", "the", "Search", "object", "." ]
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/faceted_search.py#L372-L383
train
Construct the search 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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/faceted_search.py
FacetedSearch.execute
def execute(self): """ Execute the search and return the response. """ r = self._s.execute() r._faceted_search = self return r
python
def execute(self): """ Execute the search and return the response. """ r = self._s.execute() r._faceted_search = self return r
[ "def", "execute", "(", "self", ")", ":", "r", "=", "self", ".", "_s", ".", "execute", "(", ")", "r", ".", "_faceted_search", "=", "self", "return", "r" ]
Execute the search and return the response.
[ "Execute", "the", "search", "and", "return", "the", "response", "." ]
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/faceted_search.py#L385-L391
train
Execute the search and return the response.
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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/search.py
Request.params
def params(self, **kwargs): """ Specify query params to be used when executing the search. All the keyword arguments will override the current values. See https://elasticsearch-py.readthedocs.io/en/master/api.html#elasticsearch.Elasticsearch.search for all available parameters. ...
python
def params(self, **kwargs): """ Specify query params to be used when executing the search. All the keyword arguments will override the current values. See https://elasticsearch-py.readthedocs.io/en/master/api.html#elasticsearch.Elasticsearch.search for all available parameters. ...
[ "def", "params", "(", "self", ",", "*", "*", "kwargs", ")", ":", "s", "=", "self", ".", "_clone", "(", ")", "s", ".", "_params", ".", "update", "(", "kwargs", ")", "return", "s" ]
Specify query params to be used when executing the search. All the keyword arguments will override the current values. See https://elasticsearch-py.readthedocs.io/en/master/api.html#elasticsearch.Elasticsearch.search for all available parameters. Example:: s = Search() ...
[ "Specify", "query", "params", "to", "be", "used", "when", "executing", "the", "search", ".", "All", "the", "keyword", "arguments", "will", "override", "the", "current", "values", ".", "See", "https", ":", "//", "elasticsearch", "-", "py", ".", "readthedocs",...
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/search.py#L131-L145
train
Returns a new instance of Search with the specified query params.
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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/search.py
Request.index
def index(self, *index): """ Set the index for the search. If called empty it will remove all information. Example: s = Search() s = s.index('twitter-2015.01.01', 'twitter-2015.01.02') s = s.index(['twitter-2015.01.01', 'twitter-2015.01.02']) """ ...
python
def index(self, *index): """ Set the index for the search. If called empty it will remove all information. Example: s = Search() s = s.index('twitter-2015.01.01', 'twitter-2015.01.02') s = s.index(['twitter-2015.01.01', 'twitter-2015.01.02']) """ ...
[ "def", "index", "(", "self", ",", "*", "index", ")", ":", "# .index() resets", "s", "=", "self", ".", "_clone", "(", ")", "if", "not", "index", ":", "s", ".", "_index", "=", "None", "else", ":", "indexes", "=", "[", "]", "for", "i", "in", "index"...
Set the index for the search. If called empty it will remove all information. Example: s = Search() s = s.index('twitter-2015.01.01', 'twitter-2015.01.02') s = s.index(['twitter-2015.01.01', 'twitter-2015.01.02'])
[ "Set", "the", "index", "for", "the", "search", ".", "If", "called", "empty", "it", "will", "remove", "all", "information", "." ]
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/search.py#L147-L173
train
Sets the index for the search.
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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/search.py
Request.doc_type
def doc_type(self, *doc_type, **kwargs): """ Set the type to search through. You can supply a single value or multiple. Values can be strings or subclasses of ``Document``. You can also pass in any keyword arguments, mapping a doc_type to a callback that should be used instead o...
python
def doc_type(self, *doc_type, **kwargs): """ Set the type to search through. You can supply a single value or multiple. Values can be strings or subclasses of ``Document``. You can also pass in any keyword arguments, mapping a doc_type to a callback that should be used instead o...
[ "def", "doc_type", "(", "self", ",", "*", "doc_type", ",", "*", "*", "kwargs", ")", ":", "# .doc_type() resets", "s", "=", "self", ".", "_clone", "(", ")", "if", "not", "doc_type", "and", "not", "kwargs", ":", "s", ".", "_doc_type", "=", "[", "]", ...
Set the type to search through. You can supply a single value or multiple. Values can be strings or subclasses of ``Document``. You can also pass in any keyword arguments, mapping a doc_type to a callback that should be used instead of the Hit class. If no doc_type is supplied any info...
[ "Set", "the", "type", "to", "search", "through", ".", "You", "can", "supply", "a", "single", "value", "or", "multiple", ".", "Values", "can", "be", "strings", "or", "subclasses", "of", "Document", "." ]
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/search.py#L225-L249
train
Set the type of the information stored on this instance.
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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/search.py
Request.using
def using(self, client): """ Associate the search request with an elasticsearch client. A fresh copy will be returned with current instance remaining unchanged. :arg client: an instance of ``elasticsearch.Elasticsearch`` to use or an alias to look up in ``elasticsearch_dsl.c...
python
def using(self, client): """ Associate the search request with an elasticsearch client. A fresh copy will be returned with current instance remaining unchanged. :arg client: an instance of ``elasticsearch.Elasticsearch`` to use or an alias to look up in ``elasticsearch_dsl.c...
[ "def", "using", "(", "self", ",", "client", ")", ":", "s", "=", "self", ".", "_clone", "(", ")", "s", ".", "_using", "=", "client", "return", "s" ]
Associate the search request with an elasticsearch client. A fresh copy will be returned with current instance remaining unchanged. :arg client: an instance of ``elasticsearch.Elasticsearch`` to use or an alias to look up in ``elasticsearch_dsl.connections``
[ "Associate", "the", "search", "request", "with", "an", "elasticsearch", "client", ".", "A", "fresh", "copy", "will", "be", "returned", "with", "current", "instance", "remaining", "unchanged", "." ]
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/search.py#L251-L262
train
Associate the search request with an elasticsearch client.
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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/search.py
Request.extra
def extra(self, **kwargs): """ Add extra keys to the request body. Mostly here for backwards compatibility. """ s = self._clone() if 'from_' in kwargs: kwargs['from'] = kwargs.pop('from_') s._extra.update(kwargs) return s
python
def extra(self, **kwargs): """ Add extra keys to the request body. Mostly here for backwards compatibility. """ s = self._clone() if 'from_' in kwargs: kwargs['from'] = kwargs.pop('from_') s._extra.update(kwargs) return s
[ "def", "extra", "(", "self", ",", "*", "*", "kwargs", ")", ":", "s", "=", "self", ".", "_clone", "(", ")", "if", "'from_'", "in", "kwargs", ":", "kwargs", "[", "'from'", "]", "=", "kwargs", ".", "pop", "(", "'from_'", ")", "s", ".", "_extra", "...
Add extra keys to the request body. Mostly here for backwards compatibility.
[ "Add", "extra", "keys", "to", "the", "request", "body", ".", "Mostly", "here", "for", "backwards", "compatibility", "." ]
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/search.py#L264-L273
train
Add extra keys to the request body. Mostly here for backwards compatibility.
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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/search.py
Search._clone
def _clone(self): """ Return a clone of the current search request. Performs a shallow copy of all the underlying objects. Used internally by most state modifying APIs. """ s = super(Search, self)._clone() s._response_class = self._response_class s._sort ...
python
def _clone(self): """ Return a clone of the current search request. Performs a shallow copy of all the underlying objects. Used internally by most state modifying APIs. """ s = super(Search, self)._clone() s._response_class = self._response_class s._sort ...
[ "def", "_clone", "(", "self", ")", ":", "s", "=", "super", "(", "Search", ",", "self", ")", ".", "_clone", "(", ")", "s", ".", "_response_class", "=", "self", ".", "_response_class", "s", ".", "_sort", "=", "self", ".", "_sort", "[", ":", "]", "s...
Return a clone of the current search request. Performs a shallow copy of all the underlying objects. Used internally by most state modifying APIs.
[ "Return", "a", "clone", "of", "the", "current", "search", "request", ".", "Performs", "a", "shallow", "copy", "of", "all", "the", "underlying", "objects", ".", "Used", "internally", "by", "most", "state", "modifying", "APIs", "." ]
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/search.py#L379-L401
train
Returns a shallow copy of the current search request. Performs a shallow copy of all the underlying objects. Used internally by most state modifying APIs.
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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/search.py
Search.response_class
def response_class(self, cls): """ Override the default wrapper used for the response. """ s = self._clone() s._response_class = cls return s
python
def response_class(self, cls): """ Override the default wrapper used for the response. """ s = self._clone() s._response_class = cls return s
[ "def", "response_class", "(", "self", ",", "cls", ")", ":", "s", "=", "self", ".", "_clone", "(", ")", "s", ".", "_response_class", "=", "cls", "return", "s" ]
Override the default wrapper used for the response.
[ "Override", "the", "default", "wrapper", "used", "for", "the", "response", "." ]
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/search.py#L403-L409
train
Override the default wrapper used for the response.
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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/search.py
Search.update_from_dict
def update_from_dict(self, d): """ Apply options from a serialized body to the current instance. Modifies the object in-place. Used mostly by ``from_dict``. """ d = d.copy() if 'query' in d: self.query._proxied = Q(d.pop('query')) if 'post_filter' in d...
python
def update_from_dict(self, d): """ Apply options from a serialized body to the current instance. Modifies the object in-place. Used mostly by ``from_dict``. """ d = d.copy() if 'query' in d: self.query._proxied = Q(d.pop('query')) if 'post_filter' in d...
[ "def", "update_from_dict", "(", "self", ",", "d", ")", ":", "d", "=", "d", ".", "copy", "(", ")", "if", "'query'", "in", "d", ":", "self", ".", "query", ".", "_proxied", "=", "Q", "(", "d", ".", "pop", "(", "'query'", ")", ")", "if", "'post_fil...
Apply options from a serialized body to the current instance. Modifies the object in-place. Used mostly by ``from_dict``.
[ "Apply", "options", "from", "a", "serialized", "body", "to", "the", "current", "instance", ".", "Modifies", "the", "object", "in", "-", "place", ".", "Used", "mostly", "by", "from_dict", "." ]
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/search.py#L411-L445
train
Updates the internal state of the object from a 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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/search.py
Search.script_fields
def script_fields(self, **kwargs): """ Define script fields to be calculated on hits. See https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-script-fields.html for more details. Example:: s = Search() s = s.script_fields(times...
python
def script_fields(self, **kwargs): """ Define script fields to be calculated on hits. See https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-script-fields.html for more details. Example:: s = Search() s = s.script_fields(times...
[ "def", "script_fields", "(", "self", ",", "*", "*", "kwargs", ")", ":", "s", "=", "self", ".", "_clone", "(", ")", "for", "name", "in", "kwargs", ":", "if", "isinstance", "(", "kwargs", "[", "name", "]", ",", "string_types", ")", ":", "kwargs", "["...
Define script fields to be calculated on hits. See https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-script-fields.html for more details. Example:: s = Search() s = s.script_fields(times_two="doc['field'].value * 2") s = s.script...
[ "Define", "script", "fields", "to", "be", "calculated", "on", "hits", ".", "See", "https", ":", "//", "www", ".", "elastic", ".", "co", "/", "guide", "/", "en", "/", "elasticsearch", "/", "reference", "/", "current", "/", "search", "-", "request", "-",...
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/search.py#L447-L472
train
Define script fields to be calculated on hits. See SetException. html for more details.
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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/search.py
Search.source
def source(self, fields=None, **kwargs): """ Selectively control how the _source field is returned. :arg fields: wildcard string, array of wildcards, or dictionary of includes and excludes If ``fields`` is None, the entire document will be returned for each hit. If fields is a...
python
def source(self, fields=None, **kwargs): """ Selectively control how the _source field is returned. :arg fields: wildcard string, array of wildcards, or dictionary of includes and excludes If ``fields`` is None, the entire document will be returned for each hit. If fields is a...
[ "def", "source", "(", "self", ",", "fields", "=", "None", ",", "*", "*", "kwargs", ")", ":", "s", "=", "self", ".", "_clone", "(", ")", "if", "fields", "and", "kwargs", ":", "raise", "ValueError", "(", "\"You cannot specify fields and kwargs at the same time...
Selectively control how the _source field is returned. :arg fields: wildcard string, array of wildcards, or dictionary of includes and excludes If ``fields`` is None, the entire document will be returned for each hit. If fields is a dictionary with keys of 'include' and/or 'exclude' t...
[ "Selectively", "control", "how", "the", "_source", "field", "is", "returned", "." ]
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/search.py#L474-L517
train
Selectively control how the _source field is returned.
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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/search.py
Search.sort
def sort(self, *keys): """ Add sorting information to the search request. If called without arguments it will remove all sort requirements. Otherwise it will replace them. Acceptable arguments are:: 'some.field' '-some.other.field' {'different.field':...
python
def sort(self, *keys): """ Add sorting information to the search request. If called without arguments it will remove all sort requirements. Otherwise it will replace them. Acceptable arguments are:: 'some.field' '-some.other.field' {'different.field':...
[ "def", "sort", "(", "self", ",", "*", "keys", ")", ":", "s", "=", "self", ".", "_clone", "(", ")", "s", ".", "_sort", "=", "[", "]", "for", "k", "in", "keys", ":", "if", "isinstance", "(", "k", ",", "string_types", ")", "and", "k", ".", "star...
Add sorting information to the search request. If called without arguments it will remove all sort requirements. Otherwise it will replace them. Acceptable arguments are:: 'some.field' '-some.other.field' {'different.field': {'any': 'dict'}} so for example::...
[ "Add", "sorting", "information", "to", "the", "search", "request", ".", "If", "called", "without", "arguments", "it", "will", "remove", "all", "sort", "requirements", ".", "Otherwise", "it", "will", "replace", "them", ".", "Acceptable", "arguments", "are", "::...
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/search.py#L519-L550
train
Returns a new Search object with the sort information added to the search request.
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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/search.py
Search.highlight_options
def highlight_options(self, **kwargs): """ Update the global highlighting options used for this request. For example:: s = Search() s = s.highlight_options(order='score') """ s = self._clone() s._highlight_opts.update(kwargs) return s
python
def highlight_options(self, **kwargs): """ Update the global highlighting options used for this request. For example:: s = Search() s = s.highlight_options(order='score') """ s = self._clone() s._highlight_opts.update(kwargs) return s
[ "def", "highlight_options", "(", "self", ",", "*", "*", "kwargs", ")", ":", "s", "=", "self", ".", "_clone", "(", ")", "s", ".", "_highlight_opts", ".", "update", "(", "kwargs", ")", "return", "s" ]
Update the global highlighting options used for this request. For example:: s = Search() s = s.highlight_options(order='score')
[ "Update", "the", "global", "highlighting", "options", "used", "for", "this", "request", ".", "For", "example", "::" ]
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/search.py#L552-L562
train
Returns a new instance of Search with highlight options set to the given kwargs.
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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/search.py
Search.highlight
def highlight(self, *fields, **kwargs): """ Request highlighting of some fields. All keyword arguments passed in will be used as parameters for all the fields in the ``fields`` parameter. Example:: Search().highlight('title', 'body', fragment_size=50) will produce the equiv...
python
def highlight(self, *fields, **kwargs): """ Request highlighting of some fields. All keyword arguments passed in will be used as parameters for all the fields in the ``fields`` parameter. Example:: Search().highlight('title', 'body', fragment_size=50) will produce the equiv...
[ "def", "highlight", "(", "self", ",", "*", "fields", ",", "*", "*", "kwargs", ")", ":", "s", "=", "self", ".", "_clone", "(", ")", "for", "f", "in", "fields", ":", "s", ".", "_highlight", "[", "f", "]", "=", "kwargs", "return", "s" ]
Request highlighting of some fields. All keyword arguments passed in will be used as parameters for all the fields in the ``fields`` parameter. Example:: Search().highlight('title', 'body', fragment_size=50) will produce the equivalent of:: { "highlight": { ...
[ "Request", "highlighting", "of", "some", "fields", ".", "All", "keyword", "arguments", "passed", "in", "will", "be", "used", "as", "parameters", "for", "all", "the", "fields", "in", "the", "fields", "parameter", ".", "Example", "::" ]
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/search.py#L564-L601
train
Returns a new instance with highlighting of some fields.
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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/search.py
Search.suggest
def suggest(self, name, text, **kwargs): """ Add a suggestions request to the search. :arg name: name of the suggestion :arg text: text to suggest on All keyword arguments will be added to the suggestions body. For example:: s = Search() s = s.suggest('...
python
def suggest(self, name, text, **kwargs): """ Add a suggestions request to the search. :arg name: name of the suggestion :arg text: text to suggest on All keyword arguments will be added to the suggestions body. For example:: s = Search() s = s.suggest('...
[ "def", "suggest", "(", "self", ",", "name", ",", "text", ",", "*", "*", "kwargs", ")", ":", "s", "=", "self", ".", "_clone", "(", ")", "s", ".", "_suggest", "[", "name", "]", "=", "{", "'text'", ":", "text", "}", "s", ".", "_suggest", "[", "n...
Add a suggestions request to the search. :arg name: name of the suggestion :arg text: text to suggest on All keyword arguments will be added to the suggestions body. For example:: s = Search() s = s.suggest('suggestion-1', 'Elasticsearch', term={'field': 'body'})
[ "Add", "a", "suggestions", "request", "to", "the", "search", "." ]
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/search.py#L603-L618
train
Add a suggestions request to the search.
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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/search.py
Search.to_dict
def to_dict(self, count=False, **kwargs): """ Serialize the search into the dictionary that will be sent over as the request's body. :arg count: a flag to specify if we are interested in a body for count - no aggregations, no pagination bounds etc. All additional ke...
python
def to_dict(self, count=False, **kwargs): """ Serialize the search into the dictionary that will be sent over as the request's body. :arg count: a flag to specify if we are interested in a body for count - no aggregations, no pagination bounds etc. All additional ke...
[ "def", "to_dict", "(", "self", ",", "count", "=", "False", ",", "*", "*", "kwargs", ")", ":", "d", "=", "{", "}", "if", "self", ".", "query", ":", "d", "[", "\"query\"", "]", "=", "self", ".", "query", ".", "to_dict", "(", ")", "# count request d...
Serialize the search into the dictionary that will be sent over as the request's body. :arg count: a flag to specify if we are interested in a body for count - no aggregations, no pagination bounds etc. All additional keyword arguments will be included into the dictionary.
[ "Serialize", "the", "search", "into", "the", "dictionary", "that", "will", "be", "sent", "over", "as", "the", "request", "s", "body", "." ]
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/search.py#L620-L662
train
Serialize the search into a dictionary that will be sent over as the request s body.
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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/search.py
Search.count
def count(self): """ Return the number of hits matching the query and filters. Note that only the actual number is returned. """ if hasattr(self, '_response'): return self._response.hits.total es = connections.get_connection(self._using) d = self.to_...
python
def count(self): """ Return the number of hits matching the query and filters. Note that only the actual number is returned. """ if hasattr(self, '_response'): return self._response.hits.total es = connections.get_connection(self._using) d = self.to_...
[ "def", "count", "(", "self", ")", ":", "if", "hasattr", "(", "self", ",", "'_response'", ")", ":", "return", "self", ".", "_response", ".", "hits", ".", "total", "es", "=", "connections", ".", "get_connection", "(", "self", ".", "_using", ")", "d", "...
Return the number of hits matching the query and filters. Note that only the actual number is returned.
[ "Return", "the", "number", "of", "hits", "matching", "the", "query", "and", "filters", ".", "Note", "that", "only", "the", "actual", "number", "is", "returned", "." ]
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/search.py#L664-L680
train
Return the number of hits matching the query and filters.
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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/search.py
Search.execute
def execute(self, ignore_cache=False): """ Execute the search and return an instance of ``Response`` wrapping all the data. :arg ignore_cache: if set to ``True``, consecutive calls will hit ES, while cached result will be ignored. Defaults to `False` """ if i...
python
def execute(self, ignore_cache=False): """ Execute the search and return an instance of ``Response`` wrapping all the data. :arg ignore_cache: if set to ``True``, consecutive calls will hit ES, while cached result will be ignored. Defaults to `False` """ if i...
[ "def", "execute", "(", "self", ",", "ignore_cache", "=", "False", ")", ":", "if", "ignore_cache", "or", "not", "hasattr", "(", "self", ",", "'_response'", ")", ":", "es", "=", "connections", ".", "get_connection", "(", "self", ".", "_using", ")", "self",...
Execute the search and return an instance of ``Response`` wrapping all the data. :arg ignore_cache: if set to ``True``, consecutive calls will hit ES, while cached result will be ignored. Defaults to `False`
[ "Execute", "the", "search", "and", "return", "an", "instance", "of", "Response", "wrapping", "all", "the", "data", "." ]
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/search.py#L682-L701
train
Execute the search and return an instance of Response
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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/search.py
Search.scan
def scan(self): """ Turn the search into a scan search and return a generator that will iterate over all the documents matching the query. Use ``params`` method to specify any additional arguments you with to pass to the underlying ``scan`` helper from ``elasticsearch-py`` - ...
python
def scan(self): """ Turn the search into a scan search and return a generator that will iterate over all the documents matching the query. Use ``params`` method to specify any additional arguments you with to pass to the underlying ``scan`` helper from ``elasticsearch-py`` - ...
[ "def", "scan", "(", "self", ")", ":", "es", "=", "connections", ".", "get_connection", "(", "self", ".", "_using", ")", "for", "hit", "in", "scan", "(", "es", ",", "query", "=", "self", ".", "to_dict", "(", ")", ",", "index", "=", "self", ".", "_...
Turn the search into a scan search and return a generator that will iterate over all the documents matching the query. Use ``params`` method to specify any additional arguments you with to pass to the underlying ``scan`` helper from ``elasticsearch-py`` - https://elasticsearch-py.readth...
[ "Turn", "the", "search", "into", "a", "scan", "search", "and", "return", "a", "generator", "that", "will", "iterate", "over", "all", "the", "documents", "matching", "the", "query", "." ]
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/search.py#L703-L721
train
Turn the search into a scan search and return a generator that will iterate over all the documents matching the query.
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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/search.py
Search.delete
def delete(self): """ delete() executes the query by delegating to delete_by_query() """ es = connections.get_connection(self._using) return AttrDict( es.delete_by_query( index=self._index, body=self.to_dict(), **self....
python
def delete(self): """ delete() executes the query by delegating to delete_by_query() """ es = connections.get_connection(self._using) return AttrDict( es.delete_by_query( index=self._index, body=self.to_dict(), **self....
[ "def", "delete", "(", "self", ")", ":", "es", "=", "connections", ".", "get_connection", "(", "self", ".", "_using", ")", "return", "AttrDict", "(", "es", ".", "delete_by_query", "(", "index", "=", "self", ".", "_index", ",", "body", "=", "self", ".", ...
delete() executes the query by delegating to delete_by_query()
[ "delete", "()", "executes", "the", "query", "by", "delegating", "to", "delete_by_query", "()" ]
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/search.py#L723-L736
train
Delete the entry from the database.
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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/search.py
MultiSearch.add
def add(self, search): """ Adds a new :class:`~elasticsearch_dsl.Search` object to the request:: ms = MultiSearch(index='my-index') ms = ms.add(Search(doc_type=Category).filter('term', category='python')) ms = ms.add(Search(doc_type=Blog)) """ ms = se...
python
def add(self, search): """ Adds a new :class:`~elasticsearch_dsl.Search` object to the request:: ms = MultiSearch(index='my-index') ms = ms.add(Search(doc_type=Category).filter('term', category='python')) ms = ms.add(Search(doc_type=Blog)) """ ms = se...
[ "def", "add", "(", "self", ",", "search", ")", ":", "ms", "=", "self", ".", "_clone", "(", ")", "ms", ".", "_searches", ".", "append", "(", "search", ")", "return", "ms" ]
Adds a new :class:`~elasticsearch_dsl.Search` object to the request:: ms = MultiSearch(index='my-index') ms = ms.add(Search(doc_type=Category).filter('term', category='python')) ms = ms.add(Search(doc_type=Blog))
[ "Adds", "a", "new", ":", "class", ":", "~elasticsearch_dsl", ".", "Search", "object", "to", "the", "request", "::" ]
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/search.py#L759-L769
train
Adds a new search object to the request 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...
elastic/elasticsearch-dsl-py
elasticsearch_dsl/search.py
MultiSearch.execute
def execute(self, ignore_cache=False, raise_on_error=True): """ Execute the multi search request and return a list of search results. """ if ignore_cache or not hasattr(self, '_response'): es = connections.get_connection(self._using) responses = es.msearch( ...
python
def execute(self, ignore_cache=False, raise_on_error=True): """ Execute the multi search request and return a list of search results. """ if ignore_cache or not hasattr(self, '_response'): es = connections.get_connection(self._using) responses = es.msearch( ...
[ "def", "execute", "(", "self", ",", "ignore_cache", "=", "False", ",", "raise_on_error", "=", "True", ")", ":", "if", "ignore_cache", "or", "not", "hasattr", "(", "self", ",", "'_response'", ")", ":", "es", "=", "connections", ".", "get_connection", "(", ...
Execute the multi search request and return a list of search results.
[ "Execute", "the", "multi", "search", "request", "and", "return", "a", "list", "of", "search", "results", "." ]
874b52472fc47b601de0e5fa0e4300e21aff0085
https://github.com/elastic/elasticsearch-dsl-py/blob/874b52472fc47b601de0e5fa0e4300e21aff0085/elasticsearch_dsl/search.py#L784-L809
train
Execute the multi search request and return a list of search results.
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...
paramiko/paramiko
setup_helper.py
make_tarball
def make_tarball( base_name, base_dir, compress="gzip", verbose=0, dry_run=0, owner=None, group=None, ): """Create a tar file from all the files under 'base_dir'. This file may be compressed. :param compress: Compression algorithms. Supported algorithms are: 'gzip': (the...
python
def make_tarball( base_name, base_dir, compress="gzip", verbose=0, dry_run=0, owner=None, group=None, ): """Create a tar file from all the files under 'base_dir'. This file may be compressed. :param compress: Compression algorithms. Supported algorithms are: 'gzip': (the...
[ "def", "make_tarball", "(", "base_name", ",", "base_dir", ",", "compress", "=", "\"gzip\"", ",", "verbose", "=", "0", ",", "dry_run", "=", "0", ",", "owner", "=", "None", ",", "group", "=", "None", ",", ")", ":", "# XXX GNU tar 1.13 has a nifty option to add...
Create a tar file from all the files under 'base_dir'. This file may be compressed. :param compress: Compression algorithms. Supported algorithms are: 'gzip': (the default) 'compress' 'bzip2' None For 'gzip' and 'bzip2' the internal tarfile module will be used. For 'comp...
[ "Create", "a", "tar", "file", "from", "all", "the", "files", "under", "base_dir", ".", "This", "file", "may", "be", "compressed", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/setup_helper.py#L70-L153
train
Create a tar file from all the files under base_dir.
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...
paramiko/paramiko
paramiko/kex_gss.py
KexGSSGroup1.start_kex
def start_kex(self): """ Start the GSS-API / SSPI Authenticated Diffie-Hellman Key Exchange. """ self._generate_x() if self.transport.server_mode: # compute f = g^x mod p, but don't send it yet self.f = pow(self.G, self.x, self.P) self.transpor...
python
def start_kex(self): """ Start the GSS-API / SSPI Authenticated Diffie-Hellman Key Exchange. """ self._generate_x() if self.transport.server_mode: # compute f = g^x mod p, but don't send it yet self.f = pow(self.G, self.x, self.P) self.transpor...
[ "def", "start_kex", "(", "self", ")", ":", "self", ".", "_generate_x", "(", ")", "if", "self", ".", "transport", ".", "server_mode", ":", "# compute f = g^x mod p, but don't send it yet", "self", ".", "f", "=", "pow", "(", "self", ".", "G", ",", "self", "....
Start the GSS-API / SSPI Authenticated Diffie-Hellman Key Exchange.
[ "Start", "the", "GSS", "-", "API", "/", "SSPI", "Authenticated", "Diffie", "-", "Hellman", "Key", "Exchange", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/kex_gss.py#L91-L115
train
Start the GSS - API Key Exchange.
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...
paramiko/paramiko
paramiko/kex_gss.py
KexGSSGroup1.parse_next
def parse_next(self, ptype, m): """ Parse the next packet. :param ptype: The (string) type of the incoming packet :param `.Message` m: The paket content """ if self.transport.server_mode and (ptype == MSG_KEXGSS_INIT): return self._parse_kexgss_init(m) ...
python
def parse_next(self, ptype, m): """ Parse the next packet. :param ptype: The (string) type of the incoming packet :param `.Message` m: The paket content """ if self.transport.server_mode and (ptype == MSG_KEXGSS_INIT): return self._parse_kexgss_init(m) ...
[ "def", "parse_next", "(", "self", ",", "ptype", ",", "m", ")", ":", "if", "self", ".", "transport", ".", "server_mode", "and", "(", "ptype", "==", "MSG_KEXGSS_INIT", ")", ":", "return", "self", ".", "_parse_kexgss_init", "(", "m", ")", "elif", "not", "...
Parse the next packet. :param ptype: The (string) type of the incoming packet :param `.Message` m: The paket content
[ "Parse", "the", "next", "packet", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/kex_gss.py#L117-L135
train
Parse the next packet in the 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...
paramiko/paramiko
paramiko/kex_gss.py
KexGSSGroup1._parse_kexgss_hostkey
def _parse_kexgss_hostkey(self, m): """ Parse the SSH2_MSG_KEXGSS_HOSTKEY message (client mode). :param `.Message` m: The content of the SSH2_MSG_KEXGSS_HOSTKEY message """ # client mode host_key = m.get_string() self.transport.host_key = host_key sig = m...
python
def _parse_kexgss_hostkey(self, m): """ Parse the SSH2_MSG_KEXGSS_HOSTKEY message (client mode). :param `.Message` m: The content of the SSH2_MSG_KEXGSS_HOSTKEY message """ # client mode host_key = m.get_string() self.transport.host_key = host_key sig = m...
[ "def", "_parse_kexgss_hostkey", "(", "self", ",", "m", ")", ":", "# client mode", "host_key", "=", "m", ".", "get_string", "(", ")", "self", ".", "transport", ".", "host_key", "=", "host_key", "sig", "=", "m", ".", "get_string", "(", ")", "self", ".", ...
Parse the SSH2_MSG_KEXGSS_HOSTKEY message (client mode). :param `.Message` m: The content of the SSH2_MSG_KEXGSS_HOSTKEY message
[ "Parse", "the", "SSH2_MSG_KEXGSS_HOSTKEY", "message", "(", "client", "mode", ")", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/kex_gss.py#L155-L166
train
Parse the KEXGSS_HOSTKEY message.
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...
paramiko/paramiko
paramiko/kex_gss.py
KexGSSGroup1._parse_kexgss_continue
def _parse_kexgss_continue(self, m): """ Parse the SSH2_MSG_KEXGSS_CONTINUE message. :param `.Message` m: The content of the SSH2_MSG_KEXGSS_CONTINUE message """ if not self.transport.server_mode: srv_token = m.get_string() m = Message() ...
python
def _parse_kexgss_continue(self, m): """ Parse the SSH2_MSG_KEXGSS_CONTINUE message. :param `.Message` m: The content of the SSH2_MSG_KEXGSS_CONTINUE message """ if not self.transport.server_mode: srv_token = m.get_string() m = Message() ...
[ "def", "_parse_kexgss_continue", "(", "self", ",", "m", ")", ":", "if", "not", "self", ".", "transport", ".", "server_mode", ":", "srv_token", "=", "m", ".", "get_string", "(", ")", "m", "=", "Message", "(", ")", "m", ".", "add_byte", "(", "c_MSG_KEXGS...
Parse the SSH2_MSG_KEXGSS_CONTINUE message. :param `.Message` m: The content of the SSH2_MSG_KEXGSS_CONTINUE message
[ "Parse", "the", "SSH2_MSG_KEXGSS_CONTINUE", "message", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/kex_gss.py#L168-L189
train
Parse the SSH2_MSG_KEXGSS_CONTINUE message.
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...
paramiko/paramiko
paramiko/kex_gss.py
KexGSSGroup1._parse_kexgss_complete
def _parse_kexgss_complete(self, m): """ Parse the SSH2_MSG_KEXGSS_COMPLETE message (client mode). :param `.Message` m: The content of the SSH2_MSG_KEXGSS_COMPLETE message """ # client mode if self.transport.host_key is None: self.transport.host_k...
python
def _parse_kexgss_complete(self, m): """ Parse the SSH2_MSG_KEXGSS_COMPLETE message (client mode). :param `.Message` m: The content of the SSH2_MSG_KEXGSS_COMPLETE message """ # client mode if self.transport.host_key is None: self.transport.host_k...
[ "def", "_parse_kexgss_complete", "(", "self", ",", "m", ")", ":", "# client mode", "if", "self", ".", "transport", ".", "host_key", "is", "None", ":", "self", ".", "transport", ".", "host_key", "=", "NullHostKey", "(", ")", "self", ".", "f", "=", "m", ...
Parse the SSH2_MSG_KEXGSS_COMPLETE message (client mode). :param `.Message` m: The content of the SSH2_MSG_KEXGSS_COMPLETE message
[ "Parse", "the", "SSH2_MSG_KEXGSS_COMPLETE", "message", "(", "client", "mode", ")", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/kex_gss.py#L191-L234
train
Parse the SSH2_MSG_KEXGSS_COMPLETE message.
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...
paramiko/paramiko
paramiko/kex_gss.py
KexGSSGroup1._parse_kexgss_init
def _parse_kexgss_init(self, m): """ Parse the SSH2_MSG_KEXGSS_INIT message (server mode). :param `.Message` m: The content of the SSH2_MSG_KEXGSS_INIT message """ # server mode client_token = m.get_string() self.e = m.get_mpint() if (self.e < 1) or (self...
python
def _parse_kexgss_init(self, m): """ Parse the SSH2_MSG_KEXGSS_INIT message (server mode). :param `.Message` m: The content of the SSH2_MSG_KEXGSS_INIT message """ # server mode client_token = m.get_string() self.e = m.get_mpint() if (self.e < 1) or (self...
[ "def", "_parse_kexgss_init", "(", "self", ",", "m", ")", ":", "# server mode", "client_token", "=", "m", ".", "get_string", "(", ")", "self", ".", "e", "=", "m", ".", "get_mpint", "(", ")", "if", "(", "self", ".", "e", "<", "1", ")", "or", "(", "...
Parse the SSH2_MSG_KEXGSS_INIT message (server mode). :param `.Message` m: The content of the SSH2_MSG_KEXGSS_INIT message
[ "Parse", "the", "SSH2_MSG_KEXGSS_INIT", "message", "(", "server", "mode", ")", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/kex_gss.py#L236-L290
train
Parse the SSH2_MSG_KEXGSS_INIT message.
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...
paramiko/paramiko
paramiko/kex_gss.py
KexGSSGex.start_kex
def start_kex(self): """ Start the GSS-API / SSPI Authenticated Diffie-Hellman Group Exchange """ if self.transport.server_mode: self.transport._expect_packet(MSG_KEXGSS_GROUPREQ) return # request a bit range: we accept (min_bits) to (max_bits), but prefer...
python
def start_kex(self): """ Start the GSS-API / SSPI Authenticated Diffie-Hellman Group Exchange """ if self.transport.server_mode: self.transport._expect_packet(MSG_KEXGSS_GROUPREQ) return # request a bit range: we accept (min_bits) to (max_bits), but prefer...
[ "def", "start_kex", "(", "self", ")", ":", "if", "self", ".", "transport", ".", "server_mode", ":", "self", ".", "transport", ".", "_expect_packet", "(", "MSG_KEXGSS_GROUPREQ", ")", "return", "# request a bit range: we accept (min_bits) to (max_bits), but prefer", "# (p...
Start the GSS-API / SSPI Authenticated Diffie-Hellman Group Exchange
[ "Start", "the", "GSS", "-", "API", "/", "SSPI", "Authenticated", "Diffie", "-", "Hellman", "Group", "Exchange" ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/kex_gss.py#L353-L370
train
Start the GSS - API Group Exchange
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...
paramiko/paramiko
paramiko/kex_gss.py
KexGSSGex.parse_next
def parse_next(self, ptype, m): """ Parse the next packet. :param ptype: The (string) type of the incoming packet :param `.Message` m: The paket content """ if ptype == MSG_KEXGSS_GROUPREQ: return self._parse_kexgss_groupreq(m) elif ptype == MSG_KEXGS...
python
def parse_next(self, ptype, m): """ Parse the next packet. :param ptype: The (string) type of the incoming packet :param `.Message` m: The paket content """ if ptype == MSG_KEXGSS_GROUPREQ: return self._parse_kexgss_groupreq(m) elif ptype == MSG_KEXGS...
[ "def", "parse_next", "(", "self", ",", "ptype", ",", "m", ")", ":", "if", "ptype", "==", "MSG_KEXGSS_GROUPREQ", ":", "return", "self", ".", "_parse_kexgss_groupreq", "(", "m", ")", "elif", "ptype", "==", "MSG_KEXGSS_GROUP", ":", "return", "self", ".", "_pa...
Parse the next packet. :param ptype: The (string) type of the incoming packet :param `.Message` m: The paket content
[ "Parse", "the", "next", "packet", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/kex_gss.py#L372-L394
train
Parse the next packet in the 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...
paramiko/paramiko
paramiko/kex_gss.py
KexGSSGex._parse_kexgss_group
def _parse_kexgss_group(self, m): """ Parse the SSH2_MSG_KEXGSS_GROUP message (client mode). :param `Message` m: The content of the SSH2_MSG_KEXGSS_GROUP message """ self.p = m.get_mpint() self.g = m.get_mpint() # reject if p's bit length < 1024 or > 8192 ...
python
def _parse_kexgss_group(self, m): """ Parse the SSH2_MSG_KEXGSS_GROUP message (client mode). :param `Message` m: The content of the SSH2_MSG_KEXGSS_GROUP message """ self.p = m.get_mpint() self.g = m.get_mpint() # reject if p's bit length < 1024 or > 8192 ...
[ "def", "_parse_kexgss_group", "(", "self", ",", "m", ")", ":", "self", ".", "p", "=", "m", ".", "get_mpint", "(", ")", "self", ".", "g", "=", "m", ".", "get_mpint", "(", ")", "# reject if p's bit length < 1024 or > 8192", "bitlen", "=", "util", ".", "bit...
Parse the SSH2_MSG_KEXGSS_GROUP message (client mode). :param `Message` m: The content of the SSH2_MSG_KEXGSS_GROUP message
[ "Parse", "the", "SSH2_MSG_KEXGSS_GROUP", "message", "(", "client", "mode", ")", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/kex_gss.py#L460-L491
train
Parse the KEXGSS_GROUP message.
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...
paramiko/paramiko
paramiko/kex_gss.py
KexGSSGex._parse_kexgss_complete
def _parse_kexgss_complete(self, m): """ Parse the SSH2_MSG_KEXGSS_COMPLETE message (client mode). :param `Message` m: The content of the SSH2_MSG_KEXGSS_COMPLETE message """ if self.transport.host_key is None: self.transport.host_key = NullHostKey() self.f =...
python
def _parse_kexgss_complete(self, m): """ Parse the SSH2_MSG_KEXGSS_COMPLETE message (client mode). :param `Message` m: The content of the SSH2_MSG_KEXGSS_COMPLETE message """ if self.transport.host_key is None: self.transport.host_key = NullHostKey() self.f =...
[ "def", "_parse_kexgss_complete", "(", "self", ",", "m", ")", ":", "if", "self", ".", "transport", ".", "host_key", "is", "None", ":", "self", ".", "transport", ".", "host_key", "=", "NullHostKey", "(", ")", "self", ".", "f", "=", "m", ".", "get_mpint",...
Parse the SSH2_MSG_KEXGSS_COMPLETE message (client mode). :param `Message` m: The content of the SSH2_MSG_KEXGSS_COMPLETE message
[ "Parse", "the", "SSH2_MSG_KEXGSS_COMPLETE", "message", "(", "client", "mode", ")", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/kex_gss.py#L590-L638
train
Parse the SSH2_MSG_KEXGSS_COMPLETE message.
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...
paramiko/paramiko
paramiko/kex_gss.py
KexGSSGex._parse_kexgss_error
def _parse_kexgss_error(self, m): """ Parse the SSH2_MSG_KEXGSS_ERROR message (client mode). The server may send a GSS-API error message. if it does, we display the error by throwing an exception (client mode). :param `Message` m: The content of the SSH2_MSG_KEXGSS_ERROR messag...
python
def _parse_kexgss_error(self, m): """ Parse the SSH2_MSG_KEXGSS_ERROR message (client mode). The server may send a GSS-API error message. if it does, we display the error by throwing an exception (client mode). :param `Message` m: The content of the SSH2_MSG_KEXGSS_ERROR messag...
[ "def", "_parse_kexgss_error", "(", "self", ",", "m", ")", ":", "maj_status", "=", "m", ".", "get_int", "(", ")", "min_status", "=", "m", ".", "get_int", "(", ")", "err_msg", "=", "m", ".", "get_string", "(", ")", "m", ".", "get_string", "(", ")", "...
Parse the SSH2_MSG_KEXGSS_ERROR message (client mode). The server may send a GSS-API error message. if it does, we display the error by throwing an exception (client mode). :param `Message` m: The content of the SSH2_MSG_KEXGSS_ERROR message :raise SSHException: Contains GSS-API major ...
[ "Parse", "the", "SSH2_MSG_KEXGSS_ERROR", "message", "(", "client", "mode", ")", ".", "The", "server", "may", "send", "a", "GSS", "-", "API", "error", "message", ".", "if", "it", "does", "we", "display", "the", "error", "by", "throwing", "an", "exception", ...
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/kex_gss.py#L640-L663
train
Parse the GSS - API error message.
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...
paramiko/paramiko
paramiko/sftp_attr.py
SFTPAttributes.from_stat
def from_stat(cls, obj, filename=None): """ Create an `.SFTPAttributes` object from an existing ``stat`` object (an object returned by `os.stat`). :param object obj: an object returned by `os.stat` (or equivalent). :param str filename: the filename associated with this file. ...
python
def from_stat(cls, obj, filename=None): """ Create an `.SFTPAttributes` object from an existing ``stat`` object (an object returned by `os.stat`). :param object obj: an object returned by `os.stat` (or equivalent). :param str filename: the filename associated with this file. ...
[ "def", "from_stat", "(", "cls", ",", "obj", ",", "filename", "=", "None", ")", ":", "attr", "=", "cls", "(", ")", "attr", ".", "st_size", "=", "obj", ".", "st_size", "attr", ".", "st_uid", "=", "obj", ".", "st_uid", "attr", ".", "st_gid", "=", "o...
Create an `.SFTPAttributes` object from an existing ``stat`` object (an object returned by `os.stat`). :param object obj: an object returned by `os.stat` (or equivalent). :param str filename: the filename associated with this file. :return: new `.SFTPAttributes` object with the same att...
[ "Create", "an", ".", "SFTPAttributes", "object", "from", "an", "existing", "stat", "object", "(", "an", "object", "returned", "by", "os", ".", "stat", ")", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/sftp_attr.py#L64-L82
train
Create an SFTPAttributes object from an existing stat 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...
paramiko/paramiko
paramiko/rsakey.py
RSAKey.generate
def generate(bits, progress_func=None): """ Generate a new private RSA key. This factory function can be used to generate a new host key or authentication key. :param int bits: number of bits the generated key should be. :param progress_func: Unused :return: new `.RSAKe...
python
def generate(bits, progress_func=None): """ Generate a new private RSA key. This factory function can be used to generate a new host key or authentication key. :param int bits: number of bits the generated key should be. :param progress_func: Unused :return: new `.RSAKe...
[ "def", "generate", "(", "bits", ",", "progress_func", "=", "None", ")", ":", "key", "=", "rsa", ".", "generate_private_key", "(", "public_exponent", "=", "65537", ",", "key_size", "=", "bits", ",", "backend", "=", "default_backend", "(", ")", ")", "return"...
Generate a new private RSA key. This factory function can be used to generate a new host key or authentication key. :param int bits: number of bits the generated key should be. :param progress_func: Unused :return: new `.RSAKey` private key
[ "Generate", "a", "new", "private", "RSA", "key", ".", "This", "factory", "function", "can", "be", "used", "to", "generate", "a", "new", "host", "key", "or", "authentication", "key", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/rsakey.py#L158-L170
train
This factory function generates a new private RSA 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...
paramiko/paramiko
paramiko/sftp_file.py
SFTPFile._data_in_prefetch_buffers
def _data_in_prefetch_buffers(self, offset): """ if a block of data is present in the prefetch buffers, at the given offset, return the offset of the relevant prefetch buffer. otherwise, return None. this guarantees nothing about the number of bytes collected in the prefetch bu...
python
def _data_in_prefetch_buffers(self, offset): """ if a block of data is present in the prefetch buffers, at the given offset, return the offset of the relevant prefetch buffer. otherwise, return None. this guarantees nothing about the number of bytes collected in the prefetch bu...
[ "def", "_data_in_prefetch_buffers", "(", "self", ",", "offset", ")", ":", "k", "=", "[", "i", "for", "i", "in", "self", ".", "_prefetch_data", ".", "keys", "(", ")", "if", "i", "<=", "offset", "]", "if", "len", "(", "k", ")", "==", "0", ":", "ret...
if a block of data is present in the prefetch buffers, at the given offset, return the offset of the relevant prefetch buffer. otherwise, return None. this guarantees nothing about the number of bytes collected in the prefetch buffer so far.
[ "if", "a", "block", "of", "data", "is", "present", "in", "the", "prefetch", "buffers", "at", "the", "given", "offset", "return", "the", "offset", "of", "the", "relevant", "prefetch", "buffer", ".", "otherwise", "return", "None", ".", "this", "guarantees", ...
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/sftp_file.py#L132-L147
train
Returns the offset of the relevant prefetch buffer at the given offset.
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...
paramiko/paramiko
paramiko/sftp_file.py
SFTPFile.seek
def seek(self, offset, whence=0): """ Set the file's current position. See `file.seek` for details. """ self.flush() if whence == self.SEEK_SET: self._realpos = self._pos = offset elif whence == self.SEEK_CUR: self._pos += offset ...
python
def seek(self, offset, whence=0): """ Set the file's current position. See `file.seek` for details. """ self.flush() if whence == self.SEEK_SET: self._realpos = self._pos = offset elif whence == self.SEEK_CUR: self._pos += offset ...
[ "def", "seek", "(", "self", ",", "offset", ",", "whence", "=", "0", ")", ":", "self", ".", "flush", "(", ")", "if", "whence", "==", "self", ".", "SEEK_SET", ":", "self", ".", "_realpos", "=", "self", ".", "_pos", "=", "offset", "elif", "whence", ...
Set the file's current position. See `file.seek` for details.
[ "Set", "the", "file", "s", "current", "position", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/sftp_file.py#L258-L272
train
Seek to the specified offset in the 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...
paramiko/paramiko
paramiko/sftp_file.py
SFTPFile.stat
def stat(self): """ Retrieve information about this file from the remote system. This is exactly like `.SFTPClient.stat`, except that it operates on an already-open file. :returns: an `.SFTPAttributes` object containing attributes about this file. """ ...
python
def stat(self): """ Retrieve information about this file from the remote system. This is exactly like `.SFTPClient.stat`, except that it operates on an already-open file. :returns: an `.SFTPAttributes` object containing attributes about this file. """ ...
[ "def", "stat", "(", "self", ")", ":", "t", ",", "msg", "=", "self", ".", "sftp", ".", "_request", "(", "CMD_FSTAT", ",", "self", ".", "handle", ")", "if", "t", "!=", "CMD_ATTRS", ":", "raise", "SFTPError", "(", "\"Expected attributes\"", ")", "return",...
Retrieve information about this file from the remote system. This is exactly like `.SFTPClient.stat`, except that it operates on an already-open file. :returns: an `.SFTPAttributes` object containing attributes about this file.
[ "Retrieve", "information", "about", "this", "file", "from", "the", "remote", "system", ".", "This", "is", "exactly", "like", ".", "SFTPClient", ".", "stat", "except", "that", "it", "operates", "on", "an", "already", "-", "open", "file", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/sftp_file.py#L274-L286
train
Retrieves information about this 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...
paramiko/paramiko
paramiko/sftp_file.py
SFTPFile.truncate
def truncate(self, size): """ Change the size of this file. This usually extends or shrinks the size of the file, just like the ``truncate()`` method on Python file objects. :param size: the new size of the file """ self.sftp._log( DEBUG, "truncate({...
python
def truncate(self, size): """ Change the size of this file. This usually extends or shrinks the size of the file, just like the ``truncate()`` method on Python file objects. :param size: the new size of the file """ self.sftp._log( DEBUG, "truncate({...
[ "def", "truncate", "(", "self", ",", "size", ")", ":", "self", ".", "sftp", ".", "_log", "(", "DEBUG", ",", "\"truncate({}, {!r})\"", ".", "format", "(", "hexlify", "(", "self", ".", "handle", ")", ",", "size", ")", ")", "attr", "=", "SFTPAttributes", ...
Change the size of this file. This usually extends or shrinks the size of the file, just like the ``truncate()`` method on Python file objects. :param size: the new size of the file
[ "Change", "the", "size", "of", "this", "file", ".", "This", "usually", "extends", "or", "shrinks", "the", "size", "of", "the", "file", "just", "like", "the", "truncate", "()", "method", "on", "Python", "file", "objects", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/sftp_file.py#L343-L356
train
Change the size of the file 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...
paramiko/paramiko
paramiko/sftp_file.py
SFTPFile.check
def check(self, hash_algorithm, offset=0, length=0, block_size=0): """ Ask the server for a hash of a section of this file. This can be used to verify a successful upload or download, or for various rsync-like operations. The file is hashed from ``offset``, for ``length`` bytes...
python
def check(self, hash_algorithm, offset=0, length=0, block_size=0): """ Ask the server for a hash of a section of this file. This can be used to verify a successful upload or download, or for various rsync-like operations. The file is hashed from ``offset``, for ``length`` bytes...
[ "def", "check", "(", "self", ",", "hash_algorithm", ",", "offset", "=", "0", ",", "length", "=", "0", ",", "block_size", "=", "0", ")", ":", "t", ",", "msg", "=", "self", ".", "sftp", ".", "_request", "(", "CMD_EXTENDED", ",", "\"check-file\"", ",", ...
Ask the server for a hash of a section of this file. This can be used to verify a successful upload or download, or for various rsync-like operations. The file is hashed from ``offset``, for ``length`` bytes. If ``length`` is 0, the remainder of the file is hashed. Thus, if both ...
[ "Ask", "the", "server", "for", "a", "hash", "of", "a", "section", "of", "this", "file", ".", "This", "can", "be", "used", "to", "verify", "a", "successful", "upload", "or", "download", "or", "for", "various", "rsync", "-", "like", "operations", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/sftp_file.py#L358-L416
train
This method checks the contents of the file for a hash of the 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...
paramiko/paramiko
paramiko/sftp_file.py
SFTPFile.prefetch
def prefetch(self, file_size=None): """ Pre-fetch the remaining contents of this file in anticipation of future `.read` calls. If reading the entire file, pre-fetching can dramatically improve the download speed by avoiding roundtrip latency. The file's contents are incrementall...
python
def prefetch(self, file_size=None): """ Pre-fetch the remaining contents of this file in anticipation of future `.read` calls. If reading the entire file, pre-fetching can dramatically improve the download speed by avoiding roundtrip latency. The file's contents are incrementall...
[ "def", "prefetch", "(", "self", ",", "file_size", "=", "None", ")", ":", "if", "file_size", "is", "None", ":", "file_size", "=", "self", ".", "stat", "(", ")", ".", "st_size", "# queue up async reads for the rest of the file", "chunks", "=", "[", "]", "n", ...
Pre-fetch the remaining contents of this file in anticipation of future `.read` calls. If reading the entire file, pre-fetching can dramatically improve the download speed by avoiding roundtrip latency. The file's contents are incrementally buffered in a background thread. The prefetch...
[ "Pre", "-", "fetch", "the", "remaining", "contents", "of", "this", "file", "in", "anticipation", "of", "future", ".", "read", "calls", ".", "If", "reading", "the", "entire", "file", "pre", "-", "fetching", "can", "dramatically", "improve", "the", "download",...
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/sftp_file.py#L438-L476
train
Pre - fetch the remaining contents of this file in anticipation of future canicalis.
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...
paramiko/paramiko
paramiko/sftp_file.py
SFTPFile.readv
def readv(self, chunks): """ Read a set of blocks from the file by (offset, length). This is more efficient than doing a series of `.seek` and `.read` calls, since the prefetch machinery is used to retrieve all the requested blocks at once. :param chunks: a ...
python
def readv(self, chunks): """ Read a set of blocks from the file by (offset, length). This is more efficient than doing a series of `.seek` and `.read` calls, since the prefetch machinery is used to retrieve all the requested blocks at once. :param chunks: a ...
[ "def", "readv", "(", "self", ",", "chunks", ")", ":", "self", ".", "sftp", ".", "_log", "(", "DEBUG", ",", "\"readv({}, {!r})\"", ".", "format", "(", "hexlify", "(", "self", ".", "handle", ")", ",", "chunks", ")", ")", "read_chunks", "=", "[", "]", ...
Read a set of blocks from the file by (offset, length). This is more efficient than doing a series of `.seek` and `.read` calls, since the prefetch machinery is used to retrieve all the requested blocks at once. :param chunks: a list of ``(offset, length)`` tuples indicatin...
[ "Read", "a", "set", "of", "blocks", "from", "the", "file", "by", "(", "offset", "length", ")", ".", "This", "is", "more", "efficient", "than", "doing", "a", "series", "of", ".", "seek", "and", ".", "read", "calls", "since", "the", "prefetch", "machiner...
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/sftp_file.py#L478-L515
train
Read a set of blocks from the 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...
paramiko/paramiko
paramiko/sftp_file.py
SFTPFile._check_exception
def _check_exception(self): """if there's a saved exception, raise & clear it""" if self._saved_exception is not None: x = self._saved_exception self._saved_exception = None raise x
python
def _check_exception(self): """if there's a saved exception, raise & clear it""" if self._saved_exception is not None: x = self._saved_exception self._saved_exception = None raise x
[ "def", "_check_exception", "(", "self", ")", ":", "if", "self", ".", "_saved_exception", "is", "not", "None", ":", "x", "=", "self", ".", "_saved_exception", "self", ".", "_saved_exception", "=", "None", "raise", "x" ]
if there's a saved exception, raise & clear it
[ "if", "there", "s", "a", "saved", "exception", "raise", "&", "clear", "it" ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/sftp_file.py#L565-L570
train
Raise the exception if there is one.
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...
paramiko/paramiko
paramiko/channel.py
open_only
def open_only(func): """ Decorator for `.Channel` methods which performs an openness check. :raises: `.SSHException` -- If the wrapped method is called on an unopened `.Channel`. """ @wraps(func) def _check(self, *args, **kwds): if ( self.closed ...
python
def open_only(func): """ Decorator for `.Channel` methods which performs an openness check. :raises: `.SSHException` -- If the wrapped method is called on an unopened `.Channel`. """ @wraps(func) def _check(self, *args, **kwds): if ( self.closed ...
[ "def", "open_only", "(", "func", ")", ":", "@", "wraps", "(", "func", ")", "def", "_check", "(", "self", ",", "*", "args", ",", "*", "*", "kwds", ")", ":", "if", "(", "self", ".", "closed", "or", "self", ".", "eof_received", "or", "self", ".", ...
Decorator for `.Channel` methods which performs an openness check. :raises: `.SSHException` -- If the wrapped method is called on an unopened `.Channel`.
[ "Decorator", "for", ".", "Channel", "methods", "which", "performs", "an", "openness", "check", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/channel.py#L54-L74
train
Decorator for methods which performs an openness check.
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...
paramiko/paramiko
paramiko/channel.py
Channel.exec_command
def exec_command(self, command): """ Execute a command on the server. If the server allows it, the channel will then be directly connected to the stdin, stdout, and stderr of the command being executed. When the command finishes executing, the channel will be closed and ...
python
def exec_command(self, command): """ Execute a command on the server. If the server allows it, the channel will then be directly connected to the stdin, stdout, and stderr of the command being executed. When the command finishes executing, the channel will be closed and ...
[ "def", "exec_command", "(", "self", ",", "command", ")", ":", "m", "=", "Message", "(", ")", "m", ".", "add_byte", "(", "cMSG_CHANNEL_REQUEST", ")", "m", ".", "add_int", "(", "self", ".", "remote_chanid", ")", "m", ".", "add_string", "(", "\"exec\"", "...
Execute a command on the server. If the server allows it, the channel will then be directly connected to the stdin, stdout, and stderr of the command being executed. When the command finishes executing, the channel will be closed and can't be reused. You must open a new channel if you...
[ "Execute", "a", "command", "on", "the", "server", ".", "If", "the", "server", "allows", "it", "the", "channel", "will", "then", "be", "directly", "connected", "to", "the", "stdin", "stdout", "and", "stderr", "of", "the", "command", "being", "executed", "."...
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/channel.py#L233-L257
train
Execute a command on the 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...
paramiko/paramiko
paramiko/channel.py
Channel.resize_pty
def resize_pty(self, width=80, height=24, width_pixels=0, height_pixels=0): """ Resize the pseudo-terminal. This can be used to change the width and height of the terminal emulation created in a previous `get_pty` call. :param int width: new width (in characters) of the terminal screen...
python
def resize_pty(self, width=80, height=24, width_pixels=0, height_pixels=0): """ Resize the pseudo-terminal. This can be used to change the width and height of the terminal emulation created in a previous `get_pty` call. :param int width: new width (in characters) of the terminal screen...
[ "def", "resize_pty", "(", "self", ",", "width", "=", "80", ",", "height", "=", "24", ",", "width_pixels", "=", "0", ",", "height_pixels", "=", "0", ")", ":", "m", "=", "Message", "(", ")", "m", ".", "add_byte", "(", "cMSG_CHANNEL_REQUEST", ")", "m", ...
Resize the pseudo-terminal. This can be used to change the width and height of the terminal emulation created in a previous `get_pty` call. :param int width: new width (in characters) of the terminal screen :param int height: new height (in characters) of the terminal screen :param int...
[ "Resize", "the", "pseudo", "-", "terminal", ".", "This", "can", "be", "used", "to", "change", "the", "width", "and", "height", "of", "the", "terminal", "emulation", "created", "in", "a", "previous", "get_pty", "call", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/channel.py#L286-L309
train
Resize the pseudo - terminal.
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...
paramiko/paramiko
paramiko/channel.py
Channel.update_environment
def update_environment(self, environment): """ Updates this channel's remote shell environment. .. note:: This operation is additive - i.e. the current environment is not reset before the given environment variables are set. .. warning:: Servers may ...
python
def update_environment(self, environment): """ Updates this channel's remote shell environment. .. note:: This operation is additive - i.e. the current environment is not reset before the given environment variables are set. .. warning:: Servers may ...
[ "def", "update_environment", "(", "self", ",", "environment", ")", ":", "for", "name", ",", "value", "in", "environment", ".", "items", "(", ")", ":", "try", ":", "self", ".", "set_environment_variable", "(", "name", ",", "value", ")", "except", "SSHExcept...
Updates this channel's remote shell environment. .. note:: This operation is additive - i.e. the current environment is not reset before the given environment variables are set. .. warning:: Servers may silently reject some environment variables; see the ...
[ "Updates", "this", "channel", "s", "remote", "shell", "environment", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/channel.py#L312-L335
train
Updates the remote shell environment.
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...
paramiko/paramiko
paramiko/channel.py
Channel.set_environment_variable
def set_environment_variable(self, name, value): """ Set the value of an environment variable. .. warning:: The server may reject this request depending on its ``AcceptEnv`` setting; such rejections will fail silently (which is common client practice for this...
python
def set_environment_variable(self, name, value): """ Set the value of an environment variable. .. warning:: The server may reject this request depending on its ``AcceptEnv`` setting; such rejections will fail silently (which is common client practice for this...
[ "def", "set_environment_variable", "(", "self", ",", "name", ",", "value", ")", ":", "m", "=", "Message", "(", ")", "m", ".", "add_byte", "(", "cMSG_CHANNEL_REQUEST", ")", "m", ".", "add_int", "(", "self", ".", "remote_chanid", ")", "m", ".", "add_string...
Set the value of an environment variable. .. warning:: The server may reject this request depending on its ``AcceptEnv`` setting; such rejections will fail silently (which is common client practice for this particular request type). Make sure you understand your ...
[ "Set", "the", "value", "of", "an", "environment", "variable", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/channel.py#L338-L362
train
Set the value of an environment variable.
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...
paramiko/paramiko
paramiko/channel.py
Channel.recv_exit_status
def recv_exit_status(self): """ Return the exit status from the process on the server. This is mostly useful for retrieving the results of an `exec_command`. If the command hasn't finished yet, this method will wait until it does, or until the channel is closed. If no exit stat...
python
def recv_exit_status(self): """ Return the exit status from the process on the server. This is mostly useful for retrieving the results of an `exec_command`. If the command hasn't finished yet, this method will wait until it does, or until the channel is closed. If no exit stat...
[ "def", "recv_exit_status", "(", "self", ")", ":", "self", ".", "status_event", ".", "wait", "(", ")", "assert", "self", ".", "status_event", ".", "is_set", "(", ")", "return", "self", ".", "exit_status" ]
Return the exit status from the process on the server. This is mostly useful for retrieving the results of an `exec_command`. If the command hasn't finished yet, this method will wait until it does, or until the channel is closed. If no exit status is provided by the server, -1 is retu...
[ "Return", "the", "exit", "status", "from", "the", "process", "on", "the", "server", ".", "This", "is", "mostly", "useful", "for", "retrieving", "the", "results", "of", "an", "exec_command", ".", "If", "the", "command", "hasn", "t", "finished", "yet", "this...
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/channel.py#L379-L404
train
This method returns the exit status of the process on the 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...
paramiko/paramiko
paramiko/channel.py
Channel.request_x11
def request_x11( self, screen_number=0, auth_protocol=None, auth_cookie=None, single_connection=False, handler=None, ): """ Request an x11 session on this channel. If the server allows it, further x11 requests can be made from the server to th...
python
def request_x11( self, screen_number=0, auth_protocol=None, auth_cookie=None, single_connection=False, handler=None, ): """ Request an x11 session on this channel. If the server allows it, further x11 requests can be made from the server to th...
[ "def", "request_x11", "(", "self", ",", "screen_number", "=", "0", ",", "auth_protocol", "=", "None", ",", "auth_cookie", "=", "None", ",", "single_connection", "=", "False", ",", "handler", "=", "None", ",", ")", ":", "if", "auth_protocol", "is", "None", ...
Request an x11 session on this channel. If the server allows it, further x11 requests can be made from the server to the client, when an x11 application is run in a shell session. From :rfc:`4254`:: It is RECOMMENDED that the 'x11 authentication cookie' that is sent be...
[ "Request", "an", "x11", "session", "on", "this", "channel", ".", "If", "the", "server", "allows", "it", "further", "x11", "requests", "can", "be", "made", "from", "the", "server", "to", "the", "client", "when", "an", "x11", "application", "is", "run", "i...
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/channel.py#L428-L492
train
Request an X11 session on this channel.
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...
paramiko/paramiko
paramiko/channel.py
Channel.request_forward_agent
def request_forward_agent(self, handler): """ Request for a forward SSH Agent on this channel. This is only valid for an ssh-agent from OpenSSH !!! :param handler: a required callable handler to use for incoming SSH Agent connections :return: True if we ...
python
def request_forward_agent(self, handler): """ Request for a forward SSH Agent on this channel. This is only valid for an ssh-agent from OpenSSH !!! :param handler: a required callable handler to use for incoming SSH Agent connections :return: True if we ...
[ "def", "request_forward_agent", "(", "self", ",", "handler", ")", ":", "m", "=", "Message", "(", ")", "m", ".", "add_byte", "(", "cMSG_CHANNEL_REQUEST", ")", "m", ".", "add_int", "(", "self", ".", "remote_chanid", ")", "m", ".", "add_string", "(", "\"aut...
Request for a forward SSH Agent on this channel. This is only valid for an ssh-agent from OpenSSH !!! :param handler: a required callable handler to use for incoming SSH Agent connections :return: True if we are ok, else False (at that time we always return ...
[ "Request", "for", "a", "forward", "SSH", "Agent", "on", "this", "channel", ".", "This", "is", "only", "valid", "for", "an", "ssh", "-", "agent", "from", "OpenSSH", "!!!" ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/channel.py#L495-L516
train
Request a forward SSH Agent on this channel.
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...
paramiko/paramiko
paramiko/channel.py
Channel.set_combine_stderr
def set_combine_stderr(self, combine): """ Set whether stderr should be combined into stdout on this channel. The default is ``False``, but in some cases it may be convenient to have both streams combined. If this is ``False``, and `exec_command` is called (or ``invoke_shell`` ...
python
def set_combine_stderr(self, combine): """ Set whether stderr should be combined into stdout on this channel. The default is ``False``, but in some cases it may be convenient to have both streams combined. If this is ``False``, and `exec_command` is called (or ``invoke_shell`` ...
[ "def", "set_combine_stderr", "(", "self", ",", "combine", ")", ":", "data", "=", "bytes", "(", ")", "self", ".", "lock", ".", "acquire", "(", ")", "try", ":", "old", "=", "self", ".", "combine_stderr", "self", ".", "combine_stderr", "=", "combine", "if...
Set whether stderr should be combined into stdout on this channel. The default is ``False``, but in some cases it may be convenient to have both streams combined. If this is ``False``, and `exec_command` is called (or ``invoke_shell`` with no pty), output to stderr will not show up thro...
[ "Set", "whether", "stderr", "should", "be", "combined", "into", "stdout", "on", "this", "channel", ".", "The", "default", "is", "False", "but", "in", "some", "cases", "it", "may", "be", "convenient", "to", "have", "both", "streams", "combined", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/channel.py#L551-L584
train
Sets whether stderr should be combined into stdout on this channel.
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...
paramiko/paramiko
paramiko/channel.py
Channel.close
def close(self): """ Close the channel. All future read/write operations on the channel will fail. The remote end will receive no more data (after queued data is flushed). Channels are automatically closed when their `.Transport` is closed or when they are garbage collected. ...
python
def close(self): """ Close the channel. All future read/write operations on the channel will fail. The remote end will receive no more data (after queued data is flushed). Channels are automatically closed when their `.Transport` is closed or when they are garbage collected. ...
[ "def", "close", "(", "self", ")", ":", "self", ".", "lock", ".", "acquire", "(", ")", "try", ":", "# only close the pipe when the user explicitly closes the channel.", "# otherwise they will get unpleasant surprises. (and do it before", "# checking self.closed, since the remote ho...
Close the channel. All future read/write operations on the channel will fail. The remote end will receive no more data (after queued data is flushed). Channels are automatically closed when their `.Transport` is closed or when they are garbage collected.
[ "Close", "the", "channel", ".", "All", "future", "read", "/", "write", "operations", "on", "the", "channel", "will", "fail", ".", "The", "remote", "end", "will", "receive", "no", "more", "data", "(", "after", "queued", "data", "is", "flushed", ")", ".", ...
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/channel.py#L647-L671
train
Closes the channel.
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...
paramiko/paramiko
paramiko/channel.py
Channel.send_ready
def send_ready(self): """ Returns true if data can be written to this channel without blocking. This means the channel is either closed (so any write attempt would return immediately) or there is at least one byte of space in the outbound buffer. If there is at least one byte of ...
python
def send_ready(self): """ Returns true if data can be written to this channel without blocking. This means the channel is either closed (so any write attempt would return immediately) or there is at least one byte of space in the outbound buffer. If there is at least one byte of ...
[ "def", "send_ready", "(", "self", ")", ":", "self", ".", "lock", ".", "acquire", "(", ")", "try", ":", "if", "self", ".", "closed", "or", "self", ".", "eof_sent", ":", "return", "True", "return", "self", ".", "out_window_size", ">", "0", "finally", "...
Returns true if data can be written to this channel without blocking. This means the channel is either closed (so any write attempt would return immediately) or there is at least one byte of space in the outbound buffer. If there is at least one byte of space in the outbound buffer, a `s...
[ "Returns", "true", "if", "data", "can", "be", "written", "to", "this", "channel", "without", "blocking", ".", "This", "means", "the", "channel", "is", "either", "closed", "(", "so", "any", "write", "attempt", "would", "return", "immediately", ")", "or", "t...
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/channel.py#L762-L781
train
Returns True if data can be written to this channel without blocking.
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...
paramiko/paramiko
paramiko/channel.py
Channel.send
def send(self, s): """ Send data to the channel. Returns the number of bytes sent, or 0 if the channel stream is closed. Applications are responsible for checking that all data has been sent: if only some of the data was transmitted, the application needs to attempt delivery of...
python
def send(self, s): """ Send data to the channel. Returns the number of bytes sent, or 0 if the channel stream is closed. Applications are responsible for checking that all data has been sent: if only some of the data was transmitted, the application needs to attempt delivery of...
[ "def", "send", "(", "self", ",", "s", ")", ":", "m", "=", "Message", "(", ")", "m", ".", "add_byte", "(", "cMSG_CHANNEL_DATA", ")", "m", ".", "add_int", "(", "self", ".", "remote_chanid", ")", "return", "self", ".", "_send", "(", "s", ",", "m", "...
Send data to the channel. Returns the number of bytes sent, or 0 if the channel stream is closed. Applications are responsible for checking that all data has been sent: if only some of the data was transmitted, the application needs to attempt delivery of the remaining data. :...
[ "Send", "data", "to", "the", "channel", ".", "Returns", "the", "number", "of", "bytes", "sent", "or", "0", "if", "the", "channel", "stream", "is", "closed", ".", "Applications", "are", "responsible", "for", "checking", "that", "all", "data", "has", "been",...
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/channel.py#L783-L801
train
Send data to the channel.
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...
paramiko/paramiko
paramiko/channel.py
Channel.send_stderr
def send_stderr(self, s): """ Send data to the channel on the "stderr" stream. This is normally only used by servers to send output from shell commands -- clients won't use this. Returns the number of bytes sent, or 0 if the channel stream is closed. Applications are responsib...
python
def send_stderr(self, s): """ Send data to the channel on the "stderr" stream. This is normally only used by servers to send output from shell commands -- clients won't use this. Returns the number of bytes sent, or 0 if the channel stream is closed. Applications are responsib...
[ "def", "send_stderr", "(", "self", ",", "s", ")", ":", "m", "=", "Message", "(", ")", "m", ".", "add_byte", "(", "cMSG_CHANNEL_EXTENDED_DATA", ")", "m", ".", "add_int", "(", "self", ".", "remote_chanid", ")", "m", ".", "add_int", "(", "1", ")", "retu...
Send data to the channel on the "stderr" stream. This is normally only used by servers to send output from shell commands -- clients won't use this. Returns the number of bytes sent, or 0 if the channel stream is closed. Applications are responsible for checking that all data has been...
[ "Send", "data", "to", "the", "channel", "on", "the", "stderr", "stream", ".", "This", "is", "normally", "only", "used", "by", "servers", "to", "send", "output", "from", "shell", "commands", "--", "clients", "won", "t", "use", "this", ".", "Returns", "the...
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/channel.py#L803-L825
train
Send data to the channel stderr stream.
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...
paramiko/paramiko
paramiko/channel.py
Channel.sendall
def sendall(self, s): """ Send data to the channel, without allowing partial results. Unlike `send`, this method continues to send data from the given string until either all data has been sent or an error occurs. Nothing is returned. :param str s: data to send. :rais...
python
def sendall(self, s): """ Send data to the channel, without allowing partial results. Unlike `send`, this method continues to send data from the given string until either all data has been sent or an error occurs. Nothing is returned. :param str s: data to send. :rais...
[ "def", "sendall", "(", "self", ",", "s", ")", ":", "while", "s", ":", "sent", "=", "self", ".", "send", "(", "s", ")", "s", "=", "s", "[", "sent", ":", "]", "return", "None" ]
Send data to the channel, without allowing partial results. Unlike `send`, this method continues to send data from the given string until either all data has been sent or an error occurs. Nothing is returned. :param str s: data to send. :raises socket.timeout: if sending ...
[ "Send", "data", "to", "the", "channel", "without", "allowing", "partial", "results", ".", "Unlike", "send", "this", "method", "continues", "to", "send", "data", "from", "the", "given", "string", "until", "either", "all", "data", "has", "been", "sent", "or", ...
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/channel.py#L827-L848
train
Send all data to the channel.
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...
paramiko/paramiko
paramiko/channel.py
Channel.sendall_stderr
def sendall_stderr(self, s): """ Send data to the channel's "stderr" stream, without allowing partial results. Unlike `send_stderr`, this method continues to send data from the given string until all data has been sent or an error occurs. Nothing is returned. :param str...
python
def sendall_stderr(self, s): """ Send data to the channel's "stderr" stream, without allowing partial results. Unlike `send_stderr`, this method continues to send data from the given string until all data has been sent or an error occurs. Nothing is returned. :param str...
[ "def", "sendall_stderr", "(", "self", ",", "s", ")", ":", "while", "s", ":", "sent", "=", "self", ".", "send_stderr", "(", "s", ")", "s", "=", "s", "[", "sent", ":", "]", "return", "None" ]
Send data to the channel's "stderr" stream, without allowing partial results. Unlike `send_stderr`, this method continues to send data from the given string until all data has been sent or an error occurs. Nothing is returned. :param str s: data to send to the client as "stderr" output...
[ "Send", "data", "to", "the", "channel", "s", "stderr", "stream", "without", "allowing", "partial", "results", ".", "Unlike", "send_stderr", "this", "method", "continues", "to", "send", "data", "from", "the", "given", "string", "until", "all", "data", "has", ...
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/channel.py#L850-L869
train
Send data to the channel s stderr stream without allowing partial results.
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...
paramiko/paramiko
paramiko/channel.py
Channel.fileno
def fileno(self): """ Returns an OS-level file descriptor which can be used for polling, but but not for reading or writing. This is primarily to allow Python's ``select`` module to work. The first time ``fileno`` is called on a channel, a pipe is created to simulate re...
python
def fileno(self): """ Returns an OS-level file descriptor which can be used for polling, but but not for reading or writing. This is primarily to allow Python's ``select`` module to work. The first time ``fileno`` is called on a channel, a pipe is created to simulate re...
[ "def", "fileno", "(", "self", ")", ":", "self", ".", "lock", ".", "acquire", "(", ")", "try", ":", "if", "self", ".", "_pipe", "is", "not", "None", ":", "return", "self", ".", "_pipe", ".", "fileno", "(", ")", "# create the pipe and feed in any existing ...
Returns an OS-level file descriptor which can be used for polling, but but not for reading or writing. This is primarily to allow Python's ``select`` module to work. The first time ``fileno`` is called on a channel, a pipe is created to simulate real OS-level file descriptor (FD) behav...
[ "Returns", "an", "OS", "-", "level", "file", "descriptor", "which", "can", "be", "used", "for", "polling", "but", "but", "not", "for", "reading", "or", "writing", ".", "This", "is", "primarily", "to", "allow", "Python", "s", "select", "module", "to", "wo...
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/channel.py#L898-L926
train
Returns an OS - level file descriptor which can be used for polling or reading or 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...
paramiko/paramiko
paramiko/channel.py
Channel.shutdown
def shutdown(self, how): """ Shut down one or both halves of the connection. If ``how`` is 0, further receives are disallowed. If ``how`` is 1, further sends are disallowed. If ``how`` is 2, further sends and receives are disallowed. This closes the stream in one or both dire...
python
def shutdown(self, how): """ Shut down one or both halves of the connection. If ``how`` is 0, further receives are disallowed. If ``how`` is 1, further sends are disallowed. If ``how`` is 2, further sends and receives are disallowed. This closes the stream in one or both dire...
[ "def", "shutdown", "(", "self", ",", "how", ")", ":", "if", "(", "how", "==", "0", ")", "or", "(", "how", "==", "2", ")", ":", "# feign \"read\" shutdown", "self", ".", "eof_received", "=", "1", "if", "(", "how", "==", "1", ")", "or", "(", "how",...
Shut down one or both halves of the connection. If ``how`` is 0, further receives are disallowed. If ``how`` is 1, further sends are disallowed. If ``how`` is 2, further sends and receives are disallowed. This closes the stream in one or both directions. :param int how: ...
[ "Shut", "down", "one", "or", "both", "halves", "of", "the", "connection", ".", "If", "how", "is", "0", "further", "receives", "are", "disallowed", ".", "If", "how", "is", "1", "further", "sends", "are", "disallowed", ".", "If", "how", "is", "2", "furth...
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/channel.py#L928-L949
train
Shut down one or both halves of the connection.
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...
paramiko/paramiko
paramiko/channel.py
Channel._wait_for_send_window
def _wait_for_send_window(self, size): """ (You are already holding the lock.) Wait for the send window to open up, and allocate up to ``size`` bytes for transmission. If no space opens up before the timeout, a timeout exception is raised. Returns the number of bytes available ...
python
def _wait_for_send_window(self, size): """ (You are already holding the lock.) Wait for the send window to open up, and allocate up to ``size`` bytes for transmission. If no space opens up before the timeout, a timeout exception is raised. Returns the number of bytes available ...
[ "def", "_wait_for_send_window", "(", "self", ",", "size", ")", ":", "# you are already holding the lock", "if", "self", ".", "closed", "or", "self", ".", "eof_sent", ":", "return", "0", "if", "self", ".", "out_window_size", "==", "0", ":", "# should we block?", ...
(You are already holding the lock.) Wait for the send window to open up, and allocate up to ``size`` bytes for transmission. If no space opens up before the timeout, a timeout exception is raised. Returns the number of bytes available to send (may be less than requested).
[ "(", "You", "are", "already", "holding", "the", "lock", ".", ")", "Wait", "for", "the", "send", "window", "to", "open", "up", "and", "allocate", "up", "to", "size", "bytes", "for", "transmission", ".", "If", "no", "space", "opens", "up", "before", "the...
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/channel.py#L1278-L1315
train
Wait for the send window to be open up and allocate up to size bytes.
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...
paramiko/paramiko
paramiko/sftp_server.py
SFTPServer.convert_errno
def convert_errno(e): """ Convert an errno value (as from an ``OSError`` or ``IOError``) into a standard SFTP result code. This is a convenience function for trapping exceptions in server code and returning an appropriate result. :param int e: an errno code, as from ``OSError.e...
python
def convert_errno(e): """ Convert an errno value (as from an ``OSError`` or ``IOError``) into a standard SFTP result code. This is a convenience function for trapping exceptions in server code and returning an appropriate result. :param int e: an errno code, as from ``OSError.e...
[ "def", "convert_errno", "(", "e", ")", ":", "if", "e", "==", "errno", ".", "EACCES", ":", "# permission denied", "return", "SFTP_PERMISSION_DENIED", "elif", "(", "e", "==", "errno", ".", "ENOENT", ")", "or", "(", "e", "==", "errno", ".", "ENOTDIR", ")", ...
Convert an errno value (as from an ``OSError`` or ``IOError``) into a standard SFTP result code. This is a convenience function for trapping exceptions in server code and returning an appropriate result. :param int e: an errno code, as from ``OSError.errno``. :return: an `int` SFTP err...
[ "Convert", "an", "errno", "value", "(", "as", "from", "an", "OSError", "or", "IOError", ")", "into", "a", "standard", "SFTP", "result", "code", ".", "This", "is", "a", "convenience", "function", "for", "trapping", "exceptions", "in", "server", "code", "and...
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/sftp_server.py#L180-L196
train
Convert an errno value into an appropriate SFTP result 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...
paramiko/paramiko
paramiko/sftp_server.py
SFTPServer._convert_pflags
def _convert_pflags(self, pflags): """convert SFTP-style open() flags to Python's os.open() flags""" if (pflags & SFTP_FLAG_READ) and (pflags & SFTP_FLAG_WRITE): flags = os.O_RDWR elif pflags & SFTP_FLAG_WRITE: flags = os.O_WRONLY else: flags = os.O_RD...
python
def _convert_pflags(self, pflags): """convert SFTP-style open() flags to Python's os.open() flags""" if (pflags & SFTP_FLAG_READ) and (pflags & SFTP_FLAG_WRITE): flags = os.O_RDWR elif pflags & SFTP_FLAG_WRITE: flags = os.O_WRONLY else: flags = os.O_RD...
[ "def", "_convert_pflags", "(", "self", ",", "pflags", ")", ":", "if", "(", "pflags", "&", "SFTP_FLAG_READ", ")", "and", "(", "pflags", "&", "SFTP_FLAG_WRITE", ")", ":", "flags", "=", "os", ".", "O_RDWR", "elif", "pflags", "&", "SFTP_FLAG_WRITE", ":", "fl...
convert SFTP-style open() flags to Python's os.open() flags
[ "convert", "SFTP", "-", "style", "open", "()", "flags", "to", "Python", "s", "os", ".", "open", "()", "flags" ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/sftp_server.py#L360-L376
train
converts flags from SFTP - style open() flags to Python s os. open flags
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...
paramiko/paramiko
paramiko/buffered_pipe.py
BufferedPipe.set_event
def set_event(self, event): """ Set an event on this buffer. When data is ready to be read (or the buffer has been closed), the event will be set. When no data is ready, the event will be cleared. :param threading.Event event: the event to set/clear """ self._l...
python
def set_event(self, event): """ Set an event on this buffer. When data is ready to be read (or the buffer has been closed), the event will be set. When no data is ready, the event will be cleared. :param threading.Event event: the event to set/clear """ self._l...
[ "def", "set_event", "(", "self", ",", "event", ")", ":", "self", ".", "_lock", ".", "acquire", "(", ")", "try", ":", "self", ".", "_event", "=", "event", "# Make sure the event starts in `set` state if we appear to already", "# be closed; otherwise, if we start in `clea...
Set an event on this buffer. When data is ready to be read (or the buffer has been closed), the event will be set. When no data is ready, the event will be cleared. :param threading.Event event: the event to set/clear
[ "Set", "an", "event", "on", "this", "buffer", ".", "When", "data", "is", "ready", "to", "be", "read", "(", "or", "the", "buffer", "has", "been", "closed", ")", "the", "event", "will", "be", "set", ".", "When", "no", "data", "is", "ready", "the", "e...
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/buffered_pipe.py#L69-L90
train
Sets an event on this buffer.
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...
paramiko/paramiko
paramiko/buffered_pipe.py
BufferedPipe.feed
def feed(self, data): """ Feed new data into this pipe. This method is assumed to be called from a separate thread, so synchronization is done. :param data: the data to add, as a ``str`` or ``bytes`` """ self._lock.acquire() try: if self._event is no...
python
def feed(self, data): """ Feed new data into this pipe. This method is assumed to be called from a separate thread, so synchronization is done. :param data: the data to add, as a ``str`` or ``bytes`` """ self._lock.acquire() try: if self._event is no...
[ "def", "feed", "(", "self", ",", "data", ")", ":", "self", ".", "_lock", ".", "acquire", "(", ")", "try", ":", "if", "self", ".", "_event", "is", "not", "None", ":", "self", ".", "_event", ".", "set", "(", ")", "self", ".", "_buffer_frombytes", "...
Feed new data into this pipe. This method is assumed to be called from a separate thread, so synchronization is done. :param data: the data to add, as a ``str`` or ``bytes``
[ "Feed", "new", "data", "into", "this", "pipe", ".", "This", "method", "is", "assumed", "to", "be", "called", "from", "a", "separate", "thread", "so", "synchronization", "is", "done", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/buffered_pipe.py#L92-L106
train
Feed new data into the pipe.
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...
paramiko/paramiko
paramiko/buffered_pipe.py
BufferedPipe.read_ready
def read_ready(self): """ Returns true if data is buffered and ready to be read from this feeder. A ``False`` result does not mean that the feeder has closed; it means you may need to wait before more data arrives. :return: ``True`` if a `read` call would immediatel...
python
def read_ready(self): """ Returns true if data is buffered and ready to be read from this feeder. A ``False`` result does not mean that the feeder has closed; it means you may need to wait before more data arrives. :return: ``True`` if a `read` call would immediatel...
[ "def", "read_ready", "(", "self", ")", ":", "self", ".", "_lock", ".", "acquire", "(", ")", "try", ":", "if", "len", "(", "self", ".", "_buffer", ")", "==", "0", ":", "return", "False", "return", "True", "finally", ":", "self", ".", "_lock", ".", ...
Returns true if data is buffered and ready to be read from this feeder. A ``False`` result does not mean that the feeder has closed; it means you may need to wait before more data arrives. :return: ``True`` if a `read` call would immediately return at least one byte; ``...
[ "Returns", "true", "if", "data", "is", "buffered", "and", "ready", "to", "be", "read", "from", "this", "feeder", ".", "A", "False", "result", "does", "not", "mean", "that", "the", "feeder", "has", "closed", ";", "it", "means", "you", "may", "need", "to...
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/buffered_pipe.py#L108-L124
train
Returns True if data is buffered and ready to be read from this feeder.
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...
paramiko/paramiko
paramiko/buffered_pipe.py
BufferedPipe.read
def read(self, nbytes, timeout=None): """ Read data from the pipe. The return value is a string representing the data received. The maximum amount of data to be received at once is specified by ``nbytes``. If a string of length zero is returned, the pipe has been closed. ...
python
def read(self, nbytes, timeout=None): """ Read data from the pipe. The return value is a string representing the data received. The maximum amount of data to be received at once is specified by ``nbytes``. If a string of length zero is returned, the pipe has been closed. ...
[ "def", "read", "(", "self", ",", "nbytes", ",", "timeout", "=", "None", ")", ":", "out", "=", "bytes", "(", ")", "self", ".", "_lock", ".", "acquire", "(", ")", "try", ":", "if", "len", "(", "self", ".", "_buffer", ")", "==", "0", ":", "if", ...
Read data from the pipe. The return value is a string representing the data received. The maximum amount of data to be received at once is specified by ``nbytes``. If a string of length zero is returned, the pipe has been closed. The optional ``timeout`` argument can be a nonnegative...
[ "Read", "data", "from", "the", "pipe", ".", "The", "return", "value", "is", "a", "string", "representing", "the", "data", "received", ".", "The", "maximum", "amount", "of", "data", "to", "be", "received", "at", "once", "is", "specified", "by", "nbytes", ...
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/buffered_pipe.py#L126-L178
train
Read data from the pipe.
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...
paramiko/paramiko
paramiko/buffered_pipe.py
BufferedPipe.empty
def empty(self): """ Clear out the buffer and return all data that was in it. :return: any data that was in the buffer prior to clearing it out, as a `str` """ self._lock.acquire() try: out = self._buffer_tobytes() del self...
python
def empty(self): """ Clear out the buffer and return all data that was in it. :return: any data that was in the buffer prior to clearing it out, as a `str` """ self._lock.acquire() try: out = self._buffer_tobytes() del self...
[ "def", "empty", "(", "self", ")", ":", "self", ".", "_lock", ".", "acquire", "(", ")", "try", ":", "out", "=", "self", ".", "_buffer_tobytes", "(", ")", "del", "self", ".", "_buffer", "[", ":", "]", "if", "(", "self", ".", "_event", "is", "not", ...
Clear out the buffer and return all data that was in it. :return: any data that was in the buffer prior to clearing it out, as a `str`
[ "Clear", "out", "the", "buffer", "and", "return", "all", "data", "that", "was", "in", "it", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/buffered_pipe.py#L180-L196
train
Clear out the buffer and return all data that was in it.
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...
paramiko/paramiko
paramiko/buffered_pipe.py
BufferedPipe.close
def close(self): """ Close this pipe object. Future calls to `read` after the buffer has been emptied will return immediately with an empty string. """ self._lock.acquire() try: self._closed = True self._cv.notifyAll() if self._event i...
python
def close(self): """ Close this pipe object. Future calls to `read` after the buffer has been emptied will return immediately with an empty string. """ self._lock.acquire() try: self._closed = True self._cv.notifyAll() if self._event i...
[ "def", "close", "(", "self", ")", ":", "self", ".", "_lock", ".", "acquire", "(", ")", "try", ":", "self", ".", "_closed", "=", "True", "self", ".", "_cv", ".", "notifyAll", "(", ")", "if", "self", ".", "_event", "is", "not", "None", ":", "self",...
Close this pipe object. Future calls to `read` after the buffer has been emptied will return immediately with an empty string.
[ "Close", "this", "pipe", "object", ".", "Future", "calls", "to", "read", "after", "the", "buffer", "has", "been", "emptied", "will", "return", "immediately", "with", "an", "empty", "string", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/buffered_pipe.py#L198-L210
train
Close this pipe 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...
paramiko/paramiko
paramiko/config.py
SSHConfig.parse
def parse(self, file_obj): """ Read an OpenSSH config from the given file object. :param file_obj: a file-like object to read the config file from """ host = {"host": ["*"], "config": {}} for line in file_obj: # Strip any leading or trailing whitespace from t...
python
def parse(self, file_obj): """ Read an OpenSSH config from the given file object. :param file_obj: a file-like object to read the config file from """ host = {"host": ["*"], "config": {}} for line in file_obj: # Strip any leading or trailing whitespace from t...
[ "def", "parse", "(", "self", ",", "file_obj", ")", ":", "host", "=", "{", "\"host\"", ":", "[", "\"*\"", "]", ",", "\"config\"", ":", "{", "}", "}", "for", "line", "in", "file_obj", ":", "# Strip any leading or trailing whitespace from the line.", "# Refer to ...
Read an OpenSSH config from the given file object. :param file_obj: a file-like object to read the config file from
[ "Read", "an", "OpenSSH", "config", "from", "the", "given", "file", "object", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/config.py#L52-L94
train
Reads an OpenSSH config file from the given file - like 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...
paramiko/paramiko
paramiko/config.py
SSHConfig.lookup
def lookup(self, hostname): """ Return a dict (`SSHConfigDict`) of config options for a given hostname. The host-matching rules of OpenSSH's ``ssh_config`` man page are used: For each parameter, the first obtained value will be used. The configuration files contain sections sep...
python
def lookup(self, hostname): """ Return a dict (`SSHConfigDict`) of config options for a given hostname. The host-matching rules of OpenSSH's ``ssh_config`` man page are used: For each parameter, the first obtained value will be used. The configuration files contain sections sep...
[ "def", "lookup", "(", "self", ",", "hostname", ")", ":", "matches", "=", "[", "config", "for", "config", "in", "self", ".", "_config", "if", "self", ".", "_allowed", "(", "config", "[", "\"host\"", "]", ",", "hostname", ")", "]", "ret", "=", "SSHConf...
Return a dict (`SSHConfigDict`) of config options for a given hostname. The host-matching rules of OpenSSH's ``ssh_config`` man page are used: For each parameter, the first obtained value will be used. The configuration files contain sections separated by ``Host`` specifications, and t...
[ "Return", "a", "dict", "(", "SSHConfigDict", ")", "of", "config", "options", "for", "a", "given", "hostname", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/config.py#L96-L147
train
Returns a dict of config options for a given hostname.
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...
paramiko/paramiko
paramiko/config.py
SSHConfig.get_hostnames
def get_hostnames(self): """ Return the set of literal hostnames defined in the SSH config (both explicit hostnames and wildcard entries). """ hosts = set() for entry in self._config: hosts.update(entry["host"]) return hosts
python
def get_hostnames(self): """ Return the set of literal hostnames defined in the SSH config (both explicit hostnames and wildcard entries). """ hosts = set() for entry in self._config: hosts.update(entry["host"]) return hosts
[ "def", "get_hostnames", "(", "self", ")", ":", "hosts", "=", "set", "(", ")", "for", "entry", "in", "self", ".", "_config", ":", "hosts", ".", "update", "(", "entry", "[", "\"host\"", "]", ")", "return", "hosts" ]
Return the set of literal hostnames defined in the SSH config (both explicit hostnames and wildcard entries).
[ "Return", "the", "set", "of", "literal", "hostnames", "defined", "in", "the", "SSH", "config", "(", "both", "explicit", "hostnames", "and", "wildcard", "entries", ")", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/config.py#L149-L157
train
Return the set of literal hostnames defined in the SSH config.
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...
paramiko/paramiko
paramiko/config.py
SSHConfig._expand_variables
def _expand_variables(self, config, hostname): """ Return a dict of config options with expanded substitutions for a given hostname. Please refer to man ``ssh_config`` for the parameters that are replaced. :param dict config: the config for the hostname :param s...
python
def _expand_variables(self, config, hostname): """ Return a dict of config options with expanded substitutions for a given hostname. Please refer to man ``ssh_config`` for the parameters that are replaced. :param dict config: the config for the hostname :param s...
[ "def", "_expand_variables", "(", "self", ",", "config", ",", "hostname", ")", ":", "if", "\"hostname\"", "in", "config", ":", "config", "[", "\"hostname\"", "]", "=", "config", "[", "\"hostname\"", "]", ".", "replace", "(", "\"%h\"", ",", "hostname", ")", ...
Return a dict of config options with expanded substitutions for a given hostname. Please refer to man ``ssh_config`` for the parameters that are replaced. :param dict config: the config for the hostname :param str hostname: the hostname that the config belongs to
[ "Return", "a", "dict", "of", "config", "options", "with", "expanded", "substitutions", "for", "a", "given", "hostname", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/config.py#L168-L239
train
Return a dict of config options with expanded substitutions for a given hostname.
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...
paramiko/paramiko
paramiko/config.py
SSHConfig._get_hosts
def _get_hosts(self, host): """ Return a list of host_names from host value. """ try: return shlex.split(host) except ValueError: raise Exception("Unparsable host {}".format(host))
python
def _get_hosts(self, host): """ Return a list of host_names from host value. """ try: return shlex.split(host) except ValueError: raise Exception("Unparsable host {}".format(host))
[ "def", "_get_hosts", "(", "self", ",", "host", ")", ":", "try", ":", "return", "shlex", ".", "split", "(", "host", ")", "except", "ValueError", ":", "raise", "Exception", "(", "\"Unparsable host {}\"", ".", "format", "(", "host", ")", ")" ]
Return a list of host_names from host value.
[ "Return", "a", "list", "of", "host_names", "from", "host", "value", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/config.py#L241-L248
train
Return a list of host_names from host value.
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...
paramiko/paramiko
paramiko/config.py
SSHConfigDict.as_bool
def as_bool(self, key): """ Express given key's value as a boolean type. Typically, this is used for ``ssh_config``'s pseudo-boolean values which are either ``"yes"`` or ``"no"``. In such cases, ``"yes"`` yields ``True`` and any other value becomes ``False``. .. note:: ...
python
def as_bool(self, key): """ Express given key's value as a boolean type. Typically, this is used for ``ssh_config``'s pseudo-boolean values which are either ``"yes"`` or ``"no"``. In such cases, ``"yes"`` yields ``True`` and any other value becomes ``False``. .. note:: ...
[ "def", "as_bool", "(", "self", ",", "key", ")", ":", "val", "=", "self", "[", "key", "]", "if", "isinstance", "(", "val", ",", "bool", ")", ":", "return", "val", "return", "val", ".", "lower", "(", ")", "==", "\"yes\"" ]
Express given key's value as a boolean type. Typically, this is used for ``ssh_config``'s pseudo-boolean values which are either ``"yes"`` or ``"no"``. In such cases, ``"yes"`` yields ``True`` and any other value becomes ``False``. .. note:: If (for whatever reason) the sto...
[ "Express", "given", "key", "s", "value", "as", "a", "boolean", "type", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/config.py#L344-L361
train
Returns the value of the given key as a boolean.
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...
paramiko/paramiko
paramiko/server.py
ServerInterface.check_auth_gssapi_with_mic
def check_auth_gssapi_with_mic( self, username, gss_authenticated=AUTH_FAILED, cc_file=None ): """ Authenticate the given user to the server if he is a valid krb5 principal. :param str username: The username of the authenticating client :param int gss_authenticated: ...
python
def check_auth_gssapi_with_mic( self, username, gss_authenticated=AUTH_FAILED, cc_file=None ): """ Authenticate the given user to the server if he is a valid krb5 principal. :param str username: The username of the authenticating client :param int gss_authenticated: ...
[ "def", "check_auth_gssapi_with_mic", "(", "self", ",", "username", ",", "gss_authenticated", "=", "AUTH_FAILED", ",", "cc_file", "=", "None", ")", ":", "if", "gss_authenticated", "==", "AUTH_SUCCESSFUL", ":", "return", "AUTH_SUCCESSFUL", "return", "AUTH_FAILED" ]
Authenticate the given user to the server if he is a valid krb5 principal. :param str username: The username of the authenticating client :param int gss_authenticated: The result of the krb5 authentication :param str cc_filename: The krb5 client credentials cache filename :retur...
[ "Authenticate", "the", "given", "user", "to", "the", "server", "if", "he", "is", "a", "valid", "krb5", "principal", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/server.py#L239-L267
train
Checks if the given user is authenticated with the kerberos API.
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...
paramiko/paramiko
paramiko/server.py
ServerInterface.check_auth_gssapi_keyex
def check_auth_gssapi_keyex( self, username, gss_authenticated=AUTH_FAILED, cc_file=None ): """ Authenticate the given user to the server if he is a valid krb5 principal and GSS-API Key Exchange was performed. If GSS-API Key Exchange was not performed, this authentication met...
python
def check_auth_gssapi_keyex( self, username, gss_authenticated=AUTH_FAILED, cc_file=None ): """ Authenticate the given user to the server if he is a valid krb5 principal and GSS-API Key Exchange was performed. If GSS-API Key Exchange was not performed, this authentication met...
[ "def", "check_auth_gssapi_keyex", "(", "self", ",", "username", ",", "gss_authenticated", "=", "AUTH_FAILED", ",", "cc_file", "=", "None", ")", ":", "if", "gss_authenticated", "==", "AUTH_SUCCESSFUL", ":", "return", "AUTH_SUCCESSFUL", "return", "AUTH_FAILED" ]
Authenticate the given user to the server if he is a valid krb5 principal and GSS-API Key Exchange was performed. If GSS-API Key Exchange was not performed, this authentication method won't be available. :param str username: The username of the authenticating client :param int g...
[ "Authenticate", "the", "given", "user", "to", "the", "server", "if", "he", "is", "a", "valid", "krb5", "principal", "and", "GSS", "-", "API", "Key", "Exchange", "was", "performed", ".", "If", "GSS", "-", "API", "Key", "Exchange", "was", "not", "performed...
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/server.py#L269-L299
train
Checks if the given user is a valid kerberos - API key exchange and returns AUTH_SUCCESSFUL if the user is not authenticated otherwise AUTH_FAILED.
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...
paramiko/paramiko
paramiko/server.py
ServerInterface.check_channel_subsystem_request
def check_channel_subsystem_request(self, channel, name): """ Determine if a requested subsystem will be provided to the client on the given channel. If this method returns ``True``, all future I/O through this channel will be assumed to be connected to the requested subsystem. ...
python
def check_channel_subsystem_request(self, channel, name): """ Determine if a requested subsystem will be provided to the client on the given channel. If this method returns ``True``, all future I/O through this channel will be assumed to be connected to the requested subsystem. ...
[ "def", "check_channel_subsystem_request", "(", "self", ",", "channel", ",", "name", ")", ":", "transport", "=", "channel", ".", "get_transport", "(", ")", "handler_class", ",", "larg", ",", "kwarg", "=", "transport", ".", "_get_subsystem_handler", "(", "name", ...
Determine if a requested subsystem will be provided to the client on the given channel. If this method returns ``True``, all future I/O through this channel will be assumed to be connected to the requested subsystem. An example of a subsystem is ``sftp``. The default implementation ch...
[ "Determine", "if", "a", "requested", "subsystem", "will", "be", "provided", "to", "the", "client", "on", "the", "given", "channel", ".", "If", "this", "method", "returns", "True", "all", "future", "I", "/", "O", "through", "this", "channel", "will", "be", ...
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/server.py#L435-L463
train
Checks if a requested subsystem request should be routed to the client on the given channel.
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...
paramiko/paramiko
paramiko/server.py
InteractiveQuery.add_prompt
def add_prompt(self, prompt, echo=True): """ Add a prompt to this query. The prompt should be a (reasonably short) string. Multiple prompts can be added to the same query. :param str prompt: the user prompt :param bool echo: ``True`` (default) if the user's respons...
python
def add_prompt(self, prompt, echo=True): """ Add a prompt to this query. The prompt should be a (reasonably short) string. Multiple prompts can be added to the same query. :param str prompt: the user prompt :param bool echo: ``True`` (default) if the user's respons...
[ "def", "add_prompt", "(", "self", ",", "prompt", ",", "echo", "=", "True", ")", ":", "self", ".", "prompts", ".", "append", "(", "(", "prompt", ",", "echo", ")", ")" ]
Add a prompt to this query. The prompt should be a (reasonably short) string. Multiple prompts can be added to the same query. :param str prompt: the user prompt :param bool echo: ``True`` (default) if the user's response should be echoed; ``False`` if not (for a passw...
[ "Add", "a", "prompt", "to", "this", "query", ".", "The", "prompt", "should", "be", "a", "(", "reasonably", "short", ")", "string", ".", "Multiple", "prompts", "can", "be", "added", "to", "the", "same", "query", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/server.py#L623-L633
train
Add a prompt to this query.
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...
paramiko/paramiko
paramiko/ssh_gss.py
GSSAuth
def GSSAuth(auth_method, gss_deleg_creds=True): """ Provide SSH2 GSS-API / SSPI authentication. :param str auth_method: The name of the SSH authentication mechanism (gssapi-with-mic or gss-keyex) :param bool gss_deleg_creds: Delegate client credentials or not. ...
python
def GSSAuth(auth_method, gss_deleg_creds=True): """ Provide SSH2 GSS-API / SSPI authentication. :param str auth_method: The name of the SSH authentication mechanism (gssapi-with-mic or gss-keyex) :param bool gss_deleg_creds: Delegate client credentials or not. ...
[ "def", "GSSAuth", "(", "auth_method", ",", "gss_deleg_creds", "=", "True", ")", ":", "if", "_API", "==", "\"MIT\"", ":", "return", "_SSH_GSSAPI", "(", "auth_method", ",", "gss_deleg_creds", ")", "elif", "_API", "==", "\"SSPI\"", "and", "os", ".", "name", "...
Provide SSH2 GSS-API / SSPI authentication. :param str auth_method: The name of the SSH authentication mechanism (gssapi-with-mic or gss-keyex) :param bool gss_deleg_creds: Delegate client credentials or not. We delegate credentials by default. :...
[ "Provide", "SSH2", "GSS", "-", "API", "/", "SSPI", "authentication", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/ssh_gss.py#L68-L94
train
Returns an SSH2 GSS - API or SSPI authentication 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...
paramiko/paramiko
paramiko/ssh_gss.py
_SSH_GSSAuth.ssh_gss_oids
def ssh_gss_oids(self, mode="client"): """ This method returns a single OID, because we only support the Kerberos V5 mechanism. :param str mode: Client for client mode and server for server mode :return: A byte sequence containing the number of supported OIDs, t...
python
def ssh_gss_oids(self, mode="client"): """ This method returns a single OID, because we only support the Kerberos V5 mechanism. :param str mode: Client for client mode and server for server mode :return: A byte sequence containing the number of supported OIDs, t...
[ "def", "ssh_gss_oids", "(", "self", ",", "mode", "=", "\"client\"", ")", ":", "from", "pyasn1", ".", "type", ".", "univ", "import", "ObjectIdentifier", "from", "pyasn1", ".", "codec", ".", "der", "import", "encoder", "OIDs", "=", "self", ".", "_make_uint32...
This method returns a single OID, because we only support the Kerberos V5 mechanism. :param str mode: Client for client mode and server for server mode :return: A byte sequence containing the number of supported OIDs, the length of the OID and the actual OID encoded with ...
[ "This", "method", "returns", "a", "single", "OID", "because", "we", "only", "support", "the", "Kerberos", "V5", "mechanism", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/ssh_gss.py#L150-L170
train
This method returns a byte sequence containing the number of supported Kerberos V5 OIDs and the actual OID encoded with the base64 - encoded with .
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...
paramiko/paramiko
paramiko/ssh_gss.py
_SSH_GSSAuth.ssh_check_mech
def ssh_check_mech(self, desired_mech): """ Check if the given OID is the Kerberos V5 OID (server mode). :param str desired_mech: The desired GSS-API mechanism of the client :return: ``True`` if the given OID is supported, otherwise C{False} """ from pyasn1.codec.der imp...
python
def ssh_check_mech(self, desired_mech): """ Check if the given OID is the Kerberos V5 OID (server mode). :param str desired_mech: The desired GSS-API mechanism of the client :return: ``True`` if the given OID is supported, otherwise C{False} """ from pyasn1.codec.der imp...
[ "def", "ssh_check_mech", "(", "self", ",", "desired_mech", ")", ":", "from", "pyasn1", ".", "codec", ".", "der", "import", "decoder", "mech", ",", "__", "=", "decoder", ".", "decode", "(", "desired_mech", ")", "if", "mech", ".", "__str__", "(", ")", "!...
Check if the given OID is the Kerberos V5 OID (server mode). :param str desired_mech: The desired GSS-API mechanism of the client :return: ``True`` if the given OID is supported, otherwise C{False}
[ "Check", "if", "the", "given", "OID", "is", "the", "Kerberos", "V5", "OID", "(", "server", "mode", ")", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/ssh_gss.py#L172-L184
train
Check if the given OID is the Kerberos V5 OID.
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...
paramiko/paramiko
paramiko/ssh_gss.py
_SSH_GSSAuth._ssh_build_mic
def _ssh_build_mic(self, session_id, username, service, auth_method): """ Create the SSH2 MIC filed for gssapi-with-mic. :param str session_id: The SSH session ID :param str username: The name of the user who attempts to login :param str service: The requested SSH service ...
python
def _ssh_build_mic(self, session_id, username, service, auth_method): """ Create the SSH2 MIC filed for gssapi-with-mic. :param str session_id: The SSH session ID :param str username: The name of the user who attempts to login :param str service: The requested SSH service ...
[ "def", "_ssh_build_mic", "(", "self", ",", "session_id", ",", "username", ",", "service", ",", "auth_method", ")", ":", "mic", "=", "self", ".", "_make_uint32", "(", "len", "(", "session_id", ")", ")", "mic", "+=", "session_id", "mic", "+=", "struct", "....
Create the SSH2 MIC filed for gssapi-with-mic. :param str session_id: The SSH session ID :param str username: The name of the user who attempts to login :param str service: The requested SSH service :param str auth_method: The requested SSH authentication mechanism :return: The ...
[ "Create", "the", "SSH2", "MIC", "filed", "for", "gssapi", "-", "with", "-", "mic", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/ssh_gss.py#L197-L223
train
Builds the SSH2 MIC filed for gssapi - with - mic.
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...
paramiko/paramiko
paramiko/ssh_gss.py
_SSH_GSSAPI.ssh_init_sec_context
def ssh_init_sec_context( self, target, desired_mech=None, username=None, recv_token=None ): """ Initialize a GSS-API context. :param str username: The name of the user who attempts to login :param str target: The hostname of the target to connect to :param str desir...
python
def ssh_init_sec_context( self, target, desired_mech=None, username=None, recv_token=None ): """ Initialize a GSS-API context. :param str username: The name of the user who attempts to login :param str target: The hostname of the target to connect to :param str desir...
[ "def", "ssh_init_sec_context", "(", "self", ",", "target", ",", "desired_mech", "=", "None", ",", "username", "=", "None", ",", "recv_token", "=", "None", ")", ":", "from", "pyasn1", ".", "codec", ".", "der", "import", "decoder", "self", ".", "_username", ...
Initialize a GSS-API context. :param str username: The name of the user who attempts to login :param str target: The hostname of the target to connect to :param str desired_mech: The negotiated GSS-API mechanism ("pseudo negotiated" mechanism, because we ...
[ "Initialize", "a", "GSS", "-", "API", "context", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/ssh_gss.py#L255-L305
train
Initialize a GSS - API context.
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...
paramiko/paramiko
paramiko/ssh_gss.py
_SSH_GSSAPI.ssh_accept_sec_context
def ssh_accept_sec_context(self, hostname, recv_token, username=None): """ Accept a GSS-API context (server mode). :param str hostname: The servers hostname :param str username: The name of the user who attempts to login :param str recv_token: The GSS-API Token received from the...
python
def ssh_accept_sec_context(self, hostname, recv_token, username=None): """ Accept a GSS-API context (server mode). :param str hostname: The servers hostname :param str username: The name of the user who attempts to login :param str recv_token: The GSS-API Token received from the...
[ "def", "ssh_accept_sec_context", "(", "self", ",", "hostname", ",", "recv_token", ",", "username", "=", "None", ")", ":", "# hostname and username are not required for GSSAPI, but for SSPI", "self", ".", "_gss_host", "=", "hostname", "self", ".", "_username", "=", "us...
Accept a GSS-API context (server mode). :param str hostname: The servers hostname :param str username: The name of the user who attempts to login :param str recv_token: The GSS-API Token received from the server, if it's not the initial call. :return: A ``...
[ "Accept", "a", "GSS", "-", "API", "context", "(", "server", "mode", ")", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/ssh_gss.py#L334-L352
train
Accept a GSS - API context.
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...
paramiko/paramiko
paramiko/ssh_gss.py
_SSH_SSPI.ssh_init_sec_context
def ssh_init_sec_context( self, target, desired_mech=None, username=None, recv_token=None ): """ Initialize a SSPI context. :param str username: The name of the user who attempts to login :param str target: The FQDN of the target to connect to :param str desired_mech...
python
def ssh_init_sec_context( self, target, desired_mech=None, username=None, recv_token=None ): """ Initialize a SSPI context. :param str username: The name of the user who attempts to login :param str target: The FQDN of the target to connect to :param str desired_mech...
[ "def", "ssh_init_sec_context", "(", "self", ",", "target", ",", "desired_mech", "=", "None", ",", "username", "=", "None", ",", "recv_token", "=", "None", ")", ":", "from", "pyasn1", ".", "codec", ".", "der", "import", "decoder", "self", ".", "_username", ...
Initialize a SSPI context. :param str username: The name of the user who attempts to login :param str target: The FQDN of the target to connect to :param str desired_mech: The negotiated SSPI mechanism ("pseudo negotiated" mechanism, because we ...
[ "Initialize", "a", "SSPI", "context", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/ssh_gss.py#L431-L481
train
Initialize the SSPI context.
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...
paramiko/paramiko
paramiko/ssh_gss.py
_SSH_SSPI.ssh_get_mic
def ssh_get_mic(self, session_id, gss_kex=False): """ Create the MIC token for a SSH2 message. :param str session_id: The SSH session ID :param bool gss_kex: Generate the MIC for Key Exchange with SSPI or not :return: gssapi-with-mic: Returns the MIC token from ...
python
def ssh_get_mic(self, session_id, gss_kex=False): """ Create the MIC token for a SSH2 message. :param str session_id: The SSH session ID :param bool gss_kex: Generate the MIC for Key Exchange with SSPI or not :return: gssapi-with-mic: Returns the MIC token from ...
[ "def", "ssh_get_mic", "(", "self", ",", "session_id", ",", "gss_kex", "=", "False", ")", ":", "self", ".", "_session_id", "=", "session_id", "if", "not", "gss_kex", ":", "mic_field", "=", "self", ".", "_ssh_build_mic", "(", "self", ".", "_session_id", ",",...
Create the MIC token for a SSH2 message. :param str session_id: The SSH session ID :param bool gss_kex: Generate the MIC for Key Exchange with SSPI or not :return: gssapi-with-mic: Returns the MIC token from SSPI for the message we created with ``_ssh_build_mic...
[ "Create", "the", "MIC", "token", "for", "a", "SSH2", "message", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/ssh_gss.py#L483-L508
train
Generate the MIC token for a SSH2 message.
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...
paramiko/paramiko
paramiko/ssh_gss.py
_SSH_SSPI.ssh_accept_sec_context
def ssh_accept_sec_context(self, hostname, username, recv_token): """ Accept a SSPI context (server mode). :param str hostname: The servers FQDN :param str username: The name of the user who attempts to login :param str recv_token: The SSPI Token received from the server, ...
python
def ssh_accept_sec_context(self, hostname, username, recv_token): """ Accept a SSPI context (server mode). :param str hostname: The servers FQDN :param str username: The name of the user who attempts to login :param str recv_token: The SSPI Token received from the server, ...
[ "def", "ssh_accept_sec_context", "(", "self", ",", "hostname", ",", "username", ",", "recv_token", ")", ":", "self", ".", "_gss_host", "=", "hostname", "self", ".", "_username", "=", "username", "targ_name", "=", "\"host/\"", "+", "self", ".", "_gss_host", "...
Accept a SSPI context (server mode). :param str hostname: The servers FQDN :param str username: The name of the user who attempts to login :param str recv_token: The SSPI Token received from the server, if it's not the initial call. :return: A ``String`` i...
[ "Accept", "a", "SSPI", "context", "(", "server", "mode", ")", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/ssh_gss.py#L510-L530
train
Accept a SSPI context.
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...
paramiko/paramiko
paramiko/ssh_gss.py
_SSH_SSPI.ssh_check_mic
def ssh_check_mic(self, mic_token, session_id, username=None): """ Verify the MIC token for a SSH2 message. :param str mic_token: The MIC token received from the client :param str session_id: The SSH session ID :param str username: The name of the user who attempts to login ...
python
def ssh_check_mic(self, mic_token, session_id, username=None): """ Verify the MIC token for a SSH2 message. :param str mic_token: The MIC token received from the client :param str session_id: The SSH session ID :param str username: The name of the user who attempts to login ...
[ "def", "ssh_check_mic", "(", "self", ",", "mic_token", ",", "session_id", ",", "username", "=", "None", ")", ":", "self", ".", "_session_id", "=", "session_id", "self", ".", "_username", "=", "username", "if", "username", "is", "not", "None", ":", "# serve...
Verify the MIC token for a SSH2 message. :param str mic_token: The MIC token received from the client :param str session_id: The SSH session ID :param str username: The name of the user who attempts to login :return: None if the MIC check was successful :raises: ``sspi.error`` -...
[ "Verify", "the", "MIC", "token", "for", "a", "SSH2", "message", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/ssh_gss.py#L532-L560
train
Verify the MIC token for a SSH2 message.
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...
paramiko/paramiko
paramiko/ssh_gss.py
_SSH_SSPI.credentials_delegated
def credentials_delegated(self): """ Checks if credentials are delegated (server mode). :return: ``True`` if credentials are delegated, otherwise ``False`` """ return self._gss_flags & sspicon.ISC_REQ_DELEGATE and ( self._gss_srv_ctxt_status or self._gss_flags ...
python
def credentials_delegated(self): """ Checks if credentials are delegated (server mode). :return: ``True`` if credentials are delegated, otherwise ``False`` """ return self._gss_flags & sspicon.ISC_REQ_DELEGATE and ( self._gss_srv_ctxt_status or self._gss_flags ...
[ "def", "credentials_delegated", "(", "self", ")", ":", "return", "self", ".", "_gss_flags", "&", "sspicon", ".", "ISC_REQ_DELEGATE", "and", "(", "self", ".", "_gss_srv_ctxt_status", "or", "self", ".", "_gss_flags", ")" ]
Checks if credentials are delegated (server mode). :return: ``True`` if credentials are delegated, otherwise ``False``
[ "Checks", "if", "credentials", "are", "delegated", "(", "server", "mode", ")", "." ]
cf7d49d66f3b1fbc8b0853518a54050182b3b5eb
https://github.com/paramiko/paramiko/blob/cf7d49d66f3b1fbc8b0853518a54050182b3b5eb/paramiko/ssh_gss.py#L563-L571
train
Checks if credentials are delegated.
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...