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
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
image_overlay
<not_specific>
def image_overlay(self, url, bounds, name): """Overlays an image from the Internet or locally on the map. Args: url (str): http URL or local file path to the image. bounds (tuple): bounding box of the image in the format of (lower_left(lat, lon), upper_right(lat, lon)), suc...
Overlays an image from the Internet or locally on the map. Args: url (str): http URL or local file path to the image. bounds (tuple): bounding box of the image in the format of (lower_left(lat, lon), upper_right(lat, lon)), such as ((13, -130), (32, -100)). name (str): ...
Overlays an image from the Internet or locally on the map.
[ "Overlays", "an", "image", "from", "the", "Internet", "or", "locally", "on", "the", "map", "." ]
def image_overlay(self, url, bounds, name): from base64 import b64encode from io import BytesIO from PIL import Image, ImageSequence try: if not url.startswith("http"): if not os.path.exists(url): print("The provided file does not exist.") ...
[ "def", "image_overlay", "(", "self", ",", "url", ",", "bounds", ",", "name", ")", ":", "from", "base64", "import", "b64encode", "from", "io", "import", "BytesIO", "from", "PIL", "import", "Image", ",", "ImageSequence", "try", ":", "if", "not", "url", "."...
Overlays an image from the Internet or locally on the map.
[ "Overlays", "an", "image", "from", "the", "Internet", "or", "locally", "on", "the", "map", "." ]
[ "\"\"\"Overlays an image from the Internet or locally on the map.\r\n\r\n Args:\r\n url (str): http URL or local file path to the image.\r\n bounds (tuple): bounding box of the image in the format of (lower_left(lat, lon), upper_right(lat, lon)), such as ((13, -130), (32, -100)).\r\n ...
[ { "param": "self", "type": null }, { "param": "url", "type": null }, { "param": "bounds", "type": null }, { "param": "name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "url", "type": null, "docstring": "http URL or local file path to th...
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
video_overlay
null
def video_overlay(self, url, bounds, name): """Overlays a video from the Internet on the map. Args: url (str): http URL of the video, such as "https://www.mapbox.com/bites/00188/patricia_nasa.webm" bounds (tuple): bounding box of the video in the format of (lower_left(lat, ...
Overlays a video from the Internet on the map. Args: url (str): http URL of the video, such as "https://www.mapbox.com/bites/00188/patricia_nasa.webm" bounds (tuple): bounding box of the video in the format of (lower_left(lat, lon), upper_right(lat, lon)), such as ((13, -130), (32, ...
Overlays a video from the Internet on the map.
[ "Overlays", "a", "video", "from", "the", "Internet", "on", "the", "map", "." ]
def video_overlay(self, url, bounds, name): try: video = ipyleaflet.VideoOverlay(url=url, bounds=bounds, name=name) self.add_layer(video) except Exception as e: print(e)
[ "def", "video_overlay", "(", "self", ",", "url", ",", "bounds", ",", "name", ")", ":", "try", ":", "video", "=", "ipyleaflet", ".", "VideoOverlay", "(", "url", "=", "url", ",", "bounds", "=", "bounds", ",", "name", "=", "name", ")", "self", ".", "a...
Overlays a video from the Internet on the map.
[ "Overlays", "a", "video", "from", "the", "Internet", "on", "the", "map", "." ]
[ "\"\"\"Overlays a video from the Internet on the map.\r\n\r\n Args:\r\n url (str): http URL of the video, such as \"https://www.mapbox.com/bites/00188/patricia_nasa.webm\"\r\n bounds (tuple): bounding box of the video in the format of (lower_left(lat, lon), upper_right(lat, lon)), such ...
[ { "param": "self", "type": null }, { "param": "url", "type": null }, { "param": "bounds", "type": null }, { "param": "name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "url", "type": null, "docstring": null, "docstring_tokens": [ ...
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
to_html
<not_specific>
def to_html( self, outfile=None, title="My Map", width="100%", height="880px", add_layer_control=True, **kwargs, ): """Saves the map as an HTML file. Args: outfile (str, optional): The output file path to the HTML file....
Saves the map as an HTML file. Args: outfile (str, optional): The output file path to the HTML file. title (str, optional): The title of the HTML file. Defaults to 'My Map'. width (str, optional): The width of the map in pixels or percentage. Defaults to '100%'. ...
Saves the map as an HTML file.
[ "Saves", "the", "map", "as", "an", "HTML", "file", "." ]
def to_html( self, outfile=None, title="My Map", width="100%", height="880px", add_layer_control=True, **kwargs, ): try: save = True if outfile is not None: if not outfile.endswith(".html"): r...
[ "def", "to_html", "(", "self", ",", "outfile", "=", "None", ",", "title", "=", "\"My Map\"", ",", "width", "=", "\"100%\"", ",", "height", "=", "\"880px\"", ",", "add_layer_control", "=", "True", ",", "**", "kwargs", ",", ")", ":", "try", ":", "save", ...
Saves the map as an HTML file.
[ "Saves", "the", "map", "as", "an", "HTML", "file", "." ]
[ "\"\"\"Saves the map as an HTML file.\r\n\r\n Args:\r\n outfile (str, optional): The output file path to the HTML file.\r\n title (str, optional): The title of the HTML file. Defaults to 'My Map'.\r\n width (str, optional): The width of the map in pixels or percentage. Defaul...
[ { "param": "self", "type": null }, { "param": "outfile", "type": null }, { "param": "title", "type": null }, { "param": "width", "type": null }, { "param": "height", "type": null }, { "param": "add_layer_control", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "outfile", "type": null, "docstring": "The output file path to the H...
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
to_image
<not_specific>
def to_image(self, outfile=None, monitor=1): """Saves the map as a PNG or JPG image. Args: outfile (str, optional): The output file path to the image. Defaults to None. monitor (int, optional): The monitor to take the screenshot. Defaults to 1. """ if outf...
Saves the map as a PNG or JPG image. Args: outfile (str, optional): The output file path to the image. Defaults to None. monitor (int, optional): The monitor to take the screenshot. Defaults to 1.
Saves the map as a PNG or JPG image.
[ "Saves", "the", "map", "as", "a", "PNG", "or", "JPG", "image", "." ]
def to_image(self, outfile=None, monitor=1): if outfile is None: outfile = os.path.join(os.getcwd(), "my_map.png") if outfile.endswith(".png") or outfile.endswith(".jpg"): pass else: print("The output file must be a PNG or JPG image.") return ...
[ "def", "to_image", "(", "self", ",", "outfile", "=", "None", ",", "monitor", "=", "1", ")", ":", "if", "outfile", "is", "None", ":", "outfile", "=", "os", ".", "path", ".", "join", "(", "os", ".", "getcwd", "(", ")", ",", "\"my_map.png\"", ")", "...
Saves the map as a PNG or JPG image.
[ "Saves", "the", "map", "as", "a", "PNG", "or", "JPG", "image", "." ]
[ "\"\"\"Saves the map as a PNG or JPG image.\r\n\r\n Args:\r\n outfile (str, optional): The output file path to the image. Defaults to None.\r\n monitor (int, optional): The monitor to take the screenshot. Defaults to 1.\r\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "outfile", "type": null }, { "param": "monitor", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "outfile", "type": null, "docstring": "The output file path to the i...
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
toolbar_reset
null
def toolbar_reset(self): """Reset the toolbar so that no tool is selected.""" toolbar_grid = self.toolbar for tool in toolbar_grid.children: tool.value = False
Reset the toolbar so that no tool is selected.
Reset the toolbar so that no tool is selected.
[ "Reset", "the", "toolbar", "so", "that", "no", "tool", "is", "selected", "." ]
def toolbar_reset(self): toolbar_grid = self.toolbar for tool in toolbar_grid.children: tool.value = False
[ "def", "toolbar_reset", "(", "self", ")", ":", "toolbar_grid", "=", "self", ".", "toolbar", "for", "tool", "in", "toolbar_grid", ".", "children", ":", "tool", ".", "value", "=", "False" ]
Reset the toolbar so that no tool is selected.
[ "Reset", "the", "toolbar", "so", "that", "no", "tool", "is", "selected", "." ]
[ "\"\"\"Reset the toolbar so that no tool is selected.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
add_local_tile
null
def add_local_tile( self, source, band=None, palette=None, vmin=None, vmax=None, nodata=None, attribution=None, layer_name=None, **kwargs, ): """Add a local raster dataset to the map. Args: so...
Add a local raster dataset to the map. Args: source (str): The path to the GeoTIFF file or the URL of the Cloud Optimized GeoTIFF. band (int, optional): The band to use. Band indexing starts at 1. Defaults to None. palette (str, optional): The name of the color palette ...
Add a local raster dataset to the map.
[ "Add", "a", "local", "raster", "dataset", "to", "the", "map", "." ]
def add_local_tile( self, source, band=None, palette=None, vmin=None, vmax=None, nodata=None, attribution=None, layer_name=None, **kwargs, ): tile, bounds = get_local_tile_layer( source, band=band, ...
[ "def", "add_local_tile", "(", "self", ",", "source", ",", "band", "=", "None", ",", "palette", "=", "None", ",", "vmin", "=", "None", ",", "vmax", "=", "None", ",", "nodata", "=", "None", ",", "attribution", "=", "None", ",", "layer_name", "=", "None...
Add a local raster dataset to the map.
[ "Add", "a", "local", "raster", "dataset", "to", "the", "map", "." ]
[ "\"\"\"Add a local raster dataset to the map.\r\n\r\n Args:\r\n source (str): The path to the GeoTIFF file or the URL of the Cloud Optimized GeoTIFF.\r\n band (int, optional): The band to use. Band indexing starts at 1. Defaults to None.\r\n palette (str, optional): The name ...
[ { "param": "self", "type": null }, { "param": "source", "type": null }, { "param": "band", "type": null }, { "param": "palette", "type": null }, { "param": "vmin", "type": null }, { "param": "vmax", "type": null }, { "param": "nodata", ...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "source", "type": null, "docstring": "The path to the GeoTIFF file o...
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
add_remote_tile
null
def add_remote_tile( self, source, band=None, palette=None, vmin=None, vmax=None, nodata=None, attribution=None, layer_name=None, **kwargs, ): """Add a remote Cloud Optimized GeoTIFF (COG) to the map. Args...
Add a remote Cloud Optimized GeoTIFF (COG) to the map. Args: source (str): The path to the remote Cloud Optimized GeoTIFF. band (int, optional): The band to use. Band indexing starts at 1. Defaults to None. palette (str, optional): The name of the color palette from `pa...
Add a remote Cloud Optimized GeoTIFF (COG) to the map.
[ "Add", "a", "remote", "Cloud", "Optimized", "GeoTIFF", "(", "COG", ")", "to", "the", "map", "." ]
def add_remote_tile( self, source, band=None, palette=None, vmin=None, vmax=None, nodata=None, attribution=None, layer_name=None, **kwargs, ): if isinstance(source, str) and source.startswith("http"): self.add_local_...
[ "def", "add_remote_tile", "(", "self", ",", "source", ",", "band", "=", "None", ",", "palette", "=", "None", ",", "vmin", "=", "None", ",", "vmax", "=", "None", ",", "nodata", "=", "None", ",", "attribution", "=", "None", ",", "layer_name", "=", "Non...
Add a remote Cloud Optimized GeoTIFF (COG) to the map.
[ "Add", "a", "remote", "Cloud", "Optimized", "GeoTIFF", "(", "COG", ")", "to", "the", "map", "." ]
[ "\"\"\"Add a remote Cloud Optimized GeoTIFF (COG) to the map.\r\n\r\n Args:\r\n source (str): The path to the remote Cloud Optimized GeoTIFF.\r\n band (int, optional): The band to use. Band indexing starts at 1. Defaults to None.\r\n palette (str, optional): The name of the c...
[ { "param": "self", "type": null }, { "param": "source", "type": null }, { "param": "band", "type": null }, { "param": "palette", "type": null }, { "param": "vmin", "type": null }, { "param": "vmax", "type": null }, { "param": "nodata", ...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "source", "type": null, "docstring": "The path to the remote Cloud O...
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
add_raster
<not_specific>
def add_raster( self, image, bands=None, layer_name=None, colormap=None, x_dim="x", y_dim="y", ): """Adds a local raster dataset to the map. Args: image (str): The image file path. bands (int or list, optio...
Adds a local raster dataset to the map. Args: image (str): The image file path. bands (int or list, optional): The image bands to use. It can be either a number (e.g., 1) or a list (e.g., [3, 2, 1]). Defaults to None. layer_name (str, optional): The layer name to use fo...
Adds a local raster dataset to the map.
[ "Adds", "a", "local", "raster", "dataset", "to", "the", "map", "." ]
def add_raster( self, image, bands=None, layer_name=None, colormap=None, x_dim="x", y_dim="y", ): try: import xarray_leaflet except Exception: raise ImportError( "You need to install xarray_leaflet first....
[ "def", "add_raster", "(", "self", ",", "image", ",", "bands", "=", "None", ",", "layer_name", "=", "None", ",", "colormap", "=", "None", ",", "x_dim", "=", "\"x\"", ",", "y_dim", "=", "\"y\"", ",", ")", ":", "try", ":", "import", "xarray_leaflet", "e...
Adds a local raster dataset to the map.
[ "Adds", "a", "local", "raster", "dataset", "to", "the", "map", "." ]
[ "\"\"\"Adds a local raster dataset to the map.\r\n\r\n Args:\r\n image (str): The image file path.\r\n bands (int or list, optional): The image bands to use. It can be either a number (e.g., 1) or a list (e.g., [3, 2, 1]). Defaults to None.\r\n layer_name (str, optional): The...
[ { "param": "self", "type": null }, { "param": "image", "type": null }, { "param": "bands", "type": null }, { "param": "layer_name", "type": null }, { "param": "colormap", "type": null }, { "param": "x_dim", "type": null }, { "param": "y_dim...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "image", "type": null, "docstring": "The image file path.", "d...
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
remove_drawn_features
null
def remove_drawn_features(self): """Removes user-drawn geometries from the map""" if self.draw_layer is not None: self.remove_layer(self.draw_layer) self.draw_count = 0 self.draw_features = [] self.draw_last_feature = None self.draw_laye...
Removes user-drawn geometries from the map
Removes user-drawn geometries from the map
[ "Removes", "user", "-", "drawn", "geometries", "from", "the", "map" ]
def remove_drawn_features(self): if self.draw_layer is not None: self.remove_layer(self.draw_layer) self.draw_count = 0 self.draw_features = [] self.draw_last_feature = None self.draw_layer = None self.draw_last_json = None self...
[ "def", "remove_drawn_features", "(", "self", ")", ":", "if", "self", ".", "draw_layer", "is", "not", "None", ":", "self", ".", "remove_layer", "(", "self", ".", "draw_layer", ")", "self", ".", "draw_count", "=", "0", "self", ".", "draw_features", "=", "[...
Removes user-drawn geometries from the map
[ "Removes", "user", "-", "drawn", "geometries", "from", "the", "map" ]
[ "\"\"\"Removes user-drawn geometries from the map\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
remove_last_drawn
null
def remove_last_drawn(self): """Removes user-drawn geometries from the map""" if self.draw_layer is not None: collection = ee.FeatureCollection(self.draw_features[:-1]) ee_draw_layer = ee_tile_layer( collection, {"color": "blue"}, "Drawn Features", True, 0.5 ...
Removes user-drawn geometries from the map
Removes user-drawn geometries from the map
[ "Removes", "user", "-", "drawn", "geometries", "from", "the", "map" ]
def remove_last_drawn(self): if self.draw_layer is not None: collection = ee.FeatureCollection(self.draw_features[:-1]) ee_draw_layer = ee_tile_layer( collection, {"color": "blue"}, "Drawn Features", True, 0.5 ) if self.draw_count == 1: ...
[ "def", "remove_last_drawn", "(", "self", ")", ":", "if", "self", ".", "draw_layer", "is", "not", "None", ":", "collection", "=", "ee", ".", "FeatureCollection", "(", "self", ".", "draw_features", "[", ":", "-", "1", "]", ")", "ee_draw_layer", "=", "ee_ti...
Removes user-drawn geometries from the map
[ "Removes", "user", "-", "drawn", "geometries", "from", "the", "map" ]
[ "\"\"\"Removes user-drawn geometries from the map\"\"\"", "# self.chart_labels = None\r" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
extract_values_to_points
<not_specific>
def extract_values_to_points(self, filename): """Exports pixel values to a csv file based on user-drawn geometries. Args: filename (str): The output file path to the csv file or shapefile. """ import csv filename = os.path.abspath(filename) allowed_...
Exports pixel values to a csv file based on user-drawn geometries. Args: filename (str): The output file path to the csv file or shapefile.
Exports pixel values to a csv file based on user-drawn geometries.
[ "Exports", "pixel", "values", "to", "a", "csv", "file", "based", "on", "user", "-", "drawn", "geometries", "." ]
def extract_values_to_points(self, filename): import csv filename = os.path.abspath(filename) allowed_formats = ["csv", "shp"] ext = filename[-3:] if ext not in allowed_formats: print( "The output file must be one of the following: {}".format( ...
[ "def", "extract_values_to_points", "(", "self", ",", "filename", ")", ":", "import", "csv", "filename", "=", "os", ".", "path", ".", "abspath", "(", "filename", ")", "allowed_formats", "=", "[", "\"csv\"", ",", "\"shp\"", "]", "ext", "=", "filename", "[", ...
Exports pixel values to a csv file based on user-drawn geometries.
[ "Exports", "pixel", "values", "to", "a", "csv", "file", "based", "on", "user", "-", "drawn", "geometries", "." ]
[ "\"\"\"Exports pixel values to a csv file based on user-drawn geometries.\r\n\r\n Args:\r\n filename (str): The output file path to the csv file or shapefile.\r\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "filename", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "filename", "type": null, "docstring": "The output file path to the ...
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
add_styled_vector
null
def add_styled_vector( self, ee_object, column, palette, layer_name="Untitled", **kwargs ): """Adds a styled vector to the map. Args: ee_object (object): An ee.FeatureCollection. column (str): The column name to use for styling. palette (list | di...
Adds a styled vector to the map. Args: ee_object (object): An ee.FeatureCollection. column (str): The column name to use for styling. palette (list | dict): The palette (e.g., list of colors or a dict containing label and color pairs) to use for styling. la...
Adds a styled vector to the map.
[ "Adds", "a", "styled", "vector", "to", "the", "map", "." ]
def add_styled_vector( self, ee_object, column, palette, layer_name="Untitled", **kwargs ): styled_vector = vector_styling(ee_object, column, palette, **kwargs) self.addLayer(styled_vector.style(**{"styleProperty": "style"}), {}, layer_name)
[ "def", "add_styled_vector", "(", "self", ",", "ee_object", ",", "column", ",", "palette", ",", "layer_name", "=", "\"Untitled\"", ",", "**", "kwargs", ")", ":", "styled_vector", "=", "vector_styling", "(", "ee_object", ",", "column", ",", "palette", ",", "**...
Adds a styled vector to the map.
[ "Adds", "a", "styled", "vector", "to", "the", "map", "." ]
[ "\"\"\"Adds a styled vector to the map.\r\n\r\n Args:\r\n ee_object (object): An ee.FeatureCollection.\r\n column (str): The column name to use for styling.\r\n palette (list | dict): The palette (e.g., list of colors or a dict containing label and color pairs) to use for sty...
[ { "param": "self", "type": null }, { "param": "ee_object", "type": null }, { "param": "column", "type": null }, { "param": "palette", "type": null }, { "param": "layer_name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "ee_object", "type": null, "docstring": null, "docstring_token...
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
add_shapefile
null
def add_shapefile( self, in_shp, layer_name="Untitled", style={}, hover_style={}, style_callback=None, fill_colors=["black"], info_mode="on_hover", ): """Adds a shapefile to the map. Args: in_shp (str): The inp...
Adds a shapefile to the map. Args: in_shp (str): The input file path to the shapefile. layer_name (str, optional): The layer name to be used.. Defaults to "Untitled". style (dict, optional): A dictionary specifying the style to be used. Defaults to {}. hove...
Adds a shapefile to the map.
[ "Adds", "a", "shapefile", "to", "the", "map", "." ]
def add_shapefile( self, in_shp, layer_name="Untitled", style={}, hover_style={}, style_callback=None, fill_colors=["black"], info_mode="on_hover", ): in_shp = os.path.abspath(in_shp) if not os.path.exists(in_shp): raise Fil...
[ "def", "add_shapefile", "(", "self", ",", "in_shp", ",", "layer_name", "=", "\"Untitled\"", ",", "style", "=", "{", "}", ",", "hover_style", "=", "{", "}", ",", "style_callback", "=", "None", ",", "fill_colors", "=", "[", "\"black\"", "]", ",", "info_mod...
Adds a shapefile to the map.
[ "Adds", "a", "shapefile", "to", "the", "map", "." ]
[ "\"\"\"Adds a shapefile to the map.\r\n\r\n Args:\r\n in_shp (str): The input file path to the shapefile.\r\n layer_name (str, optional): The layer name to be used.. Defaults to \"Untitled\".\r\n style (dict, optional): A dictionary specifying the style to be used. Defaults t...
[ { "param": "self", "type": null }, { "param": "in_shp", "type": null }, { "param": "layer_name", "type": null }, { "param": "style", "type": null }, { "param": "hover_style", "type": null }, { "param": "style_callback", "type": null }, { "p...
{ "returns": [], "raises": [ { "docstring": "The provided shapefile could not be found.", "docstring_tokens": [ "The", "provided", "shapefile", "could", "not", "be", "found", "." ], "type": "FileNotFoundError" } ], "...
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
add_geojson
<not_specific>
def add_geojson( self, in_geojson, layer_name="Untitled", style={}, hover_style={}, style_callback=None, fill_colors=["black"], info_mode="on_hover", ): """Adds a GeoJSON file to the map. Args: in_geojson (str ...
Adds a GeoJSON file to the map. Args: in_geojson (str | dict): The file path or http URL to the input GeoJSON or a dictionary containing the geojson. layer_name (str, optional): The layer name to be used.. Defaults to "Untitled". style (dict, optional): A dictionary spe...
Adds a GeoJSON file to the map.
[ "Adds", "a", "GeoJSON", "file", "to", "the", "map", "." ]
def add_geojson( self, in_geojson, layer_name="Untitled", style={}, hover_style={}, style_callback=None, fill_colors=["black"], info_mode="on_hover", ): import json import random import requests style_callback_only = Fal...
[ "def", "add_geojson", "(", "self", ",", "in_geojson", ",", "layer_name", "=", "\"Untitled\"", ",", "style", "=", "{", "}", ",", "hover_style", "=", "{", "}", ",", "style_callback", "=", "None", ",", "fill_colors", "=", "[", "\"black\"", "]", ",", "info_m...
Adds a GeoJSON file to the map.
[ "Adds", "a", "GeoJSON", "file", "to", "the", "map", "." ]
[ "\"\"\"Adds a GeoJSON file to the map.\r\n\r\n Args:\r\n in_geojson (str | dict): The file path or http URL to the input GeoJSON or a dictionary containing the geojson.\r\n layer_name (str, optional): The layer name to be used.. Defaults to \"Untitled\".\r\n style (dict, opti...
[ { "param": "self", "type": null }, { "param": "in_geojson", "type": null }, { "param": "layer_name", "type": null }, { "param": "style", "type": null }, { "param": "hover_style", "type": null }, { "param": "style_callback", "type": null }, { ...
{ "returns": [], "raises": [ { "docstring": "The provided GeoJSON file could not be found.", "docstring_tokens": [ "The", "provided", "GeoJSON", "file", "could", "not", "be", "found", "." ], "type": "FileNotFoundErro...
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
add_kml
null
def add_kml( self, in_kml, layer_name="Untitled", style={}, hover_style={}, style_callback=None, fill_colors=["black"], info_mode="on_hover", ): """Adds a GeoJSON file to the map. Args: in_kml (str): The input ...
Adds a GeoJSON file to the map. Args: in_kml (str): The input file path to the KML. layer_name (str, optional): The layer name to be used.. Defaults to "Untitled". style (dict, optional): A dictionary specifying the style to be used. Defaults to {}. hover_s...
Adds a GeoJSON file to the map.
[ "Adds", "a", "GeoJSON", "file", "to", "the", "map", "." ]
def add_kml( self, in_kml, layer_name="Untitled", style={}, hover_style={}, style_callback=None, fill_colors=["black"], info_mode="on_hover", ): in_kml = os.path.abspath(in_kml) if not os.path.exists(in_kml): raise FileNotFo...
[ "def", "add_kml", "(", "self", ",", "in_kml", ",", "layer_name", "=", "\"Untitled\"", ",", "style", "=", "{", "}", ",", "hover_style", "=", "{", "}", ",", "style_callback", "=", "None", ",", "fill_colors", "=", "[", "\"black\"", "]", ",", "info_mode", ...
Adds a GeoJSON file to the map.
[ "Adds", "a", "GeoJSON", "file", "to", "the", "map", "." ]
[ "\"\"\"Adds a GeoJSON file to the map.\r\n\r\n Args:\r\n in_kml (str): The input file path to the KML.\r\n layer_name (str, optional): The layer name to be used.. Defaults to \"Untitled\".\r\n style (dict, optional): A dictionary specifying the style to be used. Defaults to {...
[ { "param": "self", "type": null }, { "param": "in_kml", "type": null }, { "param": "layer_name", "type": null }, { "param": "style", "type": null }, { "param": "hover_style", "type": null }, { "param": "style_callback", "type": null }, { "p...
{ "returns": [], "raises": [ { "docstring": "The provided KML file could not be found.", "docstring_tokens": [ "The", "provided", "KML", "file", "could", "not", "be", "found", "." ], "type": "FileNotFoundError" }...
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
add_vector
null
def add_vector( self, filename, layer_name="Untitled", to_ee=False, bbox=None, mask=None, rows=None, style={}, hover_style={}, style_callback=None, fill_colors=["black"], info_mode="on_hover", **kwargs, ...
Adds any geopandas-supported vector dataset to the map. Args: filename (str): Either the absolute or relative path to the file or URL to be opened, or any object with a read() method (such as an open file or StringIO). layer_name (str, optional): The layer name to use. Defaults to "...
Adds any geopandas-supported vector dataset to the map.
[ "Adds", "any", "geopandas", "-", "supported", "vector", "dataset", "to", "the", "map", "." ]
def add_vector( self, filename, layer_name="Untitled", to_ee=False, bbox=None, mask=None, rows=None, style={}, hover_style={}, style_callback=None, fill_colors=["black"], info_mode="on_hover", **kwargs, ): ...
[ "def", "add_vector", "(", "self", ",", "filename", ",", "layer_name", "=", "\"Untitled\"", ",", "to_ee", "=", "False", ",", "bbox", "=", "None", ",", "mask", "=", "None", ",", "rows", "=", "None", ",", "style", "=", "{", "}", ",", "hover_style", "=",...
Adds any geopandas-supported vector dataset to the map.
[ "Adds", "any", "geopandas", "-", "supported", "vector", "dataset", "to", "the", "map", "." ]
[ "\"\"\"Adds any geopandas-supported vector dataset to the map.\r\n\r\n Args:\r\n filename (str): Either the absolute or relative path to the file or URL to be opened, or any object with a read() method (such as an open file or StringIO).\r\n layer_name (str, optional): The layer name to...
[ { "param": "self", "type": null }, { "param": "filename", "type": null }, { "param": "layer_name", "type": null }, { "param": "to_ee", "type": null }, { "param": "bbox", "type": null }, { "param": "mask", "type": null }, { "param": "rows", ...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "filename", "type": null, "docstring": "Either the absolute or relat...
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
add_osm
null
def add_osm( self, query, layer_name="Untitled", style={}, hover_style={}, style_callback=None, fill_colors=["black"], info_mode="on_hover", which_result=None, by_osmid=False, buffer_dist=None, to_ee=False, ...
Adds OSM data to the map. Args: query (str | dict | list): Query string(s) or structured dict(s) to geocode. layer_name (str, optional): The layer name to be used.. Defaults to "Untitled". style (dict, optional): A dictionary specifying the style to be used. Defaults to...
Adds OSM data to the map.
[ "Adds", "OSM", "data", "to", "the", "map", "." ]
def add_osm( self, query, layer_name="Untitled", style={}, hover_style={}, style_callback=None, fill_colors=["black"], info_mode="on_hover", which_result=None, by_osmid=False, buffer_dist=None, to_ee=False, geodesic=...
[ "def", "add_osm", "(", "self", ",", "query", ",", "layer_name", "=", "\"Untitled\"", ",", "style", "=", "{", "}", ",", "hover_style", "=", "{", "}", ",", "style_callback", "=", "None", ",", "fill_colors", "=", "[", "\"black\"", "]", ",", "info_mode", "...
Adds OSM data to the map.
[ "Adds", "OSM", "data", "to", "the", "map", "." ]
[ "\"\"\"Adds OSM data to the map.\r\n\r\n Args:\r\n query (str | dict | list): Query string(s) or structured dict(s) to geocode.\r\n layer_name (str, optional): The layer name to be used.. Defaults to \"Untitled\".\r\n style (dict, optional): A dictionary specifying the style ...
[ { "param": "self", "type": null }, { "param": "query", "type": null }, { "param": "layer_name", "type": null }, { "param": "style", "type": null }, { "param": "hover_style", "type": null }, { "param": "style_callback", "type": null }, { "pa...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "query", "type": null, "docstring": "Query string(s) or structured d...
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
add_osm_from_geocode
null
def add_osm_from_geocode( self, query, which_result=None, by_osmid=False, buffer_dist=None, layer_name="Untitled", style={}, hover_style={}, style_callback=None, fill_colors=["black"], info_mode="on_hover", ): ...
Adds OSM data of place(s) by name or ID to the map. Args: query (str | dict | list): Query string(s) or structured dict(s) to geocode. which_result (int, optional): Which geocoding result to use. if None, auto-select the first (Multi)Polygon or raise an error if OSM doesn't return o...
Adds OSM data of place(s) by name or ID to the map.
[ "Adds", "OSM", "data", "of", "place", "(", "s", ")", "by", "name", "or", "ID", "to", "the", "map", "." ]
def add_osm_from_geocode( self, query, which_result=None, by_osmid=False, buffer_dist=None, layer_name="Untitled", style={}, hover_style={}, style_callback=None, fill_colors=["black"], info_mode="on_hover", ): gdf = osm_...
[ "def", "add_osm_from_geocode", "(", "self", ",", "query", ",", "which_result", "=", "None", ",", "by_osmid", "=", "False", ",", "buffer_dist", "=", "None", ",", "layer_name", "=", "\"Untitled\"", ",", "style", "=", "{", "}", ",", "hover_style", "=", "{", ...
Adds OSM data of place(s) by name or ID to the map.
[ "Adds", "OSM", "data", "of", "place", "(", "s", ")", "by", "name", "or", "ID", "to", "the", "map", "." ]
[ "\"\"\"Adds OSM data of place(s) by name or ID to the map.\r\n\r\n Args:\r\n query (str | dict | list): Query string(s) or structured dict(s) to geocode.\r\n which_result (int, optional): Which geocoding result to use. if None, auto-select the first (Multi)Polygon or raise an error if O...
[ { "param": "self", "type": null }, { "param": "query", "type": null }, { "param": "which_result", "type": null }, { "param": "by_osmid", "type": null }, { "param": "buffer_dist", "type": null }, { "param": "layer_name", "type": null }, { "p...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "query", "type": null, "docstring": "Query string(s) or structured d...
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
add_gdf
<not_specific>
def add_gdf( self, gdf, layer_name="Untitled", style={}, hover_style={}, style_callback=None, fill_colors=["black"], info_mode="on_hover", zoom_to_layer=True, ): """Adds a GeoDataFrame to the map. Args: ...
Adds a GeoDataFrame to the map. Args: gdf (GeoDataFrame): A GeoPandas GeoDataFrame. layer_name (str, optional): The layer name to be used.. Defaults to "Untitled". style (dict, optional): A dictionary specifying the style to be used. Defaults to {}. hover_s...
Adds a GeoDataFrame to the map.
[ "Adds", "a", "GeoDataFrame", "to", "the", "map", "." ]
def add_gdf( self, gdf, layer_name="Untitled", style={}, hover_style={}, style_callback=None, fill_colors=["black"], info_mode="on_hover", zoom_to_layer=True, ): import random data = gdf_to_geojson(gdf, epsg="4326") if n...
[ "def", "add_gdf", "(", "self", ",", "gdf", ",", "layer_name", "=", "\"Untitled\"", ",", "style", "=", "{", "}", ",", "hover_style", "=", "{", "}", ",", "style_callback", "=", "None", ",", "fill_colors", "=", "[", "\"black\"", "]", ",", "info_mode", "="...
Adds a GeoDataFrame to the map.
[ "Adds", "a", "GeoDataFrame", "to", "the", "map", "." ]
[ "\"\"\"Adds a GeoDataFrame to the map.\r\n\r\n Args:\r\n gdf (GeoDataFrame): A GeoPandas GeoDataFrame.\r\n layer_name (str, optional): The layer name to be used.. Defaults to \"Untitled\".\r\n style (dict, optional): A dictionary specifying the style to be used. Defaults to {...
[ { "param": "self", "type": null }, { "param": "gdf", "type": null }, { "param": "layer_name", "type": null }, { "param": "style", "type": null }, { "param": "hover_style", "type": null }, { "param": "style_callback", "type": null }, { "para...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "gdf", "type": null, "docstring": "A GeoPandas GeoDataFrame.", ...
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
add_gdf_from_postgis
null
def add_gdf_from_postgis( self, sql, con, layer_name="Untitled", style={}, hover_style={}, style_callback=None, fill_colors=["black"], info_mode="on_hover", zoom_to_layer=True, **kwargs, ): """Reads a PostGI...
Reads a PostGIS database and returns data as a GeoDataFrame to be added to the map. Args: sql (str): SQL query to execute in selecting entries from database, or name of the table to read from the database. con (sqlalchemy.engine.Engine): Active connection to the database to query. ...
Reads a PostGIS database and returns data as a GeoDataFrame to be added to the map.
[ "Reads", "a", "PostGIS", "database", "and", "returns", "data", "as", "a", "GeoDataFrame", "to", "be", "added", "to", "the", "map", "." ]
def add_gdf_from_postgis( self, sql, con, layer_name="Untitled", style={}, hover_style={}, style_callback=None, fill_colors=["black"], info_mode="on_hover", zoom_to_layer=True, **kwargs, ): gdf = read_postgis(sql, con, *...
[ "def", "add_gdf_from_postgis", "(", "self", ",", "sql", ",", "con", ",", "layer_name", "=", "\"Untitled\"", ",", "style", "=", "{", "}", ",", "hover_style", "=", "{", "}", ",", "style_callback", "=", "None", ",", "fill_colors", "=", "[", "\"black\"", "]"...
Reads a PostGIS database and returns data as a GeoDataFrame to be added to the map.
[ "Reads", "a", "PostGIS", "database", "and", "returns", "data", "as", "a", "GeoDataFrame", "to", "be", "added", "to", "the", "map", "." ]
[ "\"\"\"Reads a PostGIS database and returns data as a GeoDataFrame to be added to the map.\r\n\r\n Args:\r\n sql (str): SQL query to execute in selecting entries from database, or name of the table to read from the database.\r\n con (sqlalchemy.engine.Engine): Active connection to the d...
[ { "param": "self", "type": null }, { "param": "sql", "type": null }, { "param": "con", "type": null }, { "param": "layer_name", "type": null }, { "param": "style", "type": null }, { "param": "hover_style", "type": null }, { "param": "style_...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "sql", "type": null, "docstring": "SQL query to execute in selecting...
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
add_time_slider
null
def add_time_slider( self, ee_object, vis_params={}, region=None, layer_name="Time series", labels=None, time_interval=1, position="bottomright", slider_length="150px", date_format="YYYY-MM-dd", opacity=1.0, **kw...
Adds a time slider to the map. Args: ee_object (ee.Image | ee.ImageCollection): The Image or ImageCollection to visualize. vis_params (dict, optional): Visualization parameters to use for visualizing image. Defaults to {}. region (ee.Geometry | ee.FeatureCollection): Th...
Adds a time slider to the map.
[ "Adds", "a", "time", "slider", "to", "the", "map", "." ]
def add_time_slider( self, ee_object, vis_params={}, region=None, layer_name="Time series", labels=None, time_interval=1, position="bottomright", slider_length="150px", date_format="YYYY-MM-dd", opacity=1.0, **kwargs, ):...
[ "def", "add_time_slider", "(", "self", ",", "ee_object", ",", "vis_params", "=", "{", "}", ",", "region", "=", "None", ",", "layer_name", "=", "\"Time series\"", ",", "labels", "=", "None", ",", "time_interval", "=", "1", ",", "position", "=", "\"bottomrig...
Adds a time slider to the map.
[ "Adds", "a", "time", "slider", "to", "the", "map", "." ]
[ "\"\"\"Adds a time slider to the map.\r\n\r\n Args:\r\n ee_object (ee.Image | ee.ImageCollection): The Image or ImageCollection to visualize.\r\n vis_params (dict, optional): Visualization parameters to use for visualizing image. Defaults to {}.\r\n region (ee.Geometry | ee.F...
[ { "param": "self", "type": null }, { "param": "ee_object", "type": null }, { "param": "vis_params", "type": null }, { "param": "region", "type": null }, { "param": "layer_name", "type": null }, { "param": "labels", "type": null }, { "param"...
{ "returns": [], "raises": [ { "docstring": "If the ee_object is not ee.Image | ee.ImageCollection.", "docstring_tokens": [ "If", "the", "ee_object", "is", "not", "ee", ".", "Image", "|", "ee", ".", "Imag...
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
add_xy_data
null
def add_xy_data( self, in_csv, x="longitude", y="latitude", label=None, layer_name="Marker cluster", to_ee=False, ): """Adds points from a CSV file containing lat/lon information and display data on the map. Args: in_cs...
Adds points from a CSV file containing lat/lon information and display data on the map. Args: in_csv (str): The file path to the input CSV file. x (str, optional): The name of the column containing longitude coordinates. Defaults to "longitude". y (str, optional): The n...
Adds points from a CSV file containing lat/lon information and display data on the map.
[ "Adds", "points", "from", "a", "CSV", "file", "containing", "lat", "/", "lon", "information", "and", "display", "data", "on", "the", "map", "." ]
def add_xy_data( self, in_csv, x="longitude", y="latitude", label=None, layer_name="Marker cluster", to_ee=False, ): import pandas as pd if not in_csv.startswith("http") and (not os.path.exists(in_csv)): raise FileNotFoundError("The...
[ "def", "add_xy_data", "(", "self", ",", "in_csv", ",", "x", "=", "\"longitude\"", ",", "y", "=", "\"latitude\"", ",", "label", "=", "None", ",", "layer_name", "=", "\"Marker cluster\"", ",", "to_ee", "=", "False", ",", ")", ":", "import", "pandas", "as",...
Adds points from a CSV file containing lat/lon information and display data on the map.
[ "Adds", "points", "from", "a", "CSV", "file", "containing", "lat", "/", "lon", "information", "and", "display", "data", "on", "the", "map", "." ]
[ "\"\"\"Adds points from a CSV file containing lat/lon information and display data on the map.\r\n\r\n Args:\r\n in_csv (str): The file path to the input CSV file.\r\n x (str, optional): The name of the column containing longitude coordinates. Defaults to \"longitude\".\r\n y...
[ { "param": "self", "type": null }, { "param": "in_csv", "type": null }, { "param": "x", "type": null }, { "param": "y", "type": null }, { "param": "label", "type": null }, { "param": "layer_name", "type": null }, { "param": "to_ee", "ty...
{ "returns": [], "raises": [ { "docstring": "The specified input csv does not exist.", "docstring_tokens": [ "The", "specified", "input", "csv", "does", "not", "exist", "." ], "type": "FileNotFoundError" }, { "...
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
add_points_from_xy
null
def add_points_from_xy( self, data, x="longitude", y="latitude", popup=None, layer_name="Marker Cluster", **kwargs, ): """Adds a marker cluster to the map. Args: data (str | pd.DataFrame): A csv or Pandas DataFrame cont...
Adds a marker cluster to the map. Args: data (str | pd.DataFrame): A csv or Pandas DataFrame containing x, y, z values. x (str, optional): The column name for the x values. Defaults to "longitude". y (str, optional): The column name for the y values. Defaults to "latitu...
Adds a marker cluster to the map.
[ "Adds", "a", "marker", "cluster", "to", "the", "map", "." ]
def add_points_from_xy( self, data, x="longitude", y="latitude", popup=None, layer_name="Marker Cluster", **kwargs, ): import pandas as pd if isinstance(data, pd.DataFrame): df = data elif not data.startswith("http") and (no...
[ "def", "add_points_from_xy", "(", "self", ",", "data", ",", "x", "=", "\"longitude\"", ",", "y", "=", "\"latitude\"", ",", "popup", "=", "None", ",", "layer_name", "=", "\"Marker Cluster\"", ",", "**", "kwargs", ",", ")", ":", "import", "pandas", "as", "...
Adds a marker cluster to the map.
[ "Adds", "a", "marker", "cluster", "to", "the", "map", "." ]
[ "\"\"\"Adds a marker cluster to the map.\r\n\r\n Args:\r\n data (str | pd.DataFrame): A csv or Pandas DataFrame containing x, y, z values.\r\n x (str, optional): The column name for the x values. Defaults to \"longitude\".\r\n y (str, optional): The column name for the y valu...
[ { "param": "self", "type": null }, { "param": "data", "type": null }, { "param": "x", "type": null }, { "param": "y", "type": null }, { "param": "popup", "type": null }, { "param": "layer_name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "data", "type": null, "docstring": "A csv or Pandas DataFrame contai...
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
add_circle_markers_from_xy
null
def add_circle_markers_from_xy( self, data, x="longitude", y="latitude", radius=10, popup=None, **kwargs, ): """Adds a marker cluster to the map. For a list of options, see https://ipyleaflet.readthedocs.io/en/latest/api_reference/circle_marke...
Adds a marker cluster to the map. For a list of options, see https://ipyleaflet.readthedocs.io/en/latest/api_reference/circle_marker.html Args: data (str | pd.DataFrame): A csv or Pandas DataFrame containing x, y, z values. x (str, optional): The column name for the x values. Defaul...
Adds a marker cluster to the map.
[ "Adds", "a", "marker", "cluster", "to", "the", "map", "." ]
def add_circle_markers_from_xy( self, data, x="longitude", y="latitude", radius=10, popup=None, **kwargs, ): import pandas as pd if isinstance(data, pd.DataFrame): df = data elif not data.startswith("http") and (not os.path....
[ "def", "add_circle_markers_from_xy", "(", "self", ",", "data", ",", "x", "=", "\"longitude\"", ",", "y", "=", "\"latitude\"", ",", "radius", "=", "10", ",", "popup", "=", "None", ",", "**", "kwargs", ",", ")", ":", "import", "pandas", "as", "pd", "if",...
Adds a marker cluster to the map.
[ "Adds", "a", "marker", "cluster", "to", "the", "map", "." ]
[ "\"\"\"Adds a marker cluster to the map. For a list of options, see https://ipyleaflet.readthedocs.io/en/latest/api_reference/circle_marker.html\r\n\r\n Args:\r\n data (str | pd.DataFrame): A csv or Pandas DataFrame containing x, y, z values.\r\n x (str, optional): The column name for t...
[ { "param": "self", "type": null }, { "param": "data", "type": null }, { "param": "x", "type": null }, { "param": "y", "type": null }, { "param": "radius", "type": null }, { "param": "popup", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "data", "type": null, "docstring": "A csv or Pandas DataFrame contai...
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
add_planet_by_month
null
def add_planet_by_month( self, year=2016, month=1, name=None, api_key=None, token_name="PLANET_API_KEY" ): """Adds a Planet global mosaic by month to the map. To get a Planet API key, see https://developers.planet.com/quickstart/apis Args: year (int, optional): The year of...
Adds a Planet global mosaic by month to the map. To get a Planet API key, see https://developers.planet.com/quickstart/apis Args: year (int, optional): The year of Planet global mosaic, must be >=2016. Defaults to 2016. month (int, optional): The month of Planet global mosaic, must ...
Adds a Planet global mosaic by month to the map.
[ "Adds", "a", "Planet", "global", "mosaic", "by", "month", "to", "the", "map", "." ]
def add_planet_by_month( self, year=2016, month=1, name=None, api_key=None, token_name="PLANET_API_KEY" ): layer = planet_tile_by_month(year, month, name, api_key, token_name) self.add_layer(layer)
[ "def", "add_planet_by_month", "(", "self", ",", "year", "=", "2016", ",", "month", "=", "1", ",", "name", "=", "None", ",", "api_key", "=", "None", ",", "token_name", "=", "\"PLANET_API_KEY\"", ")", ":", "layer", "=", "planet_tile_by_month", "(", "year", ...
Adds a Planet global mosaic by month to the map.
[ "Adds", "a", "Planet", "global", "mosaic", "by", "month", "to", "the", "map", "." ]
[ "\"\"\"Adds a Planet global mosaic by month to the map. To get a Planet API key, see https://developers.planet.com/quickstart/apis\r\n\r\n Args:\r\n year (int, optional): The year of Planet global mosaic, must be >=2016. Defaults to 2016.\r\n month (int, optional): The month of Planet g...
[ { "param": "self", "type": null }, { "param": "year", "type": null }, { "param": "month", "type": null }, { "param": "name", "type": null }, { "param": "api_key", "type": null }, { "param": "token_name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "year", "type": null, "docstring": "The year of Planet global mosaic...
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
add_planet_by_quarter
null
def add_planet_by_quarter( self, year=2016, quarter=1, name=None, api_key=None, token_name="PLANET_API_KEY" ): """Adds a Planet global mosaic by quarter to the map. To get a Planet API key, see https://developers.planet.com/quickstart/apis Args: year (int, optional): The y...
Adds a Planet global mosaic by quarter to the map. To get a Planet API key, see https://developers.planet.com/quickstart/apis Args: year (int, optional): The year of Planet global mosaic, must be >=2016. Defaults to 2016. quarter (int, optional): The quarter of Planet global mosaic,...
Adds a Planet global mosaic by quarter to the map.
[ "Adds", "a", "Planet", "global", "mosaic", "by", "quarter", "to", "the", "map", "." ]
def add_planet_by_quarter( self, year=2016, quarter=1, name=None, api_key=None, token_name="PLANET_API_KEY" ): layer = planet_tile_by_quarter(year, quarter, name, api_key, token_name) self.add_layer(layer)
[ "def", "add_planet_by_quarter", "(", "self", ",", "year", "=", "2016", ",", "quarter", "=", "1", ",", "name", "=", "None", ",", "api_key", "=", "None", ",", "token_name", "=", "\"PLANET_API_KEY\"", ")", ":", "layer", "=", "planet_tile_by_quarter", "(", "ye...
Adds a Planet global mosaic by quarter to the map.
[ "Adds", "a", "Planet", "global", "mosaic", "by", "quarter", "to", "the", "map", "." ]
[ "\"\"\"Adds a Planet global mosaic by quarter to the map. To get a Planet API key, see https://developers.planet.com/quickstart/apis\r\n\r\n Args:\r\n year (int, optional): The year of Planet global mosaic, must be >=2016. Defaults to 2016.\r\n quarter (int, optional): The quarter of Pl...
[ { "param": "self", "type": null }, { "param": "year", "type": null }, { "param": "quarter", "type": null }, { "param": "name", "type": null }, { "param": "api_key", "type": null }, { "param": "token_name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "year", "type": null, "docstring": "The year of Planet global mosaic...
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
to_streamlit
<not_specific>
def to_streamlit( self, width=700, height=500, responsive=True, scrolling=False, **kwargs ): """Renders map figure in a Streamlit app. Args: width (int, optional): Width of the map. Defaults to 700. height (int, optional): Height of the map. Defaults to 500. ...
Renders map figure in a Streamlit app. Args: width (int, optional): Width of the map. Defaults to 700. height (int, optional): Height of the map. Defaults to 500. responsive (bool, optional): Whether to make the map responsive. Defaults to True. scrolling (...
Renders map figure in a Streamlit app.
[ "Renders", "map", "figure", "in", "a", "Streamlit", "app", "." ]
def to_streamlit( self, width=700, height=500, responsive=True, scrolling=False, **kwargs ): try: import streamlit as st import streamlit.components.v1 as components if responsive: make_map_responsive = """ <style> [...
[ "def", "to_streamlit", "(", "self", ",", "width", "=", "700", ",", "height", "=", "500", ",", "responsive", "=", "True", ",", "scrolling", "=", "False", ",", "**", "kwargs", ")", ":", "try", ":", "import", "streamlit", "as", "st", "import", "streamlit"...
Renders map figure in a Streamlit app.
[ "Renders", "map", "figure", "in", "a", "Streamlit", "app", "." ]
[ "\"\"\"Renders map figure in a Streamlit app.\r\n\r\n Args:\r\n width (int, optional): Width of the map. Defaults to 700.\r\n height (int, optional): Height of the map. Defaults to 500.\r\n responsive (bool, optional): Whether to make the map responsive. Defaults to True.\r\n...
[ { "param": "self", "type": null }, { "param": "width", "type": null }, { "param": "height", "type": null }, { "param": "responsive", "type": null }, { "param": "scrolling", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": "streamlit.components" } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_...
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
add_point_layer
null
def add_point_layer( self, filename, popup=None, layer_name="Marker Cluster", **kwargs ): """Adds a point layer to the map with a popup attribute. Args: filename (str): str, http url, path object or file-like object. Either the absolute or relative path to the file or URL ...
Adds a point layer to the map with a popup attribute. Args: filename (str): str, http url, path object or file-like object. Either the absolute or relative path to the file or URL to be opened, or any object with a read() method (such as an open file or StringIO) popup (str | list, ...
Adds a point layer to the map with a popup attribute.
[ "Adds", "a", "point", "layer", "to", "the", "map", "with", "a", "popup", "attribute", "." ]
def add_point_layer( self, filename, popup=None, layer_name="Marker Cluster", **kwargs ): import warnings warnings.filterwarnings("ignore") check_package(name="geopandas", URL="https://geopandas.org") import geopandas as gpd self.default_style = {"cursor": "wait"} ...
[ "def", "add_point_layer", "(", "self", ",", "filename", ",", "popup", "=", "None", ",", "layer_name", "=", "\"Marker Cluster\"", ",", "**", "kwargs", ")", ":", "import", "warnings", "warnings", ".", "filterwarnings", "(", "\"ignore\"", ")", "check_package", "(...
Adds a point layer to the map with a popup attribute.
[ "Adds", "a", "point", "layer", "to", "the", "map", "with", "a", "popup", "attribute", "." ]
[ "\"\"\"Adds a point layer to the map with a popup attribute.\r\n\r\n Args:\r\n filename (str): str, http url, path object or file-like object. Either the absolute or relative path to the file or URL to be opened, or any object with a read() method (such as an open file or StringIO)\r\n ...
[ { "param": "self", "type": null }, { "param": "filename", "type": null }, { "param": "popup", "type": null }, { "param": "layer_name", "type": null } ]
{ "returns": [], "raises": [ { "docstring": "If the specified column name does not exist.", "docstring_tokens": [ "If", "the", "specified", "column", "name", "does", "not", "exist", "." ], "type": "ValueError" },...
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
add_census_data
null
def add_census_data(self, wms, layer, census_dict=None, **kwargs): """Adds a census data layer to the map. Args: wms (str): The wms to use. For example, "Current", "ACS 2021", "Census 2020". See the complete list at https://tigerweb.geo.census.gov/tigerwebmain/TIGERweb_wms.html ...
Adds a census data layer to the map. Args: wms (str): The wms to use. For example, "Current", "ACS 2021", "Census 2020". See the complete list at https://tigerweb.geo.census.gov/tigerwebmain/TIGERweb_wms.html layer (str): The layer name to add to the map. census_dict (...
Adds a census data layer to the map.
[ "Adds", "a", "census", "data", "layer", "to", "the", "map", "." ]
def add_census_data(self, wms, layer, census_dict=None, **kwargs): try: if census_dict is None: census_dict = get_census_dict() if wms not in census_dict.keys(): raise ValueError( f"The provided WMS is invalid. It must be one of {census...
[ "def", "add_census_data", "(", "self", ",", "wms", ",", "layer", ",", "census_dict", "=", "None", ",", "**", "kwargs", ")", ":", "try", ":", "if", "census_dict", "is", "None", ":", "census_dict", "=", "get_census_dict", "(", ")", "if", "wms", "not", "i...
Adds a census data layer to the map.
[ "Adds", "a", "census", "data", "layer", "to", "the", "map", "." ]
[ "\"\"\"Adds a census data layer to the map.\r\n\r\n Args:\r\n wms (str): The wms to use. For example, \"Current\", \"ACS 2021\", \"Census 2020\". See the complete list at https://tigerweb.geo.census.gov/tigerwebmain/TIGERweb_wms.html\r\n layer (str): The layer name to add to the map.\r...
[ { "param": "self", "type": null }, { "param": "wms", "type": null }, { "param": "layer", "type": null }, { "param": "census_dict", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "wms", "type": null, "docstring": "The wms to use.", "docstrin...
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
add_xyz_service
null
def add_xyz_service(self, provider, **kwargs): """Add a XYZ tile layer to the map. Args: provider (str): A tile layer name starts with xyz or qms. For example, xyz.OpenTopoMap, Raises: ValueError: The provider is not valid. It must start with xyz or qms. ...
Add a XYZ tile layer to the map. Args: provider (str): A tile layer name starts with xyz or qms. For example, xyz.OpenTopoMap, Raises: ValueError: The provider is not valid. It must start with xyz or qms.
Add a XYZ tile layer to the map.
[ "Add", "a", "XYZ", "tile", "layer", "to", "the", "map", "." ]
def add_xyz_service(self, provider, **kwargs): import xyzservices.providers as xyz from xyzservices import TileProvider if provider.startswith("xyz"): name = provider[4:] xyz_provider = xyz.flatten()[name] url = xyz_provider.build_url() attribution...
[ "def", "add_xyz_service", "(", "self", ",", "provider", ",", "**", "kwargs", ")", ":", "import", "xyzservices", ".", "providers", "as", "xyz", "from", "xyzservices", "import", "TileProvider", "if", "provider", ".", "startswith", "(", "\"xyz\"", ")", ":", "na...
Add a XYZ tile layer to the map.
[ "Add", "a", "XYZ", "tile", "layer", "to", "the", "map", "." ]
[ "\"\"\"Add a XYZ tile layer to the map.\r\n\r\n Args:\r\n provider (str): A tile layer name starts with xyz or qms. For example, xyz.OpenTopoMap,\r\n\r\n Raises:\r\n ValueError: The provider is not valid. It must start with xyz or qms.\r\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "provider", "type": null } ]
{ "returns": [], "raises": [ { "docstring": "The provider is not valid. It must start with xyz or qms.", "docstring_tokens": [ "The", "provider", "is", "not", "valid", ".", "It", "must", "start", "with", "xyz", ...
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
add_labels
<not_specific>
def add_labels( self, data, column, font_size="12pt", font_color="black", font_family="arial", font_weight="normal", x="longitude", y="latitude", draggable=True, layer_name="Labels", **kwargs, ): ""...
Adds a label layer to the map. Reference: https://ipyleaflet.readthedocs.io/en/latest/api_reference/divicon.html Args: data (pd.DataFrame | ee.FeatureCollection): The input data to label. column (str): The column name of the data to label. font_size (str, optional): The...
Adds a label layer to the map.
[ "Adds", "a", "label", "layer", "to", "the", "map", "." ]
def add_labels( self, data, column, font_size="12pt", font_color="black", font_family="arial", font_weight="normal", x="longitude", y="latitude", draggable=True, layer_name="Labels", **kwargs, ): import warnings ...
[ "def", "add_labels", "(", "self", ",", "data", ",", "column", ",", "font_size", "=", "\"12pt\"", ",", "font_color", "=", "\"black\"", ",", "font_family", "=", "\"arial\"", ",", "font_weight", "=", "\"normal\"", ",", "x", "=", "\"longitude\"", ",", "y", "="...
Adds a label layer to the map.
[ "Adds", "a", "label", "layer", "to", "the", "map", "." ]
[ "\"\"\"Adds a label layer to the map. Reference: https://ipyleaflet.readthedocs.io/en/latest/api_reference/divicon.html\r\n\r\n Args:\r\n data (pd.DataFrame | ee.FeatureCollection): The input data to label.\r\n column (str): The column name of the data to label.\r\n font_size...
[ { "param": "self", "type": null }, { "param": "data", "type": null }, { "param": "column", "type": null }, { "param": "font_size", "type": null }, { "param": "font_color", "type": null }, { "param": "font_family", "type": null }, { "param":...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "data", "type": null, "docstring": "The input data to label.", ...
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
remove_labels
null
def remove_labels(self): """Removes all labels from the map.""" if hasattr(self, "labels"): self.remove_layer(self.labels) delattr(self, "labels")
Removes all labels from the map.
Removes all labels from the map.
[ "Removes", "all", "labels", "from", "the", "map", "." ]
def remove_labels(self): if hasattr(self, "labels"): self.remove_layer(self.labels) delattr(self, "labels")
[ "def", "remove_labels", "(", "self", ")", ":", "if", "hasattr", "(", "self", ",", "\"labels\"", ")", ":", "self", ".", "remove_layer", "(", "self", ".", "labels", ")", "delattr", "(", "self", ",", "\"labels\"", ")" ]
Removes all labels from the map.
[ "Removes", "all", "labels", "from", "the", "map", "." ]
[ "\"\"\"Removes all labels from the map.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
ee_tile_layer
<not_specific>
def ee_tile_layer( ee_object, vis_params={}, name="Layer untitled", shown=True, opacity=1.0 ): """Converts and Earth Engine layer to ipyleaflet TileLayer. Args: ee_object (Collection|Feature|Image|MapId): The object to add to the map. vis_params (dict, optional): The visualization pa...
Converts and Earth Engine layer to ipyleaflet TileLayer. Args: ee_object (Collection|Feature|Image|MapId): The object to add to the map. vis_params (dict, optional): The visualization parameters. Defaults to {}. name (str, optional): The name of the layer. Defaults to 'Layer untitled'....
Converts and Earth Engine layer to ipyleaflet TileLayer.
[ "Converts", "and", "Earth", "Engine", "layer", "to", "ipyleaflet", "TileLayer", "." ]
def ee_tile_layer( ee_object, vis_params={}, name="Layer untitled", shown=True, opacity=1.0 ): image = None if ( not isinstance(ee_object, ee.Image) and not isinstance(ee_object, ee.ImageCollection) and not isinstance(ee_object, ee.FeatureCollection) and not isinstance(ee_obj...
[ "def", "ee_tile_layer", "(", "ee_object", ",", "vis_params", "=", "{", "}", ",", "name", "=", "\"Layer untitled\"", ",", "shown", "=", "True", ",", "opacity", "=", "1.0", ")", ":", "image", "=", "None", "if", "(", "not", "isinstance", "(", "ee_object", ...
Converts and Earth Engine layer to ipyleaflet TileLayer.
[ "Converts", "and", "Earth", "Engine", "layer", "to", "ipyleaflet", "TileLayer", "." ]
[ "\"\"\"Converts and Earth Engine layer to ipyleaflet TileLayer.\r\n\r\n Args:\r\n ee_object (Collection|Feature|Image|MapId): The object to add to the map.\r\n vis_params (dict, optional): The visualization parameters. Defaults to {}.\r\n name (str, optional): The name of the layer. Defaults...
[ { "param": "ee_object", "type": null }, { "param": "vis_params", "type": null }, { "param": "name", "type": null }, { "param": "shown", "type": null }, { "param": "opacity", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "ee_object", "type": null, "docstring": "The object to add to the map.", "docstring_tokens": [ "The", "object", "to", "add", "to", "the", "map", "." ], ...
56aa720715ab102858e4cbb04cbd753f11c089af
hanzlan/geemap
geemap/geemap.py
[ "MIT" ]
Python
linked_maps
<not_specific>
def linked_maps( rows=2, cols=2, height="400px", ee_objects=[], vis_params=[], labels=[], label_position="topright", **kwargs, ): """Create linked maps of Earth Engine data layers. Args: rows (int, optional): The number of rows of maps to create. Defaults to...
Create linked maps of Earth Engine data layers. Args: rows (int, optional): The number of rows of maps to create. Defaults to 2. cols (int, optional): The number of columns of maps to create. Defaults to 2. height (str, optional): The height of each map in pixels. Defaults to "400px". ...
Create linked maps of Earth Engine data layers.
[ "Create", "linked", "maps", "of", "Earth", "Engine", "data", "layers", "." ]
def linked_maps( rows=2, cols=2, height="400px", ee_objects=[], vis_params=[], labels=[], label_position="topright", **kwargs, ): grid = widgets.GridspecLayout(rows, cols, grid_gap="0px") count = rows * cols maps = [] if len(ee_objects) > 0: if len(ee_objects) == ...
[ "def", "linked_maps", "(", "rows", "=", "2", ",", "cols", "=", "2", ",", "height", "=", "\"400px\"", ",", "ee_objects", "=", "[", "]", ",", "vis_params", "=", "[", "]", ",", "labels", "=", "[", "]", ",", "label_position", "=", "\"topright\"", ",", ...
Create linked maps of Earth Engine data layers.
[ "Create", "linked", "maps", "of", "Earth", "Engine", "data", "layers", "." ]
[ "\"\"\"Create linked maps of Earth Engine data layers.\r\n\r\n Args:\r\n rows (int, optional): The number of rows of maps to create. Defaults to 2.\r\n cols (int, optional): The number of columns of maps to create. Defaults to 2.\r\n height (str, optional): The height of each map in pixels. ...
[ { "param": "rows", "type": null }, { "param": "cols", "type": null }, { "param": "height", "type": null }, { "param": "ee_objects", "type": null }, { "param": "vis_params", "type": null }, { "param": "labels", "type": null }, { "param": "la...
{ "returns": [ { "docstring": "A GridspecLayout widget.", "docstring_tokens": [ "A", "GridspecLayout", "widget", "." ], "type": "ipywidget" } ], "raises": [ { "docstring": "If the length of ee_objects is not equal to rows*cols.", "doc...
b1395166dfe1fa569cb5bbf76b7fab2c5ccee4e5
hanzlan/geemap
geemap/toolbar.py
[ "MIT" ]
Python
convert_js2py
null
def convert_js2py(m): """A widget for converting Earth Engine JavaScript to Python. Args: m (object): geemap.Map """ full_widget = widgets.VBox(layout=widgets.Layout(width="465px", height="350px")) text_widget = widgets.Textarea( placeholder="Paste your Earth Engine JavaScript int...
A widget for converting Earth Engine JavaScript to Python. Args: m (object): geemap.Map
A widget for converting Earth Engine JavaScript to Python.
[ "A", "widget", "for", "converting", "Earth", "Engine", "JavaScript", "to", "Python", "." ]
def convert_js2py(m): full_widget = widgets.VBox(layout=widgets.Layout(width="465px", height="350px")) text_widget = widgets.Textarea( placeholder="Paste your Earth Engine JavaScript into this textbox and click the Convert button below to convert the Javascript to Python", layout=widgets.Layout(...
[ "def", "convert_js2py", "(", "m", ")", ":", "full_widget", "=", "widgets", ".", "VBox", "(", "layout", "=", "widgets", ".", "Layout", "(", "width", "=", "\"465px\"", ",", "height", "=", "\"350px\"", ")", ")", "text_widget", "=", "widgets", ".", "Textarea...
A widget for converting Earth Engine JavaScript to Python.
[ "A", "widget", "for", "converting", "Earth", "Engine", "JavaScript", "to", "Python", "." ]
[ "\"\"\"A widget for converting Earth Engine JavaScript to Python.\n\n Args:\n m (object): geemap.Map\n \"\"\"" ]
[ { "param": "m", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "m", "type": null, "docstring": null, "docstring_tokens": [ "None" ], "default": null, "is_optional": false } ], "outlier_params": [], "others": [] }
b1395166dfe1fa569cb5bbf76b7fab2c5ccee4e5
hanzlan/geemap
geemap/toolbar.py
[ "MIT" ]
Python
tool_gui
<not_specific>
def tool_gui(tool_dict, max_width="420px", max_height="600px"): """Create a GUI for a tool based on the tool dictionary. Args: tool_dict (dict): The dictionary containing the tool info. max_width (str, optional): The max width of the tool dialog. max_height (str, optional): The max heig...
Create a GUI for a tool based on the tool dictionary. Args: tool_dict (dict): The dictionary containing the tool info. max_width (str, optional): The max width of the tool dialog. max_height (str, optional): The max height of the tool dialog. Returns: object: An ipywidget objec...
Create a GUI for a tool based on the tool dictionary.
[ "Create", "a", "GUI", "for", "a", "tool", "based", "on", "the", "tool", "dictionary", "." ]
def tool_gui(tool_dict, max_width="420px", max_height="600px"): tool_widget = widgets.VBox( layout=widgets.Layout(max_width=max_width, max_height=max_height) ) children = [] args = {} required_inputs = [] style = {"description_width": "initial"} max_width = str(int(max_width.replace(...
[ "def", "tool_gui", "(", "tool_dict", ",", "max_width", "=", "\"420px\"", ",", "max_height", "=", "\"600px\"", ")", ":", "tool_widget", "=", "widgets", ".", "VBox", "(", "layout", "=", "widgets", ".", "Layout", "(", "max_width", "=", "max_width", ",", "max_...
Create a GUI for a tool based on the tool dictionary.
[ "Create", "a", "GUI", "for", "a", "tool", "based", "on", "the", "tool", "dictionary", "." ]
[ "\"\"\"Create a GUI for a tool based on the tool dictionary.\n\n Args:\n tool_dict (dict): The dictionary containing the tool info.\n max_width (str, optional): The max width of the tool dialog.\n max_height (str, optional): The max height of the tool dialog.\n\n Returns:\n object:...
[ { "param": "tool_dict", "type": null }, { "param": "max_width", "type": null }, { "param": "max_height", "type": null } ]
{ "returns": [ { "docstring": "An ipywidget object representing the tool interface.", "docstring_tokens": [ "An", "ipywidget", "object", "representing", "the", "tool", "interface", "." ], "type": "object" } ], "raises"...
1675d39e0ebec4a3e65c3bb14c2927822a6214f8
hanzlan/geemap
geemap/plotlymap.py
[ "MIT" ]
Python
add_ee_layer
null
def add_ee_layer( self, ee_object, vis_params={}, name=None, shown=True, opacity=1.0, **kwargs ): """Adds a given EE object to the map as a layer. Args: ee_object (Collection|Feature|Image|MapId): The object to add to the map. vis_params (dict, optional): The visuali...
Adds a given EE object to the map as a layer. Args: ee_object (Collection|Feature|Image|MapId): The object to add to the map. vis_params (dict, optional): The visualization parameters. Defaults to {}. name (str, optional): The name of the layer. Defaults to 'Layer N'. ...
Adds a given EE object to the map as a layer.
[ "Adds", "a", "given", "EE", "object", "to", "the", "map", "as", "a", "layer", "." ]
def add_ee_layer( self, ee_object, vis_params={}, name=None, shown=True, opacity=1.0, **kwargs ): from box import Box image = None if vis_params is None: vis_params = {} if name is None: layer_count = len(self.layout.mapbox.layers) name = "...
[ "def", "add_ee_layer", "(", "self", ",", "ee_object", ",", "vis_params", "=", "{", "}", ",", "name", "=", "None", ",", "shown", "=", "True", ",", "opacity", "=", "1.0", ",", "**", "kwargs", ")", ":", "from", "box", "import", "Box", "image", "=", "N...
Adds a given EE object to the map as a layer.
[ "Adds", "a", "given", "EE", "object", "to", "the", "map", "as", "a", "layer", "." ]
[ "\"\"\"Adds a given EE object to the map as a layer.\n\n Args:\n ee_object (Collection|Feature|Image|MapId): The object to add to the map.\n vis_params (dict, optional): The visualization parameters. Defaults to {}.\n name (str, optional): The name of the layer. Defaults to '...
[ { "param": "self", "type": null }, { "param": "ee_object", "type": null }, { "param": "vis_params", "type": null }, { "param": "name", "type": null }, { "param": "shown", "type": null }, { "param": "opacity", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "ee_object", "type": null, "docstring": "The object to add to the ma...
1675d39e0ebec4a3e65c3bb14c2927822a6214f8
hanzlan/geemap
geemap/plotlymap.py
[ "MIT" ]
Python
add_stac_layer
null
def add_stac_layer( self, url=None, collection=None, item=None, assets=None, bands=None, titiler_endpoint=None, name="STAC Layer", attribution="", opacity=1.0, **kwargs, ): """Adds a STAC TileLayer to the map. A...
Adds a STAC TileLayer to the map. Args: url (str): HTTP URL to a STAC item, e.g., https://canada-spot-ortho.s3.amazonaws.com/canada_spot_orthoimages/canada_spot5_orthoimages/S5_2007/S5_11055_6057_20070622/S5_11055_6057_20070622.json collection (str): The Microsoft Planetary Computer STA...
Adds a STAC TileLayer to the map.
[ "Adds", "a", "STAC", "TileLayer", "to", "the", "map", "." ]
def add_stac_layer( self, url=None, collection=None, item=None, assets=None, bands=None, titiler_endpoint=None, name="STAC Layer", attribution="", opacity=1.0, **kwargs, ): tile_url = stac_tile( url, collecti...
[ "def", "add_stac_layer", "(", "self", ",", "url", "=", "None", ",", "collection", "=", "None", ",", "item", "=", "None", ",", "assets", "=", "None", ",", "bands", "=", "None", ",", "titiler_endpoint", "=", "None", ",", "name", "=", "\"STAC Layer\"", ",...
Adds a STAC TileLayer to the map.
[ "Adds", "a", "STAC", "TileLayer", "to", "the", "map", "." ]
[ "\"\"\"Adds a STAC TileLayer to the map.\n\n Args:\n url (str): HTTP URL to a STAC item, e.g., https://canada-spot-ortho.s3.amazonaws.com/canada_spot_orthoimages/canada_spot5_orthoimages/S5_2007/S5_11055_6057_20070622/S5_11055_6057_20070622.json\n collection (str): The Microsoft Planeta...
[ { "param": "self", "type": null }, { "param": "url", "type": null }, { "param": "collection", "type": null }, { "param": "item", "type": null }, { "param": "assets", "type": null }, { "param": "bands", "type": null }, { "param": "titiler_en...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "url", "type": null, "docstring": null, "docstring_tokens": [ ...
1675d39e0ebec4a3e65c3bb14c2927822a6214f8
hanzlan/geemap
geemap/plotlymap.py
[ "MIT" ]
Python
add_gdf
null
def add_gdf( self, gdf, label_col=None, color_col=None, labels=None, opacity=1.0, zoom=None, color_continuous_scale="Viridis", **kwargs, ): """Adds a GeoDataFrame to the map. Args: gdf (GeoDataFrame): A GeoDataFrame...
Adds a GeoDataFrame to the map. Args: gdf (GeoDataFrame): A GeoDataFrame. label_col (str, optional): The column name of locations. Defaults to None. color_col (str, optional): The column name of color. Defaults to None.
Adds a GeoDataFrame to the map.
[ "Adds", "a", "GeoDataFrame", "to", "the", "map", "." ]
def add_gdf( self, gdf, label_col=None, color_col=None, labels=None, opacity=1.0, zoom=None, color_continuous_scale="Viridis", **kwargs, ): check_package("geopandas", "https://geopandas.org") import geopandas as gpd if i...
[ "def", "add_gdf", "(", "self", ",", "gdf", ",", "label_col", "=", "None", ",", "color_col", "=", "None", ",", "labels", "=", "None", ",", "opacity", "=", "1.0", ",", "zoom", "=", "None", ",", "color_continuous_scale", "=", "\"Viridis\"", ",", "**", "kw...
Adds a GeoDataFrame to the map.
[ "Adds", "a", "GeoDataFrame", "to", "the", "map", "." ]
[ "\"\"\"Adds a GeoDataFrame to the map.\n\n Args:\n gdf (GeoDataFrame): A GeoDataFrame.\n label_col (str, optional): The column name of locations. Defaults to None.\n color_col (str, optional): The column name of color. Defaults to None.\n \"\"\"", "# geom_type = gdf_...
[ { "param": "self", "type": null }, { "param": "gdf", "type": null }, { "param": "label_col", "type": null }, { "param": "color_col", "type": null }, { "param": "labels", "type": null }, { "param": "opacity", "type": null }, { "param": "zoom...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "gdf", "type": null, "docstring": null, "docstring_tokens": [ ...
70b909e8f755da29f8c8af2011a1dcee8b9c231a
braedon/shh
utils/__init__.py
[ "MIT" ]
Python
log_exceptions
<not_specific>
def log_exceptions(exit_on_exception=False): """ Logs any exceptions raised. By default, exceptions are then re-raised. If set to exit on exception, sys.exit(1) is called instead. """ def decorator(func): @functools.wraps(func) def wrapper(*args, **kwargs): try: ...
Logs any exceptions raised. By default, exceptions are then re-raised. If set to exit on exception, sys.exit(1) is called instead.
Logs any exceptions raised. By default, exceptions are then re-raised. If set to exit on exception, sys.exit(1) is called instead.
[ "Logs", "any", "exceptions", "raised", ".", "By", "default", "exceptions", "are", "then", "re", "-", "raised", ".", "If", "set", "to", "exit", "on", "exception", "sys", ".", "exit", "(", "1", ")", "is", "called", "instead", "." ]
def log_exceptions(exit_on_exception=False): def decorator(func): @functools.wraps(func) def wrapper(*args, **kwargs): try: return func(*args, **kwargs) except Exception: if exit_on_exception: log.exception('Unrecoverable ex...
[ "def", "log_exceptions", "(", "exit_on_exception", "=", "False", ")", ":", "def", "decorator", "(", "func", ")", ":", "@", "functools", ".", "wraps", "(", "func", ")", "def", "wrapper", "(", "*", "args", ",", "**", "kwargs", ")", ":", "try", ":", "re...
Logs any exceptions raised.
[ "Logs", "any", "exceptions", "raised", "." ]
[ "\"\"\"\n Logs any exceptions raised.\n\n By default, exceptions are then re-raised. If set to exit on exception,\n sys.exit(1) is called instead.\n \"\"\"" ]
[ { "param": "exit_on_exception", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "exit_on_exception", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
70b909e8f755da29f8c8af2011a1dcee8b9c231a
braedon/shh
utils/__init__.py
[ "MIT" ]
Python
nice_shutdown
null
def nice_shutdown(shutdown=sys.exit, shutdown_signals=(signal.SIGINT, signal.SIGTERM)): """ Logs shutdown signals nicely, and calls a shutdown function. Installs new handlers for the shutdown signals (SIGINT and SIGTERM by default). The original handlers are restored before returning. """ shut...
Logs shutdown signals nicely, and calls a shutdown function. Installs new handlers for the shutdown signals (SIGINT and SIGTERM by default). The original handlers are restored before returning.
Logs shutdown signals nicely, and calls a shutdown function. Installs new handlers for the shutdown signals (SIGINT and SIGTERM by default). The original handlers are restored before returning.
[ "Logs", "shutdown", "signals", "nicely", "and", "calls", "a", "shutdown", "function", ".", "Installs", "new", "handlers", "for", "the", "shutdown", "signals", "(", "SIGINT", "and", "SIGTERM", "by", "default", ")", ".", "The", "original", "handlers", "are", "...
def nice_shutdown(shutdown=sys.exit, shutdown_signals=(signal.SIGINT, signal.SIGTERM)): shutting_down = False def sig_handler(signum, _): nonlocal shutting_down if shutting_down: log.warning('Received signal %(signal)s while shutting down. Aborting.', {'signal...
[ "def", "nice_shutdown", "(", "shutdown", "=", "sys", ".", "exit", ",", "shutdown_signals", "=", "(", "signal", ".", "SIGINT", ",", "signal", ".", "SIGTERM", ")", ")", ":", "shutting_down", "=", "False", "def", "sig_handler", "(", "signum", ",", "_", ")",...
Logs shutdown signals nicely, and calls a shutdown function.
[ "Logs", "shutdown", "signals", "nicely", "and", "calls", "a", "shutdown", "function", "." ]
[ "\"\"\"\n Logs shutdown signals nicely, and calls a shutdown function.\n\n Installs new handlers for the shutdown signals (SIGINT and SIGTERM by default).\n The original handlers are restored before returning.\n \"\"\"", "# Setup new shutdown handlers, storing the old ones for later.", "# Wrapped co...
[ { "param": "shutdown", "type": null }, { "param": "shutdown_signals", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "shutdown", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "shutdown_signals", "type": null, "docstring": null, "docs...
9e03eac5b4c587e96ed3808e2d5b0ef0cf4c9e77
braedon/shh
utils/param_parse.py
[ "MIT" ]
Python
param_parser
<not_specific>
def param_parser(key, *other_keys, default=Unset, empty=Unset, required=False, strip=False, multi=False): """ Decorator that coverts a parsing function into a full param parser. The parsing functions take two strings - the param key and value - and return the parsed (and validated, if ...
Decorator that coverts a parsing function into a full param parser. The parsing functions take two strings - the param key and value - and return the parsed (and validated, if applicable) value. InvalidParamError should be raised if parsing(/validation) fails. The returned param parser function t...
Decorator that coverts a parsing function into a full param parser. The parsing functions take two strings - the param key and value - and return the parsed (and validated, if applicable) value. InvalidParamError should be raised if parsing(/validation) fails. The returned param parser function takes a dict of params,...
[ "Decorator", "that", "coverts", "a", "parsing", "function", "into", "a", "full", "param", "parser", ".", "The", "parsing", "functions", "take", "two", "strings", "-", "the", "param", "key", "and", "value", "-", "and", "return", "the", "parsed", "(", "and",...
def param_parser(key, *other_keys, default=Unset, empty=Unset, required=False, strip=False, multi=False): def decorator(parse_func): def parse_key(params, k): v = params[k] if multi: if isinstance(multi, str): v = params[k].split(m...
[ "def", "param_parser", "(", "key", ",", "*", "other_keys", ",", "default", "=", "Unset", ",", "empty", "=", "Unset", ",", "required", "=", "False", ",", "strip", "=", "False", ",", "multi", "=", "False", ")", ":", "def", "decorator", "(", "parse_func",...
Decorator that coverts a parsing function into a full param parser.
[ "Decorator", "that", "coverts", "a", "parsing", "function", "into", "a", "full", "param", "parser", "." ]
[ "\"\"\"\n Decorator that coverts a parsing function into a full param parser.\n\n The parsing functions take two strings - the param key and value - and return the parsed\n (and validated, if applicable) value. InvalidParamError should be raised if parsing(/validation)\n fails.\n\n The returned param...
[ { "param": "key", "type": null }, { "param": "default", "type": null }, { "param": "empty", "type": null }, { "param": "required", "type": null }, { "param": "strip", "type": null }, { "param": "multi", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "key", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "default", "type": null, "docstring": null, "docstring_tokens":...
9e03eac5b4c587e96ed3808e2d5b0ef0cf4c9e77
braedon/shh
utils/param_parse.py
[ "MIT" ]
Python
parse_params
<not_specific>
def parse_params(params, **parsers): """ Parse a number of params out of a params dict, returning the parsed params as dict. The `params` string -> string dict usually holds HTTP query params, or form params. Each of the `parsers` keyword parameters maps a key in the returned dict to a param parser ...
Parse a number of params out of a params dict, returning the parsed params as dict. The `params` string -> string dict usually holds HTTP query params, or form params. Each of the `parsers` keyword parameters maps a key in the returned dict to a param parser function. Each parser is run on the `param...
Parse a number of params out of a params dict, returning the parsed params as dict. The `params` string -> string dict usually holds HTTP query params, or form params. Each of the `parsers` keyword parameters maps a key in the returned dict to a param parser function. Each parser is run on the `params` in turn, and th...
[ "Parse", "a", "number", "of", "params", "out", "of", "a", "params", "dict", "returning", "the", "parsed", "params", "as", "dict", ".", "The", "`", "params", "`", "string", "-", ">", "string", "dict", "usually", "holds", "HTTP", "query", "params", "or", ...
def parse_params(params, **parsers): parsed_params = {} for out_key, parser in parsers.items(): v = parser(params) if v is not Unset: parsed_params[out_key] = v return parsed_params
[ "def", "parse_params", "(", "params", ",", "**", "parsers", ")", ":", "parsed_params", "=", "{", "}", "for", "out_key", ",", "parser", "in", "parsers", ".", "items", "(", ")", ":", "v", "=", "parser", "(", "params", ")", "if", "v", "is", "not", "Un...
Parse a number of params out of a params dict, returning the parsed params as dict.
[ "Parse", "a", "number", "of", "params", "out", "of", "a", "params", "dict", "returning", "the", "parsed", "params", "as", "dict", "." ]
[ "\"\"\"\n Parse a number of params out of a params dict, returning the parsed params as dict.\n\n The `params` string -> string dict usually holds HTTP query params, or form params.\n\n Each of the `parsers` keyword parameters maps a key in the returned dict to a param parser\n function. Each parser is ...
[ { "param": "params", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "params", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
9e03eac5b4c587e96ed3808e2d5b0ef0cf4c9e77
braedon/shh
utils/param_parse.py
[ "MIT" ]
Python
parse_param
<not_specific>
def parse_param(params, parser): """ Parse a single param out of a params dict. The `params` string -> string dictionary usually holds HTTP query params, or form params. The `parser` is a param parser function that is run on the `params`, and the produced value returned (or `None` if `Unset` is pr...
Parse a single param out of a params dict. The `params` string -> string dictionary usually holds HTTP query params, or form params. The `parser` is a param parser function that is run on the `params`, and the produced value returned (or `None` if `Unset` is produced).
Parse a single param out of a params dict. The `params` string -> string dictionary usually holds HTTP query params, or form params.
[ "Parse", "a", "single", "param", "out", "of", "a", "params", "dict", ".", "The", "`", "params", "`", "string", "-", ">", "string", "dictionary", "usually", "holds", "HTTP", "query", "params", "or", "form", "params", "." ]
def parse_param(params, parser): v = parser(params) if v is not Unset: return v else: return None
[ "def", "parse_param", "(", "params", ",", "parser", ")", ":", "v", "=", "parser", "(", "params", ")", "if", "v", "is", "not", "Unset", ":", "return", "v", "else", ":", "return", "None" ]
Parse a single param out of a params dict.
[ "Parse", "a", "single", "param", "out", "of", "a", "params", "dict", "." ]
[ "\"\"\"\n Parse a single param out of a params dict.\n\n The `params` string -> string dictionary usually holds HTTP query params, or form params.\n\n The `parser` is a param parser function that is run on the `params`, and the produced value\n returned (or `None` if `Unset` is produced).\n \"\"\"" ]
[ { "param": "params", "type": null }, { "param": "parser", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "params", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "parser", "type": null, "docstring": null, "docstring_tokens...
f25e56bdd45aa0d93a95992bb7c1b400e0fa92cd
braedon/shh
utils/security_headers.py
[ "MIT" ]
Python
ensure_headers
null
def ensure_headers(r, headers): """Set headers on a response if not already set""" r = r if isinstance(r, HTTPResponse) else response for k, v in headers.items(): if k not in r.headers: r.set_header(k, v)
Set headers on a response if not already set
Set headers on a response if not already set
[ "Set", "headers", "on", "a", "response", "if", "not", "already", "set" ]
def ensure_headers(r, headers): r = r if isinstance(r, HTTPResponse) else response for k, v in headers.items(): if k not in r.headers: r.set_header(k, v)
[ "def", "ensure_headers", "(", "r", ",", "headers", ")", ":", "r", "=", "r", "if", "isinstance", "(", "r", ",", "HTTPResponse", ")", "else", "response", "for", "k", ",", "v", "in", "headers", ".", "items", "(", ")", ":", "if", "k", "not", "in", "r...
Set headers on a response if not already set
[ "Set", "headers", "on", "a", "response", "if", "not", "already", "set" ]
[ "\"\"\"Set headers on a response if not already set\"\"\"" ]
[ { "param": "r", "type": null }, { "param": "headers", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "r", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "headers", "type": null, "docstring": null, "docstring_tokens": [...
e59bd80f619d25a004354082056baac8c0ee5034
sytone/TTS-Manager
tts_manager/tts.py
[ "MIT" ]
Python
download_file
<not_specific>
def download_file(filesystem, ident, save_type): """Attempt to download all files for a given savefile""" log = logger() log.info("Downloading %s file %s (from %s)" % (save_type.name, ident, filesystem)) filename = filesystem.get_json_filename_for_type(ident, save_type) if not filename:...
Attempt to download all files for a given savefile
Attempt to download all files for a given savefile
[ "Attempt", "to", "download", "all", "files", "for", "a", "given", "savefile" ]
def download_file(filesystem, ident, save_type): log = logger() log.info("Downloading %s file %s (from %s)" % (save_type.name, ident, filesystem)) filename = filesystem.get_json_filename_for_type(ident, save_type) if not filename: log.error("Unable to find data file.") retur...
[ "def", "download_file", "(", "filesystem", ",", "ident", ",", "save_type", ")", ":", "log", "=", "logger", "(", ")", "log", ".", "info", "(", "\"Downloading %s file %s (from %s)\"", "%", "(", "save_type", ".", "name", ",", "ident", ",", "filesystem", ")", ...
Attempt to download all files for a given savefile
[ "Attempt", "to", "download", "all", "files", "for", "a", "given", "savefile" ]
[ "\"\"\"Attempt to download all files for a given savefile\"\"\"" ]
[ { "param": "filesystem", "type": null }, { "param": "ident", "type": null }, { "param": "save_type", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "filesystem", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "ident", "type": null, "docstring": null, "docstring_tok...
289000c33844da87517b5c9903e49378b57ec884
DataResponsibly/fairDAGs
utils.py
[ "MIT" ]
Python
line_cleansing
<not_specific>
def line_cleansing(line): """ Function used to convert sting to unique integer identifier. """ return int.from_bytes(line.encode(), 'little')
Function used to convert sting to unique integer identifier.
Function used to convert sting to unique integer identifier.
[ "Function", "used", "to", "convert", "sting", "to", "unique", "integer", "identifier", "." ]
def line_cleansing(line): return int.from_bytes(line.encode(), 'little')
[ "def", "line_cleansing", "(", "line", ")", ":", "return", "int", ".", "from_bytes", "(", "line", ".", "encode", "(", ")", ",", "'little'", ")" ]
Function used to convert sting to unique integer identifier.
[ "Function", "used", "to", "convert", "sting", "to", "unique", "integer", "identifier", "." ]
[ "\"\"\"\n Function used to convert sting to unique integer identifier.\n \"\"\"" ]
[ { "param": "line", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "line", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
289000c33844da87517b5c9903e49378b57ec884
DataResponsibly/fairDAGs
utils.py
[ "MIT" ]
Python
int_to_string
<not_specific>
def int_to_string(n): """ Function used to convert integer to correspoding String. """ return n.to_bytes(math.ceil(n.bit_length() / 8), 'little').decode()
Function used to convert integer to correspoding String.
Function used to convert integer to correspoding String.
[ "Function", "used", "to", "convert", "integer", "to", "correspoding", "String", "." ]
def int_to_string(n): return n.to_bytes(math.ceil(n.bit_length() / 8), 'little').decode()
[ "def", "int_to_string", "(", "n", ")", ":", "return", "n", ".", "to_bytes", "(", "math", ".", "ceil", "(", "n", ".", "bit_length", "(", ")", "/", "8", ")", ",", "'little'", ")", ".", "decode", "(", ")" ]
Function used to convert integer to correspoding String.
[ "Function", "used", "to", "convert", "integer", "to", "correspoding", "String", "." ]
[ "\"\"\"\n Function used to convert integer to correspoding String.\n \"\"\"" ]
[ { "param": "n", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "n", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
289000c33844da87517b5c9903e49378b57ec884
DataResponsibly/fairDAGs
utils.py
[ "MIT" ]
Python
plotly_histogram
<not_specific>
def plotly_histogram(res, title, ind, pos_group): """ Function used to convert data list to html-ready plotly histogram. """ colors = px.colors.qualitative.Plotly primary_key = remove_list_dup([item[0] for item in res.keys()]) names = remove_list_dup([item[1] for item in res.keys()]) ys_pos,...
Function used to convert data list to html-ready plotly histogram.
Function used to convert data list to html-ready plotly histogram.
[ "Function", "used", "to", "convert", "data", "list", "to", "html", "-", "ready", "plotly", "histogram", "." ]
def plotly_histogram(res, title, ind, pos_group): colors = px.colors.qualitative.Plotly primary_key = remove_list_dup([item[0] for item in res.keys()]) names = remove_list_dup([item[1] for item in res.keys()]) ys_pos, ys_neg = [], [] for value in res.values(): neg_group = list(value.keys())[...
[ "def", "plotly_histogram", "(", "res", ",", "title", ",", "ind", ",", "pos_group", ")", ":", "colors", "=", "px", ".", "colors", ".", "qualitative", ".", "Plotly", "primary_key", "=", "remove_list_dup", "(", "[", "item", "[", "0", "]", "for", "item", "...
Function used to convert data list to html-ready plotly histogram.
[ "Function", "used", "to", "convert", "data", "list", "to", "html", "-", "ready", "plotly", "histogram", "." ]
[ "\"\"\"\n Function used to convert data list to html-ready plotly histogram.\n \"\"\"", "# ys_pos = [ys_pos[i*len(primary_key):(i + 1) * len(primary_key)] for i in range((len(ys_pos) + len(primary_key) - 1) // len(primary_key))]", "# ys_neg = [ys_neg[i*len(primary_key):(i + 1) * len(primary_key)] for i in...
[ { "param": "res", "type": null }, { "param": "title", "type": null }, { "param": "ind", "type": null }, { "param": "pos_group", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "res", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "title", "type": null, "docstring": null, "docstring_tokens": [...
289000c33844da87517b5c9903e49378b57ec884
DataResponsibly/fairDAGs
utils.py
[ "MIT" ]
Python
plotly_histogram_perform
<not_specific>
def plotly_histogram_perform(data, target, title): """ Function used to convert performance label to html-ready plotly histogram. """ colors = px.colors.qualitative.Plotly primary_key = remove_list_dup([item[0] for item in data.keys()]) names = remove_list_dup([item[1] for item in data.keys()]) ...
Function used to convert performance label to html-ready plotly histogram.
Function used to convert performance label to html-ready plotly histogram.
[ "Function", "used", "to", "convert", "performance", "label", "to", "html", "-", "ready", "plotly", "histogram", "." ]
def plotly_histogram_perform(data, target, title): colors = px.colors.qualitative.Plotly primary_key = remove_list_dup([item[0] for item in data.keys()]) names = remove_list_dup([item[1] for item in data.keys()]) target_data = [] for value in data.values(): target_data.append(value[target]) ...
[ "def", "plotly_histogram_perform", "(", "data", ",", "target", ",", "title", ")", ":", "colors", "=", "px", ".", "colors", ".", "qualitative", ".", "Plotly", "primary_key", "=", "remove_list_dup", "(", "[", "item", "[", "0", "]", "for", "item", "in", "da...
Function used to convert performance label to html-ready plotly histogram.
[ "Function", "used", "to", "convert", "performance", "label", "to", "html", "-", "ready", "plotly", "histogram", "." ]
[ "\"\"\"\n Function used to convert performance label to html-ready plotly histogram.\n \"\"\"" ]
[ { "param": "data", "type": null }, { "param": "target", "type": null }, { "param": "title", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "data", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "target", "type": null, "docstring": null, "docstring_tokens":...
289000c33844da87517b5c9903e49378b57ec884
DataResponsibly/fairDAGs
utils.py
[ "MIT" ]
Python
pipeline_to_dataflow_graph
<not_specific>
def pipeline_to_dataflow_graph(pipeline): ''' Support function used in Logs. Parent_vertices are all set to None here. name field is set to be column name in ColumnTransfomer and operation field contains not only name but also input args. ''' graph = [] layer_graph = [] def helper(pipeline, ...
Support function used in Logs. Parent_vertices are all set to None here. name field is set to be column name in ColumnTransfomer and operation field contains not only name but also input args.
Support function used in Logs. Parent_vertices are all set to None here. name field is set to be column name in ColumnTransfomer and operation field contains not only name but also input args.
[ "Support", "function", "used", "in", "Logs", ".", "Parent_vertices", "are", "all", "set", "to", "None", "here", ".", "name", "field", "is", "set", "to", "be", "column", "name", "in", "ColumnTransfomer", "and", "operation", "field", "contains", "not", "only",...
def pipeline_to_dataflow_graph(pipeline): graph = [] layer_graph = [] def helper(pipeline, name_prefix=[], parent_vertices=[]): if 'ColumnTransformer' in str(type(pipeline)): for step in pipeline.transformers: for column_name in step[2]: helper(step[1]...
[ "def", "pipeline_to_dataflow_graph", "(", "pipeline", ")", ":", "graph", "=", "[", "]", "layer_graph", "=", "[", "]", "def", "helper", "(", "pipeline", ",", "name_prefix", "=", "[", "]", ",", "parent_vertices", "=", "[", "]", ")", ":", "if", "'ColumnTran...
Support function used in Logs.
[ "Support", "function", "used", "in", "Logs", "." ]
[ "'''\n Support function used in Logs. Parent_vertices are all set to None here.\n name field is set to be column name in ColumnTransfomer and operation field contains not only name but also input args.\n '''", "# helper(step[1], name_prefix+['ColTrans__'+column_name], parent_vertices)" ]
[ { "param": "pipeline", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "pipeline", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
289000c33844da87517b5c9903e49378b57ec884
DataResponsibly/fairDAGs
utils.py
[ "MIT" ]
Python
static_label
<not_specific>
def static_label(data, sensi_atts, target_name): """ Function used for static label generation. args: data: raw input data. pandas dataframe. sensi_atts: sensible attributes used to generate static labels. String. target_name: target attributes. String. return: res: dic...
Function used for static label generation. args: data: raw input data. pandas dataframe. sensi_atts: sensible attributes used to generate static labels. String. target_name: target attributes. String. return: res: dictionaty storing categories to static labels.
Function used for static label generation. args: data: raw input data. pandas dataframe. sensi_atts: sensible attributes used to generate static labels. String. dictionaty storing categories to static labels.
[ "Function", "used", "for", "static", "label", "generation", ".", "args", ":", "data", ":", "raw", "input", "data", ".", "pandas", "dataframe", ".", "sensi_atts", ":", "sensible", "attributes", "used", "to", "generate", "static", "labels", ".", "String", ".",...
def static_label(data, sensi_atts, target_name): groupby_cols = sensi_atts+[target_name] placeholder_att = list(set(data.columns).difference(groupby_cols))[0] pivot_data = data.pivot_table(index=sensi_atts, columns=target_name, values=placeholder_att, ...
[ "def", "static_label", "(", "data", ",", "sensi_atts", ",", "target_name", ")", ":", "groupby_cols", "=", "sensi_atts", "+", "[", "target_name", "]", "placeholder_att", "=", "list", "(", "set", "(", "data", ".", "columns", ")", ".", "difference", "(", "gro...
Function used for static label generation.
[ "Function", "used", "for", "static", "label", "generation", "." ]
[ "\"\"\"\n Function used for static label generation.\n\n args:\n data: raw input data. pandas dataframe.\n sensi_atts: sensible attributes used to generate static labels. String.\n target_name: target attributes. String.\n\n return:\n res: dictionaty storing categories to static...
[ { "param": "data", "type": null }, { "param": "sensi_atts", "type": null }, { "param": "target_name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "data", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "sensi_atts", "type": null, "docstring": null, "docstring_toke...
289000c33844da87517b5c9903e49378b57ec884
DataResponsibly/fairDAGs
utils.py
[ "MIT" ]
Python
func_aggregation
<not_specific>
def func_aggregation(func_str): ''' This function is used for line execution with exec() args: function strings after inspect returns: list of functionable strings for exec() ''' res = [] # executables for return stack_for_parent = [] # stack storing brackets for line integ...
This function is used for line execution with exec() args: function strings after inspect returns: list of functionable strings for exec()
This function is used for line execution with exec() args: function strings after inspect returns: list of functionable strings for exec()
[ "This", "function", "is", "used", "for", "line", "execution", "with", "exec", "()", "args", ":", "function", "strings", "after", "inspect", "returns", ":", "list", "of", "functionable", "strings", "for", "exec", "()" ]
def func_aggregation(func_str): res = [] stack_for_parent = [] logs_of_parent = [] func_list = [item.strip() for item in func_str.split('\n')] i = 0 while True: if func_list[i].startswith('def'): func_list = func_list[i:] break i = i + 1 func_args =...
[ "def", "func_aggregation", "(", "func_str", ")", ":", "res", "=", "[", "]", "stack_for_parent", "=", "[", "]", "logs_of_parent", "=", "[", "]", "func_list", "=", "[", "item", ".", "strip", "(", ")", "for", "item", "in", "func_str", ".", "split", "(", ...
This function is used for line execution with exec() args: function strings after inspect returns: list of functionable strings for exec()
[ "This", "function", "is", "used", "for", "line", "execution", "with", "exec", "()", "args", ":", "function", "strings", "after", "inspect", "returns", ":", "list", "of", "functionable", "strings", "for", "exec", "()" ]
[ "'''\n This function is used for line execution with exec()\n\n args:\n function strings after inspect\n returns:\n list of functionable strings for exec()\n '''", "# executables for return", "# stack storing brackets for line integration", "# logs of lines for concat", "# conv...
[ { "param": "func_str", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "func_str", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
289000c33844da87517b5c9903e49378b57ec884
DataResponsibly/fairDAGs
utils.py
[ "MIT" ]
Python
cal_numerical
<not_specific>
def cal_numerical(target_df_1, numeric_feature, numerical_df): ''' Calculate metrices for numerical features including counts, missing values, Median and MAD, range/scaling ''' # get counts of non NA values count_log = target_df_1[numeric_feature].count() numerical_df.loc[numeric_featur...
Calculate metrices for numerical features including counts, missing values, Median and MAD, range/scaling
Calculate metrices for numerical features including counts, missing values, Median and MAD, range/scaling
[ "Calculate", "metrices", "for", "numerical", "features", "including", "counts", "missing", "values", "Median", "and", "MAD", "range", "/", "scaling" ]
def cal_numerical(target_df_1, numeric_feature, numerical_df): count_log = target_df_1[numeric_feature].count() numerical_df.loc[numeric_feature, 'count'] = count_log missing_count_log = target_df_1[numeric_feature].isna().sum() numerical_df.loc[numeric_feature, 'missing_count'] = missing_count_log ...
[ "def", "cal_numerical", "(", "target_df_1", ",", "numeric_feature", ",", "numerical_df", ")", ":", "count_log", "=", "target_df_1", "[", "numeric_feature", "]", ".", "count", "(", ")", "numerical_df", ".", "loc", "[", "numeric_feature", ",", "'count'", "]", "=...
Calculate metrices for numerical features including counts, missing values, Median and MAD, range/scaling
[ "Calculate", "metrices", "for", "numerical", "features", "including", "counts", "missing", "values", "Median", "and", "MAD", "range", "/", "scaling" ]
[ "'''\n Calculate metrices for numerical features\n including counts, missing values, Median and MAD, range/scaling\n '''", "# get counts of non NA values", "# get missing value counts", "# distribution", "# Median and MAD", "# range/ scaling" ]
[ { "param": "target_df_1", "type": null }, { "param": "numeric_feature", "type": null }, { "param": "numerical_df", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "target_df_1", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "numeric_feature", "type": null, "docstring": null, "do...
289000c33844da87517b5c9903e49378b57ec884
DataResponsibly/fairDAGs
utils.py
[ "MIT" ]
Python
cal_categorical
<not_specific>
def cal_categorical(target_df_1, cat_feature, cat_df): ''' Calculate metrices for categorical features including missing values, number of classes, counts for each group, percentage for each group ''' # get missing value counts missing_count_log = target_df_1[cat_feature].isna().sum() c...
Calculate metrices for categorical features including missing values, number of classes, counts for each group, percentage for each group
Calculate metrices for categorical features including missing values, number of classes, counts for each group, percentage for each group
[ "Calculate", "metrices", "for", "categorical", "features", "including", "missing", "values", "number", "of", "classes", "counts", "for", "each", "group", "percentage", "for", "each", "group" ]
def cal_categorical(target_df_1, cat_feature, cat_df): missing_count_log = target_df_1[cat_feature].isna().sum() cat_df.loc[cat_feature, 'missing_count'] = missing_count_log num_class_log = len(target_df_1[cat_feature].value_counts().keys()) cat_df.loc[cat_feature, 'num_class'] = num_class_log class...
[ "def", "cal_categorical", "(", "target_df_1", ",", "cat_feature", ",", "cat_df", ")", ":", "missing_count_log", "=", "target_df_1", "[", "cat_feature", "]", ".", "isna", "(", ")", ".", "sum", "(", ")", "cat_df", ".", "loc", "[", "cat_feature", ",", "'missi...
Calculate metrices for categorical features including missing values, number of classes, counts for each group, percentage for each group
[ "Calculate", "metrices", "for", "categorical", "features", "including", "missing", "values", "number", "of", "classes", "counts", "for", "each", "group", "percentage", "for", "each", "group" ]
[ "'''\n Calculate metrices for categorical features\n including missing values, number of classes, counts for each group, percentage for each group\n '''", "# get missing value counts", "# get number of classes", "# get counts for each group", "# get percentage each group covers" ]
[ { "param": "target_df_1", "type": null }, { "param": "cat_feature", "type": null }, { "param": "cat_df", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "target_df_1", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "cat_feature", "type": null, "docstring": null, "docstr...
289000c33844da87517b5c9903e49378b57ec884
DataResponsibly/fairDAGs
utils.py
[ "MIT" ]
Python
autolabel
null
def autolabel(rects, ax, font_size): """Attach a text label above each bar in *rects*, displaying its height.""" for rect in rects: height = rect.get_height() ax.annotate('{}'.format(height), fontsize = font_size - 3, xy=(rect.get_x() + rect.get_width() / 2, height), ...
Attach a text label above each bar in *rects*, displaying its height.
Attach a text label above each bar in *rects*, displaying its height.
[ "Attach", "a", "text", "label", "above", "each", "bar", "in", "*", "rects", "*", "displaying", "its", "height", "." ]
def autolabel(rects, ax, font_size): for rect in rects: height = rect.get_height() ax.annotate('{}'.format(height), fontsize = font_size - 3, xy=(rect.get_x() + rect.get_width() / 2, height), xytext=(0, 3), textcoords="offset points", ...
[ "def", "autolabel", "(", "rects", ",", "ax", ",", "font_size", ")", ":", "for", "rect", "in", "rects", ":", "height", "=", "rect", ".", "get_height", "(", ")", "ax", ".", "annotate", "(", "'{}'", ".", "format", "(", "height", ")", ",", "fontsize", ...
Attach a text label above each bar in *rects*, displaying its height.
[ "Attach", "a", "text", "label", "above", "each", "bar", "in", "*", "rects", "*", "displaying", "its", "height", "." ]
[ "\"\"\"Attach a text label above each bar in *rects*, displaying its height.\"\"\"", "# 3 points vertical offset" ]
[ { "param": "rects", "type": null }, { "param": "ax", "type": null }, { "param": "font_size", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "rects", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "ax", "type": null, "docstring": null, "docstring_tokens": []...
289000c33844da87517b5c9903e49378b57ec884
DataResponsibly/fairDAGs
utils.py
[ "MIT" ]
Python
change_code_color
<not_specific>
def change_code_color(colors, titles, code): """ Function used for code color changing in main home heml page w.r.t user's click events. """ code_list = code.split("\n") for idx, line in enumerate(code_list): if line.startswith(" "): code_list[idx] = f"<p style=\"marg...
Function used for code color changing in main home heml page w.r.t user's click events.
Function used for code color changing in main home heml page w.r.t user's click events.
[ "Function", "used", "for", "code", "color", "changing", "in", "main", "home", "heml", "page", "w", ".", "r", ".", "t", "user", "'", "s", "click", "events", "." ]
def change_code_color(colors, titles, code): code_list = code.split("\n") for idx, line in enumerate(code_list): if line.startswith(" "): code_list[idx] = f"<p style=\"margin-left: 120px\">{line}</p>" elif line.startswith(" "): code_list[idx] = f"<p styl...
[ "def", "change_code_color", "(", "colors", ",", "titles", ",", "code", ")", ":", "code_list", "=", "code", ".", "split", "(", "\"\\n\"", ")", "for", "idx", ",", "line", "in", "enumerate", "(", "code_list", ")", ":", "if", "line", ".", "startswith", "("...
Function used for code color changing in main home heml page w.r.t user's click events.
[ "Function", "used", "for", "code", "color", "changing", "in", "main", "home", "heml", "page", "w", ".", "r", ".", "t", "user", "'", "s", "click", "events", "." ]
[ "\"\"\"\n Function used for code color changing in main home heml page w.r.t user's click events.\n \"\"\"", "# for sep in title.split(\"__\"):", "# if sep in line and sep:" ]
[ { "param": "colors", "type": null }, { "param": "titles", "type": null }, { "param": "code", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "colors", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "titles", "type": null, "docstring": null, "docstring_tokens...
087bf51cbc44946c723875ccb1b5a40ad170afe8
DataResponsibly/fairDAGs
fairness_instru.py
[ "MIT" ]
Python
find_pd_lines
<not_specific>
def find_pd_lines(pipeline_func): """ function used for extract pandas operations from raw pipeline codes. args: pipeline_func: raw pipeline codes. String. return: rows including pandas operations. """ pipeline_func = inspect.getsource(pipeline_func) pd_lines = [] input...
function used for extract pandas operations from raw pipeline codes. args: pipeline_func: raw pipeline codes. String. return: rows including pandas operations.
function used for extract pandas operations from raw pipeline codes. args: pipeline_func: raw pipeline codes. String. rows including pandas operations.
[ "function", "used", "for", "extract", "pandas", "operations", "from", "raw", "pipeline", "codes", ".", "args", ":", "pipeline_func", ":", "raw", "pipeline", "codes", ".", "String", ".", "rows", "including", "pandas", "operations", "." ]
def find_pd_lines(pipeline_func): pipeline_func = inspect.getsource(pipeline_func) pd_lines = [] input_args , executable_list, _ = func_aggregation(pipeline_func) for line in input_args: exec(line) for cur_line in executable_list: exec(cur_line) try: if 'inplace' ...
[ "def", "find_pd_lines", "(", "pipeline_func", ")", ":", "pipeline_func", "=", "inspect", ".", "getsource", "(", "pipeline_func", ")", "pd_lines", "=", "[", "]", "input_args", ",", "executable_list", ",", "_", "=", "func_aggregation", "(", "pipeline_func", ")", ...
function used for extract pandas operations from raw pipeline codes.
[ "function", "used", "for", "extract", "pandas", "operations", "from", "raw", "pipeline", "codes", "." ]
[ "\"\"\"\n function used for extract pandas operations from raw pipeline codes.\n\n args:\n pipeline_func: raw pipeline codes. String.\n\n return:\n rows including pandas operations.\n \"\"\"" ]
[ { "param": "pipeline_func", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "pipeline_func", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
087bf51cbc44946c723875ccb1b5a40ad170afe8
DataResponsibly/fairDAGs
fairness_instru.py
[ "MIT" ]
Python
pd_to_dataflow_graph
<not_specific>
def pd_to_dataflow_graph(pipeline_func, log_list, parent_vertices=[]): """ Function translating pandas operations to DAGs. args: pipeline_func: raw pipeline codes. String. log_list: log_list storing all operation identifiers. List. parent_vertices: parent nodes. default to be None. ...
Function translating pandas operations to DAGs. args: pipeline_func: raw pipeline codes. String. log_list: log_list storing all operation identifiers. List. parent_vertices: parent nodes. default to be None. No operations before pandas. List. return: graph: list of nodes i...
Function translating pandas operations to DAGs. args: pipeline_func: raw pipeline codes. String. list of nodes in the eligible format from graphviz. previous: last node used for parent node of sklearn part.
[ "Function", "translating", "pandas", "operations", "to", "DAGs", ".", "args", ":", "pipeline_func", ":", "raw", "pipeline", "codes", ".", "String", ".", "list", "of", "nodes", "in", "the", "eligible", "format", "from", "graphviz", ".", "previous", ":", "last...
def pd_to_dataflow_graph(pipeline_func, log_list, parent_vertices=[]): executable_list = find_pd_lines(pipeline_func) graph = [] previous = [] for line in executable_list: line.replace('{','').replace('}', '') if 'inplace' in line and '#' not in line: log_list.append(line_cle...
[ "def", "pd_to_dataflow_graph", "(", "pipeline_func", ",", "log_list", ",", "parent_vertices", "=", "[", "]", ")", ":", "executable_list", "=", "find_pd_lines", "(", "pipeline_func", ")", "graph", "=", "[", "]", "previous", "=", "[", "]", "for", "line", "in",...
Function translating pandas operations to DAGs.
[ "Function", "translating", "pandas", "operations", "to", "DAGs", "." ]
[ "\"\"\"\n Function translating pandas operations to DAGs.\n\n args:\n pipeline_func: raw pipeline codes. String.\n log_list: log_list storing all operation identifiers. List.\n parent_vertices: parent nodes. default to be None. No operations before pandas. List.\n\n return:\n gr...
[ { "param": "pipeline_func", "type": null }, { "param": "log_list", "type": null }, { "param": "parent_vertices", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "pipeline_func", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "log_list", "type": null, "docstring": null, "docstri...
087bf51cbc44946c723875ccb1b5a40ad170afe8
DataResponsibly/fairDAGs
fairness_instru.py
[ "MIT" ]
Python
sklearn_to_dataflow_graph
<not_specific>
def sklearn_to_dataflow_graph(pipeline, log_list, parent_vertices=[]): """ Function translating sklearn operations to DAGs. args: pipeline_func: raw pipeline codes. String. log_list: log_list storing all operation identifiers. List. parent_vertices: parent nodes. default to be None....
Function translating sklearn operations to DAGs. args: pipeline_func: raw pipeline codes. String. log_list: log_list storing all operation identifiers. List. parent_vertices: parent nodes. default to be None. No operations before pandas. List. return: graph: list of nodes ...
Function translating sklearn operations to DAGs. args: pipeline_func: raw pipeline codes. String. list of nodes in the eligible format from graphviz.
[ "Function", "translating", "sklearn", "operations", "to", "DAGs", ".", "args", ":", "pipeline_func", ":", "raw", "pipeline", "codes", ".", "String", ".", "list", "of", "nodes", "in", "the", "eligible", "format", "from", "graphviz", "." ]
def sklearn_to_dataflow_graph(pipeline, log_list, parent_vertices=[]): graph = pipeline_to_dataflow_graph_full(pipeline) graph_dict = pipeline_to_dataflow_graph(pipeline) for node in graph_dict: log_list.append(line_cleansing(f"{node.name}__{str(node.operation).split('(')[0]}")) for node in grap...
[ "def", "sklearn_to_dataflow_graph", "(", "pipeline", ",", "log_list", ",", "parent_vertices", "=", "[", "]", ")", ":", "graph", "=", "pipeline_to_dataflow_graph_full", "(", "pipeline", ")", "graph_dict", "=", "pipeline_to_dataflow_graph", "(", "pipeline", ")", "for"...
Function translating sklearn operations to DAGs.
[ "Function", "translating", "sklearn", "operations", "to", "DAGs", "." ]
[ "\"\"\"\n Function translating sklearn operations to DAGs.\n\n args:\n pipeline_func: raw pipeline codes. String.\n log_list: log_list storing all operation identifiers. List.\n parent_vertices: parent nodes. default to be None. No operations before pandas. List.\n\n return:\n g...
[ { "param": "pipeline", "type": null }, { "param": "log_list", "type": null }, { "param": "parent_vertices", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "pipeline", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "log_list", "type": null, "docstring": null, "docstring_to...
087bf51cbc44946c723875ccb1b5a40ad170afe8
DataResponsibly/fairDAGs
fairness_instru.py
[ "MIT" ]
Python
visualize
<not_specific>
def visualize(nested_graph, log_list, save_path, dag_save): """ Use graphvis to generate DAGs from graph list generated from pandas_to_dataflow_graph and sklearn_to_dataflow_graph. args: nested_graph: graph list generated from pandas_to_dataflow_graph and sklearn_to_dataflow_graph. List. lo...
Use graphvis to generate DAGs from graph list generated from pandas_to_dataflow_graph and sklearn_to_dataflow_graph. args: nested_graph: graph list generated from pandas_to_dataflow_graph and sklearn_to_dataflow_graph. List. log_list: log_list storing all operation identifiers. List. s...
Use graphvis to generate DAGs from graph list generated from pandas_to_dataflow_graph and sklearn_to_dataflow_graph. graphviz DAG object. rand_rgb: color list storing the sequence of color used for DAG nodes.
[ "Use", "graphvis", "to", "generate", "DAGs", "from", "graph", "list", "generated", "from", "pandas_to_dataflow_graph", "and", "sklearn_to_dataflow_graph", ".", "graphviz", "DAG", "object", ".", "rand_rgb", ":", "color", "list", "storing", "the", "sequence", "of", ...
def visualize(nested_graph, log_list, save_path, dag_save): no_nodes = len(log_list) rand_rgb = ['#191970', '#ff0000', '#006400', '#32cd32', '#ffd700', '#9932cc', '#ff69b4', '#8b4513', '#00ced1', '#d2691e'] if no_nodes <= 10 else ["#"+''.join([random.choice('0123456789ABCDEF') for j in range(6)]) for i in range...
[ "def", "visualize", "(", "nested_graph", ",", "log_list", ",", "save_path", ",", "dag_save", ")", ":", "no_nodes", "=", "len", "(", "log_list", ")", "rand_rgb", "=", "[", "'#191970'", ",", "'#ff0000'", ",", "'#006400'", ",", "'#32cd32'", ",", "'#ffd700'", ...
Use graphvis to generate DAGs from graph list generated from pandas_to_dataflow_graph and sklearn_to_dataflow_graph.
[ "Use", "graphvis", "to", "generate", "DAGs", "from", "graph", "list", "generated", "from", "pandas_to_dataflow_graph", "and", "sklearn_to_dataflow_graph", "." ]
[ "\"\"\"\n Use graphvis to generate DAGs from graph list generated from pandas_to_dataflow_graph and sklearn_to_dataflow_graph.\n\n args:\n nested_graph: graph list generated from pandas_to_dataflow_graph and sklearn_to_dataflow_graph. List.\n log_list: log_list storing all operation identifiers....
[ { "param": "nested_graph", "type": null }, { "param": "log_list", "type": null }, { "param": "save_path", "type": null }, { "param": "dag_save", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "nested_graph", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "log_list", "type": null, "docstring": null, "docstrin...
087bf51cbc44946c723875ccb1b5a40ad170afe8
DataResponsibly/fairDAGs
fairness_instru.py
[ "MIT" ]
Python
tracer
<not_specific>
def tracer(cat_col, numerical_col, sensi_atts, target_name, training = True, save_path = '', dag_save = 'pdf'): """ combines describe_ver(generate intermediate dict) and visualize(DAG generation). args: cat_col: catagorical attributes used for tracing changes. String. numerical_col: numeric...
combines describe_ver(generate intermediate dict) and visualize(DAG generation). args: cat_col: catagorical attributes used for tracing changes. String. numerical_col: numerical attributes used for tracing changes. String. sensi_atts: sensible attributes used to generate static labels....
function wrapper. all outputs saved to save_path using pickle.
[ "function", "wrapper", ".", "all", "outputs", "saved", "to", "save_path", "using", "pickle", "." ]
def tracer(cat_col, numerical_col, sensi_atts, target_name, training = True, save_path = '', dag_save = 'pdf'): def wrapper(func): def call(*args, **kwargs): if not os.path.exists('experiments'): os.mkdir('experiments') if not os.path.exists(save_path): ...
[ "def", "tracer", "(", "cat_col", ",", "numerical_col", ",", "sensi_atts", ",", "target_name", ",", "training", "=", "True", ",", "save_path", "=", "''", ",", "dag_save", "=", "'pdf'", ")", ":", "def", "wrapper", "(", "func", ")", ":", "def", "call", "(...
combines describe_ver(generate intermediate dict) and visualize(DAG generation).
[ "combines", "describe_ver", "(", "generate", "intermediate", "dict", ")", "and", "visualize", "(", "DAG", "generation", ")", "." ]
[ "\"\"\"\n combines describe_ver(generate intermediate dict) and visualize(DAG generation).\n\n args:\n cat_col: catagorical attributes used for tracing changes. String.\n numerical_col: numerical attributes used for tracing changes. String.\n sensi_atts: sensible attributes used to genera...
[ { "param": "cat_col", "type": null }, { "param": "numerical_col", "type": null }, { "param": "sensi_atts", "type": null }, { "param": "target_name", "type": null }, { "param": "training", "type": null }, { "param": "save_path", "type": null }, ...
{ "returns": [], "raises": [], "params": [ { "identifier": "cat_col", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "numerical_col", "type": null, "docstring": null, "docstrin...
07d8353e3712ee5152db64bbb1457acdd56576a0
DataResponsibly/fairDAGs
fair_dag.py
[ "MIT" ]
Python
wrap
<not_specific>
def wrap(*args, **kwargs): """ Function checking the login status of user. If no login status, redirect to login package """ if 'logged_in' in session and session['logged_in']: return f(*args, **kwargs) else: flash('You need to login first') ...
Function checking the login status of user. If no login status, redirect to login package
Function checking the login status of user. If no login status, redirect to login package
[ "Function", "checking", "the", "login", "status", "of", "user", ".", "If", "no", "login", "status", "redirect", "to", "login", "package" ]
def wrap(*args, **kwargs): if 'logged_in' in session and session['logged_in']: return f(*args, **kwargs) else: flash('You need to login first') return redirect(url_for('login'))
[ "def", "wrap", "(", "*", "args", ",", "**", "kwargs", ")", ":", "if", "'logged_in'", "in", "session", "and", "session", "[", "'logged_in'", "]", ":", "return", "f", "(", "*", "args", ",", "**", "kwargs", ")", "else", ":", "flash", "(", "'You need to ...
Function checking the login status of user.
[ "Function", "checking", "the", "login", "status", "of", "user", "." ]
[ "\"\"\"\n Function checking the login status of user.\n If no login status, redirect to login package\n \"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
07d8353e3712ee5152db64bbb1457acdd56576a0
DataResponsibly/fairDAGs
fair_dag.py
[ "MIT" ]
Python
login
<not_specific>
def login(): """ Login Page Flask function In Login page: takes in user information. dropdown menu for user to select play data upload function for data upload if new case specified by user Returns: url for login page. Redirect to main home page if valid login session ...
Login Page Flask function In Login page: takes in user information. dropdown menu for user to select play data upload function for data upload if new case specified by user Returns: url for login page. Redirect to main home page if valid login session write pipelin...
Login Page Flask function In Login page: takes in user information. dropdown menu for user to select play data upload function for data upload if new case specified by user
[ "Login", "Page", "Flask", "function", "In", "Login", "page", ":", "takes", "in", "user", "information", ".", "dropdown", "menu", "for", "user", "to", "select", "play", "data", "upload", "function", "for", "data", "upload", "if", "new", "case", "specified", ...
def login(): error = None if request.method == 'POST': global name name = request.form['name'] if request.form['name'] else 'Guest X' global organization organization = request.form['organization'] if request.form['organization'] else 'Y university' global demo de...
[ "def", "login", "(", ")", ":", "error", "=", "None", "if", "request", ".", "method", "==", "'POST'", ":", "global", "name", "name", "=", "request", ".", "form", "[", "'name'", "]", "if", "request", ".", "form", "[", "'name'", "]", "else", "'Guest X'"...
Login Page Flask function In Login page: takes in user information.
[ "Login", "Page", "Flask", "function", "In", "Login", "page", ":", "takes", "in", "user", "information", "." ]
[ "\"\"\"\n Login Page Flask function\n\n In Login page:\n takes in user information.\n dropdown menu for user to select play data\n upload function for data upload if new case specified by user\n\n Returns:\n url for login page. Redirect to main home page if valid login session\n...
[]
{ "returns": [ { "docstring": "url for login page. Redirect to main home page if valid login session\nwrite pipeline code to executable function python file which calls fairness_instru wrapper generating DAGs and intermediate log dict files\nload intermediate dicts as well as DAG(stored in svg) and parse th...
07d8353e3712ee5152db64bbb1457acdd56576a0
DataResponsibly/fairDAGs
fair_dag.py
[ "MIT" ]
Python
home
<not_specific>
def home(): """ Main Function Flask function html adopts hierachical format. child html file takes care of DAG visualization while parent html deals with dynamic changes in codes, dag color, tables and histograms. In Main home page: Display user information in head row Display raw pipel...
Main Function Flask function html adopts hierachical format. child html file takes care of DAG visualization while parent html deals with dynamic changes in codes, dag color, tables and histograms. In Main home page: Display user information in head row Display raw pipeline code. Change co...
Main Function Flask function html adopts hierachical format. child html file takes care of DAG visualization while parent html deals with dynamic changes in codes, dag color, tables and histograms. In Main home page: Display user information in head row Display raw pipeline code. Change color w.r.t click events Display...
[ "Main", "Function", "Flask", "function", "html", "adopts", "hierachical", "format", ".", "child", "html", "file", "takes", "care", "of", "DAG", "visualization", "while", "parent", "html", "deals", "with", "dynamic", "changes", "in", "codes", "dag", "color", "t...
def home(): selected_status = request.args.get('type') if selected_status is not None: cache.append(selected_status) corr_color = [rand_rgb[int(step)] for step in cache] plots = {} to_plot = [] code_with_color = "" tables_to_display, titles, labels, code_titles, plt_xs, plt_ys, plt_t...
[ "def", "home", "(", ")", ":", "selected_status", "=", "request", ".", "args", ".", "get", "(", "'type'", ")", "if", "selected_status", "is", "not", "None", ":", "cache", ".", "append", "(", "selected_status", ")", "corr_color", "=", "[", "rand_rgb", "[",...
Main Function Flask function html adopts hierachical format.
[ "Main", "Function", "Flask", "function", "html", "adopts", "hierachical", "format", "." ]
[ "\"\"\"\n Main Function Flask function\n\n html adopts hierachical format. child html file takes care of DAG visualization while parent html deals with dynamic changes in codes, dag color, tables and histograms.\n In Main home page:\n Display user information in head row\n Display raw pipelin...
[]
{ "returns": [ { "docstring": "url for main home page.", "docstring_tokens": [ "url", "for", "main", "home", "page", "." ], "type": null } ], "raises": [], "params": [], "outlier_params": [], "others": [] }
7269923c31c04363275d7657e91173ff31d96b71
anukaal/python-service-management
scripts/fixup_servicemanagement_v1_keywords.py
[ "Apache-2.0" ]
Python
fix_files
null
def fix_files( in_dir: pathlib.Path, out_dir: pathlib.Path, *, transformer=servicemanagementCallTransformer(), ): """Duplicate the input dir to the output dir, fixing file method calls. Preconditions: * in_dir is a real directory * out_dir is a real, empty directory """ pyfile_g...
Duplicate the input dir to the output dir, fixing file method calls. Preconditions: * in_dir is a real directory * out_dir is a real, empty directory
Duplicate the input dir to the output dir, fixing file method calls. Preconditions: in_dir is a real directory out_dir is a real, empty directory
[ "Duplicate", "the", "input", "dir", "to", "the", "output", "dir", "fixing", "file", "method", "calls", ".", "Preconditions", ":", "in_dir", "is", "a", "real", "directory", "out_dir", "is", "a", "real", "empty", "directory" ]
def fix_files( in_dir: pathlib.Path, out_dir: pathlib.Path, *, transformer=servicemanagementCallTransformer(), ): pyfile_gen = ( pathlib.Path(os.path.join(root, f)) for root, _, files in os.walk(in_dir) for f in files if os.path.splitext(f)[1] == ".py" ) for fpath in ...
[ "def", "fix_files", "(", "in_dir", ":", "pathlib", ".", "Path", ",", "out_dir", ":", "pathlib", ".", "Path", ",", "*", ",", "transformer", "=", "servicemanagementCallTransformer", "(", ")", ",", ")", ":", "pyfile_gen", "=", "(", "pathlib", ".", "Path", "...
Duplicate the input dir to the output dir, fixing file method calls.
[ "Duplicate", "the", "input", "dir", "to", "the", "output", "dir", "fixing", "file", "method", "calls", "." ]
[ "\"\"\"Duplicate the input dir to the output dir, fixing file method calls.\n\n Preconditions:\n * in_dir is a real directory\n * out_dir is a real, empty directory\n \"\"\"", "# Parse the code and insert method call fixes.", "# Create the path and directory structure for the new file.", "# Genera...
[ { "param": "in_dir", "type": "pathlib.Path" }, { "param": "out_dir", "type": "pathlib.Path" }, { "param": "transformer", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "in_dir", "type": "pathlib.Path", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "out_dir", "type": "pathlib.Path", "docstring": null, ...
6c5a7804a07030ea1fa438266f6c572085302203
daniel-s-ingram/osr-rover-code
rover/connections.py
[ "Apache-2.0" ]
Python
_btConnect
null
def _btConnect(self): ''' Initializes the server side for bluetooth communication, with a timeout of 1 second between data from the app ''' server_sock = BluetoothSocket(RFCOMM) server_sock.bind(("",PORT_ANY)) server_sock.listen(1) port = server_sock.getsockname()[1] uuid = self.config['BLUETOOTH_SOCKE...
Initializes the server side for bluetooth communication, with a timeout of 1 second between data from the app
Initializes the server side for bluetooth communication, with a timeout of 1 second between data from the app
[ "Initializes", "the", "server", "side", "for", "bluetooth", "communication", "with", "a", "timeout", "of", "1", "second", "between", "data", "from", "the", "app" ]
def _btConnect(self): server_sock = BluetoothSocket(RFCOMM) server_sock.bind(("",PORT_ANY)) server_sock.listen(1) port = server_sock.getsockname()[1] uuid = self.config['BLUETOOTH_SOCKET_CONFIG']['UUID'] name = self.config['BLUETOOTH_SOCKET_CONFIG']['name'] advertise_service( server_sock, name, s...
[ "def", "_btConnect", "(", "self", ")", ":", "server_sock", "=", "BluetoothSocket", "(", "RFCOMM", ")", "server_sock", ".", "bind", "(", "(", "\"\"", ",", "PORT_ANY", ")", ")", "server_sock", ".", "listen", "(", "1", ")", "port", "=", "server_sock", ".", ...
Initializes the server side for bluetooth communication, with a timeout of 1 second between data from the app
[ "Initializes", "the", "server", "side", "for", "bluetooth", "communication", "with", "a", "timeout", "of", "1", "second", "between", "data", "from", "the", "app" ]
[ "'''\n\t\tInitializes the server side for bluetooth communication, with a timeout of 1 second between data from the app\n\t\t'''" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
6c5a7804a07030ea1fa438266f6c572085302203
daniel-s-ingram/osr-rover-code
rover/connections.py
[ "Apache-2.0" ]
Python
_xBoxConnect
null
def _xBoxConnect(self): ''' Initializes a listener for the Xbox controller ''' self.joy = xbox.Joystick() print 'Waiting on Xbox connect' while not self.joy.connected(): time.sleep(1) print 'Accepted connection from Xbox controller', self.joy.connected()
Initializes a listener for the Xbox controller
Initializes a listener for the Xbox controller
[ "Initializes", "a", "listener", "for", "the", "Xbox", "controller" ]
def _xBoxConnect(self): self.joy = xbox.Joystick() print 'Waiting on Xbox connect' while not self.joy.connected(): time.sleep(1) print 'Accepted connection from Xbox controller', self.joy.connected()
[ "def", "_xBoxConnect", "(", "self", ")", ":", "self", ".", "joy", "=", "xbox", ".", "Joystick", "(", ")", "print", "'Waiting on Xbox connect'", "while", "not", "self", ".", "joy", ".", "connected", "(", ")", ":", "time", ".", "sleep", "(", "1", ")", ...
Initializes a listener for the Xbox controller
[ "Initializes", "a", "listener", "for", "the", "Xbox", "controller" ]
[ "'''\n\t\tInitializes a listener for the Xbox controller\n\t\t'''" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
6c5a7804a07030ea1fa438266f6c572085302203
daniel-s-ingram/osr-rover-code
rover/connections.py
[ "Apache-2.0" ]
Python
_btVals
<not_specific>
def _btVals(self): ''' Parses values from the bluetooth app as drive, turning, and LED screen commands these values should be: v: [-100,100] r: [-100,100] led: [0-3] ''' try: sockData = self.bt_sock.recv(1024) v,s,c = ord(sockData[3]),ord(sockData[7]),ord(sockData[-1]) self.led = ord(sockData...
Parses values from the bluetooth app as drive, turning, and LED screen commands these values should be: v: [-100,100] r: [-100,100] led: [0-3]
Parses values from the bluetooth app as drive, turning, and LED screen commands these values should be.
[ "Parses", "values", "from", "the", "bluetooth", "app", "as", "drive", "turning", "and", "LED", "screen", "commands", "these", "values", "should", "be", "." ]
def _btVals(self): try: sockData = self.bt_sock.recv(1024) v,s,c = ord(sockData[3]),ord(sockData[7]),ord(sockData[-1]) self.led = ord(sockData[11]) self.bt_sock.send('1') return (v-100,s-100) except: pass
[ "def", "_btVals", "(", "self", ")", ":", "try", ":", "sockData", "=", "self", ".", "bt_sock", ".", "recv", "(", "1024", ")", "v", ",", "s", ",", "c", "=", "ord", "(", "sockData", "[", "3", "]", ")", ",", "ord", "(", "sockData", "[", "7", "]",...
Parses values from the bluetooth app as drive, turning, and LED screen commands these values should be:
[ "Parses", "values", "from", "the", "bluetooth", "app", "as", "drive", "turning", "and", "LED", "screen", "commands", "these", "values", "should", "be", ":" ]
[ "'''\n\t\tParses values from the bluetooth app as drive, turning, and LED screen commands\n\t\tthese values should be:\n\n\t\tv: [-100,100]\n\t\tr: [-100,100]\n\t\tled: [0-3]\n\n\t\t'''" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
6c5a7804a07030ea1fa438266f6c572085302203
daniel-s-ingram/osr-rover-code
rover/connections.py
[ "Apache-2.0" ]
Python
_xboxVals
<not_specific>
def _xboxVals(self): ''' Parses values from the Xbox controller. By default the speed is halved, and the "A" button is used as a boost button. The D-pad controls the LED screen ''' if self.joy.connected(): if self.joy.dpadUp(): self.led = 0 elif self.joy.dpadRight(): self.led = 1 elif self.joy...
Parses values from the Xbox controller. By default the speed is halved, and the "A" button is used as a boost button. The D-pad controls the LED screen
Parses values from the Xbox controller. By default the speed is halved, and the "A" button is used as a boost button. The D-pad controls the LED screen
[ "Parses", "values", "from", "the", "Xbox", "controller", ".", "By", "default", "the", "speed", "is", "halved", "and", "the", "\"", "A", "\"", "button", "is", "used", "as", "a", "boost", "button", ".", "The", "D", "-", "pad", "controls", "the", "LED", ...
def _xboxVals(self): if self.joy.connected(): if self.joy.dpadUp(): self.led = 0 elif self.joy.dpadRight(): self.led = 1 elif self.joy.dpadDown(): self.led = 2 elif self.joy.dpadLeft(): self.led = 3 v,r = int(self.joy.leftY()*50),int(self.joy.rightX()*100) if self.joy.A(): v *= 2 return (v...
[ "def", "_xboxVals", "(", "self", ")", ":", "if", "self", ".", "joy", ".", "connected", "(", ")", ":", "if", "self", ".", "joy", ".", "dpadUp", "(", ")", ":", "self", ".", "led", "=", "0", "elif", "self", ".", "joy", ".", "dpadRight", "(", ")", ...
Parses values from the Xbox controller.
[ "Parses", "values", "from", "the", "Xbox", "controller", "." ]
[ "'''\n\t\tParses values from the Xbox controller. By default the speed is halved, and the \"A\" button\n\t\tis used as a boost button. The D-pad controls the LED screen\n\n\t\t'''" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
6c5a7804a07030ea1fa438266f6c572085302203
daniel-s-ingram/osr-rover-code
rover/connections.py
[ "Apache-2.0" ]
Python
unixSockConnect
null
def unixSockConnect(self): ''' Connects to a unix socket from the process running the LED screen, which expects values of strings [0-3] ''' if os.path.exists(self.config['UNIX_SOCKET_CONFIG']['path']) : client = socket.socket(socket.AF_UNIX,socket.SOCK_DGRAM) client.connect(self.config['UNIX_SOCKET_CON...
Connects to a unix socket from the process running the LED screen, which expects values of strings [0-3]
Connects to a unix socket from the process running the LED screen, which expects values of strings [0-3]
[ "Connects", "to", "a", "unix", "socket", "from", "the", "process", "running", "the", "LED", "screen", "which", "expects", "values", "of", "strings", "[", "0", "-", "3", "]" ]
def unixSockConnect(self): if os.path.exists(self.config['UNIX_SOCKET_CONFIG']['path']) : client = socket.socket(socket.AF_UNIX,socket.SOCK_DGRAM) client.connect(self.config['UNIX_SOCKET_CONFIG']['path']) self.unix_sock = client print "Sucessfully connected to Unix Socket at: ", self.config['UNIX_SOCKET_C...
[ "def", "unixSockConnect", "(", "self", ")", ":", "if", "os", ".", "path", ".", "exists", "(", "self", ".", "config", "[", "'UNIX_SOCKET_CONFIG'", "]", "[", "'path'", "]", ")", ":", "client", "=", "socket", ".", "socket", "(", "socket", ".", "AF_UNIX", ...
Connects to a unix socket from the process running the LED screen, which expects values of strings [0-3]
[ "Connects", "to", "a", "unix", "socket", "from", "the", "process", "running", "the", "LED", "screen", "which", "expects", "values", "of", "strings", "[", "0", "-", "3", "]" ]
[ "'''\n\t\tConnects to a unix socket from the process running the LED screen, which expects\n\t\tvalues of strings [0-3]\n\n\t\t'''" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
6c5a7804a07030ea1fa438266f6c572085302203
daniel-s-ingram/osr-rover-code
rover/connections.py
[ "Apache-2.0" ]
Python
connectController
<not_specific>
def connectController(self): ''' Connects to a controller based on what type it is told from command line arg :param str type: The tpye of controller being connected, b (default) for bluetooth app and x for xbox controller ''' if self.connection_type == "b": self._btConnect() elif self.connecti...
Connects to a controller based on what type it is told from command line arg :param str type: The tpye of controller being connected, b (default) for bluetooth app and x for xbox controller
Connects to a controller based on what type it is told from command line arg
[ "Connects", "to", "a", "controller", "based", "on", "what", "type", "it", "is", "told", "from", "command", "line", "arg" ]
def connectController(self): if self.connection_type == "b": self._btConnect() elif self.connection_type == "x": self._xBoxConnect() else: return -1
[ "def", "connectController", "(", "self", ")", ":", "if", "self", ".", "connection_type", "==", "\"b\"", ":", "self", ".", "_btConnect", "(", ")", "elif", "self", ".", "connection_type", "==", "\"x\"", ":", "self", ".", "_xBoxConnect", "(", ")", "else", "...
Connects to a controller based on what type it is told from command line arg
[ "Connects", "to", "a", "controller", "based", "on", "what", "type", "it", "is", "told", "from", "command", "line", "arg" ]
[ "'''\n\t\tConnects to a controller based on what type it is told from command line arg\n\n\t\t:param str type: The tpye of controller being connected, b (default) for \n\t\t\t\t\t\t\tbluetooth app and x for xbox controller \n\n\t\t'''" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [ { "identifier": "type", "type": null, "docstring": "The tp...
6c5a7804a07030ea1fa438266f6c572085302203
daniel-s-ingram/osr-rover-code
rover/connections.py
[ "Apache-2.0" ]
Python
sendUnixData
null
def sendUnixData(self): ''' Sends the LED screen process commands for the face over unix socket ''' self.unix_sock.send(str(self.led))
Sends the LED screen process commands for the face over unix socket
Sends the LED screen process commands for the face over unix socket
[ "Sends", "the", "LED", "screen", "process", "commands", "for", "the", "face", "over", "unix", "socket" ]
def sendUnixData(self): self.unix_sock.send(str(self.led))
[ "def", "sendUnixData", "(", "self", ")", ":", "self", ".", "unix_sock", ".", "send", "(", "str", "(", "self", ".", "led", ")", ")" ]
Sends the LED screen process commands for the face over unix socket
[ "Sends", "the", "LED", "screen", "process", "commands", "for", "the", "face", "over", "unix", "socket" ]
[ "'''\n\t\tSends the LED screen process commands for the face over unix socket\n\t\t'''" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
6c5a7804a07030ea1fa438266f6c572085302203
daniel-s-ingram/osr-rover-code
rover/connections.py
[ "Apache-2.0" ]
Python
closeConnections
null
def closeConnections(self): ''' Closes all the connections opened by the Rover ''' if self.connection_type == 'b': try: self.bt_sock.send('0') time.sleep(0.25) self.bt_sock.close() except: pass elif self.connection_type == 'x': self.joy.close() if self.unix_sock != None: self.u...
Closes all the connections opened by the Rover
Closes all the connections opened by the Rover
[ "Closes", "all", "the", "connections", "opened", "by", "the", "Rover" ]
def closeConnections(self): if self.connection_type == 'b': try: self.bt_sock.send('0') time.sleep(0.25) self.bt_sock.close() except: pass elif self.connection_type == 'x': self.joy.close() if self.unix_sock != None: self.unix_sock.close()
[ "def", "closeConnections", "(", "self", ")", ":", "if", "self", ".", "connection_type", "==", "'b'", ":", "try", ":", "self", ".", "bt_sock", ".", "send", "(", "'0'", ")", "time", ".", "sleep", "(", "0.25", ")", "self", ".", "bt_sock", ".", "close", ...
Closes all the connections opened by the Rover
[ "Closes", "all", "the", "connections", "opened", "by", "the", "Rover" ]
[ "'''\n\t\tCloses all the connections opened by the Rover\n\t\t'''" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
626a9a950b70576192f204de540d656194d18233
daniel-s-ingram/osr-rover-code
rover/motor_controller.py
[ "Apache-2.0" ]
Python
cornerToPosition
null
def cornerToPosition(self,tick): ''' Method to send position commands to the corner motor :param list tick: A list of ticks for each of the corner motors to move to, if tick[i] is 0 it instead stops that motor from moving ''' speed, accel = 1000,2000 #These values could potentially need tuning ...
Method to send position commands to the corner motor :param list tick: A list of ticks for each of the corner motors to move to, if tick[i] is 0 it instead stops that motor from moving
Method to send position commands to the corner motor
[ "Method", "to", "send", "position", "commands", "to", "the", "corner", "motor" ]
def cornerToPosition(self,tick): speed, accel = 1000,2000 self.errorCheck() for i in range(4): index = int(math.ceil((i+1)/2.0)+2) if tick[i]: if (i % 2): self.rc.SpeedAccelDeccelPositionM2(self.address[index],accel,speed,accel,tick[i],1) else: self.rc.SpeedAccelDeccelPositionM1(...
[ "def", "cornerToPosition", "(", "self", ",", "tick", ")", ":", "speed", ",", "accel", "=", "1000", ",", "2000", "self", ".", "errorCheck", "(", ")", "for", "i", "in", "range", "(", "4", ")", ":", "index", "=", "int", "(", "math", ".", "ceil", "("...
Method to send position commands to the corner motor
[ "Method", "to", "send", "position", "commands", "to", "the", "corner", "motor" ]
[ "'''\n\t\tMethod to send position commands to the corner motor\n\n\t\t:param list tick: A list of ticks for each of the corner motors to\n\t\tmove to, if tick[i] is 0 it instead stops that motor from moving\n\n\t\t'''", "#These values could potentially need tuning still" ]
[ { "param": "self", "type": null }, { "param": "tick", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "tick", "type": null, "docstring": "A list of ticks for each of the ...
626a9a950b70576192f204de540d656194d18233
daniel-s-ingram/osr-rover-code
rover/motor_controller.py
[ "Apache-2.0" ]
Python
sendMotorDuty
<not_specific>
def sendMotorDuty(self, motorID, speed): ''' Wrapper method for an easier interface to control the drive motors, sends open-loop commands to the motors :param int motorID: number that corresponds to each physical motor :param int speed: Speed for each motor, range from 0-127 ''' self.errorCheck() a...
Wrapper method for an easier interface to control the drive motors, sends open-loop commands to the motors :param int motorID: number that corresponds to each physical motor :param int speed: Speed for each motor, range from 0-127
Wrapper method for an easier interface to control the drive motors, sends open-loop commands to the motors
[ "Wrapper", "method", "for", "an", "easier", "interface", "to", "control", "the", "drive", "motors", "sends", "open", "-", "loop", "commands", "to", "the", "motors" ]
def sendMotorDuty(self, motorID, speed): self.errorCheck() addr = self.address[int(motorID/2)] if speed > 0: if not motorID % 2: command = self.rc.ForwardM1 else: command = self.rc.ForwardM2 else: if not motorID % 2: command = self.rc.BackwardM1 else: command = self.rc....
[ "def", "sendMotorDuty", "(", "self", ",", "motorID", ",", "speed", ")", ":", "self", ".", "errorCheck", "(", ")", "addr", "=", "self", ".", "address", "[", "int", "(", "motorID", "/", "2", ")", "]", "if", "speed", ">", "0", ":", "if", "not", "mot...
Wrapper method for an easier interface to control the drive motors, sends open-loop commands to the motors
[ "Wrapper", "method", "for", "an", "easier", "interface", "to", "control", "the", "drive", "motors", "sends", "open", "-", "loop", "commands", "to", "the", "motors" ]
[ "'''\n\t\tWrapper method for an easier interface to control the drive motors,\n\t\t\n\t\tsends open-loop commands to the motors\n\n\t\t:param int motorID: number that corresponds to each physical motor\n\t\t:param int speed: Speed for each motor, range from 0-127\n\n\t\t'''" ]
[ { "param": "self", "type": null }, { "param": "motorID", "type": null }, { "param": "speed", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "motorID", "type": null, "docstring": "number that corresponds to ea...
626a9a950b70576192f204de540d656194d18233
daniel-s-ingram/osr-rover-code
rover/motor_controller.py
[ "Apache-2.0" ]
Python
errorCheck
<not_specific>
def errorCheck(self): ''' Checks error status of each motor controller, returns 0 if any errors occur ''' for i in range(5): self.err[i] = self.rc.ReadError(self.address[i])[1] for error in self.err: if error: self.killMotors() self.writeError() raise Exception("Motor controller Error", err...
Checks error status of each motor controller, returns 0 if any errors occur
Checks error status of each motor controller, returns 0 if any errors occur
[ "Checks", "error", "status", "of", "each", "motor", "controller", "returns", "0", "if", "any", "errors", "occur" ]
def errorCheck(self): for i in range(5): self.err[i] = self.rc.ReadError(self.address[i])[1] for error in self.err: if error: self.killMotors() self.writeError() raise Exception("Motor controller Error", error) return 1
[ "def", "errorCheck", "(", "self", ")", ":", "for", "i", "in", "range", "(", "5", ")", ":", "self", ".", "err", "[", "i", "]", "=", "self", ".", "rc", ".", "ReadError", "(", "self", ".", "address", "[", "i", "]", ")", "[", "1", "]", "for", "...
Checks error status of each motor controller, returns 0 if any errors occur
[ "Checks", "error", "status", "of", "each", "motor", "controller", "returns", "0", "if", "any", "errors", "occur" ]
[ "'''\n\t\tChecks error status of each motor controller, returns 0 if any errors occur\n\t\t'''" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
e50df57260ce0489005c1e2d9c03c84c0f298389
daniel-s-ingram/osr-rover-code
rover/osr.py
[ "Apache-2.0" ]
Python
drive
null
def drive(self): ''' Takes drive commands and sends them to the robot ''' cmds = self.getDriveVals() if cmds != self.prev_cmd: #if no new command don't send commands to robot self.sendCommands(cmds[0],cmds[1]) self.prev_cmd = cmds else: #still monitor the corners to reduc...
Takes drive commands and sends them to the robot
Takes drive commands and sends them to the robot
[ "Takes", "drive", "commands", "and", "sends", "them", "to", "the", "robot" ]
def drive(self): cmds = self.getDriveVals() if cmds != self.prev_cmd: self.sendCommands(cmds[0],cmds[1]) self.prev_cmd = cmds else: self.cornerPosControl(self.calculateTargetDeg(cmds[1])) if self.unix_flag: self.sendFaceCmd()
[ "def", "drive", "(", "self", ")", ":", "cmds", "=", "self", ".", "getDriveVals", "(", ")", "if", "cmds", "!=", "self", ".", "prev_cmd", ":", "self", ".", "sendCommands", "(", "cmds", "[", "0", "]", ",", "cmds", "[", "1", "]", ")", "self", ".", ...
Takes drive commands and sends them to the robot
[ "Takes", "drive", "commands", "and", "sends", "them", "to", "the", "robot" ]
[ "'''\n\t\tTakes drive commands and sends them to the robot\n\t\t\n\t\t'''", "#if no new command don't send commands to robot", "#still monitor the corners to reduce jitter though" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
e50df57260ce0489005c1e2d9c03c84c0f298389
daniel-s-ingram/osr-rover-code
rover/osr.py
[ "Apache-2.0" ]
Python
sendFaceCmd
null
def sendFaceCmd(self): ''' Attempts to send commands to the LED screen over unix socket ''' try: self.sendUnixData() except Exception as e: print e self.unix_flag = 0
Attempts to send commands to the LED screen over unix socket
Attempts to send commands to the LED screen over unix socket
[ "Attempts", "to", "send", "commands", "to", "the", "LED", "screen", "over", "unix", "socket" ]
def sendFaceCmd(self): try: self.sendUnixData() except Exception as e: print e self.unix_flag = 0
[ "def", "sendFaceCmd", "(", "self", ")", ":", "try", ":", "self", ".", "sendUnixData", "(", ")", "except", "Exception", "as", "e", ":", "print", "e", "self", ".", "unix_flag", "=", "0" ]
Attempts to send commands to the LED screen over unix socket
[ "Attempts", "to", "send", "commands", "to", "the", "LED", "screen", "over", "unix", "socket" ]
[ "'''\n\t\tAttempts to send commands to the LED screen over unix socket\n\t\t\n\t\t'''" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
e50df57260ce0489005c1e2d9c03c84c0f298389
daniel-s-ingram/osr-rover-code
rover/osr.py
[ "Apache-2.0" ]
Python
cleanup
null
def cleanup(self): ''' Cleanup method for closing connections, and stopping the motors ''' self.killMotors() self.closeConnections()
Cleanup method for closing connections, and stopping the motors
Cleanup method for closing connections, and stopping the motors
[ "Cleanup", "method", "for", "closing", "connections", "and", "stopping", "the", "motors" ]
def cleanup(self): self.killMotors() self.closeConnections()
[ "def", "cleanup", "(", "self", ")", ":", "self", ".", "killMotors", "(", ")", "self", ".", "closeConnections", "(", ")" ]
Cleanup method for closing connections, and stopping the motors
[ "Cleanup", "method", "for", "closing", "connections", "and", "stopping", "the", "motors" ]
[ "'''\n\t\tCleanup method for closing connections, and stopping the motors\n\t\t\n\t\t'''" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
dd16e733afe314eb3d3e0e449eaec009fa397109
daniel-s-ingram/osr-rover-code
rover/robot.py
[ "Apache-2.0" ]
Python
deg2tick
<not_specific>
def deg2tick(deg,e_min,e_max): ''' Converts a degrees to tick value :param int deg : Degrees value desired :param int e_min: The minimum encoder value based on physical stop :param int e_max: The maximum encoder value based on physical stop ''' return (e_max + e_min)/2 + ((e_max - e_min)/90)*deg
Converts a degrees to tick value :param int deg : Degrees value desired :param int e_min: The minimum encoder value based on physical stop :param int e_max: The maximum encoder value based on physical stop
Converts a degrees to tick value
[ "Converts", "a", "degrees", "to", "tick", "value" ]
def deg2tick(deg,e_min,e_max): return (e_max + e_min)/2 + ((e_max - e_min)/90)*deg
[ "def", "deg2tick", "(", "deg", ",", "e_min", ",", "e_max", ")", ":", "return", "(", "e_max", "+", "e_min", ")", "/", "2", "+", "(", "(", "e_max", "-", "e_min", ")", "/", "90", ")", "*", "deg" ]
Converts a degrees to tick value
[ "Converts", "a", "degrees", "to", "tick", "value" ]
[ "'''\n\t\tConverts a degrees to tick value\n\t\t\n\t\t:param int deg : Degrees value desired\n\t\t:param int e_min: The minimum encoder value based on physical stop\n\t\t:param int e_max: The maximum encoder value based on physical stop\n\t\t\n\t\t'''" ]
[ { "param": "deg", "type": null }, { "param": "e_min", "type": null }, { "param": "e_max", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "deg", "type": null, "docstring": "Degrees value desired", "docstring_tokens": [ "Degrees", "value", "desired" ], "default": null, "is_optional": false }, { "identifier": ...
dd16e733afe314eb3d3e0e449eaec009fa397109
daniel-s-ingram/osr-rover-code
rover/robot.py
[ "Apache-2.0" ]
Python
calculateTargetDeg
<not_specific>
def calculateTargetDeg(self,radius): ''' Takes a turning radius and calculates what angle [degrees] each corner should be at :param int radius: Radius drive command, ranges from -100 (turning left) to 100 (turning right) ''' #Scaled from 250 to 20 inches. For more information on these numbers look at the So...
Takes a turning radius and calculates what angle [degrees] each corner should be at :param int radius: Radius drive command, ranges from -100 (turning left) to 100 (turning right)
Takes a turning radius and calculates what angle [degrees] each corner should be at
[ "Takes", "a", "turning", "radius", "and", "calculates", "what", "angle", "[", "degrees", "]", "each", "corner", "should", "be", "at" ]
def calculateTargetDeg(self,radius): if radius == 0: r = 250 elif -100 <= radius <= 100: r = 220 - abs(radius)*(250/100) else: r = 250 if r == 250: return [0]*4 ang1 = int(math.degrees(math.atan(self.d1/(abs(r)+self.d3)))) ang2 = int(math.degrees(math.atan(self.d2/(abs(r)+self.d3)))) ang3 = int(math.degre...
[ "def", "calculateTargetDeg", "(", "self", ",", "radius", ")", ":", "if", "radius", "==", "0", ":", "r", "=", "250", "elif", "-", "100", "<=", "radius", "<=", "100", ":", "r", "=", "220", "-", "abs", "(", "radius", ")", "*", "(", "250", "/", "10...
Takes a turning radius and calculates what angle [degrees] each corner should be at
[ "Takes", "a", "turning", "radius", "and", "calculates", "what", "angle", "[", "degrees", "]", "each", "corner", "should", "be", "at" ]
[ "'''\n\t\tTakes a turning radius and calculates what angle [degrees] each corner should be at\n\n\t\t:param int radius: Radius drive command, ranges from -100 (turning left) to 100 (turning right)\n\n\t\t'''", "#Scaled from 250 to 20 inches. For more information on these numbers look at the Software Controls.pdf"...
[ { "param": "self", "type": null }, { "param": "radius", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "radius", "type": null, "docstring": "Radius drive command, ranges f...
dd16e733afe314eb3d3e0e449eaec009fa397109
daniel-s-ingram/osr-rover-code
rover/robot.py
[ "Apache-2.0" ]
Python
approxTurningRadius
<not_specific>
def approxTurningRadius(self,enc): ''' Takes the list of current corner angles and approximates the current turning radius [inches] :param list [int] enc: List of encoder ticks for each corner motor ''' if enc[0] == None: return 250 try: if enc[0] > 0: r1 = (self.d1/math.tan(math.radians(abs(enc...
Takes the list of current corner angles and approximates the current turning radius [inches] :param list [int] enc: List of encoder ticks for each corner motor
Takes the list of current corner angles and approximates the current turning radius [inches] :param list [int] enc: List of encoder ticks for each corner motor
[ "Takes", "the", "list", "of", "current", "corner", "angles", "and", "approximates", "the", "current", "turning", "radius", "[", "inches", "]", ":", "param", "list", "[", "int", "]", "enc", ":", "List", "of", "encoder", "ticks", "for", "each", "corner", "...
def approxTurningRadius(self,enc): if enc[0] == None: return 250 try: if enc[0] > 0: r1 = (self.d1/math.tan(math.radians(abs(enc[0])))) + self.d3 r2 = (self.d2/math.tan(math.radians(abs(enc[1])))) + self.d3 r3 = (self.d2/math.tan(math.radians(abs(enc[2])))) - self.d3 r4 = (self.d1/math.tan(mat...
[ "def", "approxTurningRadius", "(", "self", ",", "enc", ")", ":", "if", "enc", "[", "0", "]", "==", "None", ":", "return", "250", "try", ":", "if", "enc", "[", "0", "]", ">", "0", ":", "r1", "=", "(", "self", ".", "d1", "/", "math", ".", "tan"...
Takes the list of current corner angles and approximates the current turning radius [inches] :param list [int] enc: List of encoder ticks for each corner motor
[ "Takes", "the", "list", "of", "current", "corner", "angles", "and", "approximates", "the", "current", "turning", "radius", "[", "inches", "]", ":", "param", "list", "[", "int", "]", "enc", ":", "List", "of", "encoder", "ticks", "for", "each", "corner", "...
[ "'''\n\t\tTakes the list of current corner angles and approximates the current turning radius [inches]\n\n\t\t:param list [int] enc: List of encoder ticks for each corner motor\n\n\t\t'''" ]
[ { "param": "self", "type": null }, { "param": "enc", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "enc", "type": null, "docstring": null, "docstring_tokens": []...
dd16e733afe314eb3d3e0e449eaec009fa397109
daniel-s-ingram/osr-rover-code
rover/robot.py
[ "Apache-2.0" ]
Python
cornerPosControl
null
def cornerPosControl(self, tar_enc): ''' Takes the target angle and gets what encoder tick that value is for position control :param list [int] tar_enc: List of target angles in degrees for each corner ''' tick = [] for i in range(4): tick.append(self.deg2tick(tar_enc[i],self.enc_min[i],self.enc_max[i])...
Takes the target angle and gets what encoder tick that value is for position control :param list [int] tar_enc: List of target angles in degrees for each corner
Takes the target angle and gets what encoder tick that value is for position control :param list [int] tar_enc: List of target angles in degrees for each corner
[ "Takes", "the", "target", "angle", "and", "gets", "what", "encoder", "tick", "that", "value", "is", "for", "position", "control", ":", "param", "list", "[", "int", "]", "tar_enc", ":", "List", "of", "target", "angles", "in", "degrees", "for", "each", "co...
def cornerPosControl(self, tar_enc): tick = [] for i in range(4): tick.append(self.deg2tick(tar_enc[i],self.enc_min[i],self.enc_max[i])) enc = self.getCornerEnc() for i in range(4): if abs(tick[i] - enc[i]) < 30: tick[i] = 0 self.cornerToPosition(tick)
[ "def", "cornerPosControl", "(", "self", ",", "tar_enc", ")", ":", "tick", "=", "[", "]", "for", "i", "in", "range", "(", "4", ")", ":", "tick", ".", "append", "(", "self", ".", "deg2tick", "(", "tar_enc", "[", "i", "]", ",", "self", ".", "enc_min...
Takes the target angle and gets what encoder tick that value is for position control :param list [int] tar_enc: List of target angles in degrees for each corner
[ "Takes", "the", "target", "angle", "and", "gets", "what", "encoder", "tick", "that", "value", "is", "for", "position", "control", ":", "param", "list", "[", "int", "]", "tar_enc", ":", "List", "of", "target", "angles", "in", "degrees", "for", "each", "co...
[ "'''\n\t\tTakes the target angle and gets what encoder tick that value is for position control\n\n\t\t:param list [int] tar_enc: List of target angles in degrees for each corner\n\t\t'''", "# stopping the motor when it is close to target reduced motor jitter" ]
[ { "param": "self", "type": null }, { "param": "tar_enc", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "tar_enc", "type": null, "docstring": null, "docstring_tokens"...
dd16e733afe314eb3d3e0e449eaec009fa397109
daniel-s-ingram/osr-rover-code
rover/robot.py
[ "Apache-2.0" ]
Python
sendCommands
null
def sendCommands(self,v,r): ''' Driving method for the Rover, rover will not do any commands if any motor controller throws an error :param int v: driving velocity command, % based from -100 (backward) to 100 (forward) :param int r: driving turning radius command, % based from -100 (left) to 100 (right) '...
Driving method for the Rover, rover will not do any commands if any motor controller throws an error :param int v: driving velocity command, % based from -100 (backward) to 100 (forward) :param int r: driving turning radius command, % based from -100 (left) to 100 (right)
Driving method for the Rover, rover will not do any commands if any motor controller throws an error
[ "Driving", "method", "for", "the", "Rover", "rover", "will", "not", "do", "any", "commands", "if", "any", "motor", "controller", "throws", "an", "error" ]
def sendCommands(self,v,r): current_radius = self.approxTurningRadius(self.getCornerDeg()) velocity = self.calculateVelocity(v,current_radius) self.cornerPosControl(self.calculateTargetDeg(r)) for i in range(6): self.sendMotorDuty(i,velocity[i])
[ "def", "sendCommands", "(", "self", ",", "v", ",", "r", ")", ":", "current_radius", "=", "self", ".", "approxTurningRadius", "(", "self", ".", "getCornerDeg", "(", ")", ")", "velocity", "=", "self", ".", "calculateVelocity", "(", "v", ",", "current_radius"...
Driving method for the Rover, rover will not do any commands if any motor controller throws an error
[ "Driving", "method", "for", "the", "Rover", "rover", "will", "not", "do", "any", "commands", "if", "any", "motor", "controller", "throws", "an", "error" ]
[ "'''\n\t\tDriving method for the Rover, rover will not do any commands if any motor controller\n\t\tthrows an error\n\n\t\t:param int v: driving velocity command, % based from -100 (backward) to 100 (forward)\n\t\t:param int r: driving turning radius command, % based from -100 (left) to 100 (right)\n\n\t\t'''" ]
[ { "param": "self", "type": null }, { "param": "v", "type": null }, { "param": "r", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "v", "type": null, "docstring": "driving velocity command, % based f...
736a6d6ab819930b6827630210aba1bc61167fd5
wangcunxiang/Can_PLM_Server_as_KB
simpletransformers/language_modeling/language_modeling_model.py
[ "Apache-2.0" ]
Python
train_model
null
def train_model( self, train_file, output_dir=None, show_running_loss=True, args=None, eval_file=None, verbose=True, **kwargs, ): """ Trains the model using 'train_file' Args: train_file: Path to text file containing the text to train the language model on. o...
Trains the model using 'train_file' Args: train_file: Path to text file containing the text to train the language model on. output_dir: The directory where model files will be saved. If not given, self.args.output_dir will be used. show_running_loss (optional): Set ...
Trains the model using 'train_file'
[ "Trains", "the", "model", "using", "'", "train_file", "'" ]
def train_model( self, train_file, output_dir=None, show_running_loss=True, args=None, eval_file=None, verbose=True, **kwargs, ): if args: self.args.update_from_dict(args) if self.args.silent: show_running_loss = False if self.args.evaluate_during_training and...
[ "def", "train_model", "(", "self", ",", "train_file", ",", "output_dir", "=", "None", ",", "show_running_loss", "=", "True", ",", "args", "=", "None", ",", "eval_file", "=", "None", ",", "verbose", "=", "True", ",", "**", "kwargs", ",", ")", ":", "if",...
Trains the model using 'train_file'
[ "Trains", "the", "model", "using", "'", "train_file", "'" ]
[ "\"\"\"\n Trains the model using 'train_file'\n\n Args:\n train_file: Path to text file containing the text to train the language model on.\n output_dir: The directory where model files will be saved. If not given, self.args.output_dir will be used.\n show_running_loss...
[ { "param": "self", "type": null }, { "param": "train_file", "type": null }, { "param": "output_dir", "type": null }, { "param": "show_running_loss", "type": null }, { "param": "args", "type": null }, { "param": "eval_file", "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 ...
736a6d6ab819930b6827630210aba1bc61167fd5
wangcunxiang/Can_PLM_Server_as_KB
simpletransformers/language_modeling/language_modeling_model.py
[ "Apache-2.0" ]
Python
eval_model
<not_specific>
def eval_model(self, eval_file, output_dir=None, verbose=True, silent=False, **kwargs): """ Evaluates the model on eval_df. Saves results to args.output_dir result: Dictionary containing evaluation results. """ # noqa: ignore flake8" if not output_dir: output_di...
Evaluates the model on eval_df. Saves results to args.output_dir result: Dictionary containing evaluation results.
Evaluates the model on eval_df. Saves results to args.output_dir result: Dictionary containing evaluation results.
[ "Evaluates", "the", "model", "on", "eval_df", ".", "Saves", "results", "to", "args", ".", "output_dir", "result", ":", "Dictionary", "containing", "evaluation", "results", "." ]
def eval_model(self, eval_file, output_dir=None, verbose=True, silent=False, **kwargs): if not output_dir: output_dir = self.args.output_dir self._move_model_to_device() eval_dataset = self.load_and_cache_examples(eval_file, evaluate=True, verbose=verbose, silent=silent) os.m...
[ "def", "eval_model", "(", "self", ",", "eval_file", ",", "output_dir", "=", "None", ",", "verbose", "=", "True", ",", "silent", "=", "False", ",", "**", "kwargs", ")", ":", "if", "not", "output_dir", ":", "output_dir", "=", "self", ".", "args", ".", ...
Evaluates the model on eval_df.
[ "Evaluates", "the", "model", "on", "eval_df", "." ]
[ "\"\"\"\n Evaluates the model on eval_df. Saves results to args.output_dir\n result: Dictionary containing evaluation results.\n \"\"\"", "# noqa: ignore flake8\"" ]
[ { "param": "self", "type": null }, { "param": "eval_file", "type": null }, { "param": "output_dir", "type": null }, { "param": "verbose", "type": null }, { "param": "silent", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "eval_file", "type": null, "docstring": null, "docstring_token...
736a6d6ab819930b6827630210aba1bc61167fd5
wangcunxiang/Can_PLM_Server_as_KB
simpletransformers/language_modeling/language_modeling_model.py
[ "Apache-2.0" ]
Python
evaluate
<not_specific>
def evaluate(self, eval_dataset, output_dir, multi_label=False, prefix="", verbose=True, silent=False, **kwargs): """ Evaluates the model on eval_dataset. Utility function to be used by the eval_model() method. Not intended to be used directly. """ model = self.model ar...
Evaluates the model on eval_dataset. Utility function to be used by the eval_model() method. Not intended to be used directly.
Evaluates the model on eval_dataset. Utility function to be used by the eval_model() method. Not intended to be used directly.
[ "Evaluates", "the", "model", "on", "eval_dataset", ".", "Utility", "function", "to", "be", "used", "by", "the", "eval_model", "()", "method", ".", "Not", "intended", "to", "be", "used", "directly", "." ]
def evaluate(self, eval_dataset, output_dir, multi_label=False, prefix="", verbose=True, silent=False, **kwargs): model = self.model args = self.args eval_output_dir = output_dir tokenizer = self.tokenizer results = {} def collate(examples: List[torch.Tensor]): ...
[ "def", "evaluate", "(", "self", ",", "eval_dataset", ",", "output_dir", ",", "multi_label", "=", "False", ",", "prefix", "=", "\"\"", ",", "verbose", "=", "True", ",", "silent", "=", "False", ",", "**", "kwargs", ")", ":", "model", "=", "self", ".", ...
Evaluates the model on eval_dataset.
[ "Evaluates", "the", "model", "on", "eval_dataset", "." ]
[ "\"\"\"\n Evaluates the model on eval_dataset.\n\n Utility function to be used by the eval_model() method. Not intended to be used directly.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "eval_dataset", "type": null }, { "param": "output_dir", "type": null }, { "param": "multi_label", "type": null }, { "param": "prefix", "type": null }, { "param": "verbose", "type": null }, { "p...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "eval_dataset", "type": null, "docstring": null, "docstring_to...
736a6d6ab819930b6827630210aba1bc61167fd5
wangcunxiang/Can_PLM_Server_as_KB
simpletransformers/language_modeling/language_modeling_model.py
[ "Apache-2.0" ]
Python
load_and_cache_examples
<not_specific>
def load_and_cache_examples(self, file_path, evaluate=False, no_cache=False, verbose=True, silent=False): """ Reads a text file from file_path and creates training features. Utility function for train() and eval() methods. Not intended to be used directly. """ tokenizer = self....
Reads a text file from file_path and creates training features. Utility function for train() and eval() methods. Not intended to be used directly.
Reads a text file from file_path and creates training features. Utility function for train() and eval() methods. Not intended to be used directly.
[ "Reads", "a", "text", "file", "from", "file_path", "and", "creates", "training", "features", ".", "Utility", "function", "for", "train", "()", "and", "eval", "()", "methods", ".", "Not", "intended", "to", "be", "used", "directly", "." ]
def load_and_cache_examples(self, file_path, evaluate=False, no_cache=False, verbose=True, silent=False): tokenizer = self.tokenizer args = self.args if not no_cache: no_cache = args.no_cache if not no_cache: os.makedirs(self.args.cache_dir, exist_ok=True) ...
[ "def", "load_and_cache_examples", "(", "self", ",", "file_path", ",", "evaluate", "=", "False", ",", "no_cache", "=", "False", ",", "verbose", "=", "True", ",", "silent", "=", "False", ")", ":", "tokenizer", "=", "self", ".", "tokenizer", "args", "=", "s...
Reads a text file from file_path and creates training features.
[ "Reads", "a", "text", "file", "from", "file_path", "and", "creates", "training", "features", "." ]
[ "\"\"\"\n Reads a text file from file_path and creates training features.\n\n Utility function for train() and eval() methods. Not intended to be used directly.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "file_path", "type": null }, { "param": "evaluate", "type": null }, { "param": "no_cache", "type": null }, { "param": "verbose", "type": null }, { "param": "silent", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "file_path", "type": null, "docstring": null, "docstring_token...
736a6d6ab819930b6827630210aba1bc61167fd5
wangcunxiang/Can_PLM_Server_as_KB
simpletransformers/language_modeling/language_modeling_model.py
[ "Apache-2.0" ]
Python
is_world_master
bool
def is_world_master(self) -> bool: """ This will be True only in one process, even in distributed mode, even when training on multiple machines. """ return self.args.local_rank == -1 or torch.distributed.get_rank() == 0
This will be True only in one process, even in distributed mode, even when training on multiple machines.
This will be True only in one process, even in distributed mode, even when training on multiple machines.
[ "This", "will", "be", "True", "only", "in", "one", "process", "even", "in", "distributed", "mode", "even", "when", "training", "on", "multiple", "machines", "." ]
def is_world_master(self) -> bool: return self.args.local_rank == -1 or torch.distributed.get_rank() == 0
[ "def", "is_world_master", "(", "self", ")", "->", "bool", ":", "return", "self", ".", "args", ".", "local_rank", "==", "-", "1", "or", "torch", ".", "distributed", ".", "get_rank", "(", ")", "==", "0" ]
This will be True only in one process, even in distributed mode, even when training on multiple machines.
[ "This", "will", "be", "True", "only", "in", "one", "process", "even", "in", "distributed", "mode", "even", "when", "training", "on", "multiple", "machines", "." ]
[ "\"\"\"\n This will be True only in one process, even in distributed mode,\n even when training on multiple machines.\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
19ced10c3a403663085f69f500f3d1857ce453e9
wangcunxiang/Can_PLM_Server_as_KB
simpletransformers/seq2seq/seq2seq_model.py
[ "Apache-2.0" ]
Python
train_model
null
def train_model( self, train_data, output_dir=None, show_running_loss=True, args=None, eval_data=None, test_data=None, verbose=True, **kwargs, ): """ Trains the model using 'train_data' Args: train_data: Pandas DataFrame containing the 2 columns - `input_text`, `target_t...
Trains the model using 'train_data' Args: train_data: Pandas DataFrame containing the 2 columns - `input_text`, `target_text`. - `input_text`: The input text sequence. - `target_text`: The target text sequence output_dir: The dire...
Trains the model using 'train_data'
[ "Trains", "the", "model", "using", "'", "train_data", "'" ]
def train_model( self, train_data, output_dir=None, show_running_loss=True, args=None, eval_data=None, test_data=None, verbose=True, **kwargs, ): if args: self.args.update_from_dict(args) if self.args.evaluate_during_training and eval_data is None: raise ValueError( ...
[ "def", "train_model", "(", "self", ",", "train_data", ",", "output_dir", "=", "None", ",", "show_running_loss", "=", "True", ",", "args", "=", "None", ",", "eval_data", "=", "None", ",", "test_data", "=", "None", ",", "verbose", "=", "True", ",", "**", ...
Trains the model using 'train_data'
[ "Trains", "the", "model", "using", "'", "train_data", "'" ]
[ "\"\"\"\n Trains the model using 'train_data'\n\n Args:\n train_data: Pandas DataFrame containing the 2 columns - `input_text`, `target_text`.\n - `input_text`: The input text sequence.\n - `target_text`: The target text sequence\n ou...
[ { "param": "self", "type": null }, { "param": "train_data", "type": null }, { "param": "output_dir", "type": null }, { "param": "show_running_loss", "type": null }, { "param": "args", "type": null }, { "param": "eval_data", "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 ...
19ced10c3a403663085f69f500f3d1857ce453e9
wangcunxiang/Can_PLM_Server_as_KB
simpletransformers/seq2seq/seq2seq_model.py
[ "Apache-2.0" ]
Python
eval_model
<not_specific>
def eval_model(self, eval_data, output_dir=None, verbose=True, silent=False, **kwargs): """ Evaluates the model on eval_data. Saves results to output_dir. Args: eval_data: Pandas DataFrame containing the 2 columns - `input_text`, `target_text`. - `input_text`...
Evaluates the model on eval_data. Saves results to output_dir. Args: eval_data: Pandas DataFrame containing the 2 columns - `input_text`, `target_text`. - `input_text`: The input text sequence. - `target_text`: The target text sequence. ...
Evaluates the model on eval_data. Saves results to output_dir.
[ "Evaluates", "the", "model", "on", "eval_data", ".", "Saves", "results", "to", "output_dir", "." ]
def eval_model(self, eval_data, output_dir=None, verbose=True, silent=False, **kwargs): if not output_dir: output_dir = self.args.output_dir self._move_model_to_device() eval_dataset = self.load_and_cache_examples(eval_data, evaluate=True, verbose=verbose, silent=silent) os.m...
[ "def", "eval_model", "(", "self", ",", "eval_data", ",", "output_dir", "=", "None", ",", "verbose", "=", "True", ",", "silent", "=", "False", ",", "**", "kwargs", ")", ":", "if", "not", "output_dir", ":", "output_dir", "=", "self", ".", "args", ".", ...
Evaluates the model on eval_data.
[ "Evaluates", "the", "model", "on", "eval_data", "." ]
[ "\"\"\"\n Evaluates the model on eval_data. Saves results to output_dir.\n\n Args:\n eval_data: Pandas DataFrame containing the 2 columns - `input_text`, `target_text`.\n - `input_text`: The input text sequence.\n - `target_text`: The target tex...
[ { "param": "self", "type": null }, { "param": "eval_data", "type": null }, { "param": "output_dir", "type": null }, { "param": "verbose", "type": null }, { "param": "silent", "type": null } ]
{ "returns": [ { "docstring": "Dictionary containing evaluation results.", "docstring_tokens": [ "Dictionary", "containing", "evaluation", "results", "." ], "type": "results" } ], "raises": [], "params": [ { "identifier": "self", ...
19ced10c3a403663085f69f500f3d1857ce453e9
wangcunxiang/Can_PLM_Server_as_KB
simpletransformers/seq2seq/seq2seq_model.py
[ "Apache-2.0" ]
Python
evaluate
<not_specific>
def evaluate(self, eval_dataset, output_dir, verbose=True, silent=False, **kwargs): """ Evaluates the model on eval_dataset. Utility function to be used by the eval_model() method. Not intended to be used directly. """ model = self.model args = self.args eval_ou...
Evaluates the model on eval_dataset. Utility function to be used by the eval_model() method. Not intended to be used directly.
Evaluates the model on eval_dataset. Utility function to be used by the eval_model() method. Not intended to be used directly.
[ "Evaluates", "the", "model", "on", "eval_dataset", ".", "Utility", "function", "to", "be", "used", "by", "the", "eval_model", "()", "method", ".", "Not", "intended", "to", "be", "used", "directly", "." ]
def evaluate(self, eval_dataset, output_dir, verbose=True, silent=False, **kwargs): model = self.model args = self.args eval_output_dir = output_dir results = {} eval_sampler = SequentialSampler(eval_dataset) eval_dataloader = DataLoader(eval_dataset, sampler=eval_sampler...
[ "def", "evaluate", "(", "self", ",", "eval_dataset", ",", "output_dir", ",", "verbose", "=", "True", ",", "silent", "=", "False", ",", "**", "kwargs", ")", ":", "model", "=", "self", ".", "model", "args", "=", "self", ".", "args", "eval_output_dir", "=...
Evaluates the model on eval_dataset.
[ "Evaluates", "the", "model", "on", "eval_dataset", "." ]
[ "\"\"\"\n Evaluates the model on eval_dataset.\n\n Utility function to be used by the eval_model() method. Not intended to be used directly.\n \"\"\"", "# batch = tuple(t.to(device) for t in batch)" ]
[ { "param": "self", "type": null }, { "param": "eval_dataset", "type": null }, { "param": "output_dir", "type": null }, { "param": "verbose", "type": null }, { "param": "silent", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "eval_dataset", "type": null, "docstring": null, "docstring_to...
19ced10c3a403663085f69f500f3d1857ce453e9
wangcunxiang/Can_PLM_Server_as_KB
simpletransformers/seq2seq/seq2seq_model.py
[ "Apache-2.0" ]
Python
predict
<not_specific>
def predict(self, pred_data, output_dir=None, suffix=None, verbose=True, silent=False): """ Performs predictions on a list of text. Args: pred_data: Pandas DataFrame containing the 2 columns - `input_text`, `target_text`. - `input_text`: The input text sequenc...
Performs predictions on a list of text. Args: pred_data: Pandas DataFrame containing the 2 columns - `input_text`, `target_text`. - `input_text`: The input text sequence. - `target_text`: The target text sequence. outpu...
Performs predictions on a list of text.
[ "Performs", "predictions", "on", "a", "list", "of", "text", "." ]
def predict(self, pred_data, output_dir=None, suffix=None, verbose=True, silent=False): to_predict = pred_data["input_text"].tolist() target_predict = pred_data["target_text"].tolist() assert len(to_predict)==len(target_predict) self._move_model_to_device() if not output_dir: ...
[ "def", "predict", "(", "self", ",", "pred_data", ",", "output_dir", "=", "None", ",", "suffix", "=", "None", ",", "verbose", "=", "True", ",", "silent", "=", "False", ")", ":", "to_predict", "=", "pred_data", "[", "\"input_text\"", "]", ".", "tolist", ...
Performs predictions on a list of text.
[ "Performs", "predictions", "on", "a", "list", "of", "text", "." ]
[ "\"\"\"\n Performs predictions on a list of text.\n Args:\n pred_data: Pandas DataFrame containing the 2 columns - `input_text`, `target_text`.\n - `input_text`: The input text sequence.\n - `target_text`: The target text sequence. \n...
[ { "param": "self", "type": null }, { "param": "pred_data", "type": null }, { "param": "output_dir", "type": null }, { "param": "suffix", "type": null }, { "param": "verbose", "type": null }, { "param": "silent", "type": null } ]
{ "returns": [ { "docstring": "A python list of the generated sequences.", "docstring_tokens": [ "A", "python", "list", "of", "the", "generated", "sequences", "." ], "type": "preds" } ], "raises": [], "params": [ ...
19ced10c3a403663085f69f500f3d1857ce453e9
wangcunxiang/Can_PLM_Server_as_KB
simpletransformers/seq2seq/seq2seq_model.py
[ "Apache-2.0" ]
Python
load_and_cache_examples
<not_specific>
def load_and_cache_examples(self, data, evaluate=False, no_cache=False, verbose=True, silent=False): """ Creates a T5Dataset from data. Utility function for train() and eval() methods. Not intended to be used directly. """ encoder_tokenizer = self.encoder_tokenizer deco...
Creates a T5Dataset from data. Utility function for train() and eval() methods. Not intended to be used directly.
Creates a T5Dataset from data. Utility function for train() and eval() methods. Not intended to be used directly.
[ "Creates", "a", "T5Dataset", "from", "data", ".", "Utility", "function", "for", "train", "()", "and", "eval", "()", "methods", ".", "Not", "intended", "to", "be", "used", "directly", "." ]
def load_and_cache_examples(self, data, evaluate=False, no_cache=False, verbose=True, silent=False): encoder_tokenizer = self.encoder_tokenizer decoder_tokenizer = self.decoder_tokenizer args = self.args if not no_cache: no_cache = args.no_cache if not no_cache: ...
[ "def", "load_and_cache_examples", "(", "self", ",", "data", ",", "evaluate", "=", "False", ",", "no_cache", "=", "False", ",", "verbose", "=", "True", ",", "silent", "=", "False", ")", ":", "encoder_tokenizer", "=", "self", ".", "encoder_tokenizer", "decoder...
Creates a T5Dataset from data.
[ "Creates", "a", "T5Dataset", "from", "data", "." ]
[ "\"\"\"\n Creates a T5Dataset from data.\n\n Utility function for train() and eval() methods. Not intended to be used directly.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "data", "type": null }, { "param": "evaluate", "type": null }, { "param": "no_cache", "type": null }, { "param": "verbose", "type": null }, { "param": "silent", "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": [...
2af65d774a9c67fb2f22a9683737ee905021c7e0
wangcunxiang/Can_PLM_Server_as_KB
simpletransformers/classification/classification_model.py
[ "Apache-2.0" ]
Python
train_model
null
def train_model( self, train_df, multi_label=False, output_dir=None, show_running_loss=True, args=None, eval_df=None, verbose=True, **kwargs, ): """ Trains the model using 'train_df' Args: train_df: Pandas D...
Trains the model using 'train_df' Args: train_df: Pandas Dataframe containing at least two columns. If the Dataframe has a header, it should contain a 'text' and a 'labels' column. If no header is present, the Dataframe should contain at least two columns, with the first column...
Trains the model using 'train_df' Args: train_df: Pandas Dataframe containing at least two columns. If the Dataframe has a header, it should contain a 'text' and a 'labels' column. If no header is present, the Dataframe should contain at least two columns, with the first column containing the text, and the second colum...
[ "Trains", "the", "model", "using", "'", "train_df", "'", "Args", ":", "train_df", ":", "Pandas", "Dataframe", "containing", "at", "least", "two", "columns", ".", "If", "the", "Dataframe", "has", "a", "header", "it", "should", "contain", "a", "'", "text", ...
def train_model( self, train_df, multi_label=False, output_dir=None, show_running_loss=True, args=None, eval_df=None, verbose=True, **kwargs, ): if args: self.args.update_from_dict(args) if self.args.silent: ...
[ "def", "train_model", "(", "self", ",", "train_df", ",", "multi_label", "=", "False", ",", "output_dir", "=", "None", ",", "show_running_loss", "=", "True", ",", "args", "=", "None", ",", "eval_df", "=", "None", ",", "verbose", "=", "True", ",", "**", ...
Trains the model using 'train_df' Args: train_df: Pandas Dataframe containing at least two columns.
[ "Trains", "the", "model", "using", "'", "train_df", "'", "Args", ":", "train_df", ":", "Pandas", "Dataframe", "containing", "at", "least", "two", "columns", "." ]
[ "\"\"\"\n Trains the model using 'train_df'\n\n Args:\n train_df: Pandas Dataframe containing at least two columns. If the Dataframe has a header, it should contain a 'text' and a 'labels' column. If no header is present,\n the Dataframe should contain at least two columns, with ...
[ { "param": "self", "type": null }, { "param": "train_df", "type": null }, { "param": "multi_label", "type": null }, { "param": "output_dir", "type": null }, { "param": "show_running_loss", "type": null }, { "param": "args", "type": null }, { ...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "train_df", "type": null, "docstring": null, "docstring_tokens...
2af65d774a9c67fb2f22a9683737ee905021c7e0
wangcunxiang/Can_PLM_Server_as_KB
simpletransformers/classification/classification_model.py
[ "Apache-2.0" ]
Python
load_and_cache_examples
<not_specific>
def load_and_cache_examples( self, examples, evaluate=False, no_cache=False, multi_label=False, verbose=True, silent=False ): """ Converts a list of InputExample objects to a TensorDataset containing InputFeatures. Caches the InputFeatures. Utility function for train() and eval() me...
Converts a list of InputExample objects to a TensorDataset containing InputFeatures. Caches the InputFeatures. Utility function for train() and eval() methods. Not intended to be used directly.
Converts a list of InputExample objects to a TensorDataset containing InputFeatures.
[ "Converts", "a", "list", "of", "InputExample", "objects", "to", "a", "TensorDataset", "containing", "InputFeatures", "." ]
def load_and_cache_examples( self, examples, evaluate=False, no_cache=False, multi_label=False, verbose=True, silent=False ): process_count = self.args.process_count tokenizer = self.tokenizer args = self.args if not no_cache: no_cache = args.no_cache if n...
[ "def", "load_and_cache_examples", "(", "self", ",", "examples", ",", "evaluate", "=", "False", ",", "no_cache", "=", "False", ",", "multi_label", "=", "False", ",", "verbose", "=", "True", ",", "silent", "=", "False", ")", ":", "process_count", "=", "self"...
Converts a list of InputExample objects to a TensorDataset containing InputFeatures.
[ "Converts", "a", "list", "of", "InputExample", "objects", "to", "a", "TensorDataset", "containing", "InputFeatures", "." ]
[ "\"\"\"\n Converts a list of InputExample objects to a TensorDataset containing InputFeatures. Caches the InputFeatures.\n\n Utility function for train() and eval() methods. Not intended to be used directly.\n \"\"\"", "# If labels_map is defined, then labels need to be replaced with ints", ...
[ { "param": "self", "type": null }, { "param": "examples", "type": null }, { "param": "evaluate", "type": null }, { "param": "no_cache", "type": null }, { "param": "multi_label", "type": null }, { "param": "verbose", "type": null }, { "param...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "examples", "type": null, "docstring": null, "docstring_tokens...
9a6e5702de9e8b6ac854dc423821f29c05f3d303
rossmann-engineering/EasyModbusTCP.PY
easymodbus/modbusClient.py
[ "MIT" ]
Python
connect
null
def connect(self): """ Connects to a Modbus-TCP Server or a Modbus-RTU Slave with the given Parameters """ if self.__ser is not None: serial = importlib.import_module("serial") if self.__stopbits == 0: self.__ser.stopbits = serial.STOPBITS_ONE ...
Connects to a Modbus-TCP Server or a Modbus-RTU Slave with the given Parameters
Connects to a Modbus-TCP Server or a Modbus-RTU Slave with the given Parameters
[ "Connects", "to", "a", "Modbus", "-", "TCP", "Server", "or", "a", "Modbus", "-", "RTU", "Slave", "with", "the", "given", "Parameters" ]
def connect(self): if self.__ser is not None: serial = importlib.import_module("serial") if self.__stopbits == 0: self.__ser.stopbits = serial.STOPBITS_ONE elif self.__stopbits == 1: self.__ser.stopbits = serial.STOPBITS_TWO elif se...
[ "def", "connect", "(", "self", ")", ":", "if", "self", ".", "__ser", "is", "not", "None", ":", "serial", "=", "importlib", ".", "import_module", "(", "\"serial\"", ")", "if", "self", ".", "__stopbits", "==", "0", ":", "self", ".", "__ser", ".", "stop...
Connects to a Modbus-TCP Server or a Modbus-RTU Slave with the given Parameters
[ "Connects", "to", "a", "Modbus", "-", "TCP", "Server", "or", "a", "Modbus", "-", "RTU", "Slave", "with", "the", "given", "Parameters" ]
[ "\"\"\"\n Connects to a Modbus-TCP Server or a Modbus-RTU Slave with the given Parameters\n \"\"\"", "# print (self.ser)" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
9a6e5702de9e8b6ac854dc423821f29c05f3d303
rossmann-engineering/EasyModbusTCP.PY
easymodbus/modbusClient.py
[ "MIT" ]
Python
close
null
def close(self): """ Closes Serial port, or TCP-Socket connection """ if self.__ser is not None: self.__ser.close() if self.__tcpClientSocket is not None: self.__stoplistening = True self.__tcpClientSocket.shutdown(socket.SHUT_RDWR) ...
Closes Serial port, or TCP-Socket connection
Closes Serial port, or TCP-Socket connection
[ "Closes", "Serial", "port", "or", "TCP", "-", "Socket", "connection" ]
def close(self): if self.__ser is not None: self.__ser.close() if self.__tcpClientSocket is not None: self.__stoplistening = True self.__tcpClientSocket.shutdown(socket.SHUT_RDWR) self.__tcpClientSocket.close() self.__connected = False logg...
[ "def", "close", "(", "self", ")", ":", "if", "self", ".", "__ser", "is", "not", "None", ":", "self", ".", "__ser", ".", "close", "(", ")", "if", "self", ".", "__tcpClientSocket", "is", "not", "None", ":", "self", ".", "__stoplistening", "=", "True", ...
Closes Serial port, or TCP-Socket connection
[ "Closes", "Serial", "port", "or", "TCP", "-", "Socket", "connection" ]
[ "\"\"\"\n Closes Serial port, or TCP-Socket connection\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
9a6e5702de9e8b6ac854dc423821f29c05f3d303
rossmann-engineering/EasyModbusTCP.PY
easymodbus/modbusClient.py
[ "MIT" ]
Python
read_discreteinputs
<not_specific>
def read_discreteinputs(self, starting_address, quantity): """ Read Discrete Inputs from Master device (Function code 2) starting_address: First discrete input to be read quantity: Numer of discrete Inputs to be read returns: Boolean Array [0..quantity-1] which contains the discr...
Read Discrete Inputs from Master device (Function code 2) starting_address: First discrete input to be read quantity: Numer of discrete Inputs to be read returns: Boolean Array [0..quantity-1] which contains the discrete Inputs
Read Discrete Inputs from Master device (Function code 2) starting_address: First discrete input to be read quantity: Numer of discrete Inputs to be read returns: Boolean Array [0..quantity-1] which contains the discrete Inputs
[ "Read", "Discrete", "Inputs", "from", "Master", "device", "(", "Function", "code", "2", ")", "starting_address", ":", "First", "discrete", "input", "to", "be", "read", "quantity", ":", "Numer", "of", "discrete", "Inputs", "to", "be", "read", "returns", ":", ...
def read_discreteinputs(self, starting_address, quantity): logging.info("Request to read discrete inputs (FC02), starting address: {0}, quantity: {1}" .format(str(starting_address), str(quantity))) self.__transactionIdentifier += 1 if self.__ser is not None: if s...
[ "def", "read_discreteinputs", "(", "self", ",", "starting_address", ",", "quantity", ")", ":", "logging", ".", "info", "(", "\"Request to read discrete inputs (FC02), starting address: {0}, quantity: {1}\"", ".", "format", "(", "str", "(", "starting_address", ")", ",", ...
Read Discrete Inputs from Master device (Function code 2) starting_address: First discrete input to be read quantity: Numer of discrete Inputs to be read returns: Boolean Array [0..quantity-1] which contains the discrete Inputs
[ "Read", "Discrete", "Inputs", "from", "Master", "device", "(", "Function", "code", "2", ")", "starting_address", ":", "First", "discrete", "input", "to", "be", "read", "quantity", ":", "Numer", "of", "discrete", "Inputs", "to", "be", "read", "returns", ":", ...
[ "\"\"\"\n Read Discrete Inputs from Master device (Function code 2)\n starting_address: First discrete input to be read\n quantity: Numer of discrete Inputs to be read\n returns: Boolean Array [0..quantity-1] which contains the discrete Inputs\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "starting_address", "type": null }, { "param": "quantity", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "starting_address", "type": null, "docstring": null, "docstrin...