signature stringlengths 8 3.44k | body stringlengths 0 1.41M | docstring stringlengths 1 122k | id stringlengths 5 17 |
|---|---|---|---|
@mp4_size.setter<EOL><INDENT>def mp4_size(self, mp4_size):<DEDENT> | self._mp4_size = mp4_size<EOL> | Sets the mp4_size of this GifImagesFixedHeight.
The size in bytes of the .MP4 file corresponding to this GIF.
:param mp4_size: The mp4_size of this GifImagesFixedHeight.
:type: str | f3080:c0:m12 |
@property<EOL><INDENT>def webp(self):<DEDENT> | return self._webp<EOL> | Gets the webp of this GifImagesFixedHeight.
The URL for this GIF in .webp format.
:return: The webp of this GifImagesFixedHeight.
:rtype: str | f3080:c0:m13 |
@webp.setter<EOL><INDENT>def webp(self, webp):<DEDENT> | self._webp = webp<EOL> | Sets the webp of this GifImagesFixedHeight.
The URL for this GIF in .webp format.
:param webp: The webp of this GifImagesFixedHeight.
:type: str | f3080:c0:m14 |
@property<EOL><INDENT>def webp_size(self):<DEDENT> | return self._webp_size<EOL> | Gets the webp_size of this GifImagesFixedHeight.
The size in bytes of the .webp file corresponding to this GIF.
:return: The webp_size of this GifImagesFixedHeight.
:rtype: str | f3080:c0:m15 |
@webp_size.setter<EOL><INDENT>def webp_size(self, webp_size):<DEDENT> | self._webp_size = webp_size<EOL> | Sets the webp_size of this GifImagesFixedHeight.
The size in bytes of the .webp file corresponding to this GIF.
:param webp_size: The webp_size of this GifImagesFixedHeight.
:type: str | f3080:c0:m16 |
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] ... | Returns the model properties as a dict | f3080:c0:m17 |
def to_str(self): | return pformat(self.to_dict())<EOL> | Returns the string representation of the model | f3080:c0:m18 |
def __repr__(self): | return self.to_str()<EOL> | For `print` and `pprint` | f3080:c0:m19 |
def __eq__(self, other): | if not isinstance(other, GifImagesFixedHeight):<EOL><INDENT>return False<EOL><DEDENT>return self.__dict__ == other.__dict__<EOL> | Returns true if both objects are equal | f3080:c0:m20 |
def __ne__(self, other): | return not self == other<EOL> | Returns true if both objects are not equal | f3080:c0:m21 |
def __init__(self, url=None, width=None, height=None, size=None, mp4=None, mp4_size=None, webp=None, webp_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>'<STR_LIT>': '<STR_LIT:str>',<EOL>'<STR_LIT>': '<STR_LIT:str>',<EOL>'<STR_LIT>': '<STR_LIT:str>',<EOL>'<STR_LIT>': '<STR_LIT:str>'<EOL>}<EOL>s... | GifImagesFixedHeightSmall - 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. | f3081:c0:m0 |
@property<EOL><INDENT>def url(self):<DEDENT> | return self._url<EOL> | Gets the url of this GifImagesFixedHeightSmall.
The publicly-accessible direct URL for this GIF.
:return: The url of this GifImagesFixedHeightSmall.
:rtype: str | f3081:c0:m1 |
@url.setter<EOL><INDENT>def url(self, url):<DEDENT> | self._url = url<EOL> | Sets the url of this GifImagesFixedHeightSmall.
The publicly-accessible direct URL for this GIF.
:param url: The url of this GifImagesFixedHeightSmall.
:type: str | f3081:c0:m2 |
@property<EOL><INDENT>def width(self):<DEDENT> | return self._width<EOL> | Gets the width of this GifImagesFixedHeightSmall.
The width of this GIF in pixels.
:return: The width of this GifImagesFixedHeightSmall.
:rtype: str | f3081:c0:m3 |
@width.setter<EOL><INDENT>def width(self, width):<DEDENT> | self._width = width<EOL> | Sets the width of this GifImagesFixedHeightSmall.
The width of this GIF in pixels.
:param width: The width of this GifImagesFixedHeightSmall.
:type: str | f3081:c0:m4 |
@property<EOL><INDENT>def height(self):<DEDENT> | return self._height<EOL> | Gets the height of this GifImagesFixedHeightSmall.
The height of this GIF in pixels.
:return: The height of this GifImagesFixedHeightSmall.
:rtype: str | f3081:c0:m5 |
@height.setter<EOL><INDENT>def height(self, height):<DEDENT> | self._height = height<EOL> | Sets the height of this GifImagesFixedHeightSmall.
The height of this GIF in pixels.
:param height: The height of this GifImagesFixedHeightSmall.
:type: str | f3081:c0:m6 |
@property<EOL><INDENT>def size(self):<DEDENT> | return self._size<EOL> | Gets the size of this GifImagesFixedHeightSmall.
The size of this GIF in bytes.
:return: The size of this GifImagesFixedHeightSmall.
:rtype: str | f3081:c0:m7 |
@size.setter<EOL><INDENT>def size(self, size):<DEDENT> | self._size = size<EOL> | Sets the size of this GifImagesFixedHeightSmall.
The size of this GIF in bytes.
:param size: The size of this GifImagesFixedHeightSmall.
:type: str | f3081:c0:m8 |
@property<EOL><INDENT>def mp4(self):<DEDENT> | return self._mp4<EOL> | Gets the mp4 of this GifImagesFixedHeightSmall.
The URL for this GIF in .MP4 format.
:return: The mp4 of this GifImagesFixedHeightSmall.
:rtype: str | f3081:c0:m9 |
@mp4.setter<EOL><INDENT>def mp4(self, mp4):<DEDENT> | self._mp4 = mp4<EOL> | Sets the mp4 of this GifImagesFixedHeightSmall.
The URL for this GIF in .MP4 format.
:param mp4: The mp4 of this GifImagesFixedHeightSmall.
:type: str | f3081:c0:m10 |
@property<EOL><INDENT>def mp4_size(self):<DEDENT> | return self._mp4_size<EOL> | Gets the mp4_size of this GifImagesFixedHeightSmall.
The size in bytes of the .MP4 file corresponding to this GIF.
:return: The mp4_size of this GifImagesFixedHeightSmall.
:rtype: str | f3081:c0:m11 |
@mp4_size.setter<EOL><INDENT>def mp4_size(self, mp4_size):<DEDENT> | self._mp4_size = mp4_size<EOL> | Sets the mp4_size of this GifImagesFixedHeightSmall.
The size in bytes of the .MP4 file corresponding to this GIF.
:param mp4_size: The mp4_size of this GifImagesFixedHeightSmall.
:type: str | f3081:c0:m12 |
@property<EOL><INDENT>def webp(self):<DEDENT> | return self._webp<EOL> | Gets the webp of this GifImagesFixedHeightSmall.
The URL for this GIF in .webp format.
:return: The webp of this GifImagesFixedHeightSmall.
:rtype: str | f3081:c0:m13 |
@webp.setter<EOL><INDENT>def webp(self, webp):<DEDENT> | self._webp = webp<EOL> | Sets the webp of this GifImagesFixedHeightSmall.
The URL for this GIF in .webp format.
:param webp: The webp of this GifImagesFixedHeightSmall.
:type: str | f3081:c0:m14 |
@property<EOL><INDENT>def webp_size(self):<DEDENT> | return self._webp_size<EOL> | Gets the webp_size of this GifImagesFixedHeightSmall.
The size in bytes of the .webp file corresponding to this GIF.
:return: The webp_size of this GifImagesFixedHeightSmall.
:rtype: str | f3081:c0:m15 |
@webp_size.setter<EOL><INDENT>def webp_size(self, webp_size):<DEDENT> | self._webp_size = webp_size<EOL> | Sets the webp_size of this GifImagesFixedHeightSmall.
The size in bytes of the .webp file corresponding to this GIF.
:param webp_size: The webp_size of this GifImagesFixedHeightSmall.
:type: str | f3081:c0:m16 |
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] ... | Returns the model properties as a dict | f3081:c0:m17 |
def to_str(self): | return pformat(self.to_dict())<EOL> | Returns the string representation of the model | f3081:c0:m18 |
def __repr__(self): | return self.to_str()<EOL> | For `print` and `pprint` | f3081:c0:m19 |
def __eq__(self, other): | if not isinstance(other, GifImagesFixedHeightSmall):<EOL><INDENT>return False<EOL><DEDENT>return self.__dict__ == other.__dict__<EOL> | Returns true if both objects are equal | f3081:c0:m20 |
def __ne__(self, other): | return not self == other<EOL> | Returns true if both objects are not equal | f3081:c0:m21 |
def __init__(self, name=None, gif=None): | self.swagger_types = {<EOL>'<STR_LIT:name>': '<STR_LIT:str>',<EOL>'<STR_LIT>': '<STR_LIT>'<EOL>}<EOL>self.attribute_map = {<EOL>'<STR_LIT:name>': '<STR_LIT:name>',<EOL>'<STR_LIT>': '<STR_LIT>'<EOL>}<EOL>self._name = name<EOL>self._gif = gif<EOL> | Tag - 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. | f3082:c0:m0 |
@property<EOL><INDENT>def name(self):<DEDENT> | return self._name<EOL> | Gets the name of this Tag.
Category name
:return: The name of this Tag.
:rtype: str | f3082:c0:m1 |
@name.setter<EOL><INDENT>def name(self, name):<DEDENT> | self._name = name<EOL> | Sets the name of this Tag.
Category name
:param name: The name of this Tag.
:type: str | f3082:c0:m2 |
@property<EOL><INDENT>def gif(self):<DEDENT> | return self._gif<EOL> | Gets the gif of this Tag.
A gif which can be used as the icon for this category.
:return: The gif of this Tag.
:rtype: Gif | f3082:c0:m3 |
@gif.setter<EOL><INDENT>def gif(self, gif):<DEDENT> | self._gif = gif<EOL> | Sets the gif of this Tag.
A gif which can be used as the icon for this category.
:param gif: The gif of this Tag.
:type: Gif | f3082:c0:m4 |
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] ... | Returns the model properties as a dict | f3082:c0:m5 |
def to_str(self): | return pformat(self.to_dict())<EOL> | Returns the string representation of the model | f3082:c0:m6 |
def __repr__(self): | return self.to_str()<EOL> | For `print` and `pprint` | f3082:c0:m7 |
def __eq__(self, other): | if not isinstance(other, Tag):<EOL><INDENT>return False<EOL><DEDENT>return self.__dict__ == other.__dict__<EOL> | Returns true if both objects are equal | f3082:c0:m8 |
def __ne__(self, other): | return not self == other<EOL> | Returns true if both objects are not equal | f3082:c0:m9 |
def __init__(self): | <EOL>self.host = "<STR_LIT>"<EOL>self.api_client = None<EOL>self.temp_folder_path = None<EOL>self.api_key = {}<EOL>self.api_key_prefix = {}<EOL>self.username = "<STR_LIT>"<EOL>self.password = "<STR_LIT>"<EOL>self.logger = {}<EOL>self.logger["<STR_LIT>"] = logging.getLogger("<STR_LIT>")<EOL>self.logger["<STR_LIT>"] = lo... | Constructor | f3083:c0:m0 |
@property<EOL><INDENT>def logger_file(self):<DEDENT> | return self.__logger_file<EOL> | Gets the logger_file. | f3083:c0:m1 |
@logger_file.setter<EOL><INDENT>def logger_file(self, value):<DEDENT> | self.__logger_file = value<EOL>if self.__logger_file:<EOL><INDENT>self.logger_file_handler = logging.FileHandler(self.__logger_file)<EOL>self.logger_file_handler.setFormatter(self.logger_formatter)<EOL>for _, logger in iteritems(self.logger):<EOL><INDENT>logger.addHandler(self.logger_file_handler)<EOL>if self.logger_st... | Sets the logger_file.
If the logger_file is None, then add stream handler and remove file handler.
Otherwise, add file handler and remove stream handler.
:param value: The logger_file path.
:type: str | f3083:c0:m2 |
@property<EOL><INDENT>def debug(self):<DEDENT> | return self.__debug<EOL> | Gets the debug status. | f3083:c0:m3 |
@debug.setter<EOL><INDENT>def debug(self, value):<DEDENT> | self.__debug = value<EOL>if self.__debug:<EOL><INDENT>for _, logger in iteritems(self.logger):<EOL><INDENT>logger.setLevel(logging.DEBUG)<EOL><DEDENT>httplib.HTTPConnection.debuglevel = <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>for _, logger in iteritems(self.logger):<EOL><INDENT>logger.setLevel(logging.WARNING)<EOL><D... | Sets the debug status.
:param value: The debug status, True or False.
:type: bool | f3083:c0:m4 |
@property<EOL><INDENT>def logger_format(self):<DEDENT> | return self.__logger_format<EOL> | Gets the logger_format. | f3083:c0:m5 |
@logger_format.setter<EOL><INDENT>def logger_format(self, value):<DEDENT> | self.__logger_format = value<EOL>self.logger_formatter = logging.Formatter(self.__logger_format)<EOL> | Sets the logger_format.
The logger_formatter will be updated when sets logger_format.
:param value: The format string.
:type: str | f3083:c0:m6 |
def get_api_key_with_prefix(self, identifier): | if self.api_key.get(identifier) and self.api_key_prefix.get(identifier):<EOL><INDENT>return self.api_key_prefix[identifier] + '<STR_LIT:U+0020>' + self.api_key[identifier]<EOL><DEDENT>elif self.api_key.get(identifier):<EOL><INDENT>return self.api_key[identifier]<EOL><DEDENT> | Gets API key (with prefix if set).
:param identifier: The identifier of apiKey.
:return: The token for api key authentication. | f3083:c0:m7 |
def get_basic_auth_token(self): | return urllib3.util.make_headers(basic_auth=self.username + '<STR_LIT::>' + self.password).get('<STR_LIT>')<EOL> | Gets HTTP basic authentication header (string).
:return: The token for basic HTTP authentication. | f3083:c0:m8 |
def auth_settings(self): | return {<EOL>}<EOL> | Gets Auth Settings dict for api client.
:return: The Auth Settings information dict. | f3083:c0:m9 |
def to_debug_report(self): | return "<STR_LIT>""<STR_LIT>""<STR_LIT>""<STR_LIT>""<STR_LIT>".format(env=sys.platform, pyversion=sys.version)<EOL> | Gets the essential information for debugging.
:return: The report for debugging. | f3083:c0:m10 |
def gifs_categories_category_get(self, api_key, category, **kwargs): | kwargs['<STR_LIT>'] = True<EOL>if kwargs.get('<STR_LIT>'):<EOL><INDENT>return self.gifs_categories_category_get_with_http_info(api_key, category, **kwargs)<EOL><DEDENT>else:<EOL><INDENT>(data) = self.gifs_categories_category_get_with_http_info(api_key, category, **kwargs)<EOL>return data<EOL><DEDENT> | Category Tags Endpoint.
Returns a list of tags for a given category. NOTE `limit` and `offset` must both be set; otherwise they're ignored.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> de... | f3085:c0:m1 |
def gifs_categories_category_get_with_http_info(self, api_key, category, **kwargs): | all_params = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>params = locals()<EOL>for key, val in iteritems(params['<STR_LIT>']):<EOL><INDENT>if key not in all_params:<EO... | Category Tags Endpoint.
Returns a list of tags for a given category. NOTE `limit` and `offset` must both be set; otherwise they're ignored.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> de... | f3085:c0:m2 |
def gifs_categories_category_tag_get(self, api_key, category, tag, **kwargs): | kwargs['<STR_LIT>'] = True<EOL>if kwargs.get('<STR_LIT>'):<EOL><INDENT>return self.gifs_categories_category_tag_get_with_http_info(api_key, category, tag, **kwargs)<EOL><DEDENT>else:<EOL><INDENT>(data) = self.gifs_categories_category_tag_get_with_http_info(api_key, category, tag, **kwargs)<EOL>return data<EOL><DEDENT> | Tagged Gifs Endpoint.
Returns a list of gifs for a given tag (alias to `/gif/search`).
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(respons... | f3085:c0:m3 |
def gifs_categories_category_tag_get_with_http_info(self, api_key, category, tag, **kwargs): | all_params = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>params = locals()<EOL>for key, val in iteritems(params['<STR_LIT>']):<EOL><INDENT>if key not in a... | Tagged Gifs Endpoint.
Returns a list of gifs for a given tag (alias to `/gif/search`).
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(respons... | f3085:c0:m4 |
def gifs_categories_get(self, api_key, **kwargs): | kwargs['<STR_LIT>'] = True<EOL>if kwargs.get('<STR_LIT>'):<EOL><INDENT>return self.gifs_categories_get_with_http_info(api_key, **kwargs)<EOL><DEDENT>else:<EOL><INDENT>(data) = self.gifs_categories_get_with_http_info(api_key, **kwargs)<EOL>return data<EOL><DEDENT> | Categories Endpoint.
Returns a list of categories.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.gifs_categor... | f3085:c0:m5 |
def gifs_categories_get_with_http_info(self, api_key, **kwargs): | all_params = ['<STR_LIT>', '<STR_LIT>']<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>params = locals()<EOL>for key, val in iteritems(params['<STR_LIT>']):<EOL><INDENT>if key not in all_params:<EOL><INDENT>raise TypeError(... | Categories Endpoint.
Returns a list of categories.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.gifs_categor... | f3085:c0:m6 |
def gifs_get(self, api_key, ids, **kwargs): | kwargs['<STR_LIT>'] = True<EOL>if kwargs.get('<STR_LIT>'):<EOL><INDENT>return self.gifs_get_with_http_info(api_key, ids, **kwargs)<EOL><DEDENT>else:<EOL><INDENT>(data) = self.gifs_get_with_http_info(api_key, ids, **kwargs)<EOL>return data<EOL><DEDENT> | Get GIFs by ID Endpoint
A multiget version of the get GIF by ID endpoint.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> th... | f3085:c0:m7 |
def gifs_get_with_http_info(self, api_key, ids, **kwargs): | all_params = ['<STR_LIT>', '<STR_LIT>']<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>params = locals()<EOL>for key, val in iteritems(params['<STR_LIT>']):<EOL><INDENT>if key not in all_params:<EOL><INDENT>raise TypeError(... | Get GIFs by ID Endpoint
A multiget version of the get GIF by ID endpoint.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> th... | f3085:c0:m8 |
def gifs_gif_id_get(self, api_key, gif_id, **kwargs): | kwargs['<STR_LIT>'] = True<EOL>if kwargs.get('<STR_LIT>'):<EOL><INDENT>return self.gifs_gif_id_get_with_http_info(api_key, gif_id, **kwargs)<EOL><DEDENT>else:<EOL><INDENT>(data) = self.gifs_gif_id_get_with_http_info(api_key, gif_id, **kwargs)<EOL>return data<EOL><DEDENT> | Get GIF by ID Endpoint
Returns a GIF given that GIF's unique ID
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api... | f3085:c0:m9 |
def gifs_gif_id_get_with_http_info(self, api_key, gif_id, **kwargs): | all_params = ['<STR_LIT>', '<STR_LIT>']<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>params = locals()<EOL>for key, val in iteritems(params['<STR_LIT>']):<EOL><INDENT>if key not in all_params:<EOL><INDENT>raise TypeError(... | Get GIF by ID Endpoint
Returns a GIF given that GIF's unique ID
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api... | f3085:c0:m10 |
def gifs_random_get(self, api_key, **kwargs): | kwargs['<STR_LIT>'] = True<EOL>if kwargs.get('<STR_LIT>'):<EOL><INDENT>return self.gifs_random_get_with_http_info(api_key, **kwargs)<EOL><DEDENT>else:<EOL><INDENT>(data) = self.gifs_random_get_with_http_info(api_key, **kwargs)<EOL>return data<EOL><DEDENT> | Random Endpoint
Returns a random GIF, limited by tag. Excluding the tag parameter will return a random GIF from the GIPHY catalog.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callbac... | f3085:c0:m11 |
def gifs_random_get_with_http_info(self, api_key, **kwargs): | all_params = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>params = locals()<EOL>for key, val in iteritems(params['<STR_LIT>']):<EOL><INDENT>if key not in all_params:<EO... | Random Endpoint
Returns a random GIF, limited by tag. Excluding the tag parameter will return a random GIF from the GIPHY catalog.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callbac... | f3085:c0:m12 |
def gifs_search_get(self, api_key, q, **kwargs): | kwargs['<STR_LIT>'] = True<EOL>if kwargs.get('<STR_LIT>'):<EOL><INDENT>return self.gifs_search_get_with_http_info(api_key, q, **kwargs)<EOL><DEDENT>else:<EOL><INDENT>(data) = self.gifs_search_get_with_http_info(api_key, q, **kwargs)<EOL>return data<EOL><DEDENT> | Search Endpoint
Search all Giphy GIFs for a word or phrase. Punctuation will be stripped and ignored. Use a plus or url encode for phrases. Example paul+rudd, ryan+gosling or american+psycho.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` functi... | f3085:c0:m13 |
def gifs_search_get_with_http_info(self, api_key, q, **kwargs): | all_params = ['<STR_LIT>', '<STR_LIT:q>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>params = locals()<EOL>for key, val in iteritems(params['<STR_LIT>']):... | Search Endpoint
Search all Giphy GIFs for a word or phrase. Punctuation will be stripped and ignored. Use a plus or url encode for phrases. Example paul+rudd, ryan+gosling or american+psycho.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` functi... | f3085:c0:m14 |
def gifs_translate_get(self, api_key, s, **kwargs): | kwargs['<STR_LIT>'] = True<EOL>if kwargs.get('<STR_LIT>'):<EOL><INDENT>return self.gifs_translate_get_with_http_info(api_key, s, **kwargs)<EOL><DEDENT>else:<EOL><INDENT>(data) = self.gifs_translate_get_with_http_info(api_key, s, **kwargs)<EOL>return data<EOL><DEDENT> | Translate Endpoint
The translate API draws on search, but uses the Giphy `special sauce` to handle translating from one vocabulary to another. In this case, words and phrases to GIFs.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be... | f3085:c0:m15 |
def gifs_translate_get_with_http_info(self, api_key, s, **kwargs): | all_params = ['<STR_LIT>', '<STR_LIT:s>']<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>params = locals()<EOL>for key, val in iteritems(params['<STR_LIT>']):<EOL><INDENT>if key not in all_params:<EOL><INDENT>raise TypeErro... | Translate Endpoint
The translate API draws on search, but uses the Giphy `special sauce` to handle translating from one vocabulary to another. In this case, words and phrases to GIFs.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be... | f3085:c0:m16 |
def gifs_trending_get(self, api_key, **kwargs): | kwargs['<STR_LIT>'] = True<EOL>if kwargs.get('<STR_LIT>'):<EOL><INDENT>return self.gifs_trending_get_with_http_info(api_key, **kwargs)<EOL><DEDENT>else:<EOL><INDENT>(data) = self.gifs_trending_get_with_http_info(api_key, **kwargs)<EOL>return data<EOL><DEDENT> | Trending GIFs Endpoint
Fetch GIFs currently trending online. Hand curated by the GIPHY editorial team. The data returned mirrors the GIFs showcased on the <a href = \"http://www.giphy.com\">GIPHY homepage</a>. Returns 25 results by default.
This method makes a synchronous HTTP request by default. To make an
asynchronou... | f3085:c0:m17 |
def gifs_trending_get_with_http_info(self, api_key, **kwargs): | all_params = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>params = locals()<EOL>for key, val in iteritems(params['<STR_LIT>']):<EOL><INDENT>if key not in all_params:<EO... | Trending GIFs Endpoint
Fetch GIFs currently trending online. Hand curated by the GIPHY editorial team. The data returned mirrors the GIFs showcased on the <a href = \"http://www.giphy.com\">GIPHY homepage</a>. Returns 25 results by default.
This method makes a synchronous HTTP request by default. To make an
asynchronou... | f3085:c0:m18 |
def stickers_random_get(self, api_key, **kwargs): | kwargs['<STR_LIT>'] = True<EOL>if kwargs.get('<STR_LIT>'):<EOL><INDENT>return self.stickers_random_get_with_http_info(api_key, **kwargs)<EOL><DEDENT>else:<EOL><INDENT>(data) = self.stickers_random_get_with_http_info(api_key, **kwargs)<EOL>return data<EOL><DEDENT> | Random Sticker Endpoint
Returns a random GIF, limited by tag. Excluding the tag parameter will return a random GIF from the GIPHY catalog.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def... | f3085:c0:m19 |
def stickers_random_get_with_http_info(self, api_key, **kwargs): | all_params = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>params = locals()<EOL>for key, val in iteritems(params['<STR_LIT>']):<EOL><INDENT>if key not in all_params:<EO... | Random Sticker Endpoint
Returns a random GIF, limited by tag. Excluding the tag parameter will return a random GIF from the GIPHY catalog.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def... | f3085:c0:m20 |
def stickers_search_get(self, api_key, q, **kwargs): | kwargs['<STR_LIT>'] = True<EOL>if kwargs.get('<STR_LIT>'):<EOL><INDENT>return self.stickers_search_get_with_http_info(api_key, q, **kwargs)<EOL><DEDENT>else:<EOL><INDENT>(data) = self.stickers_search_get_with_http_info(api_key, q, **kwargs)<EOL>return data<EOL><DEDENT> | Sticker Search Endpoint
Replicates the functionality and requirements of the classic GIPHY search, but returns animated stickers rather than GIFs.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.... | f3085:c0:m21 |
def stickers_search_get_with_http_info(self, api_key, q, **kwargs): | all_params = ['<STR_LIT>', '<STR_LIT:q>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>params = locals()<EOL>for key, val in iteritems(params['<STR_LIT>']):... | Sticker Search Endpoint
Replicates the functionality and requirements of the classic GIPHY search, but returns animated stickers rather than GIFs.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.... | f3085:c0:m22 |
def stickers_translate_get(self, api_key, s, **kwargs): | kwargs['<STR_LIT>'] = True<EOL>if kwargs.get('<STR_LIT>'):<EOL><INDENT>return self.stickers_translate_get_with_http_info(api_key, s, **kwargs)<EOL><DEDENT>else:<EOL><INDENT>(data) = self.stickers_translate_get_with_http_info(api_key, s, **kwargs)<EOL>return data<EOL><DEDENT> | Sticker Translate Endpoint
The translate API draws on search, but uses the Giphy `special sauce` to handle translating from one vocabulary to another. In this case, words and phrases to GIFs.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` functi... | f3085:c0:m23 |
def stickers_translate_get_with_http_info(self, api_key, s, **kwargs): | all_params = ['<STR_LIT>', '<STR_LIT:s>']<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>params = locals()<EOL>for key, val in iteritems(params['<STR_LIT>']):<EOL><INDENT>if key not in all_params:<EOL><INDENT>raise TypeErro... | Sticker Translate Endpoint
The translate API draws on search, but uses the Giphy `special sauce` to handle translating from one vocabulary to another. In this case, words and phrases to GIFs.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` functi... | f3085:c0:m24 |
def stickers_trending_get(self, api_key, **kwargs): | kwargs['<STR_LIT>'] = True<EOL>if kwargs.get('<STR_LIT>'):<EOL><INDENT>return self.stickers_trending_get_with_http_info(api_key, **kwargs)<EOL><DEDENT>else:<EOL><INDENT>(data) = self.stickers_trending_get_with_http_info(api_key, **kwargs)<EOL>return data<EOL><DEDENT> | Trending Stickers Endpoint
Fetch GIFs currently trending online. Hand curated by the GIPHY editorial team. The data returned mirrors the GIFs showcased on the <a href = \"http://www.giphy.com\">GIPHY homepage</a>. Returns 25 results by default.
This method makes a synchronous HTTP request by default. To make an
asynchr... | f3085:c0:m25 |
def stickers_trending_get_with_http_info(self, api_key, **kwargs): | all_params = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>all_params.append('<STR_LIT>')<EOL>params = locals()<EOL>for key, val in iteritems(params['<STR_LIT>']):<EOL><INDENT>if key not in all_params:<EO... | Trending Stickers Endpoint
Fetch GIFs currently trending online. Hand curated by the GIPHY editorial team. The data returned mirrors the GIFs showcased on the <a href = \"http://www.giphy.com\">GIPHY homepage</a>. Returns 25 results by default.
This method makes a synchronous HTTP request by default. To make an
asynchr... | f3085:c0:m26 |
def flatten(value, key="<STR_LIT>", sep="<STR_LIT:.>"): | def unhandled_type():<EOL><INDENT>raise Exception("<STR_LIT>" + str(type(value)))<EOL><DEDENT>return (<EOL>({<EOL>str: lambda: [(key, value)],<EOL>unicode: lambda: [(key, value)],<EOL>int: lambda: [(key, value)],<EOL>float: lambda: [(key, value)],<EOL>NoneType: lambda: [(key, value)],<EOL>bool: lambda: [(key, value)],<... | Flattens potentially nested dictionaries into a single flat list of key/value pairs.
Similiar to dict.items() except it works for nested dictionaries, and all keys start with ".". | f3087:m0 |
def _validate(self, obj): | exclude_keys = [<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>... | Looks through every key in every object to check for null values.
If a null value is found where it shouldn't be we raise an exception and the test fails.
Keys included in `exclude_keys` are ignored, meaning they may be null. | f3087:c0:m2 |
def main(argv=None): | if argv is None:<EOL><INDENT>argv = sys.argv[<NUM_LIT:1>:]<EOL><DEDENT>usage = '<STR_LIT>'.join(__doc__.split('<STR_LIT>')[<NUM_LIT:1>:])<EOL>version = '<STR_LIT>' + __version__<EOL>args = docopt(usage, argv=argv, version=version)<EOL>return watch(args['<STR_LIT>'], args['<STR_LIT>'])<EOL> | The entry point of the application. | f3090:m0 |
def watch(directory=None, auto_clear=False, extensions=[]): | if directory and not os.path.isdir(directory):<EOL><INDENT>raise ValueError('<STR_LIT>' + directory)<EOL><DEDENT>directory = os.path.abspath(directory)<EOL>event_handler = ChangeHandler(directory, auto_clear, extensions)<EOL>event_handler.run()<EOL>observer = Observer()<EOL>observer.schedule(event_handler, path=directo... | Starts a server to render the specified file or directory containing a README. | f3092:m0 |
def run(self): | if self.auto_clear:<EOL><INDENT>os.system('<STR_LIT>' if os.name == '<STR_LIT>' else '<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>print()<EOL><DEDENT>print('<STR_LIT>')<EOL>if self.auto_clear:<EOL><INDENT>print()<EOL><DEDENT>subprocess.call('<STR_LIT>', cwd=self.directory)<EOL> | Called when a file is changed to re-run the tests with nose. | f3092:c0:m2 |
def __init__(self, rect=None, caption='<STR_LIT>', bgcolor=LIGHTGRAY, fgcolor=BLACK, font=None, normal=None, down=None, highlight=None): | if rect is None:<EOL><INDENT>self._rect = pygame.Rect(<NUM_LIT:0>, <NUM_LIT:0>, <NUM_LIT:30>, <NUM_LIT>)<EOL><DEDENT>else:<EOL><INDENT>self._rect = pygame.Rect(rect)<EOL><DEDENT>self._caption = caption<EOL>self._bgcolor = bgcolor<EOL>self._fgcolor = fgcolor<EOL>if font is None:<EOL><INDENT>self._font = PYGBUTTON_FONT<E... | Create a new button object. Parameters:
rect - The size and position of the button as a pygame.Rect object
or 4-tuple of integers.
caption - The text on the button (default is blank)
bgcolor - The background color of the button (default is a light
gray... | f3098:c0:m0 |
def handleEvent(self, eventObj): | if eventObj.type not in (MOUSEMOTION, MOUSEBUTTONUP, MOUSEBUTTONDOWN) or not self._visible:<EOL><INDENT>return []<EOL><DEDENT>retVal = []<EOL>hasExited = False<EOL>if not self.mouseOverButton and self._rect.collidepoint(eventObj.pos):<EOL><INDENT>self.mouseOverButton = True<EOL>self.mouseEnter(eventObj)<EOL>retVal.appe... | All MOUSEMOTION, MOUSEBUTTONUP, MOUSEBUTTONDOWN event objects
created by Pygame should be passed to this method. handleEvent() will
detect if the event is relevant to this button and change its state.
There are two ways that your code can respond to button-events. One is
to inherit the ... | f3098:c0:m1 |
def draw(self, surfaceObj): | if self._visible:<EOL><INDENT>if self.buttonDown:<EOL><INDENT>surfaceObj.blit(self.surfaceDown, self._rect)<EOL><DEDENT>elif self.mouseOverButton:<EOL><INDENT>surfaceObj.blit(self.surfaceHighlight, self._rect)<EOL><DEDENT>else:<EOL><INDENT>surfaceObj.blit(self.surfaceNormal, self._rect)<EOL><DEDENT><DEDENT> | Blit the current button's appearance to the surface object. | f3098:c0:m2 |
def _update(self): | if self.customSurfaces:<EOL><INDENT>self.surfaceNormal = pygame.transform.smoothscale(self.origSurfaceNormal, self._rect.size)<EOL>self.surfaceDown = pygame.transform.smoothscale(self.origSurfaceDown, self._rect.size)<EOL>self.surfaceHighlight = pygame.transform.smoothscale(self.origSurfaceHighlight, self._rect... | Redraw the button's Surface object. Call this method when the button has changed appearance. | f3098:c0:m3 |
def setSurfaces(self, normalSurface, downSurface=None, highlightSurface=None): | if downSurface is None:<EOL><INDENT>downSurface = normalSurface<EOL><DEDENT>if highlightSurface is None:<EOL><INDENT>highlightSurface = normalSurface<EOL><DEDENT>if type(normalSurface) == str:<EOL><INDENT>self.origSurfaceNormal = pygame.image.load(normalSurface)<EOL><DEDENT>if type(downSurface) == str:<EOL><INDENT>self... | Switch the button to a custom image type of button (rather than a
text button). You can specify either a pygame.Surface object or a
string of a filename to load for each of the three button appearance
states. | f3098:c0:m10 |
def __init__(self, func, on_collect=None): | self._ext_on_collect = on_collect<EOL>if hasattr(func, '<STR_LIT>'): <EOL><INDENT>self._func = weakref.ref(func.im_func)<EOL>self._obj = weakref.ref(func.im_self, self._on_collect)<EOL><DEDENT>else:<EOL><INDENT>self._func = weakref.ref(func, self._on_collect)<EOL>self._obj = None<EOL><DEDENT> | Both `on_func_collect` and `on_self_collect` should accept single
parameter that will be instance of :class:`.WeakCallable` that died.
:param callable func:
Methods to create weak reference for.
:param callable on_collect:
Callable that will be called when function is garbage collected. | f3100:c1:m0 |
@classmethod<EOL><INDENT>def instance(cls, interval=<NUM_LIT:5>):<DEDENT> | if not cls._instance:<EOL><INDENT>cls._instance = _Messenger(interval)<EOL><DEDENT>return cls._instance<EOL> | Returns existing instance of messenger. If one does not exist it will
be created and returned.
:param int interval:
Number of miliseconds that represents interval when messages will
be processed.
Note that this parameter will be used only the first time when
instance is requested, every other time it w... | f3100:c2:m0 |
def __init__(self, interval=<NUM_LIT:5>): | self._subscribers = defaultdict(list)<EOL>self._messages = Queue()<EOL>self._lock = Lock()<EOL>self._timer = DispatcherTimer()<EOL>self._timer.Interval = TimeSpan.FromMilliseconds(<NUM_LIT:5>)<EOL>self._timer.Tick += self._execute<EOL>self._timer.Start()<EOL> | :param int interval:
Number of milliseconds that represents interval when messages will
be processed. | f3100:c2:m1 |
def send(self, message, *args, **kwargs): | self._messages.put((message, args, kwargs), False)<EOL> | Sends provided message to all listeners. Message is only added to
queue and will be processed on next tick.
:param Message message:
Message to send. | f3100:c2:m2 |
def subscribe(self, message, handler): | with self._lock:<EOL><INDENT>ref = WeakCallable(handler, self._on_collect)<EOL>self._subscribers[message].append(ref)<EOL><DEDENT> | Adds hander for specified message.
:param str message:
Name of message to subscribe to.
:param callable handler:
Handler for this message type. Handler must receive single parameter
and that parameter will be instance of sent message. | f3100:c2:m3 |
def unsubscribe(self, message, handler): | with self._lock:<EOL><INDENT>self._subscribers[message].remove(WeakCallable(handler))<EOL><DEDENT> | Removes handler from message listeners.
:param str message:
Name of message to unsubscribe handler from.
:param callable handler:
Callable that should be removed as handler for `message`. | f3100:c2:m4 |
def _execute(self, sender, event_args): | with self._lock:<EOL><INDENT>while not self._messages.empty():<EOL><INDENT>msg, args, kwargs = self._messages.get(False)<EOL>for subscriber in self._subscribers[msg]:<EOL><INDENT>try:<EOL><INDENT>subscriber(*args, **kwargs)<EOL><DEDENT>except weakref.ReferenceError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT><DEDENT> | Event handler for timer that processes all queued messages. | f3100:c2:m5 |
def __init__(self, name=None): | self._messanger = _Messenger.instance()<EOL> | :param str name:
Name of signal, for easier debuging. If not provided name of
property to which signal is assigned to will be used if signal
is creates in :class:`.ViewModel` class. | f3100:c3:m0 |
def connect(self, handler): | self._messanger.subscribe(self, handler)<EOL> | Connects handler to this signal. | f3100:c3:m1 |
def disconnect(self, handler): | self._messanger.unsubscribe(self, handler)<EOL> | Disconnects handler from this singal. | f3100:c3:m2 |
def emit(self, *args, **kwargs): | self._messanger.send(self, *args, **kwargs)<EOL> | Emits this signal. As result, all handlers will be invoked. | f3100:c3:m3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.