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

All Samples(3)  |  Call(0)  |  Derive(0)  |  Import(3)
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.
    Currently summary and detail resource states have the same attributes.
    """
    name = Attribute(unicode, (SUMMARY,DETAILED)) #: Name of the club.
 
    @property
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)

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.
    Currently summary and detail resource states have the same attributes.
    """
    name = Attribute(unicode, (SUMMARY,DETAILED)) #: Name of the club.
    profile_medium = Attribute(unicode, (SUMMARY,DETAILED)) #: URL to a 62x62 pixel club picture
    profile = Attribute(unicode, (SUMMARY,DETAILED)) #: URL to a 124x124 pixel club picture

src/s/t/stravalib-HEAD/stravalib/tests/test_attributes.py   stravalib(Download)
from __future__ import absolute_import, unicode_literals
 
from stravalib.attributes import EntityAttribute, SUMMARY, DETAILED
from stravalib.model import Athlete
from stravalib.tests import TestBase
            u'friend': None
        }
        athlete = EntityAttribute(Athlete, (SUMMARY,DETAILED))
        athlete.unmarshal(NON_ASCII_DATA)