hexsha
stringlengths
40
40
repo
stringlengths
7
114
path
stringlengths
4
124
license
listlengths
1
9
language
stringclasses
1 value
identifier
stringlengths
1
71
return_type
stringlengths
1
749
original_string
stringlengths
76
22.7k
original_docstring
stringlengths
16
7.61k
docstring
stringlengths
16
2.47k
docstring_tokens
listlengths
6
477
code
stringlengths
14
10.2k
code_tokens
listlengths
6
996
short_docstring
stringlengths
2
644
short_docstring_tokens
listlengths
1
116
comment
listlengths
1
89
parameters
listlengths
0
64
docstring_params
dict
044fca5aa12012cec41bf451b4b8213142a6067b
ATMOcanes/tropycal
src/tropycal/tracks/season.py
[ "MIT" ]
Python
to_dataframe
<not_specific>
def to_dataframe(self): r""" Converts the season dict into a pandas DataFrame object. Returns ------- `pandas.DataFrame` A pandas DataFrame object containing information about the season. """ #Try importing pandas try...
r""" Converts the season dict into a pandas DataFrame object. Returns ------- `pandas.DataFrame` A pandas DataFrame object containing information about the season.
r""" Converts the season dict into a pandas DataFrame object. Returns `pandas.DataFrame` A pandas DataFrame object containing information about the season.
[ "r", "\"", "\"", "\"", "Converts", "the", "season", "dict", "into", "a", "pandas", "DataFrame", "object", ".", "Returns", "`", "pandas", ".", "DataFrame", "`", "A", "pandas", "DataFrame", "object", "containing", "information", "about", "the", "season", "." ]
def to_dataframe(self): try: import pandas as pd except ImportError as e: raise RuntimeError("Error: pandas is not available. Install pandas in order to use this function.") from e season_info = self.summary() season_info_keys = season_info['id'] ds = {'id...
[ "def", "to_dataframe", "(", "self", ")", ":", "try", ":", "import", "pandas", "as", "pd", "except", "ImportError", "as", "e", ":", "raise", "RuntimeError", "(", "\"Error: pandas is not available. Install pandas in order to use this function.\"", ")", "from", "e", "sea...
r""" Converts the season dict into a pandas DataFrame object.
[ "r", "\"", "\"", "\"", "Converts", "the", "season", "dict", "into", "a", "pandas", "DataFrame", "object", "." ]
[ "r\"\"\"\n Converts the season dict into a pandas DataFrame object.\n \n Returns\n -------\n `pandas.DataFrame`\n A pandas DataFrame object containing information about the season.\n \"\"\"", "#Try importing pandas", "#Get season info", "#Set up empty dict ...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
651f27f67f6fd352309f49c6b1b8dc3beeb4bd95
ATMOcanes/tropycal
src/tropycal/utils/cartopy_utils.py
[ "MIT" ]
Python
add_tropycal
<not_specific>
def add_tropycal(ax): r""" Adds Tropycal plotting capability to a matplotlib.pyplot axes instance with a Cartopy projection. This axes instance must have already had a Cartopy projection added (e.g., ``projection=ccrs.PlateCarree()``). Parameters ---------- ax : cartopy.mpl.geoaxe...
r""" Adds Tropycal plotting capability to a matplotlib.pyplot axes instance with a Cartopy projection. This axes instance must have already had a Cartopy projection added (e.g., ``projection=ccrs.PlateCarree()``). Parameters ---------- ax : cartopy.mpl.geoaxes.GeoAxes Instance of a...
r""" Adds Tropycal plotting capability to a matplotlib.pyplot axes instance with a Cartopy projection. This axes instance must have already had a Cartopy projection added ``). Parameters ax : cartopy.mpl.geoaxes.GeoAxes Instance of a matplotlib axes with a Cartopy projection added. Returns ax The same axes instanc...
[ "r", "\"", "\"", "\"", "Adds", "Tropycal", "plotting", "capability", "to", "a", "matplotlib", ".", "pyplot", "axes", "instance", "with", "a", "Cartopy", "projection", ".", "This", "axes", "instance", "must", "have", "already", "had", "a", "Cartopy", "project...
def add_tropycal(ax): ax.plot_storm = types.MethodType( plot_storm, ax ) return ax
[ "def", "add_tropycal", "(", "ax", ")", ":", "ax", ".", "plot_storm", "=", "types", ".", "MethodType", "(", "plot_storm", ",", "ax", ")", "return", "ax" ]
r""" Adds Tropycal plotting capability to a matplotlib.pyplot axes instance with a Cartopy projection.
[ "r", "\"", "\"", "\"", "Adds", "Tropycal", "plotting", "capability", "to", "a", "matplotlib", ".", "pyplot", "axes", "instance", "with", "a", "Cartopy", "projection", "." ]
[ "r\"\"\"\n Adds Tropycal plotting capability to a matplotlib.pyplot axes instance with a Cartopy projection.\n \n This axes instance must have already had a Cartopy projection added (e.g., ``projection=ccrs.PlateCarree()``).\n \n Parameters\n ----------\n ax : cartopy.mpl.geoaxes.GeoAxes\n ...
[ { "param": "ax", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "ax", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
5b92e0ee1e2493cfe5c4bd47b9c9c5693b432ce7
ATMOcanes/tropycal
src/tropycal/rain/dataset.py
[ "MIT" ]
Python
interpolate_to_grid
<not_specific>
def interpolate_to_grid(self,storm,grid_res=0.1,method='linear',return_xarray=False): r""" Interpolates storm rainfall data to a horizontal grid. Interpolation is performed using Scipy's `scipy.interpolate.griddata()` interpolation function. Parameters ...
r""" Interpolates storm rainfall data to a horizontal grid. Interpolation is performed using Scipy's `scipy.interpolate.griddata()` interpolation function. Parameters ---------- storm : tropycal.tracks.Storm Instance of a Storm object. grid_r...
r""" Interpolates storm rainfall data to a horizontal grid. Interpolation is performed using Scipy's `scipy.interpolate.griddata()` interpolation function. Parameters storm : tropycal.tracks.Storm Instance of a Storm object. grid_res : int or float Horizontal resolution of the desired grid in degrees. Returns dict...
[ "r", "\"", "\"", "\"", "Interpolates", "storm", "rainfall", "data", "to", "a", "horizontal", "grid", ".", "Interpolation", "is", "performed", "using", "Scipy", "'", "s", "`", "scipy", ".", "interpolate", ".", "griddata", "()", "`", "interpolation", "function...
def interpolate_to_grid(self,storm,grid_res=0.1,method='linear',return_xarray=False): try: import xarray as xr except ImportError as e: return_xarray = False msg = "xarray is not installed in your python environment. Defaulting to return_xarray=False." war...
[ "def", "interpolate_to_grid", "(", "self", ",", "storm", ",", "grid_res", "=", "0.1", ",", "method", "=", "'linear'", ",", "return_xarray", "=", "False", ")", ":", "try", ":", "import", "xarray", "as", "xr", "except", "ImportError", "as", "e", ":", "retu...
r""" Interpolates storm rainfall data to a horizontal grid.
[ "r", "\"", "\"", "\"", "Interpolates", "storm", "rainfall", "data", "to", "a", "horizontal", "grid", "." ]
[ "r\"\"\"\n Interpolates storm rainfall data to a horizontal grid.\n \n Interpolation is performed using Scipy's `scipy.interpolate.griddata()` interpolation function.\n \n Parameters\n ----------\n storm : tropycal.tracks.Storm\n Instance of a Storm object...
[ { "param": "self", "type": null }, { "param": "storm", "type": null }, { "param": "grid_res", "type": null }, { "param": "method", "type": null }, { "param": "return_xarray", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "storm", "type": null, "docstring": null, "docstring_tokens": ...
e544116a8d7918be83e4af448f06abb95388dedb
mattaustin/gaussian
gaussian/feeds.py
[ "Apache-2.0" ]
Python
mark_as_read
<not_specific>
def mark_as_read(self): """Mark all stories in this feed as read.""" response = self._api_client.session.post( self._api_client._construct_url('/reader/mark_feed_as_read'), data={'feed_id': self.id}) return response.json()['result'] == 'ok'
Mark all stories in this feed as read.
Mark all stories in this feed as read.
[ "Mark", "all", "stories", "in", "this", "feed", "as", "read", "." ]
def mark_as_read(self): response = self._api_client.session.post( self._api_client._construct_url('/reader/mark_feed_as_read'), data={'feed_id': self.id}) return response.json()['result'] == 'ok'
[ "def", "mark_as_read", "(", "self", ")", ":", "response", "=", "self", ".", "_api_client", ".", "session", ".", "post", "(", "self", ".", "_api_client", ".", "_construct_url", "(", "'/reader/mark_feed_as_read'", ")", ",", "data", "=", "{", "'feed_id'", ":", ...
Mark all stories in this feed as read.
[ "Mark", "all", "stories", "in", "this", "feed", "as", "read", "." ]
[ "\"\"\"Mark all stories in this feed as read.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
9ce7bfb4241f59939bdcb06aabfa03be7b8bc555
mattaustin/gaussian
gaussian/__init__.py
[ "Apache-2.0" ]
Python
login
<not_specific>
def login(self): """Login to NewsBlur, using session (cookie) authentication.""" response = self.session.post(self._construct_url('/api/login'), data={'username': self.username, 'password': self.password}) # TODO: p...
Login to NewsBlur, using session (cookie) authentication.
Login to NewsBlur, using session (cookie) authentication.
[ "Login", "to", "NewsBlur", "using", "session", "(", "cookie", ")", "authentication", "." ]
def login(self): response = self.session.post(self._construct_url('/api/login'), data={'username': self.username, 'password': self.password}) self._logger.debug(response.content) assert response.json()['result'] == '...
[ "def", "login", "(", "self", ")", ":", "response", "=", "self", ".", "session", ".", "post", "(", "self", ".", "_construct_url", "(", "'/api/login'", ")", ",", "data", "=", "{", "'username'", ":", "self", ".", "username", ",", "'password'", ":", "self"...
Login to NewsBlur, using session (cookie) authentication.
[ "Login", "to", "NewsBlur", "using", "session", "(", "cookie", ")", "authentication", "." ]
[ "\"\"\"Login to NewsBlur, using session (cookie) authentication.\"\"\"", "# TODO: properly check for success, it appears server always returns", "# 200." ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
9ce7bfb4241f59939bdcb06aabfa03be7b8bc555
mattaustin/gaussian
gaussian/__init__.py
[ "Apache-2.0" ]
Python
mark_as_read
<not_specific>
def mark_as_read(self, days=0): """Mark all stories from all feeds as read. :param int days: Number of days back to mark as read. Default: 0 (all). """ response = self.session.post( self._construct_url('/reader/mark_all_as_read'), data={'days': days}) r...
Mark all stories from all feeds as read. :param int days: Number of days back to mark as read. Default: 0 (all).
Mark all stories from all feeds as read.
[ "Mark", "all", "stories", "from", "all", "feeds", "as", "read", "." ]
def mark_as_read(self, days=0): response = self.session.post( self._construct_url('/reader/mark_all_as_read'), data={'days': days}) return response.json()['result'] == 'ok'
[ "def", "mark_as_read", "(", "self", ",", "days", "=", "0", ")", ":", "response", "=", "self", ".", "session", ".", "post", "(", "self", ".", "_construct_url", "(", "'/reader/mark_all_as_read'", ")", ",", "data", "=", "{", "'days'", ":", "days", "}", ")...
Mark all stories from all feeds as read.
[ "Mark", "all", "stories", "from", "all", "feeds", "as", "read", "." ]
[ "\"\"\"Mark all stories from all feeds as read.\n\n :param int days: Number of days back to mark as read. Default: 0 (all).\n\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "days", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "days", "type": null, "docstring": "Number of days back to mark as r...
9ce7bfb4241f59939bdcb06aabfa03be7b8bc555
mattaustin/gaussian
gaussian/__init__.py
[ "Apache-2.0" ]
Python
mark_stories_as_read
<not_specific>
def mark_stories_as_read(self, stories): """Mark provided stories as read. :param list stories: List of :py:class:`~gaussian.stories.Story` instances. """ response = self.session.post( self._construct_url('/reader/mark_story_hashes_as_read'), data={...
Mark provided stories as read. :param list stories: List of :py:class:`~gaussian.stories.Story` instances.
Mark provided stories as read.
[ "Mark", "provided", "stories", "as", "read", "." ]
def mark_stories_as_read(self, stories): response = self.session.post( self._construct_url('/reader/mark_story_hashes_as_read'), data={'story_hash': [story.hash for story in stories]}) return response.json()['result'] == 'ok'
[ "def", "mark_stories_as_read", "(", "self", ",", "stories", ")", ":", "response", "=", "self", ".", "session", ".", "post", "(", "self", ".", "_construct_url", "(", "'/reader/mark_story_hashes_as_read'", ")", ",", "data", "=", "{", "'story_hash'", ":", "[", ...
Mark provided stories as read.
[ "Mark", "provided", "stories", "as", "read", "." ]
[ "\"\"\"Mark provided stories as read.\n\n :param list stories: List of :py:class:`~gaussian.stories.Story`\n instances.\n\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "stories", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "stories", "type": null, "docstring": "List of :py:class:`~gaussian....
f0f4702306fc51c37ce2cd43aded553f151eea46
uetke/UUTrap
Model/lib/xml2dict.py
[ "MIT" ]
Python
xmltodict
<not_specific>
def xmltodict(element): """converts the XML-file to a dictionary""" def xmltodict_handler(parent_element,result={}): for element in parent_element: if len(element): obj = xmltodict_handler(element) else: obj = element.attrib for i, ...
converts the XML-file to a dictionary
converts the XML-file to a dictionary
[ "converts", "the", "XML", "-", "file", "to", "a", "dictionary" ]
def xmltodict(element): def xmltodict_handler(parent_element,result={}): for element in parent_element: if len(element): obj = xmltodict_handler(element) else: obj = element.attrib for i, j in obj.items(): try: ...
[ "def", "xmltodict", "(", "element", ")", ":", "def", "xmltodict_handler", "(", "parent_element", ",", "result", "=", "{", "}", ")", ":", "for", "element", "in", "parent_element", ":", "if", "len", "(", "element", ")", ":", "obj", "=", "xmltodict_handler", ...
converts the XML-file to a dictionary
[ "converts", "the", "XML", "-", "file", "to", "a", "dictionary" ]
[ "\"\"\"converts the XML-file to a dictionary\"\"\"" ]
[ { "param": "element", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "element", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
88676be69b4e5d677e93bb1afc12fbf23ad51615
uetke/UUTrap
Model/lib/logger.py
[ "MIT" ]
Python
caller_name
<not_specific>
def caller_name(skip=2): """Get a name of a caller in the format module.class.method `skip` specifies how many levels of stack to skip while getting caller name. skip=1 means "who calls me", skip=2 "who calls my caller" etc. An empty string is returned if skipped levels exceed stac...
Get a name of a caller in the format module.class.method `skip` specifies how many levels of stack to skip while getting caller name. skip=1 means "who calls me", skip=2 "who calls my caller" etc. An empty string is returned if skipped levels exceed stack height
Get a name of a caller in the format module.class.method `skip` specifies how many levels of stack to skip while getting caller name. skip=1 means "who calls me", skip=2 "who calls my caller" etc. An empty string is returned if skipped levels exceed stack height
[ "Get", "a", "name", "of", "a", "caller", "in", "the", "format", "module", ".", "class", ".", "method", "`", "skip", "`", "specifies", "how", "many", "levels", "of", "stack", "to", "skip", "while", "getting", "caller", "name", ".", "skip", "=", "1", "...
def caller_name(skip=2): stack = inspect.stack() start = 0 + skip if len(stack) < start+1: return '' parentframe = stack[start][0] name = [] module = inspect.getmodule(parentframe) if module: name.append(module.__name__) if 'self' in parentframe.f_locals: name.a...
[ "def", "caller_name", "(", "skip", "=", "2", ")", ":", "stack", "=", "inspect", ".", "stack", "(", ")", "start", "=", "0", "+", "skip", "if", "len", "(", "stack", ")", "<", "start", "+", "1", ":", "return", "''", "parentframe", "=", "stack", "[",...
Get a name of a caller in the format module.class.method `skip` specifies how many levels of stack to skip while getting caller name.
[ "Get", "a", "name", "of", "a", "caller", "in", "the", "format", "module", ".", "class", ".", "method", "`", "skip", "`", "specifies", "how", "many", "levels", "of", "stack", "to", "skip", "while", "getting", "caller", "name", "." ]
[ "\"\"\"Get a name of a caller in the format module.class.method\n \n `skip` specifies how many levels of stack to skip while getting caller\n name. skip=1 means \"who calls me\", skip=2 \"who calls my caller\" etc.\n \n An empty string is returned if skipped levels exceed stack height\n ...
[ { "param": "skip", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "skip", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
9c195f9e7f4e512a49472b10dee31135f92500a4
uetke/UUTrap
View/Trap/mainWindow.py
[ "MIT" ]
Python
clearMonitor
null
def clearMonitor(self): """Clears the variables associated with the monitor and starts again. """ self.t =[] self.data = [] self.varData = [] self.varT = [] self.firstMon = [] self.firstVar = [] for i in range(len(self.devices)): self.t.append(...
Clears the variables associated with the monitor and starts again.
Clears the variables associated with the monitor and starts again.
[ "Clears", "the", "variables", "associated", "with", "the", "monitor", "and", "starts", "again", "." ]
def clearMonitor(self): self.t =[] self.data = [] self.varData = [] self.varT = [] self.firstMon = [] self.firstVar = [] for i in range(len(self.devices)): self.t.append(np.zeros([1,])) self.data.append(np.zeros([1,])) self.varD...
[ "def", "clearMonitor", "(", "self", ")", ":", "self", ".", "t", "=", "[", "]", "self", ".", "data", "=", "[", "]", "self", ".", "varData", "=", "[", "]", "self", ".", "varT", "=", "[", "]", "self", ".", "firstMon", "=", "[", "]", "self", ".",...
Clears the variables associated with the monitor and starts again.
[ "Clears", "the", "variables", "associated", "with", "the", "monitor", "and", "starts", "again", "." ]
[ "\"\"\"Clears the variables associated with the monitor and starts again. \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
9c195f9e7f4e512a49472b10dee31135f92500a4
uetke/UUTrap
View/Trap/mainWindow.py
[ "MIT" ]
Python
updateMon
null
def updateMon(self): """Function that gets the data from the ADQ and prepares it for updating the GUI. """ final_data = self.trap.readMonitor() # Have to be sure it is an ND array final_data = np.reshape(final_data, (self.trap.devsMonitor, int(len(final_data)/self.trap.devsMonitor))) ...
Function that gets the data from the ADQ and prepares it for updating the GUI.
Function that gets the data from the ADQ and prepares it for updating the GUI.
[ "Function", "that", "gets", "the", "data", "from", "the", "ADQ", "and", "prepares", "it", "for", "updating", "the", "GUI", "." ]
def updateMon(self): final_data = self.trap.readMonitor() final_data = np.reshape(final_data, (self.trap.devsMonitor, int(len(final_data)/self.trap.devsMonitor))) mean_data = np.mean(final_data,1) varData = np.var(final_data, 1) self.emit(QtCore.SIGNAL('TimeTraces'), final_data)...
[ "def", "updateMon", "(", "self", ")", ":", "final_data", "=", "self", ".", "trap", ".", "readMonitor", "(", ")", "final_data", "=", "np", ".", "reshape", "(", "final_data", ",", "(", "self", ".", "trap", ".", "devsMonitor", ",", "int", "(", "len", "(...
Function that gets the data from the ADQ and prepares it for updating the GUI.
[ "Function", "that", "gets", "the", "data", "from", "the", "ADQ", "and", "prepares", "it", "for", "updating", "the", "GUI", "." ]
[ "\"\"\"Function that gets the data from the ADQ and prepares it for updating the GUI.\n \"\"\"", "# Have to be sure it is an ND array" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
9c195f9e7f4e512a49472b10dee31135f92500a4
uetke/UUTrap
View/Trap/mainWindow.py
[ "MIT" ]
Python
updateTimes
null
def updateTimes(self,data): """Updates the plots of the timetraces. """ #Check the sizes of the variances var = copy.copy(data) for i in range(len(var)): xdata = np.arange(len(var[i]))*self._session.monitorTimeresol/1000 old_data = self.data[i] ...
Updates the plots of the timetraces.
Updates the plots of the timetraces.
[ "Updates", "the", "plots", "of", "the", "timetraces", "." ]
def updateTimes(self,data): var = copy.copy(data) for i in range(len(var)): xdata = np.arange(len(var[i]))*self._session.monitorTimeresol/1000 old_data = self.data[i] old_t = self.t[i] self.t[i] = np.append(self.t[i], xdata+max(self.t[i]) + self._session.m...
[ "def", "updateTimes", "(", "self", ",", "data", ")", ":", "var", "=", "copy", ".", "copy", "(", "data", ")", "for", "i", "in", "range", "(", "len", "(", "var", ")", ")", ":", "xdata", "=", "np", ".", "arange", "(", "len", "(", "var", "[", "i"...
Updates the plots of the timetraces.
[ "Updates", "the", "plots", "of", "the", "timetraces", "." ]
[ "\"\"\"Updates the plots of the timetraces.\n \"\"\"", "#Check the sizes of the variances" ]
[ { "param": "self", "type": null }, { "param": "data", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "data", "type": null, "docstring": null, "docstring_tokens": [...
9c195f9e7f4e512a49472b10dee31135f92500a4
uetke/UUTrap
View/Trap/mainWindow.py
[ "MIT" ]
Python
start_timer
null
def start_timer(self): """Starts the timer with a predefined update interval. It also starts the monitor routine. """ if not self.running: if self.powerSpectra.is_running: print('Cant update while power spectra is running.') else: c...
Starts the timer with a predefined update interval. It also starts the monitor routine.
Starts the timer with a predefined update interval. It also starts the monitor routine.
[ "Starts", "the", "timer", "with", "a", "predefined", "update", "interval", ".", "It", "also", "starts", "the", "monitor", "routine", "." ]
def start_timer(self): if not self.running: if self.powerSpectra.is_running: print('Cant update while power spectra is running.') else: conditions = {} conditions['devs'] = self.devices conditions['accuracy'] = self._session...
[ "def", "start_timer", "(", "self", ")", ":", "if", "not", "self", ".", "running", ":", "if", "self", ".", "powerSpectra", ".", "is_running", ":", "print", "(", "'Cant update while power spectra is running.'", ")", "else", ":", "conditions", "=", "{", "}", "c...
Starts the timer with a predefined update interval.
[ "Starts", "the", "timer", "with", "a", "predefined", "update", "interval", "." ]
[ "\"\"\"Starts the timer with a predefined update interval.\n It also starts the monitor routine.\n \"\"\"", "# Starts the timer for updating the GUI", "# In seconds" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
9c195f9e7f4e512a49472b10dee31135f92500a4
uetke/UUTrap
View/Trap/mainWindow.py
[ "MIT" ]
Python
stop_timer
null
def stop_timer(self): """Stops refreshing and the monitor. """ self.ctimer.stop() if self.running: self.trap.stopMonitor() self.running = False
Stops refreshing and the monitor.
Stops refreshing and the monitor.
[ "Stops", "refreshing", "and", "the", "monitor", "." ]
def stop_timer(self): self.ctimer.stop() if self.running: self.trap.stopMonitor() self.running = False
[ "def", "stop_timer", "(", "self", ")", ":", "self", ".", "ctimer", ".", "stop", "(", ")", "if", "self", ".", "running", ":", "self", ".", "trap", ".", "stopMonitor", "(", ")", "self", ".", "running", "=", "False" ]
Stops refreshing and the monitor.
[ "Stops", "refreshing", "and", "the", "monitor", "." ]
[ "\"\"\"Stops refreshing and the monitor.\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
9c195f9e7f4e512a49472b10dee31135f92500a4
uetke/UUTrap
View/Trap/mainWindow.py
[ "MIT" ]
Python
fileSave
<not_specific>
def fileSave(self): """Saves the files to a specified folder. """ name = 'Timetrace_Data' savedir = os.path.join(self._session.saveDirectory, str(datetime.now().date())) if not os.path.exists(savedir): os.makedirs(savedir) i=1 filename = name w...
Saves the files to a specified folder.
Saves the files to a specified folder.
[ "Saves", "the", "files", "to", "a", "specified", "folder", "." ]
def fileSave(self): name = 'Timetrace_Data' savedir = os.path.join(self._session.saveDirectory, str(datetime.now().date())) if not os.path.exists(savedir): os.makedirs(savedir) i=1 filename = name while os.path.exists(os.path.join(savedir,filename+".dat")): ...
[ "def", "fileSave", "(", "self", ")", ":", "name", "=", "'Timetrace_Data'", "savedir", "=", "os", ".", "path", ".", "join", "(", "self", ".", "_session", ".", "saveDirectory", ",", "str", "(", "datetime", ".", "now", "(", ")", ".", "date", "(", ")", ...
Saves the files to a specified folder.
[ "Saves", "the", "files", "to", "a", "specified", "folder", "." ]
[ "\"\"\"Saves the files to a specified folder.\n \"\"\"", "# Saves the data to binary format. Sometimes (not sure why) the ascii data is not being save properly...", "# Only what would appear on the screen when printing self.data." ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
9c195f9e7f4e512a49472b10dee31135f92500a4
uetke/UUTrap
View/Trap/mainWindow.py
[ "MIT" ]
Python
updateParameters
null
def updateParameters(self,_session): """Updates the relevant parameters for the monitor timetrace. """ self._session = _session self.powerSpectra._session = _session self.configWindow._session = _session self.stop_timer() self.start_timer()
Updates the relevant parameters for the monitor timetrace.
Updates the relevant parameters for the monitor timetrace.
[ "Updates", "the", "relevant", "parameters", "for", "the", "monitor", "timetrace", "." ]
def updateParameters(self,_session): self._session = _session self.powerSpectra._session = _session self.configWindow._session = _session self.stop_timer() self.start_timer()
[ "def", "updateParameters", "(", "self", ",", "_session", ")", ":", "self", ".", "_session", "=", "_session", "self", ".", "powerSpectra", ".", "_session", "=", "_session", "self", ".", "configWindow", ".", "_session", "=", "_session", "self", ".", "stop_time...
Updates the relevant parameters for the monitor timetrace.
[ "Updates", "the", "relevant", "parameters", "for", "the", "monitor", "timetrace", "." ]
[ "\"\"\"Updates the relevant parameters for the monitor timetrace.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "_session", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "_session", "type": null, "docstring": null, "docstring_tokens...
e03e2d5bf3af86601f79d167b708fca77e695c86
uetke/UUTrap
View/Trap/valueMonitor.py
[ "MIT" ]
Python
UpdateValues
null
def UpdateValues(self,data): ''' Updates the values displayed. Asumes a particular order of the data being passed ''' self.qpdx.display(data[0]) self.qpdy.display(data[1]) self.qpdz.display(data[2])
Updates the values displayed. Asumes a particular order of the data being passed
Updates the values displayed. Asumes a particular order of the data being passed
[ "Updates", "the", "values", "displayed", ".", "Asumes", "a", "particular", "order", "of", "the", "data", "being", "passed" ]
def UpdateValues(self,data): self.qpdx.display(data[0]) self.qpdy.display(data[1]) self.qpdz.display(data[2])
[ "def", "UpdateValues", "(", "self", ",", "data", ")", ":", "self", ".", "qpdx", ".", "display", "(", "data", "[", "0", "]", ")", "self", ".", "qpdy", ".", "display", "(", "data", "[", "1", "]", ")", "self", ".", "qpdz", ".", "display", "(", "da...
Updates the values displayed.
[ "Updates", "the", "values", "displayed", "." ]
[ "''' Updates the values displayed. Asumes a particular order of the data being passed\n '''" ]
[ { "param": "self", "type": null }, { "param": "data", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "data", "type": null, "docstring": null, "docstring_tokens": [...
1794c1d7a0dcfcdffbba77977ad631561aa307e1
uetke/UUTrap
View/Trap/powerSpectra.py
[ "MIT" ]
Python
stop_acq
null
def stop_acq(self): """ Stops the continuous runs. Emmits a signal for continuing with the timetraces. """ _session.runs = False self.emit(QtCore.SIGNAL('Start_Tr'))
Stops the continuous runs. Emmits a signal for continuing with the timetraces.
Stops the continuous runs. Emmits a signal for continuing with the timetraces.
[ "Stops", "the", "continuous", "runs", ".", "Emmits", "a", "signal", "for", "continuing", "with", "the", "timetraces", "." ]
def stop_acq(self): _session.runs = False self.emit(QtCore.SIGNAL('Start_Tr'))
[ "def", "stop_acq", "(", "self", ")", ":", "_session", ".", "runs", "=", "False", "self", ".", "emit", "(", "QtCore", ".", "SIGNAL", "(", "'Start_Tr'", ")", ")" ]
Stops the continuous runs.
[ "Stops", "the", "continuous", "runs", "." ]
[ "\"\"\" Stops the continuous runs.\n Emmits a signal for continuing with the timetraces.\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
1794c1d7a0dcfcdffbba77977ad631561aa307e1
uetke/UUTrap
View/Trap/powerSpectra.py
[ "MIT" ]
Python
update
null
def update(self): """ Connects the signals of the working Thread with the appropriate functions in the main Class. """ self.statusbar.showMessage('Running...') self.setStatusTip('Running...') if self.is_running == False: self.is_running = True ...
Connects the signals of the working Thread with the appropriate functions in the main Class.
Connects the signals of the working Thread with the appropriate functions in the main Class.
[ "Connects", "the", "signals", "of", "the", "working", "Thread", "with", "the", "appropriate", "functions", "in", "the", "main", "Class", "." ]
def update(self): self.statusbar.showMessage('Running...') self.setStatusTip('Running...') if self.is_running == False: self.is_running = True self.workThread.start() else: print('Try to re-run')
[ "def", "update", "(", "self", ")", ":", "self", ".", "statusbar", ".", "showMessage", "(", "'Running...'", ")", "self", ".", "setStatusTip", "(", "'Running...'", ")", "if", "self", ".", "is_running", "==", "False", ":", "self", ".", "is_running", "=", "T...
Connects the signals of the working Thread with the appropriate functions in the main Class.
[ "Connects", "the", "signals", "of", "the", "working", "Thread", "with", "the", "appropriate", "functions", "in", "the", "main", "Class", "." ]
[ "\"\"\" Connects the signals of the working Thread with the appropriate\n functions in the main Class.\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
1794c1d7a0dcfcdffbba77977ad631561aa307e1
uetke/UUTrap
View/Trap/powerSpectra.py
[ "MIT" ]
Python
updateGUI
null
def updateGUI(self,frequencies,data,values): """Updates the curves in the screen and the mean values. """ self.setStatusTip('Stopped...') self.is_running = False self.data = data self.freqs = frequencies self.curvex.setData(self.freqs[1:],values[1,1:]) sel...
Updates the curves in the screen and the mean values.
Updates the curves in the screen and the mean values.
[ "Updates", "the", "curves", "in", "the", "screen", "and", "the", "mean", "values", "." ]
def updateGUI(self,frequencies,data,values): self.setStatusTip('Stopped...') self.is_running = False self.data = data self.freqs = frequencies self.curvex.setData(self.freqs[1:],values[1,1:]) self.curvey.setData(self.freqs[1:],values[0,1:]) self.curvez.setData(sel...
[ "def", "updateGUI", "(", "self", ",", "frequencies", ",", "data", ",", "values", ")", ":", "self", ".", "setStatusTip", "(", "'Stopped...'", ")", "self", ".", "is_running", "=", "False", "self", ".", "data", "=", "data", "self", ".", "freqs", "=", "fre...
Updates the curves in the screen and the mean values.
[ "Updates", "the", "curves", "in", "the", "screen", "and", "the", "mean", "values", "." ]
[ "\"\"\"Updates the curves in the screen and the mean values.\n \"\"\"", "# If the continuous runs is activated, then refresh." ]
[ { "param": "self", "type": null }, { "param": "frequencies", "type": null }, { "param": "data", "type": null }, { "param": "values", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "frequencies", "type": null, "docstring": null, "docstring_tok...
1794c1d7a0dcfcdffbba77977ad631561aa307e1
uetke/UUTrap
View/Trap/powerSpectra.py
[ "MIT" ]
Python
fileSave
<not_specific>
def fileSave(self): """Saves the files to a specified folder. """ name = 'PowerSpectra_Data' savedir = os.path.join(self._session.saveDirectory, str(datetime.now().date())) if not os.path.exists(savedir): os.makedirs(savedir) i=1 filename = name ...
Saves the files to a specified folder.
Saves the files to a specified folder.
[ "Saves", "the", "files", "to", "a", "specified", "folder", "." ]
def fileSave(self): name = 'PowerSpectra_Data' savedir = os.path.join(self._session.saveDirectory, str(datetime.now().date())) if not os.path.exists(savedir): os.makedirs(savedir) i=1 filename = name while os.path.exists(os.path.join(savedir,filename+".dat")):...
[ "def", "fileSave", "(", "self", ")", ":", "name", "=", "'PowerSpectra_Data'", "savedir", "=", "os", ".", "path", ".", "join", "(", "self", ".", "_session", ".", "saveDirectory", ",", "str", "(", "datetime", ".", "now", "(", ")", ".", "date", "(", ")"...
Saves the files to a specified folder.
[ "Saves", "the", "files", "to", "a", "specified", "folder", "." ]
[ "\"\"\"Saves the files to a specified folder.\n \"\"\"", "# Saves the data to binary format. Sometimes (not sure why) the ascii data is not being save properly...", "# Only what would appear on the screen when printing self.data." ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
1794c1d7a0dcfcdffbba77977ad631561aa307e1
uetke/UUTrap
View/Trap/powerSpectra.py
[ "MIT" ]
Python
exit_safe
null
def exit_safe(self): """ Exits the application stopping the working Thread. """ if self._session.highSpeedTime>5: # To avoid impatience to force the shutdown. print('Waiting for the acquisition to finish.') print('It may take up to %s more seconds.'%_session.h...
Exits the application stopping the working Thread.
Exits the application stopping the working Thread.
[ "Exits", "the", "application", "stopping", "the", "working", "Thread", "." ]
def exit_safe(self): if self._session.highSpeedTime>5: print('Waiting for the acquisition to finish.') print('It may take up to %s more seconds.'%_session.highSpeedTime) self.workThread.terminate() self.close()
[ "def", "exit_safe", "(", "self", ")", ":", "if", "self", ".", "_session", ".", "highSpeedTime", ">", "5", ":", "print", "(", "'Waiting for the acquisition to finish.'", ")", "print", "(", "'It may take up to %s more seconds.'", "%", "_session", ".", "highSpeedTime",...
Exits the application stopping the working Thread.
[ "Exits", "the", "application", "stopping", "the", "working", "Thread", "." ]
[ "\"\"\" Exits the application stopping the working Thread.\n \"\"\"", "# To avoid impatience to force the shutdown." ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
748c1013230a75053c1122500678c54300b22408
uetke/UUTrap
Model/trap.py
[ "MIT" ]
Python
triggerAnalog
null
def triggerAnalog(self,conditions): """Triggers an analog measurement. It does not read the value. conditions -- a dictionary with the needed parameters for an analog acquisition. """ if self._session.adq['type'] == 'ni': self.adq.analogSetup(conditions['channel'],conditions[...
Triggers an analog measurement. It does not read the value. conditions -- a dictionary with the needed parameters for an analog acquisition.
Triggers an analog measurement. It does not read the value. conditions -- a dictionary with the needed parameters for an analog acquisition.
[ "Triggers", "an", "analog", "measurement", ".", "It", "does", "not", "read", "the", "value", ".", "conditions", "--", "a", "dictionary", "with", "the", "needed", "parameters", "for", "an", "analog", "acquisition", "." ]
def triggerAnalog(self,conditions): if self._session.adq['type'] == 'ni': self.adq.analogSetup(conditions['channel'],conditions['points'],conditions['accuracy'],conditions['limits']) self.adq.analogTrigger() self.running = True else: raise Exception('Othe...
[ "def", "triggerAnalog", "(", "self", ",", "conditions", ")", ":", "if", "self", ".", "_session", ".", "adq", "[", "'type'", "]", "==", "'ni'", ":", "self", ".", "adq", ".", "analogSetup", "(", "conditions", "[", "'channel'", "]", ",", "conditions", "["...
Triggers an analog measurement.
[ "Triggers", "an", "analog", "measurement", "." ]
[ "\"\"\"Triggers an analog measurement. It does not read the value.\n conditions -- a dictionary with the needed parameters for an analog acquisition.\n \"\"\"", "# Starts the measurement." ]
[ { "param": "self", "type": null }, { "param": "conditions", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "conditions", "type": null, "docstring": null, "docstring_toke...
748c1013230a75053c1122500678c54300b22408
uetke/UUTrap
Model/trap.py
[ "MIT" ]
Python
startMonitor
null
def startMonitor(self,conditions): """Starts continuous acquisition of the specified channels with the specified timing interval. conditions['devs'] -- list of devices to monitor conditions['accuracy'] -- accuracy for the monitor. If not defined defaults to 0.1s """ self.monitorT...
Starts continuous acquisition of the specified channels with the specified timing interval. conditions['devs'] -- list of devices to monitor conditions['accuracy'] -- accuracy for the monitor. If not defined defaults to 0.1s
Starts continuous acquisition of the specified channels with the specified timing interval. conditions['devs'] -- list of devices to monitor conditions['accuracy'] -- accuracy for the monitor. If not defined defaults to 0.1s
[ "Starts", "continuous", "acquisition", "of", "the", "specified", "channels", "with", "the", "specified", "timing", "interval", ".", "conditions", "[", "'", "devs", "'", "]", "--", "list", "of", "devices", "to", "monitor", "conditions", "[", "'", "accuracy", ...
def startMonitor(self,conditions): self.monitorTask = self.tasks['Monitor'] channels = [] if conditions['accuracy']>0: accuracy = conditions['accuracy'] else: accuracy = 0.1 if self._session.adq['type'] == 'ni': if type(conditions['devs']) == ...
[ "def", "startMonitor", "(", "self", ",", "conditions", ")", ":", "self", ".", "monitorTask", "=", "self", ".", "tasks", "[", "'Monitor'", "]", "channels", "=", "[", "]", "if", "conditions", "[", "'accuracy'", "]", ">", "0", ":", "accuracy", "=", "condi...
Starts continuous acquisition of the specified channels with the specified timing interval.
[ "Starts", "continuous", "acquisition", "of", "the", "specified", "channels", "with", "the", "specified", "timing", "interval", "." ]
[ "\"\"\"Starts continuous acquisition of the specified channels with the specified timing interval.\n conditions['devs'] -- list of devices to monitor\n conditions['accuracy'] -- accuracy for the monitor. If not defined defaults to 0.1s\n \"\"\"", "# 100 milliseconds", "# print('Channel: %s'...
[ { "param": "self", "type": null }, { "param": "conditions", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "conditions", "type": null, "docstring": null, "docstring_toke...
748c1013230a75053c1122500678c54300b22408
uetke/UUTrap
Model/trap.py
[ "MIT" ]
Python
readMonitor
<not_specific>
def readMonitor(self): """Reads the monitor values of all the channels specified. """ val,data = self.adq.analogRead(self.monitorNum,-1) return data[:val*self.devsMonitor]
Reads the monitor values of all the channels specified.
Reads the monitor values of all the channels specified.
[ "Reads", "the", "monitor", "values", "of", "all", "the", "channels", "specified", "." ]
def readMonitor(self): val,data = self.adq.analogRead(self.monitorNum,-1) return data[:val*self.devsMonitor]
[ "def", "readMonitor", "(", "self", ")", ":", "val", ",", "data", "=", "self", ".", "adq", ".", "analogRead", "(", "self", ".", "monitorNum", ",", "-", "1", ")", "return", "data", "[", ":", "val", "*", "self", ".", "devsMonitor", "]" ]
Reads the monitor values of all the channels specified.
[ "Reads", "the", "monitor", "values", "of", "all", "the", "channels", "specified", "." ]
[ "\"\"\"Reads the monitor values of all the channels specified.\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
748c1013230a75053c1122500678c54300b22408
uetke/UUTrap
Model/trap.py
[ "MIT" ]
Python
stopMonitor
null
def stopMonitor(self): """Stops all the tasks related to the monitor. """ if self._session.adq['type'] == 'ni': self.adq.clear(self.monitorNum)
Stops all the tasks related to the monitor.
Stops all the tasks related to the monitor.
[ "Stops", "all", "the", "tasks", "related", "to", "the", "monitor", "." ]
def stopMonitor(self): if self._session.adq['type'] == 'ni': self.adq.clear(self.monitorNum)
[ "def", "stopMonitor", "(", "self", ")", ":", "if", "self", ".", "_session", ".", "adq", "[", "'type'", "]", "==", "'ni'", ":", "self", ".", "adq", ".", "clear", "(", "self", ".", "monitorNum", ")" ]
Stops all the tasks related to the monitor.
[ "Stops", "all", "the", "tasks", "related", "to", "the", "monitor", "." ]
[ "\"\"\"Stops all the tasks related to the monitor.\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
46c6025fef72039c5f060401c9d5ef6acfa04219
PatrykGorol/SudokuSolver
sudokusolver.py
[ "MIT" ]
Python
solve
None
def solve(self) -> None: ''' Backtracking method of solving sudoku. For consecutive empty cells method checks subsequent numbers (from 1 to 9). If number is permissible, program inserts number and moves to next empty cell. If number in impermissible, program checks next number. ...
Backtracking method of solving sudoku. For consecutive empty cells method checks subsequent numbers (from 1 to 9). If number is permissible, program inserts number and moves to next empty cell. If number in impermissible, program checks next number. If all 9 numbers were already...
Backtracking method of solving sudoku. For consecutive empty cells method checks subsequent numbers (from 1 to 9). If number is permissible, program inserts number and moves to next empty cell. If number in impermissible, program checks next number. If all 9 numbers were already checked and none of them was permissible...
[ "Backtracking", "method", "of", "solving", "sudoku", ".", "For", "consecutive", "empty", "cells", "method", "checks", "subsequent", "numbers", "(", "from", "1", "to", "9", ")", ".", "If", "number", "is", "permissible", "program", "inserts", "number", "and", ...
def solve(self) -> None: cell_index = 0 while cell_index < len(self.empty_cells): coordinates = self.empty_cells[cell_index] row, column = coordinates number = self.test_numbers[coordinates] if number == 10: self.insert_number(row, column) ...
[ "def", "solve", "(", "self", ")", "->", "None", ":", "cell_index", "=", "0", "while", "cell_index", "<", "len", "(", "self", ".", "empty_cells", ")", ":", "coordinates", "=", "self", ".", "empty_cells", "[", "cell_index", "]", "row", ",", "column", "="...
Backtracking method of solving sudoku.
[ "Backtracking", "method", "of", "solving", "sudoku", "." ]
[ "'''\n Backtracking method of solving sudoku.\n For consecutive empty cells method checks subsequent numbers (from 1 to 9).\n If number is permissible, program inserts number and moves to next empty cell.\n If number in impermissible, program checks next number.\n If all 9 numbers...
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
46c6025fef72039c5f060401c9d5ef6acfa04219
PatrykGorol/SudokuSolver
sudokusolver.py
[ "MIT" ]
Python
validate_number
bool
def validate_number(self, row: int, column: int, number: int) -> bool: ''' Checks if number is available in place indicated by coordinates. If such number is already present in row, column or box, method returns False. :param row: row coordinate of cell :param column: column coor...
Checks if number is available in place indicated by coordinates. If such number is already present in row, column or box, method returns False. :param row: row coordinate of cell :param column: column coordinate of cell :param number: number for checking :return: True if...
Checks if number is available in place indicated by coordinates. If such number is already present in row, column or box, method returns False.
[ "Checks", "if", "number", "is", "available", "in", "place", "indicated", "by", "coordinates", ".", "If", "such", "number", "is", "already", "present", "in", "row", "column", "or", "box", "method", "returns", "False", "." ]
def validate_number(self, row: int, column: int, number: int) -> bool: if number in self.sudoku[row, :]: return False if number in self.sudoku[:, column]: return False box_row, box_column = row // 3 * 3, column // 3 * 3 if number in self.sudoku[box_row:box_row + 3...
[ "def", "validate_number", "(", "self", ",", "row", ":", "int", ",", "column", ":", "int", ",", "number", ":", "int", ")", "->", "bool", ":", "if", "number", "in", "self", ".", "sudoku", "[", "row", ",", ":", "]", ":", "return", "False", "if", "nu...
Checks if number is available in place indicated by coordinates.
[ "Checks", "if", "number", "is", "available", "in", "place", "indicated", "by", "coordinates", "." ]
[ "'''\n Checks if number is available in place indicated by coordinates.\n If such number is already present in row, column or box, method returns False.\n :param row: row coordinate of cell\n :param column: column coordinate of cell\n :param number: number for checking\n :r...
[ { "param": "self", "type": null }, { "param": "row", "type": "int" }, { "param": "column", "type": "int" }, { "param": "number", "type": "int" } ]
{ "returns": [ { "docstring": "True if number is valid in this place, False otherwise", "docstring_tokens": [ "True", "if", "number", "is", "valid", "in", "this", "place", "False", "otherwise" ], "type": null ...
46c6025fef72039c5f060401c9d5ef6acfa04219
PatrykGorol/SudokuSolver
sudokusolver.py
[ "MIT" ]
Python
insert_number
None
def insert_number(self, row: int, column: int, number: int = 0) -> None: ''' Insert number into cell of provided coordinates. :param row: row coordinate of cell to fill :param column: column coordinate of cell to fill :param number: number to insert :return: None ...
Insert number into cell of provided coordinates. :param row: row coordinate of cell to fill :param column: column coordinate of cell to fill :param number: number to insert :return: None
Insert number into cell of provided coordinates.
[ "Insert", "number", "into", "cell", "of", "provided", "coordinates", "." ]
def insert_number(self, row: int, column: int, number: int = 0) -> None: self.sudoku[row, column] = number return None
[ "def", "insert_number", "(", "self", ",", "row", ":", "int", ",", "column", ":", "int", ",", "number", ":", "int", "=", "0", ")", "->", "None", ":", "self", ".", "sudoku", "[", "row", ",", "column", "]", "=", "number", "return", "None" ]
Insert number into cell of provided coordinates.
[ "Insert", "number", "into", "cell", "of", "provided", "coordinates", "." ]
[ "'''\n Insert number into cell of provided coordinates.\n :param row: row coordinate of cell to fill\n :param column: column coordinate of cell to fill\n :param number: number to insert\n :return: None\n '''" ]
[ { "param": "self", "type": null }, { "param": "row", "type": "int" }, { "param": "column", "type": "int" }, { "param": "number", "type": "int" } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
46c6025fef72039c5f060401c9d5ef6acfa04219
PatrykGorol/SudokuSolver
sudokusolver.py
[ "MIT" ]
Python
validate_sudoku
int
def validate_sudoku(self) -> int: """ Checks if sudoku array is valid, i.e. if rows, columns or boxes don't contain duplicated numbers. :return: 0 if array is empty, 1 if is valid, -1 if invalid """ if np.count_nonzero(self.sudoku) == 0: return 0 if not self.c...
Checks if sudoku array is valid, i.e. if rows, columns or boxes don't contain duplicated numbers. :return: 0 if array is empty, 1 if is valid, -1 if invalid
Checks if sudoku array is valid, i.e. if rows, columns or boxes don't contain duplicated numbers.
[ "Checks", "if", "sudoku", "array", "is", "valid", "i", ".", "e", ".", "if", "rows", "columns", "or", "boxes", "don", "'", "t", "contain", "duplicated", "numbers", "." ]
def validate_sudoku(self) -> int: if np.count_nonzero(self.sudoku) == 0: return 0 if not self.check_occurences(): return -1 return 1
[ "def", "validate_sudoku", "(", "self", ")", "->", "int", ":", "if", "np", ".", "count_nonzero", "(", "self", ".", "sudoku", ")", "==", "0", ":", "return", "0", "if", "not", "self", ".", "check_occurences", "(", ")", ":", "return", "-", "1", "return",...
Checks if sudoku array is valid, i.e.
[ "Checks", "if", "sudoku", "array", "is", "valid", "i", ".", "e", "." ]
[ "\"\"\"\n Checks if sudoku array is valid, i.e. if rows, columns or boxes don't contain duplicated numbers.\n :return: 0 if array is empty, 1 if is valid, -1 if invalid\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "0 if array is empty, 1 if is valid, -1 if invalid", "docstring_tokens": [ "0", "if", "array", "is", "empty", "1", "if", "is", "valid", "-", "1", "if", "invalid" ...
46c6025fef72039c5f060401c9d5ef6acfa04219
PatrykGorol/SudokuSolver
sudokusolver.py
[ "MIT" ]
Python
check_occurences
bool
def check_occurences(self) -> bool: ''' Checks if every row, column and box contains only one occurrence of number. :return: True if sudoku is valid, otherwise False ''' for e in range(0, 9): for number in range(1, 10): if np.count_nonzero(self.sudoku[...
Checks if every row, column and box contains only one occurrence of number. :return: True if sudoku is valid, otherwise False
Checks if every row, column and box contains only one occurrence of number.
[ "Checks", "if", "every", "row", "column", "and", "box", "contains", "only", "one", "occurrence", "of", "number", "." ]
def check_occurences(self) -> bool: for e in range(0, 9): for number in range(1, 10): if np.count_nonzero(self.sudoku[e, :] == number) > 1: return False if np.count_nonzero(self.sudoku[:, e] == number) > 1: return False ...
[ "def", "check_occurences", "(", "self", ")", "->", "bool", ":", "for", "e", "in", "range", "(", "0", ",", "9", ")", ":", "for", "number", "in", "range", "(", "1", ",", "10", ")", ":", "if", "np", ".", "count_nonzero", "(", "self", ".", "sudoku", ...
Checks if every row, column and box contains only one occurrence of number.
[ "Checks", "if", "every", "row", "column", "and", "box", "contains", "only", "one", "occurrence", "of", "number", "." ]
[ "'''\n Checks if every row, column and box contains only one occurrence of number.\n :return: True if sudoku is valid, otherwise False\n '''" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "True if sudoku is valid, otherwise False", "docstring_tokens": [ "True", "if", "sudoku", "is", "valid", "otherwise", "False" ], "type": null } ], "raises": [], "params": [ { "identifi...
46c6025fef72039c5f060401c9d5ef6acfa04219
PatrykGorol/SudokuSolver
sudokusolver.py
[ "MIT" ]
Python
is_sudoku_completed
bool
def is_sudoku_completed(self) -> bool: """ Checks if there are no blank cells and all elements are correctly filled. :return: bool """ if np.count_nonzero(self.sudoku) == 81: if self.check_occurences(): return True return False
Checks if there are no blank cells and all elements are correctly filled. :return: bool
Checks if there are no blank cells and all elements are correctly filled.
[ "Checks", "if", "there", "are", "no", "blank", "cells", "and", "all", "elements", "are", "correctly", "filled", "." ]
def is_sudoku_completed(self) -> bool: if np.count_nonzero(self.sudoku) == 81: if self.check_occurences(): return True return False
[ "def", "is_sudoku_completed", "(", "self", ")", "->", "bool", ":", "if", "np", ".", "count_nonzero", "(", "self", ".", "sudoku", ")", "==", "81", ":", "if", "self", ".", "check_occurences", "(", ")", ":", "return", "True", "return", "False" ]
Checks if there are no blank cells and all elements are correctly filled.
[ "Checks", "if", "there", "are", "no", "blank", "cells", "and", "all", "elements", "are", "correctly", "filled", "." ]
[ "\"\"\"\n Checks if there are no blank cells and all elements are correctly filled.\n :return: bool\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
main_sequence
None
def main_sequence(self) -> None: """ General flow of procedures. Starts with basic checks for blank cell that can be already completed. Then the main solving methods are used. If sudoku is still incomplete after previous procedures, program tries random insertions. :return: None ...
General flow of procedures. Starts with basic checks for blank cell that can be already completed. Then the main solving methods are used. If sudoku is still incomplete after previous procedures, program tries random insertions. :return: None
General flow of procedures. Starts with basic checks for blank cell that can be already completed. Then the main solving methods are used. If sudoku is still incomplete after previous procedures, program tries random insertions.
[ "General", "flow", "of", "procedures", ".", "Starts", "with", "basic", "checks", "for", "blank", "cell", "that", "can", "be", "already", "completed", ".", "Then", "the", "main", "solving", "methods", "are", "used", ".", "If", "sudoku", "is", "still", "inco...
def main_sequence(self) -> None: if not self.is_sudoku_completed(): self.pre_solving_check() self.solve() self.backtracking() return None
[ "def", "main_sequence", "(", "self", ")", "->", "None", ":", "if", "not", "self", ".", "is_sudoku_completed", "(", ")", ":", "self", ".", "pre_solving_check", "(", ")", "self", ".", "solve", "(", ")", "self", ".", "backtracking", "(", ")", "return", "N...
General flow of procedures.
[ "General", "flow", "of", "procedures", "." ]
[ "\"\"\"\n General flow of procedures. Starts with basic checks for blank cell that can be already completed.\n Then the main solving methods are used.\n If sudoku is still incomplete after previous procedures, program tries random insertions.\n :return: None\n \"\"\"", "# self.t...
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
validate_sudoku
int
def validate_sudoku(self) -> int: """ Checks if sudoku array is valid, i.e. if rows, columns or squares don't contain duplicated digits. :return: 0 if array is empty, 1 if is valid, -1 if invalid """ if self.s.elements_count[0] == 81: return 0 if not self.chec...
Checks if sudoku array is valid, i.e. if rows, columns or squares don't contain duplicated digits. :return: 0 if array is empty, 1 if is valid, -1 if invalid
Checks if sudoku array is valid, i.e. if rows, columns or squares don't contain duplicated digits.
[ "Checks", "if", "sudoku", "array", "is", "valid", "i", ".", "e", ".", "if", "rows", "columns", "or", "squares", "don", "'", "t", "contain", "duplicated", "digits", "." ]
def validate_sudoku(self) -> int: if self.s.elements_count[0] == 81: return 0 if not self.check_occurences(): return -1 return 1
[ "def", "validate_sudoku", "(", "self", ")", "->", "int", ":", "if", "self", ".", "s", ".", "elements_count", "[", "0", "]", "==", "81", ":", "return", "0", "if", "not", "self", ".", "check_occurences", "(", ")", ":", "return", "-", "1", "return", "...
Checks if sudoku array is valid, i.e.
[ "Checks", "if", "sudoku", "array", "is", "valid", "i", ".", "e", "." ]
[ "\"\"\"\n Checks if sudoku array is valid, i.e. if rows, columns or squares don't contain duplicated digits.\n :return: 0 if array is empty, 1 if is valid, -1 if invalid\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "0 if array is empty, 1 if is valid, -1 if invalid", "docstring_tokens": [ "0", "if", "array", "is", "empty", "1", "if", "is", "valid", "-", "1", "if", "invalid" ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
check_occurences
bool
def check_occurences(self) -> bool: """ Checks if every row, column and square contains only one occurrence of number. :return: True if sudoku is valid, otherwise False """ if self.check_if_one_occurence_of_digit(self.s.rows): if self.check_if_one_occurence_of_digit(s...
Checks if every row, column and square contains only one occurrence of number. :return: True if sudoku is valid, otherwise False
Checks if every row, column and square contains only one occurrence of number.
[ "Checks", "if", "every", "row", "column", "and", "square", "contains", "only", "one", "occurrence", "of", "number", "." ]
def check_occurences(self) -> bool: if self.check_if_one_occurence_of_digit(self.s.rows): if self.check_if_one_occurence_of_digit(self.s.columns): if self.check_if_one_occurence_of_digit(self.s.squares): return True return False
[ "def", "check_occurences", "(", "self", ")", "->", "bool", ":", "if", "self", ".", "check_if_one_occurence_of_digit", "(", "self", ".", "s", ".", "rows", ")", ":", "if", "self", ".", "check_if_one_occurence_of_digit", "(", "self", ".", "s", ".", "columns", ...
Checks if every row, column and square contains only one occurrence of number.
[ "Checks", "if", "every", "row", "column", "and", "square", "contains", "only", "one", "occurrence", "of", "number", "." ]
[ "\"\"\"\n Checks if every row, column and square contains only one occurrence of number.\n :return: True if sudoku is valid, otherwise False\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "True if sudoku is valid, otherwise False", "docstring_tokens": [ "True", "if", "sudoku", "is", "valid", "otherwise", "False" ], "type": null } ], "raises": [], "params": [ { "identifi...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
check_if_one_occurence_of_digit
bool
def check_if_one_occurence_of_digit(self, elements_list: List[SudokuElement]) -> bool: """ Checks if row, column or square contains only one of non-zero digits. :param elements_list: list of rows, columns or squares :return: bool """ for element in elements_list: ...
Checks if row, column or square contains only one of non-zero digits. :param elements_list: list of rows, columns or squares :return: bool
Checks if row, column or square contains only one of non-zero digits.
[ "Checks", "if", "row", "column", "or", "square", "contains", "only", "one", "of", "non", "-", "zero", "digits", "." ]
def check_if_one_occurence_of_digit(self, elements_list: List[SudokuElement]) -> bool: for element in elements_list: array = self.s.array[element.row_start:element.row_stop, element.column_start:element.column_stop] digits = [i for i in np.unique(array) if i > 0] for digit in...
[ "def", "check_if_one_occurence_of_digit", "(", "self", ",", "elements_list", ":", "List", "[", "SudokuElement", "]", ")", "->", "bool", ":", "for", "element", "in", "elements_list", ":", "array", "=", "self", ".", "s", ".", "array", "[", "element", ".", "r...
Checks if row, column or square contains only one of non-zero digits.
[ "Checks", "if", "row", "column", "or", "square", "contains", "only", "one", "of", "non", "-", "zero", "digits", "." ]
[ "\"\"\"\n Checks if row, column or square contains only one of non-zero digits.\n :param elements_list: list of rows, columns or squares\n :return: bool\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "elements_list", "type": "List[SudokuElement]" } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
pre_solving_check
None
def pre_solving_check(self) -> None: """ Checks if there are rows, columns or squares ready to fill. :return: None """ self.check_elements(self.s.rows) self.check_elements(self.s.columns) self.check_elements(self.s.squares) return None
Checks if there are rows, columns or squares ready to fill. :return: None
Checks if there are rows, columns or squares ready to fill.
[ "Checks", "if", "there", "are", "rows", "columns", "or", "squares", "ready", "to", "fill", "." ]
def pre_solving_check(self) -> None: self.check_elements(self.s.rows) self.check_elements(self.s.columns) self.check_elements(self.s.squares) return None
[ "def", "pre_solving_check", "(", "self", ")", "->", "None", ":", "self", ".", "check_elements", "(", "self", ".", "s", ".", "rows", ")", "self", ".", "check_elements", "(", "self", ".", "s", ".", "columns", ")", "self", ".", "check_elements", "(", "sel...
Checks if there are rows, columns or squares ready to fill.
[ "Checks", "if", "there", "are", "rows", "columns", "or", "squares", "ready", "to", "fill", "." ]
[ "\"\"\"\n Checks if there are rows, columns or squares ready to fill.\n :return: None\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
check_elements
None
def check_elements(self, elements_list: List[SudokuElement]) -> None: """ Checks if element can be completed immediately. :param elements_list: list of sudoku rows, columns, or squares :return: None """ for element in elements_list: self.fill_element(element) ...
Checks if element can be completed immediately. :param elements_list: list of sudoku rows, columns, or squares :return: None
Checks if element can be completed immediately.
[ "Checks", "if", "element", "can", "be", "completed", "immediately", "." ]
def check_elements(self, elements_list: List[SudokuElement]) -> None: for element in elements_list: self.fill_element(element) self.check_stack() return None
[ "def", "check_elements", "(", "self", ",", "elements_list", ":", "List", "[", "SudokuElement", "]", ")", "->", "None", ":", "for", "element", "in", "elements_list", ":", "self", ".", "fill_element", "(", "element", ")", "self", ".", "check_stack", "(", ")"...
Checks if element can be completed immediately.
[ "Checks", "if", "element", "can", "be", "completed", "immediately", "." ]
[ "\"\"\"\n Checks if element can be completed immediately.\n :param elements_list: list of sudoku rows, columns, or squares\n :return: None\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "elements_list", "type": "List[SudokuElement]" } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
fill_element
None
def fill_element(self, element: SudokuElement) -> None: """ For element with 8 digits already in place, find last number and insert into blank cell. Also upadte statistics of row, column and square containing filled cell. :param element: row, column or square :return: None ...
For element with 8 digits already in place, find last number and insert into blank cell. Also upadte statistics of row, column and square containing filled cell. :param element: row, column or square :return: None
For element with 8 digits already in place, find last number and insert into blank cell. Also upadte statistics of row, column and square containing filled cell.
[ "For", "element", "with", "8", "digits", "already", "in", "place", "find", "last", "number", "and", "insert", "into", "blank", "cell", ".", "Also", "upadte", "statistics", "of", "row", "column", "and", "square", "containing", "filled", "cell", "." ]
def fill_element(self, element: SudokuElement) -> None: if element.completed: return None if element.digits == 8: array = self.s.array[element.row_start:element.row_stop, element.column_start:element.column_stop] row_index, column_index = self.get_zero_coordinate(arra...
[ "def", "fill_element", "(", "self", ",", "element", ":", "SudokuElement", ")", "->", "None", ":", "if", "element", ".", "completed", ":", "return", "None", "if", "element", ".", "digits", "==", "8", ":", "array", "=", "self", ".", "s", ".", "array", ...
For element with 8 digits already in place, find last number and insert into blank cell.
[ "For", "element", "with", "8", "digits", "already", "in", "place", "find", "last", "number", "and", "insert", "into", "blank", "cell", "." ]
[ "\"\"\"\n For element with 8 digits already in place, find last number and insert into blank cell.\n Also upadte statistics of row, column and square containing filled cell.\n :param element: row, column or square\n :return: None\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "element", "type": "SudokuElement" } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
find_last_digit
int
def find_last_digit(self, array: np.ndarray) -> int: """ Get number an array is lacking. Searches only in available digits' list. :param array: sudoku element as an array of digits :return: number not present in an array; number to insert """ for digit in self.s.available...
Get number an array is lacking. Searches only in available digits' list. :param array: sudoku element as an array of digits :return: number not present in an array; number to insert
Get number an array is lacking. Searches only in available digits' list.
[ "Get", "number", "an", "array", "is", "lacking", ".", "Searches", "only", "in", "available", "digits", "'", "list", "." ]
def find_last_digit(self, array: np.ndarray) -> int: for digit in self.s.available_digits: if digit not in array: return digit
[ "def", "find_last_digit", "(", "self", ",", "array", ":", "np", ".", "ndarray", ")", "->", "int", ":", "for", "digit", "in", "self", ".", "s", ".", "available_digits", ":", "if", "digit", "not", "in", "array", ":", "return", "digit" ]
Get number an array is lacking.
[ "Get", "number", "an", "array", "is", "lacking", "." ]
[ "\"\"\"\n Get number an array is lacking. Searches only in available digits' list.\n :param array: sudoku element as an array of digits\n :return: number not present in an array; number to insert\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "array", "type": "np.ndarray" } ]
{ "returns": [ { "docstring": "number not present in an array; number to insert", "docstring_tokens": [ "number", "not", "present", "in", "an", "array", ";", "number", "to", "insert" ], "type": null } ], ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
insert_digit
None
def insert_digit(self, digit, row_index, column_index) -> None: """ Insert number into cell of provided coordinates, delete cell from list of zeros' coordinates. Upadtes available digits and statistics of row, column and square. :param digit: number to insert :param row_index: ro...
Insert number into cell of provided coordinates, delete cell from list of zeros' coordinates. Upadtes available digits and statistics of row, column and square. :param digit: number to insert :param row_index: row coordinate of cell to fill :param column_index: column coordinate...
Insert number into cell of provided coordinates, delete cell from list of zeros' coordinates. Upadtes available digits and statistics of row, column and square.
[ "Insert", "number", "into", "cell", "of", "provided", "coordinates", "delete", "cell", "from", "list", "of", "zeros", "'", "coordinates", ".", "Upadtes", "available", "digits", "and", "statistics", "of", "row", "column", "and", "square", "." ]
def insert_digit(self, digit, row_index, column_index) -> None: if digit is None: return None self.s.array[row_index, column_index] = digit self.s.zero_positions.remove((row_index, column_index)) self.update_available_elements(digit) self.update_elements_statistics(ro...
[ "def", "insert_digit", "(", "self", ",", "digit", ",", "row_index", ",", "column_index", ")", "->", "None", ":", "if", "digit", "is", "None", ":", "return", "None", "self", ".", "s", ".", "array", "[", "row_index", ",", "column_index", "]", "=", "digit...
Insert number into cell of provided coordinates, delete cell from list of zeros' coordinates.
[ "Insert", "number", "into", "cell", "of", "provided", "coordinates", "delete", "cell", "from", "list", "of", "zeros", "'", "coordinates", "." ]
[ "\"\"\"\n Insert number into cell of provided coordinates, delete cell from list of zeros' coordinates.\n Upadtes available digits and statistics of row, column and square.\n :param digit: number to insert\n :param row_index: row coordinate of cell to fill\n :param column_index: c...
[ { "param": "self", "type": null }, { "param": "digit", "type": null }, { "param": "row_index", "type": null }, { "param": "column_index", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
update_available_elements
None
def update_available_elements(self, digit: int) -> None: """ Adds number to the sudoku's number counter and upadates available digits. I inserted number is a 9th occurrence, number is removed from available digits' list. :param digit: inserted number :return: None """ ...
Adds number to the sudoku's number counter and upadates available digits. I inserted number is a 9th occurrence, number is removed from available digits' list. :param digit: inserted number :return: None
Adds number to the sudoku's number counter and upadates available digits. I inserted number is a 9th occurrence, number is removed from available digits' list.
[ "Adds", "number", "to", "the", "sudoku", "'", "s", "number", "counter", "and", "upadates", "available", "digits", ".", "I", "inserted", "number", "is", "a", "9th", "occurrence", "number", "is", "removed", "from", "available", "digits", "'", "list", "." ]
def update_available_elements(self, digit: int) -> None: self.s.elements_count[digit] += 1 self.s.set_available_digits() return None
[ "def", "update_available_elements", "(", "self", ",", "digit", ":", "int", ")", "->", "None", ":", "self", ".", "s", ".", "elements_count", "[", "digit", "]", "+=", "1", "self", ".", "s", ".", "set_available_digits", "(", ")", "return", "None" ]
Adds number to the sudoku's number counter and upadates available digits.
[ "Adds", "number", "to", "the", "sudoku", "'", "s", "number", "counter", "and", "upadates", "available", "digits", "." ]
[ "\"\"\"\n Adds number to the sudoku's number counter and upadates available digits.\n I inserted number is a 9th occurrence, number is removed from available digits' list.\n :param digit: inserted number\n :return: None\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "digit", "type": "int" } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
update_elements_statistics
None
def update_elements_statistics(self, row_index: int, column_index: int) -> None: """ Increment number of digits in row, column and square containing recently filled cell. Also adds those elements to stack in order to check if (after insertion) elements are easy solvable. :param row_index...
Increment number of digits in row, column and square containing recently filled cell. Also adds those elements to stack in order to check if (after insertion) elements are easy solvable. :param row_index: row coordinate of recently filled cell :param column_index: column coordinate of r...
Increment number of digits in row, column and square containing recently filled cell. Also adds those elements to stack in order to check if (after insertion) elements are easy solvable.
[ "Increment", "number", "of", "digits", "in", "row", "column", "and", "square", "containing", "recently", "filled", "cell", ".", "Also", "adds", "those", "elements", "to", "stack", "in", "order", "to", "check", "if", "(", "after", "insertion", ")", "elements"...
def update_elements_statistics(self, row_index: int, column_index: int) -> None: self.increment_digit_and_add_to_stack(self.s.rows[row_index]) self.increment_digit_and_add_to_stack(self.s.columns[column_index]) square_index = self.find_square(row_index, column_index) self.increment_digit...
[ "def", "update_elements_statistics", "(", "self", ",", "row_index", ":", "int", ",", "column_index", ":", "int", ")", "->", "None", ":", "self", ".", "increment_digit_and_add_to_stack", "(", "self", ".", "s", ".", "rows", "[", "row_index", "]", ")", "self", ...
Increment number of digits in row, column and square containing recently filled cell.
[ "Increment", "number", "of", "digits", "in", "row", "column", "and", "square", "containing", "recently", "filled", "cell", "." ]
[ "\"\"\"\n Increment number of digits in row, column and square containing recently filled cell.\n Also adds those elements to stack in order to check if (after insertion) elements are easy solvable.\n :param row_index: row coordinate of recently filled cell\n :param column_index: column ...
[ { "param": "self", "type": null }, { "param": "row_index", "type": "int" }, { "param": "column_index", "type": "int" } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
increment_digit_and_add_to_stack
None
def increment_digit_and_add_to_stack(self, element: SudokuElement) -> None: """ Increments number in element's counter and adds element into stack (queue of recently updates elements, which enable to check if elements are not easy solvable). :param element: sudoku element :return...
Increments number in element's counter and adds element into stack (queue of recently updates elements, which enable to check if elements are not easy solvable). :param element: sudoku element :return: None
Increments number in element's counter and adds element into stack (queue of recently updates elements, which enable to check if elements are not easy solvable).
[ "Increments", "number", "in", "element", "'", "s", "counter", "and", "adds", "element", "into", "stack", "(", "queue", "of", "recently", "updates", "elements", "which", "enable", "to", "check", "if", "elements", "are", "not", "easy", "solvable", ")", "." ]
def increment_digit_and_add_to_stack(self, element: SudokuElement) -> None: element.increment_digits() self.s.unchecked_stack.append(element) return None
[ "def", "increment_digit_and_add_to_stack", "(", "self", ",", "element", ":", "SudokuElement", ")", "->", "None", ":", "element", ".", "increment_digits", "(", ")", "self", ".", "s", ".", "unchecked_stack", ".", "append", "(", "element", ")", "return", "None" ]
Increments number in element's counter and adds element into stack (queue of recently updates elements, which enable to check if elements are not easy solvable).
[ "Increments", "number", "in", "element", "'", "s", "counter", "and", "adds", "element", "into", "stack", "(", "queue", "of", "recently", "updates", "elements", "which", "enable", "to", "check", "if", "elements", "are", "not", "easy", "solvable", ")", "." ]
[ "\"\"\"\n Increments number in element's counter and adds element into stack (queue of recently updates elements,\n which enable to check if elements are not easy solvable).\n :param element: sudoku element\n :return: None\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "element", "type": "SudokuElement" } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
find_square
int
def find_square(self, row_index: int, column_index: int) -> int: """ Check which sudoku square contains a cell of provided coordinates :param row_index: row coordinate of recently filled cell :param column_index: column coordinate of recently filled cell :return: number of square...
Check which sudoku square contains a cell of provided coordinates :param row_index: row coordinate of recently filled cell :param column_index: column coordinate of recently filled cell :return: number of square which contains cell of provided coordinates
Check which sudoku square contains a cell of provided coordinates
[ "Check", "which", "sudoku", "square", "contains", "a", "cell", "of", "provided", "coordinates" ]
def find_square(self, row_index: int, column_index: int) -> int: sq_number = 0 while not ( self.s.square_coordinates[sq_number][0] <= row_index < self.s.square_coordinates[sq_number][1] and self.s.square_coordinates[sq_number][2] <= column_index < self.s.s...
[ "def", "find_square", "(", "self", ",", "row_index", ":", "int", ",", "column_index", ":", "int", ")", "->", "int", ":", "sq_number", "=", "0", "while", "not", "(", "self", ".", "s", ".", "square_coordinates", "[", "sq_number", "]", "[", "0", "]", "<...
Check which sudoku square contains a cell of provided coordinates
[ "Check", "which", "sudoku", "square", "contains", "a", "cell", "of", "provided", "coordinates" ]
[ "\"\"\"\n Check which sudoku square contains a cell of provided coordinates\n :param row_index: row coordinate of recently filled cell\n :param column_index: column coordinate of recently filled cell\n :return: number of square which contains cell of provided coordinates\n \"\"\""...
[ { "param": "self", "type": null }, { "param": "row_index", "type": "int" }, { "param": "column_index", "type": "int" } ]
{ "returns": [ { "docstring": "number of square which contains cell of provided coordinates", "docstring_tokens": [ "number", "of", "square", "which", "contains", "cell", "of", "provided", "coordinates" ], "type": null...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
check_stack
None
def check_stack(self) -> None: """ For all elements in stack function checks if element can be easly solve and solves that element. Stack can be incremented during a process, so function runs as long as there are no more elements to check. :return: None """ self.s.uncheck...
For all elements in stack function checks if element can be easly solve and solves that element. Stack can be incremented during a process, so function runs as long as there are no more elements to check. :return: None
For all elements in stack function checks if element can be easly solve and solves that element. Stack can be incremented during a process, so function runs as long as there are no more elements to check.
[ "For", "all", "elements", "in", "stack", "function", "checks", "if", "element", "can", "be", "easly", "solve", "and", "solves", "that", "element", ".", "Stack", "can", "be", "incremented", "during", "a", "process", "so", "function", "runs", "as", "long", "...
def check_stack(self) -> None: self.s.unchecked_stack = list(set(self.s.unchecked_stack)) while len(self.s.unchecked_stack): self.fill_element(self.s.unchecked_stack[0]) self.s.unchecked_stack.pop(0) self.s.unchecked_stack = list(set(self.s.unchecked_stack)) r...
[ "def", "check_stack", "(", "self", ")", "->", "None", ":", "self", ".", "s", ".", "unchecked_stack", "=", "list", "(", "set", "(", "self", ".", "s", ".", "unchecked_stack", ")", ")", "while", "len", "(", "self", ".", "s", ".", "unchecked_stack", ")",...
For all elements in stack function checks if element can be easly solve and solves that element.
[ "For", "all", "elements", "in", "stack", "function", "checks", "if", "element", "can", "be", "easly", "solve", "and", "solves", "that", "element", "." ]
[ "\"\"\"\n For all elements in stack function checks if element can be easly solve and solves that element.\n Stack can be incremented during a process, so function runs as long as there are no more elements to check.\n :return: None\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
solve
None
def solve(self) -> None: """ Main solving sequence. Checks if there are blank cells where only one number can be inserted. :return: None """ self.counter = 0 self.s.possible_digits_in_cells = {coordinate: [] for coordinate in self.s.zero_positions} while s...
Main solving sequence. Checks if there are blank cells where only one number can be inserted. :return: None
Main solving sequence. Checks if there are blank cells where only one number can be inserted.
[ "Main", "solving", "sequence", ".", "Checks", "if", "there", "are", "blank", "cells", "where", "only", "one", "number", "can", "be", "inserted", "." ]
def solve(self) -> None: self.counter = 0 self.s.possible_digits_in_cells = {coordinate: [] for coordinate in self.s.zero_positions} while self.counter < len(self.s.available_digits): self.check_available_digits() self.check_blank_cells() return None
[ "def", "solve", "(", "self", ")", "->", "None", ":", "self", ".", "counter", "=", "0", "self", ".", "s", ".", "possible_digits_in_cells", "=", "{", "coordinate", ":", "[", "]", "for", "coordinate", "in", "self", ".", "s", ".", "zero_positions", "}", ...
Main solving sequence.
[ "Main", "solving", "sequence", "." ]
[ "\"\"\"\n Main solving sequence.\n Checks if there are blank cells where only one number can be inserted.\n :return: None\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
check_available_digits
None
def check_available_digits(self) -> None: """ For given number function generates all permissible blank cells. Checks in squares, rows and columns if there is only one possible cell to insert the number. If all checks don't cause number insertion, function updates dictionary with all bla...
For given number function generates all permissible blank cells. Checks in squares, rows and columns if there is only one possible cell to insert the number. If all checks don't cause number insertion, function updates dictionary with all blank cells and their corresponding permissible ...
For given number function generates all permissible blank cells. Checks in squares, rows and columns if there is only one possible cell to insert the number. If all checks don't cause number insertion, function updates dictionary with all blank cells and their corresponding permissible digits.
[ "For", "given", "number", "function", "generates", "all", "permissible", "blank", "cells", ".", "Checks", "in", "squares", "rows", "and", "columns", "if", "there", "is", "only", "one", "possible", "cell", "to", "insert", "the", "number", ".", "If", "all", ...
def check_available_digits(self) -> None: digit = self.s.available_digits[self.counter] self.s.changed = False positions_in_squares = self.get_positions_in_squares(digit) self.insert_digit_if_only_one_possible_position_in_square(digit, positions_in_squares) if self.s.changed: ...
[ "def", "check_available_digits", "(", "self", ")", "->", "None", ":", "digit", "=", "self", ".", "s", ".", "available_digits", "[", "self", ".", "counter", "]", "self", ".", "s", ".", "changed", "=", "False", "positions_in_squares", "=", "self", ".", "ge...
For given number function generates all permissible blank cells.
[ "For", "given", "number", "function", "generates", "all", "permissible", "blank", "cells", "." ]
[ "\"\"\"\n For given number function generates all permissible blank cells.\n Checks in squares, rows and columns if there is only one possible cell to insert the number.\n If all checks don't cause number insertion, function updates dictionary with all blank cells\n and their correspondi...
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
search_for_available_positions
List[Tuple[int, int]]
def search_for_available_positions(self, digit: int) -> List[Tuple[int, int]]: """ Searches for blank cells where there are no interferences (same number in a row, column or square) :param digit: number we are evaluating :return: list of blank cells' coordinates where number can be inser...
Searches for blank cells where there are no interferences (same number in a row, column or square) :param digit: number we are evaluating :return: list of blank cells' coordinates where number can be inserted
Searches for blank cells where there are no interferences (same number in a row, column or square)
[ "Searches", "for", "blank", "cells", "where", "there", "are", "no", "interferences", "(", "same", "number", "in", "a", "row", "column", "or", "square", ")" ]
def search_for_available_positions(self, digit: int) -> List[Tuple[int, int]]: positions = np.where(self.s.array == digit) available_rows = set(i[0] for i in self.s.zero_positions).difference(set(positions[0])) available_cols = set(i[1] for i in self.s.zero_positions).difference(set(positions[1]...
[ "def", "search_for_available_positions", "(", "self", ",", "digit", ":", "int", ")", "->", "List", "[", "Tuple", "[", "int", ",", "int", "]", "]", ":", "positions", "=", "np", ".", "where", "(", "self", ".", "s", ".", "array", "==", "digit", ")", "...
Searches for blank cells where there are no interferences (same number in a row, column or square)
[ "Searches", "for", "blank", "cells", "where", "there", "are", "no", "interferences", "(", "same", "number", "in", "a", "row", "column", "or", "square", ")" ]
[ "\"\"\"\n Searches for blank cells where there are no interferences (same number in a row, column or square)\n :param digit: number we are evaluating\n :return: list of blank cells' coordinates where number can be inserted\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "digit", "type": "int" } ]
{ "returns": [ { "docstring": "list of blank cells' coordinates where number can be inserted", "docstring_tokens": [ "list", "of", "blank", "cells", "'", "coordinates", "where", "number", "can", "be", "inserted" ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
divide_positions_by_squares
Dict[ int, List[int]]
def divide_positions_by_squares(self, available_positions: List[Tuple[int, int]], digit: int) -> Dict[ int, List[int]]: """ Creates a dictionary with square numbers as keys and list of black cells' coordinates, where number can be inserted. :param available_positions: :p...
Creates a dictionary with square numbers as keys and list of black cells' coordinates, where number can be inserted. :param available_positions: :param digit: number we are evaluating :return: dictionary with blank cells' coordinates divided by square numbers
Creates a dictionary with square numbers as keys and list of black cells' coordinates, where number can be inserted.
[ "Creates", "a", "dictionary", "with", "square", "numbers", "as", "keys", "and", "list", "of", "black", "cells", "'", "coordinates", "where", "number", "can", "be", "inserted", "." ]
def divide_positions_by_squares(self, available_positions: List[Tuple[int, int]], digit: int) -> Dict[ int, List[int]]: positions_in_squares = {} for element in available_positions: square_number = self.find_square(element[0], element[1]) if self.digit_in_square(digit, sq...
[ "def", "divide_positions_by_squares", "(", "self", ",", "available_positions", ":", "List", "[", "Tuple", "[", "int", ",", "int", "]", "]", ",", "digit", ":", "int", ")", "->", "Dict", "[", "int", ",", "List", "[", "int", "]", "]", ":", "positions_in_s...
Creates a dictionary with square numbers as keys and list of black cells' coordinates, where number can be inserted.
[ "Creates", "a", "dictionary", "with", "square", "numbers", "as", "keys", "and", "list", "of", "black", "cells", "'", "coordinates", "where", "number", "can", "be", "inserted", "." ]
[ "\"\"\"\n Creates a dictionary with square numbers as keys and list of black cells' coordinates,\n where number can be inserted.\n :param available_positions:\n :param digit: number we are evaluating\n :return: dictionary with blank cells' coordinates divided by square numbers\n ...
[ { "param": "self", "type": null }, { "param": "available_positions", "type": "List[Tuple[int, int]]" }, { "param": "digit", "type": "int" } ]
{ "returns": [ { "docstring": "dictionary with blank cells' coordinates divided by square numbers", "docstring_tokens": [ "dictionary", "with", "blank", "cells", "'", "coordinates", "divided", "by", "square", "numbers" ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
update_positions_if_one_dimensional_positions_in_squares
Dict[int, List[Tuple[int, int]]]
def update_positions_if_one_dimensional_positions_in_squares(self, positions_in_squares: Dict[int, List[Tuple[int, int]]], flag: int) -> Dict[int, List[Tuple[int, int]]]: """ ...
Checks if there are rows or columns inside squares where number must be inserted. Deletes the same rows/columns' coordinates in another squares (inside list od available coordinates). :param positions_in_squares: list of available blank cells' coordinates divided by squares :param flag:...
Checks if there are rows or columns inside squares where number must be inserted. Deletes the same rows/columns' coordinates in another squares (inside list od available coordinates).
[ "Checks", "if", "there", "are", "rows", "or", "columns", "inside", "squares", "where", "number", "must", "be", "inserted", ".", "Deletes", "the", "same", "rows", "/", "columns", "'", "coordinates", "in", "another", "squares", "(", "inside", "list", "od", "...
def update_positions_if_one_dimensional_positions_in_squares(self, positions_in_squares: Dict[int, List[Tuple[int, int]]], flag: int) -> Dict[int, List[Tuple[int, int]]]: for square ...
[ "def", "update_positions_if_one_dimensional_positions_in_squares", "(", "self", ",", "positions_in_squares", ":", "Dict", "[", "int", ",", "List", "[", "Tuple", "[", "int", ",", "int", "]", "]", "]", ",", "flag", ":", "int", ")", "->", "Dict", "[", "int", ...
Checks if there are rows or columns inside squares where number must be inserted.
[ "Checks", "if", "there", "are", "rows", "or", "columns", "inside", "squares", "where", "number", "must", "be", "inserted", "." ]
[ "\"\"\"\n Checks if there are rows or columns inside squares where number must be inserted.\n Deletes the same rows/columns' coordinates in another squares (inside list od available coordinates).\n :param positions_in_squares: list of available blank cells' coordinates divided by squares\n ...
[ { "param": "self", "type": null }, { "param": "positions_in_squares", "type": "Dict[int, List[Tuple[int, int]]]" }, { "param": "flag", "type": "int" } ]
{ "returns": [ { "docstring": "updated list of available blank cells' coordinates divided by squares", "docstring_tokens": [ "updated", "list", "of", "available", "blank", "cells", "'", "coordinates", "divided", "by", ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
delete_unavailable_coordinates
None
def delete_unavailable_coordinates(element: int, flag: int, positions_in_squares: Dict[int, List[Tuple[int, int]]], square: int) -> None: """ Get all potential (for insertion) blank cells' coordinates and deletes non-valid coordinates. Non-valid coordinates...
Get all potential (for insertion) blank cells' coordinates and deletes non-valid coordinates. Non-valid coordinates are ones that number MUST be inserted in the same row/column but in another square. :param element: number of row or column :param flag: 0 for row, 1 for column :p...
Get all potential (for insertion) blank cells' coordinates and deletes non-valid coordinates. Non-valid coordinates are ones that number MUST be inserted in the same row/column but in another square.
[ "Get", "all", "potential", "(", "for", "insertion", ")", "blank", "cells", "'", "coordinates", "and", "deletes", "non", "-", "valid", "coordinates", ".", "Non", "-", "valid", "coordinates", "are", "ones", "that", "number", "MUST", "be", "inserted", "in", "...
def delete_unavailable_coordinates(element: int, flag: int, positions_in_squares: Dict[int, List[Tuple[int, int]]], square: int) -> None: if element: for square_number in positions_in_squares: if square_number == square: cont...
[ "def", "delete_unavailable_coordinates", "(", "element", ":", "int", ",", "flag", ":", "int", ",", "positions_in_squares", ":", "Dict", "[", "int", ",", "List", "[", "Tuple", "[", "int", ",", "int", "]", "]", "]", ",", "square", ":", "int", ")", "->", ...
Get all potential (for insertion) blank cells' coordinates and deletes non-valid coordinates.
[ "Get", "all", "potential", "(", "for", "insertion", ")", "blank", "cells", "'", "coordinates", "and", "deletes", "non", "-", "valid", "coordinates", "." ]
[ "\"\"\"\n Get all potential (for insertion) blank cells' coordinates and deletes non-valid coordinates.\n Non-valid coordinates are ones that number MUST be inserted in the same row/column but in another square.\n :param element: number of row or column\n :param flag: 0 for row, 1 for co...
[ { "param": "element", "type": "int" }, { "param": "flag", "type": "int" }, { "param": "positions_in_squares", "type": "Dict[int, List[Tuple[int, int]]]" }, { "param": "square", "type": "int" } ]
{ "returns": [ { "docstring": "updated list of available blank cells' coordinates divided by squares", "docstring_tokens": [ "updated", "list", "of", "available", "blank", "cells", "'", "coordinates", "divided", "by", ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
insert_digit_if_only_one_possible_position_in_square
None
def insert_digit_if_only_one_possible_position_in_square(self, digit: int, positions_in_squares: Dict[ int, List[Tuple[int, int]]]) -> None: """ If there is only one available (for aur number) blank cell inside a square, it can be filled. Function inserts a number and sets sudoku array s...
If there is only one available (for aur number) blank cell inside a square, it can be filled. Function inserts a number and sets sudoku array status on "changed". :param digit: evaluating number :param positions_in_squares: list of available blank cells' coordinates divided by squares ...
If there is only one available (for aur number) blank cell inside a square, it can be filled. Function inserts a number and sets sudoku array status on "changed".
[ "If", "there", "is", "only", "one", "available", "(", "for", "aur", "number", ")", "blank", "cell", "inside", "a", "square", "it", "can", "be", "filled", ".", "Function", "inserts", "a", "number", "and", "sets", "sudoku", "array", "status", "on", "\"", ...
def insert_digit_if_only_one_possible_position_in_square(self, digit: int, positions_in_squares: Dict[ int, List[Tuple[int, int]]]) -> None: for square in positions_in_squares: if len(positions_in_squares[square]) == 1: row_index, column_index = positions_in_squares[square][0...
[ "def", "insert_digit_if_only_one_possible_position_in_square", "(", "self", ",", "digit", ":", "int", ",", "positions_in_squares", ":", "Dict", "[", "int", ",", "List", "[", "Tuple", "[", "int", ",", "int", "]", "]", "]", ")", "->", "None", ":", "for", "sq...
If there is only one available (for aur number) blank cell inside a square, it can be filled.
[ "If", "there", "is", "only", "one", "available", "(", "for", "aur", "number", ")", "blank", "cell", "inside", "a", "square", "it", "can", "be", "filled", "." ]
[ "\"\"\"\n If there is only one available (for aur number) blank cell inside a square, it can be filled.\n Function inserts a number and sets sudoku array status on \"changed\".\n :param digit: evaluating number\n :param positions_in_squares: list of available blank cells' coordinates div...
[ { "param": "self", "type": null }, { "param": "digit", "type": "int" }, { "param": "positions_in_squares", "type": "Dict[\n int, List[Tuple[int, int]]]" } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
insert_and_set_changed
None
def insert_and_set_changed(self, digit: int, row_index: int, column_index: int) -> None: """ Inserts number and sets sudoku array status on "changed". :param digit: evaluating number :param row_index: row coordinate of cell to fill :param column_index: column coordinate of cell t...
Inserts number and sets sudoku array status on "changed". :param digit: evaluating number :param row_index: row coordinate of cell to fill :param column_index: column coordinate of cell to fill :return: None
Inserts number and sets sudoku array status on "changed".
[ "Inserts", "number", "and", "sets", "sudoku", "array", "status", "on", "\"", "changed", "\"", "." ]
def insert_and_set_changed(self, digit: int, row_index: int, column_index: int) -> None: self.insert_digit(digit, row_index, column_index) self.s.changed = True return None
[ "def", "insert_and_set_changed", "(", "self", ",", "digit", ":", "int", ",", "row_index", ":", "int", ",", "column_index", ":", "int", ")", "->", "None", ":", "self", ".", "insert_digit", "(", "digit", ",", "row_index", ",", "column_index", ")", "self", ...
Inserts number and sets sudoku array status on "changed".
[ "Inserts", "number", "and", "sets", "sudoku", "array", "status", "on", "\"", "changed", "\"", "." ]
[ "\"\"\"\n Inserts number and sets sudoku array status on \"changed\".\n :param digit: evaluating number\n :param row_index: row coordinate of cell to fill\n :param column_index: column coordinate of cell to fill\n :return: None\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "digit", "type": "int" }, { "param": "row_index", "type": "int" }, { "param": "column_index", "type": "int" } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
positions_in_one_row_or_column
Tuple[List[Tuple[int, int]], List[Tuple[int, int]]]
def positions_in_one_row_or_column(positions_in_squares) -> Tuple[List[Tuple[int, int]], List[Tuple[int, int]]]: """ Checks how many available blank cells is in each row and collumn. If row/column has only one available cell, it can be filled with number. :param positions_in_squares: ...
Checks how many available blank cells is in each row and collumn. If row/column has only one available cell, it can be filled with number. :param positions_in_squares: :return: list of available blank cells' coordinates, list of black cells' coordinates which can be filled
Checks how many available blank cells is in each row and collumn. If row/column has only one available cell, it can be filled with number.
[ "Checks", "how", "many", "available", "blank", "cells", "is", "in", "each", "row", "and", "collumn", ".", "If", "row", "/", "column", "has", "only", "one", "available", "cell", "it", "can", "be", "filled", "with", "number", "." ]
def positions_in_one_row_or_column(positions_in_squares) -> Tuple[List[Tuple[int, int]], List[Tuple[int, int]]]: potential_positions = list(chain.from_iterable(positions_in_squares.values())) rows_count = Counter([p[0] for p in potential_positions]) columns_count = Counter([p[1] for p in potenti...
[ "def", "positions_in_one_row_or_column", "(", "positions_in_squares", ")", "->", "Tuple", "[", "List", "[", "Tuple", "[", "int", ",", "int", "]", "]", ",", "List", "[", "Tuple", "[", "int", ",", "int", "]", "]", "]", ":", "potential_positions", "=", "lis...
Checks how many available blank cells is in each row and collumn.
[ "Checks", "how", "many", "available", "blank", "cells", "is", "in", "each", "row", "and", "collumn", "." ]
[ "\"\"\"\n Checks how many available blank cells is in each row and collumn.\n If row/column has only one available cell, it can be filled with number.\n :param positions_in_squares:\n :return: list of available blank cells' coordinates, list of black cells' coordinates which can be fille...
[ { "param": "positions_in_squares", "type": null } ]
{ "returns": [ { "docstring": "list of available blank cells' coordinates, list of black cells' coordinates which can be filled", "docstring_tokens": [ "list", "of", "available", "blank", "cells", "'", "coordinates", "list", "of",...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
after_change_procedure
None
def after_change_procedure(self) -> None: """ After inserted a number, stack has elements to check for easy solving. Also lists of possible digits for all blank cells need to be clared. Program's counter resets. :return: None """ self.check_stack() self.cl...
After inserted a number, stack has elements to check for easy solving. Also lists of possible digits for all blank cells need to be clared. Program's counter resets. :return: None
After inserted a number, stack has elements to check for easy solving. Also lists of possible digits for all blank cells need to be clared. Program's counter resets.
[ "After", "inserted", "a", "number", "stack", "has", "elements", "to", "check", "for", "easy", "solving", ".", "Also", "lists", "of", "possible", "digits", "for", "all", "blank", "cells", "need", "to", "be", "clared", ".", "Program", "'", "s", "counter", ...
def after_change_procedure(self) -> None: self.check_stack() self.clear_possible_coordinates() self.counter = 0 return None
[ "def", "after_change_procedure", "(", "self", ")", "->", "None", ":", "self", ".", "check_stack", "(", ")", "self", ".", "clear_possible_coordinates", "(", ")", "self", ".", "counter", "=", "0", "return", "None" ]
After inserted a number, stack has elements to check for easy solving.
[ "After", "inserted", "a", "number", "stack", "has", "elements", "to", "check", "for", "easy", "solving", "." ]
[ "\"\"\"\n After inserted a number, stack has elements to check for easy solving.\n Also lists of possible digits for all blank cells need to be clared.\n Program's counter resets.\n :return: None\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
apply_solutions
None
def apply_solutions(self, digit, solutions) -> None: """ Insert number into all available cells. :param digit: number to insert in available cells :param solutions: list of coordinates number can be inserted :return: None """ if len(solutions): for coo...
Insert number into all available cells. :param digit: number to insert in available cells :param solutions: list of coordinates number can be inserted :return: None
Insert number into all available cells.
[ "Insert", "number", "into", "all", "available", "cells", "." ]
def apply_solutions(self, digit, solutions) -> None: if len(solutions): for coordinate in solutions: self.insert_and_set_changed(digit, coordinate[0], coordinate[1]) return None
[ "def", "apply_solutions", "(", "self", ",", "digit", ",", "solutions", ")", "->", "None", ":", "if", "len", "(", "solutions", ")", ":", "for", "coordinate", "in", "solutions", ":", "self", ".", "insert_and_set_changed", "(", "digit", ",", "coordinate", "["...
Insert number into all available cells.
[ "Insert", "number", "into", "all", "available", "cells", "." ]
[ "\"\"\"\n Insert number into all available cells.\n :param digit: number to insert in available cells\n :param solutions: list of coordinates number can be inserted\n :return: None\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "digit", "type": null }, { "param": "solutions", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
digit_in_square
bool
def digit_in_square(self, digit: int, square_number: int) -> bool: """ Checks if number is already in square. :param digit: number we are evaluating :param square_number: index of square in list of sqares' coordinates :return: bool """ return digit in self.s.array...
Checks if number is already in square. :param digit: number we are evaluating :param square_number: index of square in list of sqares' coordinates :return: bool
Checks if number is already in square.
[ "Checks", "if", "number", "is", "already", "in", "square", "." ]
def digit_in_square(self, digit: int, square_number: int) -> bool: return digit in self.s.array[ self.s.squares[square_number].row_start: self.s.squares[square_number].row_stop, self.s.squares[square_number].column_start: self.s.squares[square_number].column_stop,...
[ "def", "digit_in_square", "(", "self", ",", "digit", ":", "int", ",", "square_number", ":", "int", ")", "->", "bool", ":", "return", "digit", "in", "self", ".", "s", ".", "array", "[", "self", ".", "s", ".", "squares", "[", "square_number", "]", ".",...
Checks if number is already in square.
[ "Checks", "if", "number", "is", "already", "in", "square", "." ]
[ "\"\"\"\n Checks if number is already in square.\n :param digit: number we are evaluating\n :param square_number: index of square in list of sqares' coordinates\n :return: bool\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "digit", "type": "int" }, { "param": "square_number", "type": "int" } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
add_digit_to_blank_cells
None
def add_digit_to_blank_cells(self, digit: int, potential_positions: List[Tuple[int, int]]) -> None: """ Fills dictionary of blank cells. For every blank cell, if number is permissible in that cell, number is added to the list of digits. :param digit: evaluating number :param pote...
Fills dictionary of blank cells. For every blank cell, if number is permissible in that cell, number is added to the list of digits. :param digit: evaluating number :param potential_positions: list of available blank cells' coordinates :return: None
Fills dictionary of blank cells. For every blank cell, if number is permissible in that cell, number is added to the list of digits.
[ "Fills", "dictionary", "of", "blank", "cells", ".", "For", "every", "blank", "cell", "if", "number", "is", "permissible", "in", "that", "cell", "number", "is", "added", "to", "the", "list", "of", "digits", "." ]
def add_digit_to_blank_cells(self, digit: int, potential_positions: List[Tuple[int, int]]) -> None: for position in potential_positions: self.s.possible_digits_in_cells[position].append(digit) self.counter += 1 return None
[ "def", "add_digit_to_blank_cells", "(", "self", ",", "digit", ":", "int", ",", "potential_positions", ":", "List", "[", "Tuple", "[", "int", ",", "int", "]", "]", ")", "->", "None", ":", "for", "position", "in", "potential_positions", ":", "self", ".", "...
Fills dictionary of blank cells.
[ "Fills", "dictionary", "of", "blank", "cells", "." ]
[ "\"\"\"\n Fills dictionary of blank cells.\n For every blank cell, if number is permissible in that cell, number is added to the list of digits.\n :param digit: evaluating number\n :param potential_positions: list of available blank cells' coordinates\n :return: None\n \"\"...
[ { "param": "self", "type": null }, { "param": "digit", "type": "int" }, { "param": "potential_positions", "type": "List[Tuple[int, int]]" } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
check_blank_cells
None
def check_blank_cells(self) -> None: """ Checks if there are coordinates, which have only one permissible number. If so, number can be inserted. :return: None """ self.s.changed = False if len(self.s.zero_positions): for coordinate in self.s.possible_d...
Checks if there are coordinates, which have only one permissible number. If so, number can be inserted. :return: None
Checks if there are coordinates, which have only one permissible number. If so, number can be inserted.
[ "Checks", "if", "there", "are", "coordinates", "which", "have", "only", "one", "permissible", "number", ".", "If", "so", "number", "can", "be", "inserted", "." ]
def check_blank_cells(self) -> None: self.s.changed = False if len(self.s.zero_positions): for coordinate in self.s.possible_digits_in_cells: if len(self.s.possible_digits_in_cells[coordinate]) == 1: self.insert_and_set_changed(self.s.possible_digits_in_ce...
[ "def", "check_blank_cells", "(", "self", ")", "->", "None", ":", "self", ".", "s", ".", "changed", "=", "False", "if", "len", "(", "self", ".", "s", ".", "zero_positions", ")", ":", "for", "coordinate", "in", "self", ".", "s", ".", "possible_digits_in_...
Checks if there are coordinates, which have only one permissible number.
[ "Checks", "if", "there", "are", "coordinates", "which", "have", "only", "one", "permissible", "number", "." ]
[ "\"\"\"\n Checks if there are coordinates, which have only one permissible number.\n If so, number can be inserted.\n :return: None\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
try_random_insert
None
def try_random_insert(self, max_tries: int = 10) -> None: """ If Sudoku is still incomplete after previous solving procedure, program tries to use random insertions. It will insert digits chosen randomly from list of available digits. Insertion will occur on blank cell with minimum numbe...
If Sudoku is still incomplete after previous solving procedure, program tries to use random insertions. It will insert digits chosen randomly from list of available digits. Insertion will occur on blank cell with minimum number of possible digits, so the probability for accurate choice ...
If Sudoku is still incomplete after previous solving procedure, program tries to use random insertions. It will insert digits chosen randomly from list of available digits. Insertion will occur on blank cell with minimum number of possible digits, so the probability for accurate choice is utmost.
[ "If", "Sudoku", "is", "still", "incomplete", "after", "previous", "solving", "procedure", "program", "tries", "to", "use", "random", "insertions", ".", "It", "will", "insert", "digits", "chosen", "randomly", "from", "list", "of", "available", "digits", ".", "I...
def try_random_insert(self, max_tries: int = 10) -> None: number_of_tries = 0 while len(self.s.zero_positions) and number_of_tries <= max_tries: self.random_check() number_of_tries += 1 return None
[ "def", "try_random_insert", "(", "self", ",", "max_tries", ":", "int", "=", "10", ")", "->", "None", ":", "number_of_tries", "=", "0", "while", "len", "(", "self", ".", "s", ".", "zero_positions", ")", "and", "number_of_tries", "<=", "max_tries", ":", "s...
If Sudoku is still incomplete after previous solving procedure, program tries to use random insertions.
[ "If", "Sudoku", "is", "still", "incomplete", "after", "previous", "solving", "procedure", "program", "tries", "to", "use", "random", "insertions", "." ]
[ "\"\"\"\n If Sudoku is still incomplete after previous solving procedure, program tries to use random insertions.\n It will insert digits chosen randomly from list of available digits.\n Insertion will occur on blank cell with minimum number of possible digits,\n so the probability for a...
[ { "param": "self", "type": null }, { "param": "max_tries", "type": "int" } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
random_check
None
def random_check(self) -> None: """ At first function makes a deepcopy of sudoku array as an backup. Then it gets a blank cell with minimum number or permissible digits. Than gets one of the coordinates with that minimum. For chosen coordinates (blank cell) inserts randomly one o...
At first function makes a deepcopy of sudoku array as an backup. Then it gets a blank cell with minimum number or permissible digits. Than gets one of the coordinates with that minimum. For chosen coordinates (blank cell) inserts randomly one of the available digits. After inser...
At first function makes a deepcopy of sudoku array as an backup. Then it gets a blank cell with minimum number or permissible digits. Than gets one of the coordinates with that minimum. For chosen coordinates (blank cell) inserts randomly one of the available digits. After insertion function starts solving procedure ag...
[ "At", "first", "function", "makes", "a", "deepcopy", "of", "sudoku", "array", "as", "an", "backup", ".", "Then", "it", "gets", "a", "blank", "cell", "with", "minimum", "number", "or", "permissible", "digits", ".", "Than", "gets", "one", "of", "the", "coo...
def random_check(self) -> None: backup_sudoku = deepcopy(self.s) minimum_number_of_digits = min( len(digits_list) for digits_list in self.s.possible_digits_in_cells.values() if len(digits_list) > 0) considered_position = choice([coordinate for coordinate in self.s.possible_digits_in_...
[ "def", "random_check", "(", "self", ")", "->", "None", ":", "backup_sudoku", "=", "deepcopy", "(", "self", ".", "s", ")", "minimum_number_of_digits", "=", "min", "(", "len", "(", "digits_list", ")", "for", "digits_list", "in", "self", ".", "s", ".", "pos...
At first function makes a deepcopy of sudoku array as an backup.
[ "At", "first", "function", "makes", "a", "deepcopy", "of", "sudoku", "array", "as", "an", "backup", "." ]
[ "\"\"\"\n At first function makes a deepcopy of sudoku array as an backup.\n Then it gets a blank cell with minimum number or permissible digits.\n Than gets one of the coordinates with that minimum.\n For chosen coordinates (blank cell) inserts randomly one of the available digits.\n ...
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
check_stack_and_solve_again
None
def check_stack_and_solve_again(self) -> None: """ Stack is not empty, so it needs to be checked. Digit has been inserted, so we can try solve sudoku again. :return: None """ self.check_stack() self.solve() return None
Stack is not empty, so it needs to be checked. Digit has been inserted, so we can try solve sudoku again. :return: None
Stack is not empty, so it needs to be checked. Digit has been inserted, so we can try solve sudoku again.
[ "Stack", "is", "not", "empty", "so", "it", "needs", "to", "be", "checked", ".", "Digit", "has", "been", "inserted", "so", "we", "can", "try", "solve", "sudoku", "again", "." ]
def check_stack_and_solve_again(self) -> None: self.check_stack() self.solve() return None
[ "def", "check_stack_and_solve_again", "(", "self", ")", "->", "None", ":", "self", ".", "check_stack", "(", ")", "self", ".", "solve", "(", ")", "return", "None" ]
Stack is not empty, so it needs to be checked.
[ "Stack", "is", "not", "empty", "so", "it", "needs", "to", "be", "checked", "." ]
[ "\"\"\"\n Stack is not empty, so it needs to be checked.\n Digit has been inserted, so we can try solve sudoku again.\n :return: None\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
is_sudoku_completed
bool
def is_sudoku_completed(self) -> bool: """ Checks if there are no blank cells and all elements are correctly filled. :return: bool """ # if len(self.s.zero_positions) == 0: if np.count_nonzero(self.s.array) == 81: if self.assert_sum_digits_in_element(self.s.ro...
Checks if there are no blank cells and all elements are correctly filled. :return: bool
Checks if there are no blank cells and all elements are correctly filled.
[ "Checks", "if", "there", "are", "no", "blank", "cells", "and", "all", "elements", "are", "correctly", "filled", "." ]
def is_sudoku_completed(self) -> bool: if np.count_nonzero(self.s.array) == 81: if self.assert_sum_digits_in_element(self.s.rows): if self.assert_sum_digits_in_element(self.s.columns): if self.assert_sum_digits_in_element(self.s.squares): r...
[ "def", "is_sudoku_completed", "(", "self", ")", "->", "bool", ":", "if", "np", ".", "count_nonzero", "(", "self", ".", "s", ".", "array", ")", "==", "81", ":", "if", "self", ".", "assert_sum_digits_in_element", "(", "self", ".", "s", ".", "rows", ")", ...
Checks if there are no blank cells and all elements are correctly filled.
[ "Checks", "if", "there", "are", "no", "blank", "cells", "and", "all", "elements", "are", "correctly", "filled", "." ]
[ "\"\"\"\n Checks if there are no blank cells and all elements are correctly filled.\n :return: bool\n \"\"\"", "# if len(self.s.zero_positions) == 0:" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
assert_sum_digits_in_element
bool
def assert_sum_digits_in_element(self, elements_list: List[SudokuElement], result: int = 45) -> bool: """ Check if sum of digits in sudoku element equals given result. :param elements_list: list of sudoku elements (rows, columns or squares) :param result: For element fully filled with un...
Check if sum of digits in sudoku element equals given result. :param elements_list: list of sudoku elements (rows, columns or squares) :param result: For element fully filled with unique digits result equals sum of digits from 1 to 9, which is 45. :return: bool
Check if sum of digits in sudoku element equals given result.
[ "Check", "if", "sum", "of", "digits", "in", "sudoku", "element", "equals", "given", "result", "." ]
def assert_sum_digits_in_element(self, elements_list: List[SudokuElement], result: int = 45) -> bool: for element in elements_list: if np.sum(self.s.array[element.row_start:element.row_stop, element.column_start:element.column_stop]) != result: return False ...
[ "def", "assert_sum_digits_in_element", "(", "self", ",", "elements_list", ":", "List", "[", "SudokuElement", "]", ",", "result", ":", "int", "=", "45", ")", "->", "bool", ":", "for", "element", "in", "elements_list", ":", "if", "np", ".", "sum", "(", "se...
Check if sum of digits in sudoku element equals given result.
[ "Check", "if", "sum", "of", "digits", "in", "sudoku", "element", "equals", "given", "result", "." ]
[ "\"\"\"\n Check if sum of digits in sudoku element equals given result.\n :param elements_list: list of sudoku elements (rows, columns or squares)\n :param result: For element fully filled with unique digits result equals sum of digits from 1 to 9, which is 45.\n :return: bool\n \...
[ { "param": "self", "type": null }, { "param": "elements_list", "type": "List[SudokuElement]" }, { "param": "result", "type": "int" } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
clear_possible_coordinates
None
def clear_possible_coordinates(self) -> None: """ Clears lists of possible digits for all blank cells' coordinates. :return: None """ for coordinate in self.s.possible_digits_in_cells: self.s.possible_digits_in_cells[coordinate] = [] return None
Clears lists of possible digits for all blank cells' coordinates. :return: None
Clears lists of possible digits for all blank cells' coordinates.
[ "Clears", "lists", "of", "possible", "digits", "for", "all", "blank", "cells", "'", "coordinates", "." ]
def clear_possible_coordinates(self) -> None: for coordinate in self.s.possible_digits_in_cells: self.s.possible_digits_in_cells[coordinate] = [] return None
[ "def", "clear_possible_coordinates", "(", "self", ")", "->", "None", ":", "for", "coordinate", "in", "self", ".", "s", ".", "possible_digits_in_cells", ":", "self", ".", "s", ".", "possible_digits_in_cells", "[", "coordinate", "]", "=", "[", "]", "return", "...
Clears lists of possible digits for all blank cells' coordinates.
[ "Clears", "lists", "of", "possible", "digits", "for", "all", "blank", "cells", "'", "coordinates", "." ]
[ "\"\"\"\n Clears lists of possible digits for all blank cells' coordinates.\n :return: None\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
9b465ed1dfc3093dbd4d948f2421e5928e31e7d4
PatrykGorol/SudokuSolver
old_version/solver.py
[ "MIT" ]
Python
positions_in_one_dimention
Optional[int]
def positions_in_one_dimention(square_positions: List[Tuple[int, int]], flag: int) -> Optional[int]: """ If all possible coordinates (for particular number) in square are located in one row or one column, that row/column can be deleted from the rest possible coordinates. :param square_po...
If all possible coordinates (for particular number) in square are located in one row or one column, that row/column can be deleted from the rest possible coordinates. :param square_positions: all possible coordinates in square :param flag: 0 for row, 1 for column :return: the nu...
If all possible coordinates (for particular number) in square are located in one row or one column, that row/column can be deleted from the rest possible coordinates.
[ "If", "all", "possible", "coordinates", "(", "for", "particular", "number", ")", "in", "square", "are", "located", "in", "one", "row", "or", "one", "column", "that", "row", "/", "column", "can", "be", "deleted", "from", "the", "rest", "possible", "coordina...
def positions_in_one_dimention(square_positions: List[Tuple[int, int]], flag: int) -> Optional[int]: if len(square_positions) == 1: return None elements = set([coordinate[flag] for coordinate in square_positions]) if len(elements) == 1: return list(elements)[0] el...
[ "def", "positions_in_one_dimention", "(", "square_positions", ":", "List", "[", "Tuple", "[", "int", ",", "int", "]", "]", ",", "flag", ":", "int", ")", "->", "Optional", "[", "int", "]", ":", "if", "len", "(", "square_positions", ")", "==", "1", ":", ...
If all possible coordinates (for particular number) in square are located in one row or one column, that row/column can be deleted from the rest possible coordinates.
[ "If", "all", "possible", "coordinates", "(", "for", "particular", "number", ")", "in", "square", "are", "located", "in", "one", "row", "or", "one", "column", "that", "row", "/", "column", "can", "be", "deleted", "from", "the", "rest", "possible", "coordina...
[ "\"\"\"\n If all possible coordinates (for particular number) in square are located in one row or one column,\n that row/column can be deleted from the rest possible coordinates.\n :param square_positions: all possible coordinates in square\n :param flag: 0 for row, 1 for column\n ...
[ { "param": "square_positions", "type": "List[Tuple[int, int]]" }, { "param": "flag", "type": "int" } ]
{ "returns": [ { "docstring": "the number of row or column or None", "docstring_tokens": [ "the", "number", "of", "row", "or", "column", "or", "None" ], "type": null } ], "raises": [], "params": [ { "identi...
515327b2977aad9398059bc0f58005f1dfe7fc76
PatrykGorol/SudokuSolver
old_version/sudoku.py
[ "MIT" ]
Python
increment_digits
None
def increment_digits(self) -> None: """ Each time number is inserted into sudoku element, increment counter. If all 9 digits have been inserted, mark element as completed. :return: None """ if not self.completed: self.digits += 1 if self.digits == ...
Each time number is inserted into sudoku element, increment counter. If all 9 digits have been inserted, mark element as completed. :return: None
Each time number is inserted into sudoku element, increment counter. If all 9 digits have been inserted, mark element as completed.
[ "Each", "time", "number", "is", "inserted", "into", "sudoku", "element", "increment", "counter", ".", "If", "all", "9", "digits", "have", "been", "inserted", "mark", "element", "as", "completed", "." ]
def increment_digits(self) -> None: if not self.completed: self.digits += 1 if self.digits == 9: self.completed = True return None
[ "def", "increment_digits", "(", "self", ")", "->", "None", ":", "if", "not", "self", ".", "completed", ":", "self", ".", "digits", "+=", "1", "if", "self", ".", "digits", "==", "9", ":", "self", ".", "completed", "=", "True", "return", "None" ]
Each time number is inserted into sudoku element, increment counter.
[ "Each", "time", "number", "is", "inserted", "into", "sudoku", "element", "increment", "counter", "." ]
[ "\"\"\"\n Each time number is inserted into sudoku element, increment counter.\n If all 9 digits have been inserted, mark element as completed.\n :return: None\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
aa57a661dfb8e6a1db32fa8e59b2fea1d3899163
PatrykGorol/SudokuSolver
old_version/gui.py
[ "MIT" ]
Python
character_limit
None
def character_limit(self) -> None: """ Checks if user's input is valid and changes invalid characters for blank string or previous valid character. :return: None """ if len(self.text) > 0: if len(self.text) == 1 and not self.input_validation(self.text[0]): ...
Checks if user's input is valid and changes invalid characters for blank string or previous valid character. :return: None
Checks if user's input is valid and changes invalid characters for blank string or previous valid character.
[ "Checks", "if", "user", "'", "s", "input", "is", "valid", "and", "changes", "invalid", "characters", "for", "blank", "string", "or", "previous", "valid", "character", "." ]
def character_limit(self) -> None: if len(self.text) > 0: if len(self.text) == 1 and not self.input_validation(self.text[0]): self.text = '' else: if self.input_validation(self.text[-1]): self.text = self.text[-1] else: ...
[ "def", "character_limit", "(", "self", ")", "->", "None", ":", "if", "len", "(", "self", ".", "text", ")", ">", "0", ":", "if", "len", "(", "self", ".", "text", ")", "==", "1", "and", "not", "self", ".", "input_validation", "(", "self", ".", "tex...
Checks if user's input is valid and changes invalid characters for blank string or previous valid character.
[ "Checks", "if", "user", "'", "s", "input", "is", "valid", "and", "changes", "invalid", "characters", "for", "blank", "string", "or", "previous", "valid", "character", "." ]
[ "\"\"\"\n Checks if user's input is valid and changes invalid characters for blank string or previous valid character.\n :return: None\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
aa57a661dfb8e6a1db32fa8e59b2fea1d3899163
PatrykGorol/SudokuSolver
old_version/gui.py
[ "MIT" ]
Python
create_buttons
None
def create_buttons(self, frame: tk.LabelFrame) -> None: """ Creates 3 buttons on the bottom af window. :param frame: tkinter master element (window's grid) :return: None """ solve_button = tk.Button(frame, text='Solve Sudoku', font=10, command=self.solve) solve_bu...
Creates 3 buttons on the bottom af window. :param frame: tkinter master element (window's grid) :return: None
Creates 3 buttons on the bottom af window.
[ "Creates", "3", "buttons", "on", "the", "bottom", "af", "window", "." ]
def create_buttons(self, frame: tk.LabelFrame) -> None: solve_button = tk.Button(frame, text='Solve Sudoku', font=10, command=self.solve) solve_button.grid(row=9, column=0, pady=(10, 0)) examples_button = tk.Button(frame, text='Get example', font=1, command=self.example) examples_button....
[ "def", "create_buttons", "(", "self", ",", "frame", ":", "tk", ".", "LabelFrame", ")", "->", "None", ":", "solve_button", "=", "tk", ".", "Button", "(", "frame", ",", "text", "=", "'Solve Sudoku'", ",", "font", "=", "10", ",", "command", "=", "self", ...
Creates 3 buttons on the bottom af window.
[ "Creates", "3", "buttons", "on", "the", "bottom", "af", "window", "." ]
[ "\"\"\"\n Creates 3 buttons on the bottom af window.\n :param frame: tkinter master element (window's grid)\n :return: None\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "frame", "type": "tk.LabelFrame" } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
aa57a661dfb8e6a1db32fa8e59b2fea1d3899163
PatrykGorol/SudokuSolver
old_version/gui.py
[ "MIT" ]
Python
create_grid
None
def create_grid(self, main_frame: tk.LabelFrame) -> None: """ Creates grid of sudoku squares. :param main_frame: tkinter master element for a squares' grid :return: None """ for square_row in range(3): for square_column in range(3): square = tk...
Creates grid of sudoku squares. :param main_frame: tkinter master element for a squares' grid :return: None
Creates grid of sudoku squares.
[ "Creates", "grid", "of", "sudoku", "squares", "." ]
def create_grid(self, main_frame: tk.LabelFrame) -> None: for square_row in range(3): for square_column in range(3): square = tk.Frame(main_frame, highlightbackground='black', highlightcolor='red', highlightthickness=1, width=120, heigh=120, padx=0) ...
[ "def", "create_grid", "(", "self", ",", "main_frame", ":", "tk", ".", "LabelFrame", ")", "->", "None", ":", "for", "square_row", "in", "range", "(", "3", ")", ":", "for", "square_column", "in", "range", "(", "3", ")", ":", "square", "=", "tk", ".", ...
Creates grid of sudoku squares.
[ "Creates", "grid", "of", "sudoku", "squares", "." ]
[ "\"\"\"\n Creates grid of sudoku squares.\n :param main_frame: tkinter master element for a squares' grid\n :return: None\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "main_frame", "type": "tk.LabelFrame" } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
aa57a661dfb8e6a1db32fa8e59b2fea1d3899163
PatrykGorol/SudokuSolver
old_version/gui.py
[ "MIT" ]
Python
create_cells_and_entries
None
def create_cells_and_entries(self, frame: tk.Frame, square_row: int) -> None: """ Creates 9 cells inside a square. :param frame: tkinter maser element (square) for a cell :param square_row: number of square's index :return: None """ for row in range(3): ...
Creates 9 cells inside a square. :param frame: tkinter maser element (square) for a cell :param square_row: number of square's index :return: None
Creates 9 cells inside a square.
[ "Creates", "9", "cells", "inside", "a", "square", "." ]
def create_cells_and_entries(self, frame: tk.Frame, square_row: int) -> None: for row in range(3): for column in range(3): cell = tk.Frame(frame, bg='white', highlightbackground='black', highlightcolor='black', highlightthickness=0.5, ...
[ "def", "create_cells_and_entries", "(", "self", ",", "frame", ":", "tk", ".", "Frame", ",", "square_row", ":", "int", ")", "->", "None", ":", "for", "row", "in", "range", "(", "3", ")", ":", "for", "column", "in", "range", "(", "3", ")", ":", "cell...
Creates 9 cells inside a square.
[ "Creates", "9", "cells", "inside", "a", "square", "." ]
[ "\"\"\"\n Creates 9 cells inside a square.\n :param frame: tkinter maser element (square) for a cell\n :param square_row: number of square's index\n :return: None\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "frame", "type": "tk.Frame" }, { "param": "square_row", "type": "int" } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
aa57a661dfb8e6a1db32fa8e59b2fea1d3899163
PatrykGorol/SudokuSolver
old_version/gui.py
[ "MIT" ]
Python
solve
None
def solve(self) -> None: """ Checks if sudoku array is valid and runs solving procedures. :return: None """ sudoku = Sudoku(self.get_data()) solver = SudokuSolver(sudoku) validation = solver.validate_sudoku() if validation == 1: solver.main_seq...
Checks if sudoku array is valid and runs solving procedures. :return: None
Checks if sudoku array is valid and runs solving procedures.
[ "Checks", "if", "sudoku", "array", "is", "valid", "and", "runs", "solving", "procedures", "." ]
def solve(self) -> None: sudoku = Sudoku(self.get_data()) solver = SudokuSolver(sudoku) validation = solver.validate_sudoku() if validation == 1: solver.main_sequence() self.get_result(solver) elif validation == -1: self.status_bar.config(text=...
[ "def", "solve", "(", "self", ")", "->", "None", ":", "sudoku", "=", "Sudoku", "(", "self", ".", "get_data", "(", ")", ")", "solver", "=", "SudokuSolver", "(", "sudoku", ")", "validation", "=", "solver", ".", "validate_sudoku", "(", ")", "if", "validati...
Checks if sudoku array is valid and runs solving procedures.
[ "Checks", "if", "sudoku", "array", "is", "valid", "and", "runs", "solving", "procedures", "." ]
[ "\"\"\"\n Checks if sudoku array is valid and runs solving procedures.\n :return: None\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
aa57a661dfb8e6a1db32fa8e59b2fea1d3899163
PatrykGorol/SudokuSolver
old_version/gui.py
[ "MIT" ]
Python
insert_digits
None
def insert_digits(self, solver) -> None: """ Inserts solving results into sudoku grid in window. :param solver: solver object containing completed array :return: None """ for row in range(9): for column in range(9): if self.entries[row][column]...
Inserts solving results into sudoku grid in window. :param solver: solver object containing completed array :return: None
Inserts solving results into sudoku grid in window.
[ "Inserts", "solving", "results", "into", "sudoku", "grid", "in", "window", "." ]
def insert_digits(self, solver) -> None: for row in range(9): for column in range(9): if self.entries[row][column].text == '': self.entries[row][column].text = solver.s.array[row, column] self.entries[row][column].entry.config(fg='blue') ...
[ "def", "insert_digits", "(", "self", ",", "solver", ")", "->", "None", ":", "for", "row", "in", "range", "(", "9", ")", ":", "for", "column", "in", "range", "(", "9", ")", ":", "if", "self", ".", "entries", "[", "row", "]", "[", "column", "]", ...
Inserts solving results into sudoku grid in window.
[ "Inserts", "solving", "results", "into", "sudoku", "grid", "in", "window", "." ]
[ "\"\"\"\n Inserts solving results into sudoku grid in window.\n :param solver: solver object containing completed array\n :return: None\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "solver", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
aa57a661dfb8e6a1db32fa8e59b2fea1d3899163
PatrykGorol/SudokuSolver
old_version/gui.py
[ "MIT" ]
Python
example
None
def example(self) -> None: """ Randomly chooses sudoku from saved examples and prints it into grid. :return: None """ random_sudoku = choice(sudoku_examples) for row in range(9): for column in range(9): self.entries[row][column].text = str(rand...
Randomly chooses sudoku from saved examples and prints it into grid. :return: None
Randomly chooses sudoku from saved examples and prints it into grid.
[ "Randomly", "chooses", "sudoku", "from", "saved", "examples", "and", "prints", "it", "into", "grid", "." ]
def example(self) -> None: random_sudoku = choice(sudoku_examples) for row in range(9): for column in range(9): self.entries[row][column].text = str(random_sudoku.array[row, column]) self.entries[row][column].entry.config(fg='black') self.status_bar.co...
[ "def", "example", "(", "self", ")", "->", "None", ":", "random_sudoku", "=", "choice", "(", "sudoku_examples", ")", "for", "row", "in", "range", "(", "9", ")", ":", "for", "column", "in", "range", "(", "9", ")", ":", "self", ".", "entries", "[", "r...
Randomly chooses sudoku from saved examples and prints it into grid.
[ "Randomly", "chooses", "sudoku", "from", "saved", "examples", "and", "prints", "it", "into", "grid", "." ]
[ "\"\"\"\n Randomly chooses sudoku from saved examples and prints it into grid.\n :return: None\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
65bffcffb77171a84db852fb2a14d55f236ba67a
redhat-cop/babylon
lab-ui-manager/operator/operator.py
[ "Apache-2.0" ]
Python
manage_bookbag_image_build
null
def manage_bookbag_image_build(namespace, name, bookbag_config, owner_ref, logger=None): """ Create BuildConfig and ImageStream to build Bookbag image. """ build_spec = deepcopy(bookbag_config['imageBuild']) build_spec['output'] = { "to": { "kind": "ImageStreamTag", "...
Create BuildConfig and ImageStream to build Bookbag image.
Create BuildConfig and ImageStream to build Bookbag image.
[ "Create", "BuildConfig", "and", "ImageStream", "to", "build", "Bookbag", "image", "." ]
def manage_bookbag_image_build(namespace, name, bookbag_config, owner_ref, logger=None): build_spec = deepcopy(bookbag_config['imageBuild']) build_spec['output'] = { "to": { "kind": "ImageStreamTag", "name": f"{name}:latest", } } if 'strategy' not in build_spec: ...
[ "def", "manage_bookbag_image_build", "(", "namespace", ",", "name", ",", "bookbag_config", ",", "owner_ref", ",", "logger", "=", "None", ")", ":", "build_spec", "=", "deepcopy", "(", "bookbag_config", "[", "'imageBuild'", "]", ")", "build_spec", "[", "'output'",...
Create BuildConfig and ImageStream to build Bookbag image.
[ "Create", "BuildConfig", "and", "ImageStream", "to", "build", "Bookbag", "image", "." ]
[ "\"\"\"\n Create BuildConfig and ImageStream to build Bookbag image.\n \"\"\"" ]
[ { "param": "namespace", "type": null }, { "param": "name", "type": null }, { "param": "bookbag_config", "type": null }, { "param": "owner_ref", "type": null }, { "param": "logger", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "namespace", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "name", "type": null, "docstring": null, "docstring_token...
65bffcffb77171a84db852fb2a14d55f236ba67a
redhat-cop/babylon
lab-ui-manager/operator/operator.py
[ "Apache-2.0" ]
Python
manage_bookbag_deployment
<not_specific>
def manage_bookbag_deployment(namespace, name, bookbag_config, bookbag_vars, owner_ref, image=None, image_stream=None, logger=None): """ Create Deployment, RoleBinding, Route, Service, ServiceAccount for bookbag. """ auth = bookbag_config.get('auth', {}) auth_user = auth.get('user', '*') auth_pa...
Create Deployment, RoleBinding, Route, Service, ServiceAccount for bookbag.
Create Deployment, RoleBinding, Route, Service, ServiceAccount for bookbag.
[ "Create", "Deployment", "RoleBinding", "Route", "Service", "ServiceAccount", "for", "bookbag", "." ]
def manage_bookbag_deployment(namespace, name, bookbag_config, bookbag_vars, owner_ref, image=None, image_stream=None, logger=None): auth = bookbag_config.get('auth', {}) auth_user = auth.get('user', '*') auth_password = auth.get('password', '') service_account = get_service_account(namespace, name) ...
[ "def", "manage_bookbag_deployment", "(", "namespace", ",", "name", ",", "bookbag_config", ",", "bookbag_vars", ",", "owner_ref", ",", "image", "=", "None", ",", "image_stream", "=", "None", ",", "logger", "=", "None", ")", ":", "auth", "=", "bookbag_config", ...
Create Deployment, RoleBinding, Route, Service, ServiceAccount for bookbag.
[ "Create", "Deployment", "RoleBinding", "Route", "Service", "ServiceAccount", "for", "bookbag", "." ]
[ "\"\"\"\n Create Deployment, RoleBinding, Route, Service, ServiceAccount for bookbag.\n \"\"\"", "# If image is set then use provided value.", "# Set image-change trigger on image stream", "# This is image value is just a place-holder, required for validation" ]
[ { "param": "namespace", "type": null }, { "param": "name", "type": null }, { "param": "bookbag_config", "type": null }, { "param": "bookbag_vars", "type": null }, { "param": "owner_ref", "type": null }, { "param": "image", "type": null }, { ...
{ "returns": [], "raises": [], "params": [ { "identifier": "namespace", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "name", "type": null, "docstring": null, "docstring_token...
0f0d33aa884a77f9d7a909e791fb712e6eff6943
redhat-cop/babylon
catalog/api/wsgi.py
[ "Apache-2.0" ]
Python
check_user_support_access
<not_specific>
def check_user_support_access(api_client): """ Check and return true if api_client is configured with babylon admin access. Access is determined by whether the user can directly manage AnarchySubjects. """ (data, status, headers) = api_client.call_api( '/apis/authorization.k8s.io/v1/selfsubj...
Check and return true if api_client is configured with babylon admin access. Access is determined by whether the user can directly manage AnarchySubjects.
Check and return true if api_client is configured with babylon admin access. Access is determined by whether the user can directly manage AnarchySubjects.
[ "Check", "and", "return", "true", "if", "api_client", "is", "configured", "with", "babylon", "admin", "access", ".", "Access", "is", "determined", "by", "whether", "the", "user", "can", "directly", "manage", "AnarchySubjects", "." ]
def check_user_support_access(api_client): (data, status, headers) = api_client.call_api( '/apis/authorization.k8s.io/v1/selfsubjectaccessreviews', 'POST', auth_settings = ['BearerToken'], body = { "apiVersion": "authorization.k8s.io/v1", "kind": "SelfSubjectAcc...
[ "def", "check_user_support_access", "(", "api_client", ")", ":", "(", "data", ",", "status", ",", "headers", ")", "=", "api_client", ".", "call_api", "(", "'/apis/authorization.k8s.io/v1/selfsubjectaccessreviews'", ",", "'POST'", ",", "auth_settings", "=", "[", "'Be...
Check and return true if api_client is configured with babylon admin access.
[ "Check", "and", "return", "true", "if", "api_client", "is", "configured", "with", "babylon", "admin", "access", "." ]
[ "\"\"\"\n Check and return true if api_client is configured with babylon admin access.\n Access is determined by whether the user can directly manage AnarchySubjects.\n \"\"\"" ]
[ { "param": "api_client", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "api_client", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
c1360e86d57c10566a44f7ae0aafce4b9cf917b4
swiftlee/albot-and-albota
cogs/messages.py
[ "MIT" ]
Python
on_raw_reaction_add
<not_specific>
async def on_raw_reaction_add(self, payload): """ Checks reactions and deletes tracked messages when necessary. """ if payload.user_id == self.bot.user.id: return if payload.emoji.name == CONSTANTS.REACTION_DELETE: is_tracked = False sender_uid = None ...
Checks reactions and deletes tracked messages when necessary.
Checks reactions and deletes tracked messages when necessary.
[ "Checks", "reactions", "and", "deletes", "tracked", "messages", "when", "necessary", "." ]
async def on_raw_reaction_add(self, payload): if payload.user_id == self.bot.user.id: return if payload.emoji.name == CONSTANTS.REACTION_DELETE: is_tracked = False sender_uid = None with SQLCursor(self.db) as cur: cur.execute("SELECT messid...
[ "async", "def", "on_raw_reaction_add", "(", "self", ",", "payload", ")", ":", "if", "payload", ".", "user_id", "==", "self", ".", "bot", ".", "user", ".", "id", ":", "return", "if", "payload", ".", "emoji", ".", "name", "==", "CONSTANTS", ".", "REACTIO...
Checks reactions and deletes tracked messages when necessary.
[ "Checks", "reactions", "and", "deletes", "tracked", "messages", "when", "necessary", "." ]
[ "\"\"\" Checks reactions and deletes tracked messages when necessary. \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "payload", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "payload", "type": null, "docstring": null, "docstring_tokens"...
c1360e86d57c10566a44f7ae0aafce4b9cf917b4
swiftlee/albot-and-albota
cogs/messages.py
[ "MIT" ]
Python
track
null
async def track(message, author=None): """ Marks a message in the database so that it will be automatically deleted if the sender or an admin reacts with the 'trash' emoji """ await message.add_reaction(CONSTANTS.REACTION_DELETE) sql_db = SQLConnection() aid = 0 if author: aid = ...
Marks a message in the database so that it will be automatically deleted if the sender or an admin reacts with the 'trash' emoji
Marks a message in the database so that it will be automatically deleted if the sender or an admin reacts with the 'trash' emoji
[ "Marks", "a", "message", "in", "the", "database", "so", "that", "it", "will", "be", "automatically", "deleted", "if", "the", "sender", "or", "an", "admin", "reacts", "with", "the", "'", "trash", "'", "emoji" ]
async def track(message, author=None): await message.add_reaction(CONSTANTS.REACTION_DELETE) sql_db = SQLConnection() aid = 0 if author: aid = author.id with SQLCursor(sql_db) as cur: cur.execute("INSERT INTO tracked_messages (messid, sender_uid, track_time) VALUES (?, ?, ?);...
[ "async", "def", "track", "(", "message", ",", "author", "=", "None", ")", ":", "await", "message", ".", "add_reaction", "(", "CONSTANTS", ".", "REACTION_DELETE", ")", "sql_db", "=", "SQLConnection", "(", ")", "aid", "=", "0", "if", "author", ":", "aid", ...
Marks a message in the database so that it will be automatically deleted if the sender or an admin reacts with the 'trash' emoji
[ "Marks", "a", "message", "in", "the", "database", "so", "that", "it", "will", "be", "automatically", "deleted", "if", "the", "sender", "or", "an", "admin", "reacts", "with", "the", "'", "trash", "'", "emoji" ]
[ "\"\"\" Marks a message in the database so that it will be automatically\n deleted if the sender or an admin reacts with the 'trash' emoji\n \"\"\"" ]
[ { "param": "message", "type": null }, { "param": "author", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "message", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "author", "type": null, "docstring": null, "docstring_token...
ae4c230083d06c8a0cdcaca423dbe816d79a410e
swiftlee/albot-and-albota
ALBot.py
[ "MIT" ]
Python
on_ready
null
async def on_ready(): """Print the bots information on connect""" global bot_url print('Logged in as "{name}" with id {id}'.format(name=bot.user.name,id=bot.user.id)) print('Invite URL: {iurl}'.format(iurl=bot_url.format(bot.user.id))) print('-----') await bot.change_presence(activity=discord.Ga...
Print the bots information on connect
Print the bots information on connect
[ "Print", "the", "bots", "information", "on", "connect" ]
async def on_ready(): global bot_url print('Logged in as "{name}" with id {id}'.format(name=bot.user.name,id=bot.user.id)) print('Invite URL: {iurl}'.format(iurl=bot_url.format(bot.user.id))) print('-----') await bot.change_presence(activity=discord.Game(name="Destroying propritary software"))
[ "async", "def", "on_ready", "(", ")", ":", "global", "bot_url", "print", "(", "'Logged in as \"{name}\" with id {id}'", ".", "format", "(", "name", "=", "bot", ".", "user", ".", "name", ",", "id", "=", "bot", ".", "user", ".", "id", ")", ")", "print", ...
Print the bots information on connect
[ "Print", "the", "bots", "information", "on", "connect" ]
[ "\"\"\"Print the bots information on connect\"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
008297d3dd8336218e66f6aae4202088e9985cbf
swiftlee/albot-and-albota
cogs/projects.py
[ "MIT" ]
Python
join
null
async def join(self, ctx, *, roleName: str): """Add a role to a user""" if roleName.lower() in ["muddy", "muddy swamp", "muddyswamp", "muddy-swamp", "MUD"]: await self.muddy(ctx) elif roleName.lower() in ["website", "club site", "club website", "clubwebsite", "clubsite"]: ...
Add a role to a user
Add a role to a user
[ "Add", "a", "role", "to", "a", "user" ]
async def join(self, ctx, *, roleName: str): if roleName.lower() in ["muddy", "muddy swamp", "muddyswamp", "muddy-swamp", "MUD"]: await self.muddy(ctx) elif roleName.lower() in ["website", "club site", "club website", "clubwebsite", "clubsite"]: await self.website(ctx) el...
[ "async", "def", "join", "(", "self", ",", "ctx", ",", "*", ",", "roleName", ":", "str", ")", ":", "if", "roleName", ".", "lower", "(", ")", "in", "[", "\"muddy\"", ",", "\"muddy swamp\"", ",", "\"muddyswamp\"", ",", "\"muddy-swamp\"", ",", "\"MUD\"", "...
Add a role to a user
[ "Add", "a", "role", "to", "a", "user" ]
[ "\"\"\"Add a role to a user\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "ctx", "type": null }, { "param": "roleName", "type": "str" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "ctx", "type": null, "docstring": null, "docstring_tokens": []...
12032ffa7ff0ed2ba95b4342fe92e81bad8529a8
simonjisu/InstaSpider
src/insta.py
[ "MIT" ]
Python
parse_tag
str
def parse_tag(self, tag: str) -> str: r"""parse the hashtag to ascii encoded string Args: tag (str): the hashtag that you want to search Returns: str: ascii encoded string """ return parse.quote(tag)
r"""parse the hashtag to ascii encoded string Args: tag (str): the hashtag that you want to search Returns: str: ascii encoded string
r"""parse the hashtag to ascii encoded string
[ "r", "\"", "\"", "\"", "parse", "the", "hashtag", "to", "ascii", "encoded", "string" ]
def parse_tag(self, tag: str) -> str: return parse.quote(tag)
[ "def", "parse_tag", "(", "self", ",", "tag", ":", "str", ")", "->", "str", ":", "return", "parse", ".", "quote", "(", "tag", ")" ]
r"""parse the hashtag to ascii encoded string
[ "r", "\"", "\"", "\"", "parse", "the", "hashtag", "to", "ascii", "encoded", "string" ]
[ "r\"\"\"parse the hashtag to ascii encoded string\n\n Args:\n tag (str): the hashtag that you want to search\n\n Returns:\n str: ascii encoded string\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "tag", "type": "str" } ]
{ "returns": [ { "docstring": "ascii encoded string", "docstring_tokens": [ "ascii", "encoded", "string" ], "type": "str" } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens"...
ae4ec4d824ee544999f413ecba5306929e0d24ea
munisisazade/demo_programs
school/decorators.py
[ "MIT" ]
Python
InvalidLoginAttempts
null
def InvalidLoginAttempts(request): """ If user want to brute force attack to Login system This method prevent from this attack And User ip address block automatic :param request: :return: """ ip = request.META.get('HTTP_X_FORWARDED_FOR', 'ipsiyoxdu') address = request.META.get('HTTP_...
If user want to brute force attack to Login system This method prevent from this attack And User ip address block automatic :param request: :return:
If user want to brute force attack to Login system This method prevent from this attack And User ip address block automatic
[ "If", "user", "want", "to", "brute", "force", "attack", "to", "Login", "system", "This", "method", "prevent", "from", "this", "attack", "And", "User", "ip", "address", "block", "automatic" ]
def InvalidLoginAttempts(request): ip = request.META.get('HTTP_X_FORWARDED_FOR', 'ipsiyoxdu') address = request.META.get('HTTP_USER_AGENT', 'unvaniyoxdu') try: log = AllowedIpAddress.objects.get(ip=ip, address=address) log.failed_login +=1 log.save() if log.failed_login == 5:...
[ "def", "InvalidLoginAttempts", "(", "request", ")", ":", "ip", "=", "request", ".", "META", ".", "get", "(", "'HTTP_X_FORWARDED_FOR'", ",", "'ipsiyoxdu'", ")", "address", "=", "request", ".", "META", ".", "get", "(", "'HTTP_USER_AGENT'", ",", "'unvaniyoxdu'", ...
If user want to brute force attack to Login system This method prevent from this attack And User ip address block automatic
[ "If", "user", "want", "to", "brute", "force", "attack", "to", "Login", "system", "This", "method", "prevent", "from", "this", "attack", "And", "User", "ip", "address", "block", "automatic" ]
[ "\"\"\"\n If user want to brute force attack to Login system\n This method prevent from this attack\n And User ip address block automatic\n :param request:\n :return:\n \"\"\"" ]
[ { "param": "request", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "request", "type": null, "docstring": null, "docstring_tokens": [ "None" ], "default": null, ...
8d46885a20f967bc0e3c0c331cd56fc3c5932d64
cuisongliu/quay
data/registry_model/interface.py
[ "Apache-2.0" ]
Python
find_matching_tag
null
def find_matching_tag(self, repository_ref, tag_names): """ Finds an alive tag in the repository matching one of the given tag names and returns it or None if none. """
Finds an alive tag in the repository matching one of the given tag names and returns it or None if none.
Finds an alive tag in the repository matching one of the given tag names and returns it or None if none.
[ "Finds", "an", "alive", "tag", "in", "the", "repository", "matching", "one", "of", "the", "given", "tag", "names", "and", "returns", "it", "or", "None", "if", "none", "." ]
def find_matching_tag(self, repository_ref, tag_names):
[ "def", "find_matching_tag", "(", "self", ",", "repository_ref", ",", "tag_names", ")", ":" ]
Finds an alive tag in the repository matching one of the given tag names and returns it or None if none.
[ "Finds", "an", "alive", "tag", "in", "the", "repository", "matching", "one", "of", "the", "given", "tag", "names", "and", "returns", "it", "or", "None", "if", "none", "." ]
[ "\"\"\"\n Finds an alive tag in the repository matching one of the given tag names and returns it or\n None if none.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "repository_ref", "type": null }, { "param": "tag_names", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "repository_ref", "type": null, "docstring": null, "docstring_...
8d46885a20f967bc0e3c0c331cd56fc3c5932d64
cuisongliu/quay
data/registry_model/interface.py
[ "Apache-2.0" ]
Python
lookup_repository
null
def lookup_repository(self, namespace_name, repo_name, kind_filter=None): """ Looks up and returns a reference to the repository with the given namespace and name, or None if none. """
Looks up and returns a reference to the repository with the given namespace and name, or None if none.
Looks up and returns a reference to the repository with the given namespace and name, or None if none.
[ "Looks", "up", "and", "returns", "a", "reference", "to", "the", "repository", "with", "the", "given", "namespace", "and", "name", "or", "None", "if", "none", "." ]
def lookup_repository(self, namespace_name, repo_name, kind_filter=None):
[ "def", "lookup_repository", "(", "self", ",", "namespace_name", ",", "repo_name", ",", "kind_filter", "=", "None", ")", ":" ]
Looks up and returns a reference to the repository with the given namespace and name, or None if none.
[ "Looks", "up", "and", "returns", "a", "reference", "to", "the", "repository", "with", "the", "given", "namespace", "and", "name", "or", "None", "if", "none", "." ]
[ "\"\"\"\n Looks up and returns a reference to the repository with the given namespace and name, or\n None if none.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "namespace_name", "type": null }, { "param": "repo_name", "type": null }, { "param": "kind_filter", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "namespace_name", "type": null, "docstring": null, "docstring_...
8d46885a20f967bc0e3c0c331cd56fc3c5932d64
cuisongliu/quay
data/registry_model/interface.py
[ "Apache-2.0" ]
Python
lookup_manifest_by_digest
null
def lookup_manifest_by_digest( self, repository_ref, manifest_digest, allow_dead=False, include_legacy_image=False, require_available=False, ): """ Looks up the manifest with the given digest under the given repository and returns it or None if...
Looks up the manifest with the given digest under the given repository and returns it or None if none. If allow_dead is True, manifests pointed to by dead tags will also be returned. If require_available is True, a temporary tag will be added onto the returned manifest (before ...
Looks up the manifest with the given digest under the given repository and returns it or None if none. If allow_dead is True, manifests pointed to by dead tags will also be returned. If require_available is True, a temporary tag will be added onto the returned manifest (before it is returned) to ensure it is available...
[ "Looks", "up", "the", "manifest", "with", "the", "given", "digest", "under", "the", "given", "repository", "and", "returns", "it", "or", "None", "if", "none", ".", "If", "allow_dead", "is", "True", "manifests", "pointed", "to", "by", "dead", "tags", "will"...
def lookup_manifest_by_digest( self, repository_ref, manifest_digest, allow_dead=False, include_legacy_image=False, require_available=False, ):
[ "def", "lookup_manifest_by_digest", "(", "self", ",", "repository_ref", ",", "manifest_digest", ",", "allow_dead", "=", "False", ",", "include_legacy_image", "=", "False", ",", "require_available", "=", "False", ",", ")", ":" ]
Looks up the manifest with the given digest under the given repository and returns it or None if none.
[ "Looks", "up", "the", "manifest", "with", "the", "given", "digest", "under", "the", "given", "repository", "and", "returns", "it", "or", "None", "if", "none", "." ]
[ "\"\"\"\n Looks up the manifest with the given digest under the given repository and returns it or\n None if none.\n\n If allow_dead is True, manifests pointed to by dead tags will also be returned. If\n require_available is True, a temporary tag will be added onto the returned manifest ...
[ { "param": "self", "type": null }, { "param": "repository_ref", "type": null }, { "param": "manifest_digest", "type": null }, { "param": "allow_dead", "type": null }, { "param": "include_legacy_image", "type": null }, { "param": "require_available", ...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "repository_ref", "type": null, "docstring": null, "docstring_...
8d46885a20f967bc0e3c0c331cd56fc3c5932d64
cuisongliu/quay
data/registry_model/interface.py
[ "Apache-2.0" ]
Python
create_manifest_and_retarget_tag
null
def create_manifest_and_retarget_tag( self, repository_ref, manifest_interface_instance, tag_name, storage, raise_on_error=False ): """ Creates a manifest in a repository, adding all of the necessary data in the model. The `manifest_interface_instance` parameter must be an instance ...
Creates a manifest in a repository, adding all of the necessary data in the model. The `manifest_interface_instance` parameter must be an instance of the manifest interface as returned by the image/docker package. Note that all blobs referenced by the manifest must exist under the rep...
Creates a manifest in a repository, adding all of the necessary data in the model. The `manifest_interface_instance` parameter must be an instance of the manifest interface as returned by the image/docker package. Note that all blobs referenced by the manifest must exist under the repository or this method will fail a...
[ "Creates", "a", "manifest", "in", "a", "repository", "adding", "all", "of", "the", "necessary", "data", "in", "the", "model", ".", "The", "`", "manifest_interface_instance", "`", "parameter", "must", "be", "an", "instance", "of", "the", "manifest", "interface"...
def create_manifest_and_retarget_tag( self, repository_ref, manifest_interface_instance, tag_name, storage, raise_on_error=False ):
[ "def", "create_manifest_and_retarget_tag", "(", "self", ",", "repository_ref", ",", "manifest_interface_instance", ",", "tag_name", ",", "storage", ",", "raise_on_error", "=", "False", ")", ":" ]
Creates a manifest in a repository, adding all of the necessary data in the model.
[ "Creates", "a", "manifest", "in", "a", "repository", "adding", "all", "of", "the", "necessary", "data", "in", "the", "model", "." ]
[ "\"\"\"\n Creates a manifest in a repository, adding all of the necessary data in the model.\n\n The `manifest_interface_instance` parameter must be an instance of the manifest\n interface as returned by the image/docker package.\n\n Note that all blobs referenced by the manifest must ex...
[ { "param": "self", "type": null }, { "param": "repository_ref", "type": null }, { "param": "manifest_interface_instance", "type": null }, { "param": "tag_name", "type": null }, { "param": "storage", "type": null }, { "param": "raise_on_error", "typ...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "repository_ref", "type": null, "docstring": null, "docstring_...
8d46885a20f967bc0e3c0c331cd56fc3c5932d64
cuisongliu/quay
data/registry_model/interface.py
[ "Apache-2.0" ]
Python
create_manifest_label
null
def create_manifest_label(self, manifest, key, value, source_type_name, media_type_name=None): """ Creates a label on the manifest with the given key and value. Can raise InvalidLabelKeyException or InvalidMediaTypeException depending on the validation errors. """
Creates a label on the manifest with the given key and value. Can raise InvalidLabelKeyException or InvalidMediaTypeException depending on the validation errors.
Creates a label on the manifest with the given key and value. Can raise InvalidLabelKeyException or InvalidMediaTypeException depending on the validation errors.
[ "Creates", "a", "label", "on", "the", "manifest", "with", "the", "given", "key", "and", "value", ".", "Can", "raise", "InvalidLabelKeyException", "or", "InvalidMediaTypeException", "depending", "on", "the", "validation", "errors", "." ]
def create_manifest_label(self, manifest, key, value, source_type_name, media_type_name=None):
[ "def", "create_manifest_label", "(", "self", ",", "manifest", ",", "key", ",", "value", ",", "source_type_name", ",", "media_type_name", "=", "None", ")", ":" ]
Creates a label on the manifest with the given key and value.
[ "Creates", "a", "label", "on", "the", "manifest", "with", "the", "given", "key", "and", "value", "." ]
[ "\"\"\"\n Creates a label on the manifest with the given key and value.\n\n Can raise InvalidLabelKeyException or InvalidMediaTypeException depending on the validation\n errors.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "manifest", "type": null }, { "param": "key", "type": null }, { "param": "value", "type": null }, { "param": "source_type_name", "type": null }, { "param": "media_type_name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "manifest", "type": null, "docstring": null, "docstring_tokens...
8d46885a20f967bc0e3c0c331cd56fc3c5932d64
cuisongliu/quay
data/registry_model/interface.py
[ "Apache-2.0" ]
Python
batch_create_manifest_labels
null
def batch_create_manifest_labels(self, manifest): """ Returns a context manager for batch creation of labels on a manifest. Can raise InvalidLabelKeyException or InvalidMediaTypeException depending on the validation errors. """
Returns a context manager for batch creation of labels on a manifest. Can raise InvalidLabelKeyException or InvalidMediaTypeException depending on the validation errors.
Returns a context manager for batch creation of labels on a manifest. Can raise InvalidLabelKeyException or InvalidMediaTypeException depending on the validation errors.
[ "Returns", "a", "context", "manager", "for", "batch", "creation", "of", "labels", "on", "a", "manifest", ".", "Can", "raise", "InvalidLabelKeyException", "or", "InvalidMediaTypeException", "depending", "on", "the", "validation", "errors", "." ]
def batch_create_manifest_labels(self, manifest):
[ "def", "batch_create_manifest_labels", "(", "self", ",", "manifest", ")", ":" ]
Returns a context manager for batch creation of labels on a manifest.
[ "Returns", "a", "context", "manager", "for", "batch", "creation", "of", "labels", "on", "a", "manifest", "." ]
[ "\"\"\"\n Returns a context manager for batch creation of labels on a manifest.\n\n Can raise InvalidLabelKeyException or InvalidMediaTypeException depending on the validation\n errors.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "manifest", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "manifest", "type": null, "docstring": null, "docstring_tokens...
8d46885a20f967bc0e3c0c331cd56fc3c5932d64
cuisongliu/quay
data/registry_model/interface.py
[ "Apache-2.0" ]
Python
list_manifest_labels
null
def list_manifest_labels(self, manifest, key_prefix=None): """ Returns all labels found on the manifest. If specified, the key_prefix will filter the labels returned to those keys that start with the given prefix. """
Returns all labels found on the manifest. If specified, the key_prefix will filter the labels returned to those keys that start with the given prefix.
Returns all labels found on the manifest. If specified, the key_prefix will filter the labels returned to those keys that start with the given prefix.
[ "Returns", "all", "labels", "found", "on", "the", "manifest", ".", "If", "specified", "the", "key_prefix", "will", "filter", "the", "labels", "returned", "to", "those", "keys", "that", "start", "with", "the", "given", "prefix", "." ]
def list_manifest_labels(self, manifest, key_prefix=None):
[ "def", "list_manifest_labels", "(", "self", ",", "manifest", ",", "key_prefix", "=", "None", ")", ":" ]
Returns all labels found on the manifest.
[ "Returns", "all", "labels", "found", "on", "the", "manifest", "." ]
[ "\"\"\"\n Returns all labels found on the manifest.\n\n If specified, the key_prefix will filter the labels returned to those keys that start with\n the given prefix.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "manifest", "type": null }, { "param": "key_prefix", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "manifest", "type": null, "docstring": null, "docstring_tokens...
8d46885a20f967bc0e3c0c331cd56fc3c5932d64
cuisongliu/quay
data/registry_model/interface.py
[ "Apache-2.0" ]
Python
delete_manifest_label
null
def delete_manifest_label(self, manifest, label_uuid): """ Delete the label with the specified UUID on the manifest. Returns the label deleted or None if none. """
Delete the label with the specified UUID on the manifest. Returns the label deleted or None if none.
Delete the label with the specified UUID on the manifest. Returns the label deleted or None if none.
[ "Delete", "the", "label", "with", "the", "specified", "UUID", "on", "the", "manifest", ".", "Returns", "the", "label", "deleted", "or", "None", "if", "none", "." ]
def delete_manifest_label(self, manifest, label_uuid):
[ "def", "delete_manifest_label", "(", "self", ",", "manifest", ",", "label_uuid", ")", ":" ]
Delete the label with the specified UUID on the manifest.
[ "Delete", "the", "label", "with", "the", "specified", "UUID", "on", "the", "manifest", "." ]
[ "\"\"\"\n Delete the label with the specified UUID on the manifest.\n\n Returns the label deleted or None if none.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "manifest", "type": null }, { "param": "label_uuid", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "manifest", "type": null, "docstring": null, "docstring_tokens...
8d46885a20f967bc0e3c0c331cd56fc3c5932d64
cuisongliu/quay
data/registry_model/interface.py
[ "Apache-2.0" ]
Python
lookup_cached_active_repository_tags
null
def lookup_cached_active_repository_tags( self, model_cache, repository_ref, start_pagination_id, limit ): """ Returns a page of active tags in a repository. Note that the tags returned by this method are ShallowTag objects, which only contain the tag name. This method will ...
Returns a page of active tags in a repository. Note that the tags returned by this method are ShallowTag objects, which only contain the tag name. This method will automatically cache the result and check the cache before making a call.
Returns a page of active tags in a repository. Note that the tags returned by this method are ShallowTag objects, which only contain the tag name. This method will automatically cache the result and check the cache before making a call.
[ "Returns", "a", "page", "of", "active", "tags", "in", "a", "repository", ".", "Note", "that", "the", "tags", "returned", "by", "this", "method", "are", "ShallowTag", "objects", "which", "only", "contain", "the", "tag", "name", ".", "This", "method", "will"...
def lookup_cached_active_repository_tags( self, model_cache, repository_ref, start_pagination_id, limit ):
[ "def", "lookup_cached_active_repository_tags", "(", "self", ",", "model_cache", ",", "repository_ref", ",", "start_pagination_id", ",", "limit", ")", ":" ]
Returns a page of active tags in a repository.
[ "Returns", "a", "page", "of", "active", "tags", "in", "a", "repository", "." ]
[ "\"\"\"\n Returns a page of active tags in a repository.\n\n Note that the tags returned by this method are ShallowTag objects, which only contain the\n tag name. This method will automatically cache the result and check the cache before making\n a call.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "model_cache", "type": null }, { "param": "repository_ref", "type": null }, { "param": "start_pagination_id", "type": null }, { "param": "limit", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "model_cache", "type": null, "docstring": null, "docstring_tok...
8d46885a20f967bc0e3c0c331cd56fc3c5932d64
cuisongliu/quay
data/registry_model/interface.py
[ "Apache-2.0" ]
Python
lookup_active_repository_tags
null
def lookup_active_repository_tags(self, repository_ref, start_pagination_id, limit): """ Returns a page of active tags in a repository. Note that the tags returned by this method are ShallowTag objects, which only contain the tag name. """
Returns a page of active tags in a repository. Note that the tags returned by this method are ShallowTag objects, which only contain the tag name.
Returns a page of active tags in a repository. Note that the tags returned by this method are ShallowTag objects, which only contain the tag name.
[ "Returns", "a", "page", "of", "active", "tags", "in", "a", "repository", ".", "Note", "that", "the", "tags", "returned", "by", "this", "method", "are", "ShallowTag", "objects", "which", "only", "contain", "the", "tag", "name", "." ]
def lookup_active_repository_tags(self, repository_ref, start_pagination_id, limit):
[ "def", "lookup_active_repository_tags", "(", "self", ",", "repository_ref", ",", "start_pagination_id", ",", "limit", ")", ":" ]
Returns a page of active tags in a repository.
[ "Returns", "a", "page", "of", "active", "tags", "in", "a", "repository", "." ]
[ "\"\"\"\n Returns a page of active tags in a repository.\n\n Note that the tags returned by this method are ShallowTag objects, which only contain the\n tag name.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "repository_ref", "type": null }, { "param": "start_pagination_id", "type": null }, { "param": "limit", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "repository_ref", "type": null, "docstring": null, "docstring_...
8d46885a20f967bc0e3c0c331cd56fc3c5932d64
cuisongliu/quay
data/registry_model/interface.py
[ "Apache-2.0" ]
Python
list_all_active_repository_tags
null
def list_all_active_repository_tags(self, repository_ref, include_legacy_images=False): """ Returns a list of all the active tags in the repository. Note that this is a *HEAVY* operation on repositories with a lot of tags, and should only be used for testing or where other more specific...
Returns a list of all the active tags in the repository. Note that this is a *HEAVY* operation on repositories with a lot of tags, and should only be used for testing or where other more specific operations are not possible.
Returns a list of all the active tags in the repository. Note that this is a *HEAVY* operation on repositories with a lot of tags, and should only be used for testing or where other more specific operations are not possible.
[ "Returns", "a", "list", "of", "all", "the", "active", "tags", "in", "the", "repository", ".", "Note", "that", "this", "is", "a", "*", "HEAVY", "*", "operation", "on", "repositories", "with", "a", "lot", "of", "tags", "and", "should", "only", "be", "use...
def list_all_active_repository_tags(self, repository_ref, include_legacy_images=False):
[ "def", "list_all_active_repository_tags", "(", "self", ",", "repository_ref", ",", "include_legacy_images", "=", "False", ")", ":" ]
Returns a list of all the active tags in the repository.
[ "Returns", "a", "list", "of", "all", "the", "active", "tags", "in", "the", "repository", "." ]
[ "\"\"\"\n Returns a list of all the active tags in the repository.\n\n Note that this is a *HEAVY* operation on repositories with a lot of tags, and should only be\n used for testing or where other more specific operations are not possible.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "repository_ref", "type": null }, { "param": "include_legacy_images", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "repository_ref", "type": null, "docstring": null, "docstring_...
8d46885a20f967bc0e3c0c331cd56fc3c5932d64
cuisongliu/quay
data/registry_model/interface.py
[ "Apache-2.0" ]
Python
list_repository_tag_history
null
def list_repository_tag_history( self, repository_ref, page=1, size=100, specific_tag_name=None, active_tags_only=False, since_time_ms=None, ): """ Returns the history of all tags in the repository (unless filtered). This includes tags...
Returns the history of all tags in the repository (unless filtered). This includes tags that have been made in-active due to newer versions of those tags coming into service.
Returns the history of all tags in the repository (unless filtered). This includes tags that have been made in-active due to newer versions of those tags coming into service.
[ "Returns", "the", "history", "of", "all", "tags", "in", "the", "repository", "(", "unless", "filtered", ")", ".", "This", "includes", "tags", "that", "have", "been", "made", "in", "-", "active", "due", "to", "newer", "versions", "of", "those", "tags", "c...
def list_repository_tag_history( self, repository_ref, page=1, size=100, specific_tag_name=None, active_tags_only=False, since_time_ms=None, ):
[ "def", "list_repository_tag_history", "(", "self", ",", "repository_ref", ",", "page", "=", "1", ",", "size", "=", "100", ",", "specific_tag_name", "=", "None", ",", "active_tags_only", "=", "False", ",", "since_time_ms", "=", "None", ",", ")", ":" ]
Returns the history of all tags in the repository (unless filtered).
[ "Returns", "the", "history", "of", "all", "tags", "in", "the", "repository", "(", "unless", "filtered", ")", "." ]
[ "\"\"\"\n Returns the history of all tags in the repository (unless filtered).\n\n This includes tags that have been made in-active due to newer versions of those tags coming\n into service.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "repository_ref", "type": null }, { "param": "page", "type": null }, { "param": "size", "type": null }, { "param": "specific_tag_name", "type": null }, { "param": "active_tags_only", "type": null }, ...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "repository_ref", "type": null, "docstring": null, "docstring_...
8d46885a20f967bc0e3c0c331cd56fc3c5932d64
cuisongliu/quay
data/registry_model/interface.py
[ "Apache-2.0" ]
Python
has_expired_tag
null
def has_expired_tag(self, repository_ref, tag_name): """ Returns true if and only if the repository contains a tag with the given name that is expired. """
Returns true if and only if the repository contains a tag with the given name that is expired.
Returns true if and only if the repository contains a tag with the given name that is expired.
[ "Returns", "true", "if", "and", "only", "if", "the", "repository", "contains", "a", "tag", "with", "the", "given", "name", "that", "is", "expired", "." ]
def has_expired_tag(self, repository_ref, tag_name):
[ "def", "has_expired_tag", "(", "self", ",", "repository_ref", ",", "tag_name", ")", ":" ]
Returns true if and only if the repository contains a tag with the given name that is expired.
[ "Returns", "true", "if", "and", "only", "if", "the", "repository", "contains", "a", "tag", "with", "the", "given", "name", "that", "is", "expired", "." ]
[ "\"\"\"\n Returns true if and only if the repository contains a tag with the given name that is\n expired.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "repository_ref", "type": null }, { "param": "tag_name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "repository_ref", "type": null, "docstring": null, "docstring_...
8d46885a20f967bc0e3c0c331cd56fc3c5932d64
cuisongliu/quay
data/registry_model/interface.py
[ "Apache-2.0" ]
Python
retarget_tag
null
def retarget_tag( self, repository_ref, tag_name, manifest_or_legacy_image, storage, legacy_manifest_key, is_reversion=False, ): """ Creates, updates or moves a tag to a new entry in history, pointing to the manifest or legacy image spe...
Creates, updates or moves a tag to a new entry in history, pointing to the manifest or legacy image specified. If is_reversion is set to True, this operation is considered a reversion over a previous tag move operation. Returns the updated Tag or None on error.
Creates, updates or moves a tag to a new entry in history, pointing to the manifest or legacy image specified. If is_reversion is set to True, this operation is considered a reversion over a previous tag move operation. Returns the updated Tag or None on error.
[ "Creates", "updates", "or", "moves", "a", "tag", "to", "a", "new", "entry", "in", "history", "pointing", "to", "the", "manifest", "or", "legacy", "image", "specified", ".", "If", "is_reversion", "is", "set", "to", "True", "this", "operation", "is", "consid...
def retarget_tag( self, repository_ref, tag_name, manifest_or_legacy_image, storage, legacy_manifest_key, is_reversion=False, ):
[ "def", "retarget_tag", "(", "self", ",", "repository_ref", ",", "tag_name", ",", "manifest_or_legacy_image", ",", "storage", ",", "legacy_manifest_key", ",", "is_reversion", "=", "False", ",", ")", ":" ]
Creates, updates or moves a tag to a new entry in history, pointing to the manifest or legacy image specified.
[ "Creates", "updates", "or", "moves", "a", "tag", "to", "a", "new", "entry", "in", "history", "pointing", "to", "the", "manifest", "or", "legacy", "image", "specified", "." ]
[ "\"\"\"\n Creates, updates or moves a tag to a new entry in history, pointing to the manifest or\n legacy image specified.\n\n If is_reversion is set to True, this operation is considered a reversion over a previous tag\n move operation. Returns the updated Tag or None on error.\n ...
[ { "param": "self", "type": null }, { "param": "repository_ref", "type": null }, { "param": "tag_name", "type": null }, { "param": "manifest_or_legacy_image", "type": null }, { "param": "storage", "type": null }, { "param": "legacy_manifest_key", "t...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "repository_ref", "type": null, "docstring": null, "docstring_...
8d46885a20f967bc0e3c0c331cd56fc3c5932d64
cuisongliu/quay
data/registry_model/interface.py
[ "Apache-2.0" ]
Python
delete_tags_for_manifest
null
def delete_tags_for_manifest(self, manifest): """ Deletes all tags pointing to the given manifest, making the manifest inaccessible for pulling. Returns the tags deleted, if any. Returns None on error. """
Deletes all tags pointing to the given manifest, making the manifest inaccessible for pulling. Returns the tags deleted, if any. Returns None on error.
Deletes all tags pointing to the given manifest, making the manifest inaccessible for pulling. Returns the tags deleted, if any. Returns None on error.
[ "Deletes", "all", "tags", "pointing", "to", "the", "given", "manifest", "making", "the", "manifest", "inaccessible", "for", "pulling", ".", "Returns", "the", "tags", "deleted", "if", "any", ".", "Returns", "None", "on", "error", "." ]
def delete_tags_for_manifest(self, manifest):
[ "def", "delete_tags_for_manifest", "(", "self", ",", "manifest", ")", ":" ]
Deletes all tags pointing to the given manifest, making the manifest inaccessible for pulling.
[ "Deletes", "all", "tags", "pointing", "to", "the", "given", "manifest", "making", "the", "manifest", "inaccessible", "for", "pulling", "." ]
[ "\"\"\"\n Deletes all tags pointing to the given manifest, making the manifest inaccessible for\n pulling.\n\n Returns the tags deleted, if any. Returns None on error.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "manifest", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "manifest", "type": null, "docstring": null, "docstring_tokens...
8d46885a20f967bc0e3c0c331cd56fc3c5932d64
cuisongliu/quay
data/registry_model/interface.py
[ "Apache-2.0" ]
Python
change_repository_tag_expiration
null
def change_repository_tag_expiration(self, tag, expiration_date): """ Sets the expiration date of the tag under the matching repository to that given. If the expiration date is None, then the tag will not expire. Returns a tuple of the previous expiration timestamp in seconds (if any), ...
Sets the expiration date of the tag under the matching repository to that given. If the expiration date is None, then the tag will not expire. Returns a tuple of the previous expiration timestamp in seconds (if any), and whether the operation succeeded.
Sets the expiration date of the tag under the matching repository to that given. If the expiration date is None, then the tag will not expire. Returns a tuple of the previous expiration timestamp in seconds (if any), and whether the operation succeeded.
[ "Sets", "the", "expiration", "date", "of", "the", "tag", "under", "the", "matching", "repository", "to", "that", "given", ".", "If", "the", "expiration", "date", "is", "None", "then", "the", "tag", "will", "not", "expire", ".", "Returns", "a", "tuple", "...
def change_repository_tag_expiration(self, tag, expiration_date):
[ "def", "change_repository_tag_expiration", "(", "self", ",", "tag", ",", "expiration_date", ")", ":" ]
Sets the expiration date of the tag under the matching repository to that given.
[ "Sets", "the", "expiration", "date", "of", "the", "tag", "under", "the", "matching", "repository", "to", "that", "given", "." ]
[ "\"\"\"\n Sets the expiration date of the tag under the matching repository to that given.\n\n If the expiration date is None, then the tag will not expire. Returns a tuple of the\n previous expiration timestamp in seconds (if any), and whether the operation succeeded.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "tag", "type": null }, { "param": "expiration_date", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "tag", "type": null, "docstring": null, "docstring_tokens": []...