repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
bitesofcode/projexui | projexui/widgets/xlabel.py | XLabel.acceptEdit | def acceptEdit(self):
"""
Accepts the current edit for this label.
"""
if not self._lineEdit:
return
self.setText(self._lineEdit.text())
self._lineEdit.hide()
if not self.signalsBlocked():
self.editingFinished.e... | python | def acceptEdit(self):
"""
Accepts the current edit for this label.
"""
if not self._lineEdit:
return
self.setText(self._lineEdit.text())
self._lineEdit.hide()
if not self.signalsBlocked():
self.editingFinished.e... | [
"def",
"acceptEdit",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_lineEdit",
":",
"return",
"self",
".",
"setText",
"(",
"self",
".",
"_lineEdit",
".",
"text",
"(",
")",
")",
"self",
".",
"_lineEdit",
".",
"hide",
"(",
")",
"if",
"not",
"self... | Accepts the current edit for this label. | [
"Accepts",
"the",
"current",
"edit",
"for",
"this",
"label",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlabel.py#L32-L43 | train |
bitesofcode/projexui | projexui/widgets/xlabel.py | XLabel.beginEdit | def beginEdit(self):
"""
Begins editing for the label.
"""
if not self._lineEdit:
return
self.aboutToEdit.emit()
self._lineEdit.setText(self.editText())
self._lineEdit.show()
self._lineEdit.selectAll()
self... | python | def beginEdit(self):
"""
Begins editing for the label.
"""
if not self._lineEdit:
return
self.aboutToEdit.emit()
self._lineEdit.setText(self.editText())
self._lineEdit.show()
self._lineEdit.selectAll()
self... | [
"def",
"beginEdit",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_lineEdit",
":",
"return",
"self",
".",
"aboutToEdit",
".",
"emit",
"(",
")",
"self",
".",
"_lineEdit",
".",
"setText",
"(",
"self",
".",
"editText",
"(",
")",
")",
"self",
".",
... | Begins editing for the label. | [
"Begins",
"editing",
"for",
"the",
"label",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlabel.py#L45-L57 | train |
bitesofcode/projexui | projexui/widgets/xlabel.py | XLabel.rejectEdit | def rejectEdit(self):
"""
Cancels the edit for this label.
"""
if self._lineEdit:
self._lineEdit.hide()
self.editingCancelled.emit() | python | def rejectEdit(self):
"""
Cancels the edit for this label.
"""
if self._lineEdit:
self._lineEdit.hide()
self.editingCancelled.emit() | [
"def",
"rejectEdit",
"(",
"self",
")",
":",
"if",
"self",
".",
"_lineEdit",
":",
"self",
".",
"_lineEdit",
".",
"hide",
"(",
")",
"self",
".",
"editingCancelled",
".",
"emit",
"(",
")"
] | Cancels the edit for this label. | [
"Cancels",
"the",
"edit",
"for",
"this",
"label",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlabel.py#L122-L128 | train |
Gbps/fastlog | fastlog/term.py | typeseq | def typeseq(types):
"""
Returns an escape for a terminal text formatting type, or a list of types.
Valid types are:
* 'i' for 'italic'
* 'b' for 'bold'
* 'u' for 'underline'
* 'r' for 'reverse'
"""
ret = ""
for t in types:
ret += termcap.get(fmttypes[t])
... | python | def typeseq(types):
"""
Returns an escape for a terminal text formatting type, or a list of types.
Valid types are:
* 'i' for 'italic'
* 'b' for 'bold'
* 'u' for 'underline'
* 'r' for 'reverse'
"""
ret = ""
for t in types:
ret += termcap.get(fmttypes[t])
... | [
"def",
"typeseq",
"(",
"types",
")",
":",
"ret",
"=",
"\"\"",
"for",
"t",
"in",
"types",
":",
"ret",
"+=",
"termcap",
".",
"get",
"(",
"fmttypes",
"[",
"t",
"]",
")",
"return",
"ret"
] | Returns an escape for a terminal text formatting type, or a list of types.
Valid types are:
* 'i' for 'italic'
* 'b' for 'bold'
* 'u' for 'underline'
* 'r' for 'reverse' | [
"Returns",
"an",
"escape",
"for",
"a",
"terminal",
"text",
"formatting",
"type",
"or",
"a",
"list",
"of",
"types",
"."
] | 8edb2327d72191510302c4654ffaa1691fe31277 | https://github.com/Gbps/fastlog/blob/8edb2327d72191510302c4654ffaa1691fe31277/fastlog/term.py#L117-L131 | train |
Gbps/fastlog | fastlog/term.py | nametonum | def nametonum(name):
"""
Returns a color code number given the color name.
"""
code = colorcodes.get(name)
if code is None:
raise ValueError("%s is not a valid color name." % name)
else:
return code | python | def nametonum(name):
"""
Returns a color code number given the color name.
"""
code = colorcodes.get(name)
if code is None:
raise ValueError("%s is not a valid color name." % name)
else:
return code | [
"def",
"nametonum",
"(",
"name",
")",
":",
"code",
"=",
"colorcodes",
".",
"get",
"(",
"name",
")",
"if",
"code",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"%s is not a valid color name.\"",
"%",
"name",
")",
"else",
":",
"return",
"code"
] | Returns a color code number given the color name. | [
"Returns",
"a",
"color",
"code",
"number",
"given",
"the",
"color",
"name",
"."
] | 8edb2327d72191510302c4654ffaa1691fe31277 | https://github.com/Gbps/fastlog/blob/8edb2327d72191510302c4654ffaa1691fe31277/fastlog/term.py#L133-L141 | train |
Gbps/fastlog | fastlog/term.py | fgseq | def fgseq(code):
"""
Returns the forground color terminal escape sequence for the given color code number or color name.
"""
if isinstance(code, str):
code = nametonum(code)
if code == -1:
return ""
s = termcap.get('setaf', code) or termcap.get('setf', code)
return ... | python | def fgseq(code):
"""
Returns the forground color terminal escape sequence for the given color code number or color name.
"""
if isinstance(code, str):
code = nametonum(code)
if code == -1:
return ""
s = termcap.get('setaf', code) or termcap.get('setf', code)
return ... | [
"def",
"fgseq",
"(",
"code",
")",
":",
"if",
"isinstance",
"(",
"code",
",",
"str",
")",
":",
"code",
"=",
"nametonum",
"(",
"code",
")",
"if",
"code",
"==",
"-",
"1",
":",
"return",
"\"\"",
"s",
"=",
"termcap",
".",
"get",
"(",
"'setaf'",
",",
... | Returns the forground color terminal escape sequence for the given color code number or color name. | [
"Returns",
"the",
"forground",
"color",
"terminal",
"escape",
"sequence",
"for",
"the",
"given",
"color",
"code",
"number",
"or",
"color",
"name",
"."
] | 8edb2327d72191510302c4654ffaa1691fe31277 | https://github.com/Gbps/fastlog/blob/8edb2327d72191510302c4654ffaa1691fe31277/fastlog/term.py#L143-L154 | train |
Gbps/fastlog | fastlog/term.py | bgseq | def bgseq(code):
"""
Returns the background color terminal escape sequence for the given color code number.
"""
if isinstance(code, str):
code = nametonum(code)
if code == -1:
return ""
s = termcap.get('setab', code) or termcap.get('setb', code)
return s | python | def bgseq(code):
"""
Returns the background color terminal escape sequence for the given color code number.
"""
if isinstance(code, str):
code = nametonum(code)
if code == -1:
return ""
s = termcap.get('setab', code) or termcap.get('setb', code)
return s | [
"def",
"bgseq",
"(",
"code",
")",
":",
"if",
"isinstance",
"(",
"code",
",",
"str",
")",
":",
"code",
"=",
"nametonum",
"(",
"code",
")",
"if",
"code",
"==",
"-",
"1",
":",
"return",
"\"\"",
"s",
"=",
"termcap",
".",
"get",
"(",
"'setab'",
",",
... | Returns the background color terminal escape sequence for the given color code number. | [
"Returns",
"the",
"background",
"color",
"terminal",
"escape",
"sequence",
"for",
"the",
"given",
"color",
"code",
"number",
"."
] | 8edb2327d72191510302c4654ffaa1691fe31277 | https://github.com/Gbps/fastlog/blob/8edb2327d72191510302c4654ffaa1691fe31277/fastlog/term.py#L156-L167 | train |
Gbps/fastlog | fastlog/term.py | Style.parse | def parse(self, descriptor):
"""
Creates a text styling from a descriptor
A descriptor is a dictionary containing any of the following keys:
* fg: The foreground color (name or int)
See `bgseq`
* bg: The background color (name or int)
... | python | def parse(self, descriptor):
"""
Creates a text styling from a descriptor
A descriptor is a dictionary containing any of the following keys:
* fg: The foreground color (name or int)
See `bgseq`
* bg: The background color (name or int)
... | [
"def",
"parse",
"(",
"self",
",",
"descriptor",
")",
":",
"fg",
"=",
"descriptor",
".",
"get",
"(",
"'fg'",
")",
"bg",
"=",
"descriptor",
".",
"get",
"(",
"'bg'",
")",
"types",
"=",
"descriptor",
".",
"get",
"(",
"'fmt'",
")",
"ret",
"=",
"\"\"",
... | Creates a text styling from a descriptor
A descriptor is a dictionary containing any of the following keys:
* fg: The foreground color (name or int)
See `bgseq`
* bg: The background color (name or int)
See `fgseq`
* fmt: The types of s... | [
"Creates",
"a",
"text",
"styling",
"from",
"a",
"descriptor"
] | 8edb2327d72191510302c4654ffaa1691fe31277 | https://github.com/Gbps/fastlog/blob/8edb2327d72191510302c4654ffaa1691fe31277/fastlog/term.py#L78-L113 | train |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofiledialog.py | XViewProfileDialog.accept | def accept( self ):
"""
Saves the data to the profile before closing.
"""
if ( not self.uiNameTXT.text() ):
QMessageBox.information(self,
'Invalid Name',
'You need to supply a name for your layout.')... | python | def accept( self ):
"""
Saves the data to the profile before closing.
"""
if ( not self.uiNameTXT.text() ):
QMessageBox.information(self,
'Invalid Name',
'You need to supply a name for your layout.')... | [
"def",
"accept",
"(",
"self",
")",
":",
"if",
"(",
"not",
"self",
".",
"uiNameTXT",
".",
"text",
"(",
")",
")",
":",
"QMessageBox",
".",
"information",
"(",
"self",
",",
"'Invalid Name'",
",",
"'You need to supply a name for your layout.'",
")",
"return",
"p... | Saves the data to the profile before closing. | [
"Saves",
"the",
"data",
"to",
"the",
"profile",
"before",
"closing",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofiledialog.py#L35-L54 | train |
bitesofcode/projexui | projexui/widgets/xlocationwidget.py | XLocationWidget.browseMaps | def browseMaps( self ):
"""
Brings up a web browser with the address in a Google map.
"""
url = self.urlTemplate()
params = urllib.urlencode({self.urlQueryKey(): self.location()})
url = url % {'params': params}
webbrowser.open(url) | python | def browseMaps( self ):
"""
Brings up a web browser with the address in a Google map.
"""
url = self.urlTemplate()
params = urllib.urlencode({self.urlQueryKey(): self.location()})
url = url % {'params': params}
webbrowser.open(url) | [
"def",
"browseMaps",
"(",
"self",
")",
":",
"url",
"=",
"self",
".",
"urlTemplate",
"(",
")",
"params",
"=",
"urllib",
".",
"urlencode",
"(",
"{",
"self",
".",
"urlQueryKey",
"(",
")",
":",
"self",
".",
"location",
"(",
")",
"}",
")",
"url",
"=",
... | Brings up a web browser with the address in a Google map. | [
"Brings",
"up",
"a",
"web",
"browser",
"with",
"the",
"address",
"in",
"a",
"Google",
"map",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xlocationwidget.py#L79-L87 | train |
Stryker0301/google-image-extractor | giextractor.py | GoogleImageExtractor._initialize_chrome_driver | def _initialize_chrome_driver(self):
"""Initializes chrome in headless mode"""
try:
print(colored('\nInitializing Headless Chrome...\n', 'yellow'))
self._initialize_chrome_options()
self._chromeDriver = webdriver.Chrome(
chrome_options=self._chromeOp... | python | def _initialize_chrome_driver(self):
"""Initializes chrome in headless mode"""
try:
print(colored('\nInitializing Headless Chrome...\n', 'yellow'))
self._initialize_chrome_options()
self._chromeDriver = webdriver.Chrome(
chrome_options=self._chromeOp... | [
"def",
"_initialize_chrome_driver",
"(",
"self",
")",
":",
"try",
":",
"print",
"(",
"colored",
"(",
"'\\nInitializing Headless Chrome...\\n'",
",",
"'yellow'",
")",
")",
"self",
".",
"_initialize_chrome_options",
"(",
")",
"self",
".",
"_chromeDriver",
"=",
"webd... | Initializes chrome in headless mode | [
"Initializes",
"chrome",
"in",
"headless",
"mode"
] | bd227f3f77cc82603b9ad7798c9af9fed6724a05 | https://github.com/Stryker0301/google-image-extractor/blob/bd227f3f77cc82603b9ad7798c9af9fed6724a05/giextractor.py#L72-L86 | train |
Stryker0301/google-image-extractor | giextractor.py | GoogleImageExtractor.extract_images | def extract_images(self, imageQuery, imageCount=100, destinationFolder='./', threadCount=4):
"""
Searches across Google Image Search with the specified image query and
downloads the specified count of images
Arguments:
imageQuery {[str]} -- [Image Search Query]
Keyw... | python | def extract_images(self, imageQuery, imageCount=100, destinationFolder='./', threadCount=4):
"""
Searches across Google Image Search with the specified image query and
downloads the specified count of images
Arguments:
imageQuery {[str]} -- [Image Search Query]
Keyw... | [
"def",
"extract_images",
"(",
"self",
",",
"imageQuery",
",",
"imageCount",
"=",
"100",
",",
"destinationFolder",
"=",
"'./'",
",",
"threadCount",
"=",
"4",
")",
":",
"self",
".",
"_initialize_chrome_driver",
"(",
")",
"self",
".",
"_imageQuery",
"=",
"image... | Searches across Google Image Search with the specified image query and
downloads the specified count of images
Arguments:
imageQuery {[str]} -- [Image Search Query]
Keyword Arguments:
imageCount {[int]} -- [Count of images that need to be downloaded]
destina... | [
"Searches",
"across",
"Google",
"Image",
"Search",
"with",
"the",
"specified",
"image",
"query",
"and",
"downloads",
"the",
"specified",
"count",
"of",
"images"
] | bd227f3f77cc82603b9ad7798c9af9fed6724a05 | https://github.com/Stryker0301/google-image-extractor/blob/bd227f3f77cc82603b9ad7798c9af9fed6724a05/giextractor.py#L129-L164 | train |
Stryker0301/google-image-extractor | giextractor.py | GoogleImageExtractor._get_image_urls | def _get_image_urls(self):
"""Retrieves the image URLS corresponding to the image query"""
print(colored('\nRetrieving Image URLs...', 'yellow'))
_imageQuery = self._imageQuery.replace(' ', '+')
self._chromeDriver.get('https://www.google.co.in/search?q=' + _imageQuery +
... | python | def _get_image_urls(self):
"""Retrieves the image URLS corresponding to the image query"""
print(colored('\nRetrieving Image URLs...', 'yellow'))
_imageQuery = self._imageQuery.replace(' ', '+')
self._chromeDriver.get('https://www.google.co.in/search?q=' + _imageQuery +
... | [
"def",
"_get_image_urls",
"(",
"self",
")",
":",
"print",
"(",
"colored",
"(",
"'\\nRetrieving Image URLs...'",
",",
"'yellow'",
")",
")",
"_imageQuery",
"=",
"self",
".",
"_imageQuery",
".",
"replace",
"(",
"' '",
",",
"'+'",
")",
"self",
".",
"_chromeDrive... | Retrieves the image URLS corresponding to the image query | [
"Retrieves",
"the",
"image",
"URLS",
"corresponding",
"to",
"the",
"image",
"query"
] | bd227f3f77cc82603b9ad7798c9af9fed6724a05 | https://github.com/Stryker0301/google-image-extractor/blob/bd227f3f77cc82603b9ad7798c9af9fed6724a05/giextractor.py#L177-L195 | train |
Stryker0301/google-image-extractor | giextractor.py | GoogleImageExtractor._extract_image_urls | def _extract_image_urls(self):
"""Retrieves image URLs from the current page"""
resultsPage = self._chromeDriver.page_source
resultsPageSoup = BeautifulSoup(resultsPage, 'html.parser')
images = resultsPageSoup.find_all('div', class_='rg_meta')
images = [json.loads(image.content... | python | def _extract_image_urls(self):
"""Retrieves image URLs from the current page"""
resultsPage = self._chromeDriver.page_source
resultsPageSoup = BeautifulSoup(resultsPage, 'html.parser')
images = resultsPageSoup.find_all('div', class_='rg_meta')
images = [json.loads(image.content... | [
"def",
"_extract_image_urls",
"(",
"self",
")",
":",
"resultsPage",
"=",
"self",
".",
"_chromeDriver",
".",
"page_source",
"resultsPageSoup",
"=",
"BeautifulSoup",
"(",
"resultsPage",
",",
"'html.parser'",
")",
"images",
"=",
"resultsPageSoup",
".",
"find_all",
"(... | Retrieves image URLs from the current page | [
"Retrieves",
"image",
"URLs",
"from",
"the",
"current",
"page"
] | bd227f3f77cc82603b9ad7798c9af9fed6724a05 | https://github.com/Stryker0301/google-image-extractor/blob/bd227f3f77cc82603b9ad7798c9af9fed6724a05/giextractor.py#L197-L208 | train |
Stryker0301/google-image-extractor | giextractor.py | GoogleImageExtractor._page_scroll_down | def _page_scroll_down(self):
"""Scrolls down to get the next set of images"""
# Scroll down to request the next set of images
self._chromeDriver.execute_script(
'window.scroll(0, document.body.clientHeight)')
# Wait for the images to load completely
time.sleep(self.... | python | def _page_scroll_down(self):
"""Scrolls down to get the next set of images"""
# Scroll down to request the next set of images
self._chromeDriver.execute_script(
'window.scroll(0, document.body.clientHeight)')
# Wait for the images to load completely
time.sleep(self.... | [
"def",
"_page_scroll_down",
"(",
"self",
")",
":",
"self",
".",
"_chromeDriver",
".",
"execute_script",
"(",
"'window.scroll(0, document.body.clientHeight)'",
")",
"time",
".",
"sleep",
"(",
"self",
".",
"WAIT_TIME",
")",
"try",
":",
"self",
".",
"_chromeDriver",
... | Scrolls down to get the next set of images | [
"Scrolls",
"down",
"to",
"get",
"the",
"next",
"set",
"of",
"images"
] | bd227f3f77cc82603b9ad7798c9af9fed6724a05 | https://github.com/Stryker0301/google-image-extractor/blob/bd227f3f77cc82603b9ad7798c9af9fed6724a05/giextractor.py#L210-L226 | train |
Stryker0301/google-image-extractor | giextractor.py | GoogleImageExtractor._download_images | def _download_images(self):
"""
Downloads the images from the retrieved image URLs and
stores in the specified destination folder.
Multiprocessing is being used to minimize the download time
"""
print('\nDownloading Images for the Query: ' + self._imageQuery)
tr... | python | def _download_images(self):
"""
Downloads the images from the retrieved image URLs and
stores in the specified destination folder.
Multiprocessing is being used to minimize the download time
"""
print('\nDownloading Images for the Query: ' + self._imageQuery)
tr... | [
"def",
"_download_images",
"(",
"self",
")",
":",
"print",
"(",
"'\\nDownloading Images for the Query: '",
"+",
"self",
".",
"_imageQuery",
")",
"try",
":",
"self",
".",
"_initialize_progress_bar",
"(",
")",
"threadPool",
"=",
"Pool",
"(",
"self",
".",
"_threadC... | Downloads the images from the retrieved image URLs and
stores in the specified destination folder.
Multiprocessing is being used to minimize the download time | [
"Downloads",
"the",
"images",
"from",
"the",
"retrieved",
"image",
"URLs",
"and",
"stores",
"in",
"the",
"specified",
"destination",
"folder",
".",
"Multiprocessing",
"is",
"being",
"used",
"to",
"minimize",
"the",
"download",
"time"
] | bd227f3f77cc82603b9ad7798c9af9fed6724a05 | https://github.com/Stryker0301/google-image-extractor/blob/bd227f3f77cc82603b9ad7798c9af9fed6724a05/giextractor.py#L228-L253 | train |
Stryker0301/google-image-extractor | giextractor.py | GoogleImageExtractor._initialize_progress_bar | def _initialize_progress_bar(self):
"""Initializes the progress bar"""
widgets = ['Download: ', Percentage(), ' ', Bar(),
' ', AdaptiveETA(), ' ', FileTransferSpeed()]
self._downloadProgressBar = ProgressBar(
widgets=widgets, max_value=self._imageCount).start() | python | def _initialize_progress_bar(self):
"""Initializes the progress bar"""
widgets = ['Download: ', Percentage(), ' ', Bar(),
' ', AdaptiveETA(), ' ', FileTransferSpeed()]
self._downloadProgressBar = ProgressBar(
widgets=widgets, max_value=self._imageCount).start() | [
"def",
"_initialize_progress_bar",
"(",
"self",
")",
":",
"widgets",
"=",
"[",
"'Download: '",
",",
"Percentage",
"(",
")",
",",
"' '",
",",
"Bar",
"(",
")",
",",
"' '",
",",
"AdaptiveETA",
"(",
")",
",",
"' '",
",",
"FileTransferSpeed",
"(",
")",
"]",... | Initializes the progress bar | [
"Initializes",
"the",
"progress",
"bar"
] | bd227f3f77cc82603b9ad7798c9af9fed6724a05 | https://github.com/Stryker0301/google-image-extractor/blob/bd227f3f77cc82603b9ad7798c9af9fed6724a05/giextractor.py#L255-L262 | train |
Stryker0301/google-image-extractor | giextractor.py | GoogleImageExtractor._download_image | def _download_image(self, imageURL):
"""
Downloads an image file from the given image URL
Arguments:
imageURL {[str]} -- [Image URL]
"""
# If the required count of images have been download,
# refrain from downloading the remainder of the images
if(s... | python | def _download_image(self, imageURL):
"""
Downloads an image file from the given image URL
Arguments:
imageURL {[str]} -- [Image URL]
"""
# If the required count of images have been download,
# refrain from downloading the remainder of the images
if(s... | [
"def",
"_download_image",
"(",
"self",
",",
"imageURL",
")",
":",
"if",
"(",
"self",
".",
"_imageCounter",
">=",
"self",
".",
"_imageCount",
")",
":",
"return",
"try",
":",
"imageResponse",
"=",
"requests",
".",
"get",
"(",
"imageURL",
")",
"imageType",
... | Downloads an image file from the given image URL
Arguments:
imageURL {[str]} -- [Image URL] | [
"Downloads",
"an",
"image",
"file",
"from",
"the",
"given",
"image",
"URL"
] | bd227f3f77cc82603b9ad7798c9af9fed6724a05 | https://github.com/Stryker0301/google-image-extractor/blob/bd227f3f77cc82603b9ad7798c9af9fed6724a05/giextractor.py#L264-L301 | train |
bitesofcode/projexui | projexui/widgets/xloaderwidget.py | XLoaderWidget.increment | def increment(self, amount=1):
"""
Increments the main progress bar by amount.
"""
self._primaryProgressBar.setValue(self.value() + amount)
QApplication.instance().processEvents() | python | def increment(self, amount=1):
"""
Increments the main progress bar by amount.
"""
self._primaryProgressBar.setValue(self.value() + amount)
QApplication.instance().processEvents() | [
"def",
"increment",
"(",
"self",
",",
"amount",
"=",
"1",
")",
":",
"self",
".",
"_primaryProgressBar",
".",
"setValue",
"(",
"self",
".",
"value",
"(",
")",
"+",
"amount",
")",
"QApplication",
".",
"instance",
"(",
")",
".",
"processEvents",
"(",
")"
... | Increments the main progress bar by amount. | [
"Increments",
"the",
"main",
"progress",
"bar",
"by",
"amount",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xloaderwidget.py#L195-L200 | train |
bitesofcode/projexui | projexui/widgets/xloaderwidget.py | XLoaderWidget.incrementSub | def incrementSub(self, amount=1):
"""
Increments the sub-progress bar by amount.
"""
self._subProgressBar.setValue(self.subValue() + amount)
QApplication.instance().processEvents() | python | def incrementSub(self, amount=1):
"""
Increments the sub-progress bar by amount.
"""
self._subProgressBar.setValue(self.subValue() + amount)
QApplication.instance().processEvents() | [
"def",
"incrementSub",
"(",
"self",
",",
"amount",
"=",
"1",
")",
":",
"self",
".",
"_subProgressBar",
".",
"setValue",
"(",
"self",
".",
"subValue",
"(",
")",
"+",
"amount",
")",
"QApplication",
".",
"instance",
"(",
")",
".",
"processEvents",
"(",
")... | Increments the sub-progress bar by amount. | [
"Increments",
"the",
"sub",
"-",
"progress",
"bar",
"by",
"amount",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xloaderwidget.py#L202-L207 | train |
bitesofcode/projexui | projexui/widgets/xchart/xchart.py | XChart.assignRenderer | def assignRenderer(self, action):
"""
Assigns the renderer for this chart to the current selected
renderer.
"""
name = nativestring(action.text()).split(' ')[0]
self._renderer = XChartRenderer.plugin(name)
self.uiTypeBTN.setDefaultAction(action)
se... | python | def assignRenderer(self, action):
"""
Assigns the renderer for this chart to the current selected
renderer.
"""
name = nativestring(action.text()).split(' ')[0]
self._renderer = XChartRenderer.plugin(name)
self.uiTypeBTN.setDefaultAction(action)
se... | [
"def",
"assignRenderer",
"(",
"self",
",",
"action",
")",
":",
"name",
"=",
"nativestring",
"(",
"action",
".",
"text",
"(",
")",
")",
".",
"split",
"(",
"' '",
")",
"[",
"0",
"]",
"self",
".",
"_renderer",
"=",
"XChartRenderer",
".",
"plugin",
"(",
... | Assigns the renderer for this chart to the current selected
renderer. | [
"Assigns",
"the",
"renderer",
"for",
"this",
"chart",
"to",
"the",
"current",
"selected",
"renderer",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchart.py#L235-L243 | train |
bitesofcode/projexui | projexui/widgets/xchart/xchart.py | XChart.recalculate | def recalculate(self):
"""
Recalculates the information for this chart.
"""
if not (self.isVisible() and self.renderer()):
return
# update dynamic range
if self._dataChanged:
for axis in self.axes():
if axis.useDy... | python | def recalculate(self):
"""
Recalculates the information for this chart.
"""
if not (self.isVisible() and self.renderer()):
return
# update dynamic range
if self._dataChanged:
for axis in self.axes():
if axis.useDy... | [
"def",
"recalculate",
"(",
"self",
")",
":",
"if",
"not",
"(",
"self",
".",
"isVisible",
"(",
")",
"and",
"self",
".",
"renderer",
"(",
")",
")",
":",
"return",
"if",
"self",
".",
"_dataChanged",
":",
"for",
"axis",
"in",
"self",
".",
"axes",
"(",
... | Recalculates the information for this chart. | [
"Recalculates",
"the",
"information",
"for",
"this",
"chart",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchart.py#L369-L420 | train |
bitesofcode/projexui | projexui/widgets/xchart/xchart.py | XChart.syncScrollbars | def syncScrollbars(self):
"""
Synchronizes the various scrollbars within this chart.
"""
chart_hbar = self.uiChartVIEW.horizontalScrollBar()
chart_vbar = self.uiChartVIEW.verticalScrollBar()
x_hbar = self.uiXAxisVIEW.horizontalScrollBar()
x_vbar =... | python | def syncScrollbars(self):
"""
Synchronizes the various scrollbars within this chart.
"""
chart_hbar = self.uiChartVIEW.horizontalScrollBar()
chart_vbar = self.uiChartVIEW.verticalScrollBar()
x_hbar = self.uiXAxisVIEW.horizontalScrollBar()
x_vbar =... | [
"def",
"syncScrollbars",
"(",
"self",
")",
":",
"chart_hbar",
"=",
"self",
".",
"uiChartVIEW",
".",
"horizontalScrollBar",
"(",
")",
"chart_vbar",
"=",
"self",
".",
"uiChartVIEW",
".",
"verticalScrollBar",
"(",
")",
"x_hbar",
"=",
"self",
".",
"uiXAxisVIEW",
... | Synchronizes the various scrollbars within this chart. | [
"Synchronizes",
"the",
"various",
"scrollbars",
"within",
"this",
"chart",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchart/xchart.py#L692-L712 | train |
johnnoone/aioconsul | aioconsul/client/catalog_endpoint.py | CatalogEndpoint.deregister | async def deregister(self, node, *,
check=None, service=None, write_token=None):
"""Deregisters a node, service or check
Parameters:
node (Object or ObjectID): Node
check (ObjectID): Check ID
service (ObjectID): Service ID
write_t... | python | async def deregister(self, node, *,
check=None, service=None, write_token=None):
"""Deregisters a node, service or check
Parameters:
node (Object or ObjectID): Node
check (ObjectID): Check ID
service (ObjectID): Service ID
write_t... | [
"async",
"def",
"deregister",
"(",
"self",
",",
"node",
",",
"*",
",",
"check",
"=",
"None",
",",
"service",
"=",
"None",
",",
"write_token",
"=",
"None",
")",
":",
"entry",
"=",
"{",
"}",
"if",
"isinstance",
"(",
"node",
",",
"str",
")",
":",
"e... | Deregisters a node, service or check
Parameters:
node (Object or ObjectID): Node
check (ObjectID): Check ID
service (ObjectID): Service ID
write_token (ObjectID): Token ID
Returns:
bool: ``True`` on success
**Node** expects a body tha... | [
"Deregisters",
"a",
"node",
"service",
"or",
"check"
] | 02f7a529d7dc2e49bed942111067aa5faf320e90 | https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/catalog_endpoint.py#L193-L266 | train |
johnnoone/aioconsul | aioconsul/client/catalog_endpoint.py | CatalogEndpoint.nodes | async def nodes(self, *,
dc=None, near=None, watch=None, consistency=None):
"""Lists nodes in a given DC
Parameters:
dc (str): Specify datacenter that will be used.
Defaults to the agent's local datacenter.
near (str): Sort the node list... | python | async def nodes(self, *,
dc=None, near=None, watch=None, consistency=None):
"""Lists nodes in a given DC
Parameters:
dc (str): Specify datacenter that will be used.
Defaults to the agent's local datacenter.
near (str): Sort the node list... | [
"async",
"def",
"nodes",
"(",
"self",
",",
"*",
",",
"dc",
"=",
"None",
",",
"near",
"=",
"None",
",",
"watch",
"=",
"None",
",",
"consistency",
"=",
"None",
")",
":",
"params",
"=",
"{",
"\"dc\"",
":",
"dc",
",",
"\"near\"",
":",
"near",
"}",
... | Lists nodes in a given DC
Parameters:
dc (str): Specify datacenter that will be used.
Defaults to the agent's local datacenter.
near (str): Sort the node list in ascending order based on the
estimated round trip time from that node.
... | [
"Lists",
"nodes",
"in",
"a",
"given",
"DC"
] | 02f7a529d7dc2e49bed942111067aa5faf320e90 | https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/catalog_endpoint.py#L288-L328 | train |
johnnoone/aioconsul | aioconsul/client/catalog_endpoint.py | CatalogEndpoint.services | async def services(self, *, dc=None, watch=None, consistency=None):
"""Lists services in a given DC
Parameters:
dc (str): Specify datacenter that will be used.
Defaults to the agent's local datacenter.
watch (Blocking): Do a blocking query
consi... | python | async def services(self, *, dc=None, watch=None, consistency=None):
"""Lists services in a given DC
Parameters:
dc (str): Specify datacenter that will be used.
Defaults to the agent's local datacenter.
watch (Blocking): Do a blocking query
consi... | [
"async",
"def",
"services",
"(",
"self",
",",
"*",
",",
"dc",
"=",
"None",
",",
"watch",
"=",
"None",
",",
"consistency",
"=",
"None",
")",
":",
"params",
"=",
"{",
"\"dc\"",
":",
"dc",
"}",
"response",
"=",
"await",
"self",
".",
"_api",
".",
"ge... | Lists services in a given DC
Parameters:
dc (str): Specify datacenter that will be used.
Defaults to the agent's local datacenter.
watch (Blocking): Do a blocking query
consistency (Consistency): Force consistency
Returns:
ObjectMeta... | [
"Lists",
"services",
"in",
"a",
"given",
"DC"
] | 02f7a529d7dc2e49bed942111067aa5faf320e90 | https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/catalog_endpoint.py#L330-L360 | train |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofiletoolbar.py | XViewProfileToolBar.createProfile | def createProfile(self, profile=None, clearLayout=True):
"""
Prompts the user to create a new profile.
"""
if profile:
prof = profile
elif not self.viewWidget() or clearLayout:
prof = XViewProfile()
else:
prof = self.viewWidget... | python | def createProfile(self, profile=None, clearLayout=True):
"""
Prompts the user to create a new profile.
"""
if profile:
prof = profile
elif not self.viewWidget() or clearLayout:
prof = XViewProfile()
else:
prof = self.viewWidget... | [
"def",
"createProfile",
"(",
"self",
",",
"profile",
"=",
"None",
",",
"clearLayout",
"=",
"True",
")",
":",
"if",
"profile",
":",
"prof",
"=",
"profile",
"elif",
"not",
"self",
".",
"viewWidget",
"(",
")",
"or",
"clearLayout",
":",
"prof",
"=",
"XView... | Prompts the user to create a new profile. | [
"Prompts",
"the",
"user",
"to",
"create",
"a",
"new",
"profile",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofiletoolbar.py#L164-L192 | train |
bitesofcode/projexui | projexui/widgets/xquerybuilderwidget/xquerybuilderwidget.py | XQueryBuilderWidget.updateRemoveEnabled | def updateRemoveEnabled( self ):
"""
Updates the remove enabled baesd on the current number of line widgets.
"""
lineWidgets = self.lineWidgets()
count = len(lineWidgets)
state = self.minimumCount() < count
for widget in lineWidgets:
... | python | def updateRemoveEnabled( self ):
"""
Updates the remove enabled baesd on the current number of line widgets.
"""
lineWidgets = self.lineWidgets()
count = len(lineWidgets)
state = self.minimumCount() < count
for widget in lineWidgets:
... | [
"def",
"updateRemoveEnabled",
"(",
"self",
")",
":",
"lineWidgets",
"=",
"self",
".",
"lineWidgets",
"(",
")",
"count",
"=",
"len",
"(",
"lineWidgets",
")",
"state",
"=",
"self",
".",
"minimumCount",
"(",
")",
"<",
"count",
"for",
"widget",
"in",
"lineWi... | Updates the remove enabled baesd on the current number of line widgets. | [
"Updates",
"the",
"remove",
"enabled",
"baesd",
"on",
"the",
"current",
"number",
"of",
"line",
"widgets",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xquerybuilderwidget/xquerybuilderwidget.py#L289-L298 | train |
bitesofcode/projexui | projexui/widgets/xquerybuilderwidget/xquerybuilderwidget.py | XQueryBuilderWidget.updateRules | def updateRules( self ):
"""
Updates the query line items to match the latest rule options.
"""
terms = sorted(self._rules.keys())
for child in self.lineWidgets():
child.setTerms(terms) | python | def updateRules( self ):
"""
Updates the query line items to match the latest rule options.
"""
terms = sorted(self._rules.keys())
for child in self.lineWidgets():
child.setTerms(terms) | [
"def",
"updateRules",
"(",
"self",
")",
":",
"terms",
"=",
"sorted",
"(",
"self",
".",
"_rules",
".",
"keys",
"(",
")",
")",
"for",
"child",
"in",
"self",
".",
"lineWidgets",
"(",
")",
":",
"child",
".",
"setTerms",
"(",
"terms",
")"
] | Updates the query line items to match the latest rule options. | [
"Updates",
"the",
"query",
"line",
"items",
"to",
"match",
"the",
"latest",
"rule",
"options",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xquerybuilderwidget/xquerybuilderwidget.py#L300-L306 | train |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofilemanager.py | XViewProfileManager.handleProfileChange | def handleProfileChange(self):
"""
Emits that the current profile has changed.
"""
# restore the profile settings
prof = self.currentProfile()
vwidget = self.viewWidget()
if vwidget:
prof.restore(vwidget)
if not self.signalsBlocked(... | python | def handleProfileChange(self):
"""
Emits that the current profile has changed.
"""
# restore the profile settings
prof = self.currentProfile()
vwidget = self.viewWidget()
if vwidget:
prof.restore(vwidget)
if not self.signalsBlocked(... | [
"def",
"handleProfileChange",
"(",
"self",
")",
":",
"prof",
"=",
"self",
".",
"currentProfile",
"(",
")",
"vwidget",
"=",
"self",
".",
"viewWidget",
"(",
")",
"if",
"vwidget",
":",
"prof",
".",
"restore",
"(",
"vwidget",
")",
"if",
"not",
"self",
".",... | Emits that the current profile has changed. | [
"Emits",
"that",
"the",
"current",
"profile",
"has",
"changed",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofilemanager.py#L89-L100 | train |
bitesofcode/projexui | projexui/widgets/xviewwidget/xviewprofilemanager.py | XViewProfileManager.showOptionsMenu | def showOptionsMenu(self):
"""
Displays the options menu. If the option menu policy is set to
CustomContextMenu, then the optionMenuRequested signal will be emitted,
otherwise the default context menu will be displayed.
"""
point = QPoint(0, self._optionsButton.h... | python | def showOptionsMenu(self):
"""
Displays the options menu. If the option menu policy is set to
CustomContextMenu, then the optionMenuRequested signal will be emitted,
otherwise the default context menu will be displayed.
"""
point = QPoint(0, self._optionsButton.h... | [
"def",
"showOptionsMenu",
"(",
"self",
")",
":",
"point",
"=",
"QPoint",
"(",
"0",
",",
"self",
".",
"_optionsButton",
".",
"height",
"(",
")",
")",
"global_point",
"=",
"self",
".",
"_optionsButton",
".",
"mapToGlobal",
"(",
"point",
")",
"if",
"self",
... | Displays the options menu. If the option menu policy is set to
CustomContextMenu, then the optionMenuRequested signal will be emitted,
otherwise the default context menu will be displayed. | [
"Displays",
"the",
"options",
"menu",
".",
"If",
"the",
"option",
"menu",
"policy",
"is",
"set",
"to",
"CustomContextMenu",
"then",
"the",
"optionMenuRequested",
"signal",
"will",
"be",
"emitted",
"otherwise",
"the",
"default",
"context",
"menu",
"will",
"be",
... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xviewwidget/xviewprofilemanager.py#L235-L252 | train |
bitesofcode/projexui | projexui/widgets/xsnapshotwidget.py | XSnapshotWidget.accept | def accept(self):
"""
Prompts the user for the filepath to save and then saves the image.
"""
filetypes = 'PNG Files (*.png);;JPG Files (*.jpg);;All Files (*.*)'
filename = QFileDialog.getSaveFileName(None,
'Save Snapshot',
... | python | def accept(self):
"""
Prompts the user for the filepath to save and then saves the image.
"""
filetypes = 'PNG Files (*.png);;JPG Files (*.jpg);;All Files (*.*)'
filename = QFileDialog.getSaveFileName(None,
'Save Snapshot',
... | [
"def",
"accept",
"(",
"self",
")",
":",
"filetypes",
"=",
"'PNG Files (*.png);;JPG Files (*.jpg);;All Files (*.*)'",
"filename",
"=",
"QFileDialog",
".",
"getSaveFileName",
"(",
"None",
",",
"'Save Snapshot'",
",",
"self",
".",
"filepath",
"(",
")",
",",
"filetypes"... | Prompts the user for the filepath to save and then saves the image. | [
"Prompts",
"the",
"user",
"for",
"the",
"filepath",
"to",
"save",
"and",
"then",
"saves",
"the",
"image",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsnapshotwidget.py#L46-L64 | train |
bitesofcode/projexui | projexui/widgets/xsnapshotwidget.py | XSnapshotWidget.reject | def reject(self):
"""
Rejects the snapshot and closes the widget.
"""
if self.hideWindow():
self.hideWindow().show()
self.close()
self.deleteLater() | python | def reject(self):
"""
Rejects the snapshot and closes the widget.
"""
if self.hideWindow():
self.hideWindow().show()
self.close()
self.deleteLater() | [
"def",
"reject",
"(",
"self",
")",
":",
"if",
"self",
".",
"hideWindow",
"(",
")",
":",
"self",
".",
"hideWindow",
"(",
")",
".",
"show",
"(",
")",
"self",
".",
"close",
"(",
")",
"self",
".",
"deleteLater",
"(",
")"
] | Rejects the snapshot and closes the widget. | [
"Rejects",
"the",
"snapshot",
"and",
"closes",
"the",
"widget",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsnapshotwidget.py#L144-L152 | train |
bitesofcode/projexui | projexui/widgets/xsnapshotwidget.py | XSnapshotWidget.save | def save(self):
"""
Saves the snapshot based on the current region.
"""
# close down the snapshot widget
if self.hideWindow():
self.hideWindow().hide()
self.hide()
QApplication.processEvents()
time.sleep(1)
... | python | def save(self):
"""
Saves the snapshot based on the current region.
"""
# close down the snapshot widget
if self.hideWindow():
self.hideWindow().hide()
self.hide()
QApplication.processEvents()
time.sleep(1)
... | [
"def",
"save",
"(",
"self",
")",
":",
"if",
"self",
".",
"hideWindow",
"(",
")",
":",
"self",
".",
"hideWindow",
"(",
")",
".",
"hide",
"(",
")",
"self",
".",
"hide",
"(",
")",
"QApplication",
".",
"processEvents",
"(",
")",
"time",
".",
"sleep",
... | Saves the snapshot based on the current region. | [
"Saves",
"the",
"snapshot",
"based",
"on",
"the",
"current",
"region",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsnapshotwidget.py#L162-L194 | train |
bitesofcode/projexui | projexui/widgets/xsnapshotwidget.py | XSnapshotWidget.show | def show(self):
"""
Shows this widget and hides the specified window if necessary.
"""
super(XSnapshotWidget, self).show()
if self.hideWindow():
self.hideWindow().hide()
QApplication.processEvents() | python | def show(self):
"""
Shows this widget and hides the specified window if necessary.
"""
super(XSnapshotWidget, self).show()
if self.hideWindow():
self.hideWindow().hide()
QApplication.processEvents() | [
"def",
"show",
"(",
"self",
")",
":",
"super",
"(",
"XSnapshotWidget",
",",
"self",
")",
".",
"show",
"(",
")",
"if",
"self",
".",
"hideWindow",
"(",
")",
":",
"self",
".",
"hideWindow",
"(",
")",
".",
"hide",
"(",
")",
"QApplication",
".",
"proces... | Shows this widget and hides the specified window if necessary. | [
"Shows",
"this",
"widget",
"and",
"hides",
"the",
"specified",
"window",
"if",
"necessary",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xsnapshotwidget.py#L196-L204 | train |
mikhaildubov/AST-text-analysis | east/applications.py | keyphrases_table | def keyphrases_table(keyphrases, texts, similarity_measure=None, synonimizer=None,
language=consts.Language.ENGLISH):
"""
Constructs the keyphrases table, containing their matching scores in a set of texts.
The resulting table is stored as a dictionary of dictionaries,
where the en... | python | def keyphrases_table(keyphrases, texts, similarity_measure=None, synonimizer=None,
language=consts.Language.ENGLISH):
"""
Constructs the keyphrases table, containing their matching scores in a set of texts.
The resulting table is stored as a dictionary of dictionaries,
where the en... | [
"def",
"keyphrases_table",
"(",
"keyphrases",
",",
"texts",
",",
"similarity_measure",
"=",
"None",
",",
"synonimizer",
"=",
"None",
",",
"language",
"=",
"consts",
".",
"Language",
".",
"ENGLISH",
")",
":",
"similarity_measure",
"=",
"similarity_measure",
"or",... | Constructs the keyphrases table, containing their matching scores in a set of texts.
The resulting table is stored as a dictionary of dictionaries,
where the entry table["keyphrase"]["text"] corresponds
to the matching score (0 <= score <= 1) of keyphrase "keyphrase"
in the text named "text".
... | [
"Constructs",
"the",
"keyphrases",
"table",
"containing",
"their",
"matching",
"scores",
"in",
"a",
"set",
"of",
"texts",
"."
] | 055ad8d2492c100bbbaa25309ec1074bdf1dfaa5 | https://github.com/mikhaildubov/AST-text-analysis/blob/055ad8d2492c100bbbaa25309ec1074bdf1dfaa5/east/applications.py#L11-L56 | train |
mikhaildubov/AST-text-analysis | east/applications.py | keyphrases_graph | def keyphrases_graph(keyphrases, texts, referral_confidence=0.6, relevance_threshold=0.25,
support_threshold=1, similarity_measure=None, synonimizer=None,
language=consts.Language.ENGLISH):
"""
Constructs the keyphrases relation graph based on the given texts corpus.
... | python | def keyphrases_graph(keyphrases, texts, referral_confidence=0.6, relevance_threshold=0.25,
support_threshold=1, similarity_measure=None, synonimizer=None,
language=consts.Language.ENGLISH):
"""
Constructs the keyphrases relation graph based on the given texts corpus.
... | [
"def",
"keyphrases_graph",
"(",
"keyphrases",
",",
"texts",
",",
"referral_confidence",
"=",
"0.6",
",",
"relevance_threshold",
"=",
"0.25",
",",
"support_threshold",
"=",
"1",
",",
"similarity_measure",
"=",
"None",
",",
"synonimizer",
"=",
"None",
",",
"langua... | Constructs the keyphrases relation graph based on the given texts corpus.
The graph construction algorithm is based on the analysis of co-occurrences of key phrases
in the text corpus. A key phrase is considered to imply another one if that second phrase
occurs frequently enough in the same texts as the fi... | [
"Constructs",
"the",
"keyphrases",
"relation",
"graph",
"based",
"on",
"the",
"given",
"texts",
"corpus",
"."
] | 055ad8d2492c100bbbaa25309ec1074bdf1dfaa5 | https://github.com/mikhaildubov/AST-text-analysis/blob/055ad8d2492c100bbbaa25309ec1074bdf1dfaa5/east/applications.py#L59-L149 | train |
core/uricore | uricore/wkz_internal.py | _decode_unicode | def _decode_unicode(value, charset, errors):
"""Like the regular decode function but this one raises an
`HTTPUnicodeError` if errors is `strict`."""
fallback = None
if errors.startswith('fallback:'):
fallback = errors[9:]
errors = 'strict'
try:
return value.decode(charset, er... | python | def _decode_unicode(value, charset, errors):
"""Like the regular decode function but this one raises an
`HTTPUnicodeError` if errors is `strict`."""
fallback = None
if errors.startswith('fallback:'):
fallback = errors[9:]
errors = 'strict'
try:
return value.decode(charset, er... | [
"def",
"_decode_unicode",
"(",
"value",
",",
"charset",
",",
"errors",
")",
":",
"fallback",
"=",
"None",
"if",
"errors",
".",
"startswith",
"(",
"'fallback:'",
")",
":",
"fallback",
"=",
"errors",
"[",
"9",
":",
"]",
"errors",
"=",
"'strict'",
"try",
... | Like the regular decode function but this one raises an
`HTTPUnicodeError` if errors is `strict`. | [
"Like",
"the",
"regular",
"decode",
"function",
"but",
"this",
"one",
"raises",
"an",
"HTTPUnicodeError",
"if",
"errors",
"is",
"strict",
"."
] | dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a | https://github.com/core/uricore/blob/dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a/uricore/wkz_internal.py#L12-L25 | train |
bitesofcode/projexui | projexui/widgets/xiconbutton.py | XIconButton.dropEvent | def dropEvent( self, event ):
"""
Handles a drop event.
"""
url = event.mimeData().urls()[0]
url_path = nativestring(url.toString())
# download an icon from the web
if ( not url_path.startswith('file:') ):
filename = os.path.basename... | python | def dropEvent( self, event ):
"""
Handles a drop event.
"""
url = event.mimeData().urls()[0]
url_path = nativestring(url.toString())
# download an icon from the web
if ( not url_path.startswith('file:') ):
filename = os.path.basename... | [
"def",
"dropEvent",
"(",
"self",
",",
"event",
")",
":",
"url",
"=",
"event",
".",
"mimeData",
"(",
")",
".",
"urls",
"(",
")",
"[",
"0",
"]",
"url_path",
"=",
"nativestring",
"(",
"url",
".",
"toString",
"(",
")",
")",
"if",
"(",
"not",
"url_pat... | Handles a drop event. | [
"Handles",
"a",
"drop",
"event",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xiconbutton.py#L90-L109 | train |
bitesofcode/projexui | projexui/widgets/xiconbutton.py | XIconButton.pickFilepath | def pickFilepath( self ):
"""
Picks the image file to use for this icon path.
"""
filepath = QFileDialog.getOpenFileName( self,
'Select Image File',
QDir.currentPath(),
... | python | def pickFilepath( self ):
"""
Picks the image file to use for this icon path.
"""
filepath = QFileDialog.getOpenFileName( self,
'Select Image File',
QDir.currentPath(),
... | [
"def",
"pickFilepath",
"(",
"self",
")",
":",
"filepath",
"=",
"QFileDialog",
".",
"getOpenFileName",
"(",
"self",
",",
"'Select Image File'",
",",
"QDir",
".",
"currentPath",
"(",
")",
",",
"self",
".",
"fileTypes",
"(",
")",
")",
"if",
"type",
"(",
"fi... | Picks the image file to use for this icon path. | [
"Picks",
"the",
"image",
"file",
"to",
"use",
"for",
"this",
"icon",
"path",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xiconbutton.py#L111-L124 | train |
johnnoone/aioconsul | aioconsul/client/event_endpoint.py | EventEndpoint.fire | async def fire(self, name, payload=None, *,
dc=None, node=None, service=None, tag=None):
"""Fires a new event
Parameters:
name (str): Event name
payload (Payload): Opaque data
node (Filter): Regular expression to filter by node name
ser... | python | async def fire(self, name, payload=None, *,
dc=None, node=None, service=None, tag=None):
"""Fires a new event
Parameters:
name (str): Event name
payload (Payload): Opaque data
node (Filter): Regular expression to filter by node name
ser... | [
"async",
"def",
"fire",
"(",
"self",
",",
"name",
",",
"payload",
"=",
"None",
",",
"*",
",",
"dc",
"=",
"None",
",",
"node",
"=",
"None",
",",
"service",
"=",
"None",
",",
"tag",
"=",
"None",
")",
":",
"params",
"=",
"{",
"\"dc\"",
":",
"dc",
... | Fires a new event
Parameters:
name (str): Event name
payload (Payload): Opaque data
node (Filter): Regular expression to filter by node name
service (Filter): Regular expression to filter by service
tag (Filter): Regular expression to filter by servic... | [
"Fires",
"a",
"new",
"event"
] | 02f7a529d7dc2e49bed942111067aa5faf320e90 | https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/event_endpoint.py#L10-L53 | train |
johnnoone/aioconsul | aioconsul/client/event_endpoint.py | EventEndpoint.items | async def items(self, name=None, *, watch=None):
"""Lists the most recent events an agent has seen
Parameters:
name (str): Filter events by name.
watch (Blocking): Do a blocking query
Returns:
CollectionMeta: where value is a list of events
It return... | python | async def items(self, name=None, *, watch=None):
"""Lists the most recent events an agent has seen
Parameters:
name (str): Filter events by name.
watch (Blocking): Do a blocking query
Returns:
CollectionMeta: where value is a list of events
It return... | [
"async",
"def",
"items",
"(",
"self",
",",
"name",
"=",
"None",
",",
"*",
",",
"watch",
"=",
"None",
")",
":",
"path",
"=",
"\"/v1/event/list\"",
"params",
"=",
"{",
"\"name\"",
":",
"name",
"}",
"response",
"=",
"await",
"self",
".",
"_api",
".",
... | Lists the most recent events an agent has seen
Parameters:
name (str): Filter events by name.
watch (Blocking): Do a blocking query
Returns:
CollectionMeta: where value is a list of events
It returns a JSON body like this::
[
{
... | [
"Lists",
"the",
"most",
"recent",
"events",
"an",
"agent",
"has",
"seen"
] | 02f7a529d7dc2e49bed942111067aa5faf320e90 | https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/event_endpoint.py#L55-L84 | train |
bitesofcode/projexui | projexui/widgets/xorbtreewidget/xorbrecorditem.py | XOrbRecordItem.updateRecordValues | def updateRecordValues(self):
"""
Updates the ui to show the latest record values.
"""
record = self.record()
if not record:
return
# update the record information
tree = self.treeWidget()
if not isinstance(tree, XTreeWidget)... | python | def updateRecordValues(self):
"""
Updates the ui to show the latest record values.
"""
record = self.record()
if not record:
return
# update the record information
tree = self.treeWidget()
if not isinstance(tree, XTreeWidget)... | [
"def",
"updateRecordValues",
"(",
"self",
")",
":",
"record",
"=",
"self",
".",
"record",
"(",
")",
"if",
"not",
"record",
":",
"return",
"tree",
"=",
"self",
".",
"treeWidget",
"(",
")",
"if",
"not",
"isinstance",
"(",
"tree",
",",
"XTreeWidget",
")",... | Updates the ui to show the latest record values. | [
"Updates",
"the",
"ui",
"to",
"show",
"the",
"latest",
"record",
"values",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbtreewidget/xorbrecorditem.py#L288-L318 | train |
andylockran/heatmiserV3 | heatmiserV3/heatmiser.py | CRC16.extract_bits | def extract_bits(self, val):
"""Extras the 4 bits, XORS the message data, and does table lookups."""
# Step one, extract the Most significant 4 bits of the CRC register
thisval = self.high >> 4
# XOR in the Message Data into the extracted bits
thisval = thisval ^ val
... | python | def extract_bits(self, val):
"""Extras the 4 bits, XORS the message data, and does table lookups."""
# Step one, extract the Most significant 4 bits of the CRC register
thisval = self.high >> 4
# XOR in the Message Data into the extracted bits
thisval = thisval ^ val
... | [
"def",
"extract_bits",
"(",
"self",
",",
"val",
")",
":",
"thisval",
"=",
"self",
".",
"high",
">>",
"4",
"thisval",
"=",
"thisval",
"^",
"val",
"self",
".",
"high",
"=",
"(",
"self",
".",
"high",
"<<",
"4",
")",
"|",
"(",
"self",
".",
"low",
"... | Extras the 4 bits, XORS the message data, and does table lookups. | [
"Extras",
"the",
"4",
"bits",
"XORS",
"the",
"message",
"data",
"and",
"does",
"table",
"lookups",
"."
] | bd8638f5fd1f85d16c908020252f58a0cc4f6ac0 | https://github.com/andylockran/heatmiserV3/blob/bd8638f5fd1f85d16c908020252f58a0cc4f6ac0/heatmiserV3/heatmiser.py#L37-L52 | train |
andylockran/heatmiserV3 | heatmiserV3/heatmiser.py | CRC16.run | def run(self, message):
"""Calculates a CRC"""
for value in message:
self.update(value)
return [self.low, self.high] | python | def run(self, message):
"""Calculates a CRC"""
for value in message:
self.update(value)
return [self.low, self.high] | [
"def",
"run",
"(",
"self",
",",
"message",
")",
":",
"for",
"value",
"in",
"message",
":",
"self",
".",
"update",
"(",
"value",
")",
"return",
"[",
"self",
".",
"low",
",",
"self",
".",
"high",
"]"
] | Calculates a CRC | [
"Calculates",
"a",
"CRC"
] | bd8638f5fd1f85d16c908020252f58a0cc4f6ac0 | https://github.com/andylockran/heatmiserV3/blob/bd8638f5fd1f85d16c908020252f58a0cc4f6ac0/heatmiserV3/heatmiser.py#L59-L63 | train |
andylockran/heatmiserV3 | heatmiserV3/heatmiser.py | HeatmiserThermostat._hm_form_message | def _hm_form_message(
self,
thermostat_id,
protocol,
source,
function,
start,
payload
):
"""Forms a message payload, excluding CRC"""
if protocol == constants.HMV3_ID:
start_low = (start & cons... | python | def _hm_form_message(
self,
thermostat_id,
protocol,
source,
function,
start,
payload
):
"""Forms a message payload, excluding CRC"""
if protocol == constants.HMV3_ID:
start_low = (start & cons... | [
"def",
"_hm_form_message",
"(",
"self",
",",
"thermostat_id",
",",
"protocol",
",",
"source",
",",
"function",
",",
"start",
",",
"payload",
")",
":",
"if",
"protocol",
"==",
"constants",
".",
"HMV3_ID",
":",
"start_low",
"=",
"(",
"start",
"&",
"constants... | Forms a message payload, excluding CRC | [
"Forms",
"a",
"message",
"payload",
"excluding",
"CRC"
] | bd8638f5fd1f85d16c908020252f58a0cc4f6ac0 | https://github.com/andylockran/heatmiserV3/blob/bd8638f5fd1f85d16c908020252f58a0cc4f6ac0/heatmiserV3/heatmiser.py#L80-L117 | train |
andylockran/heatmiserV3 | heatmiserV3/heatmiser.py | HeatmiserThermostat._hm_form_message_crc | def _hm_form_message_crc(
self,
thermostat_id,
protocol,
source,
function,
start,
payload
):
"""Forms a message payload, including CRC"""
data = self._hm_form_message(
thermostat_id, protocol, ... | python | def _hm_form_message_crc(
self,
thermostat_id,
protocol,
source,
function,
start,
payload
):
"""Forms a message payload, including CRC"""
data = self._hm_form_message(
thermostat_id, protocol, ... | [
"def",
"_hm_form_message_crc",
"(",
"self",
",",
"thermostat_id",
",",
"protocol",
",",
"source",
",",
"function",
",",
"start",
",",
"payload",
")",
":",
"data",
"=",
"self",
".",
"_hm_form_message",
"(",
"thermostat_id",
",",
"protocol",
",",
"source",
","... | Forms a message payload, including CRC | [
"Forms",
"a",
"message",
"payload",
"including",
"CRC"
] | bd8638f5fd1f85d16c908020252f58a0cc4f6ac0 | https://github.com/andylockran/heatmiserV3/blob/bd8638f5fd1f85d16c908020252f58a0cc4f6ac0/heatmiserV3/heatmiser.py#L119-L133 | train |
andylockran/heatmiserV3 | heatmiserV3/heatmiser.py | HeatmiserThermostat._hm_verify_message_crc_uk | def _hm_verify_message_crc_uk(
self,
thermostat_id,
protocol,
source,
expectedFunction,
expectedLength,
datal
):
"""Verifies message appears legal"""
# expectedLength only used for read msgs as always 7 for... | python | def _hm_verify_message_crc_uk(
self,
thermostat_id,
protocol,
source,
expectedFunction,
expectedLength,
datal
):
"""Verifies message appears legal"""
# expectedLength only used for read msgs as always 7 for... | [
"def",
"_hm_verify_message_crc_uk",
"(",
"self",
",",
"thermostat_id",
",",
"protocol",
",",
"source",
",",
"expectedFunction",
",",
"expectedLength",
",",
"datal",
")",
":",
"badresponse",
"=",
"0",
"if",
"protocol",
"==",
"constants",
".",
"HMV3_ID",
":",
"c... | Verifies message appears legal | [
"Verifies",
"message",
"appears",
"legal"
] | bd8638f5fd1f85d16c908020252f58a0cc4f6ac0 | https://github.com/andylockran/heatmiserV3/blob/bd8638f5fd1f85d16c908020252f58a0cc4f6ac0/heatmiserV3/heatmiser.py#L135-L238 | train |
andylockran/heatmiserV3 | heatmiserV3/heatmiser.py | HeatmiserThermostat._hm_send_msg | def _hm_send_msg(self, message):
"""This is the only interface to the serial connection."""
try:
serial_message = message
self.conn.write(serial_message) # Write a string
except serial.SerialTimeoutException:
serror = "Write timeout error: \n"
... | python | def _hm_send_msg(self, message):
"""This is the only interface to the serial connection."""
try:
serial_message = message
self.conn.write(serial_message) # Write a string
except serial.SerialTimeoutException:
serror = "Write timeout error: \n"
... | [
"def",
"_hm_send_msg",
"(",
"self",
",",
"message",
")",
":",
"try",
":",
"serial_message",
"=",
"message",
"self",
".",
"conn",
".",
"write",
"(",
"serial_message",
")",
"except",
"serial",
".",
"SerialTimeoutException",
":",
"serror",
"=",
"\"Write timeout e... | This is the only interface to the serial connection. | [
"This",
"is",
"the",
"only",
"interface",
"to",
"the",
"serial",
"connection",
"."
] | bd8638f5fd1f85d16c908020252f58a0cc4f6ac0 | https://github.com/andylockran/heatmiserV3/blob/bd8638f5fd1f85d16c908020252f58a0cc4f6ac0/heatmiserV3/heatmiser.py#L240-L252 | train |
andylockran/heatmiserV3 | heatmiserV3/heatmiser.py | HeatmiserThermostat._hm_read_address | def _hm_read_address(self):
"""Reads from the DCB and maps to yaml config file."""
response = self._hm_send_address(self.address, 0, 0, 0)
lookup = self.config['keys']
offset = self.config['offset']
keydata = {}
for i in lookup:
try:
kd... | python | def _hm_read_address(self):
"""Reads from the DCB and maps to yaml config file."""
response = self._hm_send_address(self.address, 0, 0, 0)
lookup = self.config['keys']
offset = self.config['offset']
keydata = {}
for i in lookup:
try:
kd... | [
"def",
"_hm_read_address",
"(",
"self",
")",
":",
"response",
"=",
"self",
".",
"_hm_send_address",
"(",
"self",
".",
"address",
",",
"0",
",",
"0",
",",
"0",
")",
"lookup",
"=",
"self",
".",
"config",
"[",
"'keys'",
"]",
"offset",
"=",
"self",
".",
... | Reads from the DCB and maps to yaml config file. | [
"Reads",
"from",
"the",
"DCB",
"and",
"maps",
"to",
"yaml",
"config",
"file",
"."
] | bd8638f5fd1f85d16c908020252f58a0cc4f6ac0 | https://github.com/andylockran/heatmiserV3/blob/bd8638f5fd1f85d16c908020252f58a0cc4f6ac0/heatmiserV3/heatmiser.py#L284-L300 | train |
andylockran/heatmiserV3 | heatmiserV3/heatmiser.py | HeatmiserThermostat.read_dcb | def read_dcb(self):
"""
Returns the full DCB, only use for non read-only operations
Use self.dcb for read-only operations.
"""
logging.info("Getting latest data from DCB....")
self.dcb = self._hm_read_address()
return self.dcb | python | def read_dcb(self):
"""
Returns the full DCB, only use for non read-only operations
Use self.dcb for read-only operations.
"""
logging.info("Getting latest data from DCB....")
self.dcb = self._hm_read_address()
return self.dcb | [
"def",
"read_dcb",
"(",
"self",
")",
":",
"logging",
".",
"info",
"(",
"\"Getting latest data from DCB....\"",
")",
"self",
".",
"dcb",
"=",
"self",
".",
"_hm_read_address",
"(",
")",
"return",
"self",
".",
"dcb"
] | Returns the full DCB, only use for non read-only operations
Use self.dcb for read-only operations. | [
"Returns",
"the",
"full",
"DCB",
"only",
"use",
"for",
"non",
"read",
"-",
"only",
"operations",
"Use",
"self",
".",
"dcb",
"for",
"read",
"-",
"only",
"operations",
"."
] | bd8638f5fd1f85d16c908020252f58a0cc4f6ac0 | https://github.com/andylockran/heatmiserV3/blob/bd8638f5fd1f85d16c908020252f58a0cc4f6ac0/heatmiserV3/heatmiser.py#L302-L309 | train |
andylockran/heatmiserV3 | heatmiserV3/heatmiser.py | HeatmiserThermostat.set_target_temp | def set_target_temp(self, temperature):
"""
Sets the target temperature, to the requested int
"""
if 35 < temperature < 5:
logging.info("Refusing to set temp outside of allowed range")
return False
else:
self._hm_send_address(self.addre... | python | def set_target_temp(self, temperature):
"""
Sets the target temperature, to the requested int
"""
if 35 < temperature < 5:
logging.info("Refusing to set temp outside of allowed range")
return False
else:
self._hm_send_address(self.addre... | [
"def",
"set_target_temp",
"(",
"self",
",",
"temperature",
")",
":",
"if",
"35",
"<",
"temperature",
"<",
"5",
":",
"logging",
".",
"info",
"(",
"\"Refusing to set temp outside of allowed range\"",
")",
"return",
"False",
"else",
":",
"self",
".",
"_hm_send_addr... | Sets the target temperature, to the requested int | [
"Sets",
"the",
"target",
"temperature",
"to",
"the",
"requested",
"int"
] | bd8638f5fd1f85d16c908020252f58a0cc4f6ac0 | https://github.com/andylockran/heatmiserV3/blob/bd8638f5fd1f85d16c908020252f58a0cc4f6ac0/heatmiserV3/heatmiser.py#L384-L393 | train |
johnnoone/aioconsul | aioconsul/client/health_endpoint.py | HealthEndpoint.node | async def node(self, node, *, dc=None, watch=None, consistency=None):
"""Returns the health info of a node.
Parameters:
node (ObjectID): Node ID
dc (str): Specify datacenter that will be used.
Defaults to the agent's local datacenter.
watch (Blo... | python | async def node(self, node, *, dc=None, watch=None, consistency=None):
"""Returns the health info of a node.
Parameters:
node (ObjectID): Node ID
dc (str): Specify datacenter that will be used.
Defaults to the agent's local datacenter.
watch (Blo... | [
"async",
"def",
"node",
"(",
"self",
",",
"node",
",",
"*",
",",
"dc",
"=",
"None",
",",
"watch",
"=",
"None",
",",
"consistency",
"=",
"None",
")",
":",
"node_id",
"=",
"extract_attr",
"(",
"node",
",",
"keys",
"=",
"[",
"\"Node\"",
",",
"\"ID\"",... | Returns the health info of a node.
Parameters:
node (ObjectID): Node ID
dc (str): Specify datacenter that will be used.
Defaults to the agent's local datacenter.
watch (Blocking): Do a blocking query
consistency (Consistency): Force consiste... | [
"Returns",
"the",
"health",
"info",
"of",
"a",
"node",
"."
] | 02f7a529d7dc2e49bed942111067aa5faf320e90 | https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/health_endpoint.py#L16-L69 | train |
johnnoone/aioconsul | aioconsul/client/health_endpoint.py | HealthEndpoint.checks | async def checks(self, service, *,
dc=None, near=None, watch=None, consistency=None):
"""Returns the checks of a service
Parameters:
dc (str): Specify datacenter that will be used.
Defaults to the agent's local datacenter.
near (str): W... | python | async def checks(self, service, *,
dc=None, near=None, watch=None, consistency=None):
"""Returns the checks of a service
Parameters:
dc (str): Specify datacenter that will be used.
Defaults to the agent's local datacenter.
near (str): W... | [
"async",
"def",
"checks",
"(",
"self",
",",
"service",
",",
"*",
",",
"dc",
"=",
"None",
",",
"near",
"=",
"None",
",",
"watch",
"=",
"None",
",",
"consistency",
"=",
"None",
")",
":",
"service_id",
"=",
"extract_attr",
"(",
"service",
",",
"keys",
... | Returns the checks of a service
Parameters:
dc (str): Specify datacenter that will be used.
Defaults to the agent's local datacenter.
near (str): With a node name will sort the node list in ascending
order based on the estimated round trip t... | [
"Returns",
"the",
"checks",
"of",
"a",
"service"
] | 02f7a529d7dc2e49bed942111067aa5faf320e90 | https://github.com/johnnoone/aioconsul/blob/02f7a529d7dc2e49bed942111067aa5faf320e90/aioconsul/client/health_endpoint.py#L71-L92 | train |
core/uricore | uricore/wkz_wsgi.py | make_limited_stream | def make_limited_stream(stream, limit):
"""Makes a stream limited."""
if not isinstance(stream, LimitedStream):
if limit is None:
raise TypeError('stream not limited and no limit provided.')
stream = LimitedStream(stream, limit)
return stream | python | def make_limited_stream(stream, limit):
"""Makes a stream limited."""
if not isinstance(stream, LimitedStream):
if limit is None:
raise TypeError('stream not limited and no limit provided.')
stream = LimitedStream(stream, limit)
return stream | [
"def",
"make_limited_stream",
"(",
"stream",
",",
"limit",
")",
":",
"if",
"not",
"isinstance",
"(",
"stream",
",",
"LimitedStream",
")",
":",
"if",
"limit",
"is",
"None",
":",
"raise",
"TypeError",
"(",
"'stream not limited and no limit provided.'",
")",
"strea... | Makes a stream limited. | [
"Makes",
"a",
"stream",
"limited",
"."
] | dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a | https://github.com/core/uricore/blob/dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a/uricore/wkz_wsgi.py#L172-L178 | train |
core/uricore | uricore/wkz_wsgi.py | LimitedStream.exhaust | def exhaust(self, chunk_size=1024 * 16):
"""Exhaust the stream. This consumes all the data left until the
limit is reached.
:param chunk_size: the size for a chunk. It will read the chunk
until the stream is exhausted and throw away
the re... | python | def exhaust(self, chunk_size=1024 * 16):
"""Exhaust the stream. This consumes all the data left until the
limit is reached.
:param chunk_size: the size for a chunk. It will read the chunk
until the stream is exhausted and throw away
the re... | [
"def",
"exhaust",
"(",
"self",
",",
"chunk_size",
"=",
"1024",
"*",
"16",
")",
":",
"to_read",
"=",
"self",
".",
"limit",
"-",
"self",
".",
"_pos",
"chunk",
"=",
"chunk_size",
"while",
"to_read",
">",
"0",
":",
"chunk",
"=",
"min",
"(",
"to_read",
... | Exhaust the stream. This consumes all the data left until the
limit is reached.
:param chunk_size: the size for a chunk. It will read the chunk
until the stream is exhausted and throw away
the results. | [
"Exhaust",
"the",
"stream",
".",
"This",
"consumes",
"all",
"the",
"data",
"left",
"until",
"the",
"limit",
"is",
"reached",
"."
] | dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a | https://github.com/core/uricore/blob/dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a/uricore/wkz_wsgi.py#L85-L98 | train |
core/uricore | uricore/wkz_wsgi.py | LimitedStream.read | def read(self, size=None):
"""Read `size` bytes or if size is not provided everything is read.
:param size: the number of bytes read.
"""
if self._pos >= self.limit:
return self.on_exhausted()
if size is None or size == -1: # -1 is for consistence with file
... | python | def read(self, size=None):
"""Read `size` bytes or if size is not provided everything is read.
:param size: the number of bytes read.
"""
if self._pos >= self.limit:
return self.on_exhausted()
if size is None or size == -1: # -1 is for consistence with file
... | [
"def",
"read",
"(",
"self",
",",
"size",
"=",
"None",
")",
":",
"if",
"self",
".",
"_pos",
">=",
"self",
".",
"limit",
":",
"return",
"self",
".",
"on_exhausted",
"(",
")",
"if",
"size",
"is",
"None",
"or",
"size",
"==",
"-",
"1",
":",
"size",
... | Read `size` bytes or if size is not provided everything is read.
:param size: the number of bytes read. | [
"Read",
"size",
"bytes",
"or",
"if",
"size",
"is",
"not",
"provided",
"everything",
"is",
"read",
"."
] | dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a | https://github.com/core/uricore/blob/dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a/uricore/wkz_wsgi.py#L100-L117 | train |
core/uricore | uricore/wkz_wsgi.py | LimitedStream.readline | def readline(self, size=None):
"""Reads one line from the stream."""
if self._pos >= self.limit:
return self.on_exhausted()
if size is None:
size = self.limit - self._pos
else:
size = min(size, self.limit - self._pos)
try:
line = se... | python | def readline(self, size=None):
"""Reads one line from the stream."""
if self._pos >= self.limit:
return self.on_exhausted()
if size is None:
size = self.limit - self._pos
else:
size = min(size, self.limit - self._pos)
try:
line = se... | [
"def",
"readline",
"(",
"self",
",",
"size",
"=",
"None",
")",
":",
"if",
"self",
".",
"_pos",
">=",
"self",
".",
"limit",
":",
"return",
"self",
".",
"on_exhausted",
"(",
")",
"if",
"size",
"is",
"None",
":",
"size",
"=",
"self",
".",
"limit",
"... | Reads one line from the stream. | [
"Reads",
"one",
"line",
"from",
"the",
"stream",
"."
] | dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a | https://github.com/core/uricore/blob/dc5ef4be7bd93da4c39e5c1cbd1ae4f3ad3f1f2a/uricore/wkz_wsgi.py#L119-L134 | train |
bitesofcode/projexui | projexui/widgets/xcalendarwidget/xcalendaritem.py | XCalendarItem.rebuild | def rebuild( self ):
"""
Rebuilds the current item in the scene.
"""
self.markForRebuild(False)
self._textData = []
if ( self.rebuildBlocked() ):
return
scene = self.scene()
if ( not scene ):
... | python | def rebuild( self ):
"""
Rebuilds the current item in the scene.
"""
self.markForRebuild(False)
self._textData = []
if ( self.rebuildBlocked() ):
return
scene = self.scene()
if ( not scene ):
... | [
"def",
"rebuild",
"(",
"self",
")",
":",
"self",
".",
"markForRebuild",
"(",
"False",
")",
"self",
".",
"_textData",
"=",
"[",
"]",
"if",
"(",
"self",
".",
"rebuildBlocked",
"(",
")",
")",
":",
"return",
"scene",
"=",
"self",
".",
"scene",
"(",
")"... | Rebuilds the current item in the scene. | [
"Rebuilds",
"the",
"current",
"item",
"in",
"the",
"scene",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcalendarwidget/xcalendaritem.py#L240-L259 | train |
bitesofcode/projexui | projexui/widgets/xcalendarwidget/xcalendaritem.py | XCalendarItem.rebuildDay | def rebuildDay( self ):
"""
Rebuilds the current item in day mode.
"""
scene = self.scene()
if ( not scene ):
return
# calculate the base information
start_date = self.dateStart()
end_date = self.dateEnd()
min_date... | python | def rebuildDay( self ):
"""
Rebuilds the current item in day mode.
"""
scene = self.scene()
if ( not scene ):
return
# calculate the base information
start_date = self.dateStart()
end_date = self.dateEnd()
min_date... | [
"def",
"rebuildDay",
"(",
"self",
")",
":",
"scene",
"=",
"self",
".",
"scene",
"(",
")",
"if",
"(",
"not",
"scene",
")",
":",
"return",
"start_date",
"=",
"self",
".",
"dateStart",
"(",
")",
"end_date",
"=",
"self",
".",
"dateEnd",
"(",
")",
"min_... | Rebuilds the current item in day mode. | [
"Rebuilds",
"the",
"current",
"item",
"in",
"day",
"mode",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xcalendarwidget/xcalendaritem.py#L261-L334 | train |
bitesofcode/projexui | projexui/wizards/xscaffoldwizard/xscaffoldwizard.py | XScaffoldPropertiesPage.validatePage | def validatePage(self):
"""
Validates the page against the scaffold information, setting the
values along the way.
"""
widgets = self.propertyWidgetMap()
failed = ''
for prop, widget in widgets.items():
val, success = projexui.widgetValue(widge... | python | def validatePage(self):
"""
Validates the page against the scaffold information, setting the
values along the way.
"""
widgets = self.propertyWidgetMap()
failed = ''
for prop, widget in widgets.items():
val, success = projexui.widgetValue(widge... | [
"def",
"validatePage",
"(",
"self",
")",
":",
"widgets",
"=",
"self",
".",
"propertyWidgetMap",
"(",
")",
"failed",
"=",
"''",
"for",
"prop",
",",
"widget",
"in",
"widgets",
".",
"items",
"(",
")",
":",
"val",
",",
"success",
"=",
"projexui",
".",
"w... | Validates the page against the scaffold information, setting the
values along the way. | [
"Validates",
"the",
"page",
"against",
"the",
"scaffold",
"information",
"setting",
"the",
"values",
"along",
"the",
"way",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/wizards/xscaffoldwizard/xscaffoldwizard.py#L166-L203 | train |
bitesofcode/projexui | projexui/wizards/xscaffoldwizard/xscaffoldwizard.py | XScaffoldElementItem.save | def save(self):
"""
Saves the state for this item to the scaffold.
"""
enabled = self.checkState(0) == QtCore.Qt.Checked
self._element.set('name', nativestring(self.text(0)))
self._element.set('enabled', nativestring(enabled))
for child in self.ch... | python | def save(self):
"""
Saves the state for this item to the scaffold.
"""
enabled = self.checkState(0) == QtCore.Qt.Checked
self._element.set('name', nativestring(self.text(0)))
self._element.set('enabled', nativestring(enabled))
for child in self.ch... | [
"def",
"save",
"(",
"self",
")",
":",
"enabled",
"=",
"self",
".",
"checkState",
"(",
"0",
")",
"==",
"QtCore",
".",
"Qt",
".",
"Checked",
"self",
".",
"_element",
".",
"set",
"(",
"'name'",
",",
"nativestring",
"(",
"self",
".",
"text",
"(",
"0",
... | Saves the state for this item to the scaffold. | [
"Saves",
"the",
"state",
"for",
"this",
"item",
"to",
"the",
"scaffold",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/wizards/xscaffoldwizard/xscaffoldwizard.py#L241-L250 | train |
bitesofcode/projexui | projexui/wizards/xscaffoldwizard/xscaffoldwizard.py | XScaffoldElementItem.update | def update(self, enabled=None):
"""
Updates this item based on the interface.
"""
if enabled is None:
enabled = self.checkState(0) == QtCore.Qt.Checked
elif not enabled or self._element.get('enabled', 'True') != 'True':
self.setCheckState(0, QtCore.... | python | def update(self, enabled=None):
"""
Updates this item based on the interface.
"""
if enabled is None:
enabled = self.checkState(0) == QtCore.Qt.Checked
elif not enabled or self._element.get('enabled', 'True') != 'True':
self.setCheckState(0, QtCore.... | [
"def",
"update",
"(",
"self",
",",
"enabled",
"=",
"None",
")",
":",
"if",
"enabled",
"is",
"None",
":",
"enabled",
"=",
"self",
".",
"checkState",
"(",
"0",
")",
"==",
"QtCore",
".",
"Qt",
".",
"Checked",
"elif",
"not",
"enabled",
"or",
"self",
".... | Updates this item based on the interface. | [
"Updates",
"this",
"item",
"based",
"on",
"the",
"interface",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/wizards/xscaffoldwizard/xscaffoldwizard.py#L252-L269 | train |
bitesofcode/projexui | projexui/wizards/xscaffoldwizard/xscaffoldwizard.py | XScaffoldStructurePage.initializePage | def initializePage(self):
"""
Initializes the page based on the current structure information.
"""
tree = self.uiStructureTREE
tree.blockSignals(True)
tree.setUpdatesEnabled(False)
self.uiStructureTREE.clear()
xstruct = self.scaffold().structure()
... | python | def initializePage(self):
"""
Initializes the page based on the current structure information.
"""
tree = self.uiStructureTREE
tree.blockSignals(True)
tree.setUpdatesEnabled(False)
self.uiStructureTREE.clear()
xstruct = self.scaffold().structure()
... | [
"def",
"initializePage",
"(",
"self",
")",
":",
"tree",
"=",
"self",
".",
"uiStructureTREE",
"tree",
".",
"blockSignals",
"(",
"True",
")",
"tree",
".",
"setUpdatesEnabled",
"(",
"False",
")",
"self",
".",
"uiStructureTREE",
".",
"clear",
"(",
")",
"xstruc... | Initializes the page based on the current structure information. | [
"Initializes",
"the",
"page",
"based",
"on",
"the",
"current",
"structure",
"information",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/wizards/xscaffoldwizard/xscaffoldwizard.py#L290-L305 | train |
bitesofcode/projexui | projexui/wizards/xscaffoldwizard/xscaffoldwizard.py | XScaffoldStructurePage.validatePage | def validatePage(self):
"""
Finishes up the structure information for this wizard by building
the scaffold.
"""
path = self.uiOutputPATH.filepath()
for item in self.uiStructureTREE.topLevelItems():
item.save()
try:
... | python | def validatePage(self):
"""
Finishes up the structure information for this wizard by building
the scaffold.
"""
path = self.uiOutputPATH.filepath()
for item in self.uiStructureTREE.topLevelItems():
item.save()
try:
... | [
"def",
"validatePage",
"(",
"self",
")",
":",
"path",
"=",
"self",
".",
"uiOutputPATH",
".",
"filepath",
"(",
")",
"for",
"item",
"in",
"self",
".",
"uiStructureTREE",
".",
"topLevelItems",
"(",
")",
":",
"item",
".",
"save",
"(",
")",
"try",
":",
"s... | Finishes up the structure information for this wizard by building
the scaffold. | [
"Finishes",
"up",
"the",
"structure",
"information",
"for",
"this",
"wizard",
"by",
"building",
"the",
"scaffold",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/wizards/xscaffoldwizard/xscaffoldwizard.py#L315-L331 | train |
bitesofcode/projexui | projexui/widgets/xorbcolumnedit/xorbcolumnedit.py | XOrbColumnEdit.rebuild | def rebuild( self ):
"""
Clears out all the child widgets from this widget and creates the
widget that best matches the column properties for this edit.
"""
plugins.init()
self.blockSignals(True)
self.setUpdatesEnabled(False)
#... | python | def rebuild( self ):
"""
Clears out all the child widgets from this widget and creates the
widget that best matches the column properties for this edit.
"""
plugins.init()
self.blockSignals(True)
self.setUpdatesEnabled(False)
#... | [
"def",
"rebuild",
"(",
"self",
")",
":",
"plugins",
".",
"init",
"(",
")",
"self",
".",
"blockSignals",
"(",
"True",
")",
"self",
".",
"setUpdatesEnabled",
"(",
"False",
")",
"if",
"(",
"self",
".",
"_editor",
")",
":",
"self",
".",
"_editor",
".",
... | Clears out all the child widgets from this widget and creates the
widget that best matches the column properties for this edit. | [
"Clears",
"out",
"all",
"the",
"child",
"widgets",
"from",
"this",
"widget",
"and",
"creates",
"the",
"widget",
"that",
"best",
"matches",
"the",
"column",
"properties",
"for",
"this",
"edit",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xorbcolumnedit/xorbcolumnedit.py#L120-L144 | train |
bitesofcode/projexui | projexui/windows/xdkwindow/xdkwindow.py | XdkWindow.closeContentsWidget | def closeContentsWidget( self ):
"""
Closes the current contents widget.
"""
widget = self.currentContentsWidget()
if ( not widget ):
return
widget.close()
widget.setParent(None)
widget.deleteLater() | python | def closeContentsWidget( self ):
"""
Closes the current contents widget.
"""
widget = self.currentContentsWidget()
if ( not widget ):
return
widget.close()
widget.setParent(None)
widget.deleteLater() | [
"def",
"closeContentsWidget",
"(",
"self",
")",
":",
"widget",
"=",
"self",
".",
"currentContentsWidget",
"(",
")",
"if",
"(",
"not",
"widget",
")",
":",
"return",
"widget",
".",
"close",
"(",
")",
"widget",
".",
"setParent",
"(",
"None",
")",
"widget",
... | Closes the current contents widget. | [
"Closes",
"the",
"current",
"contents",
"widget",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/windows/xdkwindow/xdkwindow.py#L246-L256 | train |
bitesofcode/projexui | projexui/windows/xdkwindow/xdkwindow.py | XdkWindow.copyText | def copyText( self ):
"""
Copies the selected text to the clipboard.
"""
view = self.currentWebView()
QApplication.clipboard().setText(view.page().selectedText()) | python | def copyText( self ):
"""
Copies the selected text to the clipboard.
"""
view = self.currentWebView()
QApplication.clipboard().setText(view.page().selectedText()) | [
"def",
"copyText",
"(",
"self",
")",
":",
"view",
"=",
"self",
".",
"currentWebView",
"(",
")",
"QApplication",
".",
"clipboard",
"(",
")",
".",
"setText",
"(",
"view",
".",
"page",
"(",
")",
".",
"selectedText",
"(",
")",
")"
] | Copies the selected text to the clipboard. | [
"Copies",
"the",
"selected",
"text",
"to",
"the",
"clipboard",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/windows/xdkwindow/xdkwindow.py#L258-L263 | train |
bitesofcode/projexui | projexui/windows/xdkwindow/xdkwindow.py | XdkWindow.findPrev | def findPrev( self ):
"""
Looks for the previous occurance of the current search text.
"""
text = self.uiFindTXT.text()
view = self.currentWebView()
options = QWebPage.FindWrapsAroundDocument
options |= QWebPage.FindBackward
if... | python | def findPrev( self ):
"""
Looks for the previous occurance of the current search text.
"""
text = self.uiFindTXT.text()
view = self.currentWebView()
options = QWebPage.FindWrapsAroundDocument
options |= QWebPage.FindBackward
if... | [
"def",
"findPrev",
"(",
"self",
")",
":",
"text",
"=",
"self",
".",
"uiFindTXT",
".",
"text",
"(",
")",
"view",
"=",
"self",
".",
"currentWebView",
"(",
")",
"options",
"=",
"QWebPage",
".",
"FindWrapsAroundDocument",
"options",
"|=",
"QWebPage",
".",
"F... | Looks for the previous occurance of the current search text. | [
"Looks",
"for",
"the",
"previous",
"occurance",
"of",
"the",
"current",
"search",
"text",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/windows/xdkwindow/xdkwindow.py#L322-L335 | train |
bitesofcode/projexui | projexui/windows/xdkwindow/xdkwindow.py | XdkWindow.refreshFromIndex | def refreshFromIndex( self ):
"""
Refreshes the documentation from the selected index item.
"""
item = self.uiIndexTREE.currentItem()
if ( not item ):
return
self.gotoUrl(item.toolTip(0)) | python | def refreshFromIndex( self ):
"""
Refreshes the documentation from the selected index item.
"""
item = self.uiIndexTREE.currentItem()
if ( not item ):
return
self.gotoUrl(item.toolTip(0)) | [
"def",
"refreshFromIndex",
"(",
"self",
")",
":",
"item",
"=",
"self",
".",
"uiIndexTREE",
".",
"currentItem",
"(",
")",
"if",
"(",
"not",
"item",
")",
":",
"return",
"self",
".",
"gotoUrl",
"(",
"item",
".",
"toolTip",
"(",
"0",
")",
")"
] | Refreshes the documentation from the selected index item. | [
"Refreshes",
"the",
"documentation",
"from",
"the",
"selected",
"index",
"item",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/windows/xdkwindow/xdkwindow.py#L455-L463 | train |
bitesofcode/projexui | projexui/windows/xdkwindow/xdkwindow.py | XdkWindow.refreshContents | def refreshContents( self ):
"""
Refreshes the contents tab with the latest selection from the browser.
"""
item = self.uiContentsTREE.currentItem()
if not isinstance(item, XdkEntryItem):
return
item.load()
url = item.url()
if url:... | python | def refreshContents( self ):
"""
Refreshes the contents tab with the latest selection from the browser.
"""
item = self.uiContentsTREE.currentItem()
if not isinstance(item, XdkEntryItem):
return
item.load()
url = item.url()
if url:... | [
"def",
"refreshContents",
"(",
"self",
")",
":",
"item",
"=",
"self",
".",
"uiContentsTREE",
".",
"currentItem",
"(",
")",
"if",
"not",
"isinstance",
"(",
"item",
",",
"XdkEntryItem",
")",
":",
"return",
"item",
".",
"load",
"(",
")",
"url",
"=",
"item... | Refreshes the contents tab with the latest selection from the browser. | [
"Refreshes",
"the",
"contents",
"tab",
"with",
"the",
"latest",
"selection",
"from",
"the",
"browser",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/windows/xdkwindow/xdkwindow.py#L465-L476 | train |
bitesofcode/projexui | projexui/windows/xdkwindow/xdkwindow.py | XdkWindow.refreshUi | def refreshUi( self ):
"""
Refreshes the interface based on the current settings.
"""
widget = self.uiContentsTAB.currentWidget()
is_content = isinstance(widget, QWebView)
if is_content:
self._currentContentsIndex = self.uiContentsTAB.currentInd... | python | def refreshUi( self ):
"""
Refreshes the interface based on the current settings.
"""
widget = self.uiContentsTAB.currentWidget()
is_content = isinstance(widget, QWebView)
if is_content:
self._currentContentsIndex = self.uiContentsTAB.currentInd... | [
"def",
"refreshUi",
"(",
"self",
")",
":",
"widget",
"=",
"self",
".",
"uiContentsTAB",
".",
"currentWidget",
"(",
")",
"is_content",
"=",
"isinstance",
"(",
"widget",
",",
"QWebView",
")",
"if",
"is_content",
":",
"self",
".",
"_currentContentsIndex",
"=",
... | Refreshes the interface based on the current settings. | [
"Refreshes",
"the",
"interface",
"based",
"on",
"the",
"current",
"settings",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/windows/xdkwindow/xdkwindow.py#L478-L501 | train |
bitesofcode/projexui | projexui/windows/xdkwindow/xdkwindow.py | XdkWindow.search | def search( self ):
"""
Looks up the current search terms from the xdk files that are loaded.
"""
QApplication.instance().setOverrideCursor(Qt.WaitCursor)
terms = nativestring(self.uiSearchTXT.text())
html = []
entry_html = '<a h... | python | def search( self ):
"""
Looks up the current search terms from the xdk files that are loaded.
"""
QApplication.instance().setOverrideCursor(Qt.WaitCursor)
terms = nativestring(self.uiSearchTXT.text())
html = []
entry_html = '<a h... | [
"def",
"search",
"(",
"self",
")",
":",
"QApplication",
".",
"instance",
"(",
")",
".",
"setOverrideCursor",
"(",
"Qt",
".",
"WaitCursor",
")",
"terms",
"=",
"nativestring",
"(",
"self",
".",
"uiSearchTXT",
".",
"text",
"(",
")",
")",
"html",
"=",
"[",... | Looks up the current search terms from the xdk files that are loaded. | [
"Looks",
"up",
"the",
"current",
"search",
"terms",
"from",
"the",
"xdk",
"files",
"that",
"are",
"loaded",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/windows/xdkwindow/xdkwindow.py#L503-L529 | train |
intelsdi-x/snap-plugin-lib-py | snap_plugin/v1/config_map.py | ConfigMap.clear | def clear(self):
"Removes all entries from the config map"
self._pb.IntMap.clear()
self._pb.StringMap.clear()
self._pb.FloatMap.clear()
self._pb.BoolMap.clear() | python | def clear(self):
"Removes all entries from the config map"
self._pb.IntMap.clear()
self._pb.StringMap.clear()
self._pb.FloatMap.clear()
self._pb.BoolMap.clear() | [
"def",
"clear",
"(",
"self",
")",
":",
"\"Removes all entries from the config map\"",
"self",
".",
"_pb",
".",
"IntMap",
".",
"clear",
"(",
")",
"self",
".",
"_pb",
".",
"StringMap",
".",
"clear",
"(",
")",
"self",
".",
"_pb",
".",
"FloatMap",
".",
"clea... | Removes all entries from the config map | [
"Removes",
"all",
"entries",
"from",
"the",
"config",
"map"
] | 8da5d00ac5f9d2b48a7239563ac7788209891ca4 | https://github.com/intelsdi-x/snap-plugin-lib-py/blob/8da5d00ac5f9d2b48a7239563ac7788209891ca4/snap_plugin/v1/config_map.py#L129-L134 | train |
intelsdi-x/snap-plugin-lib-py | snap_plugin/v1/config_map.py | ConfigMap.keys | def keys(self):
"Returns a list of ConfigMap keys."
return (list(self._pb.IntMap.keys()) + list(self._pb.StringMap.keys()) +
list(self._pb.FloatMap.keys()) + list(self._pb.BoolMap.keys())) | python | def keys(self):
"Returns a list of ConfigMap keys."
return (list(self._pb.IntMap.keys()) + list(self._pb.StringMap.keys()) +
list(self._pb.FloatMap.keys()) + list(self._pb.BoolMap.keys())) | [
"def",
"keys",
"(",
"self",
")",
":",
"\"Returns a list of ConfigMap keys.\"",
"return",
"(",
"list",
"(",
"self",
".",
"_pb",
".",
"IntMap",
".",
"keys",
"(",
")",
")",
"+",
"list",
"(",
"self",
".",
"_pb",
".",
"StringMap",
".",
"keys",
"(",
")",
"... | Returns a list of ConfigMap keys. | [
"Returns",
"a",
"list",
"of",
"ConfigMap",
"keys",
"."
] | 8da5d00ac5f9d2b48a7239563ac7788209891ca4 | https://github.com/intelsdi-x/snap-plugin-lib-py/blob/8da5d00ac5f9d2b48a7239563ac7788209891ca4/snap_plugin/v1/config_map.py#L159-L162 | train |
intelsdi-x/snap-plugin-lib-py | snap_plugin/v1/config_map.py | ConfigMap.values | def values(self):
"Returns a list of ConfigMap values."
return (list(self._pb.IntMap.values()) + list(self._pb.StringMap.values()) +
list(self._pb.FloatMap.values()) + list(self._pb.BoolMap.values())) | python | def values(self):
"Returns a list of ConfigMap values."
return (list(self._pb.IntMap.values()) + list(self._pb.StringMap.values()) +
list(self._pb.FloatMap.values()) + list(self._pb.BoolMap.values())) | [
"def",
"values",
"(",
"self",
")",
":",
"\"Returns a list of ConfigMap values.\"",
"return",
"(",
"list",
"(",
"self",
".",
"_pb",
".",
"IntMap",
".",
"values",
"(",
")",
")",
"+",
"list",
"(",
"self",
".",
"_pb",
".",
"StringMap",
".",
"values",
"(",
... | Returns a list of ConfigMap values. | [
"Returns",
"a",
"list",
"of",
"ConfigMap",
"values",
"."
] | 8da5d00ac5f9d2b48a7239563ac7788209891ca4 | https://github.com/intelsdi-x/snap-plugin-lib-py/blob/8da5d00ac5f9d2b48a7239563ac7788209891ca4/snap_plugin/v1/config_map.py#L164-L167 | train |
intelsdi-x/snap-plugin-lib-py | snap_plugin/v1/config_map.py | ConfigMap.iteritems | def iteritems(self):
"Returns an iterator over the items of ConfigMap."
return chain(self._pb.StringMap.items(),
self._pb.IntMap.items(),
self._pb.FloatMap.items(),
self._pb.BoolMap.items()) | python | def iteritems(self):
"Returns an iterator over the items of ConfigMap."
return chain(self._pb.StringMap.items(),
self._pb.IntMap.items(),
self._pb.FloatMap.items(),
self._pb.BoolMap.items()) | [
"def",
"iteritems",
"(",
"self",
")",
":",
"\"Returns an iterator over the items of ConfigMap.\"",
"return",
"chain",
"(",
"self",
".",
"_pb",
".",
"StringMap",
".",
"items",
"(",
")",
",",
"self",
".",
"_pb",
".",
"IntMap",
".",
"items",
"(",
")",
",",
"s... | Returns an iterator over the items of ConfigMap. | [
"Returns",
"an",
"iterator",
"over",
"the",
"items",
"of",
"ConfigMap",
"."
] | 8da5d00ac5f9d2b48a7239563ac7788209891ca4 | https://github.com/intelsdi-x/snap-plugin-lib-py/blob/8da5d00ac5f9d2b48a7239563ac7788209891ca4/snap_plugin/v1/config_map.py#L169-L174 | train |
intelsdi-x/snap-plugin-lib-py | snap_plugin/v1/config_map.py | ConfigMap.itervalues | def itervalues(self):
"Returns an iterator over the values of ConfigMap."
return chain(self._pb.StringMap.values(),
self._pb.IntMap.values(),
self._pb.FloatMap.values(),
self._pb.BoolMap.values()) | python | def itervalues(self):
"Returns an iterator over the values of ConfigMap."
return chain(self._pb.StringMap.values(),
self._pb.IntMap.values(),
self._pb.FloatMap.values(),
self._pb.BoolMap.values()) | [
"def",
"itervalues",
"(",
"self",
")",
":",
"\"Returns an iterator over the values of ConfigMap.\"",
"return",
"chain",
"(",
"self",
".",
"_pb",
".",
"StringMap",
".",
"values",
"(",
")",
",",
"self",
".",
"_pb",
".",
"IntMap",
".",
"values",
"(",
")",
",",
... | Returns an iterator over the values of ConfigMap. | [
"Returns",
"an",
"iterator",
"over",
"the",
"values",
"of",
"ConfigMap",
"."
] | 8da5d00ac5f9d2b48a7239563ac7788209891ca4 | https://github.com/intelsdi-x/snap-plugin-lib-py/blob/8da5d00ac5f9d2b48a7239563ac7788209891ca4/snap_plugin/v1/config_map.py#L176-L181 | train |
intelsdi-x/snap-plugin-lib-py | snap_plugin/v1/config_map.py | ConfigMap.iterkeys | def iterkeys(self):
"Returns an iterator over the keys of ConfigMap."
return chain(self._pb.StringMap.keys(),
self._pb.IntMap.keys(),
self._pb.FloatMap.keys(),
self._pb.BoolMap.keys()) | python | def iterkeys(self):
"Returns an iterator over the keys of ConfigMap."
return chain(self._pb.StringMap.keys(),
self._pb.IntMap.keys(),
self._pb.FloatMap.keys(),
self._pb.BoolMap.keys()) | [
"def",
"iterkeys",
"(",
"self",
")",
":",
"\"Returns an iterator over the keys of ConfigMap.\"",
"return",
"chain",
"(",
"self",
".",
"_pb",
".",
"StringMap",
".",
"keys",
"(",
")",
",",
"self",
".",
"_pb",
".",
"IntMap",
".",
"keys",
"(",
")",
",",
"self"... | Returns an iterator over the keys of ConfigMap. | [
"Returns",
"an",
"iterator",
"over",
"the",
"keys",
"of",
"ConfigMap",
"."
] | 8da5d00ac5f9d2b48a7239563ac7788209891ca4 | https://github.com/intelsdi-x/snap-plugin-lib-py/blob/8da5d00ac5f9d2b48a7239563ac7788209891ca4/snap_plugin/v1/config_map.py#L183-L188 | train |
intelsdi-x/snap-plugin-lib-py | snap_plugin/v1/config_map.py | ConfigMap.pop | def pop(self, key, default=None):
"""Remove specified key and return the corresponding value.
If key is not found, default is returned if given, otherwise
KeyError is raised.
"""
if key not in self:
if default is not None:
return default
... | python | def pop(self, key, default=None):
"""Remove specified key and return the corresponding value.
If key is not found, default is returned if given, otherwise
KeyError is raised.
"""
if key not in self:
if default is not None:
return default
... | [
"def",
"pop",
"(",
"self",
",",
"key",
",",
"default",
"=",
"None",
")",
":",
"if",
"key",
"not",
"in",
"self",
":",
"if",
"default",
"is",
"not",
"None",
":",
"return",
"default",
"raise",
"KeyError",
"(",
"key",
")",
"for",
"map",
"in",
"[",
"s... | Remove specified key and return the corresponding value.
If key is not found, default is returned if given, otherwise
KeyError is raised. | [
"Remove",
"specified",
"key",
"and",
"return",
"the",
"corresponding",
"value",
".",
"If",
"key",
"is",
"not",
"found",
"default",
"is",
"returned",
"if",
"given",
"otherwise",
"KeyError",
"is",
"raised",
"."
] | 8da5d00ac5f9d2b48a7239563ac7788209891ca4 | https://github.com/intelsdi-x/snap-plugin-lib-py/blob/8da5d00ac5f9d2b48a7239563ac7788209891ca4/snap_plugin/v1/config_map.py#L195-L207 | train |
bitesofcode/projexui | projexui/xorbworker.py | XOrbWorker.interrupt | def interrupt(self):
"""
Interrupts the current database from processing.
"""
if self._database and self._databaseThreadId:
# support Orb 2 interruption capabilities
try:
self._database.interrupt(self._databaseThreadId)
except A... | python | def interrupt(self):
"""
Interrupts the current database from processing.
"""
if self._database and self._databaseThreadId:
# support Orb 2 interruption capabilities
try:
self._database.interrupt(self._databaseThreadId)
except A... | [
"def",
"interrupt",
"(",
"self",
")",
":",
"if",
"self",
".",
"_database",
"and",
"self",
".",
"_databaseThreadId",
":",
"try",
":",
"self",
".",
"_database",
".",
"interrupt",
"(",
"self",
".",
"_databaseThreadId",
")",
"except",
"AttributeError",
":",
"p... | Interrupts the current database from processing. | [
"Interrupts",
"the",
"current",
"database",
"from",
"processing",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xorbworker.py#L121-L133 | train |
bitesofcode/projexui | projexui/xorbworker.py | XOrbWorker.waitUntilFinished | def waitUntilFinished(self):
"""
Processes the main thread until the loading process has finished. This
is a way to force the main thread to be synchronous in its execution.
"""
QtCore.QCoreApplication.processEvents()
while self.isLoading():
QtCore.QCo... | python | def waitUntilFinished(self):
"""
Processes the main thread until the loading process has finished. This
is a way to force the main thread to be synchronous in its execution.
"""
QtCore.QCoreApplication.processEvents()
while self.isLoading():
QtCore.QCo... | [
"def",
"waitUntilFinished",
"(",
"self",
")",
":",
"QtCore",
".",
"QCoreApplication",
".",
"processEvents",
"(",
")",
"while",
"self",
".",
"isLoading",
"(",
")",
":",
"QtCore",
".",
"QCoreApplication",
".",
"processEvents",
"(",
")"
] | Processes the main thread until the loading process has finished. This
is a way to force the main thread to be synchronous in its execution. | [
"Processes",
"the",
"main",
"thread",
"until",
"the",
"loading",
"process",
"has",
"finished",
".",
"This",
"is",
"a",
"way",
"to",
"force",
"the",
"main",
"thread",
"to",
"be",
"synchronous",
"in",
"its",
"execution",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/xorbworker.py#L153-L160 | train |
bitesofcode/projexui | projexui/widgets/xrichtextedit/xrichtextedit.py | XRichTextEdit.assignAlignment | def assignAlignment(self, action):
"""
Sets the current alignment for the editor.
"""
if self._actions['align_left'] == action:
self.setAlignment(Qt.AlignLeft)
elif self._actions['align_right'] == action:
self.setAlignment(Qt.AlignRight)
el... | python | def assignAlignment(self, action):
"""
Sets the current alignment for the editor.
"""
if self._actions['align_left'] == action:
self.setAlignment(Qt.AlignLeft)
elif self._actions['align_right'] == action:
self.setAlignment(Qt.AlignRight)
el... | [
"def",
"assignAlignment",
"(",
"self",
",",
"action",
")",
":",
"if",
"self",
".",
"_actions",
"[",
"'align_left'",
"]",
"==",
"action",
":",
"self",
".",
"setAlignment",
"(",
"Qt",
".",
"AlignLeft",
")",
"elif",
"self",
".",
"_actions",
"[",
"'align_rig... | Sets the current alignment for the editor. | [
"Sets",
"the",
"current",
"alignment",
"for",
"the",
"editor",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xrichtextedit/xrichtextedit.py#L165-L176 | train |
bitesofcode/projexui | projexui/widgets/xrichtextedit/xrichtextedit.py | XRichTextEdit.assignFont | def assignFont(self):
"""
Assigns the font family and point size settings from the font picker
widget.
"""
font = self.currentFont()
font.setFamily(self._fontPickerWidget.currentFamily())
font.setPointSize(self._fontPickerWidget.pointSize())
self.s... | python | def assignFont(self):
"""
Assigns the font family and point size settings from the font picker
widget.
"""
font = self.currentFont()
font.setFamily(self._fontPickerWidget.currentFamily())
font.setPointSize(self._fontPickerWidget.pointSize())
self.s... | [
"def",
"assignFont",
"(",
"self",
")",
":",
"font",
"=",
"self",
".",
"currentFont",
"(",
")",
"font",
".",
"setFamily",
"(",
"self",
".",
"_fontPickerWidget",
".",
"currentFamily",
"(",
")",
")",
"font",
".",
"setPointSize",
"(",
"self",
".",
"_fontPick... | Assigns the font family and point size settings from the font picker
widget. | [
"Assigns",
"the",
"font",
"family",
"and",
"point",
"size",
"settings",
"from",
"the",
"font",
"picker",
"widget",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xrichtextedit/xrichtextedit.py#L178-L186 | train |
bitesofcode/projexui | projexui/widgets/xrichtextedit/xrichtextedit.py | XRichTextEdit.refreshUi | def refreshUi(self):
"""
Matches the UI state to the current cursor positioning.
"""
font = self.currentFont()
for name in ('underline', 'bold', 'italic', 'strikeOut'):
getter = getattr(font, name)
act = self._actions[name]
ac... | python | def refreshUi(self):
"""
Matches the UI state to the current cursor positioning.
"""
font = self.currentFont()
for name in ('underline', 'bold', 'italic', 'strikeOut'):
getter = getattr(font, name)
act = self._actions[name]
ac... | [
"def",
"refreshUi",
"(",
"self",
")",
":",
"font",
"=",
"self",
".",
"currentFont",
"(",
")",
"for",
"name",
"in",
"(",
"'underline'",
",",
"'bold'",
",",
"'italic'",
",",
"'strikeOut'",
")",
":",
"getter",
"=",
"getattr",
"(",
"font",
",",
"name",
"... | Matches the UI state to the current cursor positioning. | [
"Matches",
"the",
"UI",
"state",
"to",
"the",
"current",
"cursor",
"positioning",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xrichtextedit/xrichtextedit.py#L465-L476 | train |
bitesofcode/projexui | projexui/widgets/xrichtextedit/xrichtextedit.py | XRichTextEdit.refreshAlignmentUi | def refreshAlignmentUi(self):
"""
Refreshes the alignment UI information.
"""
align = self.alignment()
for name, value in (('align_left', Qt.AlignLeft),
('align_right', Qt.AlignRight),
('align_center', Qt.AlignHCenter... | python | def refreshAlignmentUi(self):
"""
Refreshes the alignment UI information.
"""
align = self.alignment()
for name, value in (('align_left', Qt.AlignLeft),
('align_right', Qt.AlignRight),
('align_center', Qt.AlignHCenter... | [
"def",
"refreshAlignmentUi",
"(",
"self",
")",
":",
"align",
"=",
"self",
".",
"alignment",
"(",
")",
"for",
"name",
",",
"value",
"in",
"(",
"(",
"'align_left'",
",",
"Qt",
".",
"AlignLeft",
")",
",",
"(",
"'align_right'",
",",
"Qt",
".",
"AlignRight"... | Refreshes the alignment UI information. | [
"Refreshes",
"the",
"alignment",
"UI",
"information",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xrichtextedit/xrichtextedit.py#L478-L491 | train |
bitesofcode/projexui | projexui/widgets/xrichtextedit/xrichtextedit.py | XRichTextEdit.updateFontPicker | def updateFontPicker(self):
"""
Updates the font picker widget to the current font settings.
"""
font = self.currentFont()
self._fontPickerWidget.setPointSize(font.pointSize())
self._fontPickerWidget.setCurrentFamily(font.family()) | python | def updateFontPicker(self):
"""
Updates the font picker widget to the current font settings.
"""
font = self.currentFont()
self._fontPickerWidget.setPointSize(font.pointSize())
self._fontPickerWidget.setCurrentFamily(font.family()) | [
"def",
"updateFontPicker",
"(",
"self",
")",
":",
"font",
"=",
"self",
".",
"currentFont",
"(",
")",
"self",
".",
"_fontPickerWidget",
".",
"setPointSize",
"(",
"font",
".",
"pointSize",
"(",
")",
")",
"self",
".",
"_fontPickerWidget",
".",
"setCurrentFamily... | Updates the font picker widget to the current font settings. | [
"Updates",
"the",
"font",
"picker",
"widget",
"to",
"the",
"current",
"font",
"settings",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xrichtextedit/xrichtextedit.py#L708-L714 | train |
bitesofcode/projexui | projexui/widgets/xchartwidget/xchartwidgetitem.py | XChartWidgetItem.startDrag | def startDrag(self, data):
"""
Starts dragging information from this chart widget based on the
dragData associated with this item.
"""
if not data:
return
widget = self.scene().chartWidget()
drag = QDrag(widget)
drag.setMimeD... | python | def startDrag(self, data):
"""
Starts dragging information from this chart widget based on the
dragData associated with this item.
"""
if not data:
return
widget = self.scene().chartWidget()
drag = QDrag(widget)
drag.setMimeD... | [
"def",
"startDrag",
"(",
"self",
",",
"data",
")",
":",
"if",
"not",
"data",
":",
"return",
"widget",
"=",
"self",
".",
"scene",
"(",
")",
".",
"chartWidget",
"(",
")",
"drag",
"=",
"QDrag",
"(",
"widget",
")",
"drag",
".",
"setMimeData",
"(",
"dat... | Starts dragging information from this chart widget based on the
dragData associated with this item. | [
"Starts",
"dragging",
"information",
"from",
"this",
"chart",
"widget",
"based",
"on",
"the",
"dragData",
"associated",
"with",
"this",
"item",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xchartwidget/xchartwidgetitem.py#L740-L751 | train |
bitesofcode/projexui | projexui/widgets/xoverlaywizard.py | XOverlayWizardPage.adjustMargins | def adjustMargins(self):
"""
Adjusts the margins to incorporate enough room for the widget's title and sub-title.
"""
y = 0
height = 0
if self._titleLabel.text():
height += self._titleLabel.height() + 3
y += height
if self._subTitleLabel.t... | python | def adjustMargins(self):
"""
Adjusts the margins to incorporate enough room for the widget's title and sub-title.
"""
y = 0
height = 0
if self._titleLabel.text():
height += self._titleLabel.height() + 3
y += height
if self._subTitleLabel.t... | [
"def",
"adjustMargins",
"(",
"self",
")",
":",
"y",
"=",
"0",
"height",
"=",
"0",
"if",
"self",
".",
"_titleLabel",
".",
"text",
"(",
")",
":",
"height",
"+=",
"self",
".",
"_titleLabel",
".",
"height",
"(",
")",
"+",
"3",
"y",
"+=",
"height",
"i... | Adjusts the margins to incorporate enough room for the widget's title and sub-title. | [
"Adjusts",
"the",
"margins",
"to",
"incorporate",
"enough",
"room",
"for",
"the",
"widget",
"s",
"title",
"and",
"sub",
"-",
"title",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywizard.py#L45-L59 | train |
bitesofcode/projexui | projexui/widgets/xoverlaywizard.py | XOverlayWizardPage.nextId | def nextId(self):
"""
Returns the next id for this page. By default, it will provide the next id from the wizard, but
this method can be overloaded to create a custom path. If -1 is returned, then it will be considered
the final page.
:return <int>
"""
if s... | python | def nextId(self):
"""
Returns the next id for this page. By default, it will provide the next id from the wizard, but
this method can be overloaded to create a custom path. If -1 is returned, then it will be considered
the final page.
:return <int>
"""
if s... | [
"def",
"nextId",
"(",
"self",
")",
":",
"if",
"self",
".",
"_nextId",
"is",
"not",
"None",
":",
"return",
"self",
".",
"_nextId",
"wizard",
"=",
"self",
".",
"wizard",
"(",
")",
"curr_id",
"=",
"wizard",
".",
"currentId",
"(",
")",
"all_ids",
"=",
... | Returns the next id for this page. By default, it will provide the next id from the wizard, but
this method can be overloaded to create a custom path. If -1 is returned, then it will be considered
the final page.
:return <int> | [
"Returns",
"the",
"next",
"id",
"for",
"this",
"page",
".",
"By",
"default",
"it",
"will",
"provide",
"the",
"next",
"id",
"from",
"the",
"wizard",
"but",
"this",
"method",
"can",
"be",
"overloaded",
"to",
"create",
"a",
"custom",
"path",
".",
"If",
"-... | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywizard.py#L121-L138 | train |
bitesofcode/projexui | projexui/widgets/xoverlaywizard.py | XOverlayWizardPage.setSubTitle | def setSubTitle(self, title):
"""
Sets the sub-title for this page to the inputed title.
:param title | <str>
"""
self._subTitleLabel.setText(title)
self._subTitleLabel.adjustSize()
self.adjustMargins() | python | def setSubTitle(self, title):
"""
Sets the sub-title for this page to the inputed title.
:param title | <str>
"""
self._subTitleLabel.setText(title)
self._subTitleLabel.adjustSize()
self.adjustMargins() | [
"def",
"setSubTitle",
"(",
"self",
",",
"title",
")",
":",
"self",
".",
"_subTitleLabel",
".",
"setText",
"(",
"title",
")",
"self",
".",
"_subTitleLabel",
".",
"adjustSize",
"(",
")",
"self",
".",
"adjustMargins",
"(",
")"
] | Sets the sub-title for this page to the inputed title.
:param title | <str> | [
"Sets",
"the",
"sub",
"-",
"title",
"for",
"this",
"page",
"to",
"the",
"inputed",
"title",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywizard.py#L174-L182 | train |
bitesofcode/projexui | projexui/widgets/xoverlaywizard.py | XOverlayWizardPage.setTitle | def setTitle(self, title):
"""
Sets the title for this page to the inputed title.
:param title | <str>
"""
self._titleLabel.setText(title)
self._titleLabel.adjustSize()
self.adjustMargins() | python | def setTitle(self, title):
"""
Sets the title for this page to the inputed title.
:param title | <str>
"""
self._titleLabel.setText(title)
self._titleLabel.adjustSize()
self.adjustMargins() | [
"def",
"setTitle",
"(",
"self",
",",
"title",
")",
":",
"self",
".",
"_titleLabel",
".",
"setText",
"(",
"title",
")",
"self",
".",
"_titleLabel",
".",
"adjustSize",
"(",
")",
"self",
".",
"adjustMargins",
"(",
")"
] | Sets the title for this page to the inputed title.
:param title | <str> | [
"Sets",
"the",
"title",
"for",
"this",
"page",
"to",
"the",
"inputed",
"title",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywizard.py#L192-L200 | train |
bitesofcode/projexui | projexui/widgets/xoverlaywizard.py | XOverlayWizard.adjustSize | def adjustSize(self):
"""
Adjusts the size of this wizard and its page contents to the inputed size.
:param size | <QtCore.QSize>
"""
super(XOverlayWizard, self).adjustSize()
# adjust the page size
page_size = self.pageSize()
# resize the current p... | python | def adjustSize(self):
"""
Adjusts the size of this wizard and its page contents to the inputed size.
:param size | <QtCore.QSize>
"""
super(XOverlayWizard, self).adjustSize()
# adjust the page size
page_size = self.pageSize()
# resize the current p... | [
"def",
"adjustSize",
"(",
"self",
")",
":",
"super",
"(",
"XOverlayWizard",
",",
"self",
")",
".",
"adjustSize",
"(",
")",
"page_size",
"=",
"self",
".",
"pageSize",
"(",
")",
"x",
"=",
"(",
"self",
".",
"width",
"(",
")",
"-",
"page_size",
".",
"w... | Adjusts the size of this wizard and its page contents to the inputed size.
:param size | <QtCore.QSize> | [
"Adjusts",
"the",
"size",
"of",
"this",
"wizard",
"and",
"its",
"page",
"contents",
"to",
"the",
"inputed",
"size",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywizard.py#L319-L361 | train |
bitesofcode/projexui | projexui/widgets/xoverlaywizard.py | XOverlayWizard.canGoBack | def canGoBack(self):
"""
Returns whether or not this wizard can move forward.
:return <bool>
"""
try:
backId = self._navigation.index(self.currentId())-1
if backId >= 0:
self._navigation[backId]
else:
return... | python | def canGoBack(self):
"""
Returns whether or not this wizard can move forward.
:return <bool>
"""
try:
backId = self._navigation.index(self.currentId())-1
if backId >= 0:
self._navigation[backId]
else:
return... | [
"def",
"canGoBack",
"(",
"self",
")",
":",
"try",
":",
"backId",
"=",
"self",
".",
"_navigation",
".",
"index",
"(",
"self",
".",
"currentId",
"(",
")",
")",
"-",
"1",
"if",
"backId",
">=",
"0",
":",
"self",
".",
"_navigation",
"[",
"backId",
"]",
... | Returns whether or not this wizard can move forward.
:return <bool> | [
"Returns",
"whether",
"or",
"not",
"this",
"wizard",
"can",
"move",
"forward",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywizard.py#L448-L463 | train |
bitesofcode/projexui | projexui/widgets/xoverlaywizard.py | XOverlayWizard.pageSize | def pageSize(self):
"""
Returns the current page size for this wizard.
:return <QtCore.QSize>
"""
# update the size based on the new size
page_size = self.fixedPageSize()
if page_size.isEmpty():
w = self.width() - 80
h = self.height()... | python | def pageSize(self):
"""
Returns the current page size for this wizard.
:return <QtCore.QSize>
"""
# update the size based on the new size
page_size = self.fixedPageSize()
if page_size.isEmpty():
w = self.width() - 80
h = self.height()... | [
"def",
"pageSize",
"(",
"self",
")",
":",
"page_size",
"=",
"self",
".",
"fixedPageSize",
"(",
")",
"if",
"page_size",
".",
"isEmpty",
"(",
")",
":",
"w",
"=",
"self",
".",
"width",
"(",
")",
"-",
"80",
"h",
"=",
"self",
".",
"height",
"(",
")",
... | Returns the current page size for this wizard.
:return <QtCore.QSize> | [
"Returns",
"the",
"current",
"page",
"size",
"for",
"this",
"wizard",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywizard.py#L644-L663 | train |
bitesofcode/projexui | projexui/widgets/xoverlaywizard.py | XOverlayWizard.restart | def restart(self):
"""
Restarts the whole wizard from the beginning.
"""
# hide all of the pages
for page in self._pages.values():
page.hide()
pageId = self.startId()
try:
first_page = self._pages[pageId]
except KeyError:
... | python | def restart(self):
"""
Restarts the whole wizard from the beginning.
"""
# hide all of the pages
for page in self._pages.values():
page.hide()
pageId = self.startId()
try:
first_page = self._pages[pageId]
except KeyError:
... | [
"def",
"restart",
"(",
"self",
")",
":",
"for",
"page",
"in",
"self",
".",
"_pages",
".",
"values",
"(",
")",
":",
"page",
".",
"hide",
"(",
")",
"pageId",
"=",
"self",
".",
"startId",
"(",
")",
"try",
":",
"first_page",
"=",
"self",
".",
"_pages... | Restarts the whole wizard from the beginning. | [
"Restarts",
"the",
"whole",
"wizard",
"from",
"the",
"beginning",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywizard.py#L673-L716 | train |
bitesofcode/projexui | projexui/widgets/xoverlaywizard.py | XOverlayWizard.removePage | def removePage(self, pageId):
"""
Removes the inputed page from this wizard.
:param pageId | <int>
"""
try:
self._pages[pageId].deleteLater()
del self._pages[pageId]
except KeyError:
pass | python | def removePage(self, pageId):
"""
Removes the inputed page from this wizard.
:param pageId | <int>
"""
try:
self._pages[pageId].deleteLater()
del self._pages[pageId]
except KeyError:
pass | [
"def",
"removePage",
"(",
"self",
",",
"pageId",
")",
":",
"try",
":",
"self",
".",
"_pages",
"[",
"pageId",
"]",
".",
"deleteLater",
"(",
")",
"del",
"self",
".",
"_pages",
"[",
"pageId",
"]",
"except",
"KeyError",
":",
"pass"
] | Removes the inputed page from this wizard.
:param pageId | <int> | [
"Removes",
"the",
"inputed",
"page",
"from",
"this",
"wizard",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywizard.py#L718-L728 | train |
bitesofcode/projexui | projexui/widgets/xoverlaywizard.py | XOverlayWizard.setButton | def setButton(self, which, button):
"""
Sets the button for this wizard for the inputed type.
:param which | <XOverlayWizard.WizardButton>
button | <QtGui.QPushButton>
"""
try:
self._buttons[which].deleteLater()
except KeyError:
... | python | def setButton(self, which, button):
"""
Sets the button for this wizard for the inputed type.
:param which | <XOverlayWizard.WizardButton>
button | <QtGui.QPushButton>
"""
try:
self._buttons[which].deleteLater()
except KeyError:
... | [
"def",
"setButton",
"(",
"self",
",",
"which",
",",
"button",
")",
":",
"try",
":",
"self",
".",
"_buttons",
"[",
"which",
"]",
".",
"deleteLater",
"(",
")",
"except",
"KeyError",
":",
"pass",
"button",
".",
"setParent",
"(",
"self",
")",
"self",
"."... | Sets the button for this wizard for the inputed type.
:param which | <XOverlayWizard.WizardButton>
button | <QtGui.QPushButton> | [
"Sets",
"the",
"button",
"for",
"this",
"wizard",
"for",
"the",
"inputed",
"type",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywizard.py#L747-L760 | train |
bitesofcode/projexui | projexui/widgets/xoverlaywizard.py | XOverlayWizard.setButtonText | def setButtonText(self, which, text):
"""
Sets the display text for the inputed button to the given text.
:param which | <XOverlayWizard.WizardButton>
text | <str>
"""
try:
self._buttons[which].setText(text)
except KeyError:
... | python | def setButtonText(self, which, text):
"""
Sets the display text for the inputed button to the given text.
:param which | <XOverlayWizard.WizardButton>
text | <str>
"""
try:
self._buttons[which].setText(text)
except KeyError:
... | [
"def",
"setButtonText",
"(",
"self",
",",
"which",
",",
"text",
")",
":",
"try",
":",
"self",
".",
"_buttons",
"[",
"which",
"]",
".",
"setText",
"(",
"text",
")",
"except",
"KeyError",
":",
"pass"
] | Sets the display text for the inputed button to the given text.
:param which | <XOverlayWizard.WizardButton>
text | <str> | [
"Sets",
"the",
"display",
"text",
"for",
"the",
"inputed",
"button",
"to",
"the",
"given",
"text",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywizard.py#L762-L772 | train |
bitesofcode/projexui | projexui/widgets/xoverlaywizard.py | XOverlayWizard.setPage | def setPage(self, pageId, page):
"""
Sets the page and id for the given page vs. auto-constructing it. This will allow the
developer to create a custom order for IDs.
:param pageId | <int>
page | <projexui.widgets.xoverlaywizard.XOverlayWizardPage>
""... | python | def setPage(self, pageId, page):
"""
Sets the page and id for the given page vs. auto-constructing it. This will allow the
developer to create a custom order for IDs.
:param pageId | <int>
page | <projexui.widgets.xoverlaywizard.XOverlayWizardPage>
""... | [
"def",
"setPage",
"(",
"self",
",",
"pageId",
",",
"page",
")",
":",
"page",
".",
"setParent",
"(",
"self",
")",
"if",
"self",
".",
"property",
"(",
"\"useShadow\"",
")",
"is",
"not",
"False",
":",
"effect",
"=",
"QtGui",
".",
"QGraphicsDropShadowEffect"... | Sets the page and id for the given page vs. auto-constructing it. This will allow the
developer to create a custom order for IDs.
:param pageId | <int>
page | <projexui.widgets.xoverlaywizard.XOverlayWizardPage> | [
"Sets",
"the",
"page",
"and",
"id",
"for",
"the",
"given",
"page",
"vs",
".",
"auto",
"-",
"constructing",
"it",
".",
"This",
"will",
"allow",
"the",
"developer",
"to",
"create",
"a",
"custom",
"order",
"for",
"IDs",
"."
] | f18a73bec84df90b034ca69b9deea118dbedfc4d | https://github.com/bitesofcode/projexui/blob/f18a73bec84df90b034ca69b9deea118dbedfc4d/projexui/widgets/xoverlaywizard.py#L816-L837 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.