repo stringlengths 7 54 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 20 28.4k | docstring stringlengths 1 46.3k | docstring_tokens listlengths 1 1.66k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value | summary stringlengths 4 350 | obf_code stringlengths 7.85k 764k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
iterative/dvc | dvc/state.py | State.save_link | def save_link(self, path_info):
"""Adds the specified path to the list of links created by dvc. This
list is later used on `dvc checkout` to cleanup old links.
Args:
path_info (dict): path info to add to the list of links.
"""
assert path_info["scheme"] == "local"
... | python | def save_link(self, path_info):
"""Adds the specified path to the list of links created by dvc. This
list is later used on `dvc checkout` to cleanup old links.
Args:
path_info (dict): path info to add to the list of links.
"""
assert path_info["scheme"] == "local"
... | [
"def",
"save_link",
"(",
"self",
",",
"path_info",
")",
":",
"assert",
"path_info",
"[",
"\"scheme\"",
"]",
"==",
"\"local\"",
"path",
"=",
"path_info",
"[",
"\"path\"",
"]",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"path",
")",
":",
"return... | Adds the specified path to the list of links created by dvc. This
list is later used on `dvc checkout` to cleanup old links.
Args:
path_info (dict): path info to add to the list of links. | [
"Adds",
"the",
"specified",
"path",
"to",
"the",
"list",
"of",
"links",
"created",
"by",
"dvc",
".",
"This",
"list",
"is",
"later",
"used",
"on",
"dvc",
"checkout",
"to",
"cleanup",
"old",
"links",
"."
] | 8bb21261e34c9632453e09090de7ebe50e38d341 | https://github.com/iterative/dvc/blob/8bb21261e34c9632453e09090de7ebe50e38d341/dvc/state.py#L425-L448 | train | Save the specified path to the list of links created by dvc checkout. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
iterative/dvc | dvc/state.py | State.remove_unused_links | def remove_unused_links(self, used):
"""Removes all saved links except the ones that are used.
Args:
used (list): list of used links that should not be removed.
"""
unused = []
self._execute("SELECT * FROM {}".format(self.LINK_STATE_TABLE))
for row in self.c... | python | def remove_unused_links(self, used):
"""Removes all saved links except the ones that are used.
Args:
used (list): list of used links that should not be removed.
"""
unused = []
self._execute("SELECT * FROM {}".format(self.LINK_STATE_TABLE))
for row in self.c... | [
"def",
"remove_unused_links",
"(",
"self",
",",
"used",
")",
":",
"unused",
"=",
"[",
"]",
"self",
".",
"_execute",
"(",
"\"SELECT * FROM {}\"",
".",
"format",
"(",
"self",
".",
"LINK_STATE_TABLE",
")",
")",
"for",
"row",
"in",
"self",
".",
"cursor",
":"... | Removes all saved links except the ones that are used.
Args:
used (list): list of used links that should not be removed. | [
"Removes",
"all",
"saved",
"links",
"except",
"the",
"ones",
"that",
"are",
"used",
"."
] | 8bb21261e34c9632453e09090de7ebe50e38d341 | https://github.com/iterative/dvc/blob/8bb21261e34c9632453e09090de7ebe50e38d341/dvc/state.py#L450-L480 | train | Removes all saved links except the ones that are used. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
iterative/dvc | dvc/command/metrics.py | show_metrics | def show_metrics(metrics, all_branches=False, all_tags=False):
"""
Args:
metrics (list): Where each element is either a `list`
if an xpath was specified, otherwise a `str`
"""
for branch, val in metrics.items():
if all_branches or all_tags:
logger.info("{branch}:"... | python | def show_metrics(metrics, all_branches=False, all_tags=False):
"""
Args:
metrics (list): Where each element is either a `list`
if an xpath was specified, otherwise a `str`
"""
for branch, val in metrics.items():
if all_branches or all_tags:
logger.info("{branch}:"... | [
"def",
"show_metrics",
"(",
"metrics",
",",
"all_branches",
"=",
"False",
",",
"all_tags",
"=",
"False",
")",
":",
"for",
"branch",
",",
"val",
"in",
"metrics",
".",
"items",
"(",
")",
":",
"if",
"all_branches",
"or",
"all_tags",
":",
"logger",
".",
"i... | Args:
metrics (list): Where each element is either a `list`
if an xpath was specified, otherwise a `str` | [
"Args",
":",
"metrics",
"(",
"list",
")",
":",
"Where",
"each",
"element",
"is",
"either",
"a",
"list",
"if",
"an",
"xpath",
"was",
"specified",
"otherwise",
"a",
"str"
] | 8bb21261e34c9632453e09090de7ebe50e38d341 | https://github.com/iterative/dvc/blob/8bb21261e34c9632453e09090de7ebe50e38d341/dvc/command/metrics.py#L13-L33 | train | Prints out the metrics in a log file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
iterative/dvc | dvc/lock.py | Lock.lock | def lock(self):
"""Acquire lock for dvc repo."""
try:
self._do_lock()
return
except LockError:
time.sleep(self.TIMEOUT)
self._do_lock() | python | def lock(self):
"""Acquire lock for dvc repo."""
try:
self._do_lock()
return
except LockError:
time.sleep(self.TIMEOUT)
self._do_lock() | [
"def",
"lock",
"(",
"self",
")",
":",
"try",
":",
"self",
".",
"_do_lock",
"(",
")",
"return",
"except",
"LockError",
":",
"time",
".",
"sleep",
"(",
"self",
".",
"TIMEOUT",
")",
"self",
".",
"_do_lock",
"(",
")"
] | Acquire lock for dvc repo. | [
"Acquire",
"lock",
"for",
"dvc",
"repo",
"."
] | 8bb21261e34c9632453e09090de7ebe50e38d341 | https://github.com/iterative/dvc/blob/8bb21261e34c9632453e09090de7ebe50e38d341/dvc/lock.py#L41-L49 | train | Acquire lock for dvc repo. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | DemoPrograms/Demo_Desktop_Widget_Email_Notification.py | read_mail | def read_mail(window):
"""
Reads late emails from IMAP server and displays them in the Window
:param window: window to display emails in
:return:
"""
mail = imaplib.IMAP4_SSL(IMAP_SERVER)
(retcode, capabilities) = mail.login(LOGIN_EMAIL, LOGIN_PASSWORD)
mail.list()
typ, data = mail.... | python | def read_mail(window):
"""
Reads late emails from IMAP server and displays them in the Window
:param window: window to display emails in
:return:
"""
mail = imaplib.IMAP4_SSL(IMAP_SERVER)
(retcode, capabilities) = mail.login(LOGIN_EMAIL, LOGIN_PASSWORD)
mail.list()
typ, data = mail.... | [
"def",
"read_mail",
"(",
"window",
")",
":",
"mail",
"=",
"imaplib",
".",
"IMAP4_SSL",
"(",
"IMAP_SERVER",
")",
"(",
"retcode",
",",
"capabilities",
")",
"=",
"mail",
".",
"login",
"(",
"LOGIN_EMAIL",
",",
"LOGIN_PASSWORD",
")",
"mail",
".",
"list",
"(",... | Reads late emails from IMAP server and displays them in the Window
:param window: window to display emails in
:return: | [
"Reads",
"late",
"emails",
"from",
"IMAP",
"server",
"and",
"displays",
"them",
"in",
"the",
"Window",
":",
"param",
"window",
":",
"window",
"to",
"display",
"emails",
"in",
":",
"return",
":"
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/DemoPrograms/Demo_Desktop_Widget_Email_Notification.py#L67-L101 | train | Reads late emails from IMAP server and displays them in the Window
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | exemaker/pysimplegui-exemaker/pysimplegui-exemaker.py | runCommand | def runCommand(cmd, timeout=None):
""" run shell command
@param cmd: command to execute
@param timeout: timeout for command execution
@return: (return code from command, command output)
"""
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output = ''
out, er... | python | def runCommand(cmd, timeout=None):
""" run shell command
@param cmd: command to execute
@param timeout: timeout for command execution
@return: (return code from command, command output)
"""
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output = ''
out, er... | [
"def",
"runCommand",
"(",
"cmd",
",",
"timeout",
"=",
"None",
")",
":",
"p",
"=",
"subprocess",
".",
"Popen",
"(",
"cmd",
",",
"shell",
"=",
"True",
",",
"stdout",
"=",
"subprocess",
".",
"PIPE",
",",
"stderr",
"=",
"subprocess",
".",
"STDOUT",
")",
... | run shell command
@param cmd: command to execute
@param timeout: timeout for command execution
@return: (return code from command, command output) | [
"run",
"shell",
"command"
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/exemaker/pysimplegui-exemaker/pysimplegui-exemaker.py#L59-L73 | train | run shell command
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIWeb/Demo Programs/Web_psutil_Kill_Processes.py | kill_proc_tree | def kill_proc_tree(pid, sig=signal.SIGTERM, include_parent=True,
timeout=None, on_terminate=None):
"""Kill a process tree (including grandchildren) with signal
"sig" and return a (gone, still_alive) tuple.
"on_terminate", if specified, is a callabck function which is
called as soon as... | python | def kill_proc_tree(pid, sig=signal.SIGTERM, include_parent=True,
timeout=None, on_terminate=None):
"""Kill a process tree (including grandchildren) with signal
"sig" and return a (gone, still_alive) tuple.
"on_terminate", if specified, is a callabck function which is
called as soon as... | [
"def",
"kill_proc_tree",
"(",
"pid",
",",
"sig",
"=",
"signal",
".",
"SIGTERM",
",",
"include_parent",
"=",
"True",
",",
"timeout",
"=",
"None",
",",
"on_terminate",
"=",
"None",
")",
":",
"if",
"pid",
"==",
"os",
".",
"getpid",
"(",
")",
":",
"raise... | Kill a process tree (including grandchildren) with signal
"sig" and return a (gone, still_alive) tuple.
"on_terminate", if specified, is a callabck function which is
called as soon as a child terminates. | [
"Kill",
"a",
"process",
"tree",
"(",
"including",
"grandchildren",
")",
"with",
"signal",
"sig",
"and",
"return",
"a",
"(",
"gone",
"still_alive",
")",
"tuple",
".",
"on_terminate",
"if",
"specified",
"is",
"a",
"callabck",
"function",
"which",
"is",
"called... | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIWeb/Demo Programs/Web_psutil_Kill_Processes.py#L16-L33 | train | Kill a process tree with signal signal. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUI27.py | Popup | def Popup(*args, **_3to2kwargs):
if 'location' in _3to2kwargs: location = _3to2kwargs['location']; del _3to2kwargs['location']
else: location = (None, None)
if 'keep_on_top' in _3to2kwargs: keep_on_top = _3to2kwargs['keep_on_top']; del _3to2kwargs['keep_on_top']
else: keep_on_top = False
if 'grab_an... | python | def Popup(*args, **_3to2kwargs):
if 'location' in _3to2kwargs: location = _3to2kwargs['location']; del _3to2kwargs['location']
else: location = (None, None)
if 'keep_on_top' in _3to2kwargs: keep_on_top = _3to2kwargs['keep_on_top']; del _3to2kwargs['keep_on_top']
else: keep_on_top = False
if 'grab_an... | [
"def",
"Popup",
"(",
"*",
"args",
",",
"*",
"*",
"_3to2kwargs",
")",
":",
"if",
"'location'",
"in",
"_3to2kwargs",
":",
"location",
"=",
"_3to2kwargs",
"[",
"'location'",
"]",
"del",
"_3to2kwargs",
"[",
"'location'",
"]",
"else",
":",
"location",
"=",
"(... | Popup - Display a popup box with as many parms as you wish to include
:param args:
:param button_color:
:param background_color:
:param text_color:
:param button_type:
:param auto_close:
:param auto_close_duration:
:param non_blocking:
:param icon:
:param line_width:
:param f... | [
"Popup",
"-",
"Display",
"a",
"popup",
"box",
"with",
"as",
"many",
"parms",
"as",
"you",
"wish",
"to",
"include",
":",
"param",
"args",
":",
":",
"param",
"button_color",
":",
":",
"param",
"background_color",
":",
":",
"param",
"text_color",
":",
":",
... | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUI27.py#L7037-L7156 | train | Creates a Popup object from the given arguments. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUI27.py | PopupNoButtons | def PopupNoButtons(*args, **_3to2kwargs):
if 'location' in _3to2kwargs: location = _3to2kwargs['location']; del _3to2kwargs['location']
else: location = (None, None)
if 'keep_on_top' in _3to2kwargs: keep_on_top = _3to2kwargs['keep_on_top']; del _3to2kwargs['keep_on_top']
else: keep_on_top = False
if... | python | def PopupNoButtons(*args, **_3to2kwargs):
if 'location' in _3to2kwargs: location = _3to2kwargs['location']; del _3to2kwargs['location']
else: location = (None, None)
if 'keep_on_top' in _3to2kwargs: keep_on_top = _3to2kwargs['keep_on_top']; del _3to2kwargs['keep_on_top']
else: keep_on_top = False
if... | [
"def",
"PopupNoButtons",
"(",
"*",
"args",
",",
"*",
"*",
"_3to2kwargs",
")",
":",
"if",
"'location'",
"in",
"_3to2kwargs",
":",
"location",
"=",
"_3to2kwargs",
"[",
"'location'",
"]",
"del",
"_3to2kwargs",
"[",
"'location'",
"]",
"else",
":",
"location",
... | Show a Popup but without any buttons
:param args:
:param button_color:
:param background_color:
:param text_color:
:param auto_close:
:param auto_close_duration:
:param non_blocking:
:param icon:
:param line_width:
:param font:
:param no_titlebar:
:param grab_anywhere:
... | [
"Show",
"a",
"Popup",
"but",
"without",
"any",
"buttons",
":",
"param",
"args",
":",
":",
"param",
"button_color",
":",
":",
"param",
"background_color",
":",
":",
"param",
"text_color",
":",
":",
"param",
"auto_close",
":",
":",
"param",
"auto_close_duratio... | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUI27.py#L7169-L7220 | train | Popups a new window with no buttons. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUI27.py | PopupError | def PopupError(*args, **_3to2kwargs):
if 'location' in _3to2kwargs: location = _3to2kwargs['location']; del _3to2kwargs['location']
else: location = (None, None)
if 'keep_on_top' in _3to2kwargs: keep_on_top = _3to2kwargs['keep_on_top']; del _3to2kwargs['keep_on_top']
else: keep_on_top = False
if 'gr... | python | def PopupError(*args, **_3to2kwargs):
if 'location' in _3to2kwargs: location = _3to2kwargs['location']; del _3to2kwargs['location']
else: location = (None, None)
if 'keep_on_top' in _3to2kwargs: keep_on_top = _3to2kwargs['keep_on_top']; del _3to2kwargs['keep_on_top']
else: keep_on_top = False
if 'gr... | [
"def",
"PopupError",
"(",
"*",
"args",
",",
"*",
"*",
"_3to2kwargs",
")",
":",
"if",
"'location'",
"in",
"_3to2kwargs",
":",
"location",
"=",
"_3to2kwargs",
"[",
"'location'",
"]",
"del",
"_3to2kwargs",
"[",
"'location'",
"]",
"else",
":",
"location",
"=",... | Popup with colored button and 'Error' as button text
:param args:
:param button_color:
:param background_color:
:param text_color:
:param auto_close:
:param auto_close_duration:
:param non_blocking:
:param icon:
:param line_width:
:param font:
:param no_titlebar:
:param g... | [
"Popup",
"with",
"colored",
"button",
"and",
"Error",
"as",
"button",
"text",
":",
"param",
"args",
":",
":",
"param",
"button_color",
":",
":",
"param",
"background_color",
":",
":",
"param",
"text_color",
":",
":",
"param",
"auto_close",
":",
":",
"param... | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUI27.py#L7522-L7573 | train | PopupError decorator. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUI27.py | TkScrollableFrame.set_scrollregion | def set_scrollregion(self, event=None):
""" Set the scroll region on the canvas"""
self.canvas.configure(scrollregion=self.canvas.bbox('all')) | python | def set_scrollregion(self, event=None):
""" Set the scroll region on the canvas"""
self.canvas.configure(scrollregion=self.canvas.bbox('all')) | [
"def",
"set_scrollregion",
"(",
"self",
",",
"event",
"=",
"None",
")",
":",
"self",
".",
"canvas",
".",
"configure",
"(",
"scrollregion",
"=",
"self",
".",
"canvas",
".",
"bbox",
"(",
"'all'",
")",
")"
] | Set the scroll region on the canvas | [
"Set",
"the",
"scroll",
"region",
"on",
"the",
"canvas"
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUI27.py#L2769-L2771 | train | Set the scroll region on the canvas | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUI27.py | TKCalendar._show_selection | def _show_selection(self, text, bbox):
"""Configure canvas for a new selection."""
x, y, width, height = bbox
textw = self._font.measure(text)
canvas = self._canvas
canvas.configure(width=width, height=height)
canvas.coords(canvas.text, width - textw, height / 2 - 1)
... | python | def _show_selection(self, text, bbox):
"""Configure canvas for a new selection."""
x, y, width, height = bbox
textw = self._font.measure(text)
canvas = self._canvas
canvas.configure(width=width, height=height)
canvas.coords(canvas.text, width - textw, height / 2 - 1)
... | [
"def",
"_show_selection",
"(",
"self",
",",
"text",
",",
"bbox",
")",
":",
"x",
",",
"y",
",",
"width",
",",
"height",
"=",
"bbox",
"textw",
"=",
"self",
".",
"_font",
".",
"measure",
"(",
"text",
")",
"canvas",
"=",
"self",
".",
"_canvas",
"canvas... | Configure canvas for a new selection. | [
"Configure",
"canvas",
"for",
"a",
"new",
"selection",
"."
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUI27.py#L3052-L3062 | train | Configure canvas for a new selection. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUI27.py | TKCalendar._pressed | def _pressed(self, evt):
"""Clicked somewhere in the calendar."""
x, y, widget = evt.x, evt.y, evt.widget
item = widget.identify_row(y)
column = widget.identify_column(x)
if not column or not item in self._items:
# clicked in the weekdays row or just outside the colu... | python | def _pressed(self, evt):
"""Clicked somewhere in the calendar."""
x, y, widget = evt.x, evt.y, evt.widget
item = widget.identify_row(y)
column = widget.identify_column(x)
if not column or not item in self._items:
# clicked in the weekdays row or just outside the colu... | [
"def",
"_pressed",
"(",
"self",
",",
"evt",
")",
":",
"x",
",",
"y",
",",
"widget",
"=",
"evt",
".",
"x",
",",
"evt",
".",
"y",
",",
"evt",
".",
"widget",
"item",
"=",
"widget",
".",
"identify_row",
"(",
"y",
")",
"column",
"=",
"widget",
".",
... | Clicked somewhere in the calendar. | [
"Clicked",
"somewhere",
"in",
"the",
"calendar",
"."
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUI27.py#L3066-L3102 | train | Called when the user clicks the keypad in the calendar. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUI27.py | TKCalendar._prev_month | def _prev_month(self):
"""Updated calendar to show the previous month."""
self._canvas.place_forget()
self._date = self._date - self.timedelta(days=1)
self._date = self.datetime(self._date.year, self._date.month, 1)
self._build_calendar() | python | def _prev_month(self):
"""Updated calendar to show the previous month."""
self._canvas.place_forget()
self._date = self._date - self.timedelta(days=1)
self._date = self.datetime(self._date.year, self._date.month, 1)
self._build_calendar() | [
"def",
"_prev_month",
"(",
"self",
")",
":",
"self",
".",
"_canvas",
".",
"place_forget",
"(",
")",
"self",
".",
"_date",
"=",
"self",
".",
"_date",
"-",
"self",
".",
"timedelta",
"(",
"days",
"=",
"1",
")",
"self",
".",
"_date",
"=",
"self",
".",
... | Updated calendar to show the previous month. | [
"Updated",
"calendar",
"to",
"show",
"the",
"previous",
"month",
"."
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUI27.py#L3104-L3110 | train | Update calendar to show the previous month. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUI27.py | TKCalendar._next_month | def _next_month(self):
"""Update calendar to show the next month."""
self._canvas.place_forget()
year, month = self._date.year, self._date.month
self._date = self._date + self.timedelta(
days=calendar.monthrange(year, month)[1] + 1)
self._date = self.datetime(self._d... | python | def _next_month(self):
"""Update calendar to show the next month."""
self._canvas.place_forget()
year, month = self._date.year, self._date.month
self._date = self._date + self.timedelta(
days=calendar.monthrange(year, month)[1] + 1)
self._date = self.datetime(self._d... | [
"def",
"_next_month",
"(",
"self",
")",
":",
"self",
".",
"_canvas",
".",
"place_forget",
"(",
")",
"year",
",",
"month",
"=",
"self",
".",
"_date",
".",
"year",
",",
"self",
".",
"_date",
".",
"month",
"self",
".",
"_date",
"=",
"self",
".",
"_dat... | Update calendar to show the next month. | [
"Update",
"calendar",
"to",
"show",
"the",
"next",
"month",
"."
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUI27.py#L3112-L3120 | train | Update calendar to show the next month. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUI27.py | TKCalendar.selection | def selection(self):
"""Return a datetime representing the current selected date."""
if not self._selection:
return None
year, month = self._date.year, self._date.month
return self.datetime(year, month, int(self._selection[0])) | python | def selection(self):
"""Return a datetime representing the current selected date."""
if not self._selection:
return None
year, month = self._date.year, self._date.month
return self.datetime(year, month, int(self._selection[0])) | [
"def",
"selection",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_selection",
":",
"return",
"None",
"year",
",",
"month",
"=",
"self",
".",
"_date",
".",
"year",
",",
"self",
".",
"_date",
".",
"month",
"return",
"self",
".",
"datetime",
"(",
... | Return a datetime representing the current selected date. | [
"Return",
"a",
"datetime",
"representing",
"the",
"current",
"selected",
"date",
"."
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUI27.py#L3125-L3131 | train | Return a datetime representing the current selected date. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUI27.py | Window.AddRow | def AddRow(self, *args):
''' Parms are a variable number of Elements '''
NumRows = len(self.Rows) # number of existing rows is our row number
CurrentRowNumber = NumRows # this row's number
CurrentRow = [] # start with a blank row and build up
# ------------------------- Add t... | python | def AddRow(self, *args):
''' Parms are a variable number of Elements '''
NumRows = len(self.Rows) # number of existing rows is our row number
CurrentRowNumber = NumRows # this row's number
CurrentRow = [] # start with a blank row and build up
# ------------------------- Add t... | [
"def",
"AddRow",
"(",
"self",
",",
"*",
"args",
")",
":",
"NumRows",
"=",
"len",
"(",
"self",
".",
"Rows",
")",
"# number of existing rows is our row number",
"CurrentRowNumber",
"=",
"NumRows",
"# this row's number",
"CurrentRow",
"=",
"[",
"]",
"# start with a b... | Parms are a variable number of Elements | [
"Parms",
"are",
"a",
"variable",
"number",
"of",
"Elements"
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUI27.py#L3638-L3649 | train | Adds a row to the list of rows. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUI27.py | Window.SetAlpha | def SetAlpha(self, alpha):
'''
Change the window's transparency
:param alpha: From 0 to 1 with 0 being completely transparent
:return:
'''
self._AlphaChannel = alpha
self.TKroot.attributes('-alpha', alpha) | python | def SetAlpha(self, alpha):
'''
Change the window's transparency
:param alpha: From 0 to 1 with 0 being completely transparent
:return:
'''
self._AlphaChannel = alpha
self.TKroot.attributes('-alpha', alpha) | [
"def",
"SetAlpha",
"(",
"self",
",",
"alpha",
")",
":",
"self",
".",
"_AlphaChannel",
"=",
"alpha",
"self",
".",
"TKroot",
".",
"attributes",
"(",
"'-alpha'",
",",
"alpha",
")"
] | Change the window's transparency
:param alpha: From 0 to 1 with 0 being completely transparent
:return: | [
"Change",
"the",
"window",
"s",
"transparency",
":",
"param",
"alpha",
":",
"From",
"0",
"to",
"1",
"with",
"0",
"being",
"completely",
"transparent",
":",
"return",
":"
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUI27.py#L4079-L4086 | train | Change the window s transparency
. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | DemoPrograms/Demo_Uno_Card_Game.py | Card.setColor | def setColor(self, color):
'''Sets Card's color and escape code.'''
if color == 'blue':
self.color = 'blue'
self.colorCode = self.colors['blue']
self.colorCodeDark = self.colors['dblue']
elif color == 'red':
self.color = 'red'
self.colo... | python | def setColor(self, color):
'''Sets Card's color and escape code.'''
if color == 'blue':
self.color = 'blue'
self.colorCode = self.colors['blue']
self.colorCodeDark = self.colors['dblue']
elif color == 'red':
self.color = 'red'
self.colo... | [
"def",
"setColor",
"(",
"self",
",",
"color",
")",
":",
"if",
"color",
"==",
"'blue'",
":",
"self",
".",
"color",
"=",
"'blue'",
"self",
".",
"colorCode",
"=",
"self",
".",
"colors",
"[",
"'blue'",
"]",
"self",
".",
"colorCodeDark",
"=",
"self",
".",... | Sets Card's color and escape code. | [
"Sets",
"Card",
"s",
"color",
"and",
"escape",
"code",
"."
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/DemoPrograms/Demo_Uno_Card_Game.py#L633-L655 | train | Sets Card s color and escape code. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | DemoPrograms/Demo_Img_Viewer.py | get_img_data | def get_img_data(f, maxsize = (1200, 850), first = False):
"""Generate image data using PIL
"""
img = Image.open(f)
img.thumbnail(maxsize)
if first: # tkinter is inactive the first time
bio = io.BytesIO()
img.save(bio, format = "PNG")
del img
retur... | python | def get_img_data(f, maxsize = (1200, 850), first = False):
"""Generate image data using PIL
"""
img = Image.open(f)
img.thumbnail(maxsize)
if first: # tkinter is inactive the first time
bio = io.BytesIO()
img.save(bio, format = "PNG")
del img
retur... | [
"def",
"get_img_data",
"(",
"f",
",",
"maxsize",
"=",
"(",
"1200",
",",
"850",
")",
",",
"first",
"=",
"False",
")",
":",
"img",
"=",
"Image",
".",
"open",
"(",
"f",
")",
"img",
".",
"thumbnail",
"(",
"maxsize",
")",
"if",
"first",
":",
"# tkinte... | Generate image data using PIL | [
"Generate",
"image",
"data",
"using",
"PIL"
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/DemoPrograms/Demo_Img_Viewer.py#L50-L60 | train | Generate image data using PIL PIL
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | DemoPrograms/Demo_Matplotlib_Ping_Graph.py | do_one | def do_one(myStats, destIP, hostname, timeout, mySeqNumber, packet_size, quiet=False):
"""
Returns either the delay (in ms) or None on timeout.
"""
delay = None
try: # One could use UDP here, but it's obscure
mySocket = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.getprotobyname("... | python | def do_one(myStats, destIP, hostname, timeout, mySeqNumber, packet_size, quiet=False):
"""
Returns either the delay (in ms) or None on timeout.
"""
delay = None
try: # One could use UDP here, but it's obscure
mySocket = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.getprotobyname("... | [
"def",
"do_one",
"(",
"myStats",
",",
"destIP",
",",
"hostname",
",",
"timeout",
",",
"mySeqNumber",
",",
"packet_size",
",",
"quiet",
"=",
"False",
")",
":",
"delay",
"=",
"None",
"try",
":",
"# One could use UDP here, but it's obscure",
"mySocket",
"=",
"soc... | Returns either the delay (in ms) or None on timeout. | [
"Returns",
"either",
"the",
"delay",
"(",
"in",
"ms",
")",
"or",
"None",
"on",
"timeout",
"."
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/DemoPrograms/Demo_Matplotlib_Ping_Graph.py#L315-L356 | train | Send one ping to the specified destination IP and return the delay on success. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | DemoPrograms/Demo_Matplotlib_Ping_Graph.py | quiet_ping | def quiet_ping(hostname, timeout=WAIT_TIMEOUT, count=NUM_PACKETS,
packet_size=PACKET_SIZE, path_finder=False):
"""
Same as verbose_ping, but the results are returned as tuple
"""
myStats = MyStats() # Reset the stats
mySeqNumber = 0 # Starting value
try:
destIP = socket.g... | python | def quiet_ping(hostname, timeout=WAIT_TIMEOUT, count=NUM_PACKETS,
packet_size=PACKET_SIZE, path_finder=False):
"""
Same as verbose_ping, but the results are returned as tuple
"""
myStats = MyStats() # Reset the stats
mySeqNumber = 0 # Starting value
try:
destIP = socket.g... | [
"def",
"quiet_ping",
"(",
"hostname",
",",
"timeout",
"=",
"WAIT_TIMEOUT",
",",
"count",
"=",
"NUM_PACKETS",
",",
"packet_size",
"=",
"PACKET_SIZE",
",",
"path_finder",
"=",
"False",
")",
":",
"myStats",
"=",
"MyStats",
"(",
")",
"# Reset the stats",
"mySeqNum... | Same as verbose_ping, but the results are returned as tuple | [
"Same",
"as",
"verbose_ping",
"but",
"the",
"results",
"are",
"returned",
"as",
"tuple"
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/DemoPrograms/Demo_Matplotlib_Ping_Graph.py#L527-L570 | train | This function is used to send a ping to the specified hostname and return the results as tuple
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | DemoPrograms/Demo_DOC_Viewer_PIL.py | get_page | def get_page(pno, zoom = False, max_size = None, first = False):
"""Return a PNG image for a document page number.
"""
dlist = dlist_tab[pno] # get display list of page number
if not dlist: # create if not yet there
dlist_tab[pno] = doc[pno].getDisplayList()
dlist = dlist_ta... | python | def get_page(pno, zoom = False, max_size = None, first = False):
"""Return a PNG image for a document page number.
"""
dlist = dlist_tab[pno] # get display list of page number
if not dlist: # create if not yet there
dlist_tab[pno] = doc[pno].getDisplayList()
dlist = dlist_ta... | [
"def",
"get_page",
"(",
"pno",
",",
"zoom",
"=",
"False",
",",
"max_size",
"=",
"None",
",",
"first",
"=",
"False",
")",
":",
"dlist",
"=",
"dlist_tab",
"[",
"pno",
"]",
"# get display list of page number",
"if",
"not",
"dlist",
":",
"# create if not yet the... | Return a PNG image for a document page number. | [
"Return",
"a",
"PNG",
"image",
"for",
"a",
"document",
"page",
"number",
"."
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/DemoPrograms/Demo_DOC_Viewer_PIL.py#L75-L118 | train | Return a PNG image for a document page number. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | DemoPrograms/Demo_Conways_Game_of_Life.py | GameOfLife.live_neighbours | def live_neighbours(self, i, j):
""" Count the number of live neighbours around point (i, j). """
s = 0 # The total number of live neighbours.
# Loop over all the neighbours.
for x in [i - 1, i, i + 1]:
for y in [j - 1, j, j + 1]:
if (x == i and y == j):
... | python | def live_neighbours(self, i, j):
""" Count the number of live neighbours around point (i, j). """
s = 0 # The total number of live neighbours.
# Loop over all the neighbours.
for x in [i - 1, i, i + 1]:
for y in [j - 1, j, j + 1]:
if (x == i and y == j):
... | [
"def",
"live_neighbours",
"(",
"self",
",",
"i",
",",
"j",
")",
":",
"s",
"=",
"0",
"# The total number of live neighbours.",
"# Loop over all the neighbours.",
"for",
"x",
"in",
"[",
"i",
"-",
"1",
",",
"i",
",",
"i",
"+",
"1",
"]",
":",
"for",
"y",
"... | Count the number of live neighbours around point (i, j). | [
"Count",
"the",
"number",
"of",
"live",
"neighbours",
"around",
"point",
"(",
"i",
"j",
")",
"."
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/DemoPrograms/Demo_Conways_Game_of_Life.py#L49-L67 | train | Count the number of live neighbours around point i and j. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | DemoPrograms/Demo_Conways_Game_of_Life.py | GameOfLife.play | def play(self):
""" Play Conway's Game of Life. """
# Write the initial configuration to file.
self.t = 1 # Current time level
while self.t <= self.T: # Evolve!
# print( "At time level %d" % t)
# Loop over each cell of the grid and apply Conway's rules.
... | python | def play(self):
""" Play Conway's Game of Life. """
# Write the initial configuration to file.
self.t = 1 # Current time level
while self.t <= self.T: # Evolve!
# print( "At time level %d" % t)
# Loop over each cell of the grid and apply Conway's rules.
... | [
"def",
"play",
"(",
"self",
")",
":",
"# Write the initial configuration to file.",
"self",
".",
"t",
"=",
"1",
"# Current time level",
"while",
"self",
".",
"t",
"<=",
"self",
".",
"T",
":",
"# Evolve!",
"# print( \"At time level %d\" % t)",
"# Loop over each cell of... | Play Conway's Game of Life. | [
"Play",
"Conway",
"s",
"Game",
"of",
"Life",
"."
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/DemoPrograms/Demo_Conways_Game_of_Life.py#L69-L97 | train | Play Conway s Game of Life. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | DemoPrograms/Demo_Desktop_Widget_psutil_Dashboard.py | human_size | def human_size(bytes, units=[' bytes','KB','MB','GB','TB', 'PB', 'EB']):
""" Returns a human readable string reprentation of bytes"""
return str(bytes) + units[0] if bytes < 1024 else human_size(bytes>>10, units[1:]) | python | def human_size(bytes, units=[' bytes','KB','MB','GB','TB', 'PB', 'EB']):
""" Returns a human readable string reprentation of bytes"""
return str(bytes) + units[0] if bytes < 1024 else human_size(bytes>>10, units[1:]) | [
"def",
"human_size",
"(",
"bytes",
",",
"units",
"=",
"[",
"' bytes'",
",",
"'KB'",
",",
"'MB'",
",",
"'GB'",
",",
"'TB'",
",",
"'PB'",
",",
"'EB'",
"]",
")",
":",
"return",
"str",
"(",
"bytes",
")",
"+",
"units",
"[",
"0",
"]",
"if",
"bytes",
... | Returns a human readable string reprentation of bytes | [
"Returns",
"a",
"human",
"readable",
"string",
"reprentation",
"of",
"bytes"
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/DemoPrograms/Demo_Desktop_Widget_psutil_Dashboard.py#L51-L53 | train | Returns a human readable string reprentation of bytes | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIWeb/Demo Programs/Web_Demo_HowDoI.py | HowDoI | def HowDoI():
'''
Make and show a window (PySimpleGUI form) that takes user input and sends to the HowDoI web oracle
Excellent example of 2 GUI concepts
1. Output Element that will show text in a scrolled window
2. Non-Window-Closing Buttons - These buttons will cause the form to return with... | python | def HowDoI():
'''
Make and show a window (PySimpleGUI form) that takes user input and sends to the HowDoI web oracle
Excellent example of 2 GUI concepts
1. Output Element that will show text in a scrolled window
2. Non-Window-Closing Buttons - These buttons will cause the form to return with... | [
"def",
"HowDoI",
"(",
")",
":",
"# ------- Make a new Window ------- #",
"sg",
".",
"ChangeLookAndFeel",
"(",
"'GreenTan'",
")",
"# give our form a spiffy set of colors",
"layout",
"=",
"[",
"[",
"sg",
".",
"Text",
"(",
"'Ask and your answer will appear here....'",
",",... | Make and show a window (PySimpleGUI form) that takes user input and sends to the HowDoI web oracle
Excellent example of 2 GUI concepts
1. Output Element that will show text in a scrolled window
2. Non-Window-Closing Buttons - These buttons will cause the form to return with the form's values, but do... | [
"Make",
"and",
"show",
"a",
"window",
"(",
"PySimpleGUI",
"form",
")",
"that",
"takes",
"user",
"input",
"and",
"sends",
"to",
"the",
"HowDoI",
"web",
"oracle",
"Excellent",
"example",
"of",
"2",
"GUI",
"concepts",
"1",
".",
"Output",
"Element",
"that",
... | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIWeb/Demo Programs/Web_Demo_HowDoI.py#L14-L68 | train | This function creates and displays a window that takes user input and sends to the HowDoI web oracle
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIWeb/Demo Programs/Web_Demo_HowDoI.py | QueryHowDoI | def QueryHowDoI(Query, num_answers, full_text, window:sg.Window):
'''
Kicks off a subprocess to send the 'Query' to HowDoI
Prints the result, which in this program will route to a gooeyGUI window
:param Query: text english question to ask the HowDoI web engine
:return: nothing
'''
howdoi_com... | python | def QueryHowDoI(Query, num_answers, full_text, window:sg.Window):
'''
Kicks off a subprocess to send the 'Query' to HowDoI
Prints the result, which in this program will route to a gooeyGUI window
:param Query: text english question to ask the HowDoI web engine
:return: nothing
'''
howdoi_com... | [
"def",
"QueryHowDoI",
"(",
"Query",
",",
"num_answers",
",",
"full_text",
",",
"window",
":",
"sg",
".",
"Window",
")",
":",
"howdoi_command",
"=",
"HOW_DO_I_COMMAND",
"full_text_option",
"=",
"' -a'",
"if",
"full_text",
"else",
"''",
"t",
"=",
"subprocess",
... | Kicks off a subprocess to send the 'Query' to HowDoI
Prints the result, which in this program will route to a gooeyGUI window
:param Query: text english question to ask the HowDoI web engine
:return: nothing | [
"Kicks",
"off",
"a",
"subprocess",
"to",
"send",
"the",
"Query",
"to",
"HowDoI",
"Prints",
"the",
"result",
"which",
"in",
"this",
"program",
"will",
"route",
"to",
"a",
"gooeyGUI",
"window",
":",
"param",
"Query",
":",
"text",
"english",
"question",
"to",... | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIWeb/Demo Programs/Web_Demo_HowDoI.py#L70-L84 | train | Queries the HowDoI web engine and returns the result. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIWeb/Demo Programs/widgets_overview_app.py | MyApp.list_view_on_selected | def list_view_on_selected(self, widget, selected_item_key):
""" The selection event of the listView, returns a key of the clicked event.
You can retrieve the item rapidly
"""
self.lbl.set_text('List selection: ' + self.listView.children[selected_item_key].get_text()) | python | def list_view_on_selected(self, widget, selected_item_key):
""" The selection event of the listView, returns a key of the clicked event.
You can retrieve the item rapidly
"""
self.lbl.set_text('List selection: ' + self.listView.children[selected_item_key].get_text()) | [
"def",
"list_view_on_selected",
"(",
"self",
",",
"widget",
",",
"selected_item_key",
")",
":",
"self",
".",
"lbl",
".",
"set_text",
"(",
"'List selection: '",
"+",
"self",
".",
"listView",
".",
"children",
"[",
"selected_item_key",
"]",
".",
"get_text",
"(",
... | The selection event of the listView, returns a key of the clicked event.
You can retrieve the item rapidly | [
"The",
"selection",
"event",
"of",
"the",
"listView",
"returns",
"a",
"key",
"of",
"the",
"clicked",
"event",
".",
"You",
"can",
"retrieve",
"the",
"item",
"rapidly"
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIWeb/Demo Programs/widgets_overview_app.py#L281-L285 | train | The selection event of the listView returns a key of the clicked event. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | DemoPrograms/Demo_Matplotlib_Browser_Paned.py | PyplotHistogram | def PyplotHistogram():
"""
=============================================================
Demo of the histogram (hist) function with multiple data sets
=============================================================
Plot histogram with multiple sample sets and demonstrate:
* Use of legend wit... | python | def PyplotHistogram():
"""
=============================================================
Demo of the histogram (hist) function with multiple data sets
=============================================================
Plot histogram with multiple sample sets and demonstrate:
* Use of legend wit... | [
"def",
"PyplotHistogram",
"(",
")",
":",
"import",
"numpy",
"as",
"np",
"import",
"matplotlib",
".",
"pyplot",
"as",
"plt",
"np",
".",
"random",
".",
"seed",
"(",
"0",
")",
"n_bins",
"=",
"10",
"x",
"=",
"np",
".",
"random",
".",
"randn",
"(",
"100... | =============================================================
Demo of the histogram (hist) function with multiple data sets
=============================================================
Plot histogram with multiple sample sets and demonstrate:
* Use of legend with multiple sample sets
* St... | [
"=============================================================",
"Demo",
"of",
"the",
"histogram",
"(",
"hist",
")",
"function",
"with",
"multiple",
"data",
"sets",
"============================================================="
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/DemoPrograms/Demo_Matplotlib_Browser_Paned.py#L44-L91 | train | A function that plots a histogram of the same data set and multiple sample sets. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | DemoPrograms/Demo_Matplotlib_Browser_Paned.py | PyplotArtistBoxPlots | def PyplotArtistBoxPlots():
"""
=========================================
Demo of artist customization in box plots
=========================================
This example demonstrates how to use the various kwargs
to fully customize box plots. The first figure demonstrates
how to remove and... | python | def PyplotArtistBoxPlots():
"""
=========================================
Demo of artist customization in box plots
=========================================
This example demonstrates how to use the various kwargs
to fully customize box plots. The first figure demonstrates
how to remove and... | [
"def",
"PyplotArtistBoxPlots",
"(",
")",
":",
"import",
"numpy",
"as",
"np",
"import",
"matplotlib",
".",
"pyplot",
"as",
"plt",
"# fake data",
"np",
".",
"random",
".",
"seed",
"(",
"937",
")",
"data",
"=",
"np",
".",
"random",
".",
"lognormal",
"(",
... | =========================================
Demo of artist customization in box plots
=========================================
This example demonstrates how to use the various kwargs
to fully customize box plots. The first figure demonstrates
how to remove and add individual components (note that th... | [
"=========================================",
"Demo",
"of",
"artist",
"customization",
"in",
"box",
"plots",
"========================================="
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/DemoPrograms/Demo_Matplotlib_Browser_Paned.py#L93-L147 | train | This function is a simple example of how to use the basic and standardized box plots for the given base - artist. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | DemoPrograms/Demo_Matplotlib_Browser_Paned.py | PyplotLineStyles | def PyplotLineStyles():
"""
==========
Linestyles
==========
This examples showcases different linestyles copying those of Tikz/PGF.
"""
import numpy as np
import matplotlib.pyplot as plt
from collections import OrderedDict
from matplotlib.transforms import blended_transform_fac... | python | def PyplotLineStyles():
"""
==========
Linestyles
==========
This examples showcases different linestyles copying those of Tikz/PGF.
"""
import numpy as np
import matplotlib.pyplot as plt
from collections import OrderedDict
from matplotlib.transforms import blended_transform_fac... | [
"def",
"PyplotLineStyles",
"(",
")",
":",
"import",
"numpy",
"as",
"np",
"import",
"matplotlib",
".",
"pyplot",
"as",
"plt",
"from",
"collections",
"import",
"OrderedDict",
"from",
"matplotlib",
".",
"transforms",
"import",
"blended_transform_factory",
"linestyles",... | ==========
Linestyles
==========
This examples showcases different linestyles copying those of Tikz/PGF. | [
"==========",
"Linestyles",
"=========="
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/DemoPrograms/Demo_Matplotlib_Browser_Paned.py#L211-L262 | train | Plots the line styles of the Tikz - PGF. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIQt/PySimpleGUIQt.py | convert_tkinter_size_to_Qt | def convert_tkinter_size_to_Qt(size):
"""
Converts size in characters to size in pixels
:param size: size in characters, rows
:return: size in pixels, pixels
"""
qtsize = size
if size[1] is not None and size[1] < DEFAULT_PIXEL_TO_CHARS_CUTOFF: # change from character based size to pi... | python | def convert_tkinter_size_to_Qt(size):
"""
Converts size in characters to size in pixels
:param size: size in characters, rows
:return: size in pixels, pixels
"""
qtsize = size
if size[1] is not None and size[1] < DEFAULT_PIXEL_TO_CHARS_CUTOFF: # change from character based size to pi... | [
"def",
"convert_tkinter_size_to_Qt",
"(",
"size",
")",
":",
"qtsize",
"=",
"size",
"if",
"size",
"[",
"1",
"]",
"is",
"not",
"None",
"and",
"size",
"[",
"1",
"]",
"<",
"DEFAULT_PIXEL_TO_CHARS_CUTOFF",
":",
"# change from character based size to pixels (roughly)",
... | Converts size in characters to size in pixels
:param size: size in characters, rows
:return: size in pixels, pixels | [
"Converts",
"size",
"in",
"characters",
"to",
"size",
"in",
"pixels",
":",
"param",
"size",
":",
"size",
"in",
"characters",
"rows",
":",
"return",
":",
"size",
"in",
"pixels",
"pixels"
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIQt/PySimpleGUIQt.py#L3730-L3739 | train | Converts size in characters to size in pixels
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIQt/PySimpleGUIQt.py | create_style_from_font | def create_style_from_font(font):
"""
Convert from font string/tyuple into a Qt style sheet string
:param font: "Arial 10 Bold" or ('Arial', 10, 'Bold)
:return: style string that can be combined with other style strings
"""
if font is None:
return ''
if type(font) is str:
_... | python | def create_style_from_font(font):
"""
Convert from font string/tyuple into a Qt style sheet string
:param font: "Arial 10 Bold" or ('Arial', 10, 'Bold)
:return: style string that can be combined with other style strings
"""
if font is None:
return ''
if type(font) is str:
_... | [
"def",
"create_style_from_font",
"(",
"font",
")",
":",
"if",
"font",
"is",
"None",
":",
"return",
"''",
"if",
"type",
"(",
"font",
")",
"is",
"str",
":",
"_font",
"=",
"font",
".",
"split",
"(",
"' '",
")",
"else",
":",
"_font",
"=",
"font",
"styl... | Convert from font string/tyuple into a Qt style sheet string
:param font: "Arial 10 Bold" or ('Arial', 10, 'Bold)
:return: style string that can be combined with other style strings | [
"Convert",
"from",
"font",
"string",
"/",
"tyuple",
"into",
"a",
"Qt",
"style",
"sheet",
"string",
":",
"param",
"font",
":",
"Arial",
"10",
"Bold",
"or",
"(",
"Arial",
"10",
"Bold",
")",
":",
"return",
":",
"style",
"string",
"that",
"can",
"be",
"c... | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIQt/PySimpleGUIQt.py#L3756-L3782 | train | Convert from font string to Qt style sheet string | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIQt/PySimpleGUIQt.py | PopupGetFolder | def PopupGetFolder(message, title=None, default_path='', no_window=False, size=(None, None), button_color=None,
background_color=None, text_color=None, icon=DEFAULT_WINDOW_ICON, font=None, no_titlebar=False,
grab_anywhere=False, keep_on_top=False, location=(None, None), initial_fol... | python | def PopupGetFolder(message, title=None, default_path='', no_window=False, size=(None, None), button_color=None,
background_color=None, text_color=None, icon=DEFAULT_WINDOW_ICON, font=None, no_titlebar=False,
grab_anywhere=False, keep_on_top=False, location=(None, None), initial_fol... | [
"def",
"PopupGetFolder",
"(",
"message",
",",
"title",
"=",
"None",
",",
"default_path",
"=",
"''",
",",
"no_window",
"=",
"False",
",",
"size",
"=",
"(",
"None",
",",
"None",
")",
",",
"button_color",
"=",
"None",
",",
"background_color",
"=",
"None",
... | Display popup with text entry field and browse button. Browse for folder
:param message:
:param default_path:
:param no_window:
:param size:
:param button_color:
:param background_color:
:param text_color:
:param icon:
:param font:
:param no_titlebar:
:param grab_anywhere:
... | [
"Display",
"popup",
"with",
"text",
"entry",
"field",
"and",
"browse",
"button",
".",
"Browse",
"for",
"folder",
":",
"param",
"message",
":",
":",
"param",
"default_path",
":",
":",
"param",
"no_window",
":",
":",
"param",
"size",
":",
":",
"param",
"bu... | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIQt/PySimpleGUIQt.py#L7025-L7070 | train | Displays a popup with text entry field and browse button. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIQt/PySimpleGUIQt.py | PopupGetFile | def PopupGetFile(message, title=None, default_path='', default_extension='', save_as=False, file_types=(("ALL Files", "*"),),
no_window=False, size=(None, None), button_color=None, background_color=None, text_color=None,
icon=DEFAULT_WINDOW_ICON, font=None, no_titlebar=False, grab_anyw... | python | def PopupGetFile(message, title=None, default_path='', default_extension='', save_as=False, file_types=(("ALL Files", "*"),),
no_window=False, size=(None, None), button_color=None, background_color=None, text_color=None,
icon=DEFAULT_WINDOW_ICON, font=None, no_titlebar=False, grab_anyw... | [
"def",
"PopupGetFile",
"(",
"message",
",",
"title",
"=",
"None",
",",
"default_path",
"=",
"''",
",",
"default_extension",
"=",
"''",
",",
"save_as",
"=",
"False",
",",
"file_types",
"=",
"(",
"(",
"\"ALL Files\"",
",",
"\"*\"",
")",
",",
")",
",",
"n... | Display popup with text entry field and browse button. Browse for file
:param message:
:param default_path:
:param default_extension:
:param save_as:
:param file_types:
:param no_window:
:param size:
:param button_color:
:param background_color:
:param text_color:
:param icon... | [
"Display",
"popup",
"with",
"text",
"entry",
"field",
"and",
"browse",
"button",
".",
"Browse",
"for",
"file",
":",
"param",
"message",
":",
":",
"param",
"default_path",
":",
":",
"param",
"default_extension",
":",
":",
"param",
"save_as",
":",
":",
"para... | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIQt/PySimpleGUIQt.py#L7075-L7132 | train | Display a popup with text entry field and browse button. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIQt/PySimpleGUIQt.py | PopupGetText | def PopupGetText(message, title=None, default_text='', password_char='', size=(None, None), button_color=None,
background_color=None, text_color=None, icon=DEFAULT_WINDOW_ICON, font=None, no_titlebar=False,
grab_anywhere=False, keep_on_top=False, location=(None, None)):
"""
Dis... | python | def PopupGetText(message, title=None, default_text='', password_char='', size=(None, None), button_color=None,
background_color=None, text_color=None, icon=DEFAULT_WINDOW_ICON, font=None, no_titlebar=False,
grab_anywhere=False, keep_on_top=False, location=(None, None)):
"""
Dis... | [
"def",
"PopupGetText",
"(",
"message",
",",
"title",
"=",
"None",
",",
"default_text",
"=",
"''",
",",
"password_char",
"=",
"''",
",",
"size",
"=",
"(",
"None",
",",
"None",
")",
",",
"button_color",
"=",
"None",
",",
"background_color",
"=",
"None",
... | Display Popup with text entry field
:param message:
:param default_text:
:param password_char:
:param size:
:param button_color:
:param background_color:
:param text_color:
:param icon:
:param font:
:param no_titlebar:
:param grab_anywhere:
:param keep_on_top:
:param ... | [
"Display",
"Popup",
"with",
"text",
"entry",
"field",
":",
"param",
"message",
":",
":",
"param",
"default_text",
":",
":",
"param",
"password_char",
":",
":",
"param",
"size",
":",
":",
"param",
"button_color",
":",
":",
"param",
"background_color",
":",
... | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIQt/PySimpleGUIQt.py#L7137-L7173 | train | Display Popup with text entry field. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIQt/PySimpleGUIQt.py | SystemTray.Read | def Read(self, timeout=None):
'''
Reads the context menu
:param timeout: Optional. Any value other than None indicates a non-blocking read
:return:
'''
if not self.Shown:
self.Shown = True
self.TrayIcon.show()
if timeout is None:
... | python | def Read(self, timeout=None):
'''
Reads the context menu
:param timeout: Optional. Any value other than None indicates a non-blocking read
:return:
'''
if not self.Shown:
self.Shown = True
self.TrayIcon.show()
if timeout is None:
... | [
"def",
"Read",
"(",
"self",
",",
"timeout",
"=",
"None",
")",
":",
"if",
"not",
"self",
".",
"Shown",
":",
"self",
".",
"Shown",
"=",
"True",
"self",
".",
"TrayIcon",
".",
"show",
"(",
")",
"if",
"timeout",
"is",
"None",
":",
"self",
".",
"App",
... | Reads the context menu
:param timeout: Optional. Any value other than None indicates a non-blocking read
:return: | [
"Reads",
"the",
"context",
"menu",
":",
"param",
"timeout",
":",
"Optional",
".",
"Any",
"value",
"other",
"than",
"None",
"indicates",
"a",
"non",
"-",
"blocking",
"read",
":",
"return",
":"
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIQt/PySimpleGUIQt.py#L2953-L2975 | train | Reads the context menu and returns the item. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIQt/PySimpleGUIQt.py | SystemTray.ShowMessage | def ShowMessage(self, title, message, filename=None, data=None, data_base64=None, messageicon=None, time=10000):
'''
Shows a balloon above icon in system tray
:param title: Title shown in balloon
:param message: Message to be displayed
:param filename: Optional icon filename
... | python | def ShowMessage(self, title, message, filename=None, data=None, data_base64=None, messageicon=None, time=10000):
'''
Shows a balloon above icon in system tray
:param title: Title shown in balloon
:param message: Message to be displayed
:param filename: Optional icon filename
... | [
"def",
"ShowMessage",
"(",
"self",
",",
"title",
",",
"message",
",",
"filename",
"=",
"None",
",",
"data",
"=",
"None",
",",
"data_base64",
"=",
"None",
",",
"messageicon",
"=",
"None",
",",
"time",
"=",
"10000",
")",
":",
"qicon",
"=",
"None",
"if"... | Shows a balloon above icon in system tray
:param title: Title shown in balloon
:param message: Message to be displayed
:param filename: Optional icon filename
:param data: Optional in-ram icon
:param data_base64: Optional base64 icon
:param time: How long to display mess... | [
"Shows",
"a",
"balloon",
"above",
"icon",
"in",
"system",
"tray",
":",
"param",
"title",
":",
"Title",
"shown",
"in",
"balloon",
":",
"param",
"message",
":",
"Message",
"to",
"be",
"displayed",
":",
"param",
"filename",
":",
"Optional",
"icon",
"filename"... | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIQt/PySimpleGUIQt.py#L2988-L3022 | train | Show a message in system tray. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIQt/PySimpleGUIQt.py | SystemTray.Update | def Update(self, menu=None, tooltip=None,filename=None, data=None, data_base64=None,):
'''
Updates the menu, tooltip or icon
:param menu: menu defintion
:param tooltip: string representing tooltip
:param filename: icon filename
:param data: icon raw image
:param... | python | def Update(self, menu=None, tooltip=None,filename=None, data=None, data_base64=None,):
'''
Updates the menu, tooltip or icon
:param menu: menu defintion
:param tooltip: string representing tooltip
:param filename: icon filename
:param data: icon raw image
:param... | [
"def",
"Update",
"(",
"self",
",",
"menu",
"=",
"None",
",",
"tooltip",
"=",
"None",
",",
"filename",
"=",
"None",
",",
"data",
"=",
"None",
",",
"data_base64",
"=",
"None",
",",
")",
":",
"# Menu",
"if",
"menu",
"is",
"not",
"None",
":",
"self",
... | Updates the menu, tooltip or icon
:param menu: menu defintion
:param tooltip: string representing tooltip
:param filename: icon filename
:param data: icon raw image
:param data_base64: icon base 64 image
:return: | [
"Updates",
"the",
"menu",
"tooltip",
"or",
"icon",
":",
"param",
"menu",
":",
"menu",
"defintion",
":",
"param",
"tooltip",
":",
"string",
"representing",
"tooltip",
":",
"param",
"filename",
":",
"icon",
"filename",
":",
"param",
"data",
":",
"icon",
"raw... | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIQt/PySimpleGUIQt.py#L3034-L3069 | train | Updates the menu tooltip or icon with the given data. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIQt/PySimpleGUIQt.py | Window.SetAlpha | def SetAlpha(self, alpha):
'''
Change the window's transparency
:param alpha: From 0 to 1 with 0 being completely transparent
:return:
'''
self._AlphaChannel = alpha
if self._AlphaChannel is not None:
self.QT_QMainWindow.setWindowOpacity(self._AlphaCha... | python | def SetAlpha(self, alpha):
'''
Change the window's transparency
:param alpha: From 0 to 1 with 0 being completely transparent
:return:
'''
self._AlphaChannel = alpha
if self._AlphaChannel is not None:
self.QT_QMainWindow.setWindowOpacity(self._AlphaCha... | [
"def",
"SetAlpha",
"(",
"self",
",",
"alpha",
")",
":",
"self",
".",
"_AlphaChannel",
"=",
"alpha",
"if",
"self",
".",
"_AlphaChannel",
"is",
"not",
"None",
":",
"self",
".",
"QT_QMainWindow",
".",
"setWindowOpacity",
"(",
"self",
".",
"_AlphaChannel",
")"... | Change the window's transparency
:param alpha: From 0 to 1 with 0 being completely transparent
:return: | [
"Change",
"the",
"window",
"s",
"transparency",
":",
"param",
"alpha",
":",
"From",
"0",
"to",
"1",
"with",
"0",
"being",
"completely",
"transparent",
":",
"return",
":"
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIQt/PySimpleGUIQt.py#L3576-L3584 | train | Change the window s transparency. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIWx/PySimpleGUIWx.py | convert_tkinter_size_to_Wx | def convert_tkinter_size_to_Wx(size):
"""
Converts size in characters to size in pixels
:param size: size in characters, rows
:return: size in pixels, pixels
"""
qtsize = size
if size[1] is not None and size[1] < DEFAULT_PIXEL_TO_CHARS_CUTOFF: # change from character based size to pi... | python | def convert_tkinter_size_to_Wx(size):
"""
Converts size in characters to size in pixels
:param size: size in characters, rows
:return: size in pixels, pixels
"""
qtsize = size
if size[1] is not None and size[1] < DEFAULT_PIXEL_TO_CHARS_CUTOFF: # change from character based size to pi... | [
"def",
"convert_tkinter_size_to_Wx",
"(",
"size",
")",
":",
"qtsize",
"=",
"size",
"if",
"size",
"[",
"1",
"]",
"is",
"not",
"None",
"and",
"size",
"[",
"1",
"]",
"<",
"DEFAULT_PIXEL_TO_CHARS_CUTOFF",
":",
"# change from character based size to pixels (roughly)",
... | Converts size in characters to size in pixels
:param size: size in characters, rows
:return: size in pixels, pixels | [
"Converts",
"size",
"in",
"characters",
"to",
"size",
"in",
"pixels",
":",
"param",
"size",
":",
"size",
"in",
"characters",
"rows",
":",
"return",
":",
"size",
"in",
"pixels",
"pixels"
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIWx/PySimpleGUIWx.py#L3570-L3579 | train | Converts size in characters to size in pixels
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIWx/PySimpleGUIWx.py | font_to_wx_font | def font_to_wx_font(font):
"""
Convert from font string/tyuple into a Qt style sheet string
:param font: "Arial 10 Bold" or ('Arial', 10, 'Bold)
:return: style string that can be combined with other style strings
"""
if font is None:
return ''
if type(font) is str:
_font = ... | python | def font_to_wx_font(font):
"""
Convert from font string/tyuple into a Qt style sheet string
:param font: "Arial 10 Bold" or ('Arial', 10, 'Bold)
:return: style string that can be combined with other style strings
"""
if font is None:
return ''
if type(font) is str:
_font = ... | [
"def",
"font_to_wx_font",
"(",
"font",
")",
":",
"if",
"font",
"is",
"None",
":",
"return",
"''",
"if",
"type",
"(",
"font",
")",
"is",
"str",
":",
"_font",
"=",
"font",
".",
"split",
"(",
"' '",
")",
"else",
":",
"_font",
"=",
"font",
"name",
"=... | Convert from font string/tyuple into a Qt style sheet string
:param font: "Arial 10 Bold" or ('Arial', 10, 'Bold)
:return: style string that can be combined with other style strings | [
"Convert",
"from",
"font",
"string",
"/",
"tyuple",
"into",
"a",
"Qt",
"style",
"sheet",
"string",
":",
"param",
"font",
":",
"Arial",
"10",
"Bold",
"or",
"(",
"Arial",
"10",
"Bold",
")",
":",
"return",
":",
"style",
"string",
"that",
"can",
"be",
"c... | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIWx/PySimpleGUIWx.py#L3582-L3612 | train | Convert a font string into a Qt style sheet string | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIWx/PySimpleGUIWx.py | PopupError | def PopupError(*args, button_color=DEFAULT_ERROR_BUTTON_COLOR, background_color=None, text_color=None, auto_close=False,
auto_close_duration=None, non_blocking=False, icon=DEFAULT_WINDOW_ICON, line_width=None, font=None,
no_titlebar=False, grab_anywhere=False, keep_on_top=False, location=(... | python | def PopupError(*args, button_color=DEFAULT_ERROR_BUTTON_COLOR, background_color=None, text_color=None, auto_close=False,
auto_close_duration=None, non_blocking=False, icon=DEFAULT_WINDOW_ICON, line_width=None, font=None,
no_titlebar=False, grab_anywhere=False, keep_on_top=False, location=(... | [
"def",
"PopupError",
"(",
"*",
"args",
",",
"button_color",
"=",
"DEFAULT_ERROR_BUTTON_COLOR",
",",
"background_color",
"=",
"None",
",",
"text_color",
"=",
"None",
",",
"auto_close",
"=",
"False",
",",
"auto_close_duration",
"=",
"None",
",",
"non_blocking",
"=... | Popup with colored button and 'Error' as button text
:param args:
:param button_color:
:param background_color:
:param text_color:
:param auto_close:
:param auto_close_duration:
:param non_blocking:
:param icon:
:param line_width:
:param font:
:param no_titlebar:
:param g... | [
"Popup",
"with",
"colored",
"button",
"and",
"Error",
"as",
"button",
"text",
":",
"param",
"args",
":",
":",
"param",
"button_color",
":",
":",
"param",
"background_color",
":",
":",
"param",
"text_color",
":",
":",
"param",
"auto_close",
":",
":",
"param... | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIWx/PySimpleGUIWx.py#L6621-L6645 | train | Shortcut for Popup with colored button and Error as button text. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIWx/PySimpleGUIWx.py | PopupGetFolder | def PopupGetFolder(message, title=None, default_path='', no_window=False, size=(None, None), button_color=None,
background_color=None, text_color=None, icon=DEFAULT_WINDOW_ICON, font=None, no_titlebar=False,
grab_anywhere=False, keep_on_top=False, location=(None, None), initial_fol... | python | def PopupGetFolder(message, title=None, default_path='', no_window=False, size=(None, None), button_color=None,
background_color=None, text_color=None, icon=DEFAULT_WINDOW_ICON, font=None, no_titlebar=False,
grab_anywhere=False, keep_on_top=False, location=(None, None), initial_fol... | [
"def",
"PopupGetFolder",
"(",
"message",
",",
"title",
"=",
"None",
",",
"default_path",
"=",
"''",
",",
"no_window",
"=",
"False",
",",
"size",
"=",
"(",
"None",
",",
"None",
")",
",",
"button_color",
"=",
"None",
",",
"background_color",
"=",
"None",
... | Display popup with text entry field and browse button. Browse for folder
:param message:
:param default_path:
:param no_window:
:param size:
:param button_color:
:param background_color:
:param text_color:
:param icon:
:param font:
:param no_titlebar:
:param grab_anywhere:
... | [
"Display",
"popup",
"with",
"text",
"entry",
"field",
"and",
"browse",
"button",
".",
"Browse",
"for",
"folder",
":",
"param",
"message",
":",
":",
"param",
"default_path",
":",
":",
"param",
"no_window",
":",
":",
"param",
"size",
":",
":",
"param",
"bu... | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIWx/PySimpleGUIWx.py#L6768-L6821 | train | Displays a popup with text entry field and browse button. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIWx/PySimpleGUIWx.py | PopupGetFile | def PopupGetFile(message, title=None, default_path='', default_extension='', save_as=False, file_types=(("ALL Files", "*"),),
no_window=False, size=(None, None), button_color=None, background_color=None, text_color=None,
icon=DEFAULT_WINDOW_ICON, font=None, no_titlebar=False, grab_anyw... | python | def PopupGetFile(message, title=None, default_path='', default_extension='', save_as=False, file_types=(("ALL Files", "*"),),
no_window=False, size=(None, None), button_color=None, background_color=None, text_color=None,
icon=DEFAULT_WINDOW_ICON, font=None, no_titlebar=False, grab_anyw... | [
"def",
"PopupGetFile",
"(",
"message",
",",
"title",
"=",
"None",
",",
"default_path",
"=",
"''",
",",
"default_extension",
"=",
"''",
",",
"save_as",
"=",
"False",
",",
"file_types",
"=",
"(",
"(",
"\"ALL Files\"",
",",
"\"*\"",
")",
",",
")",
",",
"n... | Display popup with text entry field and browse button. Browse for file
:param message:
:param default_path:
:param default_extension:
:param save_as:
:param file_types:
:param no_window:
:param size:
:param button_color:
:param background_color:
:param text_color:
:param icon... | [
"Display",
"popup",
"with",
"text",
"entry",
"field",
"and",
"browse",
"button",
".",
"Browse",
"for",
"file",
":",
"param",
"message",
":",
":",
"param",
"default_path",
":",
":",
"param",
"default_extension",
":",
":",
"param",
"save_as",
":",
":",
"para... | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIWx/PySimpleGUIWx.py#L6826-L6888 | train | Display a popup with text entry field and browse button. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIWx/PySimpleGUIWx.py | SystemTray.Read | def Read(self, timeout=None):
'''
Reads the context menu
:param timeout: Optional. Any value other than None indicates a non-blocking read
:return:
'''
# if not self.Shown:
# self.Shown = True
# self.TrayIcon.show()
timeout1 = timeout
... | python | def Read(self, timeout=None):
'''
Reads the context menu
:param timeout: Optional. Any value other than None indicates a non-blocking read
:return:
'''
# if not self.Shown:
# self.Shown = True
# self.TrayIcon.show()
timeout1 = timeout
... | [
"def",
"Read",
"(",
"self",
",",
"timeout",
"=",
"None",
")",
":",
"# if not self.Shown:",
"# self.Shown = True",
"# self.TrayIcon.show()",
"timeout1",
"=",
"timeout",
"# if timeout1 == 0:",
"# timeout1 = 1",
"# if wx.GetApp():",
"# wx.GetApp().ProcessPendingEve... | Reads the context menu
:param timeout: Optional. Any value other than None indicates a non-blocking read
:return: | [
"Reads",
"the",
"context",
"menu",
":",
"param",
"timeout",
":",
"Optional",
".",
"Any",
"value",
"other",
"than",
"None",
"indicates",
"a",
"non",
"-",
"blocking",
"read",
":",
"return",
":"
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIWx/PySimpleGUIWx.py#L2817-L2847 | train | Reads the context menu and returns the menu item that was chosen. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIWx/PySimpleGUIWx.py | SystemTray.ShowMessage | def ShowMessage(self, title, message, filename=None, data=None, data_base64=None, messageicon=None, time=10000):
'''
Shows a balloon above icon in system tray
:param title: Title shown in balloon
:param message: Message to be displayed
:param filename: Optional icon filename
... | python | def ShowMessage(self, title, message, filename=None, data=None, data_base64=None, messageicon=None, time=10000):
'''
Shows a balloon above icon in system tray
:param title: Title shown in balloon
:param message: Message to be displayed
:param filename: Optional icon filename
... | [
"def",
"ShowMessage",
"(",
"self",
",",
"title",
",",
"message",
",",
"filename",
"=",
"None",
",",
"data",
"=",
"None",
",",
"data_base64",
"=",
"None",
",",
"messageicon",
"=",
"None",
",",
"time",
"=",
"10000",
")",
":",
"if",
"messageicon",
"is",
... | Shows a balloon above icon in system tray
:param title: Title shown in balloon
:param message: Message to be displayed
:param filename: Optional icon filename
:param data: Optional in-ram icon
:param data_base64: Optional base64 icon
:param time: How long to display mess... | [
"Shows",
"a",
"balloon",
"above",
"icon",
"in",
"system",
"tray",
":",
"param",
"title",
":",
"Title",
"shown",
"in",
"balloon",
":",
"param",
"message",
":",
"Message",
"to",
"be",
"displayed",
":",
"param",
"filename",
":",
"Optional",
"icon",
"filename"... | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIWx/PySimpleGUIWx.py#L2863-L2879 | train | Shows a balloon above icon in system tray. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIWx/PySimpleGUIWx.py | SystemTray.Update | def Update(self, menu=None, tooltip=None,filename=None, data=None, data_base64=None,):
'''
Updates the menu, tooltip or icon
:param menu: menu defintion
:param tooltip: string representing tooltip
:param filename: icon filename
:param data: icon raw image
:param... | python | def Update(self, menu=None, tooltip=None,filename=None, data=None, data_base64=None,):
'''
Updates the menu, tooltip or icon
:param menu: menu defintion
:param tooltip: string representing tooltip
:param filename: icon filename
:param data: icon raw image
:param... | [
"def",
"Update",
"(",
"self",
",",
"menu",
"=",
"None",
",",
"tooltip",
"=",
"None",
",",
"filename",
"=",
"None",
",",
"data",
"=",
"None",
",",
"data_base64",
"=",
"None",
",",
")",
":",
"# Menu",
"if",
"menu",
"is",
"not",
"None",
":",
"self",
... | Updates the menu, tooltip or icon
:param menu: menu defintion
:param tooltip: string representing tooltip
:param filename: icon filename
:param data: icon raw image
:param data_base64: icon base 64 image
:return: | [
"Updates",
"the",
"menu",
"tooltip",
"or",
"icon",
":",
"param",
"menu",
":",
"menu",
"defintion",
":",
"param",
"tooltip",
":",
"string",
"representing",
"tooltip",
":",
"param",
"filename",
":",
"icon",
"filename",
":",
"param",
"data",
":",
"icon",
"raw... | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIWx/PySimpleGUIWx.py#L2894-L2915 | train | Updates the menu tooltip or icon | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIWx/PySimpleGUIWx.py | DragFrame.on_mouse | def on_mouse(self, event):
'''
implement dragging
'''
# print('on_mouse')
if not event.Dragging():
self._dragPos = None
return
# self.CaptureMouse()
if not self._dragPos:
self._dragPos = event.GetPosition()
else:
... | python | def on_mouse(self, event):
'''
implement dragging
'''
# print('on_mouse')
if not event.Dragging():
self._dragPos = None
return
# self.CaptureMouse()
if not self._dragPos:
self._dragPos = event.GetPosition()
else:
... | [
"def",
"on_mouse",
"(",
"self",
",",
"event",
")",
":",
"# print('on_mouse')",
"if",
"not",
"event",
".",
"Dragging",
"(",
")",
":",
"self",
".",
"_dragPos",
"=",
"None",
"return",
"# self.CaptureMouse()",
"if",
"not",
"self",
".",
"_dragPos",
":",
"self",... | implement dragging | [
"implement",
"dragging"
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIWx/PySimpleGUIWx.py#L2947-L2961 | train | implement dragging
implement dragging
implement dragging
implement dragging
implement dragging
implement dragging
implement dragging
implement dragging
implement dragging
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIWx/PySimpleGUIWx.py | Window.SetAlpha | def SetAlpha(self, alpha):
'''
Change the window's transparency
:param alpha: From 0 to 1 with 0 being completely transparent
:return:
'''
self._AlphaChannel = alpha * 255
if self._AlphaChannel is not None:
self.MasterFrame.SetTransparent(self._AlphaCh... | python | def SetAlpha(self, alpha):
'''
Change the window's transparency
:param alpha: From 0 to 1 with 0 being completely transparent
:return:
'''
self._AlphaChannel = alpha * 255
if self._AlphaChannel is not None:
self.MasterFrame.SetTransparent(self._AlphaCh... | [
"def",
"SetAlpha",
"(",
"self",
",",
"alpha",
")",
":",
"self",
".",
"_AlphaChannel",
"=",
"alpha",
"*",
"255",
"if",
"self",
".",
"_AlphaChannel",
"is",
"not",
"None",
":",
"self",
".",
"MasterFrame",
".",
"SetTransparent",
"(",
"self",
".",
"_AlphaChan... | Change the window's transparency
:param alpha: From 0 to 1 with 0 being completely transparent
:return: | [
"Change",
"the",
"window",
"s",
"transparency",
":",
"param",
"alpha",
":",
"From",
"0",
"to",
"1",
"with",
"0",
"being",
"completely",
"transparent",
":",
"return",
":"
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIWx/PySimpleGUIWx.py#L3460-L3468 | train | Change the window s transparency by a factor of 255. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | DemoPrograms/Demo_Multithreaded_Queued.py | worker_thread | def worker_thread(thread_name, run_freq, gui_queue):
"""
A worker thrread that communicates with the GUI
These threads can call functions that block withouth affecting the GUI (a good thing)
Note that this function is the code started as each thread. All threads are identical in this way
:param thr... | python | def worker_thread(thread_name, run_freq, gui_queue):
"""
A worker thrread that communicates with the GUI
These threads can call functions that block withouth affecting the GUI (a good thing)
Note that this function is the code started as each thread. All threads are identical in this way
:param thr... | [
"def",
"worker_thread",
"(",
"thread_name",
",",
"run_freq",
",",
"gui_queue",
")",
":",
"print",
"(",
"'Starting thread - {} that runds every {} ms'",
".",
"format",
"(",
"thread_name",
",",
"run_freq",
")",
")",
"for",
"i",
"in",
"itertools",
".",
"count",
"("... | A worker thrread that communicates with the GUI
These threads can call functions that block withouth affecting the GUI (a good thing)
Note that this function is the code started as each thread. All threads are identical in this way
:param thread_name: Text name used for displaying info
:param run_freq:... | [
"A",
"worker",
"thrread",
"that",
"communicates",
"with",
"the",
"GUI",
"These",
"threads",
"can",
"call",
"functions",
"that",
"block",
"withouth",
"affecting",
"the",
"GUI",
"(",
"a",
"good",
"thing",
")",
"Note",
"that",
"this",
"function",
"is",
"the",
... | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/DemoPrograms/Demo_Multithreaded_Queued.py#L44-L58 | train | A worker thread that communicates with the GUI | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | DemoPrograms/ping.py | send_one_ping | def send_one_ping(mySocket, destIP, myID, mySeqNumber, packet_size):
"""
Send one ping to the given >destIP<.
"""
#destIP = socket.gethostbyname(destIP)
# Header is type (8), code (8), checksum (16), id (16), sequence (16)
# (packet_size - 8) - Remove header size from packet size
myChecks... | python | def send_one_ping(mySocket, destIP, myID, mySeqNumber, packet_size):
"""
Send one ping to the given >destIP<.
"""
#destIP = socket.gethostbyname(destIP)
# Header is type (8), code (8), checksum (16), id (16), sequence (16)
# (packet_size - 8) - Remove header size from packet size
myChecks... | [
"def",
"send_one_ping",
"(",
"mySocket",
",",
"destIP",
",",
"myID",
",",
"mySeqNumber",
",",
"packet_size",
")",
":",
"#destIP = socket.gethostbyname(destIP)",
"# Header is type (8), code (8), checksum (16), id (16), sequence (16)",
"# (packet_size - 8) - Remove header size from p... | Send one ping to the given >destIP<. | [
"Send",
"one",
"ping",
"to",
"the",
"given",
">",
"destIP<",
"."
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/DemoPrograms/ping.py#L337-L387 | train | Send one ping to the given destination IP. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | DemoPrograms/ping.py | receive_one_ping | def receive_one_ping(mySocket, myID, timeout):
"""
Receive the ping from the socket. Timeout = in ms
"""
timeLeft = timeout/1000
while True: # Loop while waiting for packet or timeout
startedSelect = default_timer()
whatReady = select.select([mySocket], [], [], timeLeft)
how... | python | def receive_one_ping(mySocket, myID, timeout):
"""
Receive the ping from the socket. Timeout = in ms
"""
timeLeft = timeout/1000
while True: # Loop while waiting for packet or timeout
startedSelect = default_timer()
whatReady = select.select([mySocket], [], [], timeLeft)
how... | [
"def",
"receive_one_ping",
"(",
"mySocket",
",",
"myID",
",",
"timeout",
")",
":",
"timeLeft",
"=",
"timeout",
"/",
"1000",
"while",
"True",
":",
"# Loop while waiting for packet or timeout",
"startedSelect",
"=",
"default_timer",
"(",
")",
"whatReady",
"=",
"sele... | Receive the ping from the socket. Timeout = in ms | [
"Receive",
"the",
"ping",
"from",
"the",
"socket",
".",
"Timeout",
"=",
"in",
"ms"
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/DemoPrograms/ping.py#L390-L427 | train | Receive one ping from the socket. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | DemoPrograms/Demo_Script_Launcher_Realtime_Output.py | runCommand | def runCommand(cmd, timeout=None, window=None):
""" run shell command
@param cmd: command to execute
@param timeout: timeout for command execution
@param window: the PySimpleGUI window that the output is going to (needed to do refresh on)
@return: (return code from command, command output)
"""
p = subproce... | python | def runCommand(cmd, timeout=None, window=None):
""" run shell command
@param cmd: command to execute
@param timeout: timeout for command execution
@param window: the PySimpleGUI window that the output is going to (needed to do refresh on)
@return: (return code from command, command output)
"""
p = subproce... | [
"def",
"runCommand",
"(",
"cmd",
",",
"timeout",
"=",
"None",
",",
"window",
"=",
"None",
")",
":",
"p",
"=",
"subprocess",
".",
"Popen",
"(",
"cmd",
",",
"shell",
"=",
"True",
",",
"stdout",
"=",
"subprocess",
".",
"PIPE",
",",
"stderr",
"=",
"sub... | run shell command
@param cmd: command to execute
@param timeout: timeout for command execution
@param window: the PySimpleGUI window that the output is going to (needed to do refresh on)
@return: (return code from command, command output) | [
"run",
"shell",
"command"
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/DemoPrograms/Demo_Script_Launcher_Realtime_Output.py#L29-L45 | train | run shell command
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIWeb/PySimpleGUIWeb.py | font_parse_string | def font_parse_string(font):
"""
Convert from font string/tyuple into a Qt style sheet string
:param font: "Arial 10 Bold" or ('Arial', 10, 'Bold)
:return: style string that can be combined with other style strings
"""
if font is None:
return ''
if type(font) is str:
_font ... | python | def font_parse_string(font):
"""
Convert from font string/tyuple into a Qt style sheet string
:param font: "Arial 10 Bold" or ('Arial', 10, 'Bold)
:return: style string that can be combined with other style strings
"""
if font is None:
return ''
if type(font) is str:
_font ... | [
"def",
"font_parse_string",
"(",
"font",
")",
":",
"if",
"font",
"is",
"None",
":",
"return",
"''",
"if",
"type",
"(",
"font",
")",
"is",
"str",
":",
"_font",
"=",
"font",
".",
"split",
"(",
"' '",
")",
"else",
":",
"_font",
"=",
"font",
"family",
... | Convert from font string/tyuple into a Qt style sheet string
:param font: "Arial 10 Bold" or ('Arial', 10, 'Bold)
:return: style string that can be combined with other style strings | [
"Convert",
"from",
"font",
"string",
"/",
"tyuple",
"into",
"a",
"Qt",
"style",
"sheet",
"string",
":",
"param",
"font",
":",
"Arial",
"10",
"Bold",
"or",
"(",
"Arial",
"10",
"Bold",
")",
":",
"return",
":",
"style",
"string",
"that",
"can",
"be",
"c... | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIWeb/PySimpleGUIWeb.py#L3449-L3471 | train | Convert from font string to Qt style sheet string | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIWeb/PySimpleGUIWeb.py | _ProgressMeter | def _ProgressMeter(title, max_value, *args, orientation=None, bar_color=(None, None), button_color=None,
size=DEFAULT_PROGRESS_BAR_SIZE, border_width=None, grab_anywhere=False):
'''
Create and show a form on tbe caller's behalf.
:param title:
:param max_value:
:param args: ANY num... | python | def _ProgressMeter(title, max_value, *args, orientation=None, bar_color=(None, None), button_color=None,
size=DEFAULT_PROGRESS_BAR_SIZE, border_width=None, grab_anywhere=False):
'''
Create and show a form on tbe caller's behalf.
:param title:
:param max_value:
:param args: ANY num... | [
"def",
"_ProgressMeter",
"(",
"title",
",",
"max_value",
",",
"*",
"args",
",",
"orientation",
"=",
"None",
",",
"bar_color",
"=",
"(",
"None",
",",
"None",
")",
",",
"button_color",
"=",
"None",
",",
"size",
"=",
"DEFAULT_PROGRESS_BAR_SIZE",
",",
"border_... | Create and show a form on tbe caller's behalf.
:param title:
:param max_value:
:param args: ANY number of arguments the caller wants to display
:param orientation:
:param bar_color:
:param size:
:param Style:
:param StyleOffset:
:return: ProgressBar object that is in the form | [
"Create",
"and",
"show",
"a",
"form",
"on",
"tbe",
"caller",
"s",
"behalf",
".",
":",
"param",
"title",
":",
":",
"param",
"max_value",
":",
":",
"param",
"args",
":",
"ANY",
"number",
"of",
"arguments",
"the",
"caller",
"wants",
"to",
"display",
":",
... | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIWeb/PySimpleGUIWeb.py#L5237-L5279 | train | Create and show a progress meter on the tbe caller s behalf. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIWeb/PySimpleGUIWeb.py | _ProgressMeterUpdate | def _ProgressMeterUpdate(bar, value, text_elem, *args):
'''
Update the progress meter for a form
:param form: class ProgressBar
:param value: int
:return: True if not cancelled, OK....False if Error
'''
global _my_windows
if bar == None: return False
if bar.BarExpired: return False
... | python | def _ProgressMeterUpdate(bar, value, text_elem, *args):
'''
Update the progress meter for a form
:param form: class ProgressBar
:param value: int
:return: True if not cancelled, OK....False if Error
'''
global _my_windows
if bar == None: return False
if bar.BarExpired: return False
... | [
"def",
"_ProgressMeterUpdate",
"(",
"bar",
",",
"value",
",",
"text_elem",
",",
"*",
"args",
")",
":",
"global",
"_my_windows",
"if",
"bar",
"==",
"None",
":",
"return",
"False",
"if",
"bar",
".",
"BarExpired",
":",
"return",
"False",
"message",
",",
"w"... | Update the progress meter for a form
:param form: class ProgressBar
:param value: int
:return: True if not cancelled, OK....False if Error | [
"Update",
"the",
"progress",
"meter",
"for",
"a",
"form",
":",
"param",
"form",
":",
"class",
"ProgressBar",
":",
"param",
"value",
":",
"int",
":",
"return",
":",
"True",
"if",
"not",
"cancelled",
"OK",
"....",
"False",
"if",
"Error"
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIWeb/PySimpleGUIWeb.py#L5283-L5320 | train | Update the progress meter for a form
. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIWeb/PySimpleGUIWeb.py | EasyProgressMeter | def EasyProgressMeter(title, current_value, max_value, *args, orientation=None, bar_color=(None, None),
button_color=None, size=DEFAULT_PROGRESS_BAR_SIZE, border_width=None):
'''
A ONE-LINE progress meter. Add to your code where ever you need a meter. No need for a second
function call... | python | def EasyProgressMeter(title, current_value, max_value, *args, orientation=None, bar_color=(None, None),
button_color=None, size=DEFAULT_PROGRESS_BAR_SIZE, border_width=None):
'''
A ONE-LINE progress meter. Add to your code where ever you need a meter. No need for a second
function call... | [
"def",
"EasyProgressMeter",
"(",
"title",
",",
"current_value",
",",
"max_value",
",",
"*",
"args",
",",
"orientation",
"=",
"None",
",",
"bar_color",
"=",
"(",
"None",
",",
"None",
")",
",",
"button_color",
"=",
"None",
",",
"size",
"=",
"DEFAULT_PROGRESS... | A ONE-LINE progress meter. Add to your code where ever you need a meter. No need for a second
function call before your loop. You've got enough code to write!
:param title: Title will be shown on the window
:param current_value: Current count of your items
:param max_value: Max value your count will eve... | [
"A",
"ONE",
"-",
"LINE",
"progress",
"meter",
".",
"Add",
"to",
"your",
"code",
"where",
"ever",
"you",
"need",
"a",
"meter",
".",
"No",
"need",
"for",
"a",
"second",
"function",
"call",
"before",
"your",
"loop",
".",
"You",
"ve",
"got",
"enough",
"c... | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIWeb/PySimpleGUIWeb.py#L5367-L5432 | train | This function is used to create a new one - line progress meter. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIWeb/PySimpleGUIWeb.py | PopupNonBlocking | def PopupNonBlocking(*args, button_type=POPUP_BUTTONS_OK, button_color=None, background_color=None, text_color=None,
auto_close=False, auto_close_duration=None, non_blocking=True, icon=DEFAULT_WINDOW_ICON,
line_width=None, font=None, no_titlebar=False, grab_anywhere=False, keep... | python | def PopupNonBlocking(*args, button_type=POPUP_BUTTONS_OK, button_color=None, background_color=None, text_color=None,
auto_close=False, auto_close_duration=None, non_blocking=True, icon=DEFAULT_WINDOW_ICON,
line_width=None, font=None, no_titlebar=False, grab_anywhere=False, keep... | [
"def",
"PopupNonBlocking",
"(",
"*",
"args",
",",
"button_type",
"=",
"POPUP_BUTTONS_OK",
",",
"button_color",
"=",
"None",
",",
"background_color",
"=",
"None",
",",
"text_color",
"=",
"None",
",",
"auto_close",
"=",
"False",
",",
"auto_close_duration",
"=",
... | Show Popup box and immediately return (does not block)
:param args:
:param button_type:
:param button_color:
:param background_color:
:param text_color:
:param auto_close:
:param auto_close_duration:
:param non_blocking:
:param icon:
:param line_width:
:param font:
:param... | [
"Show",
"Popup",
"box",
"and",
"immediately",
"return",
"(",
"does",
"not",
"block",
")",
":",
"param",
"args",
":",
":",
"param",
"button_type",
":",
":",
"param",
"button_color",
":",
":",
"param",
"background_color",
":",
":",
"param",
"text_color",
":"... | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIWeb/PySimpleGUIWeb.py#L6286-L6313 | train | Show Popup box and immediately return. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIWeb/PySimpleGUIWeb.py | PopupGetFolder | def PopupGetFolder(message, default_path='', no_window=False, size=(None, None), button_color=None,
background_color=None, text_color=None, icon=DEFAULT_WINDOW_ICON, font=None, no_titlebar=False,
grab_anywhere=False, keep_on_top=False, location=(None, None), initial_folder=None):
... | python | def PopupGetFolder(message, default_path='', no_window=False, size=(None, None), button_color=None,
background_color=None, text_color=None, icon=DEFAULT_WINDOW_ICON, font=None, no_titlebar=False,
grab_anywhere=False, keep_on_top=False, location=(None, None), initial_folder=None):
... | [
"def",
"PopupGetFolder",
"(",
"message",
",",
"default_path",
"=",
"''",
",",
"no_window",
"=",
"False",
",",
"size",
"=",
"(",
"None",
",",
"None",
")",
",",
"button_color",
"=",
"None",
",",
"background_color",
"=",
"None",
",",
"text_color",
"=",
"Non... | Display popup with text entry field and browse button. Browse for folder
:param message:
:param default_path:
:param no_window:
:param size:
:param button_color:
:param background_color:
:param text_color:
:param icon:
:param font:
:param no_titlebar:
:param grab_anywhere:
... | [
"Display",
"popup",
"with",
"text",
"entry",
"field",
"and",
"browse",
"button",
".",
"Browse",
"for",
"folder",
":",
"param",
"message",
":",
":",
"param",
"default_path",
":",
":",
"param",
"no_window",
":",
":",
"param",
"size",
":",
":",
"param",
"bu... | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIWeb/PySimpleGUIWeb.py#L6596-L6647 | train | Displays a popup with text entry field and browse button. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | PySimpleGUIWeb/PySimpleGUIWeb.py | PopupGetFile | def PopupGetFile(message, default_path='', default_extension='', save_as=False, file_types=(("ALL Files", "*.*"),),
no_window=False, size=(None, None), button_color=None, background_color=None, text_color=None,
icon=DEFAULT_WINDOW_ICON, font=None, no_titlebar=False, grab_anywhere=False... | python | def PopupGetFile(message, default_path='', default_extension='', save_as=False, file_types=(("ALL Files", "*.*"),),
no_window=False, size=(None, None), button_color=None, background_color=None, text_color=None,
icon=DEFAULT_WINDOW_ICON, font=None, no_titlebar=False, grab_anywhere=False... | [
"def",
"PopupGetFile",
"(",
"message",
",",
"default_path",
"=",
"''",
",",
"default_extension",
"=",
"''",
",",
"save_as",
"=",
"False",
",",
"file_types",
"=",
"(",
"(",
"\"ALL Files\"",
",",
"\"*.*\"",
")",
",",
")",
",",
"no_window",
"=",
"False",
",... | Display popup with text entry field and browse button. Browse for file
:param message:
:param default_path:
:param default_extension:
:param save_as:
:param file_types:
:param no_window:
:param size:
:param button_color:
:param background_color:
:param text_color:
:param icon... | [
"Display",
"popup",
"with",
"text",
"entry",
"field",
"and",
"browse",
"button",
".",
"Browse",
"for",
"file",
":",
"param",
"message",
":",
":",
"param",
"default_path",
":",
":",
"param",
"default_extension",
":",
":",
"param",
"save_as",
":",
":",
"para... | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/PySimpleGUIWeb/PySimpleGUIWeb.py#L6652-L6714 | train | Displays a popup with text entry field and browse button. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | DemoPrograms/Demo_Table_Simulation.py | TableSimulation | def TableSimulation():
"""
Display data in a table format
"""
sg.SetOptions(element_padding=(0,0))
menu_def = [['File', ['Open', 'Save', 'Exit']],
['Edit', ['Paste', ['Special', 'Normal',], 'Undo'],],
['Help', 'About...'],]
columm_layout = [[]]
MAX_ROWS = 2... | python | def TableSimulation():
"""
Display data in a table format
"""
sg.SetOptions(element_padding=(0,0))
menu_def = [['File', ['Open', 'Save', 'Exit']],
['Edit', ['Paste', ['Special', 'Normal',], 'Undo'],],
['Help', 'About...'],]
columm_layout = [[]]
MAX_ROWS = 2... | [
"def",
"TableSimulation",
"(",
")",
":",
"sg",
".",
"SetOptions",
"(",
"element_padding",
"=",
"(",
"0",
",",
"0",
")",
")",
"menu_def",
"=",
"[",
"[",
"'File'",
",",
"[",
"'Open'",
",",
"'Save'",
",",
"'Exit'",
"]",
"]",
",",
"[",
"'Edit'",
",",
... | Display data in a table format | [
"Display",
"data",
"in",
"a",
"table",
"format"
] | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/DemoPrograms/Demo_Table_Simulation.py#L10-L78 | train | A simple simulation of the table. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | HowDoI/PySimpleGUI-HowDoI.py | HowDoI | def HowDoI():
'''
Make and show a window (PySimpleGUI form) that takes user input and sends to the HowDoI web oracle
Excellent example of 2 GUI concepts
1. Output Element that will show text in a scrolled window
2. Non-Window-Closing Buttons - These buttons will cause the form to return with... | python | def HowDoI():
'''
Make and show a window (PySimpleGUI form) that takes user input and sends to the HowDoI web oracle
Excellent example of 2 GUI concepts
1. Output Element that will show text in a scrolled window
2. Non-Window-Closing Buttons - These buttons will cause the form to return with... | [
"def",
"HowDoI",
"(",
")",
":",
"# ------- Make a new Window ------- #",
"sg",
".",
"ChangeLookAndFeel",
"(",
"'GreenTan'",
")",
"# give our form a spiffy set of colors",
"layout",
"=",
"[",
"[",
"sg",
".",
"Text",
"(",
"'Ask and your answer will appear here....'",
",",... | Make and show a window (PySimpleGUI form) that takes user input and sends to the HowDoI web oracle
Excellent example of 2 GUI concepts
1. Output Element that will show text in a scrolled window
2. Non-Window-Closing Buttons - These buttons will cause the form to return with the form's values, but do... | [
"Make",
"and",
"show",
"a",
"window",
"(",
"PySimpleGUI",
"form",
")",
"that",
"takes",
"user",
"input",
"and",
"sends",
"to",
"the",
"HowDoI",
"web",
"oracle",
"Excellent",
"example",
"of",
"2",
"GUI",
"concepts",
"1",
".",
"Output",
"Element",
"that",
... | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/HowDoI/PySimpleGUI-HowDoI.py#L16-L69 | train | A function that returns a window that takes user input and sends to the HowDoI web oracle
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
PySimpleGUI/PySimpleGUI | HowDoI/PySimpleGUI-HowDoI.py | QueryHowDoI | def QueryHowDoI(Query, num_answers, full_text):
'''
Kicks off a subprocess to send the 'Query' to HowDoI
Prints the result, which in this program will route to a gooeyGUI window
:param Query: text english question to ask the HowDoI web engine
:return: nothing
'''
howdoi_command = HOW_DO_I_CO... | python | def QueryHowDoI(Query, num_answers, full_text):
'''
Kicks off a subprocess to send the 'Query' to HowDoI
Prints the result, which in this program will route to a gooeyGUI window
:param Query: text english question to ask the HowDoI web engine
:return: nothing
'''
howdoi_command = HOW_DO_I_CO... | [
"def",
"QueryHowDoI",
"(",
"Query",
",",
"num_answers",
",",
"full_text",
")",
":",
"howdoi_command",
"=",
"HOW_DO_I_COMMAND",
"full_text_option",
"=",
"' -a'",
"if",
"full_text",
"else",
"''",
"t",
"=",
"subprocess",
".",
"Popen",
"(",
"howdoi_command",
"+",
... | Kicks off a subprocess to send the 'Query' to HowDoI
Prints the result, which in this program will route to a gooeyGUI window
:param Query: text english question to ask the HowDoI web engine
:return: nothing | [
"Kicks",
"off",
"a",
"subprocess",
"to",
"send",
"the",
"Query",
"to",
"HowDoI",
"Prints",
"the",
"result",
"which",
"in",
"this",
"program",
"will",
"route",
"to",
"a",
"gooeyGUI",
"window",
":",
"param",
"Query",
":",
"text",
"english",
"question",
"to",... | 08184197f5bd4580ab5e5aca28bdda30f87b86fc | https://github.com/PySimpleGUI/PySimpleGUI/blob/08184197f5bd4580ab5e5aca28bdda30f87b86fc/HowDoI/PySimpleGUI-HowDoI.py#L72-L86 | train | Queries the HowDoI web engine and returns the result | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | tensorflow_hub/module_spec.py | ModuleSpec.export | def export(self, path, _sentinel=None, # pylint: disable=invalid-name
checkpoint_path=None, name_transform_fn=None):
"""Exports a ModuleSpec with weights taken from a checkpoint.
This is an helper to export modules directly from a ModuleSpec
without having to create a session and set the vari... | python | def export(self, path, _sentinel=None, # pylint: disable=invalid-name
checkpoint_path=None, name_transform_fn=None):
"""Exports a ModuleSpec with weights taken from a checkpoint.
This is an helper to export modules directly from a ModuleSpec
without having to create a session and set the vari... | [
"def",
"export",
"(",
"self",
",",
"path",
",",
"_sentinel",
"=",
"None",
",",
"# pylint: disable=invalid-name",
"checkpoint_path",
"=",
"None",
",",
"name_transform_fn",
"=",
"None",
")",
":",
"from",
"tensorflow_hub",
".",
"module",
"import",
"export_module_spec... | Exports a ModuleSpec with weights taken from a checkpoint.
This is an helper to export modules directly from a ModuleSpec
without having to create a session and set the variables to the
intended values.
Example usage:
```python
spec = hub.create_module_spec(module_fn)
spec.export("/path/t... | [
"Exports",
"a",
"ModuleSpec",
"with",
"weights",
"taken",
"from",
"a",
"checkpoint",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/tensorflow_hub/module_spec.py#L41-L77 | train | Exports a module spec with weights taken from a checkpoint. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | tensorflow_hub/module_spec.py | ModuleSpec.get_attached_message | def get_attached_message(self, key, message_type, tags=None, required=False):
"""Returns the message attached to the module under the given key, or None.
Module publishers can attach protocol messages to modules at creation time
to provide module consumers with additional information, e.g., on module
u... | python | def get_attached_message(self, key, message_type, tags=None, required=False):
"""Returns the message attached to the module under the given key, or None.
Module publishers can attach protocol messages to modules at creation time
to provide module consumers with additional information, e.g., on module
u... | [
"def",
"get_attached_message",
"(",
"self",
",",
"key",
",",
"message_type",
",",
"tags",
"=",
"None",
",",
"required",
"=",
"False",
")",
":",
"attached_bytes",
"=",
"self",
".",
"_get_attached_bytes",
"(",
"key",
",",
"tags",
")",
"if",
"attached_bytes",
... | Returns the message attached to the module under the given key, or None.
Module publishers can attach protocol messages to modules at creation time
to provide module consumers with additional information, e.g., on module
usage or provenance (see see hub.attach_message()). A typical use would be
to stor... | [
"Returns",
"the",
"message",
"attached",
"to",
"the",
"module",
"under",
"the",
"given",
"key",
"or",
"None",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/tensorflow_hub/module_spec.py#L129-L169 | train | Returns the message contents attached to the given key. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | examples/image_retraining/retrain.py | create_image_lists | def create_image_lists(image_dir, testing_percentage, validation_percentage):
"""Builds a list of training images from the file system.
Analyzes the sub folders in the image directory, splits them into stable
training, testing, and validation sets, and returns a data structure
describing the lists of images fo... | python | def create_image_lists(image_dir, testing_percentage, validation_percentage):
"""Builds a list of training images from the file system.
Analyzes the sub folders in the image directory, splits them into stable
training, testing, and validation sets, and returns a data structure
describing the lists of images fo... | [
"def",
"create_image_lists",
"(",
"image_dir",
",",
"testing_percentage",
",",
"validation_percentage",
")",
":",
"if",
"not",
"tf",
".",
"gfile",
".",
"Exists",
"(",
"image_dir",
")",
":",
"tf",
".",
"logging",
".",
"error",
"(",
"\"Image directory '\"",
"+",... | Builds a list of training images from the file system.
Analyzes the sub folders in the image directory, splits them into stable
training, testing, and validation sets, and returns a data structure
describing the lists of images for each label and their paths.
Args:
image_dir: String path to a folder conta... | [
"Builds",
"a",
"list",
"of",
"training",
"images",
"from",
"the",
"file",
"system",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/examples/image_retraining/retrain.py#L147-L234 | train | Builds a list of training images from the file system. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | examples/image_retraining/retrain.py | get_image_path | def get_image_path(image_lists, label_name, index, image_dir, category):
"""Returns a path to an image for a label at the given index.
Args:
image_lists: OrderedDict of training images for each label.
label_name: Label string we want to get an image for.
index: Int offset of the image we want. This wil... | python | def get_image_path(image_lists, label_name, index, image_dir, category):
"""Returns a path to an image for a label at the given index.
Args:
image_lists: OrderedDict of training images for each label.
label_name: Label string we want to get an image for.
index: Int offset of the image we want. This wil... | [
"def",
"get_image_path",
"(",
"image_lists",
",",
"label_name",
",",
"index",
",",
"image_dir",
",",
"category",
")",
":",
"if",
"label_name",
"not",
"in",
"image_lists",
":",
"tf",
".",
"logging",
".",
"fatal",
"(",
"'Label does not exist %s.'",
",",
"label_n... | Returns a path to an image for a label at the given index.
Args:
image_lists: OrderedDict of training images for each label.
label_name: Label string we want to get an image for.
index: Int offset of the image we want. This will be moduloed by the
available number of images for the label, so it can b... | [
"Returns",
"a",
"path",
"to",
"an",
"image",
"for",
"a",
"label",
"at",
"the",
"given",
"index",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/examples/image_retraining/retrain.py#L237-L267 | train | Returns a path to an image for a given label at the given index. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | examples/image_retraining/retrain.py | get_bottleneck_path | def get_bottleneck_path(image_lists, label_name, index, bottleneck_dir,
category, module_name):
"""Returns a path to a bottleneck file for a label at the given index.
Args:
image_lists: OrderedDict of training images for each label.
label_name: Label string we want to get an image f... | python | def get_bottleneck_path(image_lists, label_name, index, bottleneck_dir,
category, module_name):
"""Returns a path to a bottleneck file for a label at the given index.
Args:
image_lists: OrderedDict of training images for each label.
label_name: Label string we want to get an image f... | [
"def",
"get_bottleneck_path",
"(",
"image_lists",
",",
"label_name",
",",
"index",
",",
"bottleneck_dir",
",",
"category",
",",
"module_name",
")",
":",
"module_name",
"=",
"(",
"module_name",
".",
"replace",
"(",
"'://'",
",",
"'~'",
")",
"# URL scheme.",
"."... | Returns a path to a bottleneck file for a label at the given index.
Args:
image_lists: OrderedDict of training images for each label.
label_name: Label string we want to get an image for.
index: Integer offset of the image we want. This will be moduloed by the
available number of images for the label... | [
"Returns",
"a",
"path",
"to",
"a",
"bottleneck",
"file",
"for",
"a",
"label",
"at",
"the",
"given",
"index",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/examples/image_retraining/retrain.py#L270-L291 | train | Returns a path to a bottleneck file for a given label. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | examples/image_retraining/retrain.py | create_module_graph | def create_module_graph(module_spec):
"""Creates a graph and loads Hub Module into it.
Args:
module_spec: the hub.ModuleSpec for the image module being used.
Returns:
graph: the tf.Graph that was created.
bottleneck_tensor: the bottleneck values output by the module.
resized_input_tensor: the in... | python | def create_module_graph(module_spec):
"""Creates a graph and loads Hub Module into it.
Args:
module_spec: the hub.ModuleSpec for the image module being used.
Returns:
graph: the tf.Graph that was created.
bottleneck_tensor: the bottleneck values output by the module.
resized_input_tensor: the in... | [
"def",
"create_module_graph",
"(",
"module_spec",
")",
":",
"height",
",",
"width",
"=",
"hub",
".",
"get_expected_image_size",
"(",
"module_spec",
")",
"with",
"tf",
".",
"Graph",
"(",
")",
".",
"as_default",
"(",
")",
"as",
"graph",
":",
"resized_input_ten... | Creates a graph and loads Hub Module into it.
Args:
module_spec: the hub.ModuleSpec for the image module being used.
Returns:
graph: the tf.Graph that was created.
bottleneck_tensor: the bottleneck values output by the module.
resized_input_tensor: the input images, resized as expected by the modu... | [
"Creates",
"a",
"graph",
"and",
"loads",
"Hub",
"Module",
"into",
"it",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/examples/image_retraining/retrain.py#L294-L314 | train | Creates a graph and loads Hub Module into it. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | examples/image_retraining/retrain.py | run_bottleneck_on_image | def run_bottleneck_on_image(sess, image_data, image_data_tensor,
decoded_image_tensor, resized_input_tensor,
bottleneck_tensor):
"""Runs inference on an image to extract the 'bottleneck' summary layer.
Args:
sess: Current active TensorFlow Session.
im... | python | def run_bottleneck_on_image(sess, image_data, image_data_tensor,
decoded_image_tensor, resized_input_tensor,
bottleneck_tensor):
"""Runs inference on an image to extract the 'bottleneck' summary layer.
Args:
sess: Current active TensorFlow Session.
im... | [
"def",
"run_bottleneck_on_image",
"(",
"sess",
",",
"image_data",
",",
"image_data_tensor",
",",
"decoded_image_tensor",
",",
"resized_input_tensor",
",",
"bottleneck_tensor",
")",
":",
"# First decode the JPEG image, resize it, and rescale the pixel values.",
"resized_input_values... | Runs inference on an image to extract the 'bottleneck' summary layer.
Args:
sess: Current active TensorFlow Session.
image_data: String of raw JPEG data.
image_data_tensor: Input data layer in the graph.
decoded_image_tensor: Output of initial image resizing and preprocessing.
resized_input_tenso... | [
"Runs",
"inference",
"on",
"an",
"image",
"to",
"extract",
"the",
"bottleneck",
"summary",
"layer",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/examples/image_retraining/retrain.py#L317-L340 | train | Runs inference on an image to extract the bottleneck summary layer. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | examples/image_retraining/retrain.py | create_bottleneck_file | def create_bottleneck_file(bottleneck_path, image_lists, label_name, index,
image_dir, category, sess, jpeg_data_tensor,
decoded_image_tensor, resized_input_tensor,
bottleneck_tensor):
"""Create a single bottleneck file."""
tf.logging.... | python | def create_bottleneck_file(bottleneck_path, image_lists, label_name, index,
image_dir, category, sess, jpeg_data_tensor,
decoded_image_tensor, resized_input_tensor,
bottleneck_tensor):
"""Create a single bottleneck file."""
tf.logging.... | [
"def",
"create_bottleneck_file",
"(",
"bottleneck_path",
",",
"image_lists",
",",
"label_name",
",",
"index",
",",
"image_dir",
",",
"category",
",",
"sess",
",",
"jpeg_data_tensor",
",",
"decoded_image_tensor",
",",
"resized_input_tensor",
",",
"bottleneck_tensor",
"... | Create a single bottleneck file. | [
"Create",
"a",
"single",
"bottleneck",
"file",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/examples/image_retraining/retrain.py#L353-L373 | train | Create a single bottleneck file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | examples/image_retraining/retrain.py | get_or_create_bottleneck | def get_or_create_bottleneck(sess, image_lists, label_name, index, image_dir,
category, bottleneck_dir, jpeg_data_tensor,
decoded_image_tensor, resized_input_tensor,
bottleneck_tensor, module_name):
"""Retrieves or calculates bottl... | python | def get_or_create_bottleneck(sess, image_lists, label_name, index, image_dir,
category, bottleneck_dir, jpeg_data_tensor,
decoded_image_tensor, resized_input_tensor,
bottleneck_tensor, module_name):
"""Retrieves or calculates bottl... | [
"def",
"get_or_create_bottleneck",
"(",
"sess",
",",
"image_lists",
",",
"label_name",
",",
"index",
",",
"image_dir",
",",
"category",
",",
"bottleneck_dir",
",",
"jpeg_data_tensor",
",",
"decoded_image_tensor",
",",
"resized_input_tensor",
",",
"bottleneck_tensor",
... | Retrieves or calculates bottleneck values for an image.
If a cached version of the bottleneck data exists on-disk, return that,
otherwise calculate the data and save it to disk for future use.
Args:
sess: The current active TensorFlow Session.
image_lists: OrderedDict of training images for each label.
... | [
"Retrieves",
"or",
"calculates",
"bottleneck",
"values",
"for",
"an",
"image",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/examples/image_retraining/retrain.py#L376-L434 | train | Retrieves or creates a bottleneck file for an image. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | examples/image_retraining/retrain.py | cache_bottlenecks | def cache_bottlenecks(sess, image_lists, image_dir, bottleneck_dir,
jpeg_data_tensor, decoded_image_tensor,
resized_input_tensor, bottleneck_tensor, module_name):
"""Ensures all the training, testing, and validation bottlenecks are cached.
Because we're likely to read th... | python | def cache_bottlenecks(sess, image_lists, image_dir, bottleneck_dir,
jpeg_data_tensor, decoded_image_tensor,
resized_input_tensor, bottleneck_tensor, module_name):
"""Ensures all the training, testing, and validation bottlenecks are cached.
Because we're likely to read th... | [
"def",
"cache_bottlenecks",
"(",
"sess",
",",
"image_lists",
",",
"image_dir",
",",
"bottleneck_dir",
",",
"jpeg_data_tensor",
",",
"decoded_image_tensor",
",",
"resized_input_tensor",
",",
"bottleneck_tensor",
",",
"module_name",
")",
":",
"how_many_bottlenecks",
"=",
... | Ensures all the training, testing, and validation bottlenecks are cached.
Because we're likely to read the same image multiple times (if there are no
distortions applied during training) it can speed things up a lot if we
calculate the bottleneck layer values once for each image during
preprocessing, and then ... | [
"Ensures",
"all",
"the",
"training",
"testing",
"and",
"validation",
"bottlenecks",
"are",
"cached",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/examples/image_retraining/retrain.py#L437-L478 | train | This function is used to cache bottlenecks for training testing and validation. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | examples/image_retraining/retrain.py | get_random_cached_bottlenecks | def get_random_cached_bottlenecks(sess, image_lists, how_many, category,
bottleneck_dir, image_dir, jpeg_data_tensor,
decoded_image_tensor, resized_input_tensor,
bottleneck_tensor, module_name):
"""Retrieves bottlene... | python | def get_random_cached_bottlenecks(sess, image_lists, how_many, category,
bottleneck_dir, image_dir, jpeg_data_tensor,
decoded_image_tensor, resized_input_tensor,
bottleneck_tensor, module_name):
"""Retrieves bottlene... | [
"def",
"get_random_cached_bottlenecks",
"(",
"sess",
",",
"image_lists",
",",
"how_many",
",",
"category",
",",
"bottleneck_dir",
",",
"image_dir",
",",
"jpeg_data_tensor",
",",
"decoded_image_tensor",
",",
"resized_input_tensor",
",",
"bottleneck_tensor",
",",
"module_... | Retrieves bottleneck values for cached images.
If no distortions are being applied, this function can retrieve the cached
bottleneck values directly from disk for images. It picks a random set of
images from the specified category.
Args:
sess: Current TensorFlow Session.
image_lists: OrderedDict of tr... | [
"Retrieves",
"bottleneck",
"values",
"for",
"cached",
"images",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/examples/image_retraining/retrain.py#L481-L544 | train | This function returns bottlenecks for the given images. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | examples/image_retraining/retrain.py | get_random_distorted_bottlenecks | def get_random_distorted_bottlenecks(
sess, image_lists, how_many, category, image_dir, input_jpeg_tensor,
distorted_image, resized_input_tensor, bottleneck_tensor):
"""Retrieves bottleneck values for training images, after distortions.
If we're training with distortions like crops, scales, or flips, we ha... | python | def get_random_distorted_bottlenecks(
sess, image_lists, how_many, category, image_dir, input_jpeg_tensor,
distorted_image, resized_input_tensor, bottleneck_tensor):
"""Retrieves bottleneck values for training images, after distortions.
If we're training with distortions like crops, scales, or flips, we ha... | [
"def",
"get_random_distorted_bottlenecks",
"(",
"sess",
",",
"image_lists",
",",
"how_many",
",",
"category",
",",
"image_dir",
",",
"input_jpeg_tensor",
",",
"distorted_image",
",",
"resized_input_tensor",
",",
"bottleneck_tensor",
")",
":",
"class_count",
"=",
"len"... | Retrieves bottleneck values for training images, after distortions.
If we're training with distortions like crops, scales, or flips, we have to
recalculate the full model for every image, and so we can't use cached
bottleneck values. Instead we find random images for the requested category,
run them through th... | [
"Retrieves",
"bottleneck",
"values",
"for",
"training",
"images",
"after",
"distortions",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/examples/image_retraining/retrain.py#L547-L596 | train | This function returns bottleneck values for training images after distortions. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | examples/image_retraining/retrain.py | add_input_distortions | def add_input_distortions(flip_left_right, random_crop, random_scale,
random_brightness, module_spec):
"""Creates the operations to apply the specified distortions.
During training it can help to improve the results if we run the images
through simple distortions like crops, scales, and... | python | def add_input_distortions(flip_left_right, random_crop, random_scale,
random_brightness, module_spec):
"""Creates the operations to apply the specified distortions.
During training it can help to improve the results if we run the images
through simple distortions like crops, scales, and... | [
"def",
"add_input_distortions",
"(",
"flip_left_right",
",",
"random_crop",
",",
"random_scale",
",",
"random_brightness",
",",
"module_spec",
")",
":",
"input_height",
",",
"input_width",
"=",
"hub",
".",
"get_expected_image_size",
"(",
"module_spec",
")",
"input_dep... | Creates the operations to apply the specified distortions.
During training it can help to improve the results if we run the images
through simple distortions like crops, scales, and flips. These reflect the
kind of variations we expect in the real world, and so can help train the
model to cope with natural dat... | [
"Creates",
"the",
"operations",
"to",
"apply",
"the",
"specified",
"distortions",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/examples/image_retraining/retrain.py#L617-L706 | train | This function creates the operations to apply the input distortions to the full availabe. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | examples/image_retraining/retrain.py | variable_summaries | def variable_summaries(var):
"""Attach a lot of summaries to a Tensor (for TensorBoard visualization)."""
with tf.name_scope('summaries'):
mean = tf.reduce_mean(var)
tf.summary.scalar('mean', mean)
with tf.name_scope('stddev'):
stddev = tf.sqrt(tf.reduce_mean(tf.square(var - mean)))
tf.summary... | python | def variable_summaries(var):
"""Attach a lot of summaries to a Tensor (for TensorBoard visualization)."""
with tf.name_scope('summaries'):
mean = tf.reduce_mean(var)
tf.summary.scalar('mean', mean)
with tf.name_scope('stddev'):
stddev = tf.sqrt(tf.reduce_mean(tf.square(var - mean)))
tf.summary... | [
"def",
"variable_summaries",
"(",
"var",
")",
":",
"with",
"tf",
".",
"name_scope",
"(",
"'summaries'",
")",
":",
"mean",
"=",
"tf",
".",
"reduce_mean",
"(",
"var",
")",
"tf",
".",
"summary",
".",
"scalar",
"(",
"'mean'",
",",
"mean",
")",
"with",
"t... | Attach a lot of summaries to a Tensor (for TensorBoard visualization). | [
"Attach",
"a",
"lot",
"of",
"summaries",
"to",
"a",
"Tensor",
"(",
"for",
"TensorBoard",
"visualization",
")",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/examples/image_retraining/retrain.py#L709-L719 | train | Attach a lot of summaries to a TensorBoard visualization. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | examples/image_retraining/retrain.py | add_final_retrain_ops | def add_final_retrain_ops(class_count, final_tensor_name, bottleneck_tensor,
quantize_layer, is_training):
"""Adds a new softmax and fully-connected layer for training and eval.
We need to retrain the top layer to identify our new classes, so this function
adds the right operations to t... | python | def add_final_retrain_ops(class_count, final_tensor_name, bottleneck_tensor,
quantize_layer, is_training):
"""Adds a new softmax and fully-connected layer for training and eval.
We need to retrain the top layer to identify our new classes, so this function
adds the right operations to t... | [
"def",
"add_final_retrain_ops",
"(",
"class_count",
",",
"final_tensor_name",
",",
"bottleneck_tensor",
",",
"quantize_layer",
",",
"is_training",
")",
":",
"batch_size",
",",
"bottleneck_tensor_size",
"=",
"bottleneck_tensor",
".",
"get_shape",
"(",
")",
".",
"as_lis... | Adds a new softmax and fully-connected layer for training and eval.
We need to retrain the top layer to identify our new classes, so this function
adds the right operations to the graph, along with some variables to hold the
weights, and then sets up all the gradients for the backward pass.
The set up for the... | [
"Adds",
"a",
"new",
"softmax",
"and",
"fully",
"-",
"connected",
"layer",
"for",
"training",
"and",
"eval",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/examples/image_retraining/retrain.py#L722-L804 | train | Adds a new softmax and fully - connected layer for training and eval. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | examples/image_retraining/retrain.py | add_evaluation_step | def add_evaluation_step(result_tensor, ground_truth_tensor):
"""Inserts the operations we need to evaluate the accuracy of our results.
Args:
result_tensor: The new final node that produces results.
ground_truth_tensor: The node we feed ground truth data
into.
Returns:
Tuple of (evaluation step,... | python | def add_evaluation_step(result_tensor, ground_truth_tensor):
"""Inserts the operations we need to evaluate the accuracy of our results.
Args:
result_tensor: The new final node that produces results.
ground_truth_tensor: The node we feed ground truth data
into.
Returns:
Tuple of (evaluation step,... | [
"def",
"add_evaluation_step",
"(",
"result_tensor",
",",
"ground_truth_tensor",
")",
":",
"with",
"tf",
".",
"name_scope",
"(",
"'accuracy'",
")",
":",
"with",
"tf",
".",
"name_scope",
"(",
"'correct_prediction'",
")",
":",
"prediction",
"=",
"tf",
".",
"argma... | Inserts the operations we need to evaluate the accuracy of our results.
Args:
result_tensor: The new final node that produces results.
ground_truth_tensor: The node we feed ground truth data
into.
Returns:
Tuple of (evaluation step, prediction). | [
"Inserts",
"the",
"operations",
"we",
"need",
"to",
"evaluate",
"the",
"accuracy",
"of",
"our",
"results",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/examples/image_retraining/retrain.py#L807-L825 | train | Adds the operations needed to evaluate the accuracy of our results. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | examples/image_retraining/retrain.py | run_final_eval | def run_final_eval(train_session, module_spec, class_count, image_lists,
jpeg_data_tensor, decoded_image_tensor,
resized_image_tensor, bottleneck_tensor):
"""Runs a final evaluation on an eval graph using the test data set.
Args:
train_session: Session for the train graph ... | python | def run_final_eval(train_session, module_spec, class_count, image_lists,
jpeg_data_tensor, decoded_image_tensor,
resized_image_tensor, bottleneck_tensor):
"""Runs a final evaluation on an eval graph using the test data set.
Args:
train_session: Session for the train graph ... | [
"def",
"run_final_eval",
"(",
"train_session",
",",
"module_spec",
",",
"class_count",
",",
"image_lists",
",",
"jpeg_data_tensor",
",",
"decoded_image_tensor",
",",
"resized_image_tensor",
",",
"bottleneck_tensor",
")",
":",
"test_bottlenecks",
",",
"test_ground_truth",
... | Runs a final evaluation on an eval graph using the test data set.
Args:
train_session: Session for the train graph with the tensors below.
module_spec: The hub.ModuleSpec for the image module being used.
class_count: Number of classes
image_lists: OrderedDict of training images for each label.
jp... | [
"Runs",
"a",
"final",
"evaluation",
"on",
"an",
"eval",
"graph",
"using",
"the",
"test",
"data",
"set",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/examples/image_retraining/retrain.py#L828-L867 | train | Runs a final evaluation on an eval graph using the test data set. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | examples/image_retraining/retrain.py | build_eval_session | def build_eval_session(module_spec, class_count):
"""Builds an restored eval session without train operations for exporting.
Args:
module_spec: The hub.ModuleSpec for the image module being used.
class_count: Number of classes
Returns:
Eval session containing the restored eval graph.
The bottlen... | python | def build_eval_session(module_spec, class_count):
"""Builds an restored eval session without train operations for exporting.
Args:
module_spec: The hub.ModuleSpec for the image module being used.
class_count: Number of classes
Returns:
Eval session containing the restored eval graph.
The bottlen... | [
"def",
"build_eval_session",
"(",
"module_spec",
",",
"class_count",
")",
":",
"# If quantized, we need to create the correct eval graph for exporting.",
"eval_graph",
",",
"bottleneck_tensor",
",",
"resized_input_tensor",
",",
"wants_quantization",
"=",
"(",
"create_module_graph... | Builds an restored eval session without train operations for exporting.
Args:
module_spec: The hub.ModuleSpec for the image module being used.
class_count: Number of classes
Returns:
Eval session containing the restored eval graph.
The bottleneck input, ground truth, eval step, and prediction tens... | [
"Builds",
"an",
"restored",
"eval",
"session",
"without",
"train",
"operations",
"for",
"exporting",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/examples/image_retraining/retrain.py#L870-L901 | train | Builds an eval session with the given module_spec and class_count. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | examples/image_retraining/retrain.py | save_graph_to_file | def save_graph_to_file(graph_file_name, module_spec, class_count):
"""Saves an graph to file, creating a valid quantized one if necessary."""
sess, _, _, _, _, _ = build_eval_session(module_spec, class_count)
graph = sess.graph
output_graph_def = tf.graph_util.convert_variables_to_constants(
sess, graph.... | python | def save_graph_to_file(graph_file_name, module_spec, class_count):
"""Saves an graph to file, creating a valid quantized one if necessary."""
sess, _, _, _, _, _ = build_eval_session(module_spec, class_count)
graph = sess.graph
output_graph_def = tf.graph_util.convert_variables_to_constants(
sess, graph.... | [
"def",
"save_graph_to_file",
"(",
"graph_file_name",
",",
"module_spec",
",",
"class_count",
")",
":",
"sess",
",",
"_",
",",
"_",
",",
"_",
",",
"_",
",",
"_",
"=",
"build_eval_session",
"(",
"module_spec",
",",
"class_count",
")",
"graph",
"=",
"sess",
... | Saves an graph to file, creating a valid quantized one if necessary. | [
"Saves",
"an",
"graph",
"to",
"file",
"creating",
"a",
"valid",
"quantized",
"one",
"if",
"necessary",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/examples/image_retraining/retrain.py#L904-L913 | train | Saves an graph to file creating a valid quantized one if necessary. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | examples/image_retraining/retrain.py | add_jpeg_decoding | def add_jpeg_decoding(module_spec):
"""Adds operations that perform JPEG decoding and resizing to the graph..
Args:
module_spec: The hub.ModuleSpec for the image module being used.
Returns:
Tensors for the node to feed JPEG data into, and the output of the
preprocessing steps.
"""
input_height... | python | def add_jpeg_decoding(module_spec):
"""Adds operations that perform JPEG decoding and resizing to the graph..
Args:
module_spec: The hub.ModuleSpec for the image module being used.
Returns:
Tensors for the node to feed JPEG data into, and the output of the
preprocessing steps.
"""
input_height... | [
"def",
"add_jpeg_decoding",
"(",
"module_spec",
")",
":",
"input_height",
",",
"input_width",
"=",
"hub",
".",
"get_expected_image_size",
"(",
"module_spec",
")",
"input_depth",
"=",
"hub",
".",
"get_num_image_channels",
"(",
"module_spec",
")",
"jpeg_data",
"=",
... | Adds operations that perform JPEG decoding and resizing to the graph..
Args:
module_spec: The hub.ModuleSpec for the image module being used.
Returns:
Tensors for the node to feed JPEG data into, and the output of the
preprocessing steps. | [
"Adds",
"operations",
"that",
"perform",
"JPEG",
"decoding",
"and",
"resizing",
"to",
"the",
"graph",
".."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/examples/image_retraining/retrain.py#L926-L948 | train | Adds operations that perform JPEG decoding and resizing to the graph. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | examples/image_retraining/retrain.py | export_model | def export_model(module_spec, class_count, saved_model_dir):
"""Exports model for serving.
Args:
module_spec: The hub.ModuleSpec for the image module being used.
class_count: The number of classes.
saved_model_dir: Directory in which to save exported model and variables.
"""
# The SavedModel should... | python | def export_model(module_spec, class_count, saved_model_dir):
"""Exports model for serving.
Args:
module_spec: The hub.ModuleSpec for the image module being used.
class_count: The number of classes.
saved_model_dir: Directory in which to save exported model and variables.
"""
# The SavedModel should... | [
"def",
"export_model",
"(",
"module_spec",
",",
"class_count",
",",
"saved_model_dir",
")",
":",
"# The SavedModel should hold the eval graph.",
"sess",
",",
"in_image",
",",
"_",
",",
"_",
",",
"_",
",",
"_",
"=",
"build_eval_session",
"(",
"module_spec",
",",
... | Exports model for serving.
Args:
module_spec: The hub.ModuleSpec for the image module being used.
class_count: The number of classes.
saved_model_dir: Directory in which to save exported model and variables. | [
"Exports",
"model",
"for",
"serving",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/examples/image_retraining/retrain.py#L951-L968 | train | Exports the model for serving. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | examples/image_retraining/retrain.py | logging_level_verbosity | def logging_level_verbosity(logging_verbosity):
"""Converts logging_level into TensorFlow logging verbosity value
Args:
logging_level: String value representing logging level: 'DEBUG', 'INFO',
'WARN', 'ERROR', 'FATAL'
"""
name_to_level = {
'FATAL': tf.logging.FATAL,
'ERROR': tf.logging.ERROR,
... | python | def logging_level_verbosity(logging_verbosity):
"""Converts logging_level into TensorFlow logging verbosity value
Args:
logging_level: String value representing logging level: 'DEBUG', 'INFO',
'WARN', 'ERROR', 'FATAL'
"""
name_to_level = {
'FATAL': tf.logging.FATAL,
'ERROR': tf.logging.ERROR,
... | [
"def",
"logging_level_verbosity",
"(",
"logging_verbosity",
")",
":",
"name_to_level",
"=",
"{",
"'FATAL'",
":",
"tf",
".",
"logging",
".",
"FATAL",
",",
"'ERROR'",
":",
"tf",
".",
"logging",
".",
"ERROR",
",",
"'WARN'",
":",
"tf",
".",
"logging",
".",
"... | Converts logging_level into TensorFlow logging verbosity value
Args:
logging_level: String value representing logging level: 'DEBUG', 'INFO',
'WARN', 'ERROR', 'FATAL' | [
"Converts",
"logging_level",
"into",
"TensorFlow",
"logging",
"verbosity",
"value"
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/examples/image_retraining/retrain.py#L971-L990 | train | Converts logging_level into TensorFlow logging verbosity value
Arguments | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | tensorflow_hub/image_util.py | get_image_module_info | def get_image_module_info(module_or_spec, required=False):
"""Returns the module's attached ImageModuleInfo message, or None."""
return module_or_spec.get_attached_message(
IMAGE_MODULE_INFO_KEY, ImageModuleInfo, required=required) | python | def get_image_module_info(module_or_spec, required=False):
"""Returns the module's attached ImageModuleInfo message, or None."""
return module_or_spec.get_attached_message(
IMAGE_MODULE_INFO_KEY, ImageModuleInfo, required=required) | [
"def",
"get_image_module_info",
"(",
"module_or_spec",
",",
"required",
"=",
"False",
")",
":",
"return",
"module_or_spec",
".",
"get_attached_message",
"(",
"IMAGE_MODULE_INFO_KEY",
",",
"ImageModuleInfo",
",",
"required",
"=",
"required",
")"
] | Returns the module's attached ImageModuleInfo message, or None. | [
"Returns",
"the",
"module",
"s",
"attached",
"ImageModuleInfo",
"message",
"or",
"None",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/tensorflow_hub/image_util.py#L39-L42 | train | Returns the attached ImageModuleInfo message or None. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | tensorflow_hub/image_util.py | get_expected_image_size | def get_expected_image_size(module_or_spec, signature=None, input_name=None):
"""Returns expected [height, width] dimensions of an image input.
Args:
module_or_spec: a Module or ModuleSpec that accepts image inputs.
signature: a string with the key of the signature in question.
If None, the default s... | python | def get_expected_image_size(module_or_spec, signature=None, input_name=None):
"""Returns expected [height, width] dimensions of an image input.
Args:
module_or_spec: a Module or ModuleSpec that accepts image inputs.
signature: a string with the key of the signature in question.
If None, the default s... | [
"def",
"get_expected_image_size",
"(",
"module_or_spec",
",",
"signature",
"=",
"None",
",",
"input_name",
"=",
"None",
")",
":",
"# First see if an attached ImageModuleInfo provides this information.",
"image_module_info",
"=",
"get_image_module_info",
"(",
"module_or_spec",
... | Returns expected [height, width] dimensions of an image input.
Args:
module_or_spec: a Module or ModuleSpec that accepts image inputs.
signature: a string with the key of the signature in question.
If None, the default signature is used.
input_name: a string with the input name for images. If None,... | [
"Returns",
"expected",
"[",
"height",
"width",
"]",
"dimensions",
"of",
"an",
"image",
"input",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/tensorflow_hub/image_util.py#L45-L86 | train | Returns the expected height and width dimensions of an image input. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | tensorflow_hub/image_util.py | get_num_image_channels | def get_num_image_channels(module_or_spec, signature=None, input_name=None):
"""Returns expected num_channels dimensions of an image input.
This is for advanced users only who expect to handle modules with
image inputs that might not have the 3 usual RGB channels.
Args:
module_or_spec: a Module or ModuleS... | python | def get_num_image_channels(module_or_spec, signature=None, input_name=None):
"""Returns expected num_channels dimensions of an image input.
This is for advanced users only who expect to handle modules with
image inputs that might not have the 3 usual RGB channels.
Args:
module_or_spec: a Module or ModuleS... | [
"def",
"get_num_image_channels",
"(",
"module_or_spec",
",",
"signature",
"=",
"None",
",",
"input_name",
"=",
"None",
")",
":",
"if",
"input_name",
"is",
"None",
":",
"input_name",
"=",
"\"images\"",
"input_info_dict",
"=",
"module_or_spec",
".",
"get_input_info_... | Returns expected num_channels dimensions of an image input.
This is for advanced users only who expect to handle modules with
image inputs that might not have the 3 usual RGB channels.
Args:
module_or_spec: a Module or ModuleSpec that accepts image inputs.
signature: a string with the key of the signatu... | [
"Returns",
"expected",
"num_channels",
"dimensions",
"of",
"an",
"image",
"input",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/tensorflow_hub/image_util.py#L89-L125 | train | Returns expected num_channels dimensions of an image input. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | tensorflow_hub/tensor_info.py | _parse_tensor_info_proto | def _parse_tensor_info_proto(tensor_info):
"""Returns a ParsedTensorInfo instance from a TensorInfo proto."""
encoding = tensor_info.WhichOneof("encoding")
dtype = tf.DType(tensor_info.dtype)
shape = tf.TensorShape(tensor_info.tensor_shape)
if encoding == "name":
return ParsedTensorInfo(dtype=dtype, shape... | python | def _parse_tensor_info_proto(tensor_info):
"""Returns a ParsedTensorInfo instance from a TensorInfo proto."""
encoding = tensor_info.WhichOneof("encoding")
dtype = tf.DType(tensor_info.dtype)
shape = tf.TensorShape(tensor_info.tensor_shape)
if encoding == "name":
return ParsedTensorInfo(dtype=dtype, shape... | [
"def",
"_parse_tensor_info_proto",
"(",
"tensor_info",
")",
":",
"encoding",
"=",
"tensor_info",
".",
"WhichOneof",
"(",
"\"encoding\"",
")",
"dtype",
"=",
"tf",
".",
"DType",
"(",
"tensor_info",
".",
"dtype",
")",
"shape",
"=",
"tf",
".",
"TensorShape",
"("... | Returns a ParsedTensorInfo instance from a TensorInfo proto. | [
"Returns",
"a",
"ParsedTensorInfo",
"instance",
"from",
"a",
"TensorInfo",
"proto",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/tensorflow_hub/tensor_info.py#L65-L75 | train | Returns a ParsedTensorInfo instance from a TensorInfo proto. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | tensorflow_hub/tensor_info.py | _is_sparse | def _is_sparse(x):
"""Returns whether x is a SparseTensor or a parsed sparse tensor info."""
return (
isinstance(x, (tf.SparseTensor, tf_v1.SparseTensorValue)) or
(hasattr(x, "is_sparse") and x.is_sparse)) | python | def _is_sparse(x):
"""Returns whether x is a SparseTensor or a parsed sparse tensor info."""
return (
isinstance(x, (tf.SparseTensor, tf_v1.SparseTensorValue)) or
(hasattr(x, "is_sparse") and x.is_sparse)) | [
"def",
"_is_sparse",
"(",
"x",
")",
":",
"return",
"(",
"isinstance",
"(",
"x",
",",
"(",
"tf",
".",
"SparseTensor",
",",
"tf_v1",
".",
"SparseTensorValue",
")",
")",
"or",
"(",
"hasattr",
"(",
"x",
",",
"\"is_sparse\"",
")",
"and",
"x",
".",
"is_spa... | Returns whether x is a SparseTensor or a parsed sparse tensor info. | [
"Returns",
"whether",
"x",
"is",
"a",
"SparseTensor",
"or",
"a",
"parsed",
"sparse",
"tensor",
"info",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/tensorflow_hub/tensor_info.py#L97-L101 | train | Returns whether x is a SparseTensor or a parsed sparse tensor info. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | tensorflow_hub/tensor_info.py | _convert_to_compatible_tensor | def _convert_to_compatible_tensor(value, target, error_prefix):
"""Converts `value` into a tensor that can be feed into `tensor_info`.
Args:
value: A value to convert into Tensor or SparseTensor.
target: An object returned by `parse_tensor_info_map`.
error_prefix: A string to prefix on raised TypeError... | python | def _convert_to_compatible_tensor(value, target, error_prefix):
"""Converts `value` into a tensor that can be feed into `tensor_info`.
Args:
value: A value to convert into Tensor or SparseTensor.
target: An object returned by `parse_tensor_info_map`.
error_prefix: A string to prefix on raised TypeError... | [
"def",
"_convert_to_compatible_tensor",
"(",
"value",
",",
"target",
",",
"error_prefix",
")",
":",
"try",
":",
"tensor",
"=",
"tf_v1",
".",
"convert_to_tensor_or_indexed_slices",
"(",
"value",
",",
"target",
".",
"dtype",
")",
"except",
"TypeError",
"as",
"e",
... | Converts `value` into a tensor that can be feed into `tensor_info`.
Args:
value: A value to convert into Tensor or SparseTensor.
target: An object returned by `parse_tensor_info_map`.
error_prefix: A string to prefix on raised TypeErrors.
Raises:
TypeError: If it fails to convert.
Returns:
... | [
"Converts",
"value",
"into",
"a",
"tensor",
"that",
"can",
"be",
"feed",
"into",
"tensor_info",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/tensorflow_hub/tensor_info.py#L104-L130 | train | Converts value into a tensor that can be feed into tensor_info. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | tensorflow_hub/tensor_info.py | convert_dict_to_compatible_tensor | def convert_dict_to_compatible_tensor(values, targets):
"""Converts dict `values` in tensors that are compatible with `targets`.
Args:
values: A dict to objects to convert with same keys as `targets`.
targets: A dict returned by `parse_tensor_info_map`.
Returns:
A map with the same keys as `values` ... | python | def convert_dict_to_compatible_tensor(values, targets):
"""Converts dict `values` in tensors that are compatible with `targets`.
Args:
values: A dict to objects to convert with same keys as `targets`.
targets: A dict returned by `parse_tensor_info_map`.
Returns:
A map with the same keys as `values` ... | [
"def",
"convert_dict_to_compatible_tensor",
"(",
"values",
",",
"targets",
")",
":",
"result",
"=",
"{",
"}",
"for",
"key",
",",
"value",
"in",
"sorted",
"(",
"values",
".",
"items",
"(",
")",
")",
":",
"result",
"[",
"key",
"]",
"=",
"_convert_to_compat... | Converts dict `values` in tensors that are compatible with `targets`.
Args:
values: A dict to objects to convert with same keys as `targets`.
targets: A dict returned by `parse_tensor_info_map`.
Returns:
A map with the same keys as `values` but values converted into
Tensor/SparseTensors that can b... | [
"Converts",
"dict",
"values",
"in",
"tensors",
"that",
"are",
"compatible",
"with",
"targets",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/tensorflow_hub/tensor_info.py#L133-L151 | train | Converts dict values in tensors that are compatible with targets. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | tensorflow_hub/tensor_info.py | build_input_map | def build_input_map(protomap, inputs):
"""Builds a map to feed tensors in `protomap` using `inputs`.
Args:
protomap: A proto map<string,TensorInfo>.
inputs: A map with same keys as `protomap` of Tensors and SparseTensors.
Returns:
A map from nodes refered by TensorInfo protos to corresponding input
... | python | def build_input_map(protomap, inputs):
"""Builds a map to feed tensors in `protomap` using `inputs`.
Args:
protomap: A proto map<string,TensorInfo>.
inputs: A map with same keys as `protomap` of Tensors and SparseTensors.
Returns:
A map from nodes refered by TensorInfo protos to corresponding input
... | [
"def",
"build_input_map",
"(",
"protomap",
",",
"inputs",
")",
":",
"if",
"set",
"(",
"protomap",
".",
"keys",
"(",
")",
")",
"!=",
"set",
"(",
"inputs",
".",
"keys",
"(",
")",
")",
":",
"raise",
"ValueError",
"(",
"\"build_input_map: keys do not match.\""... | Builds a map to feed tensors in `protomap` using `inputs`.
Args:
protomap: A proto map<string,TensorInfo>.
inputs: A map with same keys as `protomap` of Tensors and SparseTensors.
Returns:
A map from nodes refered by TensorInfo protos to corresponding input
tensors.
Raises:
ValueError: if a... | [
"Builds",
"a",
"map",
"to",
"feed",
"tensors",
"in",
"protomap",
"using",
"inputs",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/tensorflow_hub/tensor_info.py#L154-L183 | train | Builds a map to feed tensors in protomap using inputs. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | tensorflow_hub/tensor_info.py | build_output_map | def build_output_map(protomap, get_tensor_by_name):
"""Builds a map of tensors from `protomap` using `get_tensor_by_name`.
Args:
protomap: A proto map<string,TensorInfo>.
get_tensor_by_name: A lambda that receives a tensor name and returns a
Tensor instance.
Returns:
A map from string to Tenso... | python | def build_output_map(protomap, get_tensor_by_name):
"""Builds a map of tensors from `protomap` using `get_tensor_by_name`.
Args:
protomap: A proto map<string,TensorInfo>.
get_tensor_by_name: A lambda that receives a tensor name and returns a
Tensor instance.
Returns:
A map from string to Tenso... | [
"def",
"build_output_map",
"(",
"protomap",
",",
"get_tensor_by_name",
")",
":",
"def",
"get_output_from_tensor_info",
"(",
"tensor_info",
")",
":",
"encoding",
"=",
"tensor_info",
".",
"WhichOneof",
"(",
"\"encoding\"",
")",
"if",
"encoding",
"==",
"\"name\"",
":... | Builds a map of tensors from `protomap` using `get_tensor_by_name`.
Args:
protomap: A proto map<string,TensorInfo>.
get_tensor_by_name: A lambda that receives a tensor name and returns a
Tensor instance.
Returns:
A map from string to Tensor or SparseTensor instances built from `protomap`
and... | [
"Builds",
"a",
"map",
"of",
"tensors",
"from",
"protomap",
"using",
"get_tensor_by_name",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/tensorflow_hub/tensor_info.py#L186-L217 | train | Builds a map from a proto map<string TensorInfo > protomap using get_tensor_by_name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | tensorflow_hub/tensor_info.py | tensor_info_proto_maps_match | def tensor_info_proto_maps_match(map_a, map_b):
"""Whether two signature inputs/outputs match in dtype, shape and sparsity.
Args:
map_a: A proto map<string,TensorInfo>.
map_b: A proto map<string,TensorInfo>.
Returns:
A boolean whether `map_a` and `map_b` tensors have the same dtype, shape and
sp... | python | def tensor_info_proto_maps_match(map_a, map_b):
"""Whether two signature inputs/outputs match in dtype, shape and sparsity.
Args:
map_a: A proto map<string,TensorInfo>.
map_b: A proto map<string,TensorInfo>.
Returns:
A boolean whether `map_a` and `map_b` tensors have the same dtype, shape and
sp... | [
"def",
"tensor_info_proto_maps_match",
"(",
"map_a",
",",
"map_b",
")",
":",
"iter_a",
"=",
"sorted",
"(",
"parse_tensor_info_map",
"(",
"map_a",
")",
".",
"items",
"(",
")",
")",
"iter_b",
"=",
"sorted",
"(",
"parse_tensor_info_map",
"(",
"map_b",
")",
".",... | Whether two signature inputs/outputs match in dtype, shape and sparsity.
Args:
map_a: A proto map<string,TensorInfo>.
map_b: A proto map<string,TensorInfo>.
Returns:
A boolean whether `map_a` and `map_b` tensors have the same dtype, shape and
sparsity. | [
"Whether",
"two",
"signature",
"inputs",
"/",
"outputs",
"match",
"in",
"dtype",
"shape",
"and",
"sparsity",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/tensorflow_hub/tensor_info.py#L230-L254 | train | Returns True if two signature inputs and outputs match in dtype shape and sparsity. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | examples/text_embeddings/export.py | parse_line | def parse_line(line):
"""Parses a line of a text embedding file.
Args:
line: (str) One line of the text embedding file.
Returns:
A token string and its embedding vector in floats.
"""
columns = line.split()
token = columns.pop(0)
values = [float(column) for column in columns]
return token, val... | python | def parse_line(line):
"""Parses a line of a text embedding file.
Args:
line: (str) One line of the text embedding file.
Returns:
A token string and its embedding vector in floats.
"""
columns = line.split()
token = columns.pop(0)
values = [float(column) for column in columns]
return token, val... | [
"def",
"parse_line",
"(",
"line",
")",
":",
"columns",
"=",
"line",
".",
"split",
"(",
")",
"token",
"=",
"columns",
".",
"pop",
"(",
"0",
")",
"values",
"=",
"[",
"float",
"(",
"column",
")",
"for",
"column",
"in",
"columns",
"]",
"return",
"token... | Parses a line of a text embedding file.
Args:
line: (str) One line of the text embedding file.
Returns:
A token string and its embedding vector in floats. | [
"Parses",
"a",
"line",
"of",
"a",
"text",
"embedding",
"file",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/examples/text_embeddings/export.py#L47-L59 | train | Parses a line of a text embedding file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | examples/text_embeddings/export.py | load | def load(file_path, parse_line_fn):
"""Loads a text embedding into memory as a numpy matrix.
Args:
file_path: Path to the text embedding file.
parse_line_fn: callback function to parse each file line.
Returns:
A tuple of (list of vocabulary tokens, numpy matrix of embedding vectors).
Raises:
... | python | def load(file_path, parse_line_fn):
"""Loads a text embedding into memory as a numpy matrix.
Args:
file_path: Path to the text embedding file.
parse_line_fn: callback function to parse each file line.
Returns:
A tuple of (list of vocabulary tokens, numpy matrix of embedding vectors).
Raises:
... | [
"def",
"load",
"(",
"file_path",
",",
"parse_line_fn",
")",
":",
"vocabulary",
"=",
"[",
"]",
"embeddings",
"=",
"[",
"]",
"embeddings_dim",
"=",
"None",
"for",
"line",
"in",
"tf",
".",
"gfile",
".",
"GFile",
"(",
"file_path",
")",
":",
"token",
",",
... | Loads a text embedding into memory as a numpy matrix.
Args:
file_path: Path to the text embedding file.
parse_line_fn: callback function to parse each file line.
Returns:
A tuple of (list of vocabulary tokens, numpy matrix of embedding vectors).
Raises:
ValueError: if the data in the sstable is... | [
"Loads",
"a",
"text",
"embedding",
"into",
"memory",
"as",
"a",
"numpy",
"matrix",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/examples/text_embeddings/export.py#L62-L90 | train | Loads a text embedding into memory as a numpy matrix. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tensorflow/hub | examples/text_embeddings/export.py | make_module_spec | def make_module_spec(vocabulary_file, vocab_size, embeddings_dim,
num_oov_buckets, preprocess_text):
"""Makes a module spec to simply perform token to embedding lookups.
Input of this module is a 1-D list of string tokens. For T tokens input and
an M dimensional embedding table, the lookup r... | python | def make_module_spec(vocabulary_file, vocab_size, embeddings_dim,
num_oov_buckets, preprocess_text):
"""Makes a module spec to simply perform token to embedding lookups.
Input of this module is a 1-D list of string tokens. For T tokens input and
an M dimensional embedding table, the lookup r... | [
"def",
"make_module_spec",
"(",
"vocabulary_file",
",",
"vocab_size",
",",
"embeddings_dim",
",",
"num_oov_buckets",
",",
"preprocess_text",
")",
":",
"def",
"module_fn",
"(",
")",
":",
"\"\"\"Spec function for a token embedding module.\"\"\"",
"tokens",
"=",
"tf",
".",... | Makes a module spec to simply perform token to embedding lookups.
Input of this module is a 1-D list of string tokens. For T tokens input and
an M dimensional embedding table, the lookup result is a [T, M] shaped Tensor.
Args:
vocabulary_file: Text file where each line is a key in the vocabulary.
vocab_... | [
"Makes",
"a",
"module",
"spec",
"to",
"simply",
"perform",
"token",
"to",
"embedding",
"lookups",
"."
] | 09f45963f6787322967b6fec61459f3ac56fbb27 | https://github.com/tensorflow/hub/blob/09f45963f6787322967b6fec61459f3ac56fbb27/examples/text_embeddings/export.py#L93-L177 | train | Makes a module spec to simply perform token to embedding lookups. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.