Retrieve pupil data
482138
def GetPupil(self):
    
    pupil_data = _co.namedtuple('pupil_data', ['ZemaxApertureType',
                                               'ApertureValue',
                                               'entrancePupilDiameter',
                                               'entrancePupilPosition',
                                               'exitPupilDiameter',
                                               'exitPupilPosition',
                                               'ApodizationType',
                                               'ApodizationFactor'])
    data = self._ilensdataeditor.GetPupil()
    return pupil_data(*data)
845413
def get_teachers_for_school(id, opts = {})
      data, _status_code, _headers = get_teachers_for_school_with_http_info(id, opts)
      return data
    end
214136
def get_item_data(self, session, item, byte_range=None):
        

        # Parse byte range
        if byte_range is not None:
            begin, end = parse_byte_range(byte_range, max_byte=item.file_size)
        else:
            begin, end = 0, item.file_size

        # Open the file
        fp = open(item.file_name, "rb+")

        if not begin:
            return fp, item.file_type, item.file_size
        elif begin and not end:
            fp.seek(begin)
            return fp, item.file_type, item.file_size
        elif begin and end:
            fp.seek(begin)

            data = fp.read(end - begin)
            result = cStringIO.StringIO(data)

            return result, item.file_type, item.file_size
24608
def index():
    """"""
    classes = []
    with app.app_context():
        classes = set(current_app.class_references.values())
    if _get_acceptable_response_type() == JSON:
        meta_data = {}
        for cls in classes:
            meta_data[cls.endpoint()] = {
                'link': '/' + cls.endpoint(),
                'meta': '/' + cls.endpoint() + '/meta'
                }
        return jsonify(meta_data)
    else:
        return render_template('index.html', classes=classes)
1284320
def get_schools_for_teacher(id, opts = {})
      data, _status_code, _headers = get_schools_for_teacher_with_http_info(id, opts)
      return data
    end
898494
def text_to_data(self, text, elt, ps):
        '''
        '''
        prefix,localName = SplitQName(text)
        nsdict = ps.GetElementNSdict(elt)
        prefix = prefix or ''
        try:
            namespaceURI = nsdict[prefix]
        except KeyError, ex:
            raise EvaluateException('cannot resolve prefix(%s)'%prefix,
                ps.Backtrace(elt))
                
        v = (namespaceURI,localName)
        if self.pyclass is not None:
            return self.pyclass(v)    
        return v
362770
def student_visible(self):
        
        group_ids = set()
        for group in Group.objects.all():
            if group.properties.student_visible:
                group_ids.add(group.id)

        return Group.objects.filter(id__in=group_ids)
1183029
def get_data(self):
        
        return {key: "".join(chr(byte) for byte in data)
                for key, data in six.iteritems(self.data)}
603819
def get_supprates(_, data):
    
    answer = list()
    for i in range(len(data)):
        r = data[i] & 0x7f
        if r == BSS_MEMBERSHIP_SELECTOR_VHT_PHY and data[i] & 0x80:
            value = 'VHT'
        elif r == BSS_MEMBERSHIP_SELECTOR_HT_PHY and data[i] & 0x80:
            value = 'HT'
        else:
            value = '{0}.{1}'.format(int(r / 2), int(5 * (r & 1)))
        answer.append('{0}{1}'.format(value, '*' if data[i] & 0x80 else ''))
    return answer
1088223
def get_data(self):
        """"""
        data = {}
        data['guarded'] = self.guarded[:]
        data['voiced'] = copy.deepcopy(self.voiced)
        data['opers'] = copy.deepcopy(self.opers)
        data['features'] = self.features.copy()
        data['uptime'] = self.uptime.copy()
        data['abuselist'] = self.abuselist.copy()
        data['who_map'] = self.who_map.copy()
        return data
125991
def get_person_by_student_number(self, student_number):
        
        if not self.valid_student_number(student_number):
            raise InvalidStudentNumber(student_number)

        url = "{}.json?{}".format(
            PERSON_PREFIX, urlencode({"student_number": student_number}))
        response = DAO.getURL(url, {"Accept": "application/json"})

        if response.status != 200:
            raise DataFailureException(url, response.status, response.data)

        # Search does not return a full person resource
        data = json.loads(response.data)
        if not len(data["Persons"]):
            raise DataFailureException(url, 404, "No person found")

        regid = data["Persons"][0]["PersonURI"]["UWRegID"]
        return self.get_person_by_regid(regid)
462845
def _get_data(self, required_for, section=b'data'):
        """"""
        line = self.next_line()
        if line.startswith(b'data '):
            rest = line[len(b'data '):]
            if rest.startswith(b'<<'):
                return self.read_until(rest[2:])
            else:
                size = int(rest)
                read_bytes = self.read_bytes(size)
                # optional LF after data.
                next_line = self.input.readline()
                self.lineno += 1
                if len(next_line) > 1 or next_line != b'\n':
                    self.push_line(next_line[:-1])
                return read_bytes
        else:
            self.abort(errors.MissingSection, required_for, section)
17373
async def get_data(self):
        """"""
        try:
            with async_timeout.timeout(5, loop=self._loop):
                response = await self._session.get(
                    '{}/{}/'.format(self.url, self.sensor_id))

            _LOGGER.debug(
                "Response from luftdaten.info: %s", response.status)
            self.data = await response.json()
            _LOGGER.debug(self.data)
        except (asyncio.TimeoutError, aiohttp.ClientError):
            _LOGGER.error("Can not load data from luftdaten.info")
            raise exceptions.LuftdatenConnectionError()

        if not self.data:
            self.values = self.meta = None
            return

        try:
            sensor_data = sorted(
                self.data, key=lambda timestamp: timestamp['timestamp'],
                reverse=True)[0]
            print(sensor_data)

            for entry in sensor_data['sensordatavalues']:
                for measurement in self.values.keys():
                    if measurement == entry['value_type']:
                        self.values[measurement] = float(entry['value'])

            self.meta['sensor_id'] = self.sensor_id
            self.meta['longitude'] = float(
                sensor_data['location']['longitude'])
            self.meta['latitude'] = float(sensor_data['location']['latitude'])
        except (TypeError, IndexError):
            raise exceptions.LuftdatenError()
341998
def text_to_data(self, text, elt, ps):
        '''
        '''
        return String.text_to_data(self, urldecode(text), elt, ps)
294101
def get_user_lists(self, course, classroomid):
        
        tutor_list = course.get_staff()

        # Determine if user is grouped or not in the classroom
        student_list = list(self.database.classrooms.aggregate([
            {"$match": {"_id": ObjectId(classroomid)}},
            {"$unwind": "$students"},
            {"$project": {
                "students": 1,
                "grouped": {
                    "$anyElementTrue": {
                        "$map": {
                            "input": "$groups.students",
                            "as": "group",
                            "in": {
                                "$anyElementTrue": {
                                    "$map": {
                                        "input": "$$group",
                                        "as": "groupmember",
                                        "in": {"$eq": ["$$groupmember", "$students"]}
                                    }
                                }
                            }
                        }
                    }
                }
            }}
        ]))

        student_list = dict([(student["students"], student) for student in student_list])

        other_students = [entry['students'] for entry in list(self.database.classrooms.aggregate([
            {"$match": {"courseid": course.get_id(), "_id": {"$ne": ObjectId(classroomid)}}},
            {"$unwind": "$students"},
            {"$project": {"_id": 0, "students": 1}}
        ]))]

        users_info = self.user_manager.get_users_info(other_students + list(student_list.keys()) + tutor_list)

        # Order the non-registered students
        other_students = sorted(other_students, key=lambda val: (("0"+users_info[val][0]) if users_info[val] else ("1"+val)))

        return student_list, tutor_list, other_students, users_info
143792
def get_teachers(self):
        """"""
        users = User.objects.filter(user_type="teacher")
        users = users.exclude(id__in=EXTRA)
        # Add possible exceptions handling here
        users = users | User.objects.filter(id__in=[31863, 32327, 32103, 33228])

        return users
920871
def get_dataset(self, key, info):
        """"""
        logger.debug("Reading %s.", key)
        return self.file_content[key.name]