signature
stringlengths
8
3.44k
body
stringlengths
0
1.41M
docstring
stringlengths
1
122k
id
stringlengths
5
17
def setup_path():
import os.path; import sys<EOL>if sys.argv[<NUM_LIT:0>]:<EOL><INDENT>top_dir = os.path.dirname(os.path.abspath(sys.argv[<NUM_LIT:0>]))<EOL>sys.path = [os.path.join(top_dir, "<STR_LIT:src>")] + sys.path<EOL>pass<EOL><DEDENT>return<EOL>
Sets up the python include paths to include src
f2983:m0
def register_view(self, view):
cb = self.view['<STR_LIT>']<EOL>cb.set_model(self.model.currencies)<EOL>cell = gtk.CellRendererText()<EOL>cb.pack_start(cell, True)<EOL>def on_cell_data(cb, cell, mod, it):<EOL><INDENT>if mod[it][<NUM_LIT:0>]: cell.set_property('<STR_LIT:text>', mod[it][<NUM_LIT:0>].name)<EOL>return<EOL><DEDENT>cb.set_cell_data_func(cell, on_cell_data)<EOL>return<EOL>
Creates treeview columns, and connect missing signals
f2984:c0:m1
def register_view(self, view):
self.view.set_text(self.model.credits)<EOL>gobject.timeout_add(<NUM_LIT>, self.on_begin_scroll)<EOL>return<EOL>
Loads the text taking it from the model, then starts a timer to scroll it.
f2985:c0:m0
def on_begin_scroll(self):
gobject.timeout_add(<NUM_LIT:50>, self.on_scroll)<EOL>return False<EOL>
Called once after 2.1 seconds
f2985:c0:m1
def on_scroll(self):
try:<EOL><INDENT>sw = self.view['<STR_LIT>']<EOL><DEDENT>except KeyError:<EOL><INDENT>return False <EOL><DEDENT>vadj = sw.get_vadjustment()<EOL>if vadj is None: return False<EOL>val = vadj.get_value()<EOL>if val >= vadj.upper - vadj.page_size:<EOL><INDENT>self.view.show_vscrollbar()<EOL>return False<EOL><DEDENT>vadj.set_value(val+<NUM_LIT:0.5>)<EOL>return True<EOL>
Called to scroll text
f2985:c0:m2
def register_view(self, view):
Controller.register_view(self, view)<EOL>self.view['<STR_LIT>'].get_buffer().connect("<STR_LIT>",<EOL>self.on_notes_changed)<EOL>self.view.set_name(self.model.name)<EOL>self.view.set_rate(self.model.rate)<EOL>self.view.set_notes(self.model.notes)<EOL>return<EOL>
Creates treeview columns, and connect missing signals
f2986:c0:m1
def register_view(self, view):
self.setup_columns()<EOL>tv = self.view['<STR_LIT>']<EOL>sel = tv.get_selection()<EOL>sel.connect('<STR_LIT>', self.on_selection_changed)<EOL>return<EOL>
Creates treeview columns, and connect missing signals
f2987:c0:m1
def setup_columns(self):
tv = self.view['<STR_LIT>']<EOL>tv.set_model(self.model)<EOL>cell = gtk.CellRendererText()<EOL>tvcol = gtk.TreeViewColumn('<STR_LIT:Name>', cell)<EOL>def cell_data_func(col, cell, mod, it):<EOL><INDENT>if mod[it][<NUM_LIT:0>]: cell.set_property('<STR_LIT:text>', mod[it][<NUM_LIT:0>].name)<EOL>return<EOL><DEDENT>tvcol.set_cell_data_func(cell, cell_data_func)<EOL>tv.append_column(tvcol) <EOL>return<EOL>
Creates the treeview stuff
f2987:c0:m2
def show_curr_model_view(self, model, select):
v = self.view.add_currency_view(select)<EOL>self.curreny = CurrencyCtrl(model, v)<EOL>return<EOL>
A currency has been added, or an existing curreny has been selected, and needs to be shown on the right side of the dialog
f2987:c0:m3
def unselect(self):
self.view['<STR_LIT>'].get_selection().unselect_all()<EOL>return<EOL>
Unselects selected currency
f2987:c0:m4
def apply_modification(self):
self.__changing_model = True<EOL>if self.adding_model: self.model.add(self.adding_model)<EOL>elif self.editing_model and self.editing_iter:<EOL><INDENT>path = self.model.get_path(self.editing_iter)<EOL>self.model.row_changed(path, self.editing_iter) <EOL>pass <EOL><DEDENT>self.view.remove_currency_view()<EOL>self.adding_model = None<EOL>self.editing_model = None<EOL>self.editing_iter = None<EOL>self.curreny = None<EOL>self.unselect()<EOL>self.__changing_model = False<EOL>return<EOL>
Modifications on the right side need to be committed
f2987:c0:m5
def on_selection_changed(self, sel):
m, self.editing_iter = sel.get_selected()<EOL>if self.editing_iter:<EOL><INDENT>self.editing_model = m[self.editing_iter][<NUM_LIT:0>]<EOL>self.show_curr_model_view(self.editing_model, False)<EOL><DEDENT>else: self.view.remove_currency_view()<EOL>return<EOL>
The user changed selection
f2987:c0:m8
def register_view(self, view):
<EOL>if self.view.is_stand_alone():<EOL><INDENT>import gtk<EOL>self.view.get_top_widget().connect('<STR_LIT>',<EOL>lambda w,e: gtk.main_quit())<EOL>pass<EOL><DEDENT>return<EOL>
Creates treeview columns, and connect missing signals
f2989:c0:m1
def add(self, model):
def foo(m, p, i):<EOL><INDENT>if m[i][<NUM_LIT:0>].name == model.name:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>return<EOL><DEDENT>self.foreach(foo)<EOL>self.append((model,))<EOL>return<EOL>
raises an exception if the model cannot be added
f2993:c0:m1
def add_currency_view(self, select=False):
v = CurrencyView()<EOL>self.remove_currency_view()<EOL>self['<STR_LIT>'].pack_end(v.get_top_widget())<EOL>v.light_name(select)<EOL>return v<EOL>
returns the newly added view
f3003:c0:m0
def __init__(self, stand_alone=True):
if stand_alone: twid = "<STR_LIT>"<EOL>else: twid = "<STR_LIT>"<EOL>View.__init__(self, top=twid)<EOL>self.source = AmountView()<EOL>self.target = AmountView()<EOL>self.setup_widgets()<EOL>self.target.set_editable(False)<EOL>return<EOL>
stand_alone means that this view has a its-own windows, i.e. the converter is used as a stand alone (non embedded) application
f3005:c0:m0
def setup_path():
import os.path; import sys<EOL>if sys.argv[<NUM_LIT:0>]:<EOL><INDENT>top_dir = os.path.dirname(os.path.abspath(sys.argv[<NUM_LIT:0>]))<EOL>sys.path = [os.path.join(top_dir, "<STR_LIT:src>")] + sys.path<EOL>pass<EOL><DEDENT>return<EOL>
Sets up the python include paths to include src
f3006:m0
def lt(y):
return lambda x: x < y<EOL>
For str this is equivalent to y.__gt__, but int doesn't have those slots.
f3011:m0
def gtif(y):
return lambda x: not x or x > y<EOL>
Like gt but True if operand is None.
f3011:m3
def contains(y):
y = y.lower()<EOL>return lambda x: y in x.lower()<EOL>
Case-insensitive substring search.
f3011:m4
def eqdate(y):
y = datetime.date.today() if y == '<STR_LIT>' else datetime.date(*y)<EOL>return lambda x: x == y<EOL>
Like eq but compares datetime with y,m,d tuple. Also accepts magic string 'TODAY'.
f3011:m5
def set_sort_function(sortable, callback, column=<NUM_LIT:0>):
sortable.set_default_sort_func(<EOL>lambda tree, itera, iterb: _normalize(callback(<EOL>tree.get_value(itera, column),<EOL>tree.get_value(iterb, column)<EOL>))<EOL>)<EOL>
*sortable* is a :class:`gtk.TreeSortable` instance. *callback* will be passed two items and must return a value like the built-in `cmp`. *column* is an integer adressing the column that holds items. This will re-sort even if *callback* is the same as before. .. note:: When sorting a `ListStore` without a `TreeModelSort` you have to call `set_sort_column_id(-1, gtk.SORT_ASCENDING)` once, *after* this.
f3013:m1
def get_sort_function(order):
stable = tuple((d['<STR_LIT:key>'], -<NUM_LIT:1> if d['<STR_LIT>'] else <NUM_LIT:1>) for d in order)<EOL>def sort_function(a, b):<EOL><INDENT>for name, direction in stable:<EOL><INDENT>v = cmp(getattr(a, name) if a else a, getattr(b, name) if b else b)<EOL>if v != <NUM_LIT:0>:<EOL><INDENT>return v * direction<EOL><DEDENT><DEDENT>return <NUM_LIT:0><EOL><DEDENT>return sort_function<EOL>
Returns a callable similar to the built-in `cmp`, to be used on objects. Takes a list of dictionaries. In each, 'key' must be a string that is used to get an attribute of the objects to compare, and 'reverse' must be a boolean indicating whether the result should be reversed.
f3013:m2
def setup_sort_column(widget, column=<NUM_LIT:0>, attribute=None, model=None):
if not attribute:<EOL><INDENT>attribute = widget.get_name()<EOL>if attribute is None:<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT><DEDENT>widget.connect('<STR_LIT>', _clicked, column, attribute, model)<EOL>
*model* is the :class:`TreeModelSort` to act on. Defaults to what is displayed. Pass this if you sort before filtering. *widget* is a clickable :class:`TreeViewColumn`. *column* is an integer addressing the column in *model* that holds your objects. *attribute* is a string naming an object attribute to display. Defaults to the name of *widget*.
f3013:m4
def set_labels(self, labels):
self.__labels = labels<EOL>
Takes a dictionary mapping keys to sort by to display labels.
f3013:c0:m1
def get_order(self):
return [dict(reverse=r[<NUM_LIT:0>], key=r[<NUM_LIT:1>]) for r in self.get_model()]<EOL>
Return a list of dicionaries. See `set_order`.
f3013:c0:m2
def set_order(self, order):
m = gtk.ListStore(bool, str)<EOL>for item in order:<EOL><INDENT>m.append(<EOL>(item['<STR_LIT>'], item['<STR_LIT:key>'])<EOL>)<EOL><DEDENT>self.set_model(m)<EOL>
Takes a list of dictionaries. Those correspond to the arguments of `list.sort` and must contain the keys 'key' and 'reverse' (a boolean). You must call `set_labels` before this!
f3013:c0:m3
def __init__(self, model, column=<NUM_LIT:0>):
self.model = model<EOL>self.column = column<EOL>self.checks = ()<EOL>model.set_visible_func(self)<EOL>
*model* is a :class:`gtk.TreeModelFilter` instance. *column* is an integer adressing the column that holds items.
f3017:c0:m0
def refilter(self, predicates, module):
self.checks = tuple(<EOL>(getattr(module, factory)(argument), attribute)<EOL>for attribute, factory, argument in predicates<EOL>)<EOL>self.model.refilter()<EOL>
*predicates* a sequence of 3-tuples. *module* an object created with `import`. Predicates have the following format: *attribute* a string naming an attribute of items. *function* a string naming a factory callable in *module*. *argument* can be anything. This will be passed to *function* as its sole argument. The result must be a callable that takes a value of *attribute* and returns a boolean. We do this to make the refilter after changing criteria faster. The function we return will lazily evaluate the predicates and logically combine their results in an AND fashion.
f3017:c0:m2
def setup_content(self, names, max_value):
<EOL>box = self['<STR_LIT>']<EOL>group = None <EOL>for name in names:<EOL><INDENT>if '<STR_LIT>'+name in self: continue <EOL>rb = gtk.RadioButton(group, name)<EOL>self['<STR_LIT>'+name] = rb<EOL>rb.set_visible(True)<EOL>box.pack_start(rb, expand=False)<EOL>group = group or rb<EOL>pass<EOL><DEDENT>self['<STR_LIT>'].set_upper(max_value)<EOL>return<EOL>
Creates the radio buttons for counter selection, and sets up the progress bar. @param names is an iterable of strings for the names of counters. @param max_value is the maximum value used to set the progress bar. This method is called by controllers, when connected model is available.
f3018:c0:m1
def get_max_value(self):
return <NUM_LIT:5><EOL>
returns the maximum value reachable by the currently selected counter
f3020:c0:m3
def increment(self):
if self.counter < self.get_max_value(): self.counter += <NUM_LIT:1><EOL>return<EOL>
Increments the currently selected counter by 1. If the maximum value is reached, the value is not incremented.
f3020:c0:m4
def reset(self):
self.counter = <NUM_LIT:0><EOL>return<EOL>
Resets the currently selected counter to 0
f3020:c0:m5
def register_view(self, view):
<EOL>self.view['<STR_LIT>'].connect('<STR_LIT>', gtk.main_quit) <EOL>return<EOL>
This method is called by the view, that calls it when it is ready to register itself. Here we connect the 'pressed' signal of the button with a controller's method. Signal 'destroy' for the main window is handled as well.
f3024:c0:m0
def register_view(self, view):
<EOL>self.view['<STR_LIT>'].connect('<STR_LIT>', gtk.main_quit)<EOL>self.view.set_text("<STR_LIT>" % self.model.counter)<EOL>return<EOL>
This method is called by the view, that calls it when it is ready to register itself. Here we connect the 'pressed' signal of the button with a controller's method. Signal 'destroy' for the main window is handled as well.
f3031:c0:m0
def getheaders(self):
return self.urllib3_response.getheaders()<EOL>
Returns a dictionary of the response headers.
f3035:c0:m1
def getheader(self, name, default=None):
return self.urllib3_response.getheader(name, default)<EOL>
Returns a given response header.
f3035:c0:m2
def request(self, method, url, query_params=None, headers=None,<EOL>body=None, post_params=None, _preload_content=True, _request_timeout=None):
method = method.upper()<EOL>assert method in ['<STR_LIT:GET>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT:POST>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL>if post_params and body:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>post_params = post_params or {}<EOL>headers = headers or {}<EOL>timeout = None<EOL>if _request_timeout:<EOL><INDENT>if isinstance(_request_timeout, (int, ) if PY3 else (int, long)):<EOL><INDENT>timeout = urllib3.Timeout(total=_request_timeout)<EOL><DEDENT>elif isinstance(_request_timeout, tuple) and len(_request_timeout) == <NUM_LIT:2>:<EOL><INDENT>timeout = urllib3.Timeout(connect=_request_timeout[<NUM_LIT:0>], read=_request_timeout[<NUM_LIT:1>])<EOL><DEDENT><DEDENT>if '<STR_LIT:Content-Type>' not in headers:<EOL><INDENT>headers['<STR_LIT:Content-Type>'] = '<STR_LIT:application/json>'<EOL><DEDENT>try:<EOL><INDENT>if method in ['<STR_LIT:POST>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>if query_params:<EOL><INDENT>url += '<STR_LIT:?>' + urlencode(query_params)<EOL><DEDENT>if re.search('<STR_LIT>', headers['<STR_LIT:Content-Type>'], re.IGNORECASE):<EOL><INDENT>request_body = None<EOL>if body:<EOL><INDENT>request_body = json.dumps(body)<EOL><DEDENT>r = self.pool_manager.request(method, url,<EOL>body=request_body,<EOL>preload_content=_preload_content,<EOL>timeout=timeout,<EOL>headers=headers)<EOL><DEDENT>elif headers['<STR_LIT:Content-Type>'] == '<STR_LIT>':<EOL><INDENT>r = self.pool_manager.request(method, url,<EOL>fields=post_params,<EOL>encode_multipart=False,<EOL>preload_content=_preload_content,<EOL>timeout=timeout,<EOL>headers=headers)<EOL><DEDENT>elif headers['<STR_LIT:Content-Type>'] == '<STR_LIT>':<EOL><INDENT>del headers['<STR_LIT:Content-Type>']<EOL>r = self.pool_manager.request(method, url,<EOL>fields=post_params,<EOL>encode_multipart=True,<EOL>preload_content=_preload_content,<EOL>timeout=timeout,<EOL>headers=headers)<EOL><DEDENT>elif isinstance(body, str):<EOL><INDENT>request_body = body<EOL>r = self.pool_manager.request(method, url,<EOL>body=request_body,<EOL>preload_content=_preload_content,<EOL>timeout=timeout,<EOL>headers=headers)<EOL><DEDENT>else:<EOL><INDENT>msg = """<STR_LIT>"""<EOL>raise ApiException(status=<NUM_LIT:0>, reason=msg)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>r = self.pool_manager.request(method, url,<EOL>fields=query_params,<EOL>preload_content=_preload_content,<EOL>timeout=timeout,<EOL>headers=headers)<EOL><DEDENT><DEDENT>except urllib3.exceptions.SSLError as e:<EOL><INDENT>msg = "<STR_LIT>".format(type(e).__name__, str(e))<EOL>raise ApiException(status=<NUM_LIT:0>, reason=msg)<EOL><DEDENT>if _preload_content:<EOL><INDENT>r = RESTResponse(r)<EOL>if PY3:<EOL><INDENT>r.data = r.data.decode('<STR_LIT:utf8>')<EOL><DEDENT>logger.debug("<STR_LIT>", r.data)<EOL><DEDENT>if r.status not in range(<NUM_LIT:200>, <NUM_LIT>):<EOL><INDENT>raise ApiException(http_resp=r)<EOL><DEDENT>return r<EOL>
:param method: http request method :param url: http request url :param query_params: query parameters in the url :param headers: http request headers :param body: request json body, for `application/json` :param post_params: request post parameters, `application/x-www-form-urlencoded` and `multipart/form-data` :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
f3035:c1:m1
def __str__(self):
error_message = "<STR_LIT>""<STR_LIT>".format(self.status, self.reason)<EOL>if self.headers:<EOL><INDENT>error_message += "<STR_LIT>".format(self.headers)<EOL><DEDENT>if self.body:<EOL><INDENT>error_message += "<STR_LIT>".format(self.body)<EOL><DEDENT>return error_message<EOL>
Custom error messages for exception
f3035:c2:m1
def __init__(self, host=None, header_name=None, header_value=None, cookie=None):
self.rest_client = RESTClientObject()<EOL>self.default_headers = {}<EOL>if header_name is not None:<EOL><INDENT>self.default_headers[header_name] = header_value<EOL><DEDENT>if host is None:<EOL><INDENT>self.host = Configuration().host<EOL><DEDENT>else:<EOL><INDENT>self.host = host<EOL><DEDENT>self.cookie = cookie<EOL>self.user_agent = '<STR_LIT>'<EOL>
Constructor of the class.
f3036:c0:m0
@property<EOL><INDENT>def user_agent(self):<DEDENT>
return self.default_headers['<STR_LIT>']<EOL>
Gets user agent.
f3036:c0:m1
@user_agent.setter<EOL><INDENT>def user_agent(self, value):<DEDENT>
self.default_headers['<STR_LIT>'] = value<EOL>
Sets user agent.
f3036:c0:m2
def sanitize_for_serialization(self, obj):
if obj is None:<EOL><INDENT>return None<EOL><DEDENT>elif isinstance(obj, self.PRIMITIVE_TYPES):<EOL><INDENT>return obj<EOL><DEDENT>elif isinstance(obj, list):<EOL><INDENT>return [self.sanitize_for_serialization(sub_obj)<EOL>for sub_obj in obj]<EOL><DEDENT>elif isinstance(obj, tuple):<EOL><INDENT>return tuple(self.sanitize_for_serialization(sub_obj)<EOL>for sub_obj in obj)<EOL><DEDENT>elif isinstance(obj, (datetime, date)):<EOL><INDENT>return obj.isoformat()<EOL><DEDENT>if isinstance(obj, dict):<EOL><INDENT>obj_dict = obj<EOL><DEDENT>else:<EOL><INDENT>obj_dict = {obj.attribute_map[attr]: getattr(obj, attr)<EOL>for attr, _ in iteritems(obj.swagger_types)<EOL>if getattr(obj, attr) is not None}<EOL><DEDENT>return {key: self.sanitize_for_serialization(val)<EOL>for key, val in iteritems(obj_dict)}<EOL>
Builds a JSON POST object. If obj is None, return None. If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is swagger model, return the properties dict. :param obj: The data to serialize. :return: The serialized form of data.
f3036:c0:m5
def deserialize(self, response, response_type):
<EOL>if response_type == "<STR_LIT:file>":<EOL><INDENT>return self.__deserialize_file(response)<EOL><DEDENT>try:<EOL><INDENT>data = json.loads(response.data)<EOL><DEDENT>except ValueError:<EOL><INDENT>data = response.data<EOL><DEDENT>return self.__deserialize(data, response_type)<EOL>
Deserializes response into an object. :param response: RESTResponse object to be deserialized. :param response_type: class literal for deserialized object, or string of class name. :return: deserialized object.
f3036:c0:m6
def __deserialize(self, data, klass):
if data is None:<EOL><INDENT>return None<EOL><DEDENT>if type(klass) == str:<EOL><INDENT>if klass.startswith('<STR_LIT>'):<EOL><INDENT>sub_kls = re.match('<STR_LIT>', klass).group(<NUM_LIT:1>)<EOL>return [self.__deserialize(sub_data, sub_kls)<EOL>for sub_data in data]<EOL><DEDENT>if klass.startswith('<STR_LIT>'):<EOL><INDENT>sub_kls = re.match('<STR_LIT>', klass).group(<NUM_LIT:2>)<EOL>return {k: self.__deserialize(v, sub_kls)<EOL>for k, v in iteritems(data)}<EOL><DEDENT>if klass in self.NATIVE_TYPES_MAPPING:<EOL><INDENT>klass = self.NATIVE_TYPES_MAPPING[klass]<EOL><DEDENT>else:<EOL><INDENT>klass = getattr(models, klass)<EOL><DEDENT><DEDENT>if klass in self.PRIMITIVE_TYPES:<EOL><INDENT>return self.__deserialize_primitive(data, klass)<EOL><DEDENT>elif klass == object:<EOL><INDENT>return self.__deserialize_object(data)<EOL><DEDENT>elif klass == date:<EOL><INDENT>return self.__deserialize_date(data)<EOL><DEDENT>elif klass == datetime:<EOL><INDENT>return self.__deserialize_datatime(data)<EOL><DEDENT>else:<EOL><INDENT>return self.__deserialize_model(data, klass)<EOL><DEDENT>
Deserializes dict, list, str into an object. :param data: dict, list or str. :param klass: class literal, or string of class name. :return: object.
f3036:c0:m7
def call_api(self, resource_path, method,<EOL>path_params=None, query_params=None, header_params=None,<EOL>body=None, post_params=None, files=None,<EOL>response_type=None, auth_settings=None, callback=None,<EOL>_return_http_data_only=None, collection_formats=None, _preload_content=True,<EOL>_request_timeout=None):
if callback is None:<EOL><INDENT>return self.__call_api(resource_path, method,<EOL>path_params, query_params, header_params,<EOL>body, post_params, files,<EOL>response_type, auth_settings, callback,<EOL>_return_http_data_only, collection_formats, _preload_content, _request_timeout)<EOL><DEDENT>else:<EOL><INDENT>thread = threading.Thread(target=self.__call_api,<EOL>args=(resource_path, method,<EOL>path_params, query_params,<EOL>header_params, body,<EOL>post_params, files,<EOL>response_type, auth_settings,<EOL>callback, _return_http_data_only,<EOL>collection_formats, _preload_content, _request_timeout))<EOL><DEDENT>thread.start()<EOL>return thread<EOL>
Makes the HTTP request (synchronous) and return the deserialized data. To make an async request, define a function for callback. :param resource_path: Path to method endpoint. :param method: Method to call. :param path_params: Path parameters in the url. :param query_params: Query parameters in the url. :param header_params: Header parameters to be placed in the request header. :param body: Request body. :param post_params dict: Request post form parameters, for `application/x-www-form-urlencoded`, `multipart/form-data`. :param auth_settings list: Auth Settings names for the request. :param response: Response data type. :param files dict: key -> filename, value -> filepath, for `multipart/form-data`. :param callback function: Callback function for asynchronous request. If provide this parameter, the request will be called asynchronously. :param _return_http_data_only: response data without head status code and headers :param collection_formats: dict of collection formats for path, query, header, and post parameters. :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: If provide parameter callback, the request will be called asynchronously. The method will return the request thread. If parameter callback is None, then the method will return the response directly.
f3036:c0:m8
def request(self, method, url, query_params=None, headers=None,<EOL>post_params=None, body=None, _preload_content=True, _request_timeout=None):
if method == "<STR_LIT:GET>":<EOL><INDENT>return self.rest_client.GET(url,<EOL>query_params=query_params,<EOL>_preload_content=_preload_content,<EOL>_request_timeout=_request_timeout,<EOL>headers=headers)<EOL><DEDENT>elif method == "<STR_LIT>":<EOL><INDENT>return self.rest_client.HEAD(url,<EOL>query_params=query_params,<EOL>_preload_content=_preload_content,<EOL>_request_timeout=_request_timeout,<EOL>headers=headers)<EOL><DEDENT>elif method == "<STR_LIT>":<EOL><INDENT>return self.rest_client.OPTIONS(url,<EOL>query_params=query_params,<EOL>headers=headers,<EOL>post_params=post_params,<EOL>_preload_content=_preload_content,<EOL>_request_timeout=_request_timeout,<EOL>body=body)<EOL><DEDENT>elif method == "<STR_LIT:POST>":<EOL><INDENT>return self.rest_client.POST(url,<EOL>query_params=query_params,<EOL>headers=headers,<EOL>post_params=post_params,<EOL>_preload_content=_preload_content,<EOL>_request_timeout=_request_timeout,<EOL>body=body)<EOL><DEDENT>elif method == "<STR_LIT>":<EOL><INDENT>return self.rest_client.PUT(url,<EOL>query_params=query_params,<EOL>headers=headers,<EOL>post_params=post_params,<EOL>_preload_content=_preload_content,<EOL>_request_timeout=_request_timeout,<EOL>body=body)<EOL><DEDENT>elif method == "<STR_LIT>":<EOL><INDENT>return self.rest_client.PATCH(url,<EOL>query_params=query_params,<EOL>headers=headers,<EOL>post_params=post_params,<EOL>_preload_content=_preload_content,<EOL>_request_timeout=_request_timeout,<EOL>body=body)<EOL><DEDENT>elif method == "<STR_LIT>":<EOL><INDENT>return self.rest_client.DELETE(url,<EOL>query_params=query_params,<EOL>headers=headers,<EOL>_preload_content=_preload_content,<EOL>_request_timeout=_request_timeout,<EOL>body=body)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>
Makes the HTTP request using RESTClient.
f3036:c0:m9
def parameters_to_tuples(self, params, collection_formats):
new_params = []<EOL>if collection_formats is None:<EOL><INDENT>collection_formats = {}<EOL><DEDENT>for k, v in iteritems(params) if isinstance(params, dict) else params:<EOL><INDENT>if k in collection_formats:<EOL><INDENT>collection_format = collection_formats[k]<EOL>if collection_format == '<STR_LIT>':<EOL><INDENT>new_params.extend((k, value) for value in v)<EOL><DEDENT>else:<EOL><INDENT>if collection_format == '<STR_LIT>':<EOL><INDENT>delimiter = '<STR_LIT:U+0020>'<EOL><DEDENT>elif collection_format == '<STR_LIT>':<EOL><INDENT>delimiter = '<STR_LIT:\t>'<EOL><DEDENT>elif collection_format == '<STR_LIT>':<EOL><INDENT>delimiter = '<STR_LIT:|>'<EOL><DEDENT>else: <EOL><INDENT>delimiter = '<STR_LIT:U+002C>'<EOL><DEDENT>new_params.append(<EOL>(k, delimiter.join(str(value) for value in v)))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>new_params.append((k, v))<EOL><DEDENT><DEDENT>return new_params<EOL>
Get parameters as list of tuples, formatting collections. :param params: Parameters as dict or list of two-tuples :param dict collection_formats: Parameter collection formats :return: Parameters as list of tuples, collections formatted
f3036:c0:m10
def prepare_post_parameters(self, post_params=None, files=None):
params = []<EOL>if post_params:<EOL><INDENT>params = post_params<EOL><DEDENT>if files:<EOL><INDENT>for k, v in iteritems(files):<EOL><INDENT>if not v:<EOL><INDENT>continue<EOL><DEDENT>file_names = v if type(v) is list else [v]<EOL>for n in file_names:<EOL><INDENT>with open(n, '<STR_LIT:rb>') as f:<EOL><INDENT>filename = os.path.basename(f.name)<EOL>filedata = f.read()<EOL>mimetype = mimetypes.guess_type(filename)[<NUM_LIT:0>] or '<STR_LIT>'<EOL>params.append(tuple([k, tuple([filename, filedata, mimetype])]))<EOL><DEDENT><DEDENT><DEDENT><DEDENT>return params<EOL>
Builds form parameters. :param post_params: Normal form parameters. :param files: File parameters. :return: Form parameters with files.
f3036:c0:m11
def select_header_accept(self, accepts):
if not accepts:<EOL><INDENT>return<EOL><DEDENT>accepts = [x.lower() for x in accepts]<EOL>if '<STR_LIT:application/json>' in accepts:<EOL><INDENT>return '<STR_LIT:application/json>'<EOL><DEDENT>else:<EOL><INDENT>return '<STR_LIT:U+002CU+0020>'.join(accepts)<EOL><DEDENT>
Returns `Accept` based on an array of accepts provided. :param accepts: List of headers. :return: Accept (e.g. application/json).
f3036:c0:m12
def select_header_content_type(self, content_types):
if not content_types:<EOL><INDENT>return '<STR_LIT:application/json>'<EOL><DEDENT>content_types = [x.lower() for x in content_types]<EOL>if '<STR_LIT:application/json>' in content_types or '<STR_LIT>' in content_types:<EOL><INDENT>return '<STR_LIT:application/json>'<EOL><DEDENT>else:<EOL><INDENT>return content_types[<NUM_LIT:0>]<EOL><DEDENT>
Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. :return: Content-Type (e.g. application/json).
f3036:c0:m13
def update_params_for_auth(self, headers, querys, auth_settings):
config = Configuration()<EOL>if not auth_settings:<EOL><INDENT>return<EOL><DEDENT>for auth in auth_settings:<EOL><INDENT>auth_setting = config.auth_settings().get(auth)<EOL>if auth_setting:<EOL><INDENT>if not auth_setting['<STR_LIT:value>']:<EOL><INDENT>continue<EOL><DEDENT>elif auth_setting['<STR_LIT>'] == '<STR_LIT>':<EOL><INDENT>headers[auth_setting['<STR_LIT:key>']] = auth_setting['<STR_LIT:value>']<EOL><DEDENT>elif auth_setting['<STR_LIT>'] == '<STR_LIT>':<EOL><INDENT>querys.append((auth_setting['<STR_LIT:key>'], auth_setting['<STR_LIT:value>']))<EOL><DEDENT>else:<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>'<EOL>)<EOL><DEDENT><DEDENT><DEDENT>
Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. :param querys: Query parameters tuple list to be updated. :param auth_settings: Authentication setting identifiers list.
f3036:c0:m14
def __deserialize_file(self, response):
config = Configuration()<EOL>fd, path = tempfile.mkstemp(dir=config.temp_folder_path)<EOL>os.close(fd)<EOL>os.remove(path)<EOL>content_disposition = response.getheader("<STR_LIT>")<EOL>if content_disposition:<EOL><INDENT>filename = re.search(r'<STR_LIT>', content_disposition).group(<NUM_LIT:1>)<EOL>path = os.path.join(os.path.dirname(path), filename)<EOL><DEDENT>with open(path, "<STR_LIT:w>") as f:<EOL><INDENT>f.write(response.data)<EOL><DEDENT>return path<EOL>
Saves response body into a file in a temporary folder, using the filename from the `Content-Disposition` header if provided. :param response: RESTResponse. :return: file path.
f3036:c0:m15
def __deserialize_primitive(self, data, klass):
try:<EOL><INDENT>return klass(data)<EOL><DEDENT>except UnicodeEncodeError:<EOL><INDENT>return unicode(data)<EOL><DEDENT>except TypeError:<EOL><INDENT>return data<EOL><DEDENT>
Deserializes string to primitive type. :param data: str. :param klass: class literal. :return: int, long, float, str, bool.
f3036:c0:m16
def __deserialize_object(self, value):
return value<EOL>
Return a original value. :return: object.
f3036:c0:m17
def __deserialize_date(self, string):
try:<EOL><INDENT>from dateutil.parser import parse<EOL>return parse(string).date()<EOL><DEDENT>except ImportError:<EOL><INDENT>return string<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ApiException(<EOL>status=<NUM_LIT:0>,<EOL>reason="<STR_LIT>".format(string)<EOL>)<EOL><DEDENT>
Deserializes string to date. :param string: str. :return: date.
f3036:c0:m18
def __deserialize_datatime(self, string):
try:<EOL><INDENT>from dateutil.parser import parse<EOL>return parse(string)<EOL><DEDENT>except ImportError:<EOL><INDENT>return string<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ApiException(<EOL>status=<NUM_LIT:0>,<EOL>reason=(<EOL>"<STR_LIT>"<EOL>.format(string)<EOL>)<EOL>)<EOL><DEDENT>
Deserializes string to datetime. The string should be in iso8601 datetime format. :param string: str. :return: datetime.
f3036:c0:m19
def __deserialize_model(self, data, klass):
instance = klass()<EOL>if not instance.swagger_types:<EOL><INDENT>return data<EOL><DEDENT>for attr, attr_type in iteritems(instance.swagger_types):<EOL><INDENT>if data is not Noneand instance.attribute_map[attr] in dataand isinstance(data, (list, dict)):<EOL><INDENT>value = data[instance.attribute_map[attr]]<EOL>setattr(instance, attr, self.__deserialize(value, attr_type))<EOL><DEDENT><DEDENT>return instance<EOL>
Deserializes list or dict to model. :param data: dict, list. :param klass: class literal. :return: model object.
f3036:c0:m20
def __init__(self, url=None, width=None, height=None, size=None):
self.swagger_types = {<EOL>'<STR_LIT:url>': '<STR_LIT:str>',<EOL>'<STR_LIT:width>': '<STR_LIT:str>',<EOL>'<STR_LIT>': '<STR_LIT:str>',<EOL>'<STR_LIT:size>': '<STR_LIT:str>'<EOL>}<EOL>self.attribute_map = {<EOL>'<STR_LIT:url>': '<STR_LIT:url>',<EOL>'<STR_LIT:width>': '<STR_LIT:width>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT:size>': '<STR_LIT:size>'<EOL>}<EOL>self._url = url<EOL>self._width = width<EOL>self._height = height<EOL>self._size = size<EOL>
GifImagesDownsized - a model defined in Swagger :param dict swaggerTypes: The key is attribute name and the value is attribute type. :param dict attributeMap: The key is attribute name and the value is json key in definition.
f3037:c0:m0
@property<EOL><INDENT>def url(self):<DEDENT>
return self._url<EOL>
Gets the url of this GifImagesDownsized. The publicly-accessible direct URL for this GIF. :return: The url of this GifImagesDownsized. :rtype: str
f3037:c0:m1
@url.setter<EOL><INDENT>def url(self, url):<DEDENT>
self._url = url<EOL>
Sets the url of this GifImagesDownsized. The publicly-accessible direct URL for this GIF. :param url: The url of this GifImagesDownsized. :type: str
f3037:c0:m2
@property<EOL><INDENT>def width(self):<DEDENT>
return self._width<EOL>
Gets the width of this GifImagesDownsized. The width of this GIF in pixels. :return: The width of this GifImagesDownsized. :rtype: str
f3037:c0:m3
@width.setter<EOL><INDENT>def width(self, width):<DEDENT>
self._width = width<EOL>
Sets the width of this GifImagesDownsized. The width of this GIF in pixels. :param width: The width of this GifImagesDownsized. :type: str
f3037:c0:m4
@property<EOL><INDENT>def height(self):<DEDENT>
return self._height<EOL>
Gets the height of this GifImagesDownsized. The height of this GIF in pixels. :return: The height of this GifImagesDownsized. :rtype: str
f3037:c0:m5
@height.setter<EOL><INDENT>def height(self, height):<DEDENT>
self._height = height<EOL>
Sets the height of this GifImagesDownsized. The height of this GIF in pixels. :param height: The height of this GifImagesDownsized. :type: str
f3037:c0:m6
@property<EOL><INDENT>def size(self):<DEDENT>
return self._size<EOL>
Gets the size of this GifImagesDownsized. The size of this GIF in bytes. :return: The size of this GifImagesDownsized. :rtype: str
f3037:c0:m7
@size.setter<EOL><INDENT>def size(self, size):<DEDENT>
self._size = size<EOL>
Sets the size of this GifImagesDownsized. The size of this GIF in bytes. :param size: The size of this GifImagesDownsized. :type: str
f3037:c0:m8
def to_dict(self):
result = {}<EOL>for attr, _ in iteritems(self.swagger_types):<EOL><INDENT>value = getattr(self, attr)<EOL>if isinstance(value, list):<EOL><INDENT>result[attr] = list(map(<EOL>lambda x: x.to_dict() if hasattr(x, "<STR_LIT>") else x,<EOL>value<EOL>))<EOL><DEDENT>elif hasattr(value, "<STR_LIT>"):<EOL><INDENT>result[attr] = value.to_dict()<EOL><DEDENT>elif isinstance(value, dict):<EOL><INDENT>result[attr] = dict(map(<EOL>lambda item: (item[<NUM_LIT:0>], item[<NUM_LIT:1>].to_dict())<EOL>if hasattr(item[<NUM_LIT:1>], "<STR_LIT>") else item,<EOL>value.items()<EOL>))<EOL><DEDENT>else:<EOL><INDENT>result[attr] = value<EOL><DEDENT><DEDENT>return result<EOL>
Returns the model properties as a dict
f3037:c0:m9
def to_str(self):
return pformat(self.to_dict())<EOL>
Returns the string representation of the model
f3037:c0:m10
def __repr__(self):
return self.to_str()<EOL>
For `print` and `pprint`
f3037:c0:m11
def __eq__(self, other):
if not isinstance(other, GifImagesDownsized):<EOL><INDENT>return False<EOL><DEDENT>return self.__dict__ == other.__dict__<EOL>
Returns true if both objects are equal
f3037:c0:m12
def __ne__(self, other):
return not self == other<EOL>
Returns true if both objects are not equal
f3037:c0:m13
def __init__(self, mp4=None, mp4_size=None, width=None, height=None):
self.swagger_types = {<EOL>'<STR_LIT>': '<STR_LIT:str>',<EOL>'<STR_LIT>': '<STR_LIT:str>',<EOL>'<STR_LIT:width>': '<STR_LIT:str>',<EOL>'<STR_LIT>': '<STR_LIT:str>'<EOL>}<EOL>self.attribute_map = {<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT:width>': '<STR_LIT:width>',<EOL>'<STR_LIT>': '<STR_LIT>'<EOL>}<EOL>self._mp4 = mp4<EOL>self._mp4_size = mp4_size<EOL>self._width = width<EOL>self._height = height<EOL>
GifImagesPreview - a model defined in Swagger :param dict swaggerTypes: The key is attribute name and the value is attribute type. :param dict attributeMap: The key is attribute name and the value is json key in definition.
f3038:c0:m0
@property<EOL><INDENT>def mp4(self):<DEDENT>
return self._mp4<EOL>
Gets the mp4 of this GifImagesPreview. The URL for this GIF in .MP4 format. :return: The mp4 of this GifImagesPreview. :rtype: str
f3038:c0:m1
@mp4.setter<EOL><INDENT>def mp4(self, mp4):<DEDENT>
self._mp4 = mp4<EOL>
Sets the mp4 of this GifImagesPreview. The URL for this GIF in .MP4 format. :param mp4: The mp4 of this GifImagesPreview. :type: str
f3038:c0:m2
@property<EOL><INDENT>def mp4_size(self):<DEDENT>
return self._mp4_size<EOL>
Gets the mp4_size of this GifImagesPreview. The size of this file in bytes. :return: The mp4_size of this GifImagesPreview. :rtype: str
f3038:c0:m3
@mp4_size.setter<EOL><INDENT>def mp4_size(self, mp4_size):<DEDENT>
self._mp4_size = mp4_size<EOL>
Sets the mp4_size of this GifImagesPreview. The size of this file in bytes. :param mp4_size: The mp4_size of this GifImagesPreview. :type: str
f3038:c0:m4
@property<EOL><INDENT>def width(self):<DEDENT>
return self._width<EOL>
Gets the width of this GifImagesPreview. The width of this file in pixels. :return: The width of this GifImagesPreview. :rtype: str
f3038:c0:m5
@width.setter<EOL><INDENT>def width(self, width):<DEDENT>
self._width = width<EOL>
Sets the width of this GifImagesPreview. The width of this file in pixels. :param width: The width of this GifImagesPreview. :type: str
f3038:c0:m6
@property<EOL><INDENT>def height(self):<DEDENT>
return self._height<EOL>
Gets the height of this GifImagesPreview. The height of this file in pixels. :return: The height of this GifImagesPreview. :rtype: str
f3038:c0:m7
@height.setter<EOL><INDENT>def height(self, height):<DEDENT>
self._height = height<EOL>
Sets the height of this GifImagesPreview. The height of this file in pixels. :param height: The height of this GifImagesPreview. :type: str
f3038:c0:m8
def to_dict(self):
result = {}<EOL>for attr, _ in iteritems(self.swagger_types):<EOL><INDENT>value = getattr(self, attr)<EOL>if isinstance(value, list):<EOL><INDENT>result[attr] = list(map(<EOL>lambda x: x.to_dict() if hasattr(x, "<STR_LIT>") else x,<EOL>value<EOL>))<EOL><DEDENT>elif hasattr(value, "<STR_LIT>"):<EOL><INDENT>result[attr] = value.to_dict()<EOL><DEDENT>elif isinstance(value, dict):<EOL><INDENT>result[attr] = dict(map(<EOL>lambda item: (item[<NUM_LIT:0>], item[<NUM_LIT:1>].to_dict())<EOL>if hasattr(item[<NUM_LIT:1>], "<STR_LIT>") else item,<EOL>value.items()<EOL>))<EOL><DEDENT>else:<EOL><INDENT>result[attr] = value<EOL><DEDENT><DEDENT>return result<EOL>
Returns the model properties as a dict
f3038:c0:m9
def to_str(self):
return pformat(self.to_dict())<EOL>
Returns the string representation of the model
f3038:c0:m10
def __repr__(self):
return self.to_str()<EOL>
For `print` and `pprint`
f3038:c0:m11
def __eq__(self, other):
if not isinstance(other, GifImagesPreview):<EOL><INDENT>return False<EOL><DEDENT>return self.__dict__ == other.__dict__<EOL>
Returns true if both objects are equal
f3038:c0:m12
def __ne__(self, other):
return not self == other<EOL>
Returns true if both objects are not equal
f3038:c0:m13
def __init__(self, type='<STR_LIT>', id=None, parent=None, create_datetime=None, breadcrumbs=None, username=None, slug=None, title=None, short_title=None, description=None, featured_gif=None, banner_image=None, avatar_image=None, screensaver_gif=None, is_private=None, is_live=None, event_start_datetime=None, event_end_datetime=None, has_children=None, url=None, website_url=None, instagram_url=None, twitter_url=None, facebook_url=None, pinterest_url=None, tumblr_url=None, user=None, trending_tags=None, gifs=None, children=None):
self.swagger_types = {<EOL>'<STR_LIT:type>': '<STR_LIT:str>',<EOL>'<STR_LIT:id>': '<STR_LIT:int>',<EOL>'<STR_LIT>': '<STR_LIT:str>',<EOL>'<STR_LIT>': '<STR_LIT:str>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT:username>': '<STR_LIT:str>',<EOL>'<STR_LIT>': '<STR_LIT:str>',<EOL>'<STR_LIT:title>': '<STR_LIT:str>',<EOL>'<STR_LIT>': '<STR_LIT:str>',<EOL>'<STR_LIT:description>': '<STR_LIT:str>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT:str>',<EOL>'<STR_LIT>': '<STR_LIT:str>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT:bool>',<EOL>'<STR_LIT>': '<STR_LIT:bool>',<EOL>'<STR_LIT>': '<STR_LIT:str>',<EOL>'<STR_LIT>': '<STR_LIT:str>',<EOL>'<STR_LIT>': '<STR_LIT:bool>',<EOL>'<STR_LIT:url>': '<STR_LIT:str>',<EOL>'<STR_LIT>': '<STR_LIT:str>',<EOL>'<STR_LIT>': '<STR_LIT:str>',<EOL>'<STR_LIT>': '<STR_LIT:str>',<EOL>'<STR_LIT>': '<STR_LIT:str>',<EOL>'<STR_LIT>': '<STR_LIT:str>',<EOL>'<STR_LIT>': '<STR_LIT:str>',<EOL>'<STR_LIT:user>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>'<EOL>}<EOL>self.attribute_map = {<EOL>'<STR_LIT:type>': '<STR_LIT:type>',<EOL>'<STR_LIT:id>': '<STR_LIT:id>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT:username>': '<STR_LIT:username>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT:title>': '<STR_LIT:title>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT:description>': '<STR_LIT:description>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT:url>': '<STR_LIT:url>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT:user>': '<STR_LIT:user>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>'<EOL>}<EOL>self._type = type<EOL>self._id = id<EOL>self._parent = parent<EOL>self._create_datetime = create_datetime<EOL>self._breadcrumbs = breadcrumbs<EOL>self._username = username<EOL>self._slug = slug<EOL>self._title = title<EOL>self._short_title = short_title<EOL>self._description = description<EOL>self._featured_gif = featured_gif<EOL>self._banner_image = banner_image<EOL>self._avatar_image = avatar_image<EOL>self._screensaver_gif = screensaver_gif<EOL>self._is_private = is_private<EOL>self._is_live = is_live<EOL>self._event_start_datetime = event_start_datetime<EOL>self._event_end_datetime = event_end_datetime<EOL>self._has_children = has_children<EOL>self._url = url<EOL>self._website_url = website_url<EOL>self._instagram_url = instagram_url<EOL>self._twitter_url = twitter_url<EOL>self._facebook_url = facebook_url<EOL>self._pinterest_url = pinterest_url<EOL>self._tumblr_url = tumblr_url<EOL>self._user = user<EOL>self._trending_tags = trending_tags<EOL>self._gifs = gifs<EOL>self._children = children<EOL>
LastChildModel - a model defined in Swagger :param dict swaggerTypes: The key is attribute name and the value is attribute type. :param dict attributeMap: The key is attribute name and the value is json key in definition.
f3039:c0:m0
@property<EOL><INDENT>def type(self):<DEDENT>
return self._type<EOL>
Gets the type of this LastChildModel. Always \"channel\" :return: The type of this LastChildModel. :rtype: str
f3039:c0:m1
@type.setter<EOL><INDENT>def type(self, type):<DEDENT>
self._type = type<EOL>
Sets the type of this LastChildModel. Always \"channel\" :param type: The type of this LastChildModel. :type: str
f3039:c0:m2
@property<EOL><INDENT>def id(self):<DEDENT>
return self._id<EOL>
Gets the id of this LastChildModel. 123 :return: The id of this LastChildModel. :rtype: int
f3039:c0:m3
@id.setter<EOL><INDENT>def id(self, id):<DEDENT>
self._id = id<EOL>
Sets the id of this LastChildModel. 123 :param id: The id of this LastChildModel. :type: int
f3039:c0:m4
@property<EOL><INDENT>def parent(self):<DEDENT>
return self._parent<EOL>
Gets the parent of this LastChildModel. parent's slug :return: The parent of this LastChildModel. :rtype: str
f3039:c0:m5
@parent.setter<EOL><INDENT>def parent(self, parent):<DEDENT>
self._parent = parent<EOL>
Sets the parent of this LastChildModel. parent's slug :param parent: The parent of this LastChildModel. :type: str
f3039:c0:m6
@property<EOL><INDENT>def create_datetime(self):<DEDENT>
return self._create_datetime<EOL>
Gets the create_datetime of this LastChildModel. xyz :return: The create_datetime of this LastChildModel. :rtype: str
f3039:c0:m7
@create_datetime.setter<EOL><INDENT>def create_datetime(self, create_datetime):<DEDENT>
self._create_datetime = create_datetime<EOL>
Sets the create_datetime of this LastChildModel. xyz :param create_datetime: The create_datetime of this LastChildModel. :type: str
f3039:c0:m8
@property<EOL><INDENT>def breadcrumbs(self):<DEDENT>
return self._breadcrumbs<EOL>
Gets the breadcrumbs of this LastChildModel. :return: The breadcrumbs of this LastChildModel. :rtype: list[Breadcrumb]
f3039:c0:m9
@breadcrumbs.setter<EOL><INDENT>def breadcrumbs(self, breadcrumbs):<DEDENT>
self._breadcrumbs = breadcrumbs<EOL>
Sets the breadcrumbs of this LastChildModel. :param breadcrumbs: The breadcrumbs of this LastChildModel. :type: list[Breadcrumb]
f3039:c0:m10
@property<EOL><INDENT>def username(self):<DEDENT>
return self._username<EOL>
Gets the username of this LastChildModel. xyz :return: The username of this LastChildModel. :rtype: str
f3039:c0:m11
@username.setter<EOL><INDENT>def username(self, username):<DEDENT>
self._username = username<EOL>
Sets the username of this LastChildModel. xyz :param username: The username of this LastChildModel. :type: str
f3039:c0:m12
@property<EOL><INDENT>def slug(self):<DEDENT>
return self._slug<EOL>
Gets the slug of this LastChildModel. :return: The slug of this LastChildModel. :rtype: str
f3039:c0:m13