Did I find the right examples for you? yes no      Crawl my project      Python Jobs

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/s/t/stravalib-0.2.2/stravalib/model.py   stravalib(Download)
from stravalib import unithelper as uh
 
from stravalib.attributes import (META, SUMMARY, DETAILED, Attribute, 
                                  TimestampAttribute, LocationAttribute, EntityCollection, 
                                  EntityAttribute, TimeIntervalAttribute, TimezoneAttribute,
class ResourceStateEntity(BaseEntity):
    """
    Mixin for entities that include the resource_state attribute.
    """
    resource_state = Attribute(int, (META,SUMMARY,DETAILED)) #: The detail-level for this entity.
class IdentifiableEntity(ResourceStateEntity):
    """
    Mixin for entities that include an ID attribute.
    """
    id = Attribute(int, (META,SUMMARY,DETAILED)) #: The numeric ID for this entity.
class Gear(IdentifiableEntity):
    """
    """
    id = Attribute(unicode, (META,SUMMARY,DETAILED)) #: Alpha-numeric gear ID.
    name = Attribute(unicode, (SUMMARY,DETAILED)) #: Name athlete entered for bike (does not apply to shoes)
class ActivityComment(LoadableEntity):
    activity_id = Attribute(int, (META,SUMMARY,DETAILED)) #: ID of activity
    text = Attribute(unicode, (META,SUMMARY,DETAILED)) #: Text of comment
    created_at = TimestampAttribute((SUMMARY,DETAILED)) #: :class:`datetime.datetime` when was coment created
    athlete = EntityAttribute(Athlete, (SUMMARY,DETAILED)) #: Associated :class:`stravalib.model.Athlete` (summary-level representation)

src/s/t/stravalib-HEAD/stravalib/model.py   stravalib(Download)
from stravalib import unithelper as uh
 
from stravalib.attributes import (META, SUMMARY, DETAILED, Attribute, 
                                  TimestampAttribute, LocationAttribute, EntityCollection, 
                                  EntityAttribute, TimeIntervalAttribute, TimezoneAttribute,
class ResourceStateEntity(BaseEntity):
    """
    Mixin for entities that include the resource_state attribute.
    """
    resource_state = Attribute(int, (META,SUMMARY,DETAILED)) #: The detail-level for this entity.
class IdentifiableEntity(ResourceStateEntity):
    """
    Mixin for entities that include an ID attribute.
    """
    id = Attribute(int, (META,SUMMARY,DETAILED)) #: The numeric ID for this entity.
class Gear(IdentifiableEntity):
    """
    """
    id = Attribute(unicode, (META,SUMMARY,DETAILED)) #: Alpha-numeric gear ID.
    name = Attribute(unicode, (SUMMARY,DETAILED)) #: Name athlete entered for bike (does not apply to shoes)
class ActivityComment(LoadableEntity):
    activity_id = Attribute(int, (META,SUMMARY,DETAILED)) #: ID of activity
    text = Attribute(unicode, (META,SUMMARY,DETAILED)) #: Text of comment
    created_at = TimestampAttribute((SUMMARY,DETAILED)) #: :class:`datetime.datetime` when was coment created
    athlete = EntityAttribute(Athlete, (SUMMARY,DETAILED)) #: Associated :class:`stravalib.model.Athlete` (summary-level representation)