id int32 0 252k | repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 |
|---|---|---|---|---|---|---|---|---|---|---|---|
222,800 | vtkiorg/vtki | vtki/common.py | Common.copy_meta_from | def copy_meta_from(self, ido):
"""Copies vtki meta data onto this object from another object"""
self._active_scalar_info = ido.active_scalar_info
self._active_vectors_info = ido.active_vectors_info
if hasattr(ido, '_textures'):
self._textures = ido._textures | python | def copy_meta_from(self, ido):
"""Copies vtki meta data onto this object from another object"""
self._active_scalar_info = ido.active_scalar_info
self._active_vectors_info = ido.active_vectors_info
if hasattr(ido, '_textures'):
self._textures = ido._textures | [
"def",
"copy_meta_from",
"(",
"self",
",",
"ido",
")",
":",
"self",
".",
"_active_scalar_info",
"=",
"ido",
".",
"active_scalar_info",
"self",
".",
"_active_vectors_info",
"=",
"ido",
".",
"active_vectors_info",
"if",
"hasattr",
"(",
"ido",
",",
"'_textures'",
... | Copies vtki meta data onto this object from another object | [
"Copies",
"vtki",
"meta",
"data",
"onto",
"this",
"object",
"from",
"another",
"object"
] | 5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1 | https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/common.py#L536-L541 |
222,801 | vtkiorg/vtki | vtki/common.py | Common.copy | def copy(self, deep=True):
"""
Returns a copy of the object
Parameters
----------
deep : bool, optional
When True makes a full copy of the object.
Returns
-------
newobject : same as input
Deep or shallow copy of the input.
... | python | def copy(self, deep=True):
"""
Returns a copy of the object
Parameters
----------
deep : bool, optional
When True makes a full copy of the object.
Returns
-------
newobject : same as input
Deep or shallow copy of the input.
... | [
"def",
"copy",
"(",
"self",
",",
"deep",
"=",
"True",
")",
":",
"thistype",
"=",
"type",
"(",
"self",
")",
"newobject",
"=",
"thistype",
"(",
")",
"if",
"deep",
":",
"newobject",
".",
"DeepCopy",
"(",
"self",
")",
"else",
":",
"newobject",
".",
"Sh... | Returns a copy of the object
Parameters
----------
deep : bool, optional
When True makes a full copy of the object.
Returns
-------
newobject : same as input
Deep or shallow copy of the input. | [
"Returns",
"a",
"copy",
"of",
"the",
"object"
] | 5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1 | https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/common.py#L543-L564 |
222,802 | vtkiorg/vtki | vtki/common.py | Common.point_arrays | def point_arrays(self):
""" Returns the all point arrays """
pdata = self.GetPointData()
narr = pdata.GetNumberOfArrays()
# Update data if necessary
if hasattr(self, '_point_arrays'):
keys = list(self._point_arrays.keys())
if narr == len(keys):
... | python | def point_arrays(self):
""" Returns the all point arrays """
pdata = self.GetPointData()
narr = pdata.GetNumberOfArrays()
# Update data if necessary
if hasattr(self, '_point_arrays'):
keys = list(self._point_arrays.keys())
if narr == len(keys):
... | [
"def",
"point_arrays",
"(",
"self",
")",
":",
"pdata",
"=",
"self",
".",
"GetPointData",
"(",
")",
"narr",
"=",
"pdata",
".",
"GetNumberOfArrays",
"(",
")",
"# Update data if necessary",
"if",
"hasattr",
"(",
"self",
",",
"'_point_arrays'",
")",
":",
"keys",... | Returns the all point arrays | [
"Returns",
"the",
"all",
"point",
"arrays"
] | 5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1 | https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/common.py#L572-L595 |
222,803 | vtkiorg/vtki | vtki/common.py | Common.cell_arrays | def cell_arrays(self):
""" Returns the all cell arrays """
cdata = self.GetCellData()
narr = cdata.GetNumberOfArrays()
# Update data if necessary
if hasattr(self, '_cell_arrays'):
keys = list(self._cell_arrays.keys())
if narr == len(keys):
... | python | def cell_arrays(self):
""" Returns the all cell arrays """
cdata = self.GetCellData()
narr = cdata.GetNumberOfArrays()
# Update data if necessary
if hasattr(self, '_cell_arrays'):
keys = list(self._cell_arrays.keys())
if narr == len(keys):
... | [
"def",
"cell_arrays",
"(",
"self",
")",
":",
"cdata",
"=",
"self",
".",
"GetCellData",
"(",
")",
"narr",
"=",
"cdata",
".",
"GetNumberOfArrays",
"(",
")",
"# Update data if necessary",
"if",
"hasattr",
"(",
"self",
",",
"'_cell_arrays'",
")",
":",
"keys",
... | Returns the all cell arrays | [
"Returns",
"the",
"all",
"cell",
"arrays"
] | 5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1 | https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/common.py#L602-L625 |
222,804 | vtkiorg/vtki | vtki/common.py | Common.get_data_range | def get_data_range(self, arr=None, preference='cell'):
"""Get the non-NaN min and max of a named scalar array
Parameters
----------
arr : str, np.ndarray, optional
The name of the array to get the range. If None, the active scalar
is used
preference : st... | python | def get_data_range(self, arr=None, preference='cell'):
"""Get the non-NaN min and max of a named scalar array
Parameters
----------
arr : str, np.ndarray, optional
The name of the array to get the range. If None, the active scalar
is used
preference : st... | [
"def",
"get_data_range",
"(",
"self",
",",
"arr",
"=",
"None",
",",
"preference",
"=",
"'cell'",
")",
":",
"if",
"arr",
"is",
"None",
":",
"# use active scalar array",
"_",
",",
"arr",
"=",
"self",
".",
"active_scalar_info",
"if",
"isinstance",
"(",
"arr",... | Get the non-NaN min and max of a named scalar array
Parameters
----------
arr : str, np.ndarray, optional
The name of the array to get the range. If None, the active scalar
is used
preference : str, optional
When scalars is specified, this is the per... | [
"Get",
"the",
"non",
"-",
"NaN",
"min",
"and",
"max",
"of",
"a",
"named",
"scalar",
"array"
] | 5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1 | https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/common.py#L685-L708 |
222,805 | vtkiorg/vtki | vtki/common.py | Common.scalar_names | def scalar_names(self):
"""A list of scalar names for the dataset. This makes
sure to put the active scalar's name first in the list."""
names = []
for i in range(self.GetPointData().GetNumberOfArrays()):
names.append(self.GetPointData().GetArrayName(i))
for i in rang... | python | def scalar_names(self):
"""A list of scalar names for the dataset. This makes
sure to put the active scalar's name first in the list."""
names = []
for i in range(self.GetPointData().GetNumberOfArrays()):
names.append(self.GetPointData().GetArrayName(i))
for i in rang... | [
"def",
"scalar_names",
"(",
"self",
")",
":",
"names",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"self",
".",
"GetPointData",
"(",
")",
".",
"GetNumberOfArrays",
"(",
")",
")",
":",
"names",
".",
"append",
"(",
"self",
".",
"GetPointData",
"(",
... | A list of scalar names for the dataset. This makes
sure to put the active scalar's name first in the list. | [
"A",
"list",
"of",
"scalar",
"names",
"for",
"the",
"dataset",
".",
"This",
"makes",
"sure",
"to",
"put",
"the",
"active",
"scalar",
"s",
"name",
"first",
"in",
"the",
"list",
"."
] | 5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1 | https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/common.py#L749-L762 |
222,806 | vtkiorg/vtki | vtki/common.py | Common.head | def head(self, display=True, html=None):
"""Return the header stats of this dataset. If in IPython, this will
be formatted to HTML. Otherwise returns a console friendly string"""
# Generate the output
if html:
fmt = ""
# HTML version
fmt += "\n"
... | python | def head(self, display=True, html=None):
"""Return the header stats of this dataset. If in IPython, this will
be formatted to HTML. Otherwise returns a console friendly string"""
# Generate the output
if html:
fmt = ""
# HTML version
fmt += "\n"
... | [
"def",
"head",
"(",
"self",
",",
"display",
"=",
"True",
",",
"html",
"=",
"None",
")",
":",
"# Generate the output",
"if",
"html",
":",
"fmt",
"=",
"\"\"",
"# HTML version",
"fmt",
"+=",
"\"\\n\"",
"fmt",
"+=",
"\"<table>\\n\"",
"fmt",
"+=",
"\"<tr><th>{}... | Return the header stats of this dataset. If in IPython, this will
be formatted to HTML. Otherwise returns a console friendly string | [
"Return",
"the",
"header",
"stats",
"of",
"this",
"dataset",
".",
"If",
"in",
"IPython",
"this",
"will",
"be",
"formatted",
"to",
"HTML",
".",
"Otherwise",
"returns",
"a",
"console",
"friendly",
"string"
] | 5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1 | https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/common.py#L779-L814 |
222,807 | vtkiorg/vtki | vtki/common.py | Common._repr_html_ | def _repr_html_(self):
"""A pretty representation for Jupyter notebooks that includes header
details and information about all scalar arrays"""
fmt = ""
if self.n_scalars > 0:
fmt += "<table>"
fmt += "<tr><th>Header</th><th>Data Arrays</th></tr>"
fmt +... | python | def _repr_html_(self):
"""A pretty representation for Jupyter notebooks that includes header
details and information about all scalar arrays"""
fmt = ""
if self.n_scalars > 0:
fmt += "<table>"
fmt += "<tr><th>Header</th><th>Data Arrays</th></tr>"
fmt +... | [
"def",
"_repr_html_",
"(",
"self",
")",
":",
"fmt",
"=",
"\"\"",
"if",
"self",
".",
"n_scalars",
">",
"0",
":",
"fmt",
"+=",
"\"<table>\"",
"fmt",
"+=",
"\"<tr><th>Header</th><th>Data Arrays</th></tr>\"",
"fmt",
"+=",
"\"<tr><td>\"",
"# Get the header info",
"fmt"... | A pretty representation for Jupyter notebooks that includes header
details and information about all scalar arrays | [
"A",
"pretty",
"representation",
"for",
"Jupyter",
"notebooks",
"that",
"includes",
"header",
"details",
"and",
"information",
"about",
"all",
"scalar",
"arrays"
] | 5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1 | https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/common.py#L817-L853 |
222,808 | vtkiorg/vtki | vtki/common.py | Common.overwrite | def overwrite(self, mesh):
"""
Overwrites this mesh inplace with the new mesh's geometries and data
Parameters
----------
mesh : vtk.vtkDataSet
The overwriting mesh.
"""
self.DeepCopy(mesh)
if is_vtki_obj(mesh):
self.copy_meta_fro... | python | def overwrite(self, mesh):
"""
Overwrites this mesh inplace with the new mesh's geometries and data
Parameters
----------
mesh : vtk.vtkDataSet
The overwriting mesh.
"""
self.DeepCopy(mesh)
if is_vtki_obj(mesh):
self.copy_meta_fro... | [
"def",
"overwrite",
"(",
"self",
",",
"mesh",
")",
":",
"self",
".",
"DeepCopy",
"(",
"mesh",
")",
"if",
"is_vtki_obj",
"(",
"mesh",
")",
":",
"self",
".",
"copy_meta_from",
"(",
"mesh",
")"
] | Overwrites this mesh inplace with the new mesh's geometries and data
Parameters
----------
mesh : vtk.vtkDataSet
The overwriting mesh. | [
"Overwrites",
"this",
"mesh",
"inplace",
"with",
"the",
"new",
"mesh",
"s",
"geometries",
"and",
"data"
] | 5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1 | https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/common.py#L864-L876 |
222,809 | vtkiorg/vtki | vtki/common.py | _ScalarsDict.pop | def pop(self, key):
"""Get and remove an element by key name"""
arr = dict.pop(self, key).copy()
self.remover(key)
return arr | python | def pop(self, key):
"""Get and remove an element by key name"""
arr = dict.pop(self, key).copy()
self.remover(key)
return arr | [
"def",
"pop",
"(",
"self",
",",
"key",
")",
":",
"arr",
"=",
"dict",
".",
"pop",
"(",
"self",
",",
"key",
")",
".",
"copy",
"(",
")",
"self",
".",
"remover",
"(",
"key",
")",
"return",
"arr"
] | Get and remove an element by key name | [
"Get",
"and",
"remove",
"an",
"element",
"by",
"key",
"name"
] | 5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1 | https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/common.py#L901-L905 |
222,810 | vtkiorg/vtki | vtki/common.py | _ScalarsDict.update | def update(self, data):
"""
Update this dictionary with th key-value pairs from a given
dictionary
"""
if not isinstance(data, dict):
raise TypeError('Data to update must be in a dictionary.')
for k, v in data.items():
arr = np.array(v)
... | python | def update(self, data):
"""
Update this dictionary with th key-value pairs from a given
dictionary
"""
if not isinstance(data, dict):
raise TypeError('Data to update must be in a dictionary.')
for k, v in data.items():
arr = np.array(v)
... | [
"def",
"update",
"(",
"self",
",",
"data",
")",
":",
"if",
"not",
"isinstance",
"(",
"data",
",",
"dict",
")",
":",
"raise",
"TypeError",
"(",
"'Data to update must be in a dictionary.'",
")",
"for",
"k",
",",
"v",
"in",
"data",
".",
"items",
"(",
")",
... | Update this dictionary with th key-value pairs from a given
dictionary | [
"Update",
"this",
"dictionary",
"with",
"th",
"key",
"-",
"value",
"pairs",
"from",
"a",
"given",
"dictionary"
] | 5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1 | https://github.com/vtkiorg/vtki/blob/5ccad7ae6d64a03e9594c9c7474c8aab3eb22dd1/vtki/common.py#L907-L920 |
222,811 | chardet/chardet | convert_language_model.py | convert_sbcs_model | def convert_sbcs_model(old_model, alphabet):
"""Create a SingleByteCharSetModel object representing the charset."""
# Setup tables necessary for computing transition frequencies for model
char_to_order = {i: order
for i, order in enumerate(old_model['char_to_order_map'])}
pos_ratio ... | python | def convert_sbcs_model(old_model, alphabet):
"""Create a SingleByteCharSetModel object representing the charset."""
# Setup tables necessary for computing transition frequencies for model
char_to_order = {i: order
for i, order in enumerate(old_model['char_to_order_map'])}
pos_ratio ... | [
"def",
"convert_sbcs_model",
"(",
"old_model",
",",
"alphabet",
")",
":",
"# Setup tables necessary for computing transition frequencies for model",
"char_to_order",
"=",
"{",
"i",
":",
"order",
"for",
"i",
",",
"order",
"in",
"enumerate",
"(",
"old_model",
"[",
"'cha... | Create a SingleByteCharSetModel object representing the charset. | [
"Create",
"a",
"SingleByteCharSetModel",
"object",
"representing",
"the",
"charset",
"."
] | b5194bf8250b7d180ac4edff51e09cab9d99febe | https://github.com/chardet/chardet/blob/b5194bf8250b7d180ac4edff51e09cab9d99febe/convert_language_model.py#L57-L73 |
222,812 | chardet/chardet | bench.py | get_py_impl | def get_py_impl():
"""Return what kind of Python this is"""
if hasattr(sys, 'pypy_version_info'):
pyimpl = 'PyPy'
elif sys.platform.startswith('java'):
pyimpl = 'Jython'
elif sys.platform == 'cli':
pyimpl = 'IronPython'
else:
pyimpl = 'CPython'
return pyimpl | python | def get_py_impl():
"""Return what kind of Python this is"""
if hasattr(sys, 'pypy_version_info'):
pyimpl = 'PyPy'
elif sys.platform.startswith('java'):
pyimpl = 'Jython'
elif sys.platform == 'cli':
pyimpl = 'IronPython'
else:
pyimpl = 'CPython'
return pyimpl | [
"def",
"get_py_impl",
"(",
")",
":",
"if",
"hasattr",
"(",
"sys",
",",
"'pypy_version_info'",
")",
":",
"pyimpl",
"=",
"'PyPy'",
"elif",
"sys",
".",
"platform",
".",
"startswith",
"(",
"'java'",
")",
":",
"pyimpl",
"=",
"'Jython'",
"elif",
"sys",
".",
... | Return what kind of Python this is | [
"Return",
"what",
"kind",
"of",
"Python",
"this",
"is"
] | b5194bf8250b7d180ac4edff51e09cab9d99febe | https://github.com/chardet/chardet/blob/b5194bf8250b7d180ac4edff51e09cab9d99febe/bench.py#L36-L46 |
222,813 | chardet/chardet | chardet/__init__.py | detect_all | def detect_all(byte_str):
"""
Detect all the possible encodings of the given byte string.
:param byte_str: The byte sequence to examine.
:type byte_str: ``bytes`` or ``bytearray``
"""
if not isinstance(byte_str, bytearray):
if not isinstance(byte_str, bytes):
raise ... | python | def detect_all(byte_str):
"""
Detect all the possible encodings of the given byte string.
:param byte_str: The byte sequence to examine.
:type byte_str: ``bytes`` or ``bytearray``
"""
if not isinstance(byte_str, bytearray):
if not isinstance(byte_str, bytes):
raise ... | [
"def",
"detect_all",
"(",
"byte_str",
")",
":",
"if",
"not",
"isinstance",
"(",
"byte_str",
",",
"bytearray",
")",
":",
"if",
"not",
"isinstance",
"(",
"byte_str",
",",
"bytes",
")",
":",
"raise",
"TypeError",
"(",
"'Expected object of type bytes or bytearray, g... | Detect all the possible encodings of the given byte string.
:param byte_str: The byte sequence to examine.
:type byte_str: ``bytes`` or ``bytearray`` | [
"Detect",
"all",
"the",
"possible",
"encodings",
"of",
"the",
"given",
"byte",
"string",
"."
] | b5194bf8250b7d180ac4edff51e09cab9d99febe | https://github.com/chardet/chardet/blob/b5194bf8250b7d180ac4edff51e09cab9d99febe/chardet/__init__.py#L45-L82 |
222,814 | sentinelsat/sentinelsat | sentinelsat/sentinel.py | geojson_to_wkt | def geojson_to_wkt(geojson_obj, feature_number=0, decimals=4):
"""Convert a GeoJSON object to Well-Known Text. Intended for use with OpenSearch queries.
In case of FeatureCollection, only one of the features is used (the first by default).
3D points are converted to 2D.
Parameters
----------
g... | python | def geojson_to_wkt(geojson_obj, feature_number=0, decimals=4):
"""Convert a GeoJSON object to Well-Known Text. Intended for use with OpenSearch queries.
In case of FeatureCollection, only one of the features is used (the first by default).
3D points are converted to 2D.
Parameters
----------
g... | [
"def",
"geojson_to_wkt",
"(",
"geojson_obj",
",",
"feature_number",
"=",
"0",
",",
"decimals",
"=",
"4",
")",
":",
"if",
"'coordinates'",
"in",
"geojson_obj",
":",
"geometry",
"=",
"geojson_obj",
"elif",
"'geometry'",
"in",
"geojson_obj",
":",
"geometry",
"=",... | Convert a GeoJSON object to Well-Known Text. Intended for use with OpenSearch queries.
In case of FeatureCollection, only one of the features is used (the first by default).
3D points are converted to 2D.
Parameters
----------
geojson_obj : dict
a GeoJSON object
feature_number : int, o... | [
"Convert",
"a",
"GeoJSON",
"object",
"to",
"Well",
"-",
"Known",
"Text",
".",
"Intended",
"for",
"use",
"with",
"OpenSearch",
"queries",
"."
] | eacfd79ff4e7e939147db9dfdd393c67d64eecaa | https://github.com/sentinelsat/sentinelsat/blob/eacfd79ff4e7e939147db9dfdd393c67d64eecaa/sentinelsat/sentinel.py#L889-L940 |
222,815 | sentinelsat/sentinelsat | sentinelsat/sentinel.py | _check_scihub_response | def _check_scihub_response(response, test_json=True):
"""Check that the response from server has status code 2xx and that the response is valid JSON.
"""
# Prevent requests from needing to guess the encoding
# SciHub appears to be using UTF-8 in all of their responses
response.encoding = 'utf-8'
... | python | def _check_scihub_response(response, test_json=True):
"""Check that the response from server has status code 2xx and that the response is valid JSON.
"""
# Prevent requests from needing to guess the encoding
# SciHub appears to be using UTF-8 in all of their responses
response.encoding = 'utf-8'
... | [
"def",
"_check_scihub_response",
"(",
"response",
",",
"test_json",
"=",
"True",
")",
":",
"# Prevent requests from needing to guess the encoding",
"# SciHub appears to be using UTF-8 in all of their responses",
"response",
".",
"encoding",
"=",
"'utf-8'",
"try",
":",
"response... | Check that the response from server has status code 2xx and that the response is valid JSON. | [
"Check",
"that",
"the",
"response",
"from",
"server",
"has",
"status",
"code",
"2xx",
"and",
"that",
"the",
"response",
"is",
"valid",
"JSON",
"."
] | eacfd79ff4e7e939147db9dfdd393c67d64eecaa | https://github.com/sentinelsat/sentinelsat/blob/eacfd79ff4e7e939147db9dfdd393c67d64eecaa/sentinelsat/sentinel.py#L997-L1027 |
222,816 | sentinelsat/sentinelsat | sentinelsat/sentinel.py | _parse_odata_timestamp | def _parse_odata_timestamp(in_date):
"""Convert the timestamp received from OData JSON API to a datetime object.
"""
timestamp = int(in_date.replace('/Date(', '').replace(')/', ''))
seconds = timestamp // 1000
ms = timestamp % 1000
return datetime.utcfromtimestamp(seconds) + timedelta(millisecon... | python | def _parse_odata_timestamp(in_date):
"""Convert the timestamp received from OData JSON API to a datetime object.
"""
timestamp = int(in_date.replace('/Date(', '').replace(')/', ''))
seconds = timestamp // 1000
ms = timestamp % 1000
return datetime.utcfromtimestamp(seconds) + timedelta(millisecon... | [
"def",
"_parse_odata_timestamp",
"(",
"in_date",
")",
":",
"timestamp",
"=",
"int",
"(",
"in_date",
".",
"replace",
"(",
"'/Date('",
",",
"''",
")",
".",
"replace",
"(",
"')/'",
",",
"''",
")",
")",
"seconds",
"=",
"timestamp",
"//",
"1000",
"ms",
"=",... | Convert the timestamp received from OData JSON API to a datetime object. | [
"Convert",
"the",
"timestamp",
"received",
"from",
"OData",
"JSON",
"API",
"to",
"a",
"datetime",
"object",
"."
] | eacfd79ff4e7e939147db9dfdd393c67d64eecaa | https://github.com/sentinelsat/sentinelsat/blob/eacfd79ff4e7e939147db9dfdd393c67d64eecaa/sentinelsat/sentinel.py#L1066-L1072 |
222,817 | sentinelsat/sentinelsat | sentinelsat/sentinel.py | _parse_opensearch_response | def _parse_opensearch_response(products):
"""Convert a query response to a dictionary.
The resulting dictionary structure is {<product id>: {<property>: <value>}}.
The property values are converted to their respective Python types unless `parse_values`
is set to `False`.
"""
converters = {'dat... | python | def _parse_opensearch_response(products):
"""Convert a query response to a dictionary.
The resulting dictionary structure is {<product id>: {<property>: <value>}}.
The property values are converted to their respective Python types unless `parse_values`
is set to `False`.
"""
converters = {'dat... | [
"def",
"_parse_opensearch_response",
"(",
"products",
")",
":",
"converters",
"=",
"{",
"'date'",
":",
"_parse_iso_date",
",",
"'int'",
":",
"int",
",",
"'long'",
":",
"int",
",",
"'float'",
":",
"float",
",",
"'double'",
":",
"float",
"}",
"# Keep the strin... | Convert a query response to a dictionary.
The resulting dictionary structure is {<product id>: {<property>: <value>}}.
The property values are converted to their respective Python types unless `parse_values`
is set to `False`. | [
"Convert",
"a",
"query",
"response",
"to",
"a",
"dictionary",
"."
] | eacfd79ff4e7e939147db9dfdd393c67d64eecaa | https://github.com/sentinelsat/sentinelsat/blob/eacfd79ff4e7e939147db9dfdd393c67d64eecaa/sentinelsat/sentinel.py#L1075-L1116 |
222,818 | sentinelsat/sentinelsat | sentinelsat/sentinel.py | SentinelAPI.query | def query(self, area=None, date=None, raw=None, area_relation='Intersects',
order_by=None, limit=None, offset=0, **keywords):
"""Query the OpenSearch API with the coordinates of an area, a date interval
and any other search keywords accepted by the API.
Parameters
--------... | python | def query(self, area=None, date=None, raw=None, area_relation='Intersects',
order_by=None, limit=None, offset=0, **keywords):
"""Query the OpenSearch API with the coordinates of an area, a date interval
and any other search keywords accepted by the API.
Parameters
--------... | [
"def",
"query",
"(",
"self",
",",
"area",
"=",
"None",
",",
"date",
"=",
"None",
",",
"raw",
"=",
"None",
",",
"area_relation",
"=",
"'Intersects'",
",",
"order_by",
"=",
"None",
",",
"limit",
"=",
"None",
",",
"offset",
"=",
"0",
",",
"*",
"*",
... | Query the OpenSearch API with the coordinates of an area, a date interval
and any other search keywords accepted by the API.
Parameters
----------
area : str, optional
The area of interest formatted as a Well-Known Text string.
date : tuple of (str or datetime) or st... | [
"Query",
"the",
"OpenSearch",
"API",
"with",
"the",
"coordinates",
"of",
"an",
"area",
"a",
"date",
"interval",
"and",
"any",
"other",
"search",
"keywords",
"accepted",
"by",
"the",
"API",
"."
] | eacfd79ff4e7e939147db9dfdd393c67d64eecaa | https://github.com/sentinelsat/sentinelsat/blob/eacfd79ff4e7e939147db9dfdd393c67d64eecaa/sentinelsat/sentinel.py#L77-L149 |
222,819 | sentinelsat/sentinelsat | sentinelsat/sentinel.py | SentinelAPI.format_query | def format_query(area=None, date=None, raw=None, area_relation='Intersects',
**keywords):
"""Create a OpenSearch API query string.
"""
if area_relation.lower() not in {"intersects", "contains", "iswithin"}:
raise ValueError("Incorrect AOI relation provided ({})".... | python | def format_query(area=None, date=None, raw=None, area_relation='Intersects',
**keywords):
"""Create a OpenSearch API query string.
"""
if area_relation.lower() not in {"intersects", "contains", "iswithin"}:
raise ValueError("Incorrect AOI relation provided ({})".... | [
"def",
"format_query",
"(",
"area",
"=",
"None",
",",
"date",
"=",
"None",
",",
"raw",
"=",
"None",
",",
"area_relation",
"=",
"'Intersects'",
",",
"*",
"*",
"keywords",
")",
":",
"if",
"area_relation",
".",
"lower",
"(",
")",
"not",
"in",
"{",
"\"in... | Create a OpenSearch API query string. | [
"Create",
"a",
"OpenSearch",
"API",
"query",
"string",
"."
] | eacfd79ff4e7e939147db9dfdd393c67d64eecaa | https://github.com/sentinelsat/sentinelsat/blob/eacfd79ff4e7e939147db9dfdd393c67d64eecaa/sentinelsat/sentinel.py#L152-L214 |
222,820 | sentinelsat/sentinelsat | sentinelsat/sentinel.py | SentinelAPI.count | def count(self, area=None, date=None, raw=None, area_relation='Intersects', **keywords):
"""Get the number of products matching a query.
Accepted parameters are identical to :meth:`SentinelAPI.query()`.
This is a significantly more efficient alternative to doing `len(api.query())`,
whi... | python | def count(self, area=None, date=None, raw=None, area_relation='Intersects', **keywords):
"""Get the number of products matching a query.
Accepted parameters are identical to :meth:`SentinelAPI.query()`.
This is a significantly more efficient alternative to doing `len(api.query())`,
whi... | [
"def",
"count",
"(",
"self",
",",
"area",
"=",
"None",
",",
"date",
"=",
"None",
",",
"raw",
"=",
"None",
",",
"area_relation",
"=",
"'Intersects'",
",",
"*",
"*",
"keywords",
")",
":",
"for",
"kw",
"in",
"[",
"'order_by'",
",",
"'limit'",
",",
"'o... | Get the number of products matching a query.
Accepted parameters are identical to :meth:`SentinelAPI.query()`.
This is a significantly more efficient alternative to doing `len(api.query())`,
which can take minutes to run for queries matching thousands of products.
Returns
----... | [
"Get",
"the",
"number",
"of",
"products",
"matching",
"a",
"query",
"."
] | eacfd79ff4e7e939147db9dfdd393c67d64eecaa | https://github.com/sentinelsat/sentinelsat/blob/eacfd79ff4e7e939147db9dfdd393c67d64eecaa/sentinelsat/sentinel.py#L249-L269 |
222,821 | sentinelsat/sentinelsat | sentinelsat/sentinel.py | SentinelAPI.to_geojson | def to_geojson(products):
"""Return the products from a query response as a GeoJSON with the values in their
appropriate Python types.
"""
feature_list = []
for i, (product_id, props) in enumerate(products.items()):
props = props.copy()
props['id'] = produ... | python | def to_geojson(products):
"""Return the products from a query response as a GeoJSON with the values in their
appropriate Python types.
"""
feature_list = []
for i, (product_id, props) in enumerate(products.items()):
props = props.copy()
props['id'] = produ... | [
"def",
"to_geojson",
"(",
"products",
")",
":",
"feature_list",
"=",
"[",
"]",
"for",
"i",
",",
"(",
"product_id",
",",
"props",
")",
"in",
"enumerate",
"(",
"products",
".",
"items",
"(",
")",
")",
":",
"props",
"=",
"props",
".",
"copy",
"(",
")"... | Return the products from a query response as a GeoJSON with the values in their
appropriate Python types. | [
"Return",
"the",
"products",
"from",
"a",
"query",
"response",
"as",
"a",
"GeoJSON",
"with",
"the",
"values",
"in",
"their",
"appropriate",
"Python",
"types",
"."
] | eacfd79ff4e7e939147db9dfdd393c67d64eecaa | https://github.com/sentinelsat/sentinelsat/blob/eacfd79ff4e7e939147db9dfdd393c67d64eecaa/sentinelsat/sentinel.py#L340-L358 |
222,822 | sentinelsat/sentinelsat | sentinelsat/sentinel.py | SentinelAPI.to_dataframe | def to_dataframe(products):
"""Return the products from a query response as a Pandas DataFrame
with the values in their appropriate Python types.
"""
try:
import pandas as pd
except ImportError:
raise ImportError("to_dataframe requires the optional depende... | python | def to_dataframe(products):
"""Return the products from a query response as a Pandas DataFrame
with the values in their appropriate Python types.
"""
try:
import pandas as pd
except ImportError:
raise ImportError("to_dataframe requires the optional depende... | [
"def",
"to_dataframe",
"(",
"products",
")",
":",
"try",
":",
"import",
"pandas",
"as",
"pd",
"except",
"ImportError",
":",
"raise",
"ImportError",
"(",
"\"to_dataframe requires the optional dependency Pandas.\"",
")",
"return",
"pd",
".",
"DataFrame",
".",
"from_di... | Return the products from a query response as a Pandas DataFrame
with the values in their appropriate Python types. | [
"Return",
"the",
"products",
"from",
"a",
"query",
"response",
"as",
"a",
"Pandas",
"DataFrame",
"with",
"the",
"values",
"in",
"their",
"appropriate",
"Python",
"types",
"."
] | eacfd79ff4e7e939147db9dfdd393c67d64eecaa | https://github.com/sentinelsat/sentinelsat/blob/eacfd79ff4e7e939147db9dfdd393c67d64eecaa/sentinelsat/sentinel.py#L361-L370 |
222,823 | sentinelsat/sentinelsat | sentinelsat/sentinel.py | SentinelAPI.to_geodataframe | def to_geodataframe(products):
"""Return the products from a query response as a GeoPandas GeoDataFrame
with the values in their appropriate Python types.
"""
try:
import geopandas as gpd
import shapely.wkt
except ImportError:
raise ImportError... | python | def to_geodataframe(products):
"""Return the products from a query response as a GeoPandas GeoDataFrame
with the values in their appropriate Python types.
"""
try:
import geopandas as gpd
import shapely.wkt
except ImportError:
raise ImportError... | [
"def",
"to_geodataframe",
"(",
"products",
")",
":",
"try",
":",
"import",
"geopandas",
"as",
"gpd",
"import",
"shapely",
".",
"wkt",
"except",
"ImportError",
":",
"raise",
"ImportError",
"(",
"\"to_geodataframe requires the optional dependencies GeoPandas and Shapely.\""... | Return the products from a query response as a GeoPandas GeoDataFrame
with the values in their appropriate Python types. | [
"Return",
"the",
"products",
"from",
"a",
"query",
"response",
"as",
"a",
"GeoPandas",
"GeoDataFrame",
"with",
"the",
"values",
"in",
"their",
"appropriate",
"Python",
"types",
"."
] | eacfd79ff4e7e939147db9dfdd393c67d64eecaa | https://github.com/sentinelsat/sentinelsat/blob/eacfd79ff4e7e939147db9dfdd393c67d64eecaa/sentinelsat/sentinel.py#L373-L391 |
222,824 | sentinelsat/sentinelsat | sentinelsat/sentinel.py | SentinelAPI.get_product_odata | def get_product_odata(self, id, full=False):
"""Access OData API to get info about a product.
Returns a dict containing the id, title, size, md5sum, date, footprint and download url
of the product. The date field corresponds to the Start ContentDate value.
If `full` is set to True, the... | python | def get_product_odata(self, id, full=False):
"""Access OData API to get info about a product.
Returns a dict containing the id, title, size, md5sum, date, footprint and download url
of the product. The date field corresponds to the Start ContentDate value.
If `full` is set to True, the... | [
"def",
"get_product_odata",
"(",
"self",
",",
"id",
",",
"full",
"=",
"False",
")",
":",
"url",
"=",
"urljoin",
"(",
"self",
".",
"api_url",
",",
"u\"odata/v1/Products('{}')?$format=json\"",
".",
"format",
"(",
"id",
")",
")",
"if",
"full",
":",
"url",
"... | Access OData API to get info about a product.
Returns a dict containing the id, title, size, md5sum, date, footprint and download url
of the product. The date field corresponds to the Start ContentDate value.
If `full` is set to True, then the full, detailed metadata of the product is returned... | [
"Access",
"OData",
"API",
"to",
"get",
"info",
"about",
"a",
"product",
"."
] | eacfd79ff4e7e939147db9dfdd393c67d64eecaa | https://github.com/sentinelsat/sentinelsat/blob/eacfd79ff4e7e939147db9dfdd393c67d64eecaa/sentinelsat/sentinel.py#L393-L429 |
222,825 | sentinelsat/sentinelsat | sentinelsat/sentinel.py | SentinelAPI._trigger_offline_retrieval | def _trigger_offline_retrieval(self, url):
""" Triggers retrieval of an offline product
Trying to download an offline product triggers its retrieval from the long term archive.
The returned HTTP status code conveys whether this was successful.
Parameters
----------
url ... | python | def _trigger_offline_retrieval(self, url):
""" Triggers retrieval of an offline product
Trying to download an offline product triggers its retrieval from the long term archive.
The returned HTTP status code conveys whether this was successful.
Parameters
----------
url ... | [
"def",
"_trigger_offline_retrieval",
"(",
"self",
",",
"url",
")",
":",
"with",
"self",
".",
"session",
".",
"get",
"(",
"url",
",",
"auth",
"=",
"self",
".",
"session",
".",
"auth",
",",
"timeout",
"=",
"self",
".",
"timeout",
")",
"as",
"r",
":",
... | Triggers retrieval of an offline product
Trying to download an offline product triggers its retrieval from the long term archive.
The returned HTTP status code conveys whether this was successful.
Parameters
----------
url : string
URL for downloading the product
... | [
"Triggers",
"retrieval",
"of",
"an",
"offline",
"product"
] | eacfd79ff4e7e939147db9dfdd393c67d64eecaa | https://github.com/sentinelsat/sentinelsat/blob/eacfd79ff4e7e939147db9dfdd393c67d64eecaa/sentinelsat/sentinel.py#L431-L461 |
222,826 | sentinelsat/sentinelsat | sentinelsat/sentinel.py | SentinelAPI.download | def download(self, id, directory_path='.', checksum=True):
"""Download a product.
Uses the filename on the server for the downloaded file, e.g.
"S1A_EW_GRDH_1SDH_20141003T003840_20141003T003920_002658_002F54_4DD1.zip".
Incomplete downloads are continued and complete files are skipped.
... | python | def download(self, id, directory_path='.', checksum=True):
"""Download a product.
Uses the filename on the server for the downloaded file, e.g.
"S1A_EW_GRDH_1SDH_20141003T003840_20141003T003920_002658_002F54_4DD1.zip".
Incomplete downloads are continued and complete files are skipped.
... | [
"def",
"download",
"(",
"self",
",",
"id",
",",
"directory_path",
"=",
"'.'",
",",
"checksum",
"=",
"True",
")",
":",
"product_info",
"=",
"self",
".",
"get_product_odata",
"(",
"id",
")",
"path",
"=",
"join",
"(",
"directory_path",
",",
"product_info",
... | Download a product.
Uses the filename on the server for the downloaded file, e.g.
"S1A_EW_GRDH_1SDH_20141003T003840_20141003T003920_002658_002F54_4DD1.zip".
Incomplete downloads are continued and complete files are skipped.
Parameters
----------
id : string
... | [
"Download",
"a",
"product",
"."
] | eacfd79ff4e7e939147db9dfdd393c67d64eecaa | https://github.com/sentinelsat/sentinelsat/blob/eacfd79ff4e7e939147db9dfdd393c67d64eecaa/sentinelsat/sentinel.py#L463-L552 |
222,827 | sentinelsat/sentinelsat | sentinelsat/sentinel.py | SentinelAPI.download_all | def download_all(self, products, directory_path='.', max_attempts=10, checksum=True):
"""Download a list of products.
Takes a list of product IDs as input. This means that the return value of query() can be
passed directly to this method.
File names on the server are used for the downl... | python | def download_all(self, products, directory_path='.', max_attempts=10, checksum=True):
"""Download a list of products.
Takes a list of product IDs as input. This means that the return value of query() can be
passed directly to this method.
File names on the server are used for the downl... | [
"def",
"download_all",
"(",
"self",
",",
"products",
",",
"directory_path",
"=",
"'.'",
",",
"max_attempts",
"=",
"10",
",",
"checksum",
"=",
"True",
")",
":",
"product_ids",
"=",
"list",
"(",
"products",
")",
"self",
".",
"logger",
".",
"info",
"(",
"... | Download a list of products.
Takes a list of product IDs as input. This means that the return value of query() can be
passed directly to this method.
File names on the server are used for the downloaded files, e.g.
"S1A_EW_GRDH_1SDH_20141003T003840_20141003T003920_002658_002F54_4DD1.zi... | [
"Download",
"a",
"list",
"of",
"products",
"."
] | eacfd79ff4e7e939147db9dfdd393c67d64eecaa | https://github.com/sentinelsat/sentinelsat/blob/eacfd79ff4e7e939147db9dfdd393c67d64eecaa/sentinelsat/sentinel.py#L554-L627 |
222,828 | sentinelsat/sentinelsat | sentinelsat/sentinel.py | SentinelAPI.get_products_size | def get_products_size(products):
"""Return the total file size in GB of all products in the OpenSearch response."""
size_total = 0
for title, props in products.items():
size_product = props["size"]
size_value = float(size_product.split(" ")[0])
size_unit = str... | python | def get_products_size(products):
"""Return the total file size in GB of all products in the OpenSearch response."""
size_total = 0
for title, props in products.items():
size_product = props["size"]
size_value = float(size_product.split(" ")[0])
size_unit = str... | [
"def",
"get_products_size",
"(",
"products",
")",
":",
"size_total",
"=",
"0",
"for",
"title",
",",
"props",
"in",
"products",
".",
"items",
"(",
")",
":",
"size_product",
"=",
"props",
"[",
"\"size\"",
"]",
"size_value",
"=",
"float",
"(",
"size_product",... | Return the total file size in GB of all products in the OpenSearch response. | [
"Return",
"the",
"total",
"file",
"size",
"in",
"GB",
"of",
"all",
"products",
"in",
"the",
"OpenSearch",
"response",
"."
] | eacfd79ff4e7e939147db9dfdd393c67d64eecaa | https://github.com/sentinelsat/sentinelsat/blob/eacfd79ff4e7e939147db9dfdd393c67d64eecaa/sentinelsat/sentinel.py#L630-L642 |
222,829 | sentinelsat/sentinelsat | sentinelsat/sentinel.py | SentinelAPI.check_files | def check_files(self, paths=None, ids=None, directory=None, delete=False):
"""Verify the integrity of product files on disk.
Integrity is checked by comparing the size and checksum of the file with the respective
values on the server.
The input can be a list of products to check or a l... | python | def check_files(self, paths=None, ids=None, directory=None, delete=False):
"""Verify the integrity of product files on disk.
Integrity is checked by comparing the size and checksum of the file with the respective
values on the server.
The input can be a list of products to check or a l... | [
"def",
"check_files",
"(",
"self",
",",
"paths",
"=",
"None",
",",
"ids",
"=",
"None",
",",
"directory",
"=",
"None",
",",
"delete",
"=",
"False",
")",
":",
"if",
"not",
"ids",
"and",
"not",
"paths",
":",
"raise",
"ValueError",
"(",
"\"Must provide eit... | Verify the integrity of product files on disk.
Integrity is checked by comparing the size and checksum of the file with the respective
values on the server.
The input can be a list of products to check or a list of IDs and a directory.
In cases where multiple products with different I... | [
"Verify",
"the",
"integrity",
"of",
"product",
"files",
"on",
"disk",
"."
] | eacfd79ff4e7e939147db9dfdd393c67d64eecaa | https://github.com/sentinelsat/sentinelsat/blob/eacfd79ff4e7e939147db9dfdd393c67d64eecaa/sentinelsat/sentinel.py#L702-L793 |
222,830 | sentinelsat/sentinelsat | sentinelsat/sentinel.py | SentinelAPI._md5_compare | def _md5_compare(self, file_path, checksum, block_size=2 ** 13):
"""Compare a given MD5 checksum with one calculated from a file."""
with closing(self._tqdm(desc="MD5 checksumming", total=getsize(file_path), unit="B",
unit_scale=True)) as progress:
md5 = hashl... | python | def _md5_compare(self, file_path, checksum, block_size=2 ** 13):
"""Compare a given MD5 checksum with one calculated from a file."""
with closing(self._tqdm(desc="MD5 checksumming", total=getsize(file_path), unit="B",
unit_scale=True)) as progress:
md5 = hashl... | [
"def",
"_md5_compare",
"(",
"self",
",",
"file_path",
",",
"checksum",
",",
"block_size",
"=",
"2",
"**",
"13",
")",
":",
"with",
"closing",
"(",
"self",
".",
"_tqdm",
"(",
"desc",
"=",
"\"MD5 checksumming\"",
",",
"total",
"=",
"getsize",
"(",
"file_pat... | Compare a given MD5 checksum with one calculated from a file. | [
"Compare",
"a",
"given",
"MD5",
"checksum",
"with",
"one",
"calculated",
"from",
"a",
"file",
"."
] | eacfd79ff4e7e939147db9dfdd393c67d64eecaa | https://github.com/sentinelsat/sentinelsat/blob/eacfd79ff4e7e939147db9dfdd393c67d64eecaa/sentinelsat/sentinel.py#L795-L807 |
222,831 | celery/django-celery | djcelery/managers.py | transaction_retry | def transaction_retry(max_retries=1):
"""Decorator for methods doing database operations.
If the database operation fails, it will retry the operation
at most ``max_retries`` times.
"""
def _outer(fun):
@wraps(fun)
def _inner(*args, **kwargs):
_max_retries = kwargs.pop... | python | def transaction_retry(max_retries=1):
"""Decorator for methods doing database operations.
If the database operation fails, it will retry the operation
at most ``max_retries`` times.
"""
def _outer(fun):
@wraps(fun)
def _inner(*args, **kwargs):
_max_retries = kwargs.pop... | [
"def",
"transaction_retry",
"(",
"max_retries",
"=",
"1",
")",
":",
"def",
"_outer",
"(",
"fun",
")",
":",
"@",
"wraps",
"(",
"fun",
")",
"def",
"_inner",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_max_retries",
"=",
"kwargs",
".",
"pop... | Decorator for methods doing database operations.
If the database operation fails, it will retry the operation
at most ``max_retries`` times. | [
"Decorator",
"for",
"methods",
"doing",
"database",
"operations",
"."
] | 5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef | https://github.com/celery/django-celery/blob/5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef/djcelery/managers.py#L31-L60 |
222,832 | celery/django-celery | djcelery/managers.py | ResultManager.delete_expired | def delete_expired(self, expires):
"""Delete all expired taskset results."""
meta = self.model._meta
with commit_on_success():
self.get_all_expired(expires).update(hidden=True)
cursor = self.connection_for_write().cursor()
cursor.execute(
'DELE... | python | def delete_expired(self, expires):
"""Delete all expired taskset results."""
meta = self.model._meta
with commit_on_success():
self.get_all_expired(expires).update(hidden=True)
cursor = self.connection_for_write().cursor()
cursor.execute(
'DELE... | [
"def",
"delete_expired",
"(",
"self",
",",
"expires",
")",
":",
"meta",
"=",
"self",
".",
"model",
".",
"_meta",
"with",
"commit_on_success",
"(",
")",
":",
"self",
".",
"get_all_expired",
"(",
"expires",
")",
".",
"update",
"(",
"hidden",
"=",
"True",
... | Delete all expired taskset results. | [
"Delete",
"all",
"expired",
"taskset",
"results",
"."
] | 5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef | https://github.com/celery/django-celery/blob/5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef/djcelery/managers.py#L115-L124 |
222,833 | celery/django-celery | djcelery/managers.py | TaskManager.get_task | def get_task(self, task_id):
"""Get task meta for task by ``task_id``.
:keyword exception_retry_count: How many times to retry by
transaction rollback on exception. This could theoretically
happen in a race condition if another worker is trying to
create the same tas... | python | def get_task(self, task_id):
"""Get task meta for task by ``task_id``.
:keyword exception_retry_count: How many times to retry by
transaction rollback on exception. This could theoretically
happen in a race condition if another worker is trying to
create the same tas... | [
"def",
"get_task",
"(",
"self",
",",
"task_id",
")",
":",
"try",
":",
"return",
"self",
".",
"get",
"(",
"task_id",
"=",
"task_id",
")",
"except",
"self",
".",
"model",
".",
"DoesNotExist",
":",
"if",
"self",
".",
"_last_id",
"==",
"task_id",
":",
"s... | Get task meta for task by ``task_id``.
:keyword exception_retry_count: How many times to retry by
transaction rollback on exception. This could theoretically
happen in a race condition if another worker is trying to
create the same task. The default is to retry once. | [
"Get",
"task",
"meta",
"for",
"task",
"by",
"task_id",
"."
] | 5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef | https://github.com/celery/django-celery/blob/5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef/djcelery/managers.py#L140-L155 |
222,834 | celery/django-celery | djcelery/managers.py | TaskManager.store_result | def store_result(self, task_id, result, status,
traceback=None, children=None):
"""Store the result and status of a task.
:param task_id: task id
:param result: The return value of the task, or an exception
instance raised by the task.
:param status: T... | python | def store_result(self, task_id, result, status,
traceback=None, children=None):
"""Store the result and status of a task.
:param task_id: task id
:param result: The return value of the task, or an exception
instance raised by the task.
:param status: T... | [
"def",
"store_result",
"(",
"self",
",",
"task_id",
",",
"result",
",",
"status",
",",
"traceback",
"=",
"None",
",",
"children",
"=",
"None",
")",
":",
"return",
"self",
".",
"update_or_create",
"(",
"task_id",
"=",
"task_id",
",",
"defaults",
"=",
"{",... | Store the result and status of a task.
:param task_id: task id
:param result: The return value of the task, or an exception
instance raised by the task.
:param status: Task status. See
:meth:`celery.result.AsyncResult.get_status` for a list of
possible stat... | [
"Store",
"the",
"result",
"and",
"status",
"of",
"a",
"task",
"."
] | 5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef | https://github.com/celery/django-celery/blob/5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef/djcelery/managers.py#L158-L187 |
222,835 | celery/django-celery | djcelery/managers.py | TaskSetManager.restore_taskset | def restore_taskset(self, taskset_id):
"""Get the async result instance by taskset id."""
try:
return self.get(taskset_id=taskset_id)
except self.model.DoesNotExist:
pass | python | def restore_taskset(self, taskset_id):
"""Get the async result instance by taskset id."""
try:
return self.get(taskset_id=taskset_id)
except self.model.DoesNotExist:
pass | [
"def",
"restore_taskset",
"(",
"self",
",",
"taskset_id",
")",
":",
"try",
":",
"return",
"self",
".",
"get",
"(",
"taskset_id",
"=",
"taskset_id",
")",
"except",
"self",
".",
"model",
".",
"DoesNotExist",
":",
"pass"
] | Get the async result instance by taskset id. | [
"Get",
"the",
"async",
"result",
"instance",
"by",
"taskset",
"id",
"."
] | 5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef | https://github.com/celery/django-celery/blob/5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef/djcelery/managers.py#L205-L210 |
222,836 | celery/django-celery | djcelery/managers.py | TaskSetManager.delete_taskset | def delete_taskset(self, taskset_id):
"""Delete a saved taskset result."""
s = self.restore_taskset(taskset_id)
if s:
s.delete() | python | def delete_taskset(self, taskset_id):
"""Delete a saved taskset result."""
s = self.restore_taskset(taskset_id)
if s:
s.delete() | [
"def",
"delete_taskset",
"(",
"self",
",",
"taskset_id",
")",
":",
"s",
"=",
"self",
".",
"restore_taskset",
"(",
"taskset_id",
")",
"if",
"s",
":",
"s",
".",
"delete",
"(",
")"
] | Delete a saved taskset result. | [
"Delete",
"a",
"saved",
"taskset",
"result",
"."
] | 5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef | https://github.com/celery/django-celery/blob/5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef/djcelery/managers.py#L212-L216 |
222,837 | celery/django-celery | djcelery/managers.py | TaskSetManager.store_result | def store_result(self, taskset_id, result):
"""Store the async result instance of a taskset.
:param taskset_id: task set id
:param result: The return value of the taskset
"""
return self.update_or_create(taskset_id=taskset_id,
defaults={'re... | python | def store_result(self, taskset_id, result):
"""Store the async result instance of a taskset.
:param taskset_id: task set id
:param result: The return value of the taskset
"""
return self.update_or_create(taskset_id=taskset_id,
defaults={'re... | [
"def",
"store_result",
"(",
"self",
",",
"taskset_id",
",",
"result",
")",
":",
"return",
"self",
".",
"update_or_create",
"(",
"taskset_id",
"=",
"taskset_id",
",",
"defaults",
"=",
"{",
"'result'",
":",
"result",
"}",
")"
] | Store the async result instance of a taskset.
:param taskset_id: task set id
:param result: The return value of the taskset | [
"Store",
"the",
"async",
"result",
"instance",
"of",
"a",
"taskset",
"."
] | 5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef | https://github.com/celery/django-celery/blob/5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef/djcelery/managers.py#L219-L228 |
222,838 | celery/django-celery | djcelery/backends/database.py | DatabaseBackend._store_result | def _store_result(self, task_id, result, status,
traceback=None, request=None):
"""Store return value and status of an executed task."""
self.TaskModel._default_manager.store_result(
task_id, result, status,
traceback=traceback, children=self.current_task_ch... | python | def _store_result(self, task_id, result, status,
traceback=None, request=None):
"""Store return value and status of an executed task."""
self.TaskModel._default_manager.store_result(
task_id, result, status,
traceback=traceback, children=self.current_task_ch... | [
"def",
"_store_result",
"(",
"self",
",",
"task_id",
",",
"result",
",",
"status",
",",
"traceback",
"=",
"None",
",",
"request",
"=",
"None",
")",
":",
"self",
".",
"TaskModel",
".",
"_default_manager",
".",
"store_result",
"(",
"task_id",
",",
"result",
... | Store return value and status of an executed task. | [
"Store",
"return",
"value",
"and",
"status",
"of",
"an",
"executed",
"task",
"."
] | 5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef | https://github.com/celery/django-celery/blob/5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef/djcelery/backends/database.py#L28-L35 |
222,839 | celery/django-celery | djcelery/backends/database.py | DatabaseBackend._save_group | def _save_group(self, group_id, result):
"""Store the result of an executed group."""
self.TaskSetModel._default_manager.store_result(group_id, result)
return result | python | def _save_group(self, group_id, result):
"""Store the result of an executed group."""
self.TaskSetModel._default_manager.store_result(group_id, result)
return result | [
"def",
"_save_group",
"(",
"self",
",",
"group_id",
",",
"result",
")",
":",
"self",
".",
"TaskSetModel",
".",
"_default_manager",
".",
"store_result",
"(",
"group_id",
",",
"result",
")",
"return",
"result"
] | Store the result of an executed group. | [
"Store",
"the",
"result",
"of",
"an",
"executed",
"group",
"."
] | 5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef | https://github.com/celery/django-celery/blob/5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef/djcelery/backends/database.py#L37-L40 |
222,840 | celery/django-celery | djcelery/backends/database.py | DatabaseBackend._restore_group | def _restore_group(self, group_id):
"""Get group metadata for a group by id."""
meta = self.TaskSetModel._default_manager.restore_taskset(group_id)
if meta:
return meta.to_dict() | python | def _restore_group(self, group_id):
"""Get group metadata for a group by id."""
meta = self.TaskSetModel._default_manager.restore_taskset(group_id)
if meta:
return meta.to_dict() | [
"def",
"_restore_group",
"(",
"self",
",",
"group_id",
")",
":",
"meta",
"=",
"self",
".",
"TaskSetModel",
".",
"_default_manager",
".",
"restore_taskset",
"(",
"group_id",
")",
"if",
"meta",
":",
"return",
"meta",
".",
"to_dict",
"(",
")"
] | Get group metadata for a group by id. | [
"Get",
"group",
"metadata",
"for",
"a",
"group",
"by",
"id",
"."
] | 5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef | https://github.com/celery/django-celery/blob/5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef/djcelery/backends/database.py#L46-L50 |
222,841 | celery/django-celery | djcelery/backends/database.py | DatabaseBackend.cleanup | def cleanup(self):
"""Delete expired metadata."""
expires = maybe_timedelta(self.expires)
for model in self.TaskModel, self.TaskSetModel:
model._default_manager.delete_expired(expires) | python | def cleanup(self):
"""Delete expired metadata."""
expires = maybe_timedelta(self.expires)
for model in self.TaskModel, self.TaskSetModel:
model._default_manager.delete_expired(expires) | [
"def",
"cleanup",
"(",
"self",
")",
":",
"expires",
"=",
"maybe_timedelta",
"(",
"self",
".",
"expires",
")",
"for",
"model",
"in",
"self",
".",
"TaskModel",
",",
"self",
".",
"TaskSetModel",
":",
"model",
".",
"_default_manager",
".",
"delete_expired",
"(... | Delete expired metadata. | [
"Delete",
"expired",
"metadata",
"."
] | 5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef | https://github.com/celery/django-celery/blob/5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef/djcelery/backends/database.py#L61-L65 |
222,842 | celery/django-celery | djcelery/snapshot.py | Camera.handle_task | def handle_task(self, uuid_task, worker=None):
"""Handle snapshotted event."""
uuid, task = uuid_task
if task.worker and task.worker.hostname:
worker = self.handle_worker(
(task.worker.hostname, task.worker),
)
defaults = {
'name': tas... | python | def handle_task(self, uuid_task, worker=None):
"""Handle snapshotted event."""
uuid, task = uuid_task
if task.worker and task.worker.hostname:
worker = self.handle_worker(
(task.worker.hostname, task.worker),
)
defaults = {
'name': tas... | [
"def",
"handle_task",
"(",
"self",
",",
"uuid_task",
",",
"worker",
"=",
"None",
")",
":",
"uuid",
",",
"task",
"=",
"uuid_task",
"if",
"task",
".",
"worker",
"and",
"task",
".",
"worker",
".",
"hostname",
":",
"worker",
"=",
"self",
".",
"handle_worke... | Handle snapshotted event. | [
"Handle",
"snapshotted",
"event",
"."
] | 5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef | https://github.com/celery/django-celery/blob/5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef/djcelery/snapshot.py#L73-L100 |
222,843 | celery/django-celery | djcelery/common.py | respect_language | def respect_language(language):
"""Context manager that changes the current translation language for
all code inside the following block.
Can e.g. be used inside tasks like this::
from celery import task
from djcelery.common import respect_language
@task
def my_task(langua... | python | def respect_language(language):
"""Context manager that changes the current translation language for
all code inside the following block.
Can e.g. be used inside tasks like this::
from celery import task
from djcelery.common import respect_language
@task
def my_task(langua... | [
"def",
"respect_language",
"(",
"language",
")",
":",
"if",
"language",
":",
"prev",
"=",
"translation",
".",
"get_language",
"(",
")",
"translation",
".",
"activate",
"(",
"language",
")",
"try",
":",
"yield",
"finally",
":",
"translation",
".",
"activate",... | Context manager that changes the current translation language for
all code inside the following block.
Can e.g. be used inside tasks like this::
from celery import task
from djcelery.common import respect_language
@task
def my_task(language=None):
with respect_lang... | [
"Context",
"manager",
"that",
"changes",
"the",
"current",
"translation",
"language",
"for",
"all",
"code",
"inside",
"the",
"following",
"block",
"."
] | 5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef | https://github.com/celery/django-celery/blob/5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef/djcelery/common.py#L10-L32 |
222,844 | celery/django-celery | djcelery/loaders.py | autodiscover | def autodiscover():
"""Include tasks for all applications in ``INSTALLED_APPS``."""
global _RACE_PROTECTION
if _RACE_PROTECTION:
return
_RACE_PROTECTION = True
try:
return filter(None, [find_related_module(app, 'tasks')
for app in settings.INSTALLED_APPS... | python | def autodiscover():
"""Include tasks for all applications in ``INSTALLED_APPS``."""
global _RACE_PROTECTION
if _RACE_PROTECTION:
return
_RACE_PROTECTION = True
try:
return filter(None, [find_related_module(app, 'tasks')
for app in settings.INSTALLED_APPS... | [
"def",
"autodiscover",
"(",
")",
":",
"global",
"_RACE_PROTECTION",
"if",
"_RACE_PROTECTION",
":",
"return",
"_RACE_PROTECTION",
"=",
"True",
"try",
":",
"return",
"filter",
"(",
"None",
",",
"[",
"find_related_module",
"(",
"app",
",",
"'tasks'",
")",
"for",
... | Include tasks for all applications in ``INSTALLED_APPS``. | [
"Include",
"tasks",
"for",
"all",
"applications",
"in",
"INSTALLED_APPS",
"."
] | 5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef | https://github.com/celery/django-celery/blob/5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef/djcelery/loaders.py#L167-L178 |
222,845 | celery/django-celery | djcelery/loaders.py | find_related_module | def find_related_module(app, related_name):
"""Given an application name and a module name, tries to find that
module in the application."""
try:
app_path = importlib.import_module(app).__path__
except ImportError as exc:
warn('Autodiscover: Error importing %s.%s: %r' % (
ap... | python | def find_related_module(app, related_name):
"""Given an application name and a module name, tries to find that
module in the application."""
try:
app_path = importlib.import_module(app).__path__
except ImportError as exc:
warn('Autodiscover: Error importing %s.%s: %r' % (
ap... | [
"def",
"find_related_module",
"(",
"app",
",",
"related_name",
")",
":",
"try",
":",
"app_path",
"=",
"importlib",
".",
"import_module",
"(",
"app",
")",
".",
"__path__",
"except",
"ImportError",
"as",
"exc",
":",
"warn",
"(",
"'Autodiscover: Error importing %s.... | Given an application name and a module name, tries to find that
module in the application. | [
"Given",
"an",
"application",
"name",
"and",
"a",
"module",
"name",
"tries",
"to",
"find",
"that",
"module",
"in",
"the",
"application",
"."
] | 5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef | https://github.com/celery/django-celery/blob/5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef/djcelery/loaders.py#L181-L202 |
222,846 | celery/django-celery | djcelery/loaders.py | DjangoLoader.read_configuration | def read_configuration(self):
"""Load configuration from Django settings."""
self.configured = True
# Default backend needs to be the database backend for backward
# compatibility.
backend = (getattr(settings, 'CELERY_RESULT_BACKEND', None) or
getattr(settings,... | python | def read_configuration(self):
"""Load configuration from Django settings."""
self.configured = True
# Default backend needs to be the database backend for backward
# compatibility.
backend = (getattr(settings, 'CELERY_RESULT_BACKEND', None) or
getattr(settings,... | [
"def",
"read_configuration",
"(",
"self",
")",
":",
"self",
".",
"configured",
"=",
"True",
"# Default backend needs to be the database backend for backward",
"# compatibility.",
"backend",
"=",
"(",
"getattr",
"(",
"settings",
",",
"'CELERY_RESULT_BACKEND'",
",",
"None",... | Load configuration from Django settings. | [
"Load",
"configuration",
"from",
"Django",
"settings",
"."
] | 5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef | https://github.com/celery/django-celery/blob/5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef/djcelery/loaders.py#L57-L66 |
222,847 | celery/django-celery | djcelery/loaders.py | DjangoLoader.on_task_init | def on_task_init(self, task_id, task):
"""Called before every task."""
try:
is_eager = task.request.is_eager
except AttributeError:
is_eager = False
if not is_eager:
self.close_database() | python | def on_task_init(self, task_id, task):
"""Called before every task."""
try:
is_eager = task.request.is_eager
except AttributeError:
is_eager = False
if not is_eager:
self.close_database() | [
"def",
"on_task_init",
"(",
"self",
",",
"task_id",
",",
"task",
")",
":",
"try",
":",
"is_eager",
"=",
"task",
".",
"request",
".",
"is_eager",
"except",
"AttributeError",
":",
"is_eager",
"=",
"False",
"if",
"not",
"is_eager",
":",
"self",
".",
"close_... | Called before every task. | [
"Called",
"before",
"every",
"task",
"."
] | 5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef | https://github.com/celery/django-celery/blob/5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef/djcelery/loaders.py#L110-L117 |
222,848 | celery/django-celery | djcelery/humanize.py | naturaldate | def naturaldate(date, include_seconds=False):
"""Convert datetime into a human natural date string."""
if not date:
return ''
right_now = now()
today = datetime(right_now.year, right_now.month,
right_now.day, tzinfo=right_now.tzinfo)
delta = right_now - date
delta_... | python | def naturaldate(date, include_seconds=False):
"""Convert datetime into a human natural date string."""
if not date:
return ''
right_now = now()
today = datetime(right_now.year, right_now.month,
right_now.day, tzinfo=right_now.tzinfo)
delta = right_now - date
delta_... | [
"def",
"naturaldate",
"(",
"date",
",",
"include_seconds",
"=",
"False",
")",
":",
"if",
"not",
"date",
":",
"return",
"''",
"right_now",
"=",
"now",
"(",
")",
"today",
"=",
"datetime",
"(",
"right_now",
".",
"year",
",",
"right_now",
".",
"month",
","... | Convert datetime into a human natural date string. | [
"Convert",
"datetime",
"into",
"a",
"human",
"natural",
"date",
"string",
"."
] | 5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef | https://github.com/celery/django-celery/blob/5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef/djcelery/humanize.py#L38-L85 |
222,849 | celery/django-celery | djcelery/views.py | apply | def apply(request, task_name):
"""View applying a task.
**Note:** Please use this with caution. Preferably you shouldn't make this
publicly accessible without ensuring your code is safe!
"""
try:
task = tasks[task_name]
except KeyError:
raise Http404('apply: no such task')
... | python | def apply(request, task_name):
"""View applying a task.
**Note:** Please use this with caution. Preferably you shouldn't make this
publicly accessible without ensuring your code is safe!
"""
try:
task = tasks[task_name]
except KeyError:
raise Http404('apply: no such task')
... | [
"def",
"apply",
"(",
"request",
",",
"task_name",
")",
":",
"try",
":",
"task",
"=",
"tasks",
"[",
"task_name",
"]",
"except",
"KeyError",
":",
"raise",
"Http404",
"(",
"'apply: no such task'",
")",
"return",
"task_view",
"(",
"task",
")",
"(",
"request",
... | View applying a task.
**Note:** Please use this with caution. Preferably you shouldn't make this
publicly accessible without ensuring your code is safe! | [
"View",
"applying",
"a",
"task",
"."
] | 5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef | https://github.com/celery/django-celery/blob/5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef/djcelery/views.py#L46-L57 |
222,850 | celery/django-celery | djcelery/views.py | task_status | def task_status(request, task_id):
"""Returns task status and result in JSON format."""
result = AsyncResult(task_id)
state, retval = result.state, result.result
response_data = {'id': task_id, 'status': state, 'result': retval}
if state in states.EXCEPTION_STATES:
traceback = result.traceba... | python | def task_status(request, task_id):
"""Returns task status and result in JSON format."""
result = AsyncResult(task_id)
state, retval = result.state, result.result
response_data = {'id': task_id, 'status': state, 'result': retval}
if state in states.EXCEPTION_STATES:
traceback = result.traceba... | [
"def",
"task_status",
"(",
"request",
",",
"task_id",
")",
":",
"result",
"=",
"AsyncResult",
"(",
"task_id",
")",
"state",
",",
"retval",
"=",
"result",
".",
"state",
",",
"result",
".",
"result",
"response_data",
"=",
"{",
"'id'",
":",
"task_id",
",",
... | Returns task status and result in JSON format. | [
"Returns",
"task",
"status",
"and",
"result",
"in",
"JSON",
"format",
"."
] | 5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef | https://github.com/celery/django-celery/blob/5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef/djcelery/views.py#L68-L78 |
222,851 | celery/django-celery | djcelery/views.py | task_webhook | def task_webhook(fun):
"""Decorator turning a function into a task webhook.
If an exception is raised within the function, the decorated
function catches this and returns an error JSON response, otherwise
it returns the result as a JSON response.
Example:
.. code-block:: python
@tas... | python | def task_webhook(fun):
"""Decorator turning a function into a task webhook.
If an exception is raised within the function, the decorated
function catches this and returns an error JSON response, otherwise
it returns the result as a JSON response.
Example:
.. code-block:: python
@tas... | [
"def",
"task_webhook",
"(",
"fun",
")",
":",
"@",
"wraps",
"(",
"fun",
")",
"def",
"_inner",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"retval",
"=",
"fun",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"except",
"Excep... | Decorator turning a function into a task webhook.
If an exception is raised within the function, the decorated
function catches this and returns an error JSON response, otherwise
it returns the result as a JSON response.
Example:
.. code-block:: python
@task_webhook
def add(requ... | [
"Decorator",
"turning",
"a",
"function",
"into",
"a",
"task",
"webhook",
"."
] | 5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef | https://github.com/celery/django-celery/blob/5d1ecb09c6304d22cc447c7c08fba0bd1febc2ef/djcelery/views.py#L86-L125 |
222,852 | Guake/guake | guake/menus.py | mk_tab_context_menu | def mk_tab_context_menu(callback_object):
"""Create the context menu for a notebook tab
"""
# Store the menu in a temp variable in terminal so that popup() is happy. See:
# https://stackoverflow.com/questions/28465956/
callback_object.context_menu = Gtk.Menu()
menu = callback_object.context_me... | python | def mk_tab_context_menu(callback_object):
"""Create the context menu for a notebook tab
"""
# Store the menu in a temp variable in terminal so that popup() is happy. See:
# https://stackoverflow.com/questions/28465956/
callback_object.context_menu = Gtk.Menu()
menu = callback_object.context_me... | [
"def",
"mk_tab_context_menu",
"(",
"callback_object",
")",
":",
"# Store the menu in a temp variable in terminal so that popup() is happy. See:",
"# https://stackoverflow.com/questions/28465956/",
"callback_object",
".",
"context_menu",
"=",
"Gtk",
".",
"Menu",
"(",
")",
"menu",
... | Create the context menu for a notebook tab | [
"Create",
"the",
"context",
"menu",
"for",
"a",
"notebook",
"tab"
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/menus.py#L13-L30 |
222,853 | Guake/guake | guake/menus.py | mk_notebook_context_menu | def mk_notebook_context_menu(callback_object):
"""Create the context menu for the notebook
"""
callback_object.context_menu = Gtk.Menu()
menu = callback_object.context_menu
mi = Gtk.MenuItem(_("New Tab"))
mi.connect("activate", callback_object.on_new_tab)
menu.add(mi)
menu.add(Gtk.Separa... | python | def mk_notebook_context_menu(callback_object):
"""Create the context menu for the notebook
"""
callback_object.context_menu = Gtk.Menu()
menu = callback_object.context_menu
mi = Gtk.MenuItem(_("New Tab"))
mi.connect("activate", callback_object.on_new_tab)
menu.add(mi)
menu.add(Gtk.Separa... | [
"def",
"mk_notebook_context_menu",
"(",
"callback_object",
")",
":",
"callback_object",
".",
"context_menu",
"=",
"Gtk",
".",
"Menu",
"(",
")",
"menu",
"=",
"callback_object",
".",
"context_menu",
"mi",
"=",
"Gtk",
".",
"MenuItem",
"(",
"_",
"(",
"\"New Tab\""... | Create the context menu for the notebook | [
"Create",
"the",
"context",
"menu",
"for",
"the",
"notebook"
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/menus.py#L33-L62 |
222,854 | Guake/guake | guake/gsettings.py | GSettingHandler.ontop_toggled | def ontop_toggled(self, settings, key, user_data):
"""If the gconf var window_ontop be changed, this method will
be called and will set the keep_above attribute in guake's
main window.
"""
self.guake.window.set_keep_above(settings.get_boolean(key)) | python | def ontop_toggled(self, settings, key, user_data):
"""If the gconf var window_ontop be changed, this method will
be called and will set the keep_above attribute in guake's
main window.
"""
self.guake.window.set_keep_above(settings.get_boolean(key)) | [
"def",
"ontop_toggled",
"(",
"self",
",",
"settings",
",",
"key",
",",
"user_data",
")",
":",
"self",
".",
"guake",
".",
"window",
".",
"set_keep_above",
"(",
"settings",
".",
"get_boolean",
"(",
"key",
")",
")"
] | If the gconf var window_ontop be changed, this method will
be called and will set the keep_above attribute in guake's
main window. | [
"If",
"the",
"gconf",
"var",
"window_ontop",
"be",
"changed",
"this",
"method",
"will",
"be",
"called",
"and",
"will",
"set",
"the",
"keep_above",
"attribute",
"in",
"guake",
"s",
"main",
"window",
"."
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/gsettings.py#L103-L108 |
222,855 | Guake/guake | guake/gsettings.py | GSettingHandler.alignment_changed | def alignment_changed(self, settings, key, user_data):
"""If the gconf var window_halignment be changed, this method will
be called and will call the move function in guake.
"""
RectCalculator.set_final_window_rect(self.settings, self.guake.window)
self.guake.set_tab_position()
... | python | def alignment_changed(self, settings, key, user_data):
"""If the gconf var window_halignment be changed, this method will
be called and will call the move function in guake.
"""
RectCalculator.set_final_window_rect(self.settings, self.guake.window)
self.guake.set_tab_position()
... | [
"def",
"alignment_changed",
"(",
"self",
",",
"settings",
",",
"key",
",",
"user_data",
")",
":",
"RectCalculator",
".",
"set_final_window_rect",
"(",
"self",
".",
"settings",
",",
"self",
".",
"guake",
".",
"window",
")",
"self",
".",
"guake",
".",
"set_t... | If the gconf var window_halignment be changed, this method will
be called and will call the move function in guake. | [
"If",
"the",
"gconf",
"var",
"window_halignment",
"be",
"changed",
"this",
"method",
"will",
"be",
"called",
"and",
"will",
"call",
"the",
"move",
"function",
"in",
"guake",
"."
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/gsettings.py#L126-L132 |
222,856 | Guake/guake | guake/gsettings.py | GSettingHandler.size_changed | def size_changed(self, settings, key, user_data):
"""If the gconf var window_height or window_width are changed,
this method will be called and will call the resize function
in guake.
"""
RectCalculator.set_final_window_rect(self.settings, self.guake.window) | python | def size_changed(self, settings, key, user_data):
"""If the gconf var window_height or window_width are changed,
this method will be called and will call the resize function
in guake.
"""
RectCalculator.set_final_window_rect(self.settings, self.guake.window) | [
"def",
"size_changed",
"(",
"self",
",",
"settings",
",",
"key",
",",
"user_data",
")",
":",
"RectCalculator",
".",
"set_final_window_rect",
"(",
"self",
".",
"settings",
",",
"self",
".",
"guake",
".",
"window",
")"
] | If the gconf var window_height or window_width are changed,
this method will be called and will call the resize function
in guake. | [
"If",
"the",
"gconf",
"var",
"window_height",
"or",
"window_width",
"are",
"changed",
"this",
"method",
"will",
"be",
"called",
"and",
"will",
"call",
"the",
"resize",
"function",
"in",
"guake",
"."
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/gsettings.py#L134-L139 |
222,857 | Guake/guake | guake/gsettings.py | GSettingHandler.cursor_blink_mode_changed | def cursor_blink_mode_changed(self, settings, key, user_data):
"""Called when cursor blink mode settings has been changed
"""
for term in self.guake.notebook_manager.iter_terminals():
term.set_property("cursor-blink-mode", settings.get_int(key)) | python | def cursor_blink_mode_changed(self, settings, key, user_data):
"""Called when cursor blink mode settings has been changed
"""
for term in self.guake.notebook_manager.iter_terminals():
term.set_property("cursor-blink-mode", settings.get_int(key)) | [
"def",
"cursor_blink_mode_changed",
"(",
"self",
",",
"settings",
",",
"key",
",",
"user_data",
")",
":",
"for",
"term",
"in",
"self",
".",
"guake",
".",
"notebook_manager",
".",
"iter_terminals",
"(",
")",
":",
"term",
".",
"set_property",
"(",
"\"cursor-bl... | Called when cursor blink mode settings has been changed | [
"Called",
"when",
"cursor",
"blink",
"mode",
"settings",
"has",
"been",
"changed"
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/gsettings.py#L141-L145 |
222,858 | Guake/guake | guake/gsettings.py | GSettingHandler.history_size_changed | def history_size_changed(self, settings, key, user_data):
"""If the gconf var history_size be changed, this method will
be called and will set the scrollback_lines property of all
terminals open.
"""
lines = settings.get_int(key)
for i in self.guake.notebook_manager.iter_... | python | def history_size_changed(self, settings, key, user_data):
"""If the gconf var history_size be changed, this method will
be called and will set the scrollback_lines property of all
terminals open.
"""
lines = settings.get_int(key)
for i in self.guake.notebook_manager.iter_... | [
"def",
"history_size_changed",
"(",
"self",
",",
"settings",
",",
"key",
",",
"user_data",
")",
":",
"lines",
"=",
"settings",
".",
"get_int",
"(",
"key",
")",
"for",
"i",
"in",
"self",
".",
"guake",
".",
"notebook_manager",
".",
"iter_terminals",
"(",
"... | If the gconf var history_size be changed, this method will
be called and will set the scrollback_lines property of all
terminals open. | [
"If",
"the",
"gconf",
"var",
"history_size",
"be",
"changed",
"this",
"method",
"will",
"be",
"called",
"and",
"will",
"set",
"the",
"scrollback_lines",
"property",
"of",
"all",
"terminals",
"open",
"."
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/gsettings.py#L171-L178 |
222,859 | Guake/guake | guake/gsettings.py | GSettingHandler.keystroke_output | def keystroke_output(self, settings, key, user_data):
"""If the gconf var scroll_output be changed, this method will
be called and will set the scroll_on_output in all terminals
open.
"""
for i in self.guake.notebook_manager.iter_terminals():
i.set_scroll_on_output(se... | python | def keystroke_output(self, settings, key, user_data):
"""If the gconf var scroll_output be changed, this method will
be called and will set the scroll_on_output in all terminals
open.
"""
for i in self.guake.notebook_manager.iter_terminals():
i.set_scroll_on_output(se... | [
"def",
"keystroke_output",
"(",
"self",
",",
"settings",
",",
"key",
",",
"user_data",
")",
":",
"for",
"i",
"in",
"self",
".",
"guake",
".",
"notebook_manager",
".",
"iter_terminals",
"(",
")",
":",
"i",
".",
"set_scroll_on_output",
"(",
"settings",
".",
... | If the gconf var scroll_output be changed, this method will
be called and will set the scroll_on_output in all terminals
open. | [
"If",
"the",
"gconf",
"var",
"scroll_output",
"be",
"changed",
"this",
"method",
"will",
"be",
"called",
"and",
"will",
"set",
"the",
"scroll_on_output",
"in",
"all",
"terminals",
"open",
"."
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/gsettings.py#L188-L194 |
222,860 | Guake/guake | guake/gsettings.py | GSettingHandler.keystroke_toggled | def keystroke_toggled(self, settings, key, user_data):
"""If the gconf var scroll_keystroke be changed, this method
will be called and will set the scroll_on_keystroke in all
terminals open.
"""
for i in self.guake.notebook_manager.iter_terminals():
i.set_scroll_on_ke... | python | def keystroke_toggled(self, settings, key, user_data):
"""If the gconf var scroll_keystroke be changed, this method
will be called and will set the scroll_on_keystroke in all
terminals open.
"""
for i in self.guake.notebook_manager.iter_terminals():
i.set_scroll_on_ke... | [
"def",
"keystroke_toggled",
"(",
"self",
",",
"settings",
",",
"key",
",",
"user_data",
")",
":",
"for",
"i",
"in",
"self",
".",
"guake",
".",
"notebook_manager",
".",
"iter_terminals",
"(",
")",
":",
"i",
".",
"set_scroll_on_keystroke",
"(",
"settings",
"... | If the gconf var scroll_keystroke be changed, this method
will be called and will set the scroll_on_keystroke in all
terminals open. | [
"If",
"the",
"gconf",
"var",
"scroll_keystroke",
"be",
"changed",
"this",
"method",
"will",
"be",
"called",
"and",
"will",
"set",
"the",
"scroll_on_keystroke",
"in",
"all",
"terminals",
"open",
"."
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/gsettings.py#L196-L202 |
222,861 | Guake/guake | guake/gsettings.py | GSettingHandler.allow_bold_toggled | def allow_bold_toggled(self, settings, key, user_data):
"""If the gconf var allow_bold is changed, this method will be called
and will change the VTE terminal o.
displaying characters in bold font.
"""
for term in self.guake.notebook_manager.iter_terminals():
term.set... | python | def allow_bold_toggled(self, settings, key, user_data):
"""If the gconf var allow_bold is changed, this method will be called
and will change the VTE terminal o.
displaying characters in bold font.
"""
for term in self.guake.notebook_manager.iter_terminals():
term.set... | [
"def",
"allow_bold_toggled",
"(",
"self",
",",
"settings",
",",
"key",
",",
"user_data",
")",
":",
"for",
"term",
"in",
"self",
".",
"guake",
".",
"notebook_manager",
".",
"iter_terminals",
"(",
")",
":",
"term",
".",
"set_allow_bold",
"(",
"settings",
"."... | If the gconf var allow_bold is changed, this method will be called
and will change the VTE terminal o.
displaying characters in bold font. | [
"If",
"the",
"gconf",
"var",
"allow_bold",
"is",
"changed",
"this",
"method",
"will",
"be",
"called",
"and",
"will",
"change",
"the",
"VTE",
"terminal",
"o",
".",
"displaying",
"characters",
"in",
"bold",
"font",
"."
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/gsettings.py#L226-L232 |
222,862 | Guake/guake | guake/gsettings.py | GSettingHandler.bold_is_bright_toggled | def bold_is_bright_toggled(self, settings, key, user_data):
"""If the dconf var bold_is_bright is changed, this method will be called
and will change the VTE terminal to toggle auto-brightened bold text.
"""
try:
for term in self.guake.notebook_manager.iter_terminals():
... | python | def bold_is_bright_toggled(self, settings, key, user_data):
"""If the dconf var bold_is_bright is changed, this method will be called
and will change the VTE terminal to toggle auto-brightened bold text.
"""
try:
for term in self.guake.notebook_manager.iter_terminals():
... | [
"def",
"bold_is_bright_toggled",
"(",
"self",
",",
"settings",
",",
"key",
",",
"user_data",
")",
":",
"try",
":",
"for",
"term",
"in",
"self",
".",
"guake",
".",
"notebook_manager",
".",
"iter_terminals",
"(",
")",
":",
"term",
".",
"set_bold_is_bright",
... | If the dconf var bold_is_bright is changed, this method will be called
and will change the VTE terminal to toggle auto-brightened bold text. | [
"If",
"the",
"dconf",
"var",
"bold_is_bright",
"is",
"changed",
"this",
"method",
"will",
"be",
"called",
"and",
"will",
"change",
"the",
"VTE",
"terminal",
"to",
"toggle",
"auto",
"-",
"brightened",
"bold",
"text",
"."
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/gsettings.py#L234-L242 |
222,863 | Guake/guake | guake/gsettings.py | GSettingHandler.palette_font_and_background_color_toggled | def palette_font_and_background_color_toggled(self, settings, key, user_data):
"""If the gconf var use_palette_font_and_background_color be changed, this method
will be called and will change the font color and the background color to the color
defined in the palette.
"""
self.se... | python | def palette_font_and_background_color_toggled(self, settings, key, user_data):
"""If the gconf var use_palette_font_and_background_color be changed, this method
will be called and will change the font color and the background color to the color
defined in the palette.
"""
self.se... | [
"def",
"palette_font_and_background_color_toggled",
"(",
"self",
",",
"settings",
",",
"key",
",",
"user_data",
")",
":",
"self",
".",
"settings",
".",
"styleFont",
".",
"triggerOnChangedValue",
"(",
"self",
".",
"settings",
".",
"styleFont",
",",
"'palette'",
"... | If the gconf var use_palette_font_and_background_color be changed, this method
will be called and will change the font color and the background color to the color
defined in the palette. | [
"If",
"the",
"gconf",
"var",
"use_palette_font_and_background_color",
"be",
"changed",
"this",
"method",
"will",
"be",
"called",
"and",
"will",
"change",
"the",
"font",
"color",
"and",
"the",
"background",
"color",
"to",
"the",
"color",
"defined",
"in",
"the",
... | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/gsettings.py#L244-L249 |
222,864 | Guake/guake | guake/gsettings.py | GSettingHandler.backspace_changed | def backspace_changed(self, settings, key, user_data):
"""If the gconf var compat_backspace be changed, this method
will be called and will change the binding configuration in
all terminals open.
"""
for i in self.guake.notebook_manager.iter_terminals():
i.set_backspa... | python | def backspace_changed(self, settings, key, user_data):
"""If the gconf var compat_backspace be changed, this method
will be called and will change the binding configuration in
all terminals open.
"""
for i in self.guake.notebook_manager.iter_terminals():
i.set_backspa... | [
"def",
"backspace_changed",
"(",
"self",
",",
"settings",
",",
"key",
",",
"user_data",
")",
":",
"for",
"i",
"in",
"self",
".",
"guake",
".",
"notebook_manager",
".",
"iter_terminals",
"(",
")",
":",
"i",
".",
"set_backspace_binding",
"(",
"self",
".",
... | If the gconf var compat_backspace be changed, this method
will be called and will change the binding configuration in
all terminals open. | [
"If",
"the",
"gconf",
"var",
"compat_backspace",
"be",
"changed",
"this",
"method",
"will",
"be",
"called",
"and",
"will",
"change",
"the",
"binding",
"configuration",
"in",
"all",
"terminals",
"open",
"."
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/gsettings.py#L286-L292 |
222,865 | Guake/guake | guake/gsettings.py | GSettingHandler.delete_changed | def delete_changed(self, settings, key, user_data):
"""If the gconf var compat_delete be changed, this method
will be called and will change the binding configuration in
all terminals open.
"""
for i in self.guake.notebook_manager.iter_terminals():
i.set_delete_bindin... | python | def delete_changed(self, settings, key, user_data):
"""If the gconf var compat_delete be changed, this method
will be called and will change the binding configuration in
all terminals open.
"""
for i in self.guake.notebook_manager.iter_terminals():
i.set_delete_bindin... | [
"def",
"delete_changed",
"(",
"self",
",",
"settings",
",",
"key",
",",
"user_data",
")",
":",
"for",
"i",
"in",
"self",
".",
"guake",
".",
"notebook_manager",
".",
"iter_terminals",
"(",
")",
":",
"i",
".",
"set_delete_binding",
"(",
"self",
".",
"getEr... | If the gconf var compat_delete be changed, this method
will be called and will change the binding configuration in
all terminals open. | [
"If",
"the",
"gconf",
"var",
"compat_delete",
"be",
"changed",
"this",
"method",
"will",
"be",
"called",
"and",
"will",
"change",
"the",
"binding",
"configuration",
"in",
"all",
"terminals",
"open",
"."
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/gsettings.py#L294-L300 |
222,866 | Guake/guake | guake/gsettings.py | GSettingHandler.max_tab_name_length_changed | def max_tab_name_length_changed(self, settings, key, user_data):
"""If the gconf var max_tab_name_length be changed, this method will
be called and will set the tab name length limit.
"""
# avoid get window title before terminal is ready
if self.guake.notebook_manager.get_curren... | python | def max_tab_name_length_changed(self, settings, key, user_data):
"""If the gconf var max_tab_name_length be changed, this method will
be called and will set the tab name length limit.
"""
# avoid get window title before terminal is ready
if self.guake.notebook_manager.get_curren... | [
"def",
"max_tab_name_length_changed",
"(",
"self",
",",
"settings",
",",
"key",
",",
"user_data",
")",
":",
"# avoid get window title before terminal is ready",
"if",
"self",
".",
"guake",
".",
"notebook_manager",
".",
"get_current_notebook",
"(",
")",
".",
"get_curre... | If the gconf var max_tab_name_length be changed, this method will
be called and will set the tab name length limit. | [
"If",
"the",
"gconf",
"var",
"max_tab_name_length",
"be",
"changed",
"this",
"method",
"will",
"be",
"called",
"and",
"will",
"set",
"the",
"tab",
"name",
"length",
"limit",
"."
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/gsettings.py#L302-L315 |
222,867 | Guake/guake | guake/gsettings.py | GSettingHandler.abbreviate_tab_names_changed | def abbreviate_tab_names_changed(self, settings, key, user_data):
"""If the gconf var abbreviate_tab_names be changed, this method will
be called and will update tab names.
"""
abbreviate_tab_names = settings.get_boolean('abbreviate-tab-names')
self.guake.abbreviate = abbreviate_... | python | def abbreviate_tab_names_changed(self, settings, key, user_data):
"""If the gconf var abbreviate_tab_names be changed, this method will
be called and will update tab names.
"""
abbreviate_tab_names = settings.get_boolean('abbreviate-tab-names')
self.guake.abbreviate = abbreviate_... | [
"def",
"abbreviate_tab_names_changed",
"(",
"self",
",",
"settings",
",",
"key",
",",
"user_data",
")",
":",
"abbreviate_tab_names",
"=",
"settings",
".",
"get_boolean",
"(",
"'abbreviate-tab-names'",
")",
"self",
".",
"guake",
".",
"abbreviate",
"=",
"abbreviate_... | If the gconf var abbreviate_tab_names be changed, this method will
be called and will update tab names. | [
"If",
"the",
"gconf",
"var",
"abbreviate_tab_names",
"be",
"changed",
"this",
"method",
"will",
"be",
"called",
"and",
"will",
"update",
"tab",
"names",
"."
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/gsettings.py#L317-L323 |
222,868 | Guake/guake | guake/keybindings.py | Keybindings.reload_accelerators | def reload_accelerators(self, *args):
"""Reassign an accel_group to guake main window and guake
context menu and calls the load_accelerators method.
"""
if self.accel_group:
self.guake.window.remove_accel_group(self.accel_group)
self.accel_group = Gtk.AccelGroup()
... | python | def reload_accelerators(self, *args):
"""Reassign an accel_group to guake main window and guake
context menu and calls the load_accelerators method.
"""
if self.accel_group:
self.guake.window.remove_accel_group(self.accel_group)
self.accel_group = Gtk.AccelGroup()
... | [
"def",
"reload_accelerators",
"(",
"self",
",",
"*",
"args",
")",
":",
"if",
"self",
".",
"accel_group",
":",
"self",
".",
"guake",
".",
"window",
".",
"remove_accel_group",
"(",
"self",
".",
"accel_group",
")",
"self",
".",
"accel_group",
"=",
"Gtk",
".... | Reassign an accel_group to guake main window and guake
context menu and calls the load_accelerators method. | [
"Reassign",
"an",
"accel_group",
"to",
"guake",
"main",
"window",
"and",
"guake",
"context",
"menu",
"and",
"calls",
"the",
"load_accelerators",
"method",
"."
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/keybindings.py#L104-L112 |
222,869 | Guake/guake | guake/globals.py | bindtextdomain | def bindtextdomain(app_name, locale_dir=None):
"""
Bind the domain represented by app_name to the locale directory locale_dir.
It has the effect of loading translations, enabling applications for different
languages.
app_name:
a domain to look for translations, typically the name of an appl... | python | def bindtextdomain(app_name, locale_dir=None):
"""
Bind the domain represented by app_name to the locale directory locale_dir.
It has the effect of loading translations, enabling applications for different
languages.
app_name:
a domain to look for translations, typically the name of an appl... | [
"def",
"bindtextdomain",
"(",
"app_name",
",",
"locale_dir",
"=",
"None",
")",
":",
"import",
"locale",
"from",
"locale",
"import",
"gettext",
"as",
"_",
"log",
".",
"info",
"(",
"\"Local binding for app '%s', local dir: %s\"",
",",
"app_name",
",",
"locale_dir",
... | Bind the domain represented by app_name to the locale directory locale_dir.
It has the effect of loading translations, enabling applications for different
languages.
app_name:
a domain to look for translations, typically the name of an application.
locale_dir:
a directory with locales ... | [
"Bind",
"the",
"domain",
"represented",
"by",
"app_name",
"to",
"the",
"locale",
"directory",
"locale_dir",
".",
"It",
"has",
"the",
"effect",
"of",
"loading",
"translations",
"enabling",
"applications",
"for",
"different",
"languages",
"."
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/globals.py#L38-L58 |
222,870 | Guake/guake | guake/prefs.py | setup_standalone_signals | def setup_standalone_signals(instance):
"""Called when prefs dialog is running in standalone mode. It
makes the delete event of dialog and click on close button finish
the application.
"""
window = instance.get_widget('config-window')
window.connect('delete-event', Gtk.main_quit)
# We need ... | python | def setup_standalone_signals(instance):
"""Called when prefs dialog is running in standalone mode. It
makes the delete event of dialog and click on close button finish
the application.
"""
window = instance.get_widget('config-window')
window.connect('delete-event', Gtk.main_quit)
# We need ... | [
"def",
"setup_standalone_signals",
"(",
"instance",
")",
":",
"window",
"=",
"instance",
".",
"get_widget",
"(",
"'config-window'",
")",
"window",
".",
"connect",
"(",
"'delete-event'",
",",
"Gtk",
".",
"main_quit",
")",
"# We need to block the execution of the alread... | Called when prefs dialog is running in standalone mode. It
makes the delete event of dialog and click on close button finish
the application. | [
"Called",
"when",
"prefs",
"dialog",
"is",
"running",
"in",
"standalone",
"mode",
".",
"It",
"makes",
"the",
"delete",
"event",
"of",
"dialog",
"and",
"click",
"on",
"close",
"button",
"finish",
"the",
"application",
"."
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L1490-L1504 |
222,871 | Guake/guake | guake/prefs.py | PrefsCallbacks.on_default_shell_changed | def on_default_shell_changed(self, combo):
"""Changes the activity of default_shell in dconf
"""
citer = combo.get_active_iter()
if not citer:
return
shell = combo.get_model().get_value(citer, 0)
# we unset the value (restore to default) when user chooses to u... | python | def on_default_shell_changed(self, combo):
"""Changes the activity of default_shell in dconf
"""
citer = combo.get_active_iter()
if not citer:
return
shell = combo.get_model().get_value(citer, 0)
# we unset the value (restore to default) when user chooses to u... | [
"def",
"on_default_shell_changed",
"(",
"self",
",",
"combo",
")",
":",
"citer",
"=",
"combo",
".",
"get_active_iter",
"(",
")",
"if",
"not",
"citer",
":",
"return",
"shell",
"=",
"combo",
".",
"get_model",
"(",
")",
".",
"get_value",
"(",
"citer",
",",
... | Changes the activity of default_shell in dconf | [
"Changes",
"the",
"activity",
"of",
"default_shell",
"in",
"dconf"
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L368-L380 |
222,872 | Guake/guake | guake/prefs.py | PrefsCallbacks.on_gtk_theme_name_changed | def on_gtk_theme_name_changed(self, combo):
"""Set the `gtk_theme_name' property in dconf
"""
citer = combo.get_active_iter()
if not citer:
return
theme_name = combo.get_model().get_value(citer, 0)
self.settings.general.set_string('gtk-theme-name', theme_name)... | python | def on_gtk_theme_name_changed(self, combo):
"""Set the `gtk_theme_name' property in dconf
"""
citer = combo.get_active_iter()
if not citer:
return
theme_name = combo.get_model().get_value(citer, 0)
self.settings.general.set_string('gtk-theme-name', theme_name)... | [
"def",
"on_gtk_theme_name_changed",
"(",
"self",
",",
"combo",
")",
":",
"citer",
"=",
"combo",
".",
"get_active_iter",
"(",
")",
"if",
"not",
"citer",
":",
"return",
"theme_name",
"=",
"combo",
".",
"get_model",
"(",
")",
".",
"get_value",
"(",
"citer",
... | Set the `gtk_theme_name' property in dconf | [
"Set",
"the",
"gtk_theme_name",
"property",
"in",
"dconf"
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L417-L425 |
222,873 | Guake/guake | guake/prefs.py | PrefsCallbacks.on_gtk_prefer_dark_theme_toggled | def on_gtk_prefer_dark_theme_toggled(self, chk):
"""Set the `gtk_prefer_dark_theme' property in dconf
"""
self.settings.general.set_boolean('gtk-prefer-dark-theme', chk.get_active())
select_gtk_theme(self.settings) | python | def on_gtk_prefer_dark_theme_toggled(self, chk):
"""Set the `gtk_prefer_dark_theme' property in dconf
"""
self.settings.general.set_boolean('gtk-prefer-dark-theme', chk.get_active())
select_gtk_theme(self.settings) | [
"def",
"on_gtk_prefer_dark_theme_toggled",
"(",
"self",
",",
"chk",
")",
":",
"self",
".",
"settings",
".",
"general",
".",
"set_boolean",
"(",
"'gtk-prefer-dark-theme'",
",",
"chk",
".",
"get_active",
"(",
")",
")",
"select_gtk_theme",
"(",
"self",
".",
"sett... | Set the `gtk_prefer_dark_theme' property in dconf | [
"Set",
"the",
"gtk_prefer_dark_theme",
"property",
"in",
"dconf"
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L427-L431 |
222,874 | Guake/guake | guake/prefs.py | PrefsCallbacks.on_start_at_login_toggled | def on_start_at_login_toggled(self, chk):
"""Changes the activity of start_at_login in dconf
"""
self.settings.general.set_boolean('start-at-login', chk.get_active())
refresh_user_start(self.settings) | python | def on_start_at_login_toggled(self, chk):
"""Changes the activity of start_at_login in dconf
"""
self.settings.general.set_boolean('start-at-login', chk.get_active())
refresh_user_start(self.settings) | [
"def",
"on_start_at_login_toggled",
"(",
"self",
",",
"chk",
")",
":",
"self",
".",
"settings",
".",
"general",
".",
"set_boolean",
"(",
"'start-at-login'",
",",
"chk",
".",
"get_active",
"(",
")",
")",
"refresh_user_start",
"(",
"self",
".",
"settings",
")"... | Changes the activity of start_at_login in dconf | [
"Changes",
"the",
"activity",
"of",
"start_at_login",
"in",
"dconf"
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L480-L484 |
222,875 | Guake/guake | guake/prefs.py | PrefsCallbacks.on_max_tab_name_length_changed | def on_max_tab_name_length_changed(self, spin):
"""Changes the value of max_tab_name_length in dconf
"""
val = int(spin.get_value())
self.settings.general.set_int('max-tab-name-length', val)
self.prefDlg.update_vte_subwidgets_states() | python | def on_max_tab_name_length_changed(self, spin):
"""Changes the value of max_tab_name_length in dconf
"""
val = int(spin.get_value())
self.settings.general.set_int('max-tab-name-length', val)
self.prefDlg.update_vte_subwidgets_states() | [
"def",
"on_max_tab_name_length_changed",
"(",
"self",
",",
"spin",
")",
":",
"val",
"=",
"int",
"(",
"spin",
".",
"get_value",
"(",
")",
")",
"self",
".",
"settings",
".",
"general",
".",
"set_int",
"(",
"'max-tab-name-length'",
",",
"val",
")",
"self",
... | Changes the value of max_tab_name_length in dconf | [
"Changes",
"the",
"value",
"of",
"max_tab_name_length",
"in",
"dconf"
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L501-L506 |
222,876 | Guake/guake | guake/prefs.py | PrefsCallbacks.on_right_align_toggled | def on_right_align_toggled(self, chk):
"""set the horizontal alignment setting.
"""
v = chk.get_active()
self.settings.general.set_int('window-halignment', 1 if v else 0) | python | def on_right_align_toggled(self, chk):
"""set the horizontal alignment setting.
"""
v = chk.get_active()
self.settings.general.set_int('window-halignment', 1 if v else 0) | [
"def",
"on_right_align_toggled",
"(",
"self",
",",
"chk",
")",
":",
"v",
"=",
"chk",
".",
"get_active",
"(",
")",
"self",
".",
"settings",
".",
"general",
".",
"set_int",
"(",
"'window-halignment'",
",",
"1",
"if",
"v",
"else",
"0",
")"
] | set the horizontal alignment setting. | [
"set",
"the",
"horizontal",
"alignment",
"setting",
"."
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L514-L518 |
222,877 | Guake/guake | guake/prefs.py | PrefsCallbacks.on_bottom_align_toggled | def on_bottom_align_toggled(self, chk):
"""set the vertical alignment setting.
"""
v = chk.get_active()
self.settings.general.set_int('window-valignment', ALIGN_BOTTOM if v else ALIGN_TOP) | python | def on_bottom_align_toggled(self, chk):
"""set the vertical alignment setting.
"""
v = chk.get_active()
self.settings.general.set_int('window-valignment', ALIGN_BOTTOM if v else ALIGN_TOP) | [
"def",
"on_bottom_align_toggled",
"(",
"self",
",",
"chk",
")",
":",
"v",
"=",
"chk",
".",
"get_active",
"(",
")",
"self",
".",
"settings",
".",
"general",
".",
"set_int",
"(",
"'window-valignment'",
",",
"ALIGN_BOTTOM",
"if",
"v",
"else",
"ALIGN_TOP",
")"... | set the vertical alignment setting. | [
"set",
"the",
"vertical",
"alignment",
"setting",
"."
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L520-L524 |
222,878 | Guake/guake | guake/prefs.py | PrefsCallbacks.on_display_n_changed | def on_display_n_changed(self, combo):
"""Set the destination display in dconf.
"""
i = combo.get_active_iter()
if not i:
return
model = combo.get_model()
first_item_path = model.get_path(model.get_iter_first())
if model.get_path(i) == first_item_pa... | python | def on_display_n_changed(self, combo):
"""Set the destination display in dconf.
"""
i = combo.get_active_iter()
if not i:
return
model = combo.get_model()
first_item_path = model.get_path(model.get_iter_first())
if model.get_path(i) == first_item_pa... | [
"def",
"on_display_n_changed",
"(",
"self",
",",
"combo",
")",
":",
"i",
"=",
"combo",
".",
"get_active_iter",
"(",
")",
"if",
"not",
"i",
":",
"return",
"model",
"=",
"combo",
".",
"get_model",
"(",
")",
"first_item_path",
"=",
"model",
".",
"get_path",... | Set the destination display in dconf. | [
"Set",
"the",
"destination",
"display",
"in",
"dconf",
"."
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L526-L542 |
222,879 | Guake/guake | guake/prefs.py | PrefsCallbacks.on_window_height_value_changed | def on_window_height_value_changed(self, hscale):
"""Changes the value of window_height in dconf
"""
val = hscale.get_value()
self.settings.general.set_int('window-height', int(val)) | python | def on_window_height_value_changed(self, hscale):
"""Changes the value of window_height in dconf
"""
val = hscale.get_value()
self.settings.general.set_int('window-height', int(val)) | [
"def",
"on_window_height_value_changed",
"(",
"self",
",",
"hscale",
")",
":",
"val",
"=",
"hscale",
".",
"get_value",
"(",
")",
"self",
".",
"settings",
".",
"general",
".",
"set_int",
"(",
"'window-height'",
",",
"int",
"(",
"val",
")",
")"
] | Changes the value of window_height in dconf | [
"Changes",
"the",
"value",
"of",
"window_height",
"in",
"dconf"
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L544-L548 |
222,880 | Guake/guake | guake/prefs.py | PrefsCallbacks.on_window_width_value_changed | def on_window_width_value_changed(self, wscale):
"""Changes the value of window_width in dconf
"""
val = wscale.get_value()
self.settings.general.set_int('window-width', int(val)) | python | def on_window_width_value_changed(self, wscale):
"""Changes the value of window_width in dconf
"""
val = wscale.get_value()
self.settings.general.set_int('window-width', int(val)) | [
"def",
"on_window_width_value_changed",
"(",
"self",
",",
"wscale",
")",
":",
"val",
"=",
"wscale",
".",
"get_value",
"(",
")",
"self",
".",
"settings",
".",
"general",
".",
"set_int",
"(",
"'window-width'",
",",
"int",
"(",
"val",
")",
")"
] | Changes the value of window_width in dconf | [
"Changes",
"the",
"value",
"of",
"window_width",
"in",
"dconf"
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L550-L554 |
222,881 | Guake/guake | guake/prefs.py | PrefsCallbacks.on_window_halign_value_changed | def on_window_halign_value_changed(self, halign_button):
"""Changes the value of window_halignment in dconf
"""
which_align = {
'radiobutton_align_left': ALIGN_LEFT,
'radiobutton_align_right': ALIGN_RIGHT,
'radiobutton_align_center': ALIGN_CENTER
}
... | python | def on_window_halign_value_changed(self, halign_button):
"""Changes the value of window_halignment in dconf
"""
which_align = {
'radiobutton_align_left': ALIGN_LEFT,
'radiobutton_align_right': ALIGN_RIGHT,
'radiobutton_align_center': ALIGN_CENTER
}
... | [
"def",
"on_window_halign_value_changed",
"(",
"self",
",",
"halign_button",
")",
":",
"which_align",
"=",
"{",
"'radiobutton_align_left'",
":",
"ALIGN_LEFT",
",",
"'radiobutton_align_right'",
":",
"ALIGN_RIGHT",
",",
"'radiobutton_align_center'",
":",
"ALIGN_CENTER",
"}",... | Changes the value of window_halignment in dconf | [
"Changes",
"the",
"value",
"of",
"window_halignment",
"in",
"dconf"
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L556-L570 |
222,882 | Guake/guake | guake/prefs.py | PrefsCallbacks.on_history_size_value_changed | def on_history_size_value_changed(self, spin):
"""Changes the value of history_size in dconf
"""
val = int(spin.get_value())
self.settings.general.set_int('history-size', val)
self._update_history_widgets() | python | def on_history_size_value_changed(self, spin):
"""Changes the value of history_size in dconf
"""
val = int(spin.get_value())
self.settings.general.set_int('history-size', val)
self._update_history_widgets() | [
"def",
"on_history_size_value_changed",
"(",
"self",
",",
"spin",
")",
":",
"val",
"=",
"int",
"(",
"spin",
".",
"get_value",
"(",
")",
")",
"self",
".",
"settings",
".",
"general",
".",
"set_int",
"(",
"'history-size'",
",",
"val",
")",
"self",
".",
"... | Changes the value of history_size in dconf | [
"Changes",
"the",
"value",
"of",
"history_size",
"in",
"dconf"
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L584-L589 |
222,883 | Guake/guake | guake/prefs.py | PrefsCallbacks.on_transparency_value_changed | def on_transparency_value_changed(self, hscale):
"""Changes the value of background_transparency in dconf
"""
value = hscale.get_value()
self.prefDlg.set_colors_from_settings()
self.settings.styleBackground.set_int('transparency', MAX_TRANSPARENCY - int(value)) | python | def on_transparency_value_changed(self, hscale):
"""Changes the value of background_transparency in dconf
"""
value = hscale.get_value()
self.prefDlg.set_colors_from_settings()
self.settings.styleBackground.set_int('transparency', MAX_TRANSPARENCY - int(value)) | [
"def",
"on_transparency_value_changed",
"(",
"self",
",",
"hscale",
")",
":",
"value",
"=",
"hscale",
".",
"get_value",
"(",
")",
"self",
".",
"prefDlg",
".",
"set_colors_from_settings",
"(",
")",
"self",
".",
"settings",
".",
"styleBackground",
".",
"set_int"... | Changes the value of background_transparency in dconf | [
"Changes",
"the",
"value",
"of",
"background_transparency",
"in",
"dconf"
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L631-L636 |
222,884 | Guake/guake | guake/prefs.py | PrefsCallbacks.on_backspace_binding_changed | def on_backspace_binding_changed(self, combo):
"""Changes the value of compat_backspace in dconf
"""
val = combo.get_active_text()
self.settings.general.set_string('compat-backspace', ERASE_BINDINGS[val]) | python | def on_backspace_binding_changed(self, combo):
"""Changes the value of compat_backspace in dconf
"""
val = combo.get_active_text()
self.settings.general.set_string('compat-backspace', ERASE_BINDINGS[val]) | [
"def",
"on_backspace_binding_changed",
"(",
"self",
",",
"combo",
")",
":",
"val",
"=",
"combo",
".",
"get_active_text",
"(",
")",
"self",
".",
"settings",
".",
"general",
".",
"set_string",
"(",
"'compat-backspace'",
",",
"ERASE_BINDINGS",
"[",
"val",
"]",
... | Changes the value of compat_backspace in dconf | [
"Changes",
"the",
"value",
"of",
"compat_backspace",
"in",
"dconf"
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L640-L644 |
222,885 | Guake/guake | guake/prefs.py | PrefsCallbacks.on_window_vertical_displacement_value_changed | def on_window_vertical_displacement_value_changed(self, spin):
"""Changes the value of window-vertical-displacement
"""
self.settings.general.set_int('window-vertical-displacement', int(spin.get_value())) | python | def on_window_vertical_displacement_value_changed(self, spin):
"""Changes the value of window-vertical-displacement
"""
self.settings.general.set_int('window-vertical-displacement', int(spin.get_value())) | [
"def",
"on_window_vertical_displacement_value_changed",
"(",
"self",
",",
"spin",
")",
":",
"self",
".",
"settings",
".",
"general",
".",
"set_int",
"(",
"'window-vertical-displacement'",
",",
"int",
"(",
"spin",
".",
"get_value",
"(",
")",
")",
")"
] | Changes the value of window-vertical-displacement | [
"Changes",
"the",
"value",
"of",
"window",
"-",
"vertical",
"-",
"displacement"
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L691-L694 |
222,886 | Guake/guake | guake/prefs.py | PrefsCallbacks.on_window_horizontal_displacement_value_changed | def on_window_horizontal_displacement_value_changed(self, spin):
"""Changes the value of window-horizontal-displacement
"""
self.settings.general.set_int('window-horizontal-displacement', int(spin.get_value())) | python | def on_window_horizontal_displacement_value_changed(self, spin):
"""Changes the value of window-horizontal-displacement
"""
self.settings.general.set_int('window-horizontal-displacement', int(spin.get_value())) | [
"def",
"on_window_horizontal_displacement_value_changed",
"(",
"self",
",",
"spin",
")",
":",
"self",
".",
"settings",
".",
"general",
".",
"set_int",
"(",
"'window-horizontal-displacement'",
",",
"int",
"(",
"spin",
".",
"get_value",
"(",
")",
")",
")"
] | Changes the value of window-horizontal-displacement | [
"Changes",
"the",
"value",
"of",
"window",
"-",
"horizontal",
"-",
"displacement"
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L696-L699 |
222,887 | Guake/guake | guake/prefs.py | PrefsDialog.toggle_use_font_background_sensitivity | def toggle_use_font_background_sensitivity(self, chk):
"""If the user chooses to use the gnome default font
configuration it means that he will not be able to use the
font selector.
"""
self.get_widget('palette_16').set_sensitive(chk.get_active())
self.get_widget('palette... | python | def toggle_use_font_background_sensitivity(self, chk):
"""If the user chooses to use the gnome default font
configuration it means that he will not be able to use the
font selector.
"""
self.get_widget('palette_16').set_sensitive(chk.get_active())
self.get_widget('palette... | [
"def",
"toggle_use_font_background_sensitivity",
"(",
"self",
",",
"chk",
")",
":",
"self",
".",
"get_widget",
"(",
"'palette_16'",
")",
".",
"set_sensitive",
"(",
"chk",
".",
"get_active",
"(",
")",
")",
"self",
".",
"get_widget",
"(",
"'palette_17'",
")",
... | If the user chooses to use the gnome default font
configuration it means that he will not be able to use the
font selector. | [
"If",
"the",
"user",
"chooses",
"to",
"use",
"the",
"gnome",
"default",
"font",
"configuration",
"it",
"means",
"that",
"he",
"will",
"not",
"be",
"able",
"to",
"use",
"the",
"font",
"selector",
"."
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L866-L872 |
222,888 | Guake/guake | guake/prefs.py | PrefsDialog.toggle_quick_open_command_line_sensitivity | def toggle_quick_open_command_line_sensitivity(self, chk):
"""When the user unchecks 'enable quick open', the command line should be disabled
"""
self.get_widget('quick_open_command_line').set_sensitive(chk.get_active())
self.get_widget('quick_open_in_current_terminal').set_sensitive(chk... | python | def toggle_quick_open_command_line_sensitivity(self, chk):
"""When the user unchecks 'enable quick open', the command line should be disabled
"""
self.get_widget('quick_open_command_line').set_sensitive(chk.get_active())
self.get_widget('quick_open_in_current_terminal').set_sensitive(chk... | [
"def",
"toggle_quick_open_command_line_sensitivity",
"(",
"self",
",",
"chk",
")",
":",
"self",
".",
"get_widget",
"(",
"'quick_open_command_line'",
")",
".",
"set_sensitive",
"(",
"chk",
".",
"get_active",
"(",
")",
")",
"self",
".",
"get_widget",
"(",
"'quick_... | When the user unchecks 'enable quick open', the command line should be disabled | [
"When",
"the",
"user",
"unchecks",
"enable",
"quick",
"open",
"the",
"command",
"line",
"should",
"be",
"disabled"
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L880-L884 |
222,889 | Guake/guake | guake/prefs.py | PrefsDialog.on_cursor_shape_changed | def on_cursor_shape_changed(self, combo):
"""Changes the value of cursor_shape in dconf
"""
index = combo.get_active()
self.settings.style.set_int('cursor-shape', index) | python | def on_cursor_shape_changed(self, combo):
"""Changes the value of cursor_shape in dconf
"""
index = combo.get_active()
self.settings.style.set_int('cursor-shape', index) | [
"def",
"on_cursor_shape_changed",
"(",
"self",
",",
"combo",
")",
":",
"index",
"=",
"combo",
".",
"get_active",
"(",
")",
"self",
".",
"settings",
".",
"style",
".",
"set_int",
"(",
"'cursor-shape'",
",",
"index",
")"
] | Changes the value of cursor_shape in dconf | [
"Changes",
"the",
"value",
"of",
"cursor_shape",
"in",
"dconf"
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L918-L922 |
222,890 | Guake/guake | guake/prefs.py | PrefsDialog.set_palette_name | def set_palette_name(self, palette_name):
"""If the given palette matches an existing one, shows it in the
combobox
"""
combo = self.get_widget('palette_name')
found = False
log.debug("wanting palette: %r", palette_name)
for i in combo.get_model():
if ... | python | def set_palette_name(self, palette_name):
"""If the given palette matches an existing one, shows it in the
combobox
"""
combo = self.get_widget('palette_name')
found = False
log.debug("wanting palette: %r", palette_name)
for i in combo.get_model():
if ... | [
"def",
"set_palette_name",
"(",
"self",
",",
"palette_name",
")",
":",
"combo",
"=",
"self",
".",
"get_widget",
"(",
"'palette_name'",
")",
"found",
"=",
"False",
"log",
".",
"debug",
"(",
"\"wanting palette: %r\"",
",",
"palette_name",
")",
"for",
"i",
"in"... | If the given palette matches an existing one, shows it in the
combobox | [
"If",
"the",
"given",
"palette",
"matches",
"an",
"existing",
"one",
"shows",
"it",
"in",
"the",
"combobox"
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L944-L957 |
222,891 | Guake/guake | guake/prefs.py | PrefsDialog.set_palette_colors | def set_palette_colors(self, palette):
"""Updates the color buttons with the given palette
"""
palette = palette.split(':')
for i, pal in enumerate(palette):
x, color = Gdk.Color.parse(pal)
self.get_widget('palette_%d' % i).set_color(color) | python | def set_palette_colors(self, palette):
"""Updates the color buttons with the given palette
"""
palette = palette.split(':')
for i, pal in enumerate(palette):
x, color = Gdk.Color.parse(pal)
self.get_widget('palette_%d' % i).set_color(color) | [
"def",
"set_palette_colors",
"(",
"self",
",",
"palette",
")",
":",
"palette",
"=",
"palette",
".",
"split",
"(",
"':'",
")",
"for",
"i",
",",
"pal",
"in",
"enumerate",
"(",
"palette",
")",
":",
"x",
",",
"color",
"=",
"Gdk",
".",
"Color",
".",
"pa... | Updates the color buttons with the given palette | [
"Updates",
"the",
"color",
"buttons",
"with",
"the",
"given",
"palette"
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L1000-L1006 |
222,892 | Guake/guake | guake/prefs.py | PrefsDialog._load_hooks_settings | def _load_hooks_settings(self):
"""load hooks settings"""
log.debug("executing _load_hooks_settings")
hook_show_widget = self.get_widget("hook_show")
hook_show_setting = self.settings.hooks.get_string("show")
if hook_show_widget is not None:
if hook_show_setting is no... | python | def _load_hooks_settings(self):
"""load hooks settings"""
log.debug("executing _load_hooks_settings")
hook_show_widget = self.get_widget("hook_show")
hook_show_setting = self.settings.hooks.get_string("show")
if hook_show_widget is not None:
if hook_show_setting is no... | [
"def",
"_load_hooks_settings",
"(",
"self",
")",
":",
"log",
".",
"debug",
"(",
"\"executing _load_hooks_settings\"",
")",
"hook_show_widget",
"=",
"self",
".",
"get_widget",
"(",
"\"hook_show\"",
")",
"hook_show_setting",
"=",
"self",
".",
"settings",
".",
"hooks... | load hooks settings | [
"load",
"hooks",
"settings"
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L1028-L1035 |
222,893 | Guake/guake | guake/prefs.py | PrefsDialog._load_screen_settings | def _load_screen_settings(self):
"""Load screen settings"""
# display number / use primary display
combo = self.get_widget('display_n')
dest_screen = self.settings.general.get_int('display-n')
# If Guake is configured to use a screen that is not currently attached,
# defa... | python | def _load_screen_settings(self):
"""Load screen settings"""
# display number / use primary display
combo = self.get_widget('display_n')
dest_screen = self.settings.general.get_int('display-n')
# If Guake is configured to use a screen that is not currently attached,
# defa... | [
"def",
"_load_screen_settings",
"(",
"self",
")",
":",
"# display number / use primary display",
"combo",
"=",
"self",
".",
"get_widget",
"(",
"'display_n'",
")",
"dest_screen",
"=",
"self",
".",
"settings",
".",
"general",
".",
"get_int",
"(",
"'display-n'",
")",... | Load screen settings | [
"Load",
"screen",
"settings"
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L1046-L1071 |
222,894 | Guake/guake | guake/prefs.py | PrefsDialog.populate_keys_tree | def populate_keys_tree(self):
"""Reads the HOTKEYS global variable and insert all data in
the TreeStore used by the preferences window treeview.
"""
for group in HOTKEYS:
parent = self.store.append(None, [None, group['label'], None, None])
for item in group['keys'... | python | def populate_keys_tree(self):
"""Reads the HOTKEYS global variable and insert all data in
the TreeStore used by the preferences window treeview.
"""
for group in HOTKEYS:
parent = self.store.append(None, [None, group['label'], None, None])
for item in group['keys'... | [
"def",
"populate_keys_tree",
"(",
"self",
")",
":",
"for",
"group",
"in",
"HOTKEYS",
":",
"parent",
"=",
"self",
".",
"store",
".",
"append",
"(",
"None",
",",
"[",
"None",
",",
"group",
"[",
"'label'",
"]",
",",
"None",
",",
"None",
"]",
")",
"for... | Reads the HOTKEYS global variable and insert all data in
the TreeStore used by the preferences window treeview. | [
"Reads",
"the",
"HOTKEYS",
"global",
"variable",
"and",
"insert",
"all",
"data",
"in",
"the",
"TreeStore",
"used",
"by",
"the",
"preferences",
"window",
"treeview",
"."
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L1340-L1355 |
222,895 | Guake/guake | guake/prefs.py | PrefsDialog.populate_display_n | def populate_display_n(self):
"""Get the number of displays and populate this drop-down box
with them all. Prepend the "always on primary" option.
"""
cb = self.get_widget('display_n')
screen = self.get_widget('config-window').get_screen()
cb.append_text("always on prima... | python | def populate_display_n(self):
"""Get the number of displays and populate this drop-down box
with them all. Prepend the "always on primary" option.
"""
cb = self.get_widget('display_n')
screen = self.get_widget('config-window').get_screen()
cb.append_text("always on prima... | [
"def",
"populate_display_n",
"(",
"self",
")",
":",
"cb",
"=",
"self",
".",
"get_widget",
"(",
"'display_n'",
")",
"screen",
"=",
"self",
".",
"get_widget",
"(",
"'config-window'",
")",
".",
"get_screen",
"(",
")",
"cb",
".",
"append_text",
"(",
"\"always ... | Get the number of displays and populate this drop-down box
with them all. Prepend the "always on primary" option. | [
"Get",
"the",
"number",
"of",
"displays",
"and",
"populate",
"this",
"drop",
"-",
"down",
"box",
"with",
"them",
"all",
".",
"Prepend",
"the",
"always",
"on",
"primary",
"option",
"."
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L1357-L1371 |
222,896 | Guake/guake | guake/prefs.py | PrefsDialog.on_accel_cleared | def on_accel_cleared(self, cellrendereraccel, path):
"""If the user tries to clear a keybinding with the backspace
key this callback will be called and it just fill the model
with an empty key and set the 'disabled' string in dconf path.
"""
dconf_path = self.store[path][HOTKET_M... | python | def on_accel_cleared(self, cellrendereraccel, path):
"""If the user tries to clear a keybinding with the backspace
key this callback will be called and it just fill the model
with an empty key and set the 'disabled' string in dconf path.
"""
dconf_path = self.store[path][HOTKET_M... | [
"def",
"on_accel_cleared",
"(",
"self",
",",
"cellrendereraccel",
",",
"path",
")",
":",
"dconf_path",
"=",
"self",
".",
"store",
"[",
"path",
"]",
"[",
"HOTKET_MODEL_INDEX_DCONF",
"]",
"if",
"dconf_path",
"==",
"\"show-hide\"",
":",
"# cannot disable 'show-hide' ... | If the user tries to clear a keybinding with the backspace
key this callback will be called and it just fill the model
with an empty key and set the 'disabled' string in dconf path. | [
"If",
"the",
"user",
"tries",
"to",
"clear",
"a",
"keybinding",
"with",
"the",
"backspace",
"key",
"this",
"callback",
"will",
"be",
"called",
"and",
"it",
"just",
"fill",
"the",
"model",
"with",
"an",
"empty",
"key",
"and",
"set",
"the",
"disabled",
"st... | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L1438-L1455 |
222,897 | Guake/guake | guake/prefs.py | PrefsDialog.start_editing | def start_editing(self, treeview, event):
"""Make the treeview grab the focus and start editing the cell
that the user has clicked to avoid confusion with two or three
clicks before editing a keybinding.
Thanks to gnome-keybinding-properties.c =)
"""
x, y = int(event.x),... | python | def start_editing(self, treeview, event):
"""Make the treeview grab the focus and start editing the cell
that the user has clicked to avoid confusion with two or three
clicks before editing a keybinding.
Thanks to gnome-keybinding-properties.c =)
"""
x, y = int(event.x),... | [
"def",
"start_editing",
"(",
"self",
",",
"treeview",
",",
"event",
")",
":",
"x",
",",
"y",
"=",
"int",
"(",
"event",
".",
"x",
")",
",",
"int",
"(",
"event",
".",
"y",
")",
"ret",
"=",
"treeview",
".",
"get_path_at_pos",
"(",
"x",
",",
"y",
"... | Make the treeview grab the focus and start editing the cell
that the user has clicked to avoid confusion with two or three
clicks before editing a keybinding.
Thanks to gnome-keybinding-properties.c =) | [
"Make",
"the",
"treeview",
"grab",
"the",
"focus",
"and",
"start",
"editing",
"the",
"cell",
"that",
"the",
"user",
"has",
"clicked",
"to",
"avoid",
"confusion",
"with",
"two",
"or",
"three",
"clicks",
"before",
"editing",
"a",
"keybinding",
"."
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/prefs.py#L1457-L1474 |
222,898 | Guake/guake | guake/utils.py | save_tabs_when_changed | def save_tabs_when_changed(func):
"""Decorator for save-tabs-when-changed
"""
def wrapper(*args, **kwargs):
func(*args, **kwargs)
log.debug("mom, I've been called: %s %s", func.__name__, func)
# Find me the Guake!
clsname = args[0].__class__.__name__
g = None
... | python | def save_tabs_when_changed(func):
"""Decorator for save-tabs-when-changed
"""
def wrapper(*args, **kwargs):
func(*args, **kwargs)
log.debug("mom, I've been called: %s %s", func.__name__, func)
# Find me the Guake!
clsname = args[0].__class__.__name__
g = None
... | [
"def",
"save_tabs_when_changed",
"(",
"func",
")",
":",
"def",
"wrapper",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"func",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"log",
".",
"debug",
"(",
"\"mom, I've been called: %s %s\"",
",",
"f... | Decorator for save-tabs-when-changed | [
"Decorator",
"for",
"save",
"-",
"tabs",
"-",
"when",
"-",
"changed"
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/utils.py#L58-L84 |
222,899 | Guake/guake | guake/utils.py | RectCalculator.get_final_window_monitor | def get_final_window_monitor(cls, settings, window):
"""Gets the final screen number for the main window of guake.
"""
screen = window.get_screen()
# fetch settings
use_mouse = settings.general.get_boolean('mouse-display')
dest_screen = settings.general.get_int('display... | python | def get_final_window_monitor(cls, settings, window):
"""Gets the final screen number for the main window of guake.
"""
screen = window.get_screen()
# fetch settings
use_mouse = settings.general.get_boolean('mouse-display')
dest_screen = settings.general.get_int('display... | [
"def",
"get_final_window_monitor",
"(",
"cls",
",",
"settings",
",",
"window",
")",
":",
"screen",
"=",
"window",
".",
"get_screen",
"(",
")",
"# fetch settings",
"use_mouse",
"=",
"settings",
".",
"general",
".",
"get_boolean",
"(",
"'mouse-display'",
")",
"d... | Gets the final screen number for the main window of guake. | [
"Gets",
"the",
"final",
"screen",
"number",
"for",
"the",
"main",
"window",
"of",
"guake",
"."
] | 4153ef38f9044cbed6494075fce80acd5809df2b | https://github.com/Guake/guake/blob/4153ef38f9044cbed6494075fce80acd5809df2b/guake/utils.py#L312-L341 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.