:returns: The age of the user associated with this profile.
766953
def age(self):
        
        if self.is_logged_in_user: 
            # Retrieve the logged-in user's profile age
            return int(self._user_age_xpb.get_text_(self.profile_tree).strip())
        else:
            # Retrieve a non logged-in user's profile age
            return int(self._age_xpb.get_text_(self.profile_tree))
938724
def generate_age(issue_time):
    """"""
    td = datetime.datetime.now() - issue_time
    age = (td.microseconds + (td.seconds + td.days * 24 * 3600)
           * 10 ** 6) / 10 ** 6
    return unicode_type(age)
212221
def age(self, as_at_date=None):
        
        if self.date_of_death != None or self.is_deceased == True:
            return None

        as_at_date = date.today() if as_at_date == None else as_at_date
        
        if self.date_of_birth != None:
            if (as_at_date.month >= self.date_of_birth.month) and (as_at_date.day >= self.date_of_birth.day):
                return (as_at_date.year - self.date_of_birth.year)
            else:
                return ((as_at_date.year - self.date_of_birth.year) -1)
        else:
            return None
757386
def is_younger(path, age):
    
    try:
        return time.time() - os.path.getmtime(path) < age

    except (OSError, TypeError):
        return False
940338
def hasUser(self):
        
        username = self.getUsername()
        if not username:
            return False
        user = api.get_user(username)
        return user is not None
734722
def pape_requirements_met?(auth_time)
      return true unless pape_request && pape_request.max_auth_age
      (Time.now - auth_time).to_i <= pape_request.max_auth_age
    end
1030207
def load_users(data_home, size):
    
    ages = [1, 18, 25, 35, 45, 50, 56, 999]

    users = {}

    if size == '100k':
        all_occupations = ['administrator',
                           'artist',
                           'doctor',
                           'educator',
                           'engineer',
                           'entertainment',
                           'executive',
                           'healthcare',
                           'homemaker',
                           'lawyer',
                           'librarian',
                           'marketing',
                           'none',
                           'other',
                           'programmer',
                           'retired',
                           'salesman',
                           'scientist',
                           'student',
                           'technician',
                           'writer']

        with open(os.path.join(data_home, 'u.user'), encoding='ISO-8859-1') as f:
            lines = list(map(lambda l: l.rstrip().split('|'), f.readlines()))

        for user_id_str, age_str, sex_str, occupation_str, zip_code in lines:
                user_vec = np.zeros(1 + 1 + 21)  # 1 categorical, 1 value, 21 categorical
                user_vec[0] = 0 if sex_str == 'M' else 1  # sex

                # age (ML1M is "age group", but 100k has actual "age")
                age = int(age_str)
                for i in range(7):
                    if age >= ages[i] and age < ages[i + 1]:
                        user_vec[1] = i
                        break

                user_vec[2 + all_occupations.index(occupation_str)] = 1  # occupation (1-of-21)
                users[int(user_id_str)] = user_vec
    elif size == '1m':
        with open(os.path.join(data_home, 'users.dat'), encoding='ISO-8859-1') as f:
            lines = list(map(lambda l: l.rstrip().split('::'), f.readlines()))

        for user_id_str, sex_str, age_str, occupation_str, zip_code in lines:
                user_vec = np.zeros(1 + 1 + 21)  # 1 categorical, 1 value, 21 categorical
                user_vec[0] = 0 if sex_str == 'M' else 1  # sex
                user_vec[1] = ages.index(int(age_str))  # age group (1, 18, ...)
                user_vec[2 + int(occupation_str)] = 1  # occupation (1-of-21)
                users[int(user_id_str)] = user_vec

    return users
271065
def get_profile(self):
        
        r = self._session.get(API_URL + "/logins/me")
        r.raise_for_status()

        return r.json()
872707
def user(self):
        
        if self._user is not None:
            return self._user

        cert = self.transport.getPeerCertificate()
        self._user = user = userForCert(self.store, cert)
        return user
528494
public function getAge()
    {
        if (!$age = $this->_headers->get('Age', 0)) {
            $age = max(time() - $this->getDate()->format('U'), 0);
        }

        return $age;
    }
921805
def _get_age(columns):
    

    # Need to check multiple places for age, year, or yrbp
    # 1. Check the column variable name
    # 2. Check for an "inferredVariableType

    age = []
    try:
        # Step 1:
        # Check for age first (exact match)
        if "age" in columns:
            # Save the values
            age = columns["age"]["values"]
        # Check for year second (exact match)
        elif "year" in columns:
            # Save the values
            age = columns["year"]["values"]
        elif "yrbp" in columns:
            # Save the values
            age = columns["yrbp"]["values"]

        # Step 2 No exact matches, check for an "inferredVariableType" : "Age" or "Year"
        if not age:
            # Loop through column variableNames
            for k, v in columns.items():
                try:
                    if v["inferredVariableType"].lower() == "age":
                        age = v["values"]
                    elif v["inferredVariableType"].lower() == "year":
                        age = v["values"]
                except Exception:
                    # Not too concerned if we error here.
                    pass

        # Step 3: No year or age found, start searching for a loose match with "age" or "year" in the variableName.
        if not age:
            # Loop through column variableNames
            for k, v in columns.items():
                k_low = k.lower()
                # Check for age in the variableName (loose match)
                if "age" in k_low:
                    # Save the values
                    age = v["values"]
                # Check for year in variableName (loose match)
                elif "year" in k_low:
                    # Save the values
                    age = v["values"]
                elif "yrbp" in k_low:
                    # Save the values
                    age = v["values"]

    # If we expected a dictionary, and didn't get one
    except AttributeError as e:
        logger_inferred_data.warn("get_age: AttributeError: {}".format(e))
    # If we were looking for values, and didn't get one
    except KeyError as e:
        logger_inferred_data.warn("get_age: KeyError: {}".format(e))
    # Fail-safe for other problems
    except Exception as e:
        logger_inferred_data.warn("get_age: Exception: {}".format(e))

    return age
577887
def age(self):
        """"""
        if self.Death:
            age =  self.Death - self.Born
        else:    
            age =  datetime.date.today() - self.Born
        return age.days
1254253
def work_experience(self, working_start_age: int = 22) -> int:
        
        age = self._store['age']
        if age == 0:
            age = self.age()

        return max(age - working_start_age, 0)
507942
def looking_for(self):
        
        looking_for = self.source_profile.looking_for
        return self.dest_user.profile.looking_for.update(
            gentation=looking_for.gentation,
            single=looking_for.single,
            near_me=looking_for.near_me,
            kinds=looking_for.kinds,
            ages=looking_for.ages
        )
539640
def current_user():
    
    user_id = current_user_id()
    guard = current_guard()
    user = guard.user_class.identify(user_id)
    PraetorianError.require_condition(
        user is not None,
        "Could not identify the current user from the current id",
    )
    return user
840531
def age(self):
        
        if not self.birthdate():
            return -1
        adjuster = 0
        today = date.today()
        birthday = self.birthdate()
        if today.month == birthday.month:
            if today.day < birthday.day:
                adjuster -= 1
        elif today.month < birthday.month:
            adjuster -= 1
        return (today.year - birthday.year) + adjuster
836101
def owner_profile(self) -> Profile:
        """"""
        if not self._owner_profile:
            self._owner_profile = Profile.from_id(self._context, self._node['owner']['id'])
        return self._owner_profile