Did I find the right examples for you? yes no

All Samples(2)  |  Call(0)  |  Derive(0)  |  Import(2)
int(x=0) -> int or long
int(x, base=10) -> int or long

Convert a number or string to an integer, or return 0 if no arguments
are given.  If x is floating point, the conversion truncates towards zero.
If x is outside the integer range, the function returns a long instead.

If x is not a number or if base is given, then x must be a string or
Unicode object representing an integer literal in the given base.  The
literal can be preceded by '+' or '-' and be surrounded by whitespace.(more...)

src/d/j/django-dash-0.4.4/src/dash/contrib/plugins/dummy/forms.py   django-dash(Download)
 
from dash.base import DashboardPluginFormBase
from dash.contrib.plugins.dummy.defaults import LANGUAGE_CHOICES, LANGUAGE_CHOICES_KEYS, DEFAULT_MAX_CHARS
from dash.widgets import BooleanRadioSelect
 
        ("generate_lipsum", False),
        ("lipsum_language", ""),
        ("lipsum_max_chars", DEFAULT_MAX_CHARS),
        ("text", "")
    ]
    lipsum_language = forms.ChoiceField(label=_("Language"), required=False, choices=LANGUAGE_CHOICES)
    lipsum_max_chars = forms.IntegerField(label=_("Max number of chars for generated text"), required=True,
                                          initial=DEFAULT_MAX_CHARS)
    text = forms.CharField(label=_("Generated lorem ipsum text"), required=False, widget=forms.widgets.HiddenInput)
 
                    truncator = Truncator(text)
                    self.cleaned_data['text'] = truncator.chars(
                        self.cleaned_data.get('lipsum_max_chars', DEFAULT_MAX_CHARS)
                        )
            except Exception as e:

src/d/j/django-dash-HEAD/src/dash/contrib/plugins/dummy/forms.py   django-dash(Download)
 
from dash.base import DashboardPluginFormBase
from dash.contrib.plugins.dummy.defaults import LANGUAGE_CHOICES, LANGUAGE_CHOICES_KEYS, DEFAULT_MAX_CHARS
from dash.widgets import BooleanRadioSelect
 
        ("generate_lipsum", False),
        ("lipsum_language", ""),
        ("lipsum_max_chars", DEFAULT_MAX_CHARS),
        ("text", "")
    ]
    lipsum_language = forms.ChoiceField(label=_("Language"), required=False, choices=LANGUAGE_CHOICES)
    lipsum_max_chars = forms.IntegerField(label=_("Max number of chars for generated text"), required=True,
                                          initial=DEFAULT_MAX_CHARS)
    text = forms.CharField(label=_("Generated lorem ipsum text"), required=False, widget=forms.widgets.HiddenInput)
 
                    truncator = Truncator(text)
                    self.cleaned_data['text'] = truncator.chars(
                        self.cleaned_data.get('lipsum_max_chars', DEFAULT_MAX_CHARS)
                        )
            except Exception as e: