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
pydata/xarray
xarray/plot/utils.py
_build_discrete_cmap
def _build_discrete_cmap(cmap, levels, extend, filled): """ Build a discrete colormap and normalization of the data. """ import matplotlib as mpl if not filled: # non-filled contour plots extend = 'max' if extend == 'both': ext_n = 2 elif extend in ['min', 'max']: ...
python
def _build_discrete_cmap(cmap, levels, extend, filled): """ Build a discrete colormap and normalization of the data. """ import matplotlib as mpl if not filled: # non-filled contour plots extend = 'max' if extend == 'both': ext_n = 2 elif extend in ['min', 'max']: ...
[ "def", "_build_discrete_cmap", "(", "cmap", ",", "levels", ",", "extend", ",", "filled", ")", ":", "import", "matplotlib", "as", "mpl", "if", "not", "filled", ":", "# non-filled contour plots", "extend", "=", "'max'", "if", "extend", "==", "'both'", ":", "ex...
Build a discrete colormap and normalization of the data.
[ "Build", "a", "discrete", "colormap", "and", "normalization", "of", "the", "data", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/utils.py#L81-L106
train
Build a discrete colormap and normalization of the data.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/plot/utils.py
_determine_cmap_params
def _determine_cmap_params(plot_data, vmin=None, vmax=None, cmap=None, center=None, robust=False, extend=None, levels=None, filled=True, norm=None): """ Use some heuristics to set good defaults for colorbar and range. Parameters ========== plot_...
python
def _determine_cmap_params(plot_data, vmin=None, vmax=None, cmap=None, center=None, robust=False, extend=None, levels=None, filled=True, norm=None): """ Use some heuristics to set good defaults for colorbar and range. Parameters ========== plot_...
[ "def", "_determine_cmap_params", "(", "plot_data", ",", "vmin", "=", "None", ",", "vmax", "=", "None", ",", "cmap", "=", "None", ",", "center", "=", "None", ",", "robust", "=", "False", ",", "extend", "=", "None", ",", "levels", "=", "None", ",", "fi...
Use some heuristics to set good defaults for colorbar and range. Parameters ========== plot_data: Numpy array Doesn't handle xarray objects Returns ======= cmap_params : dict Use depends on the type of the plotting function
[ "Use", "some", "heuristics", "to", "set", "good", "defaults", "for", "colorbar", "and", "range", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/utils.py#L143-L273
train
Determine the parameters of a colorbar and range of a colorbar.
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...
pydata/xarray
xarray/plot/utils.py
_infer_xy_labels_3d
def _infer_xy_labels_3d(darray, x, y, rgb): """ Determine x and y labels for showing RGB images. Attempts to infer which dimension is RGB/RGBA by size and order of dims. """ assert rgb is None or rgb != x assert rgb is None or rgb != y # Start by detecting and reporting invalid combination...
python
def _infer_xy_labels_3d(darray, x, y, rgb): """ Determine x and y labels for showing RGB images. Attempts to infer which dimension is RGB/RGBA by size and order of dims. """ assert rgb is None or rgb != x assert rgb is None or rgb != y # Start by detecting and reporting invalid combination...
[ "def", "_infer_xy_labels_3d", "(", "darray", ",", "x", ",", "y", ",", "rgb", ")", ":", "assert", "rgb", "is", "None", "or", "rgb", "!=", "x", "assert", "rgb", "is", "None", "or", "rgb", "!=", "y", "# Start by detecting and reporting invalid combinations of arg...
Determine x and y labels for showing RGB images. Attempts to infer which dimension is RGB/RGBA by size and order of dims.
[ "Determine", "x", "and", "y", "labels", "for", "showing", "RGB", "images", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/utils.py#L276-L323
train
Infer x and y labels for showing RGB images.
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...
pydata/xarray
xarray/plot/utils.py
_infer_xy_labels
def _infer_xy_labels(darray, x, y, imshow=False, rgb=None): """ Determine x and y labels. For use in _plot2d darray must be a 2 dimensional data array, or 3d for imshow only. """ assert x is None or x != y if imshow and darray.ndim == 3: return _infer_xy_labels_3d(darray, x, y, rgb) ...
python
def _infer_xy_labels(darray, x, y, imshow=False, rgb=None): """ Determine x and y labels. For use in _plot2d darray must be a 2 dimensional data array, or 3d for imshow only. """ assert x is None or x != y if imshow and darray.ndim == 3: return _infer_xy_labels_3d(darray, x, y, rgb) ...
[ "def", "_infer_xy_labels", "(", "darray", ",", "x", ",", "y", ",", "imshow", "=", "False", ",", "rgb", "=", "None", ")", ":", "assert", "x", "is", "None", "or", "x", "!=", "y", "if", "imshow", "and", "darray", ".", "ndim", "==", "3", ":", "return...
Determine x and y labels. For use in _plot2d darray must be a 2 dimensional data array, or 3d for imshow only.
[ "Determine", "x", "and", "y", "labels", ".", "For", "use", "in", "_plot2d" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/utils.py#L326-L350
train
Infer x and y labels for a 2D data array.
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...
pydata/xarray
xarray/plot/utils.py
label_from_attrs
def label_from_attrs(da, extra=''): ''' Makes informative labels if variable metadata (attrs) follows CF conventions. ''' if da.attrs.get('long_name'): name = da.attrs['long_name'] elif da.attrs.get('standard_name'): name = da.attrs['standard_name'] elif da.name is not None: ...
python
def label_from_attrs(da, extra=''): ''' Makes informative labels if variable metadata (attrs) follows CF conventions. ''' if da.attrs.get('long_name'): name = da.attrs['long_name'] elif da.attrs.get('standard_name'): name = da.attrs['standard_name'] elif da.name is not None: ...
[ "def", "label_from_attrs", "(", "da", ",", "extra", "=", "''", ")", ":", "if", "da", ".", "attrs", ".", "get", "(", "'long_name'", ")", ":", "name", "=", "da", ".", "attrs", "[", "'long_name'", "]", "elif", "da", ".", "attrs", ".", "get", "(", "'...
Makes informative labels if variable metadata (attrs) follows CF conventions.
[ "Makes", "informative", "labels", "if", "variable", "metadata", "(", "attrs", ")", "follows", "CF", "conventions", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/utils.py#L382-L400
train
Makes informative labels if variable metadata ( attrs ) follows CF conventions.
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...
pydata/xarray
xarray/plot/utils.py
_interval_to_bound_points
def _interval_to_bound_points(array): """ Helper function which returns an array with the Intervals' boundaries. """ array_boundaries = np.array([x.left for x in array]) array_boundaries = np.concatenate( (array_boundaries, np.array([array[-1].right]))) return array_boundaries
python
def _interval_to_bound_points(array): """ Helper function which returns an array with the Intervals' boundaries. """ array_boundaries = np.array([x.left for x in array]) array_boundaries = np.concatenate( (array_boundaries, np.array([array[-1].right]))) return array_boundaries
[ "def", "_interval_to_bound_points", "(", "array", ")", ":", "array_boundaries", "=", "np", ".", "array", "(", "[", "x", ".", "left", "for", "x", "in", "array", "]", ")", "array_boundaries", "=", "np", ".", "concatenate", "(", "(", "array_boundaries", ",", ...
Helper function which returns an array with the Intervals' boundaries.
[ "Helper", "function", "which", "returns", "an", "array", "with", "the", "Intervals", "boundaries", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/utils.py#L412-L422
train
Helper function which returns an array containing the Intervals boundaries.
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...
pydata/xarray
xarray/plot/utils.py
_interval_to_double_bound_points
def _interval_to_double_bound_points(xarray, yarray): """ Helper function to deal with a xarray consisting of pd.Intervals. Each interval is replaced with both boundaries. I.e. the length of xarray doubles. yarray is modified so it matches the new shape of xarray. """ xarray1 = np.array([x.left...
python
def _interval_to_double_bound_points(xarray, yarray): """ Helper function to deal with a xarray consisting of pd.Intervals. Each interval is replaced with both boundaries. I.e. the length of xarray doubles. yarray is modified so it matches the new shape of xarray. """ xarray1 = np.array([x.left...
[ "def", "_interval_to_double_bound_points", "(", "xarray", ",", "yarray", ")", ":", "xarray1", "=", "np", ".", "array", "(", "[", "x", ".", "left", "for", "x", "in", "xarray", "]", ")", "xarray2", "=", "np", ".", "array", "(", "[", "x", ".", "right", ...
Helper function to deal with a xarray consisting of pd.Intervals. Each interval is replaced with both boundaries. I.e. the length of xarray doubles. yarray is modified so it matches the new shape of xarray.
[ "Helper", "function", "to", "deal", "with", "a", "xarray", "consisting", "of", "pd", ".", "Intervals", ".", "Each", "interval", "is", "replaced", "with", "both", "boundaries", ".", "I", ".", "e", ".", "the", "length", "of", "xarray", "doubles", ".", "yar...
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/utils.py#L425-L438
train
Helper function to deal with a xarray consisting of pd. Intervals and yarray consisting of pd. Intervals.
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...
pydata/xarray
xarray/plot/utils.py
_resolve_intervals_2dplot
def _resolve_intervals_2dplot(val, func_name): """ Helper function to replace the values of a coordinate array containing pd.Interval with their mid-points or - for pcolormesh - boundaries which increases length by 1. """ label_extra = '' if _valid_other_type(val, [pd.Interval]): if ...
python
def _resolve_intervals_2dplot(val, func_name): """ Helper function to replace the values of a coordinate array containing pd.Interval with their mid-points or - for pcolormesh - boundaries which increases length by 1. """ label_extra = '' if _valid_other_type(val, [pd.Interval]): if ...
[ "def", "_resolve_intervals_2dplot", "(", "val", ",", "func_name", ")", ":", "label_extra", "=", "''", "if", "_valid_other_type", "(", "val", ",", "[", "pd", ".", "Interval", "]", ")", ":", "if", "func_name", "==", "'pcolormesh'", ":", "val", "=", "_interva...
Helper function to replace the values of a coordinate array containing pd.Interval with their mid-points or - for pcolormesh - boundaries which increases length by 1.
[ "Helper", "function", "to", "replace", "the", "values", "of", "a", "coordinate", "array", "containing", "pd", ".", "Interval", "with", "their", "mid", "-", "points", "or", "-", "for", "pcolormesh", "-", "boundaries", "which", "increases", "length", "by", "1"...
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/utils.py#L441-L455
train
Helper function to resolve the values of a coordinate array containing pd. Interval with their mid - points.
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...
pydata/xarray
xarray/plot/utils.py
_valid_other_type
def _valid_other_type(x, types): """ Do all elements of x have a type from types? """ return all(any(isinstance(el, t) for t in types) for el in np.ravel(x))
python
def _valid_other_type(x, types): """ Do all elements of x have a type from types? """ return all(any(isinstance(el, t) for t in types) for el in np.ravel(x))
[ "def", "_valid_other_type", "(", "x", ",", "types", ")", ":", "return", "all", "(", "any", "(", "isinstance", "(", "el", ",", "t", ")", "for", "t", "in", "types", ")", "for", "el", "in", "np", ".", "ravel", "(", "x", ")", ")" ]
Do all elements of x have a type from types?
[ "Do", "all", "elements", "of", "x", "have", "a", "type", "from", "types?" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/utils.py#L458-L462
train
Check if x has a type from types?
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...
pydata/xarray
xarray/plot/utils.py
_valid_numpy_subdtype
def _valid_numpy_subdtype(x, numpy_types): """ Is any dtype from numpy_types superior to the dtype of x? """ # If any of the types given in numpy_types is understood as numpy.generic, # all possible x will be considered valid. This is probably unwanted. for t in numpy_types: assert not ...
python
def _valid_numpy_subdtype(x, numpy_types): """ Is any dtype from numpy_types superior to the dtype of x? """ # If any of the types given in numpy_types is understood as numpy.generic, # all possible x will be considered valid. This is probably unwanted. for t in numpy_types: assert not ...
[ "def", "_valid_numpy_subdtype", "(", "x", ",", "numpy_types", ")", ":", "# If any of the types given in numpy_types is understood as numpy.generic,", "# all possible x will be considered valid. This is probably unwanted.", "for", "t", "in", "numpy_types", ":", "assert", "not", "np...
Is any dtype from numpy_types superior to the dtype of x?
[ "Is", "any", "dtype", "from", "numpy_types", "superior", "to", "the", "dtype", "of", "x?" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/utils.py#L465-L474
train
Check if x is a subdtype of numpy_types.
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...
pydata/xarray
xarray/plot/utils.py
_ensure_plottable
def _ensure_plottable(*args): """ Raise exception if there is anything in args that can't be plotted on an axis by matplotlib. """ numpy_types = [np.floating, np.integer, np.timedelta64, np.datetime64] other_types = [datetime] try: import cftime cftime_datetime = [cftime.date...
python
def _ensure_plottable(*args): """ Raise exception if there is anything in args that can't be plotted on an axis by matplotlib. """ numpy_types = [np.floating, np.integer, np.timedelta64, np.datetime64] other_types = [datetime] try: import cftime cftime_datetime = [cftime.date...
[ "def", "_ensure_plottable", "(", "*", "args", ")", ":", "numpy_types", "=", "[", "np", ".", "floating", ",", "np", ".", "integer", ",", "np", ".", "timedelta64", ",", "np", ".", "datetime64", "]", "other_types", "=", "[", "datetime", "]", "try", ":", ...
Raise exception if there is anything in args that can't be plotted on an axis by matplotlib.
[ "Raise", "exception", "if", "there", "is", "anything", "in", "args", "that", "can", "t", "be", "plotted", "on", "an", "axis", "by", "matplotlib", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/utils.py#L477-L503
train
Raise exception if any of the arguments are not plottable.
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...
pydata/xarray
xarray/plot/utils.py
_update_axes
def _update_axes(ax, xincrease, yincrease, xscale=None, yscale=None, xticks=None, yticks=None, xlim=None, ylim=None): """ Update axes with provided parameters """ if xincrease is None: pass elif xincrease and ax.xaxis_inverted(): ax....
python
def _update_axes(ax, xincrease, yincrease, xscale=None, yscale=None, xticks=None, yticks=None, xlim=None, ylim=None): """ Update axes with provided parameters """ if xincrease is None: pass elif xincrease and ax.xaxis_inverted(): ax....
[ "def", "_update_axes", "(", "ax", ",", "xincrease", ",", "yincrease", ",", "xscale", "=", "None", ",", "yscale", "=", "None", ",", "xticks", "=", "None", ",", "yticks", "=", "None", ",", "xlim", "=", "None", ",", "ylim", "=", "None", ")", ":", "if"...
Update axes with provided parameters
[ "Update", "axes", "with", "provided", "parameters" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/utils.py#L562-L601
train
Update axes with provided parameters.
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...
pydata/xarray
xarray/plot/utils.py
_is_monotonic
def _is_monotonic(coord, axis=0): """ >>> _is_monotonic(np.array([0, 1, 2])) True >>> _is_monotonic(np.array([2, 1, 0])) True >>> _is_monotonic(np.array([0, 2, 1])) False """ if coord.shape[axis] < 3: return True else: n = coord.shape[axis] delta_pos = (co...
python
def _is_monotonic(coord, axis=0): """ >>> _is_monotonic(np.array([0, 1, 2])) True >>> _is_monotonic(np.array([2, 1, 0])) True >>> _is_monotonic(np.array([0, 2, 1])) False """ if coord.shape[axis] < 3: return True else: n = coord.shape[axis] delta_pos = (co...
[ "def", "_is_monotonic", "(", "coord", ",", "axis", "=", "0", ")", ":", "if", "coord", ".", "shape", "[", "axis", "]", "<", "3", ":", "return", "True", "else", ":", "n", "=", "coord", ".", "shape", "[", "axis", "]", "delta_pos", "=", "(", "coord",...
>>> _is_monotonic(np.array([0, 1, 2])) True >>> _is_monotonic(np.array([2, 1, 0])) True >>> _is_monotonic(np.array([0, 2, 1])) False
[ ">>>", "_is_monotonic", "(", "np", ".", "array", "(", "[", "0", "1", "2", "]", "))", "True", ">>>", "_is_monotonic", "(", "np", ".", "array", "(", "[", "2", "1", "0", "]", "))", "True", ">>>", "_is_monotonic", "(", "np", ".", "array", "(", "[", ...
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/utils.py#L604-L621
train
Return True if the given array is monotonic.
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...
pydata/xarray
xarray/plot/utils.py
_infer_interval_breaks
def _infer_interval_breaks(coord, axis=0, check_monotonic=False): """ >>> _infer_interval_breaks(np.arange(5)) array([-0.5, 0.5, 1.5, 2.5, 3.5, 4.5]) >>> _infer_interval_breaks([[0, 1], [3, 4]], axis=1) array([[-0.5, 0.5, 1.5], [ 2.5, 3.5, 4.5]]) """ coord = np.asarray(co...
python
def _infer_interval_breaks(coord, axis=0, check_monotonic=False): """ >>> _infer_interval_breaks(np.arange(5)) array([-0.5, 0.5, 1.5, 2.5, 3.5, 4.5]) >>> _infer_interval_breaks([[0, 1], [3, 4]], axis=1) array([[-0.5, 0.5, 1.5], [ 2.5, 3.5, 4.5]]) """ coord = np.asarray(co...
[ "def", "_infer_interval_breaks", "(", "coord", ",", "axis", "=", "0", ",", "check_monotonic", "=", "False", ")", ":", "coord", "=", "np", ".", "asarray", "(", "coord", ")", "if", "check_monotonic", "and", "not", "_is_monotonic", "(", "coord", ",", "axis", ...
>>> _infer_interval_breaks(np.arange(5)) array([-0.5, 0.5, 1.5, 2.5, 3.5, 4.5]) >>> _infer_interval_breaks([[0, 1], [3, 4]], axis=1) array([[-0.5, 0.5, 1.5], [ 2.5, 3.5, 4.5]])
[ ">>>", "_infer_interval_breaks", "(", "np", ".", "arange", "(", "5", "))", "array", "(", "[", "-", "0", ".", "5", "0", ".", "5", "1", ".", "5", "2", ".", "5", "3", ".", "5", "4", ".", "5", "]", ")", ">>>", "_infer_interval_breaks", "(", "[[", ...
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/utils.py#L624-L649
train
Infer the interval breaks of a given coordinate.
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...
pydata/xarray
xarray/plot/utils.py
_process_cmap_cbar_kwargs
def _process_cmap_cbar_kwargs(func, kwargs, data): """ Parameters ========== func : plotting function kwargs : dict, Dictionary with arguments that need to be parsed data : ndarray, Data values Returns ======= cmap_params cbar_kwargs """ cmap = kwargs.p...
python
def _process_cmap_cbar_kwargs(func, kwargs, data): """ Parameters ========== func : plotting function kwargs : dict, Dictionary with arguments that need to be parsed data : ndarray, Data values Returns ======= cmap_params cbar_kwargs """ cmap = kwargs.p...
[ "def", "_process_cmap_cbar_kwargs", "(", "func", ",", "kwargs", ",", "data", ")", ":", "cmap", "=", "kwargs", ".", "pop", "(", "'cmap'", ",", "None", ")", "colors", "=", "kwargs", ".", "pop", "(", "'colors'", ",", "None", ")", "cbar_kwargs", "=", "kwar...
Parameters ========== func : plotting function kwargs : dict, Dictionary with arguments that need to be parsed data : ndarray, Data values Returns ======= cmap_params cbar_kwargs
[ "Parameters", "==========", "func", ":", "plotting", "function", "kwargs", ":", "dict", "Dictionary", "with", "arguments", "that", "need", "to", "be", "parsed", "data", ":", "ndarray", "Data", "values" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/utils.py#L652-L704
train
Process kwargs that need to be parsed from kwargs and return cmap_params cbar_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...
pydata/xarray
xarray/plot/plot.py
plot
def plot(darray, row=None, col=None, col_wrap=None, ax=None, hue=None, rtol=0.01, subplot_kws=None, **kwargs): """ Default plot of DataArray using matplotlib.pyplot. Calls xarray plotting function based on the dimensions of darray.squeeze() =============== =========================== ...
python
def plot(darray, row=None, col=None, col_wrap=None, ax=None, hue=None, rtol=0.01, subplot_kws=None, **kwargs): """ Default plot of DataArray using matplotlib.pyplot. Calls xarray plotting function based on the dimensions of darray.squeeze() =============== =========================== ...
[ "def", "plot", "(", "darray", ",", "row", "=", "None", ",", "col", "=", "None", ",", "col_wrap", "=", "None", ",", "ax", "=", "None", ",", "hue", "=", "None", ",", "rtol", "=", "0.01", ",", "subplot_kws", "=", "None", ",", "*", "*", "kwargs", "...
Default plot of DataArray using matplotlib.pyplot. Calls xarray plotting function based on the dimensions of darray.squeeze() =============== =========================== Dimensions Plotting function --------------- --------------------------- 1 :py:func:`xarray.plot.line` ...
[ "Default", "plot", "of", "DataArray", "using", "matplotlib", ".", "pyplot", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/plot.py#L99-L172
train
Plot a DataArray using matplotlib. pyplot.
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...
pydata/xarray
xarray/plot/plot.py
line
def line(darray, *args, **kwargs): """ Line plot of DataArray index against values Wraps :func:`matplotlib:matplotlib.pyplot.plot` Parameters ---------- darray : DataArray Must be 1 dimensional figsize : tuple, optional A tuple (width, height) of the figure in inches. ...
python
def line(darray, *args, **kwargs): """ Line plot of DataArray index against values Wraps :func:`matplotlib:matplotlib.pyplot.plot` Parameters ---------- darray : DataArray Must be 1 dimensional figsize : tuple, optional A tuple (width, height) of the figure in inches. ...
[ "def", "line", "(", "darray", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# Handle facetgrids first", "row", "=", "kwargs", ".", "pop", "(", "'row'", ",", "None", ")", "col", "=", "kwargs", ".", "pop", "(", "'col'", ",", "None", ")", "if"...
Line plot of DataArray index against values Wraps :func:`matplotlib:matplotlib.pyplot.plot` Parameters ---------- darray : DataArray Must be 1 dimensional figsize : tuple, optional A tuple (width, height) of the figure in inches. Mutually exclusive with ``size`` and ``ax``....
[ "Line", "plot", "of", "DataArray", "index", "against", "values" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/plot.py#L177-L315
train
Function to plot a single line of the given DataArray index against values
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...
pydata/xarray
xarray/plot/plot.py
step
def step(darray, *args, **kwargs): """ Step plot of DataArray index against values Similar to :func:`matplotlib:matplotlib.pyplot.step` Parameters ---------- where : {'pre', 'post', 'mid'}, optional, default 'pre' Define where the steps should be placed: - 'pre': The y value is...
python
def step(darray, *args, **kwargs): """ Step plot of DataArray index against values Similar to :func:`matplotlib:matplotlib.pyplot.step` Parameters ---------- where : {'pre', 'post', 'mid'}, optional, default 'pre' Define where the steps should be placed: - 'pre': The y value is...
[ "def", "step", "(", "darray", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "(", "'ls'", "in", "kwargs", ".", "keys", "(", ")", ")", "and", "(", "'linestyle'", "not", "in", "kwargs", ".", "keys", "(", ")", ")", ":", "kwargs", "[", ...
Step plot of DataArray index against values Similar to :func:`matplotlib:matplotlib.pyplot.step` Parameters ---------- where : {'pre', 'post', 'mid'}, optional, default 'pre' Define where the steps should be placed: - 'pre': The y value is continued constantly to the left from ...
[ "Step", "plot", "of", "DataArray", "index", "against", "values" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/plot.py#L318-L355
train
This function is a convenience function for plotting a single step plot of DataArray index against values Formula
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...
pydata/xarray
xarray/plot/plot.py
hist
def hist(darray, figsize=None, size=None, aspect=None, ax=None, **kwargs): """ Histogram of DataArray Wraps :func:`matplotlib:matplotlib.pyplot.hist` Plots N dimensional arrays by first flattening the array. Parameters ---------- darray : DataArray Can be any dimension figsize...
python
def hist(darray, figsize=None, size=None, aspect=None, ax=None, **kwargs): """ Histogram of DataArray Wraps :func:`matplotlib:matplotlib.pyplot.hist` Plots N dimensional arrays by first flattening the array. Parameters ---------- darray : DataArray Can be any dimension figsize...
[ "def", "hist", "(", "darray", ",", "figsize", "=", "None", ",", "size", "=", "None", ",", "aspect", "=", "None", ",", "ax", "=", "None", ",", "*", "*", "kwargs", ")", ":", "ax", "=", "get_axis", "(", "figsize", ",", "size", ",", "aspect", ",", ...
Histogram of DataArray Wraps :func:`matplotlib:matplotlib.pyplot.hist` Plots N dimensional arrays by first flattening the array. Parameters ---------- darray : DataArray Can be any dimension figsize : tuple, optional A tuple (width, height) of the figure in inches. Mut...
[ "Histogram", "of", "DataArray" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/plot.py#L358-L408
train
Plots a histogram of the given DataArray.
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...
pydata/xarray
xarray/plot/plot.py
_plot2d
def _plot2d(plotfunc): """ Decorator for common 2d plotting logic Also adds the 2d plot method to class _PlotMethods """ commondoc = """ Parameters ---------- darray : DataArray Must be 2 dimensional, unless creating faceted plots x : string, optional Coordinate for ...
python
def _plot2d(plotfunc): """ Decorator for common 2d plotting logic Also adds the 2d plot method to class _PlotMethods """ commondoc = """ Parameters ---------- darray : DataArray Must be 2 dimensional, unless creating faceted plots x : string, optional Coordinate for ...
[ "def", "_plot2d", "(", "plotfunc", ")", ":", "commondoc", "=", "\"\"\"\n Parameters\n ----------\n darray : DataArray\n Must be 2 dimensional, unless creating faceted plots\n x : string, optional\n Coordinate for x axis. If None use darray.dims[1]\n y : string, optional\...
Decorator for common 2d plotting logic Also adds the 2d plot method to class _PlotMethods
[ "Decorator", "for", "common", "2d", "plotting", "logic" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/plot.py#L438-L722
train
Decorator for common 2d plotting logic
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...
pydata/xarray
xarray/plot/plot.py
imshow
def imshow(x, y, z, ax, **kwargs): """ Image plot of 2d DataArray using matplotlib.pyplot Wraps :func:`matplotlib:matplotlib.pyplot.imshow` While other plot methods require the DataArray to be strictly two-dimensional, ``imshow`` also accepts a 3D array where some dimension can be interpreted ...
python
def imshow(x, y, z, ax, **kwargs): """ Image plot of 2d DataArray using matplotlib.pyplot Wraps :func:`matplotlib:matplotlib.pyplot.imshow` While other plot methods require the DataArray to be strictly two-dimensional, ``imshow`` also accepts a 3D array where some dimension can be interpreted ...
[ "def", "imshow", "(", "x", ",", "y", ",", "z", ",", "ax", ",", "*", "*", "kwargs", ")", ":", "if", "x", ".", "ndim", "!=", "1", "or", "y", ".", "ndim", "!=", "1", ":", "raise", "ValueError", "(", "'imshow requires 1D coordinates, try using '", "'pcol...
Image plot of 2d DataArray using matplotlib.pyplot Wraps :func:`matplotlib:matplotlib.pyplot.imshow` While other plot methods require the DataArray to be strictly two-dimensional, ``imshow`` also accepts a 3D array where some dimension can be interpreted as RGB or RGBA color channels and allows th...
[ "Image", "plot", "of", "2d", "DataArray", "using", "matplotlib", ".", "pyplot" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/plot.py#L726-L797
train
Plot a 2D array of pixels on a matplotlib axes.
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...
pydata/xarray
xarray/plot/plot.py
contour
def contour(x, y, z, ax, **kwargs): """ Contour plot of 2d DataArray Wraps :func:`matplotlib:matplotlib.pyplot.contour` """ primitive = ax.contour(x, y, z, **kwargs) return primitive
python
def contour(x, y, z, ax, **kwargs): """ Contour plot of 2d DataArray Wraps :func:`matplotlib:matplotlib.pyplot.contour` """ primitive = ax.contour(x, y, z, **kwargs) return primitive
[ "def", "contour", "(", "x", ",", "y", ",", "z", ",", "ax", ",", "*", "*", "kwargs", ")", ":", "primitive", "=", "ax", ".", "contour", "(", "x", ",", "y", ",", "z", ",", "*", "*", "kwargs", ")", "return", "primitive" ]
Contour plot of 2d DataArray Wraps :func:`matplotlib:matplotlib.pyplot.contour`
[ "Contour", "plot", "of", "2d", "DataArray" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/plot.py#L801-L808
train
Contour plot of 2d DataArray
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...
pydata/xarray
xarray/plot/plot.py
contourf
def contourf(x, y, z, ax, **kwargs): """ Filled contour plot of 2d DataArray Wraps :func:`matplotlib:matplotlib.pyplot.contourf` """ primitive = ax.contourf(x, y, z, **kwargs) return primitive
python
def contourf(x, y, z, ax, **kwargs): """ Filled contour plot of 2d DataArray Wraps :func:`matplotlib:matplotlib.pyplot.contourf` """ primitive = ax.contourf(x, y, z, **kwargs) return primitive
[ "def", "contourf", "(", "x", ",", "y", ",", "z", ",", "ax", ",", "*", "*", "kwargs", ")", ":", "primitive", "=", "ax", ".", "contourf", "(", "x", ",", "y", ",", "z", ",", "*", "*", "kwargs", ")", "return", "primitive" ]
Filled contour plot of 2d DataArray Wraps :func:`matplotlib:matplotlib.pyplot.contourf`
[ "Filled", "contour", "plot", "of", "2d", "DataArray" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/plot.py#L812-L819
train
Wrapper around matplotlib. pyplot. contourf
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...
pydata/xarray
xarray/plot/plot.py
pcolormesh
def pcolormesh(x, y, z, ax, infer_intervals=None, **kwargs): """ Pseudocolor plot of 2d DataArray Wraps :func:`matplotlib:matplotlib.pyplot.pcolormesh` """ # decide on a default for infer_intervals (GH781) x = np.asarray(x) if infer_intervals is None: if hasattr(ax, 'projection'): ...
python
def pcolormesh(x, y, z, ax, infer_intervals=None, **kwargs): """ Pseudocolor plot of 2d DataArray Wraps :func:`matplotlib:matplotlib.pyplot.pcolormesh` """ # decide on a default for infer_intervals (GH781) x = np.asarray(x) if infer_intervals is None: if hasattr(ax, 'projection'): ...
[ "def", "pcolormesh", "(", "x", ",", "y", ",", "z", ",", "ax", ",", "infer_intervals", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# decide on a default for infer_intervals (GH781)", "x", "=", "np", ".", "asarray", "(", "x", ")", "if", "infer_intervals...
Pseudocolor plot of 2d DataArray Wraps :func:`matplotlib:matplotlib.pyplot.pcolormesh`
[ "Pseudocolor", "plot", "of", "2d", "DataArray" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/plot.py#L823-L869
train
A wrapper around matplotlib. pyplot. pcolormesh that takes a 2d array x y z and returns a 2d array x y z.
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...
pydata/xarray
xarray/backends/locks.py
_get_scheduler
def _get_scheduler(get=None, collection=None): """Determine the dask scheduler that is being used. None is returned if no dask scheduler is active. See also -------- dask.base.get_scheduler """ try: # dask 0.18.1 and later from dask.base import get_scheduler actual_...
python
def _get_scheduler(get=None, collection=None): """Determine the dask scheduler that is being used. None is returned if no dask scheduler is active. See also -------- dask.base.get_scheduler """ try: # dask 0.18.1 and later from dask.base import get_scheduler actual_...
[ "def", "_get_scheduler", "(", "get", "=", "None", ",", "collection", "=", "None", ")", ":", "try", ":", "# dask 0.18.1 and later", "from", "dask", ".", "base", "import", "get_scheduler", "actual_get", "=", "get_scheduler", "(", "get", ",", "collection", ")", ...
Determine the dask scheduler that is being used. None is returned if no dask scheduler is active. See also -------- dask.base.get_scheduler
[ "Determine", "the", "dask", "scheduler", "that", "is", "being", "used", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/backends/locks.py#L65-L97
train
Determine the dask scheduler that is being used.
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...
pydata/xarray
xarray/backends/locks.py
acquire
def acquire(lock, blocking=True): """Acquire a lock, possibly in a non-blocking fashion. Includes backwards compatibility hacks for old versions of Python, dask and dask-distributed. """ if blocking: # no arguments needed return lock.acquire() elif DistributedLock is not None an...
python
def acquire(lock, blocking=True): """Acquire a lock, possibly in a non-blocking fashion. Includes backwards compatibility hacks for old versions of Python, dask and dask-distributed. """ if blocking: # no arguments needed return lock.acquire() elif DistributedLock is not None an...
[ "def", "acquire", "(", "lock", ",", "blocking", "=", "True", ")", ":", "if", "blocking", ":", "# no arguments needed", "return", "lock", ".", "acquire", "(", ")", "elif", "DistributedLock", "is", "not", "None", "and", "isinstance", "(", "lock", ",", "Distr...
Acquire a lock, possibly in a non-blocking fashion. Includes backwards compatibility hacks for old versions of Python, dask and dask-distributed.
[ "Acquire", "a", "lock", "possibly", "in", "a", "non", "-", "blocking", "fashion", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/backends/locks.py#L117-L135
train
Acquire a lock possibly in a non - blocking fashion.
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...
pydata/xarray
xarray/backends/locks.py
combine_locks
def combine_locks(locks): """Combine a sequence of locks into a single lock.""" all_locks = [] for lock in locks: if isinstance(lock, CombinedLock): all_locks.extend(lock.locks) elif lock is not None: all_locks.append(lock) num_locks = len(all_locks) if num_l...
python
def combine_locks(locks): """Combine a sequence of locks into a single lock.""" all_locks = [] for lock in locks: if isinstance(lock, CombinedLock): all_locks.extend(lock.locks) elif lock is not None: all_locks.append(lock) num_locks = len(all_locks) if num_l...
[ "def", "combine_locks", "(", "locks", ")", ":", "all_locks", "=", "[", "]", "for", "lock", "in", "locks", ":", "if", "isinstance", "(", "lock", ",", "CombinedLock", ")", ":", "all_locks", ".", "extend", "(", "lock", ".", "locks", ")", "elif", "lock", ...
Combine a sequence of locks into a single lock.
[ "Combine", "a", "sequence", "of", "locks", "into", "a", "single", "lock", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/backends/locks.py#L189-L204
train
Combine a sequence of locks into a single lock.
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...
pydata/xarray
xarray/core/common.py
get_squeeze_dims
def get_squeeze_dims(xarray_obj, dim: Union[Hashable, Iterable[Hashable], None] = None, axis: Union[int, Iterable[int], None] = None ) -> List[Hashable]: """Get a list of dimensions to squeeze out. """ if dim is not None and axis is not None: ...
python
def get_squeeze_dims(xarray_obj, dim: Union[Hashable, Iterable[Hashable], None] = None, axis: Union[int, Iterable[int], None] = None ) -> List[Hashable]: """Get a list of dimensions to squeeze out. """ if dim is not None and axis is not None: ...
[ "def", "get_squeeze_dims", "(", "xarray_obj", ",", "dim", ":", "Union", "[", "Hashable", ",", "Iterable", "[", "Hashable", "]", ",", "None", "]", "=", "None", ",", "axis", ":", "Union", "[", "int", ",", "Iterable", "[", "int", "]", ",", "None", "]", ...
Get a list of dimensions to squeeze out.
[ "Get", "a", "list", "of", "dimensions", "to", "squeeze", "out", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/common.py#L217-L246
train
Get a list of dimensions to squeeze out.
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...
pydata/xarray
xarray/core/common.py
full_like
def full_like(other, fill_value, dtype: Union[str, np.dtype, None] = None): """Return a new object with the same shape and type as a given object. Parameters ---------- other : DataArray, Dataset, or Variable The reference object in input fill_value : scalar Value to fill the new ob...
python
def full_like(other, fill_value, dtype: Union[str, np.dtype, None] = None): """Return a new object with the same shape and type as a given object. Parameters ---------- other : DataArray, Dataset, or Variable The reference object in input fill_value : scalar Value to fill the new ob...
[ "def", "full_like", "(", "other", ",", "fill_value", ",", "dtype", ":", "Union", "[", "str", ",", "np", ".", "dtype", ",", "None", "]", "=", "None", ")", ":", "from", ".", "dataarray", "import", "DataArray", "from", ".", "dataset", "import", "Dataset",...
Return a new object with the same shape and type as a given object. Parameters ---------- other : DataArray, Dataset, or Variable The reference object in input fill_value : scalar Value to fill the new object with before returning it. dtype : dtype, optional dtype of the new...
[ "Return", "a", "new", "object", "with", "the", "same", "shape", "and", "type", "as", "a", "given", "object", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/common.py#L942-L979
train
Return a new object with the same shape and type as a given 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...
pydata/xarray
xarray/core/common.py
_full_like_variable
def _full_like_variable(other, fill_value, dtype: Union[str, np.dtype, None] = None): """Inner function of full_like, where other must be a variable """ from .variable import Variable if isinstance(other.data, dask_array_type): import dask.array if dtype is None:...
python
def _full_like_variable(other, fill_value, dtype: Union[str, np.dtype, None] = None): """Inner function of full_like, where other must be a variable """ from .variable import Variable if isinstance(other.data, dask_array_type): import dask.array if dtype is None:...
[ "def", "_full_like_variable", "(", "other", ",", "fill_value", ",", "dtype", ":", "Union", "[", "str", ",", "np", ".", "dtype", ",", "None", "]", "=", "None", ")", ":", "from", ".", "variable", "import", "Variable", "if", "isinstance", "(", "other", "....
Inner function of full_like, where other must be a variable
[ "Inner", "function", "of", "full_like", "where", "other", "must", "be", "a", "variable" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/common.py#L982-L997
train
Inner function of full_like where other must be a variable sgi
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...
pydata/xarray
xarray/core/common.py
zeros_like
def zeros_like(other, dtype: Union[str, np.dtype, None] = None): """Shorthand for full_like(other, 0, dtype) """ return full_like(other, 0, dtype)
python
def zeros_like(other, dtype: Union[str, np.dtype, None] = None): """Shorthand for full_like(other, 0, dtype) """ return full_like(other, 0, dtype)
[ "def", "zeros_like", "(", "other", ",", "dtype", ":", "Union", "[", "str", ",", "np", ".", "dtype", ",", "None", "]", "=", "None", ")", ":", "return", "full_like", "(", "other", ",", "0", ",", "dtype", ")" ]
Shorthand for full_like(other, 0, dtype)
[ "Shorthand", "for", "full_like", "(", "other", "0", "dtype", ")" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/common.py#L1000-L1003
train
Shorthand for full_like with dtype = None.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/common.py
ones_like
def ones_like(other, dtype: Union[str, np.dtype, None] = None): """Shorthand for full_like(other, 1, dtype) """ return full_like(other, 1, dtype)
python
def ones_like(other, dtype: Union[str, np.dtype, None] = None): """Shorthand for full_like(other, 1, dtype) """ return full_like(other, 1, dtype)
[ "def", "ones_like", "(", "other", ",", "dtype", ":", "Union", "[", "str", ",", "np", ".", "dtype", ",", "None", "]", "=", "None", ")", ":", "return", "full_like", "(", "other", ",", "1", ",", "dtype", ")" ]
Shorthand for full_like(other, 1, dtype)
[ "Shorthand", "for", "full_like", "(", "other", "1", "dtype", ")" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/common.py#L1006-L1009
train
Shorthand for full_like with a 1 - dimensional dtype.
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...
pydata/xarray
xarray/core/common.py
is_np_datetime_like
def is_np_datetime_like(dtype: Union[str, np.dtype]) -> bool: """Check if a dtype is a subclass of the numpy datetime types """ return (np.issubdtype(dtype, np.datetime64) or np.issubdtype(dtype, np.timedelta64))
python
def is_np_datetime_like(dtype: Union[str, np.dtype]) -> bool: """Check if a dtype is a subclass of the numpy datetime types """ return (np.issubdtype(dtype, np.datetime64) or np.issubdtype(dtype, np.timedelta64))
[ "def", "is_np_datetime_like", "(", "dtype", ":", "Union", "[", "str", ",", "np", ".", "dtype", "]", ")", "->", "bool", ":", "return", "(", "np", ".", "issubdtype", "(", "dtype", ",", "np", ".", "datetime64", ")", "or", "np", ".", "issubdtype", "(", ...
Check if a dtype is a subclass of the numpy datetime types
[ "Check", "if", "a", "dtype", "is", "a", "subclass", "of", "the", "numpy", "datetime", "types" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/common.py#L1012-L1016
train
Check if a dtype is a subclass of the numpy datetime types
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...
pydata/xarray
xarray/core/common.py
_contains_cftime_datetimes
def _contains_cftime_datetimes(array) -> bool: """Check if an array contains cftime.datetime objects """ try: from cftime import datetime as cftime_datetime except ImportError: return False else: if array.dtype == np.dtype('O') and array.size > 0: sample = array.r...
python
def _contains_cftime_datetimes(array) -> bool: """Check if an array contains cftime.datetime objects """ try: from cftime import datetime as cftime_datetime except ImportError: return False else: if array.dtype == np.dtype('O') and array.size > 0: sample = array.r...
[ "def", "_contains_cftime_datetimes", "(", "array", ")", "->", "bool", ":", "try", ":", "from", "cftime", "import", "datetime", "as", "cftime_datetime", "except", "ImportError", ":", "return", "False", "else", ":", "if", "array", ".", "dtype", "==", "np", "."...
Check if an array contains cftime.datetime objects
[ "Check", "if", "an", "array", "contains", "cftime", ".", "datetime", "objects" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/common.py#L1019-L1035
train
Check if an array contains cftime. datetime objects Invitements
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...
pydata/xarray
xarray/core/common.py
AbstractArray.get_axis_num
def get_axis_num(self, dim: Union[Hashable, Iterable[Hashable]] ) -> Union[int, Tuple[int, ...]]: """Return axis number(s) corresponding to dimension(s) in this array. Parameters ---------- dim : str or iterable of str Dimension name(s) for which to look...
python
def get_axis_num(self, dim: Union[Hashable, Iterable[Hashable]] ) -> Union[int, Tuple[int, ...]]: """Return axis number(s) corresponding to dimension(s) in this array. Parameters ---------- dim : str or iterable of str Dimension name(s) for which to look...
[ "def", "get_axis_num", "(", "self", ",", "dim", ":", "Union", "[", "Hashable", ",", "Iterable", "[", "Hashable", "]", "]", ")", "->", "Union", "[", "int", ",", "Tuple", "[", "int", ",", "...", "]", "]", ":", "if", "isinstance", "(", "dim", ",", "...
Return axis number(s) corresponding to dimension(s) in this array. Parameters ---------- dim : str or iterable of str Dimension name(s) for which to lookup axes. Returns ------- int or tuple of int Axis number or numbers corresponding to the give...
[ "Return", "axis", "number", "(", "s", ")", "corresponding", "to", "dimension", "(", "s", ")", "in", "this", "array", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/common.py#L117-L134
train
Returns the axis number or tuple corresponding to the given dimension.
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...
pydata/xarray
xarray/core/common.py
AbstractArray.sizes
def sizes(self: Any) -> Mapping[Hashable, int]: """Ordered mapping from dimension names to lengths. Immutable. See also -------- Dataset.sizes """ return Frozen(OrderedDict(zip(self.dims, self.shape)))
python
def sizes(self: Any) -> Mapping[Hashable, int]: """Ordered mapping from dimension names to lengths. Immutable. See also -------- Dataset.sizes """ return Frozen(OrderedDict(zip(self.dims, self.shape)))
[ "def", "sizes", "(", "self", ":", "Any", ")", "->", "Mapping", "[", "Hashable", ",", "int", "]", ":", "return", "Frozen", "(", "OrderedDict", "(", "zip", "(", "self", ".", "dims", ",", "self", ".", "shape", ")", ")", ")" ]
Ordered mapping from dimension names to lengths. Immutable. See also -------- Dataset.sizes
[ "Ordered", "mapping", "from", "dimension", "names", "to", "lengths", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/common.py#L144-L153
train
Ordered mapping from dimension names to lengths.
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...
pydata/xarray
xarray/core/common.py
AttrAccessMixin._ipython_key_completions_
def _ipython_key_completions_(self) -> List[str]: """Provide method for the key-autocompletions in IPython. See http://ipython.readthedocs.io/en/stable/config/integrating.html#tab-completion For the details. """ # noqa item_lists = [item for sublist in self...
python
def _ipython_key_completions_(self) -> List[str]: """Provide method for the key-autocompletions in IPython. See http://ipython.readthedocs.io/en/stable/config/integrating.html#tab-completion For the details. """ # noqa item_lists = [item for sublist in self...
[ "def", "_ipython_key_completions_", "(", "self", ")", "->", "List", "[", "str", "]", ":", "# noqa", "item_lists", "=", "[", "item", "for", "sublist", "in", "self", ".", "_item_sources", "for", "item", "in", "sublist", "if", "isinstance", "(", "item", ",", ...
Provide method for the key-autocompletions in IPython. See http://ipython.readthedocs.io/en/stable/config/integrating.html#tab-completion For the details.
[ "Provide", "method", "for", "the", "key", "-", "autocompletions", "in", "IPython", ".", "See", "http", ":", "//", "ipython", ".", "readthedocs", ".", "io", "/", "en", "/", "stable", "/", "config", "/", "integrating", ".", "html#tab", "-", "completion", "...
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/common.py#L205-L214
train
Provide method for the key - autocompletions in IPython.
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...
pydata/xarray
xarray/core/common.py
DataWithCoords.squeeze
def squeeze(self, dim: Union[Hashable, Iterable[Hashable], None] = None, drop: bool = False, axis: Union[int, Iterable[int], None] = None): """Return a new object with squeezed data. Parameters ---------- dim : None or Hashable or iterable of Hashable, op...
python
def squeeze(self, dim: Union[Hashable, Iterable[Hashable], None] = None, drop: bool = False, axis: Union[int, Iterable[int], None] = None): """Return a new object with squeezed data. Parameters ---------- dim : None or Hashable or iterable of Hashable, op...
[ "def", "squeeze", "(", "self", ",", "dim", ":", "Union", "[", "Hashable", ",", "Iterable", "[", "Hashable", "]", ",", "None", "]", "=", "None", ",", "drop", ":", "bool", "=", "False", ",", "axis", ":", "Union", "[", "int", ",", "Iterable", "[", "...
Return a new object with squeezed data. Parameters ---------- dim : None or Hashable or iterable of Hashable, optional Selects a subset of the length one dimensions. If a dimension is selected with length greater than one, an error is raised. If None, all len...
[ "Return", "a", "new", "object", "with", "squeezed", "data", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/common.py#L252-L280
train
Return a new object with squeezed data.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/common.py
DataWithCoords.get_index
def get_index(self, key: Hashable) -> pd.Index: """Get an index for a dimension, with fall-back to a default RangeIndex """ if key not in self.dims: raise KeyError(key) try: return self.indexes[key] except KeyError: # need to ensure dtype=int6...
python
def get_index(self, key: Hashable) -> pd.Index: """Get an index for a dimension, with fall-back to a default RangeIndex """ if key not in self.dims: raise KeyError(key) try: return self.indexes[key] except KeyError: # need to ensure dtype=int6...
[ "def", "get_index", "(", "self", ",", "key", ":", "Hashable", ")", "->", "pd", ".", "Index", ":", "if", "key", "not", "in", "self", ".", "dims", ":", "raise", "KeyError", "(", "key", ")", "try", ":", "return", "self", ".", "indexes", "[", "key", ...
Get an index for a dimension, with fall-back to a default RangeIndex
[ "Get", "an", "index", "for", "a", "dimension", "with", "fall", "-", "back", "to", "a", "default", "RangeIndex" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/common.py#L282-L292
train
Get an index for a dimension with fall - back to a default RangeIndex
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...
pydata/xarray
xarray/core/common.py
DataWithCoords.assign_coords
def assign_coords(self, **kwargs): """Assign new coordinates to this object. Returns a new object with all the original data in addition to the new coordinates. Parameters ---------- kwargs : keyword, value pairs keywords are the variables names. If the valu...
python
def assign_coords(self, **kwargs): """Assign new coordinates to this object. Returns a new object with all the original data in addition to the new coordinates. Parameters ---------- kwargs : keyword, value pairs keywords are the variables names. If the valu...
[ "def", "assign_coords", "(", "self", ",", "*", "*", "kwargs", ")", ":", "data", "=", "self", ".", "copy", "(", "deep", "=", "False", ")", "results", "=", "self", ".", "_calc_assign_results", "(", "kwargs", ")", "data", ".", "coords", ".", "update", "...
Assign new coordinates to this object. Returns a new object with all the original data in addition to the new coordinates. Parameters ---------- kwargs : keyword, value pairs keywords are the variables names. If the values are callable, they are computed...
[ "Assign", "new", "coordinates", "to", "this", "object", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/common.py#L304-L359
train
Assign new coordinates to the current 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...
pydata/xarray
xarray/core/common.py
DataWithCoords.assign_attrs
def assign_attrs(self, *args, **kwargs): """Assign new attrs to this object. Returns a new object equivalent to self.attrs.update(*args, **kwargs). Parameters ---------- args : positional arguments passed into ``attrs.update``. kwargs : keyword arguments passed into ``a...
python
def assign_attrs(self, *args, **kwargs): """Assign new attrs to this object. Returns a new object equivalent to self.attrs.update(*args, **kwargs). Parameters ---------- args : positional arguments passed into ``attrs.update``. kwargs : keyword arguments passed into ``a...
[ "def", "assign_attrs", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "out", "=", "self", ".", "copy", "(", "deep", "=", "False", ")", "out", ".", "attrs", ".", "update", "(", "*", "args", ",", "*", "*", "kwargs", ")", "retur...
Assign new attrs to this object. Returns a new object equivalent to self.attrs.update(*args, **kwargs). Parameters ---------- args : positional arguments passed into ``attrs.update``. kwargs : keyword arguments passed into ``attrs.update``. Returns ------- ...
[ "Assign", "new", "attrs", "to", "this", "object", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/common.py#L361-L382
train
Assign new attrs to this 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...
pydata/xarray
xarray/core/common.py
DataWithCoords.pipe
def pipe(self, func: Union[Callable[..., T], Tuple[Callable[..., T], str]], *args, **kwargs) -> T: """ Apply func(self, *args, **kwargs) This method replicates the pandas method of the same name. Parameters ---------- func : function function to...
python
def pipe(self, func: Union[Callable[..., T], Tuple[Callable[..., T], str]], *args, **kwargs) -> T: """ Apply func(self, *args, **kwargs) This method replicates the pandas method of the same name. Parameters ---------- func : function function to...
[ "def", "pipe", "(", "self", ",", "func", ":", "Union", "[", "Callable", "[", "...", ",", "T", "]", ",", "Tuple", "[", "Callable", "[", "...", ",", "T", "]", ",", "str", "]", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")", "->", "T", ":...
Apply func(self, *args, **kwargs) This method replicates the pandas method of the same name. Parameters ---------- func : function function to apply to this xarray object (Dataset/DataArray). ``args``, and ``kwargs`` are passed into ``func``. Alterna...
[ "Apply", "func", "(", "self", "*", "args", "**", "kwargs", ")" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/common.py#L384-L442
train
This method applies a function to this xarray object and returns the result of the function.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/common.py
DataWithCoords.groupby
def groupby(self, group, squeeze: bool = True): """Returns a GroupBy object for performing grouped operations. Parameters ---------- group : str, DataArray or IndexVariable Array whose unique values should be used to group this array. If a string, must be the nam...
python
def groupby(self, group, squeeze: bool = True): """Returns a GroupBy object for performing grouped operations. Parameters ---------- group : str, DataArray or IndexVariable Array whose unique values should be used to group this array. If a string, must be the nam...
[ "def", "groupby", "(", "self", ",", "group", ",", "squeeze", ":", "bool", "=", "True", ")", ":", "# noqa", "return", "self", ".", "_groupby_cls", "(", "self", ",", "group", ",", "squeeze", "=", "squeeze", ")" ]
Returns a GroupBy object for performing grouped operations. Parameters ---------- group : str, DataArray or IndexVariable Array whose unique values should be used to group this array. If a string, must be the name of a variable contained in this dataset. squeeze ...
[ "Returns", "a", "GroupBy", "object", "for", "performing", "grouped", "operations", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/common.py#L444-L488
train
Returns a GroupBy object for performing grouped operations on the a array.
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...
pydata/xarray
xarray/core/common.py
DataWithCoords.groupby_bins
def groupby_bins(self, group, bins, right: bool = True, labels=None, precision: int = 3, include_lowest: bool = False, squeeze: bool = True): """Returns a GroupBy object for performing grouped operations. Rather than using all unique values of `group`, the valu...
python
def groupby_bins(self, group, bins, right: bool = True, labels=None, precision: int = 3, include_lowest: bool = False, squeeze: bool = True): """Returns a GroupBy object for performing grouped operations. Rather than using all unique values of `group`, the valu...
[ "def", "groupby_bins", "(", "self", ",", "group", ",", "bins", ",", "right", ":", "bool", "=", "True", ",", "labels", "=", "None", ",", "precision", ":", "int", "=", "3", ",", "include_lowest", ":", "bool", "=", "False", ",", "squeeze", ":", "bool", ...
Returns a GroupBy object for performing grouped operations. Rather than using all unique values of `group`, the values are discretized first by applying `pandas.cut` [1]_ to `group`. Parameters ---------- group : str, DataArray or IndexVariable Array whose binned va...
[ "Returns", "a", "GroupBy", "object", "for", "performing", "grouped", "operations", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/common.py#L490-L541
train
Returns a GroupBy object for performing grouped operations on the avec of unique values of the avec of the avec of the avec of the avec of the avec of the avec of the avec of the avec of the avec of the avec of the avec of the avec of the avec of the avec of the avec of the avec of the avec of the avec of the avec of t...
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...
pydata/xarray
xarray/core/common.py
DataWithCoords.rolling
def rolling(self, dim: Optional[Mapping[Hashable, int]] = None, min_periods: Optional[int] = None, center: bool = False, **dim_kwargs: int): """ Rolling window object. Parameters ---------- dim: dict, optional Mapping from the dimensio...
python
def rolling(self, dim: Optional[Mapping[Hashable, int]] = None, min_periods: Optional[int] = None, center: bool = False, **dim_kwargs: int): """ Rolling window object. Parameters ---------- dim: dict, optional Mapping from the dimensio...
[ "def", "rolling", "(", "self", ",", "dim", ":", "Optional", "[", "Mapping", "[", "Hashable", ",", "int", "]", "]", "=", "None", ",", "min_periods", ":", "Optional", "[", "int", "]", "=", "None", ",", "center", ":", "bool", "=", "False", ",", "*", ...
Rolling window object. Parameters ---------- dim: dict, optional Mapping from the dimension name to create the rolling iterator along (e.g. `time`) to its moving window size. min_periods : int, default None Minimum number of observations in window req...
[ "Rolling", "window", "object", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/common.py#L543-L603
train
Create a rolling window object for the given date and time.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/common.py
DataWithCoords.coarsen
def coarsen(self, dim: Optional[Mapping[Hashable, int]] = None, boundary: str = 'exact', side: Union[str, Mapping[Hashable, str]] = 'left', coord_func: str = 'mean', **dim_kwargs: int): """ Coarsen object. Parameters ------...
python
def coarsen(self, dim: Optional[Mapping[Hashable, int]] = None, boundary: str = 'exact', side: Union[str, Mapping[Hashable, str]] = 'left', coord_func: str = 'mean', **dim_kwargs: int): """ Coarsen object. Parameters ------...
[ "def", "coarsen", "(", "self", ",", "dim", ":", "Optional", "[", "Mapping", "[", "Hashable", ",", "int", "]", "]", "=", "None", ",", "boundary", ":", "str", "=", "'exact'", ",", "side", ":", "Union", "[", "str", ",", "Mapping", "[", "Hashable", ","...
Coarsen object. Parameters ---------- dim: dict, optional Mapping from the dimension name to the window size. dim : str Name of the dimension to create the rolling iterator along (e.g., `time`). window : int Siz...
[ "Coarsen", "object", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/common.py#L605-L666
train
Returns a new object that coarsen the long time series.
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...
pydata/xarray
xarray/core/common.py
DataWithCoords.resample
def resample(self, indexer: Optional[Mapping[Hashable, str]] = None, skipna=None, closed: Optional[str] = None, label: Optional[str] = None, base: int = 0, keep_attrs: Optional[bool] = None, loffset=None, **indexer_kwargs: str): ...
python
def resample(self, indexer: Optional[Mapping[Hashable, str]] = None, skipna=None, closed: Optional[str] = None, label: Optional[str] = None, base: int = 0, keep_attrs: Optional[bool] = None, loffset=None, **indexer_kwargs: str): ...
[ "def", "resample", "(", "self", ",", "indexer", ":", "Optional", "[", "Mapping", "[", "Hashable", ",", "str", "]", "]", "=", "None", ",", "skipna", "=", "None", ",", "closed", ":", "Optional", "[", "str", "]", "=", "None", ",", "label", ":", "Optio...
Returns a Resample object for performing resampling operations. Handles both downsampling and upsampling. If any intervals contain no values from the original object, they will be given the value ``NaN``. Parameters ---------- indexer : {dim: freq}, optional Mapping...
[ "Returns", "a", "Resample", "object", "for", "performing", "resampling", "operations", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/common.py#L668-L791
train
Returns a Resample object for performing downsampling and upsampling operations.
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...
pydata/xarray
xarray/core/common.py
DataWithCoords.where
def where(self, cond, other=dtypes.NA, drop: bool = False): """Filter elements from this object according to a condition. This operation follows the normal broadcasting and alignment rules that xarray uses for binary arithmetic. Parameters ---------- cond : DataArray or...
python
def where(self, cond, other=dtypes.NA, drop: bool = False): """Filter elements from this object according to a condition. This operation follows the normal broadcasting and alignment rules that xarray uses for binary arithmetic. Parameters ---------- cond : DataArray or...
[ "def", "where", "(", "self", ",", "cond", ",", "other", "=", "dtypes", ".", "NA", ",", "drop", ":", "bool", "=", "False", ")", ":", "from", ".", "alignment", "import", "align", "from", ".", "dataarray", "import", "DataArray", "from", ".", "dataset", ...
Filter elements from this object according to a condition. This operation follows the normal broadcasting and alignment rules that xarray uses for binary arithmetic. Parameters ---------- cond : DataArray or Dataset with boolean dtype Locations at which to preserve ...
[ "Filter", "elements", "from", "this", "object", "according", "to", "a", "condition", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/common.py#L793-L877
train
Filter elements from this object according to a condition.
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...
pydata/xarray
xarray/core/common.py
DataWithCoords.close
def close(self: Any) -> None: """Close any files linked to this object """ if self._file_obj is not None: self._file_obj.close() self._file_obj = None
python
def close(self: Any) -> None: """Close any files linked to this object """ if self._file_obj is not None: self._file_obj.close() self._file_obj = None
[ "def", "close", "(", "self", ":", "Any", ")", "->", "None", ":", "if", "self", ".", "_file_obj", "is", "not", "None", ":", "self", ".", "_file_obj", ".", "close", "(", ")", "self", ".", "_file_obj", "=", "None" ]
Close any files linked to this object
[ "Close", "any", "files", "linked", "to", "this", "object" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/common.py#L879-L884
train
Close any files linked to this 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...
pydata/xarray
xarray/core/common.py
DataWithCoords.isin
def isin(self, test_elements): """Tests each value in the array for whether it is in test elements. Parameters ---------- test_elements : array_like The values against which to test each value of `element`. This argument is flattened if an array or array_like. ...
python
def isin(self, test_elements): """Tests each value in the array for whether it is in test elements. Parameters ---------- test_elements : array_like The values against which to test each value of `element`. This argument is flattened if an array or array_like. ...
[ "def", "isin", "(", "self", ",", "test_elements", ")", ":", "from", ".", "computation", "import", "apply_ufunc", "from", ".", "dataset", "import", "Dataset", "from", ".", "dataarray", "import", "DataArray", "from", ".", "variable", "import", "Variable", "if", ...
Tests each value in the array for whether it is in test elements. Parameters ---------- test_elements : array_like The values against which to test each value of `element`. This argument is flattened if an array or array_like. See numpy notes for behavior wit...
[ "Tests", "each", "value", "in", "the", "array", "for", "whether", "it", "is", "in", "test", "elements", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/common.py#L886-L933
train
Tests each value in the array for whether it is in test elements.
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...
docker/docker-py
docker/utils/utils.py
compare_version
def compare_version(v1, v2): """Compare docker versions >>> v1 = '1.9' >>> v2 = '1.10' >>> compare_version(v1, v2) 1 >>> compare_version(v2, v1) -1 >>> compare_version(v2, v2) 0 """ s1 = StrictVersion(v1) s2 = StrictVersion(v2) if s1 == s2: return 0 elif ...
python
def compare_version(v1, v2): """Compare docker versions >>> v1 = '1.9' >>> v2 = '1.10' >>> compare_version(v1, v2) 1 >>> compare_version(v2, v1) -1 >>> compare_version(v2, v2) 0 """ s1 = StrictVersion(v1) s2 = StrictVersion(v2) if s1 == s2: return 0 elif ...
[ "def", "compare_version", "(", "v1", ",", "v2", ")", ":", "s1", "=", "StrictVersion", "(", "v1", ")", "s2", "=", "StrictVersion", "(", "v2", ")", "if", "s1", "==", "s2", ":", "return", "0", "elif", "s1", ">", "s2", ":", "return", "-", "1", "else"...
Compare docker versions >>> v1 = '1.9' >>> v2 = '1.10' >>> compare_version(v1, v2) 1 >>> compare_version(v2, v1) -1 >>> compare_version(v2, v2) 0
[ "Compare", "docker", "versions" ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/utils/utils.py#L54-L73
train
Compare two docker versions
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...
docker/docker-py
docker/utils/utils.py
datetime_to_timestamp
def datetime_to_timestamp(dt): """Convert a UTC datetime to a Unix timestamp""" delta = dt - datetime.utcfromtimestamp(0) return delta.seconds + delta.days * 24 * 3600
python
def datetime_to_timestamp(dt): """Convert a UTC datetime to a Unix timestamp""" delta = dt - datetime.utcfromtimestamp(0) return delta.seconds + delta.days * 24 * 3600
[ "def", "datetime_to_timestamp", "(", "dt", ")", ":", "delta", "=", "dt", "-", "datetime", ".", "utcfromtimestamp", "(", "0", ")", "return", "delta", ".", "seconds", "+", "delta", ".", "days", "*", "24", "*", "3600" ]
Convert a UTC datetime to a Unix timestamp
[ "Convert", "a", "UTC", "datetime", "to", "a", "Unix", "timestamp" ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/utils/utils.py#L394-L397
train
Convert a UTC datetime to a Unix timestamp
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...
docker/docker-py
docker/utils/utils.py
parse_env_file
def parse_env_file(env_file): """ Reads a line-separated environment file. The format of each line should be "key=value". """ environment = {} with open(env_file, 'r') as f: for line in f: if line[0] == '#': continue line = line.strip() ...
python
def parse_env_file(env_file): """ Reads a line-separated environment file. The format of each line should be "key=value". """ environment = {} with open(env_file, 'r') as f: for line in f: if line[0] == '#': continue line = line.strip() ...
[ "def", "parse_env_file", "(", "env_file", ")", ":", "environment", "=", "{", "}", "with", "open", "(", "env_file", ",", "'r'", ")", "as", "f", ":", "for", "line", "in", "f", ":", "if", "line", "[", "0", "]", "==", "'#'", ":", "continue", "line", ...
Reads a line-separated environment file. The format of each line should be "key=value".
[ "Reads", "a", "line", "-", "separated", "environment", "file", ".", "The", "format", "of", "each", "line", "should", "be", "key", "=", "value", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/utils/utils.py#L448-L474
train
Reads a line - separated environment 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...
docker/docker-py
docker/api/plugin.py
PluginApiMixin.configure_plugin
def configure_plugin(self, name, options): """ Configure a plugin. Args: name (string): The name of the plugin. The ``:latest`` tag is optional, and is the default if omitted. options (dict): A key-value mapping of options ...
python
def configure_plugin(self, name, options): """ Configure a plugin. Args: name (string): The name of the plugin. The ``:latest`` tag is optional, and is the default if omitted. options (dict): A key-value mapping of options ...
[ "def", "configure_plugin", "(", "self", ",", "name", ",", "options", ")", ":", "url", "=", "self", ".", "_url", "(", "'/plugins/{0}/set'", ",", "name", ")", "data", "=", "options", "if", "isinstance", "(", "data", ",", "dict", ")", ":", "data", "=", ...
Configure a plugin. Args: name (string): The name of the plugin. The ``:latest`` tag is optional, and is the default if omitted. options (dict): A key-value mapping of options Returns: ``True`` if successful
[ "Configure", "a", "plugin", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/plugin.py#L9-L27
train
Configure a plugin.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
docker/docker-py
docker/api/plugin.py
PluginApiMixin.create_plugin
def create_plugin(self, name, plugin_data_dir, gzip=False): """ Create a new plugin. Args: name (string): The name of the plugin. The ``:latest`` tag is optional, and is the default if omitted. plugin_data_dir (string): Path to the plu...
python
def create_plugin(self, name, plugin_data_dir, gzip=False): """ Create a new plugin. Args: name (string): The name of the plugin. The ``:latest`` tag is optional, and is the default if omitted. plugin_data_dir (string): Path to the plu...
[ "def", "create_plugin", "(", "self", ",", "name", ",", "plugin_data_dir", ",", "gzip", "=", "False", ")", ":", "url", "=", "self", ".", "_url", "(", "'/plugins/create'", ")", "with", "utils", ".", "create_archive", "(", "root", "=", "plugin_data_dir", ",",...
Create a new plugin. Args: name (string): The name of the plugin. The ``:latest`` tag is optional, and is the default if omitted. plugin_data_dir (string): Path to the plugin data directory. Plugin data directory must contain the ``con...
[ "Create", "a", "new", "plugin", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/plugin.py#L30-L53
train
Create a new plugin.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
docker/docker-py
docker/api/plugin.py
PluginApiMixin.disable_plugin
def disable_plugin(self, name): """ Disable an installed plugin. Args: name (string): The name of the plugin. The ``:latest`` tag is optional, and is the default if omitted. Returns: ``True`` if successful """ ...
python
def disable_plugin(self, name): """ Disable an installed plugin. Args: name (string): The name of the plugin. The ``:latest`` tag is optional, and is the default if omitted. Returns: ``True`` if successful """ ...
[ "def", "disable_plugin", "(", "self", ",", "name", ")", ":", "url", "=", "self", ".", "_url", "(", "'/plugins/{0}/disable'", ",", "name", ")", "res", "=", "self", ".", "_post", "(", "url", ")", "self", ".", "_raise_for_status", "(", "res", ")", "return...
Disable an installed plugin. Args: name (string): The name of the plugin. The ``:latest`` tag is optional, and is the default if omitted. Returns: ``True`` if successful
[ "Disable", "an", "installed", "plugin", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/plugin.py#L56-L70
train
Disable an installed plugin.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
docker/docker-py
docker/api/plugin.py
PluginApiMixin.enable_plugin
def enable_plugin(self, name, timeout=0): """ Enable an installed plugin. Args: name (string): The name of the plugin. The ``:latest`` tag is optional, and is the default if omitted. timeout (int): Operation timeout (in seconds). Defau...
python
def enable_plugin(self, name, timeout=0): """ Enable an installed plugin. Args: name (string): The name of the plugin. The ``:latest`` tag is optional, and is the default if omitted. timeout (int): Operation timeout (in seconds). Defau...
[ "def", "enable_plugin", "(", "self", ",", "name", ",", "timeout", "=", "0", ")", ":", "url", "=", "self", ".", "_url", "(", "'/plugins/{0}/enable'", ",", "name", ")", "params", "=", "{", "'timeout'", ":", "timeout", "}", "res", "=", "self", ".", "_po...
Enable an installed plugin. Args: name (string): The name of the plugin. The ``:latest`` tag is optional, and is the default if omitted. timeout (int): Operation timeout (in seconds). Default: 0 Returns: ``True`` if successful
[ "Enable", "an", "installed", "plugin", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/plugin.py#L73-L89
train
Enable an installed plugin.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
docker/docker-py
docker/api/plugin.py
PluginApiMixin.inspect_plugin
def inspect_plugin(self, name): """ Retrieve plugin metadata. Args: name (string): The name of the plugin. The ``:latest`` tag is optional, and is the default if omitted. Returns: A dict containing plugin info """ ...
python
def inspect_plugin(self, name): """ Retrieve plugin metadata. Args: name (string): The name of the plugin. The ``:latest`` tag is optional, and is the default if omitted. Returns: A dict containing plugin info """ ...
[ "def", "inspect_plugin", "(", "self", ",", "name", ")", ":", "url", "=", "self", ".", "_url", "(", "'/plugins/{0}/json'", ",", "name", ")", "return", "self", ".", "_result", "(", "self", ".", "_get", "(", "url", ")", ",", "True", ")" ]
Retrieve plugin metadata. Args: name (string): The name of the plugin. The ``:latest`` tag is optional, and is the default if omitted. Returns: A dict containing plugin info
[ "Retrieve", "plugin", "metadata", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/plugin.py#L92-L104
train
Retrieve plugin metadata.
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...
docker/docker-py
docker/api/plugin.py
PluginApiMixin.plugins
def plugins(self): """ Retrieve a list of installed plugins. Returns: A list of dicts, one per plugin """ url = self._url('/plugins') return self._result(self._get(url), True)
python
def plugins(self): """ Retrieve a list of installed plugins. Returns: A list of dicts, one per plugin """ url = self._url('/plugins') return self._result(self._get(url), True)
[ "def", "plugins", "(", "self", ")", ":", "url", "=", "self", ".", "_url", "(", "'/plugins'", ")", "return", "self", ".", "_result", "(", "self", ".", "_get", "(", "url", ")", ",", "True", ")" ]
Retrieve a list of installed plugins. Returns: A list of dicts, one per plugin
[ "Retrieve", "a", "list", "of", "installed", "plugins", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/plugin.py#L145-L153
train
Retrieve a list of installed plugins.
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...
docker/docker-py
docker/api/plugin.py
PluginApiMixin.plugin_privileges
def plugin_privileges(self, name): """ Retrieve list of privileges to be granted to a plugin. Args: name (string): Name of the remote plugin to examine. The ``:latest`` tag is optional, and is the default if omitted. Returns: ...
python
def plugin_privileges(self, name): """ Retrieve list of privileges to be granted to a plugin. Args: name (string): Name of the remote plugin to examine. The ``:latest`` tag is optional, and is the default if omitted. Returns: ...
[ "def", "plugin_privileges", "(", "self", ",", "name", ")", ":", "params", "=", "{", "'remote'", ":", "name", ",", "}", "headers", "=", "{", "}", "registry", ",", "repo_name", "=", "auth", ".", "resolve_repository_name", "(", "name", ")", "header", "=", ...
Retrieve list of privileges to be granted to a plugin. Args: name (string): Name of the remote plugin to examine. The ``:latest`` tag is optional, and is the default if omitted. Returns: A list of dictionaries representing the plugin's ...
[ "Retrieve", "list", "of", "privileges", "to", "be", "granted", "to", "a", "plugin", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/plugin.py#L156-L182
train
Retrieve list of privileges granted to a remote plugin.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
docker/docker-py
docker/api/plugin.py
PluginApiMixin.push_plugin
def push_plugin(self, name): """ Push a plugin to the registry. Args: name (string): Name of the plugin to upload. The ``:latest`` tag is optional, and is the default if omitted. Returns: ``True`` if successful """...
python
def push_plugin(self, name): """ Push a plugin to the registry. Args: name (string): Name of the plugin to upload. The ``:latest`` tag is optional, and is the default if omitted. Returns: ``True`` if successful """...
[ "def", "push_plugin", "(", "self", ",", "name", ")", ":", "url", "=", "self", ".", "_url", "(", "'/plugins/{0}/pull'", ",", "name", ")", "headers", "=", "{", "}", "registry", ",", "repo_name", "=", "auth", ".", "resolve_repository_name", "(", "name", ")"...
Push a plugin to the registry. Args: name (string): Name of the plugin to upload. The ``:latest`` tag is optional, and is the default if omitted. Returns: ``True`` if successful
[ "Push", "a", "plugin", "to", "the", "registry", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/plugin.py#L186-L206
train
Push a new plugin to the registry.
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...
docker/docker-py
docker/api/plugin.py
PluginApiMixin.remove_plugin
def remove_plugin(self, name, force=False): """ Remove an installed plugin. Args: name (string): Name of the plugin to remove. The ``:latest`` tag is optional, and is the default if omitted. force (bool): Disable the plugin before remo...
python
def remove_plugin(self, name, force=False): """ Remove an installed plugin. Args: name (string): Name of the plugin to remove. The ``:latest`` tag is optional, and is the default if omitted. force (bool): Disable the plugin before remo...
[ "def", "remove_plugin", "(", "self", ",", "name", ",", "force", "=", "False", ")", ":", "url", "=", "self", ".", "_url", "(", "'/plugins/{0}'", ",", "name", ")", "res", "=", "self", ".", "_delete", "(", "url", ",", "params", "=", "{", "'force'", ":...
Remove an installed plugin. Args: name (string): Name of the plugin to remove. The ``:latest`` tag is optional, and is the default if omitted. force (bool): Disable the plugin before removing. This may result in issues if the plugin is...
[ "Remove", "an", "installed", "plugin", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/plugin.py#L210-L226
train
Remove an installed plugin.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
docker/docker-py
docker/api/plugin.py
PluginApiMixin.upgrade_plugin
def upgrade_plugin(self, name, remote, privileges): """ Upgrade an installed plugin. Args: name (string): Name of the plugin to upgrade. The ``:latest`` tag is optional and is the default if omitted. remote (string): Remote reference t...
python
def upgrade_plugin(self, name, remote, privileges): """ Upgrade an installed plugin. Args: name (string): Name of the plugin to upgrade. The ``:latest`` tag is optional and is the default if omitted. remote (string): Remote reference t...
[ "def", "upgrade_plugin", "(", "self", ",", "name", ",", "remote", ",", "privileges", ")", ":", "url", "=", "self", ".", "_url", "(", "'/plugins/{0}/upgrade'", ",", "name", ")", "params", "=", "{", "'remote'", ":", "remote", ",", "}", "headers", "=", "{...
Upgrade an installed plugin. Args: name (string): Name of the plugin to upgrade. The ``:latest`` tag is optional and is the default if omitted. remote (string): Remote reference to upgrade to. The ``:latest`` tag is optional and is the...
[ "Upgrade", "an", "installed", "plugin", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/plugin.py#L230-L262
train
Upgrade an installed plugin.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
docker/docker-py
docker/client.py
DockerClient.from_env
def from_env(cls, **kwargs): """ Return a client configured from environment variables. The environment variables used are the same as those used by the Docker command-line client. They are: .. envvar:: DOCKER_HOST The URL to the Docker host. .. envvar:: D...
python
def from_env(cls, **kwargs): """ Return a client configured from environment variables. The environment variables used are the same as those used by the Docker command-line client. They are: .. envvar:: DOCKER_HOST The URL to the Docker host. .. envvar:: D...
[ "def", "from_env", "(", "cls", ",", "*", "*", "kwargs", ")", ":", "timeout", "=", "kwargs", ".", "pop", "(", "'timeout'", ",", "DEFAULT_TIMEOUT_SECONDS", ")", "version", "=", "kwargs", ".", "pop", "(", "'version'", ",", "None", ")", "return", "cls", "(...
Return a client configured from environment variables. The environment variables used are the same as those used by the Docker command-line client. They are: .. envvar:: DOCKER_HOST The URL to the Docker host. .. envvar:: DOCKER_TLS_VERIFY Verify the host aga...
[ "Return", "a", "client", "configured", "from", "environment", "variables", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/client.py#L43-L86
train
Returns a new instance of the class from environment variables.
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...
docker/docker-py
docker/types/daemon.py
CancellableStream.close
def close(self): """ Closes the event streaming. """ if not self._response.raw.closed: # find the underlying socket object # based on api.client._get_raw_response_socket sock_fp = self._response.raw._fp.fp if hasattr(sock_fp, 'raw'): ...
python
def close(self): """ Closes the event streaming. """ if not self._response.raw.closed: # find the underlying socket object # based on api.client._get_raw_response_socket sock_fp = self._response.raw._fp.fp if hasattr(sock_fp, 'raw'): ...
[ "def", "close", "(", "self", ")", ":", "if", "not", "self", ".", "_response", ".", "raw", ".", "closed", ":", "# find the underlying socket object", "# based on api.client._get_raw_response_socket", "sock_fp", "=", "self", ".", "_response", ".", "raw", ".", "_fp",...
Closes the event streaming.
[ "Closes", "the", "event", "streaming", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/types/daemon.py#L40-L74
train
Closes the event streaming.
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...
docker/docker-py
docker/utils/socket.py
read
def read(socket, n=4096): """ Reads at most n bytes from socket """ recoverable_errors = (errno.EINTR, errno.EDEADLK, errno.EWOULDBLOCK) if six.PY3 and not isinstance(socket, NpipeSocket): select.select([socket], [], []) try: if hasattr(socket, 'recv'): return sock...
python
def read(socket, n=4096): """ Reads at most n bytes from socket """ recoverable_errors = (errno.EINTR, errno.EDEADLK, errno.EWOULDBLOCK) if six.PY3 and not isinstance(socket, NpipeSocket): select.select([socket], [], []) try: if hasattr(socket, 'recv'): return sock...
[ "def", "read", "(", "socket", ",", "n", "=", "4096", ")", ":", "recoverable_errors", "=", "(", "errno", ".", "EINTR", ",", "errno", ".", "EDEADLK", ",", "errno", ".", "EWOULDBLOCK", ")", "if", "six", ".", "PY3", "and", "not", "isinstance", "(", "sock...
Reads at most n bytes from socket
[ "Reads", "at", "most", "n", "bytes", "from", "socket" ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/utils/socket.py#L23-L41
train
Reads at most n bytes from socket returning a tuple of the n - byte integers.
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...
docker/docker-py
docker/utils/socket.py
read_exactly
def read_exactly(socket, n): """ Reads exactly n bytes from socket Raises SocketError if there isn't enough data """ data = six.binary_type() while len(data) < n: next_data = read(socket, n - len(data)) if not next_data: raise SocketError("Unexpected EOF") dat...
python
def read_exactly(socket, n): """ Reads exactly n bytes from socket Raises SocketError if there isn't enough data """ data = six.binary_type() while len(data) < n: next_data = read(socket, n - len(data)) if not next_data: raise SocketError("Unexpected EOF") dat...
[ "def", "read_exactly", "(", "socket", ",", "n", ")", ":", "data", "=", "six", ".", "binary_type", "(", ")", "while", "len", "(", "data", ")", "<", "n", ":", "next_data", "=", "read", "(", "socket", ",", "n", "-", "len", "(", "data", ")", ")", "...
Reads exactly n bytes from socket Raises SocketError if there isn't enough data
[ "Reads", "exactly", "n", "bytes", "from", "socket", "Raises", "SocketError", "if", "there", "isn", "t", "enough", "data" ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/utils/socket.py#L44-L55
train
Reads exactly n bytes from socket returning a binary string.
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...
docker/docker-py
docker/utils/socket.py
next_frame_header
def next_frame_header(socket): """ Returns the stream and size of the next frame of data waiting to be read from socket, according to the protocol defined here: https://docs.docker.com/engine/api/v1.24/#attach-to-a-container """ try: data = read_exactly(socket, 8) except SocketError...
python
def next_frame_header(socket): """ Returns the stream and size of the next frame of data waiting to be read from socket, according to the protocol defined here: https://docs.docker.com/engine/api/v1.24/#attach-to-a-container """ try: data = read_exactly(socket, 8) except SocketError...
[ "def", "next_frame_header", "(", "socket", ")", ":", "try", ":", "data", "=", "read_exactly", "(", "socket", ",", "8", ")", "except", "SocketError", ":", "return", "(", "-", "1", ",", "-", "1", ")", "stream", ",", "actual", "=", "struct", ".", "unpac...
Returns the stream and size of the next frame of data waiting to be read from socket, according to the protocol defined here: https://docs.docker.com/engine/api/v1.24/#attach-to-a-container
[ "Returns", "the", "stream", "and", "size", "of", "the", "next", "frame", "of", "data", "waiting", "to", "be", "read", "from", "socket", "according", "to", "the", "protocol", "defined", "here", ":" ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/utils/socket.py#L58-L71
train
Reads the next frame of data from the socket and returns the stream and size of the next frame.
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...
docker/docker-py
docker/utils/socket.py
frames_iter
def frames_iter(socket, tty): """ Return a generator of frames read from socket. A frame is a tuple where the first item is the stream number and the second item is a chunk of data. If the tty setting is enabled, the streams are multiplexed into the stdout stream. """ if tty: return...
python
def frames_iter(socket, tty): """ Return a generator of frames read from socket. A frame is a tuple where the first item is the stream number and the second item is a chunk of data. If the tty setting is enabled, the streams are multiplexed into the stdout stream. """ if tty: return...
[ "def", "frames_iter", "(", "socket", ",", "tty", ")", ":", "if", "tty", ":", "return", "(", "(", "STDOUT", ",", "frame", ")", "for", "frame", "in", "frames_iter_tty", "(", "socket", ")", ")", "else", ":", "return", "frames_iter_no_tty", "(", "socket", ...
Return a generator of frames read from socket. A frame is a tuple where the first item is the stream number and the second item is a chunk of data. If the tty setting is enabled, the streams are multiplexed into the stdout stream.
[ "Return", "a", "generator", "of", "frames", "read", "from", "socket", ".", "A", "frame", "is", "a", "tuple", "where", "the", "first", "item", "is", "the", "stream", "number", "and", "the", "second", "item", "is", "a", "chunk", "of", "data", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/utils/socket.py#L74-L85
train
Return an iterator of frames read from socket.
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...
docker/docker-py
docker/utils/socket.py
frames_iter_no_tty
def frames_iter_no_tty(socket): """ Returns a generator of data read from the socket when the tty setting is not enabled. """ while True: (stream, n) = next_frame_header(socket) if n < 0: break while n > 0: result = read(socket, n) if resul...
python
def frames_iter_no_tty(socket): """ Returns a generator of data read from the socket when the tty setting is not enabled. """ while True: (stream, n) = next_frame_header(socket) if n < 0: break while n > 0: result = read(socket, n) if resul...
[ "def", "frames_iter_no_tty", "(", "socket", ")", ":", "while", "True", ":", "(", "stream", ",", "n", ")", "=", "next_frame_header", "(", "socket", ")", "if", "n", "<", "0", ":", "break", "while", "n", ">", "0", ":", "result", "=", "read", "(", "soc...
Returns a generator of data read from the socket when the tty setting is not enabled.
[ "Returns", "a", "generator", "of", "data", "read", "from", "the", "socket", "when", "the", "tty", "setting", "is", "not", "enabled", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/utils/socket.py#L88-L106
train
Returns a generator of data read from the socket when tty setting is is not enabled.
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...
docker/docker-py
docker/utils/socket.py
consume_socket_output
def consume_socket_output(frames, demux=False): """ Iterate through frames read from the socket and return the result. Args: demux (bool): If False, stdout and stderr are multiplexed, and the result is the concatenation of all the frames. If True, the streams are ...
python
def consume_socket_output(frames, demux=False): """ Iterate through frames read from the socket and return the result. Args: demux (bool): If False, stdout and stderr are multiplexed, and the result is the concatenation of all the frames. If True, the streams are ...
[ "def", "consume_socket_output", "(", "frames", ",", "demux", "=", "False", ")", ":", "if", "demux", "is", "False", ":", "# If the streams are multiplexed, the generator returns strings, that", "# we just need to concatenate.", "return", "six", ".", "binary_type", "(", ")"...
Iterate through frames read from the socket and return the result. Args: demux (bool): If False, stdout and stderr are multiplexed, and the result is the concatenation of all the frames. If True, the streams are demultiplexed, and the result is a 2-tuple where each item...
[ "Iterate", "through", "frames", "read", "from", "the", "socket", "and", "return", "the", "result", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/utils/socket.py#L122-L156
train
This function takes a list of frames and returns the result of the socket.
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...
docker/docker-py
docker/utils/socket.py
demux_adaptor
def demux_adaptor(stream_id, data): """ Utility to demultiplex stdout and stderr when reading frames from the socket. """ if stream_id == STDOUT: return (data, None) elif stream_id == STDERR: return (None, data) else: raise ValueError('{0} is not a valid stream'.forma...
python
def demux_adaptor(stream_id, data): """ Utility to demultiplex stdout and stderr when reading frames from the socket. """ if stream_id == STDOUT: return (data, None) elif stream_id == STDERR: return (None, data) else: raise ValueError('{0} is not a valid stream'.forma...
[ "def", "demux_adaptor", "(", "stream_id", ",", "data", ")", ":", "if", "stream_id", "==", "STDOUT", ":", "return", "(", "data", ",", "None", ")", "elif", "stream_id", "==", "STDERR", ":", "return", "(", "None", ",", "data", ")", "else", ":", "raise", ...
Utility to demultiplex stdout and stderr when reading frames from the socket.
[ "Utility", "to", "demultiplex", "stdout", "and", "stderr", "when", "reading", "frames", "from", "the", "socket", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/utils/socket.py#L159-L169
train
Utility to demultiplex stdout and stderr when reading frames from the socket.
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...
docker/docker-py
docker/api/build.py
BuildApiMixin.build
def build(self, path=None, tag=None, quiet=False, fileobj=None, nocache=False, rm=False, timeout=None, custom_context=False, encoding=None, pull=False, forcerm=False, dockerfile=None, container_limits=None, decode=False, buildargs=None, gzip=False, shmsize=None, ...
python
def build(self, path=None, tag=None, quiet=False, fileobj=None, nocache=False, rm=False, timeout=None, custom_context=False, encoding=None, pull=False, forcerm=False, dockerfile=None, container_limits=None, decode=False, buildargs=None, gzip=False, shmsize=None, ...
[ "def", "build", "(", "self", ",", "path", "=", "None", ",", "tag", "=", "None", ",", "quiet", "=", "False", ",", "fileobj", "=", "None", ",", "nocache", "=", "False", ",", "rm", "=", "False", ",", "timeout", "=", "None", ",", "custom_context", "=",...
Similar to the ``docker build`` command. Either ``path`` or ``fileobj`` needs to be set. ``path`` can be a local path (to a directory containing a Dockerfile) or a remote URL. ``fileobj`` must be a readable file-like object to a Dockerfile. If you have a tar file for the Docker build co...
[ "Similar", "to", "the", "docker", "build", "command", ".", "Either", "path", "or", "fileobj", "needs", "to", "be", "set", ".", "path", "can", "be", "a", "local", "path", "(", "to", "a", "directory", "containing", "a", "Dockerfile", ")", "or", "a", "rem...
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/build.py#L16-L275
train
Build a new instance of a new node.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
docker/docker-py
docker/api/build.py
BuildApiMixin.prune_builds
def prune_builds(self): """ Delete the builder cache Returns: (dict): A dictionary containing information about the operation's result. The ``SpaceReclaimed`` key indicates the amount of bytes of disk space reclaimed. Raises: ...
python
def prune_builds(self): """ Delete the builder cache Returns: (dict): A dictionary containing information about the operation's result. The ``SpaceReclaimed`` key indicates the amount of bytes of disk space reclaimed. Raises: ...
[ "def", "prune_builds", "(", "self", ")", ":", "url", "=", "self", ".", "_url", "(", "\"/build/prune\"", ")", "return", "self", ".", "_result", "(", "self", ".", "_post", "(", "url", ")", ",", "True", ")" ]
Delete the builder cache Returns: (dict): A dictionary containing information about the operation's result. The ``SpaceReclaimed`` key indicates the amount of bytes of disk space reclaimed. Raises: :py:class:`docker.errors.APIError` ...
[ "Delete", "the", "builder", "cache" ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/build.py#L278-L292
train
Delete the builder cache
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...
docker/docker-py
docker/api/swarm.py
SwarmApiMixin.create_swarm_spec
def create_swarm_spec(self, *args, **kwargs): """ Create a :py:class:`docker.types.SwarmSpec` instance that can be used as the ``swarm_spec`` argument in :py:meth:`~docker.api.swarm.SwarmApiMixin.init_swarm`. Args: task_history_retention_limit (int): Maximum number o...
python
def create_swarm_spec(self, *args, **kwargs): """ Create a :py:class:`docker.types.SwarmSpec` instance that can be used as the ``swarm_spec`` argument in :py:meth:`~docker.api.swarm.SwarmApiMixin.init_swarm`. Args: task_history_retention_limit (int): Maximum number o...
[ "def", "create_swarm_spec", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "ext_ca", "=", "kwargs", ".", "pop", "(", "'external_ca'", ",", "None", ")", "if", "ext_ca", ":", "kwargs", "[", "'external_cas'", "]", "=", "[", "ext_ca", ...
Create a :py:class:`docker.types.SwarmSpec` instance that can be used as the ``swarm_spec`` argument in :py:meth:`~docker.api.swarm.SwarmApiMixin.init_swarm`. Args: task_history_retention_limit (int): Maximum number of tasks history stored. snapshot_inter...
[ "Create", "a", ":", "py", ":", "class", ":", "docker", ".", "types", ".", "SwarmSpec", "instance", "that", "can", "be", "used", "as", "the", "swarm_spec", "argument", "in", ":", "py", ":", "meth", ":", "~docker", ".", "api", ".", "swarm", ".", "Swarm...
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/swarm.py#L13-L72
train
Creates a SwarmSpec instance that can be used as the swarm_spec argument.
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...
docker/docker-py
docker/api/swarm.py
SwarmApiMixin.init_swarm
def init_swarm(self, advertise_addr=None, listen_addr='0.0.0.0:2377', force_new_cluster=False, swarm_spec=None, default_addr_pool=None, subnet_size=None): """ Initialize a new Swarm using the current connected engine as the first node. Args: ...
python
def init_swarm(self, advertise_addr=None, listen_addr='0.0.0.0:2377', force_new_cluster=False, swarm_spec=None, default_addr_pool=None, subnet_size=None): """ Initialize a new Swarm using the current connected engine as the first node. Args: ...
[ "def", "init_swarm", "(", "self", ",", "advertise_addr", "=", "None", ",", "listen_addr", "=", "'0.0.0.0:2377'", ",", "force_new_cluster", "=", "False", ",", "swarm_spec", "=", "None", ",", "default_addr_pool", "=", "None", ",", "subnet_size", "=", "None", ")"...
Initialize a new Swarm using the current connected engine as the first node. Args: advertise_addr (string): Externally reachable address advertised to other nodes. This can either be an address/port combination in the form ``192.168.1.1:4567``, or an interfac...
[ "Initialize", "a", "new", "Swarm", "using", "the", "current", "connected", "engine", "as", "the", "first", "node", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/swarm.py#L85-L159
train
Initialize a new Swarm using the current connected engine as the first Swarm node.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
docker/docker-py
docker/api/swarm.py
SwarmApiMixin.inspect_swarm
def inspect_swarm(self): """ Retrieve low-level information about the current swarm. Returns: A dictionary containing data about the swarm. Raises: :py:class:`docker.errors.APIError` If the server returns an error. """ url = self....
python
def inspect_swarm(self): """ Retrieve low-level information about the current swarm. Returns: A dictionary containing data about the swarm. Raises: :py:class:`docker.errors.APIError` If the server returns an error. """ url = self....
[ "def", "inspect_swarm", "(", "self", ")", ":", "url", "=", "self", ".", "_url", "(", "'/swarm'", ")", "return", "self", ".", "_result", "(", "self", ".", "_get", "(", "url", ")", ",", "True", ")" ]
Retrieve low-level information about the current swarm. Returns: A dictionary containing data about the swarm. Raises: :py:class:`docker.errors.APIError` If the server returns an error.
[ "Retrieve", "low", "-", "level", "information", "about", "the", "current", "swarm", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/swarm.py#L162-L174
train
Retrieve low - level information about the current swarm.
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...
docker/docker-py
docker/api/swarm.py
SwarmApiMixin.inspect_node
def inspect_node(self, node_id): """ Retrieve low-level information about a swarm node Args: node_id (string): ID of the node to be inspected. Returns: A dictionary containing data about this node. Raises: :py:class:`docker.errors.APIError` ...
python
def inspect_node(self, node_id): """ Retrieve low-level information about a swarm node Args: node_id (string): ID of the node to be inspected. Returns: A dictionary containing data about this node. Raises: :py:class:`docker.errors.APIError` ...
[ "def", "inspect_node", "(", "self", ",", "node_id", ")", ":", "url", "=", "self", ".", "_url", "(", "'/nodes/{0}'", ",", "node_id", ")", "return", "self", ".", "_result", "(", "self", ".", "_get", "(", "url", ")", ",", "True", ")" ]
Retrieve low-level information about a swarm node Args: node_id (string): ID of the node to be inspected. Returns: A dictionary containing data about this node. Raises: :py:class:`docker.errors.APIError` If the server returns an error.
[ "Retrieve", "low", "-", "level", "information", "about", "a", "swarm", "node" ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/swarm.py#L178-L193
train
Retrieve low - level information about a swarm node.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
docker/docker-py
docker/api/swarm.py
SwarmApiMixin.join_swarm
def join_swarm(self, remote_addrs, join_token, listen_addr='0.0.0.0:2377', advertise_addr=None): """ Make this Engine join a swarm that has already been created. Args: remote_addrs (:py:class:`list`): Addresses of one or more manager nodes already ...
python
def join_swarm(self, remote_addrs, join_token, listen_addr='0.0.0.0:2377', advertise_addr=None): """ Make this Engine join a swarm that has already been created. Args: remote_addrs (:py:class:`list`): Addresses of one or more manager nodes already ...
[ "def", "join_swarm", "(", "self", ",", "remote_addrs", ",", "join_token", ",", "listen_addr", "=", "'0.0.0.0:2377'", ",", "advertise_addr", "=", "None", ")", ":", "data", "=", "{", "\"RemoteAddrs\"", ":", "remote_addrs", ",", "\"ListenAddr\"", ":", "listen_addr"...
Make this Engine join a swarm that has already been created. Args: remote_addrs (:py:class:`list`): Addresses of one or more manager nodes already participating in the Swarm to join. join_token (string): Secret token for joining this Swarm. listen_addr (strin...
[ "Make", "this", "Engine", "join", "a", "swarm", "that", "has", "already", "been", "created", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/swarm.py#L196-L233
train
This method joins a swarm.
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...
docker/docker-py
docker/api/swarm.py
SwarmApiMixin.leave_swarm
def leave_swarm(self, force=False): """ Leave a swarm. Args: force (bool): Leave the swarm even if this node is a manager. Default: ``False`` Returns: ``True`` if the request went through. Raises: :py:class:`docker.errors.API...
python
def leave_swarm(self, force=False): """ Leave a swarm. Args: force (bool): Leave the swarm even if this node is a manager. Default: ``False`` Returns: ``True`` if the request went through. Raises: :py:class:`docker.errors.API...
[ "def", "leave_swarm", "(", "self", ",", "force", "=", "False", ")", ":", "url", "=", "self", ".", "_url", "(", "'/swarm/leave'", ")", "response", "=", "self", ".", "_post", "(", "url", ",", "params", "=", "{", "'force'", ":", "force", "}", ")", "# ...
Leave a swarm. Args: force (bool): Leave the swarm even if this node is a manager. Default: ``False`` Returns: ``True`` if the request went through. Raises: :py:class:`docker.errors.APIError` If the server returns an error.
[ "Leave", "a", "swarm", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/swarm.py#L236-L261
train
Leave a swarm.
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...
docker/docker-py
docker/api/swarm.py
SwarmApiMixin.remove_node
def remove_node(self, node_id, force=False): """ Remove a node from the swarm. Args: node_id (string): ID of the node to be removed. force (bool): Force remove an active node. Default: `False` Raises: :py:class:`docker.errors.NotFound` ...
python
def remove_node(self, node_id, force=False): """ Remove a node from the swarm. Args: node_id (string): ID of the node to be removed. force (bool): Force remove an active node. Default: `False` Raises: :py:class:`docker.errors.NotFound` ...
[ "def", "remove_node", "(", "self", ",", "node_id", ",", "force", "=", "False", ")", ":", "url", "=", "self", ".", "_url", "(", "'/nodes/{0}'", ",", "node_id", ")", "params", "=", "{", "'force'", ":", "force", "}", "res", "=", "self", ".", "_delete", ...
Remove a node from the swarm. Args: node_id (string): ID of the node to be removed. force (bool): Force remove an active node. Default: `False` Raises: :py:class:`docker.errors.NotFound` If the node referenced doesn't exist in the swarm. ...
[ "Remove", "a", "node", "from", "the", "swarm", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/swarm.py#L289-L312
train
Removes a node from the swarm.
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...
docker/docker-py
docker/api/swarm.py
SwarmApiMixin.unlock_swarm
def unlock_swarm(self, key): """ Unlock a locked swarm. Args: key (string): The unlock key as provided by :py:meth:`get_unlock_key` Raises: :py:class:`docker.errors.InvalidArgument` If the key argument ...
python
def unlock_swarm(self, key): """ Unlock a locked swarm. Args: key (string): The unlock key as provided by :py:meth:`get_unlock_key` Raises: :py:class:`docker.errors.InvalidArgument` If the key argument ...
[ "def", "unlock_swarm", "(", "self", ",", "key", ")", ":", "if", "isinstance", "(", "key", ",", "dict", ")", ":", "if", "'UnlockKey'", "not", "in", "key", ":", "raise", "errors", ".", "InvalidArgument", "(", "'Invalid unlock key format'", ")", "else", ":", ...
Unlock a locked swarm. Args: key (string): The unlock key as provided by :py:meth:`get_unlock_key` Raises: :py:class:`docker.errors.InvalidArgument` If the key argument is in an incompatible format :py:cla...
[ "Unlock", "a", "locked", "swarm", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/swarm.py#L315-L348
train
Unlock a locked swarm.
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...
docker/docker-py
docker/api/swarm.py
SwarmApiMixin.update_node
def update_node(self, node_id, version, node_spec=None): """ Update the node's configuration Args: node_id (string): ID of the node to be updated. version (int): The version number of the node object being updated. This is required to avoid conflicting w...
python
def update_node(self, node_id, version, node_spec=None): """ Update the node's configuration Args: node_id (string): ID of the node to be updated. version (int): The version number of the node object being updated. This is required to avoid conflicting w...
[ "def", "update_node", "(", "self", ",", "node_id", ",", "version", ",", "node_spec", "=", "None", ")", ":", "url", "=", "self", ".", "_url", "(", "'/nodes/{0}/update?version={1}'", ",", "node_id", ",", "str", "(", "version", ")", ")", "res", "=", "self",...
Update the node's configuration Args: node_id (string): ID of the node to be updated. version (int): The version number of the node object being updated. This is required to avoid conflicting writes. node_spec (dict): Configuration settings to update. Any va...
[ "Update", "the", "node", "s", "configuration" ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/swarm.py#L351-L384
train
Update the node s configuration with the new version number.
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...
docker/docker-py
docker/api/swarm.py
SwarmApiMixin.update_swarm
def update_swarm(self, version, swarm_spec=None, rotate_worker_token=False, rotate_manager_token=False): """ Update the Swarm's configuration Args: version (int): The version number of the swarm object being updated. This is required to avoid con...
python
def update_swarm(self, version, swarm_spec=None, rotate_worker_token=False, rotate_manager_token=False): """ Update the Swarm's configuration Args: version (int): The version number of the swarm object being updated. This is required to avoid con...
[ "def", "update_swarm", "(", "self", ",", "version", ",", "swarm_spec", "=", "None", ",", "rotate_worker_token", "=", "False", ",", "rotate_manager_token", "=", "False", ")", ":", "url", "=", "self", ".", "_url", "(", "'/swarm/update'", ")", "response", "=", ...
Update the Swarm's configuration Args: version (int): The version number of the swarm object being updated. This is required to avoid conflicting writes. swarm_spec (dict): Configuration settings to update. Use :py:meth:`~docker.api.swarm.SwarmApiMixin.cr...
[ "Update", "the", "Swarm", "s", "configuration" ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/swarm.py#L387-L418
train
Update the Swarm s configuration with the new version number.
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...
docker/docker-py
docker/models/secrets.py
SecretCollection.get
def get(self, secret_id): """ Get a secret. Args: secret_id (str): Secret ID. Returns: (:py:class:`Secret`): The secret. Raises: :py:class:`docker.errors.NotFound` If the secret does not exist. :py:class:`docker.e...
python
def get(self, secret_id): """ Get a secret. Args: secret_id (str): Secret ID. Returns: (:py:class:`Secret`): The secret. Raises: :py:class:`docker.errors.NotFound` If the secret does not exist. :py:class:`docker.e...
[ "def", "get", "(", "self", ",", "secret_id", ")", ":", "return", "self", ".", "prepare_model", "(", "self", ".", "client", ".", "api", ".", "inspect_secret", "(", "secret_id", ")", ")" ]
Get a secret. Args: secret_id (str): Secret ID. Returns: (:py:class:`Secret`): The secret. Raises: :py:class:`docker.errors.NotFound` If the secret does not exist. :py:class:`docker.errors.APIError` If the server ...
[ "Get", "a", "secret", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/models/secrets.py#L36-L52
train
Get a secret.
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...
docker/docker-py
docker/models/secrets.py
SecretCollection.list
def list(self, **kwargs): """ List secrets. Similar to the ``docker secret ls`` command. Args: filters (dict): Server-side list filtering options. Returns: (list of :py:class:`Secret`): The secrets. Raises: :py:class:`docker.errors.APIError`...
python
def list(self, **kwargs): """ List secrets. Similar to the ``docker secret ls`` command. Args: filters (dict): Server-side list filtering options. Returns: (list of :py:class:`Secret`): The secrets. Raises: :py:class:`docker.errors.APIError`...
[ "def", "list", "(", "self", ",", "*", "*", "kwargs", ")", ":", "resp", "=", "self", ".", "client", ".", "api", ".", "secrets", "(", "*", "*", "kwargs", ")", "return", "[", "self", ".", "prepare_model", "(", "obj", ")", "for", "obj", "in", "resp",...
List secrets. Similar to the ``docker secret ls`` command. Args: filters (dict): Server-side list filtering options. Returns: (list of :py:class:`Secret`): The secrets. Raises: :py:class:`docker.errors.APIError` If the server returns an erro...
[ "List", "secrets", ".", "Similar", "to", "the", "docker", "secret", "ls", "command", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/models/secrets.py#L54-L69
train
List secrets. Similar to the docker secret ls command.
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...
docker/docker-py
docker/api/network.py
NetworkApiMixin.networks
def networks(self, names=None, ids=None, filters=None): """ List networks. Similar to the ``docker networks ls`` command. Args: names (:py:class:`list`): List of names to filter by ids (:py:class:`list`): List of ids to filter by filters (dict): Filters to be...
python
def networks(self, names=None, ids=None, filters=None): """ List networks. Similar to the ``docker networks ls`` command. Args: names (:py:class:`list`): List of names to filter by ids (:py:class:`list`): List of ids to filter by filters (dict): Filters to be...
[ "def", "networks", "(", "self", ",", "names", "=", "None", ",", "ids", "=", "None", ",", "filters", "=", "None", ")", ":", "if", "filters", "is", "None", ":", "filters", "=", "{", "}", "if", "names", ":", "filters", "[", "'name'", "]", "=", "name...
List networks. Similar to the ``docker networks ls`` command. Args: names (:py:class:`list`): List of names to filter by ids (:py:class:`list`): List of ids to filter by filters (dict): Filters to be processed on the network list. Available filters: ...
[ "List", "networks", ".", "Similar", "to", "the", "docker", "networks", "ls", "command", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/network.py#L8-L38
train
List the names and ids of all networks in the cluster.
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...
docker/docker-py
docker/api/network.py
NetworkApiMixin.create_network
def create_network(self, name, driver=None, options=None, ipam=None, check_duplicate=None, internal=False, labels=None, enable_ipv6=False, attachable=None, scope=None, ingress=None): """ Create a network. Similar to the ``docker networ...
python
def create_network(self, name, driver=None, options=None, ipam=None, check_duplicate=None, internal=False, labels=None, enable_ipv6=False, attachable=None, scope=None, ingress=None): """ Create a network. Similar to the ``docker networ...
[ "def", "create_network", "(", "self", ",", "name", ",", "driver", "=", "None", ",", "options", "=", "None", ",", "ipam", "=", "None", ",", "check_duplicate", "=", "None", ",", "internal", "=", "False", ",", "labels", "=", "None", ",", "enable_ipv6", "=...
Create a network. Similar to the ``docker network create``. Args: name (str): Name of the network driver (str): Name of the driver used to create the network options (dict): Driver options as a key-value dictionary ipam (IPAMConfig): Optional custom IP scheme for...
[ "Create", "a", "network", ".", "Similar", "to", "the", "docker", "network", "create", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/network.py#L40-L152
train
Create a network using the given parameters.
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...
docker/docker-py
docker/api/network.py
NetworkApiMixin.remove_network
def remove_network(self, net_id): """ Remove a network. Similar to the ``docker network rm`` command. Args: net_id (str): The network's id """ url = self._url("/networks/{0}", net_id) res = self._delete(url) self._raise_for_status(res)
python
def remove_network(self, net_id): """ Remove a network. Similar to the ``docker network rm`` command. Args: net_id (str): The network's id """ url = self._url("/networks/{0}", net_id) res = self._delete(url) self._raise_for_status(res)
[ "def", "remove_network", "(", "self", ",", "net_id", ")", ":", "url", "=", "self", ".", "_url", "(", "\"/networks/{0}\"", ",", "net_id", ")", "res", "=", "self", ".", "_delete", "(", "url", ")", "self", ".", "_raise_for_status", "(", "res", ")" ]
Remove a network. Similar to the ``docker network rm`` command. Args: net_id (str): The network's id
[ "Remove", "a", "network", ".", "Similar", "to", "the", "docker", "network", "rm", "command", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/network.py#L177-L186
train
Remove a network from the cache.
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...
docker/docker-py
docker/api/network.py
NetworkApiMixin.inspect_network
def inspect_network(self, net_id, verbose=None, scope=None): """ Get detailed information about a network. Args: net_id (str): ID of network verbose (bool): Show the service details across the cluster in swarm mode. scope (str): Filter the net...
python
def inspect_network(self, net_id, verbose=None, scope=None): """ Get detailed information about a network. Args: net_id (str): ID of network verbose (bool): Show the service details across the cluster in swarm mode. scope (str): Filter the net...
[ "def", "inspect_network", "(", "self", ",", "net_id", ",", "verbose", "=", "None", ",", "scope", "=", "None", ")", ":", "params", "=", "{", "}", "if", "verbose", "is", "not", "None", ":", "if", "version_lt", "(", "self", ".", "_version", ",", "'1.28'...
Get detailed information about a network. Args: net_id (str): ID of network verbose (bool): Show the service details across the cluster in swarm mode. scope (str): Filter the network by scope (``swarm``, ``global`` or ``local``).
[ "Get", "detailed", "information", "about", "a", "network", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/network.py#L189-L212
train
Get detailed information about a network.
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...
docker/docker-py
docker/api/network.py
NetworkApiMixin.connect_container_to_network
def connect_container_to_network(self, container, net_id, ipv4_address=None, ipv6_address=None, aliases=None, links=None, link_local_ips=None): """ Connect a container to a network. Ar...
python
def connect_container_to_network(self, container, net_id, ipv4_address=None, ipv6_address=None, aliases=None, links=None, link_local_ips=None): """ Connect a container to a network. Ar...
[ "def", "connect_container_to_network", "(", "self", ",", "container", ",", "net_id", ",", "ipv4_address", "=", "None", ",", "ipv6_address", "=", "None", ",", "aliases", "=", "None", ",", "links", "=", "None", ",", "link_local_ips", "=", "None", ")", ":", "...
Connect a container to a network. Args: container (str): container-id/name to be connected to the network net_id (str): network id aliases (:py:class:`list`): A list of aliases for this endpoint. Names in that list can be used within the network to reach the ...
[ "Connect", "a", "container", "to", "a", "network", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/network.py#L215-L248
train
Connects a container to a network.
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...
docker/docker-py
docker/api/network.py
NetworkApiMixin.disconnect_container_from_network
def disconnect_container_from_network(self, container, net_id, force=False): """ Disconnect a container from a network. Args: container (str): container ID or name to be disconnected from the network net_id (str):...
python
def disconnect_container_from_network(self, container, net_id, force=False): """ Disconnect a container from a network. Args: container (str): container ID or name to be disconnected from the network net_id (str):...
[ "def", "disconnect_container_from_network", "(", "self", ",", "container", ",", "net_id", ",", "force", "=", "False", ")", ":", "data", "=", "{", "\"Container\"", ":", "container", "}", "if", "force", ":", "if", "version_lt", "(", "self", ".", "_version", ...
Disconnect a container from a network. Args: container (str): container ID or name to be disconnected from the network net_id (str): network ID force (bool): Force the container to disconnect from a network. Default: ``False``
[ "Disconnect", "a", "container", "from", "a", "network", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/network.py#L251-L272
train
Disconnect a container from a network.
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...
docker/docker-py
docker/models/swarm.py
Swarm.init
def init(self, advertise_addr=None, listen_addr='0.0.0.0:2377', force_new_cluster=False, default_addr_pool=None, subnet_size=None, **kwargs): """ Initialize a new swarm on this Engine. Args: advertise_addr (str): Externally reachable address advertised to ...
python
def init(self, advertise_addr=None, listen_addr='0.0.0.0:2377', force_new_cluster=False, default_addr_pool=None, subnet_size=None, **kwargs): """ Initialize a new swarm on this Engine. Args: advertise_addr (str): Externally reachable address advertised to ...
[ "def", "init", "(", "self", ",", "advertise_addr", "=", "None", ",", "listen_addr", "=", "'0.0.0.0:2377'", ",", "force_new_cluster", "=", "False", ",", "default_addr_pool", "=", "None", ",", "subnet_size", "=", "None", ",", "*", "*", "kwargs", ")", ":", "i...
Initialize a new swarm on this Engine. Args: advertise_addr (str): Externally reachable address advertised to other nodes. This can either be an address/port combination in the form ``192.168.1.1:4567``, or an interface followed by a port number, like...
[ "Initialize", "a", "new", "swarm", "on", "this", "Engine", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/models/swarm.py#L36-L125
train
Initialize a new Swarm on this Engine.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
docker/docker-py
docker/models/swarm.py
Swarm.update
def update(self, rotate_worker_token=False, rotate_manager_token=False, **kwargs): """ Update the swarm's configuration. It takes the same arguments as :py:meth:`init`, except ``advertise_addr``, ``listen_addr``, and ``force_new_cluster``. In addition, it takes th...
python
def update(self, rotate_worker_token=False, rotate_manager_token=False, **kwargs): """ Update the swarm's configuration. It takes the same arguments as :py:meth:`init`, except ``advertise_addr``, ``listen_addr``, and ``force_new_cluster``. In addition, it takes th...
[ "def", "update", "(", "self", ",", "rotate_worker_token", "=", "False", ",", "rotate_manager_token", "=", "False", ",", "*", "*", "kwargs", ")", ":", "# this seems to have to be set", "if", "kwargs", ".", "get", "(", "'node_cert_expiry'", ")", "is", "None", ":...
Update the swarm's configuration. It takes the same arguments as :py:meth:`init`, except ``advertise_addr``, ``listen_addr``, and ``force_new_cluster``. In addition, it takes these arguments: Args: rotate_worker_token (bool): Rotate the worker join token. Default: ...
[ "Update", "the", "swarm", "s", "configuration", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/models/swarm.py#L150-L179
train
Update the current configuration of the swarm.
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...
docker/docker-py
docker/api/volume.py
VolumeApiMixin.create_volume
def create_volume(self, name=None, driver=None, driver_opts=None, labels=None): """ Create and register a named volume Args: name (str): Name of the volume driver (str): Name of the driver used to create the volume driver_opts (dict): Dr...
python
def create_volume(self, name=None, driver=None, driver_opts=None, labels=None): """ Create and register a named volume Args: name (str): Name of the volume driver (str): Name of the driver used to create the volume driver_opts (dict): Dr...
[ "def", "create_volume", "(", "self", ",", "name", "=", "None", ",", "driver", "=", "None", ",", "driver_opts", "=", "None", ",", "labels", "=", "None", ")", ":", "url", "=", "self", ".", "_url", "(", "'/volumes/create'", ")", "if", "driver_opts", "is",...
Create and register a named volume Args: name (str): Name of the volume driver (str): Name of the driver used to create the volume driver_opts (dict): Driver options as a key-value dictionary labels (dict): Labels to set on the volume Returns: ...
[ "Create", "and", "register", "a", "named", "volume" ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/volume.py#L39-L89
train
Create and register a named volume in the cluster.
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...
docker/docker-py
docker/api/volume.py
VolumeApiMixin.inspect_volume
def inspect_volume(self, name): """ Retrieve volume info by name. Args: name (str): volume name Returns: (dict): Volume information dictionary Raises: :py:class:`docker.errors.APIError` If the server returns an error. ...
python
def inspect_volume(self, name): """ Retrieve volume info by name. Args: name (str): volume name Returns: (dict): Volume information dictionary Raises: :py:class:`docker.errors.APIError` If the server returns an error. ...
[ "def", "inspect_volume", "(", "self", ",", "name", ")", ":", "url", "=", "self", ".", "_url", "(", "'/volumes/{0}'", ",", "name", ")", "return", "self", ".", "_result", "(", "self", ".", "_get", "(", "url", ")", ",", "True", ")" ]
Retrieve volume info by name. Args: name (str): volume name Returns: (dict): Volume information dictionary Raises: :py:class:`docker.errors.APIError` If the server returns an error. Example: >>> cli.inspect_volume('foob...
[ "Retrieve", "volume", "info", "by", "name", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/volume.py#L91-L114
train
Retrieve the information of a specific volume.
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...
docker/docker-py
docker/api/volume.py
VolumeApiMixin.prune_volumes
def prune_volumes(self, filters=None): """ Delete unused volumes Args: filters (dict): Filters to process on the prune list. Returns: (dict): A dict containing a list of deleted volume names and the amount of disk space reclaimed in bytes. ...
python
def prune_volumes(self, filters=None): """ Delete unused volumes Args: filters (dict): Filters to process on the prune list. Returns: (dict): A dict containing a list of deleted volume names and the amount of disk space reclaimed in bytes. ...
[ "def", "prune_volumes", "(", "self", ",", "filters", "=", "None", ")", ":", "params", "=", "{", "}", "if", "filters", ":", "params", "[", "'filters'", "]", "=", "utils", ".", "convert_filters", "(", "filters", ")", "url", "=", "self", ".", "_url", "(...
Delete unused volumes Args: filters (dict): Filters to process on the prune list. Returns: (dict): A dict containing a list of deleted volume names and the amount of disk space reclaimed in bytes. Raises: :py:class:`docker.errors.APIError` ...
[ "Delete", "unused", "volumes" ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/volume.py#L117-L136
train
Delete unused volumes from 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...
docker/docker-py
docker/api/volume.py
VolumeApiMixin.remove_volume
def remove_volume(self, name, force=False): """ Remove a volume. Similar to the ``docker volume rm`` command. Args: name (str): The volume's name force (bool): Force removal of volumes that were already removed out of band by the volume driver plugin. ...
python
def remove_volume(self, name, force=False): """ Remove a volume. Similar to the ``docker volume rm`` command. Args: name (str): The volume's name force (bool): Force removal of volumes that were already removed out of band by the volume driver plugin. ...
[ "def", "remove_volume", "(", "self", ",", "name", ",", "force", "=", "False", ")", ":", "params", "=", "{", "}", "if", "force", ":", "if", "utils", ".", "version_lt", "(", "self", ".", "_version", ",", "'1.25'", ")", ":", "raise", "errors", ".", "I...
Remove a volume. Similar to the ``docker volume rm`` command. Args: name (str): The volume's name force (bool): Force removal of volumes that were already removed out of band by the volume driver plugin. Raises: :py:class:`docker.errors.APIError` ...
[ "Remove", "a", "volume", ".", "Similar", "to", "the", "docker", "volume", "rm", "command", "." ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/volume.py#L138-L161
train
Removes a specific image volume from the cache.
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...
docker/docker-py
docker/api/config.py
ConfigApiMixin.create_config
def create_config(self, name, data, labels=None): """ Create a config Args: name (string): Name of the config data (bytes): Config data to be stored labels (dict): A mapping of labels to assign to the config Returns (dict): ID...
python
def create_config(self, name, data, labels=None): """ Create a config Args: name (string): Name of the config data (bytes): Config data to be stored labels (dict): A mapping of labels to assign to the config Returns (dict): ID...
[ "def", "create_config", "(", "self", ",", "name", ",", "data", ",", "labels", "=", "None", ")", ":", "if", "not", "isinstance", "(", "data", ",", "bytes", ")", ":", "data", "=", "data", ".", "encode", "(", "'utf-8'", ")", "data", "=", "base64", "."...
Create a config Args: name (string): Name of the config data (bytes): Config data to be stored labels (dict): A mapping of labels to assign to the config Returns (dict): ID of the newly created config
[ "Create", "a", "config" ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/config.py#L10-L36
train
Create a new config in the neccesary way.
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...
docker/docker-py
docker/api/config.py
ConfigApiMixin.inspect_config
def inspect_config(self, id): """ Retrieve config metadata Args: id (string): Full ID of the config to inspect Returns (dict): A dictionary of metadata Raises: :py:class:`docker.errors.NotFound` if no config w...
python
def inspect_config(self, id): """ Retrieve config metadata Args: id (string): Full ID of the config to inspect Returns (dict): A dictionary of metadata Raises: :py:class:`docker.errors.NotFound` if no config w...
[ "def", "inspect_config", "(", "self", ",", "id", ")", ":", "url", "=", "self", ".", "_url", "(", "'/configs/{0}'", ",", "id", ")", "return", "self", ".", "_result", "(", "self", ".", "_get", "(", "url", ")", ",", "True", ")" ]
Retrieve config metadata Args: id (string): Full ID of the config to inspect Returns (dict): A dictionary of metadata Raises: :py:class:`docker.errors.NotFound` if no config with that ID exists
[ "Retrieve", "config", "metadata" ]
613d6aad83acc9931ff2ecfd6a6c7bd8061dc125
https://github.com/docker/docker-py/blob/613d6aad83acc9931ff2ecfd6a6c7bd8061dc125/docker/api/config.py#L40-L54
train
Retrieve config metadata
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...