repo stringlengths 7 55 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 19 28.4k | docstring stringlengths 1 46.9k | docstring_tokens listlengths 1 1.97k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 3
values | summary stringlengths 4 350 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
AgeOfLearning/coeus-unity-python-framework | coeus_unity/transform.py | TransformRef.add_child_ref | def add_child_ref(self, transform_ref):
"""
Adds the TransformRef if it is not already added.
:param transform_ref:
:return:
"""
if not isinstance(transform_ref, TransformRef):
raise ValueError("transform_ref must be of type TransformRef")
for child i... | python | def add_child_ref(self, transform_ref):
"""
Adds the TransformRef if it is not already added.
:param transform_ref:
:return:
"""
if not isinstance(transform_ref, TransformRef):
raise ValueError("transform_ref must be of type TransformRef")
for child i... | [
"def",
"add_child_ref",
"(",
"self",
",",
"transform_ref",
")",
":",
"if",
"not",
"isinstance",
"(",
"transform_ref",
",",
"TransformRef",
")",
":",
"raise",
"ValueError",
"(",
"\"transform_ref must be of type TransformRef\"",
")",
"for",
"child",
"in",
"self",
".... | Adds the TransformRef if it is not already added.
:param transform_ref:
:return: | [
"Adds",
"the",
"TransformRef",
"if",
"it",
"is",
"not",
"already",
"added",
".",
":",
"param",
"transform_ref",
":",
":",
"return",
":"
] | cf8ca6800ace1425d917ea2628dbd05ed959fdd7 | https://github.com/AgeOfLearning/coeus-unity-python-framework/blob/cf8ca6800ace1425d917ea2628dbd05ed959fdd7/coeus_unity/transform.py#L11-L25 | train | Adds the TransformRef to the child of this tag. |
AgeOfLearning/coeus-unity-python-framework | coeus_unity/transform.py | TransformRef.create_child_ref | def create_child_ref(self, transform_path, child_id=None):
"""
Creates a new child TransformRef with transform_path specified.
:param transform_path:
:param child_id:
:return: TransformRef child
"""
transform_ref = TransformRef(transform_path, child_id)
se... | python | def create_child_ref(self, transform_path, child_id=None):
"""
Creates a new child TransformRef with transform_path specified.
:param transform_path:
:param child_id:
:return: TransformRef child
"""
transform_ref = TransformRef(transform_path, child_id)
se... | [
"def",
"create_child_ref",
"(",
"self",
",",
"transform_path",
",",
"child_id",
"=",
"None",
")",
":",
"transform_ref",
"=",
"TransformRef",
"(",
"transform_path",
",",
"child_id",
")",
"self",
".",
"add_child_ref",
"(",
"transform_ref",
")",
"return",
"transfor... | Creates a new child TransformRef with transform_path specified.
:param transform_path:
:param child_id:
:return: TransformRef child | [
"Creates",
"a",
"new",
"child",
"TransformRef",
"with",
"transform_path",
"specified",
".",
":",
"param",
"transform_path",
":",
":",
"param",
"child_id",
":",
":",
"return",
":",
"TransformRef",
"child"
] | cf8ca6800ace1425d917ea2628dbd05ed959fdd7 | https://github.com/AgeOfLearning/coeus-unity-python-framework/blob/cf8ca6800ace1425d917ea2628dbd05ed959fdd7/coeus_unity/transform.py#L27-L36 | train | Creates a new child TransformRef with transform_path specified. |
AgeOfLearning/coeus-unity-python-framework | coeus_unity/transform.py | TransformRef.get_rendered_transform_path | def get_rendered_transform_path(self):
"""
Generates a rendered transform path
that is calculated from all parents.
:return:
"""
path = self.transform_path
parent = self.parent
while parent is not None:
path = "{0}/{1}".format(parent.transform... | python | def get_rendered_transform_path(self):
"""
Generates a rendered transform path
that is calculated from all parents.
:return:
"""
path = self.transform_path
parent = self.parent
while parent is not None:
path = "{0}/{1}".format(parent.transform... | [
"def",
"get_rendered_transform_path",
"(",
"self",
")",
":",
"path",
"=",
"self",
".",
"transform_path",
"parent",
"=",
"self",
".",
"parent",
"while",
"parent",
"is",
"not",
"None",
":",
"path",
"=",
"\"{0}/{1}\"",
".",
"format",
"(",
"parent",
".",
"tran... | Generates a rendered transform path
that is calculated from all parents.
:return: | [
"Generates",
"a",
"rendered",
"transform",
"path",
"that",
"is",
"calculated",
"from",
"all",
"parents",
".",
":",
"return",
":"
] | cf8ca6800ace1425d917ea2628dbd05ed959fdd7 | https://github.com/AgeOfLearning/coeus-unity-python-framework/blob/cf8ca6800ace1425d917ea2628dbd05ed959fdd7/coeus_unity/transform.py#L38-L51 | train | Generates a rendered transform path that is calculated from all parents. |
AgeOfLearning/coeus-unity-python-framework | coeus_unity/transform.py | TransformRef.get_rendered_transform_path_relative | def get_rendered_transform_path_relative(self, relative_transform_ref):
"""
Generates a rendered transform path relative to
parent.
:param relative_transform_ref:
:return:
"""
path = self.transform_path
parent = self.parent
while parent is not Non... | python | def get_rendered_transform_path_relative(self, relative_transform_ref):
"""
Generates a rendered transform path relative to
parent.
:param relative_transform_ref:
:return:
"""
path = self.transform_path
parent = self.parent
while parent is not Non... | [
"def",
"get_rendered_transform_path_relative",
"(",
"self",
",",
"relative_transform_ref",
")",
":",
"path",
"=",
"self",
".",
"transform_path",
"parent",
"=",
"self",
".",
"parent",
"while",
"parent",
"is",
"not",
"None",
"and",
"parent",
"is",
"not",
"relative... | Generates a rendered transform path relative to
parent.
:param relative_transform_ref:
:return: | [
"Generates",
"a",
"rendered",
"transform",
"path",
"relative",
"to",
"parent",
".",
":",
"param",
"relative_transform_ref",
":",
":",
"return",
":"
] | cf8ca6800ace1425d917ea2628dbd05ed959fdd7 | https://github.com/AgeOfLearning/coeus-unity-python-framework/blob/cf8ca6800ace1425d917ea2628dbd05ed959fdd7/coeus_unity/transform.py#L53-L67 | train | Generates a rendered transform path relative to the parent s transform path. |
bitesofcode/projexui | projexui/dialogs/xconfigdialog/xconfigwidget.py | XConfigWidget.refreshUi | def refreshUi( self ):
"""
Load the plugin information to the interface.
"""
dataSet = self.dataSet()
if not dataSet:
return False
# lookup widgets based on the data set information
for widget in self.findChildren(QWidget):
pro... | python | def refreshUi( self ):
"""
Load the plugin information to the interface.
"""
dataSet = self.dataSet()
if not dataSet:
return False
# lookup widgets based on the data set information
for widget in self.findChildren(QWidget):
pro... | [
"def",
"refreshUi",
"(",
"self",
")",
":",
"dataSet",
"=",
"self",
".",
"dataSet",
"(",
")",
"if",
"not",
"dataSet",
":",
"return",
"False",
"# lookup widgets based on the data set information",
"for",
"widget",
"in",
"self",
".",
"findChildren",
"(",
"QWidget",... | Load the plugin information to the interface. | [
"Load",
"the",
"plugin",
"information",
"to",
"the",
"interface",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xconfigdialog/xconfigwidget.py#L57-L77 | train | Refresh the ui for the current plugin. |
bitesofcode/projexui | projexui/dialogs/xconfigdialog/xconfigwidget.py | XConfigWidget.reset | def reset( self ):
"""
Resets the ui information to the default data for the widget.
"""
if not self.plugin():
return False
self.plugin().reset()
self.refreshUi()
return True | python | def reset( self ):
"""
Resets the ui information to the default data for the widget.
"""
if not self.plugin():
return False
self.plugin().reset()
self.refreshUi()
return True | [
"def",
"reset",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"plugin",
"(",
")",
":",
"return",
"False",
"self",
".",
"plugin",
"(",
")",
".",
"reset",
"(",
")",
"self",
".",
"refreshUi",
"(",
")",
"return",
"True"
] | Resets the ui information to the default data for the widget. | [
"Resets",
"the",
"ui",
"information",
"to",
"the",
"default",
"data",
"for",
"the",
"widget",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xconfigdialog/xconfigwidget.py#L79-L89 | train | Resets the ui information to the default data for the widget. |
bitesofcode/projexui | projexui/dialogs/xconfigdialog/xconfigwidget.py | XConfigWidget.save | def save( self ):
"""
Saves the ui information to the data for this widget's data set.
:return <bool> saved
"""
dataSet = self.dataSet()
if ( not dataSet ):
return True
# lookup widgets based on the data set information
fo... | python | def save( self ):
"""
Saves the ui information to the data for this widget's data set.
:return <bool> saved
"""
dataSet = self.dataSet()
if ( not dataSet ):
return True
# lookup widgets based on the data set information
fo... | [
"def",
"save",
"(",
"self",
")",
":",
"dataSet",
"=",
"self",
".",
"dataSet",
"(",
")",
"if",
"(",
"not",
"dataSet",
")",
":",
"return",
"True",
"# lookup widgets based on the data set information",
"for",
"widget",
"in",
"self",
".",
"findChildren",
"(",
"Q... | Saves the ui information to the data for this widget's data set.
:return <bool> saved | [
"Saves",
"the",
"ui",
"information",
"to",
"the",
"data",
"for",
"this",
"widget",
"s",
"data",
"set",
".",
":",
"return",
"<bool",
">",
"saved"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/dialogs/xconfigdialog/xconfigwidget.py#L91-L114 | train | Saves the ui information to the data for this widget s data set. |
talkincode/txradius | txradius/mschap/des_c.py | c2ln | def c2ln(c,l1,l2,n):
"char[n] to two unsigned long???"
c = c + n
l1, l2 = U32(0), U32(0)
f = 0
if n == 8:
l2 = l2 | (U32(c[7]) << 24)
f = 1
if f or (n == 7):
l2 = l2 | (U32(c[6]) << 16)
f = 1
if f or (n == 6):
l2 = l2 | (U32(c[5]) << 8)
f = 1
... | python | def c2ln(c,l1,l2,n):
"char[n] to two unsigned long???"
c = c + n
l1, l2 = U32(0), U32(0)
f = 0
if n == 8:
l2 = l2 | (U32(c[7]) << 24)
f = 1
if f or (n == 7):
l2 = l2 | (U32(c[6]) << 16)
f = 1
if f or (n == 6):
l2 = l2 | (U32(c[5]) << 8)
f = 1
... | [
"def",
"c2ln",
"(",
"c",
",",
"l1",
",",
"l2",
",",
"n",
")",
":",
"c",
"=",
"c",
"+",
"n",
"l1",
",",
"l2",
"=",
"U32",
"(",
"0",
")",
",",
"U32",
"(",
"0",
")",
"f",
"=",
"0",
"if",
"n",
"==",
"8",
":",
"l2",
"=",
"l2",
"|",
"(",
... | char[n] to two unsigned long??? | [
"char",
"[",
"n",
"]",
"to",
"two",
"unsigned",
"long???"
] | b86fdbc9be41183680b82b07d3a8e8ea10926e01 | https://github.com/talkincode/txradius/blob/b86fdbc9be41183680b82b07d3a8e8ea10926e01/txradius/mschap/des_c.py#L35-L64 | train | char n to two unsigned long?? |
talkincode/txradius | txradius/mschap/des_c.py | n2l | def n2l(c, l):
"network to host long"
l = U32(c[0] << 24)
l = l | (U32(c[1]) << 16)
l = l | (U32(c[2]) << 8)
l = l | (U32(c[3]))
return l | python | def n2l(c, l):
"network to host long"
l = U32(c[0] << 24)
l = l | (U32(c[1]) << 16)
l = l | (U32(c[2]) << 8)
l = l | (U32(c[3]))
return l | [
"def",
"n2l",
"(",
"c",
",",
"l",
")",
":",
"l",
"=",
"U32",
"(",
"c",
"[",
"0",
"]",
"<<",
"24",
")",
"l",
"=",
"l",
"|",
"(",
"U32",
"(",
"c",
"[",
"1",
"]",
")",
"<<",
"16",
")",
"l",
"=",
"l",
"|",
"(",
"U32",
"(",
"c",
"[",
"... | network to host long | [
"network",
"to",
"host",
"long"
] | b86fdbc9be41183680b82b07d3a8e8ea10926e01 | https://github.com/talkincode/txradius/blob/b86fdbc9be41183680b82b07d3a8e8ea10926e01/txradius/mschap/des_c.py#L75-L81 | train | network to host long |
talkincode/txradius | txradius/mschap/des_c.py | l2n | def l2n(l, c):
"host to network long"
c = []
c.append(int((l >> 24) & U32(0xFF)))
c.append(int((l >> 16) & U32(0xFF)))
c.append(int((l >> 8) & U32(0xFF)))
c.append(int((l ) & U32(0xFF)))
return c | python | def l2n(l, c):
"host to network long"
c = []
c.append(int((l >> 24) & U32(0xFF)))
c.append(int((l >> 16) & U32(0xFF)))
c.append(int((l >> 8) & U32(0xFF)))
c.append(int((l ) & U32(0xFF)))
return c | [
"def",
"l2n",
"(",
"l",
",",
"c",
")",
":",
"c",
"=",
"[",
"]",
"c",
".",
"append",
"(",
"int",
"(",
"(",
"l",
">>",
"24",
")",
"&",
"U32",
"(",
"0xFF",
")",
")",
")",
"c",
".",
"append",
"(",
"int",
"(",
"(",
"l",
">>",
"16",
")",
"&... | host to network long | [
"host",
"to",
"network",
"long"
] | b86fdbc9be41183680b82b07d3a8e8ea10926e01 | https://github.com/talkincode/txradius/blob/b86fdbc9be41183680b82b07d3a8e8ea10926e01/txradius/mschap/des_c.py#L83-L90 | train | host to network long |
talkincode/txradius | txradius/mschap/des_c.py | HPERM_OP | def HPERM_OP (tup, n, m):
"tup - (a, t)"
a, t = tup
t = ((a << (16 - n)) ^ a) & m
a = a ^ t ^ (t >> (16 - n))
return (a, t) | python | def HPERM_OP (tup, n, m):
"tup - (a, t)"
a, t = tup
t = ((a << (16 - n)) ^ a) & m
a = a ^ t ^ (t >> (16 - n))
return (a, t) | [
"def",
"HPERM_OP",
"(",
"tup",
",",
"n",
",",
"m",
")",
":",
"a",
",",
"t",
"=",
"tup",
"t",
"=",
"(",
"(",
"a",
"<<",
"(",
"16",
"-",
"n",
")",
")",
"^",
"a",
")",
"&",
"m",
"a",
"=",
"a",
"^",
"t",
"^",
"(",
"t",
">>",
"(",
"16",
... | tup - (a, t) | [
"tup",
"-",
"(",
"a",
"t",
")"
] | b86fdbc9be41183680b82b07d3a8e8ea10926e01 | https://github.com/talkincode/txradius/blob/b86fdbc9be41183680b82b07d3a8e8ea10926e01/txradius/mschap/des_c.py#L153-L158 | train | tup - a t n - m |
bearyinnovative/bearychat.py | bearychat/rtm_client.py | RTMClient.start | def start(self):
"""Gets the rtm ws_host and user information
Returns:
None if request failed,
else a dict containing "user"(User) and "ws_host"
"""
resp = self.post('start')
if resp.is_fail():
return None
if 'result' not in resp.data... | python | def start(self):
"""Gets the rtm ws_host and user information
Returns:
None if request failed,
else a dict containing "user"(User) and "ws_host"
"""
resp = self.post('start')
if resp.is_fail():
return None
if 'result' not in resp.data... | [
"def",
"start",
"(",
"self",
")",
":",
"resp",
"=",
"self",
".",
"post",
"(",
"'start'",
")",
"if",
"resp",
".",
"is_fail",
"(",
")",
":",
"return",
"None",
"if",
"'result'",
"not",
"in",
"resp",
".",
"data",
":",
"return",
"None",
"result",
"=",
... | Gets the rtm ws_host and user information
Returns:
None if request failed,
else a dict containing "user"(User) and "ws_host" | [
"Gets",
"the",
"rtm",
"ws_host",
"and",
"user",
"information"
] | 6c7af2d215c2ff7135bb5af66ca333d0ea1089fd | https://github.com/bearyinnovative/bearychat.py/blob/6c7af2d215c2ff7135bb5af66ca333d0ea1089fd/bearychat/rtm_client.py#L52-L70 | train | Gets the rtm ws_host and user information
Returns None if request failed |
bearyinnovative/bearychat.py | bearychat/rtm_client.py | RTMClient.do | def do(self,
resource,
method,
params=None,
data=None,
json=None,
headers=None):
"""Does the request job
Args:
resource(str): resource uri(relative path)
method(str): HTTP method
params(dict): uri quer... | python | def do(self,
resource,
method,
params=None,
data=None,
json=None,
headers=None):
"""Does the request job
Args:
resource(str): resource uri(relative path)
method(str): HTTP method
params(dict): uri quer... | [
"def",
"do",
"(",
"self",
",",
"resource",
",",
"method",
",",
"params",
"=",
"None",
",",
"data",
"=",
"None",
",",
"json",
"=",
"None",
",",
"headers",
"=",
"None",
")",
":",
"uri",
"=",
"\"{0}/{1}\"",
".",
"format",
"(",
"self",
".",
"_api_base"... | Does the request job
Args:
resource(str): resource uri(relative path)
method(str): HTTP method
params(dict): uri queries
data(dict): HTTP body(form)
json(dict): HTTP body(json)
headers(dict): HTTP headers
Returns:
RTMR... | [
"Does",
"the",
"request",
"job"
] | 6c7af2d215c2ff7135bb5af66ca333d0ea1089fd | https://github.com/bearyinnovative/bearychat.py/blob/6c7af2d215c2ff7135bb5af66ca333d0ea1089fd/bearychat/rtm_client.py#L72-L108 | train | Does the request job
|
bearyinnovative/bearychat.py | bearychat/rtm_client.py | RTMClient.get | def get(self, resource, params=None, headers=None):
"""Sends a GET request
Returns:
RTMResponse
"""
return self.do(resource, 'GET', params=params, headers=headers) | python | def get(self, resource, params=None, headers=None):
"""Sends a GET request
Returns:
RTMResponse
"""
return self.do(resource, 'GET', params=params, headers=headers) | [
"def",
"get",
"(",
"self",
",",
"resource",
",",
"params",
"=",
"None",
",",
"headers",
"=",
"None",
")",
":",
"return",
"self",
".",
"do",
"(",
"resource",
",",
"'GET'",
",",
"params",
"=",
"params",
",",
"headers",
"=",
"headers",
")"
] | Sends a GET request
Returns:
RTMResponse | [
"Sends",
"a",
"GET",
"request"
] | 6c7af2d215c2ff7135bb5af66ca333d0ea1089fd | https://github.com/bearyinnovative/bearychat.py/blob/6c7af2d215c2ff7135bb5af66ca333d0ea1089fd/bearychat/rtm_client.py#L110-L116 | train | Sends a GET request to obtain a specific resource from the cache. |
bearyinnovative/bearychat.py | bearychat/rtm_client.py | RTMClient.post | def post(self, resource, data=None, json=None):
"""Sends a POST request
Returns:
RTMResponse
"""
return self.do(resource, 'POST', data=data, json=json) | python | def post(self, resource, data=None, json=None):
"""Sends a POST request
Returns:
RTMResponse
"""
return self.do(resource, 'POST', data=data, json=json) | [
"def",
"post",
"(",
"self",
",",
"resource",
",",
"data",
"=",
"None",
",",
"json",
"=",
"None",
")",
":",
"return",
"self",
".",
"do",
"(",
"resource",
",",
"'POST'",
",",
"data",
"=",
"data",
",",
"json",
"=",
"json",
")"
] | Sends a POST request
Returns:
RTMResponse | [
"Sends",
"a",
"POST",
"request"
] | 6c7af2d215c2ff7135bb5af66ca333d0ea1089fd | https://github.com/bearyinnovative/bearychat.py/blob/6c7af2d215c2ff7135bb5af66ca333d0ea1089fd/bearychat/rtm_client.py#L118-L124 | train | Sends a POST request to the resource specified in the data parameter. |
intelsdi-x/snap-plugin-lib-py | snap_plugin/v1/collector_proxy.py | _CollectorProxy.CollectMetrics | def CollectMetrics(self, request, context):
"""Dispatches the request to the plugins collect method"""
LOG.debug("CollectMetrics called")
try:
metrics_to_collect = []
for metric in request.metrics:
metrics_to_collect.append(Metric(pb=metric))
m... | python | def CollectMetrics(self, request, context):
"""Dispatches the request to the plugins collect method"""
LOG.debug("CollectMetrics called")
try:
metrics_to_collect = []
for metric in request.metrics:
metrics_to_collect.append(Metric(pb=metric))
m... | [
"def",
"CollectMetrics",
"(",
"self",
",",
"request",
",",
"context",
")",
":",
"LOG",
".",
"debug",
"(",
"\"CollectMetrics called\"",
")",
"try",
":",
"metrics_to_collect",
"=",
"[",
"]",
"for",
"metric",
"in",
"request",
".",
"metrics",
":",
"metrics_to_co... | Dispatches the request to the plugins collect method | [
"Dispatches",
"the",
"request",
"to",
"the",
"plugins",
"collect",
"method"
] | 8da5d00ac5f9d2b48a7239563ac7788209891ca4 | https://github.com/intelsdi-x/snap-plugin-lib-py/blob/8da5d00ac5f9d2b48a7239563ac7788209891ca4/snap_plugin/v1/collector_proxy.py#L36-L48 | train | Dispatches the request to the plugins collect method |
intelsdi-x/snap-plugin-lib-py | snap_plugin/v1/plugin_proxy.py | PluginProxy.GetConfigPolicy | def GetConfigPolicy(self, request, context):
"""Dispatches the request to the plugins get_config_policy method"""
try:
policy = self.plugin.get_config_policy()
return policy._pb
except Exception as err:
msg = "message: {}\n\nstack trace: {}".format(
... | python | def GetConfigPolicy(self, request, context):
"""Dispatches the request to the plugins get_config_policy method"""
try:
policy = self.plugin.get_config_policy()
return policy._pb
except Exception as err:
msg = "message: {}\n\nstack trace: {}".format(
... | [
"def",
"GetConfigPolicy",
"(",
"self",
",",
"request",
",",
"context",
")",
":",
"try",
":",
"policy",
"=",
"self",
".",
"plugin",
".",
"get_config_policy",
"(",
")",
"return",
"policy",
".",
"_pb",
"except",
"Exception",
"as",
"err",
":",
"msg",
"=",
... | Dispatches the request to the plugins get_config_policy method | [
"Dispatches",
"the",
"request",
"to",
"the",
"plugins",
"get_config_policy",
"method"
] | 8da5d00ac5f9d2b48a7239563ac7788209891ca4 | https://github.com/intelsdi-x/snap-plugin-lib-py/blob/8da5d00ac5f9d2b48a7239563ac7788209891ca4/snap_plugin/v1/plugin_proxy.py#L43-L51 | train | Dispatches the request to the plugins get_config_policy method and returns the object that represents the current config policy. |
wrboyce/telegrambot | telegrambot/api/__init__.py | TelegramAPIMixin.send_message | def send_message(self, text, chat_id, reply_to_message_id=None, disable_web_page_preview=False, reply_markup=None):
"""
Use this method to send text messages. On success, the sent Message is returned.
"""
self.logger.info('sending message "%s"', format(text.replace('\n', '\\n')))
... | python | def send_message(self, text, chat_id, reply_to_message_id=None, disable_web_page_preview=False, reply_markup=None):
"""
Use this method to send text messages. On success, the sent Message is returned.
"""
self.logger.info('sending message "%s"', format(text.replace('\n', '\\n')))
... | [
"def",
"send_message",
"(",
"self",
",",
"text",
",",
"chat_id",
",",
"reply_to_message_id",
"=",
"None",
",",
"disable_web_page_preview",
"=",
"False",
",",
"reply_markup",
"=",
"None",
")",
":",
"self",
".",
"logger",
".",
"info",
"(",
"'sending message \"%s... | Use this method to send text messages. On success, the sent Message is returned. | [
"Use",
"this",
"method",
"to",
"send",
"text",
"messages",
".",
"On",
"success",
"the",
"sent",
"Message",
"is",
"returned",
"."
] | c35ce19886df4c306a2a19851cc1f63e3066d70d | https://github.com/wrboyce/telegrambot/blob/c35ce19886df4c306a2a19851cc1f63e3066d70d/telegrambot/api/__init__.py#L63-L73 | train | Use this method to send text messages. |
wrboyce/telegrambot | telegrambot/api/__init__.py | TelegramAPIMixin.forward_message | def forward_message(self, chat_id, from_chat_id, message_id):
"""
Use this method to forward messages of any kind. On success, the sent Message is returned.
"""
self.logger.info('forwarding message %s from %s to %s', message_id, from_chat_id, chat_id)
payload = dict(chat_id=c... | python | def forward_message(self, chat_id, from_chat_id, message_id):
"""
Use this method to forward messages of any kind. On success, the sent Message is returned.
"""
self.logger.info('forwarding message %s from %s to %s', message_id, from_chat_id, chat_id)
payload = dict(chat_id=c... | [
"def",
"forward_message",
"(",
"self",
",",
"chat_id",
",",
"from_chat_id",
",",
"message_id",
")",
":",
"self",
".",
"logger",
".",
"info",
"(",
"'forwarding message %s from %s to %s'",
",",
"message_id",
",",
"from_chat_id",
",",
"chat_id",
")",
"payload",
"="... | Use this method to forward messages of any kind. On success, the sent Message is returned. | [
"Use",
"this",
"method",
"to",
"forward",
"messages",
"of",
"any",
"kind",
".",
"On",
"success",
"the",
"sent",
"Message",
"is",
"returned",
"."
] | c35ce19886df4c306a2a19851cc1f63e3066d70d | https://github.com/wrboyce/telegrambot/blob/c35ce19886df4c306a2a19851cc1f63e3066d70d/telegrambot/api/__init__.py#L75-L83 | train | Use this method to forward a message from one chat to another. |
wrboyce/telegrambot | telegrambot/api/__init__.py | TelegramAPIMixin.send_photo | def send_photo(self, chat_id, photo, caption=None, reply_to_message_id=None, reply_markup=None):
"""
Use this method to send photos. On success, the sent Message is returned.
"""
self.logger.info('send photo %s', photo)
payload = dict(chat_id=chat_id,
c... | python | def send_photo(self, chat_id, photo, caption=None, reply_to_message_id=None, reply_markup=None):
"""
Use this method to send photos. On success, the sent Message is returned.
"""
self.logger.info('send photo %s', photo)
payload = dict(chat_id=chat_id,
c... | [
"def",
"send_photo",
"(",
"self",
",",
"chat_id",
",",
"photo",
",",
"caption",
"=",
"None",
",",
"reply_to_message_id",
"=",
"None",
",",
"reply_markup",
"=",
"None",
")",
":",
"self",
".",
"logger",
".",
"info",
"(",
"'send photo %s'",
",",
"photo",
")... | Use this method to send photos. On success, the sent Message is returned. | [
"Use",
"this",
"method",
"to",
"send",
"photos",
".",
"On",
"success",
"the",
"sent",
"Message",
"is",
"returned",
"."
] | c35ce19886df4c306a2a19851cc1f63e3066d70d | https://github.com/wrboyce/telegrambot/blob/c35ce19886df4c306a2a19851cc1f63e3066d70d/telegrambot/api/__init__.py#L85-L95 | train | Use this method to send photos. You must be an administrator in the chat for this to work and must have the appropriate admin rights. |
wrboyce/telegrambot | telegrambot/api/__init__.py | TelegramAPIMixin.send_audio | def send_audio(self, chat_id, audio, duration=None, performer=None, title=None, reply_to_message_id=None, reply_markup=None):
"""
Use this method to send audio files, if you want Telegram clients to display them in the music player.
Your audio must be in the .mp3 format. On success, the ... | python | def send_audio(self, chat_id, audio, duration=None, performer=None, title=None, reply_to_message_id=None, reply_markup=None):
"""
Use this method to send audio files, if you want Telegram clients to display them in the music player.
Your audio must be in the .mp3 format. On success, the ... | [
"def",
"send_audio",
"(",
"self",
",",
"chat_id",
",",
"audio",
",",
"duration",
"=",
"None",
",",
"performer",
"=",
"None",
",",
"title",
"=",
"None",
",",
"reply_to_message_id",
"=",
"None",
",",
"reply_markup",
"=",
"None",
")",
":",
"self",
".",
"l... | Use this method to send audio files, if you want Telegram clients to display them in the music player.
Your audio must be in the .mp3 format. On success, the sent Message is returned. Bots can currently send
audio files of up to 50 MB in size, this limit may be changed in the future.
... | [
"Use",
"this",
"method",
"to",
"send",
"audio",
"files",
"if",
"you",
"want",
"Telegram",
"clients",
"to",
"display",
"them",
"in",
"the",
"music",
"player",
".",
"Your",
"audio",
"must",
"be",
"in",
"the",
".",
"mp3",
"format",
".",
"On",
"success",
"... | c35ce19886df4c306a2a19851cc1f63e3066d70d | https://github.com/wrboyce/telegrambot/blob/c35ce19886df4c306a2a19851cc1f63e3066d70d/telegrambot/api/__init__.py#L97-L118 | train | Use this method to send audio files. You can use this method to send audio files in a Telegram chat. You can use the audio file to send a message. You can use the send_voice method to send voice messages. |
wrboyce/telegrambot | telegrambot/api/__init__.py | TelegramAPIMixin.send_document | def send_document(self, chat_id=None, document=None, reply_to_message_id=None, reply_markup=None):
"""
Use this method to send general files. On success, the sent Message is returned.
Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the futur... | python | def send_document(self, chat_id=None, document=None, reply_to_message_id=None, reply_markup=None):
"""
Use this method to send general files. On success, the sent Message is returned.
Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the futur... | [
"def",
"send_document",
"(",
"self",
",",
"chat_id",
"=",
"None",
",",
"document",
"=",
"None",
",",
"reply_to_message_id",
"=",
"None",
",",
"reply_markup",
"=",
"None",
")",
":",
"payload",
"=",
"dict",
"(",
"chat_id",
"=",
"chat_id",
",",
"reply_to_mess... | Use this method to send general files. On success, the sent Message is returned.
Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future. | [
"Use",
"this",
"method",
"to",
"send",
"general",
"files",
".",
"On",
"success",
"the",
"sent",
"Message",
"is",
"returned",
".",
"Bots",
"can",
"currently",
"send",
"files",
"of",
"any",
"type",
"of",
"up",
"to",
"50",
"MB",
"in",
"size",
"this",
"lim... | c35ce19886df4c306a2a19851cc1f63e3066d70d | https://github.com/wrboyce/telegrambot/blob/c35ce19886df4c306a2a19851cc1f63e3066d70d/telegrambot/api/__init__.py#L120-L129 | train | Use this method to send a document to a chat. |
wrboyce/telegrambot | telegrambot/api/__init__.py | TelegramAPIMixin.send_sticker | def send_sticker(self, chat_id=None, sticker=None, reply_to_message_id=None, reply_markup=None):
"""
Use this method to send .webp stickers. On success, the sent Message is returned.
"""
payload = dict(chat_id=chat_id,
reply_to_message_id=reply_to_message_id,
... | python | def send_sticker(self, chat_id=None, sticker=None, reply_to_message_id=None, reply_markup=None):
"""
Use this method to send .webp stickers. On success, the sent Message is returned.
"""
payload = dict(chat_id=chat_id,
reply_to_message_id=reply_to_message_id,
... | [
"def",
"send_sticker",
"(",
"self",
",",
"chat_id",
"=",
"None",
",",
"sticker",
"=",
"None",
",",
"reply_to_message_id",
"=",
"None",
",",
"reply_markup",
"=",
"None",
")",
":",
"payload",
"=",
"dict",
"(",
"chat_id",
"=",
"chat_id",
",",
"reply_to_messag... | Use this method to send .webp stickers. On success, the sent Message is returned. | [
"Use",
"this",
"method",
"to",
"send",
".",
"webp",
"stickers",
".",
"On",
"success",
"the",
"sent",
"Message",
"is",
"returned",
"."
] | c35ce19886df4c306a2a19851cc1f63e3066d70d | https://github.com/wrboyce/telegrambot/blob/c35ce19886df4c306a2a19851cc1f63e3066d70d/telegrambot/api/__init__.py#L131-L139 | train | Use this method to send a. webp sticker. |
wrboyce/telegrambot | telegrambot/api/__init__.py | TelegramAPIMixin.send_video | def send_video(self, chat_id, video, duration=None, caption=None, reply_to_message_id=None, reply_markup=None):
"""
Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as
Document). On success, the sent Message is returned. Bots can current... | python | def send_video(self, chat_id, video, duration=None, caption=None, reply_to_message_id=None, reply_markup=None):
"""
Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as
Document). On success, the sent Message is returned. Bots can current... | [
"def",
"send_video",
"(",
"self",
",",
"chat_id",
",",
"video",
",",
"duration",
"=",
"None",
",",
"caption",
"=",
"None",
",",
"reply_to_message_id",
"=",
"None",
",",
"reply_markup",
"=",
"None",
")",
":",
"payload",
"=",
"dict",
"(",
"chat_id",
"=",
... | Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as
Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB
in size, this limit may be changed in the future. | [
"Use",
"this",
"method",
"to",
"send",
"video",
"files",
"Telegram",
"clients",
"support",
"mp4",
"videos",
"(",
"other",
"formats",
"may",
"be",
"sent",
"as",
"Document",
")",
".",
"On",
"success",
"the",
"sent",
"Message",
"is",
"returned",
".",
"Bots",
... | c35ce19886df4c306a2a19851cc1f63e3066d70d | https://github.com/wrboyce/telegrambot/blob/c35ce19886df4c306a2a19851cc1f63e3066d70d/telegrambot/api/__init__.py#L141-L153 | train | Use this method to send video files. You must be an administrator in the chat for this to work and must have the appropriate admin rights. |
wrboyce/telegrambot | telegrambot/api/__init__.py | TelegramAPIMixin.send_location | def send_location(self, loc, to, reply=None):
"""
Use this method to send point on the map. On success, the sent Message is returned.
"""
lat, lon = loc
payload = dict(chat_id=to, reply_to_message_id=reply,
latitude=lat, longitude=lon)
return Me... | python | def send_location(self, loc, to, reply=None):
"""
Use this method to send point on the map. On success, the sent Message is returned.
"""
lat, lon = loc
payload = dict(chat_id=to, reply_to_message_id=reply,
latitude=lat, longitude=lon)
return Me... | [
"def",
"send_location",
"(",
"self",
",",
"loc",
",",
"to",
",",
"reply",
"=",
"None",
")",
":",
"lat",
",",
"lon",
"=",
"loc",
"payload",
"=",
"dict",
"(",
"chat_id",
"=",
"to",
",",
"reply_to_message_id",
"=",
"reply",
",",
"latitude",
"=",
"lat",
... | Use this method to send point on the map. On success, the sent Message is returned. | [
"Use",
"this",
"method",
"to",
"send",
"point",
"on",
"the",
"map",
".",
"On",
"success",
"the",
"sent",
"Message",
"is",
"returned",
"."
] | c35ce19886df4c306a2a19851cc1f63e3066d70d | https://github.com/wrboyce/telegrambot/blob/c35ce19886df4c306a2a19851cc1f63e3066d70d/telegrambot/api/__init__.py#L169-L176 | train | Send a location to a specific user. |
wrboyce/telegrambot | telegrambot/api/__init__.py | TelegramAPIMixin.send_chat_action | def send_chat_action(self, action, to):
"""
Use this method when you need to tell the user that something is happening on the bot's side.
The status is set for 5 seconds or less (when a message arrives from your bot,
Telegram clients clear its typing status).
"""
... | python | def send_chat_action(self, action, to):
"""
Use this method when you need to tell the user that something is happening on the bot's side.
The status is set for 5 seconds or less (when a message arrives from your bot,
Telegram clients clear its typing status).
"""
... | [
"def",
"send_chat_action",
"(",
"self",
",",
"action",
",",
"to",
")",
":",
"payload",
"=",
"dict",
"(",
"chat_id",
"=",
"to",
",",
"action",
"=",
"action",
")",
"return",
"self",
".",
"_get",
"(",
"'sendChatAction'",
",",
"payload",
")"
] | Use this method when you need to tell the user that something is happening on the bot's side.
The status is set for 5 seconds or less (when a message arrives from your bot,
Telegram clients clear its typing status). | [
"Use",
"this",
"method",
"when",
"you",
"need",
"to",
"tell",
"the",
"user",
"that",
"something",
"is",
"happening",
"on",
"the",
"bot",
"s",
"side",
".",
"The",
"status",
"is",
"set",
"for",
"5",
"seconds",
"or",
"less",
"(",
"when",
"a",
"message",
... | c35ce19886df4c306a2a19851cc1f63e3066d70d | https://github.com/wrboyce/telegrambot/blob/c35ce19886df4c306a2a19851cc1f63e3066d70d/telegrambot/api/__init__.py#L178-L185 | train | Send a chat action to a specific user. |
wrboyce/telegrambot | telegrambot/api/__init__.py | TelegramAPIMixin.get_updates | def get_updates(self, offset=None, limit=None, timeout=None):
"""
Use this method to receive incoming updates using long polling (wiki).
An Array of Update objects is returned.
"""
payload = dict(offset=offset, limit=limit, timeout=timeout)
return self._get('getUp... | python | def get_updates(self, offset=None, limit=None, timeout=None):
"""
Use this method to receive incoming updates using long polling (wiki).
An Array of Update objects is returned.
"""
payload = dict(offset=offset, limit=limit, timeout=timeout)
return self._get('getUp... | [
"def",
"get_updates",
"(",
"self",
",",
"offset",
"=",
"None",
",",
"limit",
"=",
"None",
",",
"timeout",
"=",
"None",
")",
":",
"payload",
"=",
"dict",
"(",
"offset",
"=",
"offset",
",",
"limit",
"=",
"limit",
",",
"timeout",
"=",
"timeout",
")",
... | Use this method to receive incoming updates using long polling (wiki).
An Array of Update objects is returned. | [
"Use",
"this",
"method",
"to",
"receive",
"incoming",
"updates",
"using",
"long",
"polling",
"(",
"wiki",
")",
".",
"An",
"Array",
"of",
"Update",
"objects",
"is",
"returned",
"."
] | c35ce19886df4c306a2a19851cc1f63e3066d70d | https://github.com/wrboyce/telegrambot/blob/c35ce19886df4c306a2a19851cc1f63e3066d70d/telegrambot/api/__init__.py#L193-L199 | train | Get updates from the specified region. |
wrboyce/telegrambot | telegrambot/api/__init__.py | TelegramAPIMixin.set_web_hook | def set_web_hook(self, url=None, certificate=None):
"""
Use this method to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an
update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized
Update... | python | def set_web_hook(self, url=None, certificate=None):
"""
Use this method to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an
update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized
Update... | [
"def",
"set_web_hook",
"(",
"self",
",",
"url",
"=",
"None",
",",
"certificate",
"=",
"None",
")",
":",
"payload",
"=",
"dict",
"(",
"url",
"=",
"url",
",",
"certificate",
"=",
"certificate",
")",
"return",
"self",
".",
"_get",
"(",
"'setWebHook'",
","... | Use this method to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an
update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized
Update. In case of an unsuccessful request, we will give up after a reasonable amo... | [
"Use",
"this",
"method",
"to",
"specify",
"a",
"url",
"and",
"receive",
"incoming",
"updates",
"via",
"an",
"outgoing",
"webhook",
".",
"Whenever",
"there",
"is",
"an",
"update",
"for",
"the",
"bot",
"we",
"will",
"send",
"an",
"HTTPS",
"POST",
"request",
... | c35ce19886df4c306a2a19851cc1f63e3066d70d | https://github.com/wrboyce/telegrambot/blob/c35ce19886df4c306a2a19851cc1f63e3066d70d/telegrambot/api/__init__.py#L201-L208 | train | This method will send an outgoing webhook to the specified url and receive incoming updates via an outgoing webhook. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidgetitem.py | XGanttWidgetItem.addChild | def addChild(self, item):
"""
Adds a new child item to this item.
:param item | <XGanttWidgetItem>
"""
super(XGanttWidgetItem, self).addChild(item)
item.sync() | python | def addChild(self, item):
"""
Adds a new child item to this item.
:param item | <XGanttWidgetItem>
"""
super(XGanttWidgetItem, self).addChild(item)
item.sync() | [
"def",
"addChild",
"(",
"self",
",",
"item",
")",
":",
"super",
"(",
"XGanttWidgetItem",
",",
"self",
")",
".",
"addChild",
"(",
"item",
")",
"item",
".",
"sync",
"(",
")"
] | Adds a new child item to this item.
:param item | <XGanttWidgetItem> | [
"Adds",
"a",
"new",
"child",
"item",
"to",
"this",
"item",
".",
":",
"param",
"item",
"|",
"<XGanttWidgetItem",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidgetitem.py#L74-L82 | train | Adds a new child item to this item. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidgetitem.py | XGanttWidgetItem.addDependency | def addDependency(self, item):
"""
Creates a dependency for this item to the next item. This item will
be treated as the source, the other as the target.
:param item | <QGanttWidgetItem>
"""
if item in self._dependencies:
return
... | python | def addDependency(self, item):
"""
Creates a dependency for this item to the next item. This item will
be treated as the source, the other as the target.
:param item | <QGanttWidgetItem>
"""
if item in self._dependencies:
return
... | [
"def",
"addDependency",
"(",
"self",
",",
"item",
")",
":",
"if",
"item",
"in",
"self",
".",
"_dependencies",
":",
"return",
"viewItem",
"=",
"XGanttDepItem",
"(",
"self",
",",
"item",
")",
"self",
".",
"_dependencies",
"[",
"item",
"]",
"=",
"viewItem",... | Creates a dependency for this item to the next item. This item will
be treated as the source, the other as the target.
:param item | <QGanttWidgetItem> | [
"Creates",
"a",
"dependency",
"for",
"this",
"item",
"to",
"the",
"next",
"item",
".",
"This",
"item",
"will",
"be",
"treated",
"as",
"the",
"source",
"the",
"other",
"as",
"the",
"target",
".",
":",
"param",
"item",
"|",
"<QGanttWidgetItem",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidgetitem.py#L84-L99 | train | Adds a dependency for this item to the next item. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidgetitem.py | XGanttWidgetItem.adjustChildren | def adjustChildren(self, delta, secs=False):
"""
Shifts the children for this item by the inputed number of days.
:param delta | <int>
"""
if self.adjustmentsBlocked('children'):
return
if self.itemStyle() != self.ItemStyle.... | python | def adjustChildren(self, delta, secs=False):
"""
Shifts the children for this item by the inputed number of days.
:param delta | <int>
"""
if self.adjustmentsBlocked('children'):
return
if self.itemStyle() != self.ItemStyle.... | [
"def",
"adjustChildren",
"(",
"self",
",",
"delta",
",",
"secs",
"=",
"False",
")",
":",
"if",
"self",
".",
"adjustmentsBlocked",
"(",
"'children'",
")",
":",
"return",
"if",
"self",
".",
"itemStyle",
"(",
")",
"!=",
"self",
".",
"ItemStyle",
".",
"Gro... | Shifts the children for this item by the inputed number of days.
:param delta | <int> | [
"Shifts",
"the",
"children",
"for",
"this",
"item",
"by",
"the",
"inputed",
"number",
"of",
"days",
".",
":",
"param",
"delta",
"|",
"<int",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidgetitem.py#L111-L136 | train | Adjusts the children of this item by the inputed number of days. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidgetitem.py | XGanttWidgetItem.adjustRange | def adjustRange(self, recursive=True):
"""
Adjust the start and end ranges for this item based on the limits from
its children. This method will only apply to group items.
:param recursive | <bool>
"""
if ( self.adjustmentsBlocked('range') ):
... | python | def adjustRange(self, recursive=True):
"""
Adjust the start and end ranges for this item based on the limits from
its children. This method will only apply to group items.
:param recursive | <bool>
"""
if ( self.adjustmentsBlocked('range') ):
... | [
"def",
"adjustRange",
"(",
"self",
",",
"recursive",
"=",
"True",
")",
":",
"if",
"(",
"self",
".",
"adjustmentsBlocked",
"(",
"'range'",
")",
")",
":",
"return",
"if",
"(",
"self",
".",
"itemStyle",
"(",
")",
"==",
"self",
".",
"ItemStyle",
".",
"Gr... | Adjust the start and end ranges for this item based on the limits from
its children. This method will only apply to group items.
:param recursive | <bool> | [
"Adjust",
"the",
"start",
"and",
"end",
"ranges",
"for",
"this",
"item",
"based",
"on",
"the",
"limits",
"from",
"its",
"children",
".",
"This",
"method",
"will",
"only",
"apply",
"to",
"group",
"items",
".",
":",
"param",
"recursive",
"|",
"<bool",
">"
... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidgetitem.py#L138-L170 | train | Adjusts the start and end ranges for this item based on the limits from its children. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidgetitem.py | XGanttWidgetItem.ganttWidget | def ganttWidget(self):
"""
Returns the gantt widget that this item is linked to.
:return <XGanttWidget> || None
"""
tree = self.treeWidget()
if ( not tree ):
return None
from projexui.widgets.xganttwidget import XGanttWi... | python | def ganttWidget(self):
"""
Returns the gantt widget that this item is linked to.
:return <XGanttWidget> || None
"""
tree = self.treeWidget()
if ( not tree ):
return None
from projexui.widgets.xganttwidget import XGanttWi... | [
"def",
"ganttWidget",
"(",
"self",
")",
":",
"tree",
"=",
"self",
".",
"treeWidget",
"(",
")",
"if",
"(",
"not",
"tree",
")",
":",
"return",
"None",
"from",
"projexui",
".",
"widgets",
".",
"xganttwidget",
"import",
"XGanttWidget",
"return",
"projexui",
... | Returns the gantt widget that this item is linked to.
:return <XGanttWidget> || None | [
"Returns",
"the",
"gantt",
"widget",
"that",
"this",
"item",
"is",
"linked",
"to",
".",
":",
"return",
"<XGanttWidget",
">",
"||",
"None"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidgetitem.py#L253-L264 | train | Returns the first ancestor of the tree widget that this item is linked to or None if the item is not linked to a gantt widget. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidgetitem.py | XGanttWidgetItem.insertChild | def insertChild(self, index, item):
"""
Inserts a new item in the given index.
:param index | <int>
item | <XGanttWidgetItem>
"""
super(XGanttWidgetItem, self).insertChild(index, item)
item.sync() | python | def insertChild(self, index, item):
"""
Inserts a new item in the given index.
:param index | <int>
item | <XGanttWidgetItem>
"""
super(XGanttWidgetItem, self).insertChild(index, item)
item.sync() | [
"def",
"insertChild",
"(",
"self",
",",
"index",
",",
"item",
")",
":",
"super",
"(",
"XGanttWidgetItem",
",",
"self",
")",
".",
"insertChild",
"(",
"index",
",",
"item",
")",
"item",
".",
"sync",
"(",
")"
] | Inserts a new item in the given index.
:param index | <int>
item | <XGanttWidgetItem> | [
"Inserts",
"a",
"new",
"item",
"in",
"the",
"given",
"index",
".",
":",
"param",
"index",
"|",
"<int",
">",
"item",
"|",
"<XGanttWidgetItem",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidgetitem.py#L266-L274 | train | Adds a new item to the given index. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidgetitem.py | XGanttWidgetItem.itemStyle | def itemStyle(self):
"""
Returns the item style information for this item.
:return <XGanttWidgetItem.ItemStyle>
"""
if ( self.useGroupStyleWithChildren() and self.childCount() ):
return XGanttWidgetItem.ItemStyle.Group
return sel... | python | def itemStyle(self):
"""
Returns the item style information for this item.
:return <XGanttWidgetItem.ItemStyle>
"""
if ( self.useGroupStyleWithChildren() and self.childCount() ):
return XGanttWidgetItem.ItemStyle.Group
return sel... | [
"def",
"itemStyle",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"useGroupStyleWithChildren",
"(",
")",
"and",
"self",
".",
"childCount",
"(",
")",
")",
":",
"return",
"XGanttWidgetItem",
".",
"ItemStyle",
".",
"Group",
"return",
"self",
".",
"_itemStyle... | Returns the item style information for this item.
:return <XGanttWidgetItem.ItemStyle> | [
"Returns",
"the",
"item",
"style",
"information",
"for",
"this",
"item",
".",
":",
"return",
"<XGanttWidgetItem",
".",
"ItemStyle",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidgetitem.py#L284-L293 | train | Returns the item style information for this item. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidgetitem.py | XGanttWidgetItem.property | def property(self, key, default=None):
"""
Returns the custom data that is stored on this object.
:param key | <str>
default | <variant>
:return <variant>
"""
if key == 'Name':
return self.name()
... | python | def property(self, key, default=None):
"""
Returns the custom data that is stored on this object.
:param key | <str>
default | <variant>
:return <variant>
"""
if key == 'Name':
return self.name()
... | [
"def",
"property",
"(",
"self",
",",
"key",
",",
"default",
"=",
"None",
")",
":",
"if",
"key",
"==",
"'Name'",
":",
"return",
"self",
".",
"name",
"(",
")",
"elif",
"key",
"==",
"'Start'",
":",
"return",
"self",
".",
"dateStart",
"(",
")",
"elif",... | Returns the custom data that is stored on this object.
:param key | <str>
default | <variant>
:return <variant> | [
"Returns",
"the",
"custom",
"data",
"that",
"is",
"stored",
"on",
"this",
"object",
".",
":",
"param",
"key",
"|",
"<str",
">",
"default",
"|",
"<variant",
">",
":",
"return",
"<variant",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidgetitem.py#L303-L329 | train | Returns the custom data that is stored on this object. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidgetitem.py | XGanttWidgetItem.removeFromScene | def removeFromScene(self):
"""
Removes this item from the view scene.
"""
gantt = self.ganttWidget()
if not gantt:
return
scene = gantt.viewWidget().scene()
scene.removeItem(self.viewItem())
for target, viewItem in ... | python | def removeFromScene(self):
"""
Removes this item from the view scene.
"""
gantt = self.ganttWidget()
if not gantt:
return
scene = gantt.viewWidget().scene()
scene.removeItem(self.viewItem())
for target, viewItem in ... | [
"def",
"removeFromScene",
"(",
"self",
")",
":",
"gantt",
"=",
"self",
".",
"ganttWidget",
"(",
")",
"if",
"not",
"gantt",
":",
"return",
"scene",
"=",
"gantt",
".",
"viewWidget",
"(",
")",
".",
"scene",
"(",
")",
"scene",
".",
"removeItem",
"(",
"se... | Removes this item from the view scene. | [
"Removes",
"this",
"item",
"from",
"the",
"view",
"scene",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidgetitem.py#L331-L344 | train | Removes this item from the view scene. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidgetitem.py | XGanttWidgetItem.setDateTimeEnd | def setDateTimeEnd(self, dtime):
"""
Sets the endiing date time for this gantt chart.
:param dtime | <QDateTime>
"""
self._dateEnd = dtime.date()
self._timeEnd = dtime.time()
self._allDay = False | python | def setDateTimeEnd(self, dtime):
"""
Sets the endiing date time for this gantt chart.
:param dtime | <QDateTime>
"""
self._dateEnd = dtime.date()
self._timeEnd = dtime.time()
self._allDay = False | [
"def",
"setDateTimeEnd",
"(",
"self",
",",
"dtime",
")",
":",
"self",
".",
"_dateEnd",
"=",
"dtime",
".",
"date",
"(",
")",
"self",
".",
"_timeEnd",
"=",
"dtime",
".",
"time",
"(",
")",
"self",
".",
"_allDay",
"=",
"False"
] | Sets the endiing date time for this gantt chart.
:param dtime | <QDateTime> | [
"Sets",
"the",
"endiing",
"date",
"time",
"for",
"this",
"gantt",
"chart",
".",
":",
"param",
"dtime",
"|",
"<QDateTime",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidgetitem.py#L370-L378 | train | Sets the endiing date time for this gantt chart. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidgetitem.py | XGanttWidgetItem.setDateTimeStart | def setDateTimeStart(self, dtime):
"""
Sets the starting date time for this gantt chart.
:param dtime | <QDateTime>
"""
self._dateStart = dtime.date()
self._timeStart = dtime.time()
self._allDay = False | python | def setDateTimeStart(self, dtime):
"""
Sets the starting date time for this gantt chart.
:param dtime | <QDateTime>
"""
self._dateStart = dtime.date()
self._timeStart = dtime.time()
self._allDay = False | [
"def",
"setDateTimeStart",
"(",
"self",
",",
"dtime",
")",
":",
"self",
".",
"_dateStart",
"=",
"dtime",
".",
"date",
"(",
")",
"self",
".",
"_timeStart",
"=",
"dtime",
".",
"time",
"(",
")",
"self",
".",
"_allDay",
"=",
"False"
] | Sets the starting date time for this gantt chart.
:param dtime | <QDateTime> | [
"Sets",
"the",
"starting",
"date",
"time",
"for",
"this",
"gantt",
"chart",
".",
":",
"param",
"dtime",
"|",
"<QDateTime",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidgetitem.py#L380-L388 | train | Sets the starting date time for this gantt chart. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidgetitem.py | XGanttWidgetItem.setDuration | def setDuration(self, duration):
"""
Sets the duration for this item to the inputed duration.
:param duration | <int>
"""
if duration < 1:
return False
self.setDateEnd(self.dateStart().addDays(duration - 1))
return True | python | def setDuration(self, duration):
"""
Sets the duration for this item to the inputed duration.
:param duration | <int>
"""
if duration < 1:
return False
self.setDateEnd(self.dateStart().addDays(duration - 1))
return True | [
"def",
"setDuration",
"(",
"self",
",",
"duration",
")",
":",
"if",
"duration",
"<",
"1",
":",
"return",
"False",
"self",
".",
"setDateEnd",
"(",
"self",
".",
"dateStart",
"(",
")",
".",
"addDays",
"(",
"duration",
"-",
"1",
")",
")",
"return",
"True... | Sets the duration for this item to the inputed duration.
:param duration | <int> | [
"Sets",
"the",
"duration",
"for",
"this",
"item",
"to",
"the",
"inputed",
"duration",
".",
":",
"param",
"duration",
"|",
"<int",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidgetitem.py#L390-L400 | train | Sets the duration for this item to the inputed duration. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidgetitem.py | XGanttWidgetItem.setItemStyle | def setItemStyle(self, itemStyle):
"""
Sets the item style that will be used for this widget. If you are
trying to set a style on an item that has children, make sure to turn
off the useGroupStyleWithChildren option, or it will always display as
a group.
... | python | def setItemStyle(self, itemStyle):
"""
Sets the item style that will be used for this widget. If you are
trying to set a style on an item that has children, make sure to turn
off the useGroupStyleWithChildren option, or it will always display as
a group.
... | [
"def",
"setItemStyle",
"(",
"self",
",",
"itemStyle",
")",
":",
"self",
".",
"_itemStyle",
"=",
"itemStyle",
"# initialize the group icon for group style\r",
"if",
"itemStyle",
"==",
"XGanttWidgetItem",
".",
"ItemStyle",
".",
"Group",
"and",
"self",
".",
"icon",
"... | Sets the item style that will be used for this widget. If you are
trying to set a style on an item that has children, make sure to turn
off the useGroupStyleWithChildren option, or it will always display as
a group.
:param itemStyle | <XGanttWidgetItem.ItemStyle> | [
"Sets",
"the",
"item",
"style",
"that",
"will",
"be",
"used",
"for",
"this",
"widget",
".",
"If",
"you",
"are",
"trying",
"to",
"set",
"a",
"style",
"on",
"an",
"item",
"that",
"has",
"children",
"make",
"sure",
"to",
"turn",
"off",
"the",
"useGroupSty... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidgetitem.py#L402-L419 | train | Sets the item style that will be used for this item. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidgetitem.py | XGanttWidgetItem.setName | def setName(self, name):
"""
Sets the name of this widget item to the inputed name.
:param name | <str>
"""
self._name = name
tree = self.treeWidget()
if tree:
col = tree.column('Name')
if col != -1:
... | python | def setName(self, name):
"""
Sets the name of this widget item to the inputed name.
:param name | <str>
"""
self._name = name
tree = self.treeWidget()
if tree:
col = tree.column('Name')
if col != -1:
... | [
"def",
"setName",
"(",
"self",
",",
"name",
")",
":",
"self",
".",
"_name",
"=",
"name",
"tree",
"=",
"self",
".",
"treeWidget",
"(",
")",
"if",
"tree",
":",
"col",
"=",
"tree",
".",
"column",
"(",
"'Name'",
")",
"if",
"col",
"!=",
"-",
"1",
":... | Sets the name of this widget item to the inputed name.
:param name | <str> | [
"Sets",
"the",
"name",
"of",
"this",
"widget",
"item",
"to",
"the",
"inputed",
"name",
".",
":",
"param",
"name",
"|",
"<str",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidgetitem.py#L421-L433 | train | Sets the name of this item to the inputed name. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidgetitem.py | XGanttWidgetItem.setProperty | def setProperty(self, key, value):
"""
Sets the custom property for this item's key to the inputed value. If
the widget has a column that matches the inputed key, then the value
will be added to the tree widget as well.
:param key | <str>
... | python | def setProperty(self, key, value):
"""
Sets the custom property for this item's key to the inputed value. If
the widget has a column that matches the inputed key, then the value
will be added to the tree widget as well.
:param key | <str>
... | [
"def",
"setProperty",
"(",
"self",
",",
"key",
",",
"value",
")",
":",
"if",
"key",
"==",
"'Name'",
":",
"self",
".",
"setName",
"(",
"value",
")",
"elif",
"key",
"==",
"'Start'",
":",
"self",
".",
"setDateStart",
"(",
"value",
")",
"elif",
"key",
... | Sets the custom property for this item's key to the inputed value. If
the widget has a column that matches the inputed key, then the value
will be added to the tree widget as well.
:param key | <str>
value | <variant> | [
"Sets",
"the",
"custom",
"property",
"for",
"this",
"item",
"s",
"key",
"to",
"the",
"inputed",
"value",
".",
"If",
"the",
"widget",
"has",
"a",
"column",
"that",
"matches",
"the",
"inputed",
"key",
"then",
"the",
"value",
"will",
"be",
"added",
"to",
... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidgetitem.py#L435-L467 | train | Sets the custom property for this item based on the inputed key and value. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidgetitem.py | XGanttWidgetItem.sync | def sync(self, recursive=False):
"""
Syncs the information from this item to the tree and view.
"""
self.syncTree(recursive=recursive)
self.syncView(recursive=recursive) | python | def sync(self, recursive=False):
"""
Syncs the information from this item to the tree and view.
"""
self.syncTree(recursive=recursive)
self.syncView(recursive=recursive) | [
"def",
"sync",
"(",
"self",
",",
"recursive",
"=",
"False",
")",
":",
"self",
".",
"syncTree",
"(",
"recursive",
"=",
"recursive",
")",
"self",
".",
"syncView",
"(",
"recursive",
"=",
"recursive",
")"
] | Syncs the information from this item to the tree and view. | [
"Syncs",
"the",
"information",
"from",
"this",
"item",
"to",
"the",
"tree",
"and",
"view",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidgetitem.py#L503-L508 | train | Syncs the information from this item to the tree and view. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidgetitem.py | XGanttWidgetItem.syncDependencies | def syncDependencies(self, recursive=False):
"""
Syncs the dependencies for this item to the view.
:param recurisve | <bool>
"""
scene = self.viewItem().scene()
if not scene:
return
visible = self.viewItem().isVis... | python | def syncDependencies(self, recursive=False):
"""
Syncs the dependencies for this item to the view.
:param recurisve | <bool>
"""
scene = self.viewItem().scene()
if not scene:
return
visible = self.viewItem().isVis... | [
"def",
"syncDependencies",
"(",
"self",
",",
"recursive",
"=",
"False",
")",
":",
"scene",
"=",
"self",
".",
"viewItem",
"(",
")",
".",
"scene",
"(",
")",
"if",
"not",
"scene",
":",
"return",
"visible",
"=",
"self",
".",
"viewItem",
"(",
")",
".",
... | Syncs the dependencies for this item to the view.
:param recurisve | <bool> | [
"Syncs",
"the",
"dependencies",
"for",
"this",
"item",
"to",
"the",
"view",
".",
":",
"param",
"recurisve",
"|",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidgetitem.py#L510-L533 | train | Syncs the dependencies for this item to the view. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidgetitem.py | XGanttWidgetItem.syncTree | def syncTree(self, recursive=False, blockSignals=True):
"""
Syncs the information from this item to the tree.
"""
tree = self.treeWidget()
# sync the tree information
if not tree:
return
items = [self]
if recursive:... | python | def syncTree(self, recursive=False, blockSignals=True):
"""
Syncs the information from this item to the tree.
"""
tree = self.treeWidget()
# sync the tree information
if not tree:
return
items = [self]
if recursive:... | [
"def",
"syncTree",
"(",
"self",
",",
"recursive",
"=",
"False",
",",
"blockSignals",
"=",
"True",
")",
":",
"tree",
"=",
"self",
".",
"treeWidget",
"(",
")",
"# sync the tree information\r",
"if",
"not",
"tree",
":",
"return",
"items",
"=",
"[",
"self",
... | Syncs the information from this item to the tree. | [
"Syncs",
"the",
"information",
"from",
"this",
"item",
"to",
"the",
"tree",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidgetitem.py#L535-L563 | train | Syncs the information from this item to the tree. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidgetitem.py | XGanttWidgetItem.syncView | def syncView(self, recursive=False):
"""
Syncs the information from this item to the view.
"""
# update the view widget
gantt = self.ganttWidget()
tree = self.treeWidget()
if not gantt:
return
vwidget = gantt.viewWi... | python | def syncView(self, recursive=False):
"""
Syncs the information from this item to the view.
"""
# update the view widget
gantt = self.ganttWidget()
tree = self.treeWidget()
if not gantt:
return
vwidget = gantt.viewWi... | [
"def",
"syncView",
"(",
"self",
",",
"recursive",
"=",
"False",
")",
":",
"# update the view widget\r",
"gantt",
"=",
"self",
".",
"ganttWidget",
"(",
")",
"tree",
"=",
"self",
".",
"treeWidget",
"(",
")",
"if",
"not",
"gantt",
":",
"return",
"vwidget",
... | Syncs the information from this item to the view. | [
"Syncs",
"the",
"information",
"from",
"this",
"item",
"to",
"the",
"view",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidgetitem.py#L565-L662 | train | Updates the view with the information from this item to the view. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidgetitem.py | XGanttWidgetItem.takeChild | def takeChild(self, index):
"""
Removes the child at the given index from this item.
:param index | <int>
"""
item = super(XGanttWidgetItem, self).takeChild(index)
if item:
item.removeFromScene()
return it... | python | def takeChild(self, index):
"""
Removes the child at the given index from this item.
:param index | <int>
"""
item = super(XGanttWidgetItem, self).takeChild(index)
if item:
item.removeFromScene()
return it... | [
"def",
"takeChild",
"(",
"self",
",",
"index",
")",
":",
"item",
"=",
"super",
"(",
"XGanttWidgetItem",
",",
"self",
")",
".",
"takeChild",
"(",
"index",
")",
"if",
"item",
":",
"item",
".",
"removeFromScene",
"(",
")",
"return",
"item"
] | Removes the child at the given index from this item.
:param index | <int> | [
"Removes",
"the",
"child",
"at",
"the",
"given",
"index",
"from",
"this",
"item",
".",
":",
"param",
"index",
"|",
"<int",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidgetitem.py#L664-L675 | train | Removes the child at the given index from this item. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidgetitem.py | XGanttWidgetItem.takeDependency | def takeDependency(self, item):
"""
Removes the dependency between the this item and the inputed target.
:param item | <XGanttWidgetItem>
"""
if ( not item in self._dependencies ):
return
item._reverseDependencies.pop(self)
... | python | def takeDependency(self, item):
"""
Removes the dependency between the this item and the inputed target.
:param item | <XGanttWidgetItem>
"""
if ( not item in self._dependencies ):
return
item._reverseDependencies.pop(self)
... | [
"def",
"takeDependency",
"(",
"self",
",",
"item",
")",
":",
"if",
"(",
"not",
"item",
"in",
"self",
".",
"_dependencies",
")",
":",
"return",
"item",
".",
"_reverseDependencies",
".",
"pop",
"(",
"self",
")",
"viewItem",
"=",
"self",
".",
"_dependencies... | Removes the dependency between the this item and the inputed target.
:param item | <XGanttWidgetItem> | [
"Removes",
"the",
"dependency",
"between",
"the",
"this",
"item",
"and",
"the",
"inputed",
"target",
".",
":",
"param",
"item",
"|",
"<XGanttWidgetItem",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidgetitem.py#L677-L691 | train | Removes the dependency between this item and the inputed target. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidgetitem.py | XGanttWidgetItem.viewChanged | def viewChanged(self, start, end):
"""
Called when the view item is changed by the user.
:param start | <QDate> || <QDateTime>
end | <QDate> || <QDateTime>
"""
if type(start) == QDate:
delta = self._dateStart.daysT... | python | def viewChanged(self, start, end):
"""
Called when the view item is changed by the user.
:param start | <QDate> || <QDateTime>
end | <QDate> || <QDateTime>
"""
if type(start) == QDate:
delta = self._dateStart.daysT... | [
"def",
"viewChanged",
"(",
"self",
",",
"start",
",",
"end",
")",
":",
"if",
"type",
"(",
"start",
")",
"==",
"QDate",
":",
"delta",
"=",
"self",
".",
"_dateStart",
".",
"daysTo",
"(",
"start",
")",
"self",
".",
"_dateStart",
"=",
"start",
"self",
... | Called when the view item is changed by the user.
:param start | <QDate> || <QDateTime>
end | <QDate> || <QDateTime> | [
"Called",
"when",
"the",
"view",
"item",
"is",
"changed",
"by",
"the",
"user",
".",
":",
"param",
"start",
"|",
"<QDate",
">",
"||",
"<QDateTime",
">",
"end",
"|",
"<QDate",
">",
"||",
"<QDateTime",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidgetitem.py#L726-L752 | train | Called when the view item is changed by the user. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidgetitem.py | XGanttWidgetItem.viewItem | def viewItem(self):
"""
Returns the view item that is linked with this item.
:return <XGanttViewItem>
"""
if type(self._viewItem).__name__ == 'weakref':
return self._viewItem()
return self._viewItem | python | def viewItem(self):
"""
Returns the view item that is linked with this item.
:return <XGanttViewItem>
"""
if type(self._viewItem).__name__ == 'weakref':
return self._viewItem()
return self._viewItem | [
"def",
"viewItem",
"(",
"self",
")",
":",
"if",
"type",
"(",
"self",
".",
"_viewItem",
")",
".",
"__name__",
"==",
"'weakref'",
":",
"return",
"self",
".",
"_viewItem",
"(",
")",
"return",
"self",
".",
"_viewItem"
] | Returns the view item that is linked with this item.
:return <XGanttViewItem> | [
"Returns",
"the",
"view",
"item",
"that",
"is",
"linked",
"with",
"this",
"item",
".",
":",
"return",
"<XGanttViewItem",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidgetitem.py#L754-L762 | train | Returns the view item that is linked with this item. |
bitesofcode/projexui | projexui/widgets/xganttwidget/xganttwidgetitem.py | XGanttWidgetItem.weekdays | def weekdays(self):
"""
Returns the number of weekdays this item has.
:return <int>
"""
if self.itemStyle() == self.ItemStyle.Group:
out = 0
for i in range(self.childCount()):
out += self.child(i).weekdays()
... | python | def weekdays(self):
"""
Returns the number of weekdays this item has.
:return <int>
"""
if self.itemStyle() == self.ItemStyle.Group:
out = 0
for i in range(self.childCount()):
out += self.child(i).weekdays()
... | [
"def",
"weekdays",
"(",
"self",
")",
":",
"if",
"self",
".",
"itemStyle",
"(",
")",
"==",
"self",
".",
"ItemStyle",
".",
"Group",
":",
"out",
"=",
"0",
"for",
"i",
"in",
"range",
"(",
"self",
".",
"childCount",
"(",
")",
")",
":",
"out",
"+=",
... | Returns the number of weekdays this item has.
:return <int> | [
"Returns",
"the",
"number",
"of",
"weekdays",
"this",
"item",
"has",
".",
":",
"return",
"<int",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xganttwidget/xganttwidgetitem.py#L764-L779 | train | Returns the number of weekdays this item has. |
pmuller/versions | versions/requirements.py | Requirement.match | def match(self, package):
"""Match ``package`` with the requirement.
:param package: Package to test with the requirement.
:type package: package expression string or :class:`Package`
:returns: ``True`` if ``package`` satisfies the requirement.
:rtype: bool
"""
... | python | def match(self, package):
"""Match ``package`` with the requirement.
:param package: Package to test with the requirement.
:type package: package expression string or :class:`Package`
:returns: ``True`` if ``package`` satisfies the requirement.
:rtype: bool
"""
... | [
"def",
"match",
"(",
"self",
",",
"package",
")",
":",
"if",
"isinstance",
"(",
"package",
",",
"basestring",
")",
":",
"from",
".",
"packages",
"import",
"Package",
"package",
"=",
"Package",
".",
"parse",
"(",
"package",
")",
"if",
"self",
".",
"name... | Match ``package`` with the requirement.
:param package: Package to test with the requirement.
:type package: package expression string or :class:`Package`
:returns: ``True`` if ``package`` satisfies the requirement.
:rtype: bool | [
"Match",
"package",
"with",
"the",
"requirement",
"."
] | 951bc3fd99b6a675190f11ee0752af1d7ff5b440 | https://github.com/pmuller/versions/blob/951bc3fd99b6a675190f11ee0752af1d7ff5b440/versions/requirements.py#L117-L146 | train | Match the given package with the requirement. |
pmuller/versions | versions/requirements.py | Requirement.parse | def parse(cls, requirement_expression):
"""Parses a :ref:`requirement_expression <requirement-expressions>`
into a :class:`Requirement` object.
:param requirement_expression: A package requirement expression.
:type requirement_expression: \
:ref:`requirement_expression <requirem... | python | def parse(cls, requirement_expression):
"""Parses a :ref:`requirement_expression <requirement-expressions>`
into a :class:`Requirement` object.
:param requirement_expression: A package requirement expression.
:type requirement_expression: \
:ref:`requirement_expression <requirem... | [
"def",
"parse",
"(",
"cls",
",",
"requirement_expression",
")",
":",
"match",
"=",
"RE",
".",
"match",
"(",
"requirement_expression",
")",
"if",
"match",
":",
"name",
",",
"build_metadata",
",",
"version_constraints_str",
"=",
"match",
".",
"groups",
"(",
")... | Parses a :ref:`requirement_expression <requirement-expressions>`
into a :class:`Requirement` object.
:param requirement_expression: A package requirement expression.
:type requirement_expression: \
:ref:`requirement_expression <requirement-expressions>`
:rtype: :class:`Requireme... | [
"Parses",
"a",
":",
"ref",
":",
"requirement_expression",
"<requirement",
"-",
"expressions",
">",
"into",
"a",
":",
"class",
":",
"Requirement",
"object",
"."
] | 951bc3fd99b6a675190f11ee0752af1d7ff5b440 | https://github.com/pmuller/versions/blob/951bc3fd99b6a675190f11ee0752af1d7ff5b440/versions/requirements.py#L150-L180 | train | Parses a requirement_expression into a : class:`Requirement object. |
bitesofcode/projexui | projexui/widgets/xtimedeltaedit.py | XTimeDeltaEdit.delta | def delta(self):
"""
Returns a delta based on this widget's information.
:return <datetime.timedelta>
"""
number = self._numberSpinner.value()
unit = self._unitCombo.currentText()
direction = self._directionCombo.currentText()
... | python | def delta(self):
"""
Returns a delta based on this widget's information.
:return <datetime.timedelta>
"""
number = self._numberSpinner.value()
unit = self._unitCombo.currentText()
direction = self._directionCombo.currentText()
... | [
"def",
"delta",
"(",
"self",
")",
":",
"number",
"=",
"self",
".",
"_numberSpinner",
".",
"value",
"(",
")",
"unit",
"=",
"self",
".",
"_unitCombo",
".",
"currentText",
"(",
")",
"direction",
"=",
"self",
".",
"_directionCombo",
".",
"currentText",
"(",
... | Returns a delta based on this widget's information.
:return <datetime.timedelta> | [
"Returns",
"a",
"delta",
"based",
"on",
"this",
"widget",
"s",
"information",
".",
":",
"return",
"<datetime",
".",
"timedelta",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xtimedeltaedit.py#L92-L119 | train | Returns a delta based on this widget s information. |
bitesofcode/projexui | projexui/widgets/xtimedeltaedit.py | XTimeDeltaEdit.setDelta | def setDelta(self, delta):
"""
Sets the time delta for this widget to the inputed delta.
:param delta | <datetime.timedelta>
"""
days = int(delta.days)
secs = int(delta.total_seconds())
direction = 'from now'
if secs < 0:
... | python | def setDelta(self, delta):
"""
Sets the time delta for this widget to the inputed delta.
:param delta | <datetime.timedelta>
"""
days = int(delta.days)
secs = int(delta.total_seconds())
direction = 'from now'
if secs < 0:
... | [
"def",
"setDelta",
"(",
"self",
",",
"delta",
")",
":",
"days",
"=",
"int",
"(",
"delta",
".",
"days",
")",
"secs",
"=",
"int",
"(",
"delta",
".",
"total_seconds",
"(",
")",
")",
"direction",
"=",
"'from now'",
"if",
"secs",
"<",
"0",
":",
"directi... | Sets the time delta for this widget to the inputed delta.
:param delta | <datetime.timedelta> | [
"Sets",
"the",
"time",
"delta",
"for",
"this",
"widget",
"to",
"the",
"inputed",
"delta",
".",
":",
"param",
"delta",
"|",
"<datetime",
".",
"timedelta",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xtimedeltaedit.py#L121-L159 | train | Sets the time delta for this widget to the inputed delta. |
johnnoone/aioconsul | aioconsul/client/status_endpoint.py | StatusEndpoint.leader | async def leader(self):
"""Returns the current Raft leader
Returns:
str: address of leader such as ``10.1.10.12:8300``
"""
response = await self._api.get("/v1/status/leader")
if response.status == 200:
return response.body | python | async def leader(self):
"""Returns the current Raft leader
Returns:
str: address of leader such as ``10.1.10.12:8300``
"""
response = await self._api.get("/v1/status/leader")
if response.status == 200:
return response.body | [
"async",
"def",
"leader",
"(",
"self",
")",
":",
"response",
"=",
"await",
"self",
".",
"_api",
".",
"get",
"(",
"\"/v1/status/leader\"",
")",
"if",
"response",
".",
"status",
"==",
"200",
":",
"return",
"response",
".",
"body"
] | Returns the current Raft leader
Returns:
str: address of leader such as ``10.1.10.12:8300`` | [
"Returns",
"the",
"current",
"Raft",
"leader"
] | 02f7a529d7dc2e49bed942111067aa5faf320e90 | https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/status_endpoint.py#L11-L19 | train | Returns the current Raft leader |
johnnoone/aioconsul | aioconsul/client/status_endpoint.py | StatusEndpoint.peers | async def peers(self):
"""Returns the current Raft peer set
Returns:
Collection: addresses of peers
This endpoint retrieves the Raft peers for the datacenter in which
the agent is running. It returns a collection of addresses, such as::
[
"10.1.1... | python | async def peers(self):
"""Returns the current Raft peer set
Returns:
Collection: addresses of peers
This endpoint retrieves the Raft peers for the datacenter in which
the agent is running. It returns a collection of addresses, such as::
[
"10.1.1... | [
"async",
"def",
"peers",
"(",
"self",
")",
":",
"response",
"=",
"await",
"self",
".",
"_api",
".",
"get",
"(",
"\"/v1/status/peers\"",
")",
"if",
"response",
".",
"status",
"==",
"200",
":",
"return",
"set",
"(",
"response",
".",
"body",
")"
] | Returns the current Raft peer set
Returns:
Collection: addresses of peers
This endpoint retrieves the Raft peers for the datacenter in which
the agent is running. It returns a collection of addresses, such as::
[
"10.1.10.12:8300",
"10.1.1... | [
"Returns",
"the",
"current",
"Raft",
"peer",
"set"
] | 02f7a529d7dc2e49bed942111067aa5faf320e90 | https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/status_endpoint.py#L21-L41 | train | Returns the current Raft peer set for this agent. |
deezer/template-remover | template_remover.py | get_pattern | def get_pattern(echo_tags, start_tags, end_tags):
"""Constructs a pattern to use with the method clean().
The priority of the tags is echo_tags, then start_tags and finally end_tags.
That means that in some cases a negative lookahead may be required, as the
first match from left to right will be report... | python | def get_pattern(echo_tags, start_tags, end_tags):
"""Constructs a pattern to use with the method clean().
The priority of the tags is echo_tags, then start_tags and finally end_tags.
That means that in some cases a negative lookahead may be required, as the
first match from left to right will be report... | [
"def",
"get_pattern",
"(",
"echo_tags",
",",
"start_tags",
",",
"end_tags",
")",
":",
"return",
"re",
".",
"compile",
"(",
"'|'",
".",
"join",
"(",
"(",
"LEADING_SPACES",
",",
"NEW_LINE",
",",
"r'(?P<echo>%s)'",
"%",
"'|'",
".",
"join",
"(",
"echo_tags",
... | Constructs a pattern to use with the method clean().
The priority of the tags is echo_tags, then start_tags and finally end_tags.
That means that in some cases a negative lookahead may be required, as the
first match from left to right will be reported.
See clean() for the meaning of each group.
... | [
"Constructs",
"a",
"pattern",
"to",
"use",
"with",
"the",
"method",
"clean",
"()",
"."
] | de963f221612f57d4982fbc779acd21302c7b817 | https://github.com/deezer/template-remover/blob/de963f221612f57d4982fbc779acd21302c7b817/template_remover.py#L62-L87 | train | Constructs a regex pattern to use with the clean method. |
deezer/template-remover | template_remover.py | _TemplateRemover.get_clean_content | def get_clean_content(self):
"""Implementation of the clean() method."""
fill_chars = {'BLANK_TEMPLATE': ' ', 'ECHO_TEMPLATE': '0'}
for match in self.pattern.finditer(self.html_content):
start, end = match.start(), match.end()
tag = _get_tag(match)
if tag == '... | python | def get_clean_content(self):
"""Implementation of the clean() method."""
fill_chars = {'BLANK_TEMPLATE': ' ', 'ECHO_TEMPLATE': '0'}
for match in self.pattern.finditer(self.html_content):
start, end = match.start(), match.end()
tag = _get_tag(match)
if tag == '... | [
"def",
"get_clean_content",
"(",
"self",
")",
":",
"fill_chars",
"=",
"{",
"'BLANK_TEMPLATE'",
":",
"' '",
",",
"'ECHO_TEMPLATE'",
":",
"'0'",
"}",
"for",
"match",
"in",
"self",
".",
"pattern",
".",
"finditer",
"(",
"self",
".",
"html_content",
")",
":",
... | Implementation of the clean() method. | [
"Implementation",
"of",
"the",
"clean",
"()",
"method",
"."
] | de963f221612f57d4982fbc779acd21302c7b817 | https://github.com/deezer/template-remover/blob/de963f221612f57d4982fbc779acd21302c7b817/template_remover.py#L154-L207 | train | Implementation of the clean method. |
bitesofcode/projexui | projexui/widgets/xsplitter.py | XSplitterHandle.collapse | def collapse( self, direction ):
"""
Collapses this splitter handle before or after other widgets based on \
the inputed CollapseDirection.
:param direction | <XSplitterHandle.CollapseDirection>
:return <bool> | success
"""
if ( self.isC... | python | def collapse( self, direction ):
"""
Collapses this splitter handle before or after other widgets based on \
the inputed CollapseDirection.
:param direction | <XSplitterHandle.CollapseDirection>
:return <bool> | success
"""
if ( self.isC... | [
"def",
"collapse",
"(",
"self",
",",
"direction",
")",
":",
"if",
"(",
"self",
".",
"isCollapsed",
"(",
")",
")",
":",
"return",
"False",
"splitter",
"=",
"self",
".",
"parent",
"(",
")",
"if",
"(",
"not",
"splitter",
")",
":",
"return",
"False",
"... | Collapses this splitter handle before or after other widgets based on \
the inputed CollapseDirection.
:param direction | <XSplitterHandle.CollapseDirection>
:return <bool> | success | [
"Collapses",
"this",
"splitter",
"handle",
"before",
"or",
"after",
"other",
"widgets",
"based",
"on",
"\\",
"the",
"inputed",
"CollapseDirection",
".",
":",
"param",
"direction",
"|",
"<XSplitterHandle",
".",
"CollapseDirection",
">",
":",
"return",
"<bool",
">... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsplitter.py#L70-L99 | train | Collapse this splitter handle before or after other widgets based on the inputed CollapseDirection. |
bitesofcode/projexui | projexui/widgets/xsplitter.py | XSplitterHandle.collapseBefore | def collapseBefore( self, handle ):
"""
Collapses the splitter before the inputed handle.
:param handle | <XSplitterHandle>
"""
self.setUpdatesEnabled(False)
# collapse all items after the current handle
if ( handle.isCollapsed() ):
... | python | def collapseBefore( self, handle ):
"""
Collapses the splitter before the inputed handle.
:param handle | <XSplitterHandle>
"""
self.setUpdatesEnabled(False)
# collapse all items after the current handle
if ( handle.isCollapsed() ):
... | [
"def",
"collapseBefore",
"(",
"self",
",",
"handle",
")",
":",
"self",
".",
"setUpdatesEnabled",
"(",
"False",
")",
"# collapse all items after the current handle",
"if",
"(",
"handle",
".",
"isCollapsed",
"(",
")",
")",
":",
"self",
".",
"setSizes",
"(",
"han... | Collapses the splitter before the inputed handle.
:param handle | <XSplitterHandle> | [
"Collapses",
"the",
"splitter",
"before",
"the",
"inputed",
"handle",
".",
":",
"param",
"handle",
"|",
"<XSplitterHandle",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsplitter.py#L130-L155 | train | Collapses the splitter before the inputed handle. |
bitesofcode/projexui | projexui/widgets/xsplitter.py | XSplitterHandle.markCollapsed | def markCollapsed( self, direction, sizes ):
"""
Updates the interface to reflect that the splitter is collapsed.
:param direction | <XSplitterHandle.CollapseDirection>
sizes | [<int>, ..]
"""
self._collapsed = True
self._storedSizes ... | python | def markCollapsed( self, direction, sizes ):
"""
Updates the interface to reflect that the splitter is collapsed.
:param direction | <XSplitterHandle.CollapseDirection>
sizes | [<int>, ..]
"""
self._collapsed = True
self._storedSizes ... | [
"def",
"markCollapsed",
"(",
"self",
",",
"direction",
",",
"sizes",
")",
":",
"self",
".",
"_collapsed",
"=",
"True",
"self",
".",
"_storedSizes",
"=",
"sizes",
"[",
":",
"]",
"if",
"(",
"direction",
"==",
"XSplitterHandle",
".",
"CollapseDirection",
".",... | Updates the interface to reflect that the splitter is collapsed.
:param direction | <XSplitterHandle.CollapseDirection>
sizes | [<int>, ..] | [
"Updates",
"the",
"interface",
"to",
"reflect",
"that",
"the",
"splitter",
"is",
"collapsed",
".",
":",
"param",
"direction",
"|",
"<XSplitterHandle",
".",
"CollapseDirection",
">",
"sizes",
"|",
"[",
"<int",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsplitter.py#L165-L188 | train | Updates the interface to reflect that the splitter is collapsed. |
bitesofcode/projexui | projexui/widgets/xsplitter.py | XSplitterHandle.paintEvent | def paintEvent( self, event ):
"""
Overloads the paint event to handle drawing the splitter lines.
:param event | <QPaintEvent>
"""
lines = []
count = 20
# calculate the lines
if ( self.orientation() == Qt.Vertical ):
x =... | python | def paintEvent( self, event ):
"""
Overloads the paint event to handle drawing the splitter lines.
:param event | <QPaintEvent>
"""
lines = []
count = 20
# calculate the lines
if ( self.orientation() == Qt.Vertical ):
x =... | [
"def",
"paintEvent",
"(",
"self",
",",
"event",
")",
":",
"lines",
"=",
"[",
"]",
"count",
"=",
"20",
"# calculate the lines",
"if",
"(",
"self",
".",
"orientation",
"(",
")",
"==",
"Qt",
".",
"Vertical",
")",
":",
"x",
"=",
"self",
".",
"_resizeGrip... | Overloads the paint event to handle drawing the splitter lines.
:param event | <QPaintEvent> | [
"Overloads",
"the",
"paint",
"event",
"to",
"handle",
"drawing",
"the",
"splitter",
"lines",
".",
":",
"param",
"event",
"|",
"<QPaintEvent",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsplitter.py#L190-L221 | train | Overloads the paint event to handle drawing the splitter lines. |
bitesofcode/projexui | projexui/widgets/xsplitter.py | XSplitterHandle.setOrientation | def setOrientation( self, orientation ):
"""
Sets the orientation for this handle and updates the widgets linked \
with it.
:param orientation | <Qt.Orientation>
"""
super(XSplitterHandle, self).setOrientation(orientation)
if ( orientation =... | python | def setOrientation( self, orientation ):
"""
Sets the orientation for this handle and updates the widgets linked \
with it.
:param orientation | <Qt.Orientation>
"""
super(XSplitterHandle, self).setOrientation(orientation)
if ( orientation =... | [
"def",
"setOrientation",
"(",
"self",
",",
"orientation",
")",
":",
"super",
"(",
"XSplitterHandle",
",",
"self",
")",
".",
"setOrientation",
"(",
"orientation",
")",
"if",
"(",
"orientation",
"==",
"Qt",
".",
"Vertical",
")",
":",
"self",
".",
"layout",
... | Sets the orientation for this handle and updates the widgets linked \
with it.
:param orientation | <Qt.Orientation> | [
"Sets",
"the",
"orientation",
"for",
"this",
"handle",
"and",
"updates",
"the",
"widgets",
"linked",
"\\",
"with",
"it",
".",
":",
"param",
"orientation",
"|",
"<Qt",
".",
"Orientation",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsplitter.py#L223-L252 | train | Sets the orientation for this handle and updates the widgets linked with it. |
bitesofcode/projexui | projexui/widgets/xsplitter.py | XSplitterHandle.uncollapse | def uncollapse( self ):
"""
Uncollapses the splitter this handle is associated with by restoring \
its sizes from before the collapse occurred.
:return <bool> | changed
"""
if ( not self.isCollapsed() ):
return False
self.parent()... | python | def uncollapse( self ):
"""
Uncollapses the splitter this handle is associated with by restoring \
its sizes from before the collapse occurred.
:return <bool> | changed
"""
if ( not self.isCollapsed() ):
return False
self.parent()... | [
"def",
"uncollapse",
"(",
"self",
")",
":",
"if",
"(",
"not",
"self",
".",
"isCollapsed",
"(",
")",
")",
":",
"return",
"False",
"self",
".",
"parent",
"(",
")",
".",
"setSizes",
"(",
"self",
".",
"_storedSizes",
")",
"self",
".",
"unmarkCollapsed",
... | Uncollapses the splitter this handle is associated with by restoring \
its sizes from before the collapse occurred.
:return <bool> | changed | [
"Uncollapses",
"the",
"splitter",
"this",
"handle",
"is",
"associated",
"with",
"by",
"restoring",
"\\",
"its",
"sizes",
"from",
"before",
"the",
"collapse",
"occurred",
".",
":",
"return",
"<bool",
">",
"|",
"changed"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsplitter.py#L254-L267 | train | Uncollapses the splitter this handle is associated with by restoring the sizes from before the collapse occurred. |
bitesofcode/projexui | projexui/widgets/xsplitter.py | XSplitterHandle.unmarkCollapsed | def unmarkCollapsed( self ):
"""
Unmarks this splitter as being in a collapsed state, clearing any \
collapsed information.
"""
if ( not self.isCollapsed() ):
return
self._collapsed = False
self._storedSizes = None
if ( ... | python | def unmarkCollapsed( self ):
"""
Unmarks this splitter as being in a collapsed state, clearing any \
collapsed information.
"""
if ( not self.isCollapsed() ):
return
self._collapsed = False
self._storedSizes = None
if ( ... | [
"def",
"unmarkCollapsed",
"(",
"self",
")",
":",
"if",
"(",
"not",
"self",
".",
"isCollapsed",
"(",
")",
")",
":",
"return",
"self",
".",
"_collapsed",
"=",
"False",
"self",
".",
"_storedSizes",
"=",
"None",
"if",
"(",
"self",
".",
"orientation",
"(",
... | Unmarks this splitter as being in a collapsed state, clearing any \
collapsed information. | [
"Unmarks",
"this",
"splitter",
"as",
"being",
"in",
"a",
"collapsed",
"state",
"clearing",
"any",
"\\",
"collapsed",
"information",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsplitter.py#L269-L285 | train | Unmarks this splitter as being in a collapsed state clearing any \
collapsed information. |
bitesofcode/projexui | projexui/widgets/xsplitter.py | XSplitterHandle.toggleCollapseAfter | def toggleCollapseAfter( self ):
"""
Collapses the splitter after this handle.
"""
if ( self.isCollapsed() ):
self.uncollapse()
else:
self.collapse( XSplitterHandle.CollapseDirection.After ) | python | def toggleCollapseAfter( self ):
"""
Collapses the splitter after this handle.
"""
if ( self.isCollapsed() ):
self.uncollapse()
else:
self.collapse( XSplitterHandle.CollapseDirection.After ) | [
"def",
"toggleCollapseAfter",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"isCollapsed",
"(",
")",
")",
":",
"self",
".",
"uncollapse",
"(",
")",
"else",
":",
"self",
".",
"collapse",
"(",
"XSplitterHandle",
".",
"CollapseDirection",
".",
"After",
")"... | Collapses the splitter after this handle. | [
"Collapses",
"the",
"splitter",
"after",
"this",
"handle",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsplitter.py#L287-L294 | train | Collapses the splitter after this handle. |
bitesofcode/projexui | projexui/widgets/xsplitter.py | XSplitterHandle.toggleCollapseBefore | def toggleCollapseBefore( self ):
"""
Collapses the splitter before this handle.
"""
if ( self.isCollapsed() ):
self.uncollapse()
else:
self.collapse( XSplitterHandle.CollapseDirection.Before ) | python | def toggleCollapseBefore( self ):
"""
Collapses the splitter before this handle.
"""
if ( self.isCollapsed() ):
self.uncollapse()
else:
self.collapse( XSplitterHandle.CollapseDirection.Before ) | [
"def",
"toggleCollapseBefore",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"isCollapsed",
"(",
")",
")",
":",
"self",
".",
"uncollapse",
"(",
")",
"else",
":",
"self",
".",
"collapse",
"(",
"XSplitterHandle",
".",
"CollapseDirection",
".",
"Before",
"... | Collapses the splitter before this handle. | [
"Collapses",
"the",
"splitter",
"before",
"this",
"handle",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsplitter.py#L296-L303 | train | Collapses the splitter before this handle. |
bitesofcode/projexui | projexui/configs/xschemeconfig.py | XSchemeConfig.reset | def reset( self ):
"""
Resets the colors to the default settings.
"""
dataSet = self.dataSet()
if ( not dataSet ):
dataSet = XScheme()
dataSet.reset() | python | def reset( self ):
"""
Resets the colors to the default settings.
"""
dataSet = self.dataSet()
if ( not dataSet ):
dataSet = XScheme()
dataSet.reset() | [
"def",
"reset",
"(",
"self",
")",
":",
"dataSet",
"=",
"self",
".",
"dataSet",
"(",
")",
"if",
"(",
"not",
"dataSet",
")",
":",
"dataSet",
"=",
"XScheme",
"(",
")",
"dataSet",
".",
"reset",
"(",
")"
] | Resets the colors to the default settings. | [
"Resets",
"the",
"colors",
"to",
"the",
"default",
"settings",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/configs/xschemeconfig.py#L113-L121 | train | Resets the colors to the default settings. |
bitesofcode/projexui | projexui/widgets/xnodewidget/xnodelayer.py | XNodeLayer.isEnabled | def isEnabled(self):
"""
Return whether or not this layer is enabled and can be set as the \
current layer.
:sa linkEnabledToCurrent
:return <bool>
"""
if self._linkEnabledToCurrent:
addtl = self.isCurrent()
e... | python | def isEnabled(self):
"""
Return whether or not this layer is enabled and can be set as the \
current layer.
:sa linkEnabledToCurrent
:return <bool>
"""
if self._linkEnabledToCurrent:
addtl = self.isCurrent()
e... | [
"def",
"isEnabled",
"(",
"self",
")",
":",
"if",
"self",
".",
"_linkEnabledToCurrent",
":",
"addtl",
"=",
"self",
".",
"isCurrent",
"(",
")",
"else",
":",
"addtl",
"=",
"True",
"return",
"self",
".",
"_enabled",
"and",
"addtl"
] | Return whether or not this layer is enabled and can be set as the \
current layer.
:sa linkEnabledToCurrent
:return <bool> | [
"Return",
"whether",
"or",
"not",
"this",
"layer",
"is",
"enabled",
"and",
"can",
"be",
"set",
"as",
"the",
"\\",
"current",
"layer",
".",
":",
"sa",
"linkEnabledToCurrent",
":",
"return",
"<bool",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodelayer.py#L67-L82 | train | Return whether or not this layer is enabled and can be set as the current layer. |
bitesofcode/projexui | projexui/widgets/xnodewidget/xnodelayer.py | XNodeLayer.isVisible | def isVisible(self):
"""
Returns whether or not this layer is visible. If the inheritVisibility
value is set to True, then this will look up its parent hierarchy to \
ensure it is visible.
:return <bool>
"""
if self._visible and self._inheritVisibili... | python | def isVisible(self):
"""
Returns whether or not this layer is visible. If the inheritVisibility
value is set to True, then this will look up its parent hierarchy to \
ensure it is visible.
:return <bool>
"""
if self._visible and self._inheritVisibili... | [
"def",
"isVisible",
"(",
"self",
")",
":",
"if",
"self",
".",
"_visible",
"and",
"self",
".",
"_inheritVisibility",
"and",
"self",
".",
"_parent",
":",
"return",
"self",
".",
"_parent",
".",
"isVisible",
"(",
")",
"return",
"self",
".",
"_visible"
] | Returns whether or not this layer is visible. If the inheritVisibility
value is set to True, then this will look up its parent hierarchy to \
ensure it is visible.
:return <bool> | [
"Returns",
"whether",
"or",
"not",
"this",
"layer",
"is",
"visible",
".",
"If",
"the",
"inheritVisibility",
"value",
"is",
"set",
"to",
"True",
"then",
"this",
"will",
"look",
"up",
"its",
"parent",
"hierarchy",
"to",
"\\",
"ensure",
"it",
"is",
"visible",... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodelayer.py#L84-L95 | train | Returns whether or not this layer is visible. |
bitesofcode/projexui | projexui/widgets/xnodewidget/xnodelayer.py | XNodeLayer.ensureVisible | def ensureVisible(self):
"""
Ensures that this layer is visible by turning on all parent layers \
that it needs to based on its inheritance value.
"""
# make sure all parents are visible
if self._parent and self._inheritVisibility:
self._parent.ensureVisible()... | python | def ensureVisible(self):
"""
Ensures that this layer is visible by turning on all parent layers \
that it needs to based on its inheritance value.
"""
# make sure all parents are visible
if self._parent and self._inheritVisibility:
self._parent.ensureVisible()... | [
"def",
"ensureVisible",
"(",
"self",
")",
":",
"# make sure all parents are visible",
"if",
"self",
".",
"_parent",
"and",
"self",
".",
"_inheritVisibility",
":",
"self",
".",
"_parent",
".",
"ensureVisible",
"(",
")",
"self",
".",
"_visible",
"=",
"True",
"se... | Ensures that this layer is visible by turning on all parent layers \
that it needs to based on its inheritance value. | [
"Ensures",
"that",
"this",
"layer",
"is",
"visible",
"by",
"turning",
"on",
"all",
"parent",
"layers",
"\\",
"that",
"it",
"needs",
"to",
"based",
"on",
"its",
"inheritance",
"value",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodelayer.py#L97-L107 | train | Ensures that this layer is visible by turning on all parent layers and then setting the visible flag. |
bitesofcode/projexui | projexui/widgets/xnodewidget/xnodelayer.py | XNodeLayer.items | def items(self):
"""
Returns a list of the items that are linked to this layer.
:return [<XNode> || <XNodeConnection>, ..]
"""
from projexui.widgets.xnodewidget import XNode, XNodeConnection
output = []
for item in self.scene().items():
... | python | def items(self):
"""
Returns a list of the items that are linked to this layer.
:return [<XNode> || <XNodeConnection>, ..]
"""
from projexui.widgets.xnodewidget import XNode, XNodeConnection
output = []
for item in self.scene().items():
... | [
"def",
"items",
"(",
"self",
")",
":",
"from",
"projexui",
".",
"widgets",
".",
"xnodewidget",
"import",
"XNode",
",",
"XNodeConnection",
"output",
"=",
"[",
"]",
"for",
"item",
"in",
"self",
".",
"scene",
"(",
")",
".",
"items",
"(",
")",
":",
"if",... | Returns a list of the items that are linked to this layer.
:return [<XNode> || <XNodeConnection>, ..] | [
"Returns",
"a",
"list",
"of",
"the",
"items",
"that",
"are",
"linked",
"to",
"this",
"layer",
".",
":",
"return",
"[",
"<XNode",
">",
"||",
"<XNodeConnection",
">",
"..",
"]"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodelayer.py#L118-L135 | train | Returns a list of the items that are linked to this layer. |
bitesofcode/projexui | projexui/widgets/xnodewidget/xnodelayer.py | XNodeLayer.layerData | def layerData(self):
"""
Returns a dictionary of information about this layer that an item \
can use to sync with.
:return <dict>
"""
output = {}
output['visible'] = self.isVisible()
output['zValue'] = self.zValue()
output['c... | python | def layerData(self):
"""
Returns a dictionary of information about this layer that an item \
can use to sync with.
:return <dict>
"""
output = {}
output['visible'] = self.isVisible()
output['zValue'] = self.zValue()
output['c... | [
"def",
"layerData",
"(",
"self",
")",
":",
"output",
"=",
"{",
"}",
"output",
"[",
"'visible'",
"]",
"=",
"self",
".",
"isVisible",
"(",
")",
"output",
"[",
"'zValue'",
"]",
"=",
"self",
".",
"zValue",
"(",
")",
"output",
"[",
"'current'",
"]",
"="... | Returns a dictionary of information about this layer that an item \
can use to sync with.
:return <dict> | [
"Returns",
"a",
"dictionary",
"of",
"information",
"about",
"this",
"layer",
"that",
"an",
"item",
"\\",
"can",
"use",
"to",
"sync",
"with",
".",
":",
"return",
"<dict",
">"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodelayer.py#L137-L150 | train | Returns a dictionary of information about this item |
bitesofcode/projexui | projexui/widgets/xnodewidget/xnodelayer.py | XNodeLayer.remove | def remove(self, removeItems=False):
"""
Removes this layer from the scene. If the removeItems flag is set to \
True, then all the items on this layer will be removed as well. \
Otherwise, they will be transferred to another layer from the scene.
:param removeItem... | python | def remove(self, removeItems=False):
"""
Removes this layer from the scene. If the removeItems flag is set to \
True, then all the items on this layer will be removed as well. \
Otherwise, they will be transferred to another layer from the scene.
:param removeItem... | [
"def",
"remove",
"(",
"self",
",",
"removeItems",
"=",
"False",
")",
":",
"# makes sure this can be removed",
"if",
"not",
"self",
".",
"prepareToRemove",
"(",
")",
":",
"return",
"False",
"items",
"=",
"self",
".",
"items",
"(",
")",
"# grabs the next layer",... | Removes this layer from the scene. If the removeItems flag is set to \
True, then all the items on this layer will be removed as well. \
Otherwise, they will be transferred to another layer from the scene.
:param removeItems | <bool>
:return <bool> | [
"Removes",
"this",
"layer",
"from",
"the",
"scene",
".",
"If",
"the",
"removeItems",
"flag",
"is",
"set",
"to",
"\\",
"True",
"then",
"all",
"the",
"items",
"on",
"this",
"layer",
"will",
"be",
"removed",
"as",
"well",
".",
"\\",
"Otherwise",
"they",
"... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodelayer.py#L195-L235 | train | Removes this layer from the scene. |
bitesofcode/projexui | projexui/widgets/xnodewidget/xnodelayer.py | XNodeLayer.setInheritVisibility | def setInheritVisibility(self, state):
"""
Sets whether or not this node layer inherits visibility settings from \
its parents.
:param state | <bool>
:return <bool> changed
"""
if self._inheritVisibility == state:
return Fals... | python | def setInheritVisibility(self, state):
"""
Sets whether or not this node layer inherits visibility settings from \
its parents.
:param state | <bool>
:return <bool> changed
"""
if self._inheritVisibility == state:
return Fals... | [
"def",
"setInheritVisibility",
"(",
"self",
",",
"state",
")",
":",
"if",
"self",
".",
"_inheritVisibility",
"==",
"state",
":",
"return",
"False",
"self",
".",
"_inheritVisibility",
"=",
"state",
"self",
".",
"sync",
"(",
")",
"return",
"True"
] | Sets whether or not this node layer inherits visibility settings from \
its parents.
:param state | <bool>
:return <bool> changed | [
"Sets",
"whether",
"or",
"not",
"this",
"node",
"layer",
"inherits",
"visibility",
"settings",
"from",
"\\",
"its",
"parents",
".",
":",
"param",
"state",
"|",
"<bool",
">",
":",
"return",
"<bool",
">",
"changed"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodelayer.py#L282-L296 | train | Sets whether or not this node layer inherits visibility settings from \
its parents. |
bitesofcode/projexui | projexui/widgets/xnodewidget/xnodelayer.py | XNodeLayer.setParent | def setParent(self, other):
"""
Sets the parent for this layer to the inputed layer.
:param other | <XNodeLayer> || None
:return <bool> changed
"""
if self._parent == other:
return False
# remove this layer from its ... | python | def setParent(self, other):
"""
Sets the parent for this layer to the inputed layer.
:param other | <XNodeLayer> || None
:return <bool> changed
"""
if self._parent == other:
return False
# remove this layer from its ... | [
"def",
"setParent",
"(",
"self",
",",
"other",
")",
":",
"if",
"self",
".",
"_parent",
"==",
"other",
":",
"return",
"False",
"# remove this layer from its parent",
"if",
"self",
".",
"_parent",
"and",
"self",
"in",
"self",
".",
"_parent",
".",
"_children",
... | Sets the parent for this layer to the inputed layer.
:param other | <XNodeLayer> || None
:return <bool> changed | [
"Sets",
"the",
"parent",
"for",
"this",
"layer",
"to",
"the",
"inputed",
"layer",
".",
":",
"param",
"other",
"|",
"<XNodeLayer",
">",
"||",
"None",
":",
"return",
"<bool",
">",
"changed"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodelayer.py#L323-L346 | train | Sets the parent for this layer to the inputed layer. |
bitesofcode/projexui | projexui/widgets/xnodewidget/xnodelayer.py | XNodeLayer.setVisible | def setVisible(self, state):
"""
Sets whether or not this particular layer is visible. Depending on \
if the inheritVisibility property is set for this layer, it may not \
actually affect the visible state based on its inheritance. If you \
want to force this layer to be visibl... | python | def setVisible(self, state):
"""
Sets whether or not this particular layer is visible. Depending on \
if the inheritVisibility property is set for this layer, it may not \
actually affect the visible state based on its inheritance. If you \
want to force this layer to be visibl... | [
"def",
"setVisible",
"(",
"self",
",",
"state",
")",
":",
"# store the current state",
"currvis",
"=",
"self",
".",
"isVisible",
"(",
")",
"# update the local property",
"self",
".",
"_visible",
"=",
"state",
"# check the new state",
"newvis",
"=",
"self",
".",
... | Sets whether or not this particular layer is visible. Depending on \
if the inheritVisibility property is set for this layer, it may not \
actually affect the visible state based on its inheritance. If you \
want to force this layer to be visible, use the ensureVisible method.
... | [
"Sets",
"whether",
"or",
"not",
"this",
"particular",
"layer",
"is",
"visible",
".",
"Depending",
"on",
"\\",
"if",
"the",
"inheritVisibility",
"property",
"is",
"set",
"for",
"this",
"layer",
"it",
"may",
"not",
"\\",
"actually",
"affect",
"the",
"visible",... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodelayer.py#L348-L374 | train | Sets whether or not this particular layer is visible. |
bitesofcode/projexui | projexui/widgets/xnodewidget/xnodelayer.py | XNodeLayer.setZValue | def setZValue(self, zValue):
"""
Sets the z-value for this layer to the inputed value.
:param zValue | <int>
:return <bool> changed
"""
if zValue == self._zValue:
return False
self._zValue = zValue
self.sync(... | python | def setZValue(self, zValue):
"""
Sets the z-value for this layer to the inputed value.
:param zValue | <int>
:return <bool> changed
"""
if zValue == self._zValue:
return False
self._zValue = zValue
self.sync(... | [
"def",
"setZValue",
"(",
"self",
",",
"zValue",
")",
":",
"if",
"zValue",
"==",
"self",
".",
"_zValue",
":",
"return",
"False",
"self",
".",
"_zValue",
"=",
"zValue",
"self",
".",
"sync",
"(",
")",
"return",
"True"
] | Sets the z-value for this layer to the inputed value.
:param zValue | <int>
:return <bool> changed | [
"Sets",
"the",
"z",
"-",
"value",
"for",
"this",
"layer",
"to",
"the",
"inputed",
"value",
".",
":",
"param",
"zValue",
"|",
"<int",
">",
":",
"return",
"<bool",
">",
"changed"
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodelayer.py#L376-L389 | train | Sets the z - value for this layer to the inputed value. |
bitesofcode/projexui | projexui/widgets/xnodewidget/xnodelayer.py | XNodeLayer.sync | def sync(self):
"""
Syncs the items on this layer with the current layer settings.
"""
layerData = self.layerData()
for item in self.scene().items():
try:
if item._layer == self:
item.syncLayerData(layerData)
except ... | python | def sync(self):
"""
Syncs the items on this layer with the current layer settings.
"""
layerData = self.layerData()
for item in self.scene().items():
try:
if item._layer == self:
item.syncLayerData(layerData)
except ... | [
"def",
"sync",
"(",
"self",
")",
":",
"layerData",
"=",
"self",
".",
"layerData",
"(",
")",
"for",
"item",
"in",
"self",
".",
"scene",
"(",
")",
".",
"items",
"(",
")",
":",
"try",
":",
"if",
"item",
".",
"_layer",
"==",
"self",
":",
"item",
".... | Syncs the items on this layer with the current layer settings. | [
"Syncs",
"the",
"items",
"on",
"this",
"layer",
"with",
"the",
"current",
"layer",
"settings",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xnodewidget/xnodelayer.py#L391-L401 | train | Syncs the items on this layer with the current layer settings. |
core/uricore | uricore/wkz_urls.py | _safe_urlsplit | def _safe_urlsplit(s):
"""the urlparse.urlsplit cache breaks if it contains unicode and
we cannot control that. So we force type cast that thing back
to what we think it is.
"""
rv = urlparse.urlsplit(s)
# we have to check rv[2] here and not rv[1] as rv[1] will be
# an empty bytestring in c... | python | def _safe_urlsplit(s):
"""the urlparse.urlsplit cache breaks if it contains unicode and
we cannot control that. So we force type cast that thing back
to what we think it is.
"""
rv = urlparse.urlsplit(s)
# we have to check rv[2] here and not rv[1] as rv[1] will be
# an empty bytestring in c... | [
"def",
"_safe_urlsplit",
"(",
"s",
")",
":",
"rv",
"=",
"urlparse",
".",
"urlsplit",
"(",
"s",
")",
"# we have to check rv[2] here and not rv[1] as rv[1] will be",
"# an empty bytestring in case no domain was given.",
"if",
"type",
"(",
"rv",
"[",
"2",
"]",
")",
"is",... | the urlparse.urlsplit cache breaks if it contains unicode and
we cannot control that. So we force type cast that thing back
to what we think it is. | [
"the",
"urlparse",
".",
"urlsplit",
"cache",
"breaks",
"if",
"it",
"contains",
"unicode",
"and",
"we",
"cannot",
"control",
"that",
".",
"So",
"we",
"force",
"type",
"cast",
"that",
"thing",
"back",
"to",
"what",
"we",
"think",
"it",
"is",
"."
] | dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a | https://github.com/core/uricore/blob/dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a/uricore/wkz_urls.py#L58-L71 | train | safe urlsplit for urllib2. urlsplit |
core/uricore | uricore/wkz_urls.py | _uri_split | def _uri_split(uri):
"""Splits up an URI or IRI."""
scheme, netloc, path, query, fragment = _safe_urlsplit(uri)
auth = None
port = None
if '@' in netloc:
auth, netloc = netloc.split('@', 1)
if netloc.startswith('['):
host, port_part = netloc[1:].split(']', 1)
if port_p... | python | def _uri_split(uri):
"""Splits up an URI or IRI."""
scheme, netloc, path, query, fragment = _safe_urlsplit(uri)
auth = None
port = None
if '@' in netloc:
auth, netloc = netloc.split('@', 1)
if netloc.startswith('['):
host, port_part = netloc[1:].split(']', 1)
if port_p... | [
"def",
"_uri_split",
"(",
"uri",
")",
":",
"scheme",
",",
"netloc",
",",
"path",
",",
"query",
",",
"fragment",
"=",
"_safe_urlsplit",
"(",
"uri",
")",
"auth",
"=",
"None",
"port",
"=",
"None",
"if",
"'@'",
"in",
"netloc",
":",
"auth",
",",
"netloc",... | Splits up an URI or IRI. | [
"Splits",
"up",
"an",
"URI",
"or",
"IRI",
"."
] | dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a | https://github.com/core/uricore/blob/dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a/uricore/wkz_urls.py#L95-L113 | train | Splits up an URI or IRI. |
core/uricore | uricore/wkz_urls.py | iri_to_uri | def iri_to_uri(iri, charset='utf-8'):
r"""Converts any unicode based IRI to an acceptable ASCII URI. Werkzeug
always uses utf-8 URLs internally because this is what browsers and HTTP
do as well. In some places where it accepts an URL it also accepts a
unicode IRI and converts it into a URI.
Examp... | python | def iri_to_uri(iri, charset='utf-8'):
r"""Converts any unicode based IRI to an acceptable ASCII URI. Werkzeug
always uses utf-8 URLs internally because this is what browsers and HTTP
do as well. In some places where it accepts an URL it also accepts a
unicode IRI and converts it into a URI.
Examp... | [
"def",
"iri_to_uri",
"(",
"iri",
",",
"charset",
"=",
"'utf-8'",
")",
":",
"iri",
"=",
"unicode",
"(",
"iri",
")",
"scheme",
",",
"auth",
",",
"hostname",
",",
"port",
",",
"path",
",",
"query",
",",
"fragment",
"=",
"_uri_split",
"(",
"iri",
")",
... | r"""Converts any unicode based IRI to an acceptable ASCII URI. Werkzeug
always uses utf-8 URLs internally because this is what browsers and HTTP
do as well. In some places where it accepts an URL it also accepts a
unicode IRI and converts it into a URI.
Examples for IRI versus URI:
>>> iri_to_ur... | [
"r",
"Converts",
"any",
"unicode",
"based",
"IRI",
"to",
"an",
"acceptable",
"ASCII",
"URI",
".",
"Werkzeug",
"always",
"uses",
"utf",
"-",
"8",
"URLs",
"internally",
"because",
"this",
"is",
"what",
"browsers",
"and",
"HTTP",
"do",
"as",
"well",
".",
"I... | dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a | https://github.com/core/uricore/blob/dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a/uricore/wkz_urls.py#L116-L160 | train | r Converts any unicode based IRI to an acceptable ASCII URI. |
core/uricore | uricore/wkz_urls.py | uri_to_iri | def uri_to_iri(uri, charset='utf-8', errors='replace'):
r"""Converts a URI in a given charset to a IRI.
Examples for URI versus IRI
>>> uri_to_iri('http://xn--n3h.net/')
u'http://\u2603.net/'
>>> uri_to_iri('http://%C3%BCser:p%C3%A4ssword@xn--n3h.net/p%C3%A5th')
u'http://\xfcser:p\xe4ssword@\u... | python | def uri_to_iri(uri, charset='utf-8', errors='replace'):
r"""Converts a URI in a given charset to a IRI.
Examples for URI versus IRI
>>> uri_to_iri('http://xn--n3h.net/')
u'http://\u2603.net/'
>>> uri_to_iri('http://%C3%BCser:p%C3%A4ssword@xn--n3h.net/p%C3%A5th')
u'http://\xfcser:p\xe4ssword@\u... | [
"def",
"uri_to_iri",
"(",
"uri",
",",
"charset",
"=",
"'utf-8'",
",",
"errors",
"=",
"'replace'",
")",
":",
"uri",
"=",
"url_fix",
"(",
"str",
"(",
"uri",
")",
",",
"charset",
")",
"scheme",
",",
"auth",
",",
"hostname",
",",
"port",
",",
"path",
"... | r"""Converts a URI in a given charset to a IRI.
Examples for URI versus IRI
>>> uri_to_iri('http://xn--n3h.net/')
u'http://\u2603.net/'
>>> uri_to_iri('http://%C3%BCser:p%C3%A4ssword@xn--n3h.net/p%C3%A5th')
u'http://\xfcser:p\xe4ssword@\u2603.net/p\xe5th'
Query strings are left unchanged:
... | [
"r",
"Converts",
"a",
"URI",
"in",
"a",
"given",
"charset",
"to",
"a",
"IRI",
"."
] | dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a | https://github.com/core/uricore/blob/dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a/uricore/wkz_urls.py#L163-L219 | train | r Converts a URI in a given charset to a IRI. |
core/uricore | uricore/wkz_urls.py | url_decode | def url_decode(s, charset='utf-8', decode_keys=False, include_empty=True,
errors='replace', separator='&', cls=None):
"""Parse a querystring and return it as :class:`MultiDict`. Per default
only values are decoded into unicode strings. If `decode_keys` is set to
`True` the same will happen ... | python | def url_decode(s, charset='utf-8', decode_keys=False, include_empty=True,
errors='replace', separator='&', cls=None):
"""Parse a querystring and return it as :class:`MultiDict`. Per default
only values are decoded into unicode strings. If `decode_keys` is set to
`True` the same will happen ... | [
"def",
"url_decode",
"(",
"s",
",",
"charset",
"=",
"'utf-8'",
",",
"decode_keys",
"=",
"False",
",",
"include_empty",
"=",
"True",
",",
"errors",
"=",
"'replace'",
",",
"separator",
"=",
"'&'",
",",
"cls",
"=",
"None",
")",
":",
"if",
"cls",
"is",
"... | Parse a querystring and return it as :class:`MultiDict`. Per default
only values are decoded into unicode strings. If `decode_keys` is set to
`True` the same will happen for keys.
Per default a missing value for a key will default to an empty key. If
you don't want that behavior you can set `include... | [
"Parse",
"a",
"querystring",
"and",
"return",
"it",
"as",
":",
"class",
":",
"MultiDict",
".",
"Per",
"default",
"only",
"values",
"are",
"decoded",
"into",
"unicode",
"strings",
".",
"If",
"decode_keys",
"is",
"set",
"to",
"True",
"the",
"same",
"will",
... | dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a | https://github.com/core/uricore/blob/dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a/uricore/wkz_urls.py#L222-L256 | train | Parse a querystring and return it as a MultiDict. |
core/uricore | uricore/wkz_urls.py | url_decode_stream | def url_decode_stream(stream, charset='utf-8', decode_keys=False,
include_empty=True, errors='replace', separator='&',
cls=None, limit=None, return_iterator=False):
"""Works like :func:`url_decode` but decodes a stream. The behavior
of stream and limit follows functi... | python | def url_decode_stream(stream, charset='utf-8', decode_keys=False,
include_empty=True, errors='replace', separator='&',
cls=None, limit=None, return_iterator=False):
"""Works like :func:`url_decode` but decodes a stream. The behavior
of stream and limit follows functi... | [
"def",
"url_decode_stream",
"(",
"stream",
",",
"charset",
"=",
"'utf-8'",
",",
"decode_keys",
"=",
"False",
",",
"include_empty",
"=",
"True",
",",
"errors",
"=",
"'replace'",
",",
"separator",
"=",
"'&'",
",",
"cls",
"=",
"None",
",",
"limit",
"=",
"No... | Works like :func:`url_decode` but decodes a stream. The behavior
of stream and limit follows functions like
:func:`~werkzeug.wsgi.make_line_iter`. The generator of pairs is
directly fed to the `cls` so you can consume the data while it's
parsed.
.. versionadded:: 0.8
:param stream: a stream ... | [
"Works",
"like",
":",
"func",
":",
"url_decode",
"but",
"decodes",
"a",
"stream",
".",
"The",
"behavior",
"of",
"stream",
"and",
"limit",
"follows",
"functions",
"like",
":",
"func",
":",
"~werkzeug",
".",
"wsgi",
".",
"make_line_iter",
".",
"The",
"genera... | dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a | https://github.com/core/uricore/blob/dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a/uricore/wkz_urls.py#L259-L292 | train | This function decodes a URL string into a dictionary. |
core/uricore | uricore/wkz_urls.py | url_encode | def url_encode(obj, charset='utf-8', encode_keys=False, sort=False, key=None,
separator='&'):
"""URL encode a dict/`MultiDict`. If a value is `None` it will not appear
in the result string. Per default only values are encoded into the target
charset strings. If `encode_keys` is set to ``Tr... | python | def url_encode(obj, charset='utf-8', encode_keys=False, sort=False, key=None,
separator='&'):
"""URL encode a dict/`MultiDict`. If a value is `None` it will not appear
in the result string. Per default only values are encoded into the target
charset strings. If `encode_keys` is set to ``Tr... | [
"def",
"url_encode",
"(",
"obj",
",",
"charset",
"=",
"'utf-8'",
",",
"encode_keys",
"=",
"False",
",",
"sort",
"=",
"False",
",",
"key",
"=",
"None",
",",
"separator",
"=",
"'&'",
")",
":",
"return",
"separator",
".",
"join",
"(",
"_url_encode_impl",
... | URL encode a dict/`MultiDict`. If a value is `None` it will not appear
in the result string. Per default only values are encoded into the target
charset strings. If `encode_keys` is set to ``True`` unicode keys are
supported too.
If `sort` is set to `True` the items are sorted by `key` or the defaul... | [
"URL",
"encode",
"a",
"dict",
"/",
"MultiDict",
".",
"If",
"a",
"value",
"is",
"None",
"it",
"will",
"not",
"appear",
"in",
"the",
"result",
"string",
".",
"Per",
"default",
"only",
"values",
"are",
"encoded",
"into",
"the",
"target",
"charset",
"strings... | dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a | https://github.com/core/uricore/blob/dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a/uricore/wkz_urls.py#L313-L334 | train | URL encode a dict or MultiDict into a query string. |
core/uricore | uricore/wkz_urls.py | url_encode_stream | def url_encode_stream(obj, stream=None, charset='utf-8', encode_keys=False,
sort=False, key=None, separator='&'):
"""Like :meth:`url_encode` but writes the results to a stream
object. If the stream is `None` a generator over all encoded
pairs is returned.
.. versionadded:: 0.8
... | python | def url_encode_stream(obj, stream=None, charset='utf-8', encode_keys=False,
sort=False, key=None, separator='&'):
"""Like :meth:`url_encode` but writes the results to a stream
object. If the stream is `None` a generator over all encoded
pairs is returned.
.. versionadded:: 0.8
... | [
"def",
"url_encode_stream",
"(",
"obj",
",",
"stream",
"=",
"None",
",",
"charset",
"=",
"'utf-8'",
",",
"encode_keys",
"=",
"False",
",",
"sort",
"=",
"False",
",",
"key",
"=",
"None",
",",
"separator",
"=",
"'&'",
")",
":",
"gen",
"=",
"_url_encode_i... | Like :meth:`url_encode` but writes the results to a stream
object. If the stream is `None` a generator over all encoded
pairs is returned.
.. versionadded:: 0.8
:param obj: the object to encode into a query string.
:param stream: a stream to write the encoded object into or `None` if
... | [
"Like",
":",
"meth",
":",
"url_encode",
"but",
"writes",
"the",
"results",
"to",
"a",
"stream",
"object",
".",
"If",
"the",
"stream",
"is",
"None",
"a",
"generator",
"over",
"all",
"encoded",
"pairs",
"is",
"returned",
"."
] | dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a | https://github.com/core/uricore/blob/dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a/uricore/wkz_urls.py#L337-L362 | train | Like url_encode but writes the results into a stream. |
core/uricore | uricore/wkz_urls.py | url_quote | def url_quote(s, charset='utf-8', safe='/:'):
"""URL encode a single string with a given encoding.
:param s: the string to quote.
:param charset: the charset to be used.
:param safe: an optional sequence of safe characters.
"""
if isinstance(s, unicode):
s = s.encode(charset)
elif n... | python | def url_quote(s, charset='utf-8', safe='/:'):
"""URL encode a single string with a given encoding.
:param s: the string to quote.
:param charset: the charset to be used.
:param safe: an optional sequence of safe characters.
"""
if isinstance(s, unicode):
s = s.encode(charset)
elif n... | [
"def",
"url_quote",
"(",
"s",
",",
"charset",
"=",
"'utf-8'",
",",
"safe",
"=",
"'/:'",
")",
":",
"if",
"isinstance",
"(",
"s",
",",
"unicode",
")",
":",
"s",
"=",
"s",
".",
"encode",
"(",
"charset",
")",
"elif",
"not",
"isinstance",
"(",
"s",
",... | URL encode a single string with a given encoding.
:param s: the string to quote.
:param charset: the charset to be used.
:param safe: an optional sequence of safe characters. | [
"URL",
"encode",
"a",
"single",
"string",
"with",
"a",
"given",
"encoding",
"."
] | dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a | https://github.com/core/uricore/blob/dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a/uricore/wkz_urls.py#L383-L394 | train | URL quote a single string with a given encoding. |
core/uricore | uricore/wkz_urls.py | url_quote_plus | def url_quote_plus(s, charset='utf-8', safe=''):
"""URL encode a single string with the given encoding and convert
whitespace to "+".
:param s: the string to quote.
:param charset: the charset to be used.
:param safe: an optional sequence of safe characters.
"""
if isinstance(s, unicode):
... | python | def url_quote_plus(s, charset='utf-8', safe=''):
"""URL encode a single string with the given encoding and convert
whitespace to "+".
:param s: the string to quote.
:param charset: the charset to be used.
:param safe: an optional sequence of safe characters.
"""
if isinstance(s, unicode):
... | [
"def",
"url_quote_plus",
"(",
"s",
",",
"charset",
"=",
"'utf-8'",
",",
"safe",
"=",
"''",
")",
":",
"if",
"isinstance",
"(",
"s",
",",
"unicode",
")",
":",
"s",
"=",
"s",
".",
"encode",
"(",
"charset",
")",
"elif",
"not",
"isinstance",
"(",
"s",
... | URL encode a single string with the given encoding and convert
whitespace to "+".
:param s: the string to quote.
:param charset: the charset to be used.
:param safe: an optional sequence of safe characters. | [
"URL",
"encode",
"a",
"single",
"string",
"with",
"the",
"given",
"encoding",
"and",
"convert",
"whitespace",
"to",
"+",
"."
] | dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a | https://github.com/core/uricore/blob/dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a/uricore/wkz_urls.py#L397-L409 | train | URL encode a single string with the given encoding and convert
whitespace to +. |
core/uricore | uricore/wkz_urls.py | url_unquote | def url_unquote(s, charset='utf-8', errors='replace'):
"""URL decode a single string with a given decoding.
Per default encoding errors are ignored. If you want a different behavior
you can set `errors` to ``'replace'`` or ``'strict'``. In strict mode a
`HTTPUnicodeError` is raised.
:param s: th... | python | def url_unquote(s, charset='utf-8', errors='replace'):
"""URL decode a single string with a given decoding.
Per default encoding errors are ignored. If you want a different behavior
you can set `errors` to ``'replace'`` or ``'strict'``. In strict mode a
`HTTPUnicodeError` is raised.
:param s: th... | [
"def",
"url_unquote",
"(",
"s",
",",
"charset",
"=",
"'utf-8'",
",",
"errors",
"=",
"'replace'",
")",
":",
"if",
"isinstance",
"(",
"s",
",",
"unicode",
")",
":",
"s",
"=",
"s",
".",
"encode",
"(",
"charset",
")",
"return",
"_decode_unicode",
"(",
"_... | URL decode a single string with a given decoding.
Per default encoding errors are ignored. If you want a different behavior
you can set `errors` to ``'replace'`` or ``'strict'``. In strict mode a
`HTTPUnicodeError` is raised.
:param s: the string to unquote.
:param charset: the charset to be use... | [
"URL",
"decode",
"a",
"single",
"string",
"with",
"a",
"given",
"decoding",
"."
] | dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a | https://github.com/core/uricore/blob/dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a/uricore/wkz_urls.py#L412-L425 | train | URL decode a single string with a given charset. |
core/uricore | uricore/wkz_urls.py | url_unquote_plus | def url_unquote_plus(s, charset='utf-8', errors='replace'):
"""URL decode a single string with the given decoding and decode
a "+" to whitespace.
Per default encoding errors are ignored. If you want a different behavior
you can set `errors` to ``'replace'`` or ``'strict'``. In strict mode a
`HTTP... | python | def url_unquote_plus(s, charset='utf-8', errors='replace'):
"""URL decode a single string with the given decoding and decode
a "+" to whitespace.
Per default encoding errors are ignored. If you want a different behavior
you can set `errors` to ``'replace'`` or ``'strict'``. In strict mode a
`HTTP... | [
"def",
"url_unquote_plus",
"(",
"s",
",",
"charset",
"=",
"'utf-8'",
",",
"errors",
"=",
"'replace'",
")",
":",
"if",
"isinstance",
"(",
"s",
",",
"unicode",
")",
":",
"s",
"=",
"s",
".",
"encode",
"(",
"charset",
")",
"return",
"_decode_unicode",
"(",... | URL decode a single string with the given decoding and decode
a "+" to whitespace.
Per default encoding errors are ignored. If you want a different behavior
you can set `errors` to ``'replace'`` or ``'strict'``. In strict mode a
`HTTPUnicodeError` is raised.
:param s: the string to unquote.
... | [
"URL",
"decode",
"a",
"single",
"string",
"with",
"the",
"given",
"decoding",
"and",
"decode",
"a",
"+",
"to",
"whitespace",
"."
] | dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a | https://github.com/core/uricore/blob/dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a/uricore/wkz_urls.py#L428-L442 | train | URL decode a single string with the given decoding and decode
a + to whitespace. |
core/uricore | uricore/wkz_urls.py | url_fix | def url_fix(s, charset='utf-8'):
r"""Sometimes you get an URL by a user that just isn't a real URL because
it contains unsafe characters like ' ' and so on. This function can fix
some of the problems in a similar way browsers handle data entered by the
user:
>>> url_fix(u'http://de.wikipedia.org/w... | python | def url_fix(s, charset='utf-8'):
r"""Sometimes you get an URL by a user that just isn't a real URL because
it contains unsafe characters like ' ' and so on. This function can fix
some of the problems in a similar way browsers handle data entered by the
user:
>>> url_fix(u'http://de.wikipedia.org/w... | [
"def",
"url_fix",
"(",
"s",
",",
"charset",
"=",
"'utf-8'",
")",
":",
"if",
"isinstance",
"(",
"s",
",",
"unicode",
")",
":",
"s",
"=",
"s",
".",
"encode",
"(",
"charset",
",",
"'replace'",
")",
"scheme",
",",
"netloc",
",",
"path",
",",
"qs",
",... | r"""Sometimes you get an URL by a user that just isn't a real URL because
it contains unsafe characters like ' ' and so on. This function can fix
some of the problems in a similar way browsers handle data entered by the
user:
>>> url_fix(u'http://de.wikipedia.org/wiki/Elf (Begriffskl\xe4rung)')
'h... | [
"r",
"Sometimes",
"you",
"get",
"an",
"URL",
"by",
"a",
"user",
"that",
"just",
"isn",
"t",
"a",
"real",
"URL",
"because",
"it",
"contains",
"unsafe",
"characters",
"like",
"and",
"so",
"on",
".",
"This",
"function",
"can",
"fix",
"some",
"of",
"the",
... | dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a | https://github.com/core/uricore/blob/dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a/uricore/wkz_urls.py#L445-L463 | train | Fixes the URL of a user that just isn t a real URL. |
Gbps/fastlog | fastlog/log.py | FastLogger.addHandler | def addHandler(self, handler):
"""
Setups a new internal logging handler. For fastlog loggers,
handlers are kept track of in the self._handlers list
"""
self._handlers.append(handler)
self.inner.addHandler(handler) | python | def addHandler(self, handler):
"""
Setups a new internal logging handler. For fastlog loggers,
handlers are kept track of in the self._handlers list
"""
self._handlers.append(handler)
self.inner.addHandler(handler) | [
"def",
"addHandler",
"(",
"self",
",",
"handler",
")",
":",
"self",
".",
"_handlers",
".",
"append",
"(",
"handler",
")",
"self",
".",
"inner",
".",
"addHandler",
"(",
"handler",
")"
] | Setups a new internal logging handler. For fastlog loggers,
handlers are kept track of in the self._handlers list | [
"Setups",
"a",
"new",
"internal",
"logging",
"handler",
".",
"For",
"fastlog",
"loggers",
"handlers",
"are",
"kept",
"track",
"of",
"in",
"the",
"self",
".",
"_handlers",
"list"
] | 8edb2327d72191510302c4654ffaa1691fe31277 | https://github.com/Gbps/fastlog/blob/8edb2327d72191510302c4654ffaa1691fe31277/fastlog/log.py#L38-L44 | train | Adds a new internal logging handler. |
Gbps/fastlog | fastlog/log.py | FastLogger.setStyle | def setStyle(self, stylename):
"""
Adjusts the output format of messages based on the style name provided
Styles are loaded like python modules, so you can import styles from your own modules or use the ones in fastlog.styles
Available styles can be found under /fastlog/styles/
... | python | def setStyle(self, stylename):
"""
Adjusts the output format of messages based on the style name provided
Styles are loaded like python modules, so you can import styles from your own modules or use the ones in fastlog.styles
Available styles can be found under /fastlog/styles/
... | [
"def",
"setStyle",
"(",
"self",
",",
"stylename",
")",
":",
"self",
".",
"style",
"=",
"importlib",
".",
"import_module",
"(",
"stylename",
")",
"newHandler",
"=",
"Handler",
"(",
")",
"newHandler",
".",
"setFormatter",
"(",
"Formatter",
"(",
"self",
".",
... | Adjusts the output format of messages based on the style name provided
Styles are loaded like python modules, so you can import styles from your own modules or use the ones in fastlog.styles
Available styles can be found under /fastlog/styles/
The default style is 'fastlog.styles.pwntools' | [
"Adjusts",
"the",
"output",
"format",
"of",
"messages",
"based",
"on",
"the",
"style",
"name",
"provided"
] | 8edb2327d72191510302c4654ffaa1691fe31277 | https://github.com/Gbps/fastlog/blob/8edb2327d72191510302c4654ffaa1691fe31277/fastlog/log.py#L46-L59 | train | Adjusts the output format of messages based on the style name provided by the user. |
Gbps/fastlog | fastlog/log.py | FastLogger._log | def _log(self, lvl, msg, type, args, kwargs):
"""
Internal method to filter into the formatter before being passed to the main Python logger
"""
extra = kwargs.get('extra', {})
extra.setdefault("fastlog-type", type)
extra.setdefault("fastlog-indent", self._indent)
... | python | def _log(self, lvl, msg, type, args, kwargs):
"""
Internal method to filter into the formatter before being passed to the main Python logger
"""
extra = kwargs.get('extra', {})
extra.setdefault("fastlog-type", type)
extra.setdefault("fastlog-indent", self._indent)
... | [
"def",
"_log",
"(",
"self",
",",
"lvl",
",",
"msg",
",",
"type",
",",
"args",
",",
"kwargs",
")",
":",
"extra",
"=",
"kwargs",
".",
"get",
"(",
"'extra'",
",",
"{",
"}",
")",
"extra",
".",
"setdefault",
"(",
"\"fastlog-type\"",
",",
"type",
")",
... | Internal method to filter into the formatter before being passed to the main Python logger | [
"Internal",
"method",
"to",
"filter",
"into",
"the",
"formatter",
"before",
"being",
"passed",
"to",
"the",
"main",
"Python",
"logger"
] | 8edb2327d72191510302c4654ffaa1691fe31277 | https://github.com/Gbps/fastlog/blob/8edb2327d72191510302c4654ffaa1691fe31277/fastlog/log.py#L67-L78 | train | Internal method to log the message with the given level. |
Gbps/fastlog | fastlog/log.py | FastLogger.separator | def separator(self, *args, **kwargs):
"""
Prints a separator to the log. This can be used to separate blocks of log messages.
The separator will default its log level to the level of the last message printed unless
specified with the level= kwarg.
The length and type of the sep... | python | def separator(self, *args, **kwargs):
"""
Prints a separator to the log. This can be used to separate blocks of log messages.
The separator will default its log level to the level of the last message printed unless
specified with the level= kwarg.
The length and type of the sep... | [
"def",
"separator",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"levelOverride",
"=",
"kwargs",
".",
"get",
"(",
"'level'",
")",
"or",
"self",
".",
"_lastlevel",
"self",
".",
"_log",
"(",
"levelOverride",
",",
"''",
",",
"'separ... | Prints a separator to the log. This can be used to separate blocks of log messages.
The separator will default its log level to the level of the last message printed unless
specified with the level= kwarg.
The length and type of the separator string is determined
by the current style. ... | [
"Prints",
"a",
"separator",
"to",
"the",
"log",
".",
"This",
"can",
"be",
"used",
"to",
"separate",
"blocks",
"of",
"log",
"messages",
"."
] | 8edb2327d72191510302c4654ffaa1691fe31277 | https://github.com/Gbps/fastlog/blob/8edb2327d72191510302c4654ffaa1691fe31277/fastlog/log.py#L106-L117 | train | Prints a separator to the log. |
Gbps/fastlog | fastlog/log.py | FastLogger.indent | def indent(self):
"""
Begins an indented block. Must be used in a 'with' code block.
All calls to the logger inside of the block will be indented.
"""
blk = IndentBlock(self, self._indent)
self._indent += 1
return blk | python | def indent(self):
"""
Begins an indented block. Must be used in a 'with' code block.
All calls to the logger inside of the block will be indented.
"""
blk = IndentBlock(self, self._indent)
self._indent += 1
return blk | [
"def",
"indent",
"(",
"self",
")",
":",
"blk",
"=",
"IndentBlock",
"(",
"self",
",",
"self",
".",
"_indent",
")",
"self",
".",
"_indent",
"+=",
"1",
"return",
"blk"
] | Begins an indented block. Must be used in a 'with' code block.
All calls to the logger inside of the block will be indented. | [
"Begins",
"an",
"indented",
"block",
".",
"Must",
"be",
"used",
"in",
"a",
"with",
"code",
"block",
".",
"All",
"calls",
"to",
"the",
"logger",
"inside",
"of",
"the",
"block",
"will",
"be",
"indented",
"."
] | 8edb2327d72191510302c4654ffaa1691fe31277 | https://github.com/Gbps/fastlog/blob/8edb2327d72191510302c4654ffaa1691fe31277/fastlog/log.py#L119-L126 | train | Returns a new block that is indented. |
Gbps/fastlog | fastlog/log.py | FastLogger.newline | def newline(self, *args, **kwargs):
"""
Prints an empty line to the log. Uses the level of the last message
printed unless specified otherwise with the level= kwarg.
"""
levelOverride = kwargs.get('level') or self._lastlevel
self._log(levelOverride, '', 'newline', args, k... | python | def newline(self, *args, **kwargs):
"""
Prints an empty line to the log. Uses the level of the last message
printed unless specified otherwise with the level= kwarg.
"""
levelOverride = kwargs.get('level') or self._lastlevel
self._log(levelOverride, '', 'newline', args, k... | [
"def",
"newline",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"levelOverride",
"=",
"kwargs",
".",
"get",
"(",
"'level'",
")",
"or",
"self",
".",
"_lastlevel",
"self",
".",
"_log",
"(",
"levelOverride",
",",
"''",
",",
"'newline... | Prints an empty line to the log. Uses the level of the last message
printed unless specified otherwise with the level= kwarg. | [
"Prints",
"an",
"empty",
"line",
"to",
"the",
"log",
".",
"Uses",
"the",
"level",
"of",
"the",
"last",
"message",
"printed",
"unless",
"specified",
"otherwise",
"with",
"the",
"level",
"=",
"kwarg",
"."
] | 8edb2327d72191510302c4654ffaa1691fe31277 | https://github.com/Gbps/fastlog/blob/8edb2327d72191510302c4654ffaa1691fe31277/fastlog/log.py#L135-L141 | train | Print an empty line to the log. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.