Get the data about a home
549653
def get_home(self, home_id=None):
        
        now = datetime.datetime.utcnow()
        if self.home and now < self.home_refresh_at:
            return self.home

        if not self._do_auth():
            raise RuntimeError("Unable to login")

        if home_id is None:
            home_id = self.home_id

        url = self.api_base_url + "Home/GetHomeById"

        params = {
            "homeId": home_id
        }

        headers = {
            "Accept": "application/json",
            'Authorization':
                'bearer ' + self.login_data['token']['accessToken']
        }

        response = requests.get(
            url, params=params, headers=headers, timeout=10)

        if response.status_code != 200:
            raise RuntimeError(
                "{} response code when getting home".format(
                    response.status_code))

        home = response.json()

        if self.cache_home:
            self.home = home
            self.home_refresh_at = (datetime.datetime.utcnow()
                                    + datetime.timedelta(minutes=5))

        return home
1071391
def home(request):
    """"""
    recent_uploads = Dataset.objects.order_by('-date_uploaded')[:11]

    email_list = [upload.uploaded_by.strip() for upload in recent_uploads]
    # print all_staff

    emails_names = grab_names_from_emails(email_list)
    # print emails_names

    for upload in recent_uploads:
        for item in emails_names:
            if upload.uploaded_by == item:
                upload.fullName = emails_names[item]

    for upload in recent_uploads:
        if not hasattr(upload, 'fullName'):
            upload.fullName = upload.uploaded_by

    return render(
        request,
        'datafreezer/home.html',
        {
            'recent_uploads': recent_uploads,
            'heading': 'Most Recent Uploads'
        }
    )
930591
def getAllMetadata(self, remote, address):
        """"""
        try:
            return self.proxies["%s-%s" % (self._interface_id, remote)].getAllMetadata(address)
        except Exception as err:
            LOG.debug("ServerThread.getAllMetadata: Exception: %s" % str(err))
207081
def get_data():
    """"""
    data, targets = make_classification(
        n_samples=1000,
        n_features=45,
        n_informative=12,
        n_redundant=7,
        random_state=134985745,
    )
    return data, targets
240015
def data():
    """"""
    # defining columns
    columns = [
        ColumnDT(User.id),
        ColumnDT(User.name),
        ColumnDT(Address.description),
        ColumnDT(User.created_at)
    ]

    # defining the initial query depending on your purpose
    query = db.session.query().select_from(User).join(Address).filter(
        Address.id > 14)

    # GET parameters
    params = request.args.to_dict()

    # instantiating a DataTable for the query and table needed
    rowTable = DataTables(params, query, columns)

    # returns what is needed by DataTable
    return jsonify(rowTable.output_result())
1305873
function() {

            var data = {};
            var properties = this.__getPropertiesParam();

            for (var property in properties) {
                data[property] = this.__processData(this.__getPropertyValue(property));
            }

            return data;
        }
888002
private function extractYedProperties()
	{
		foreach ($this->_mapper as $attrName => $xp) {
			$nodeList = $this->_xp->query($xp);
			if ($nodeList->length != 0) {
				$this->_yedProperties[$attrName] = $nodeList->item(0)->value;
			}
		}
	}
270879
def personsAtHome(self, home=None):
        
        if not home: home = self.default_home
        home_data = self.homeByName(home)
        atHome = []
        for p in home_data['persons']:
            #Only check known persons
            if 'pseudo' in p:
                if not p["out_of_sight"]:
                    atHome.append(p['pseudo'])
        return atHome
1267707
def get_datatype(self, propid):
        """"""
        if _debug: Object._debug("get_datatype %r", propid)

        # get the property
        prop = self._properties.get(propid)
        if not prop:
            raise PropertyError(propid)

        # return the datatype
        return prop.datatype
961439
def set_data(self, source_data):
        
        self.region_name = source_data['region']['@name']
        self.region_id = source_data['region']['@id']
        self.region_type =  source_data['region']['@type']
        self.zillow_home_value_index = source_data.get('zindexValue', None)
        self.overview_link =  source_data['region']['links']['overview']
        self.fsbo_link =  source_data['region']['links']['forSaleByOwner']
        self.sale_link =  source_data['region']['links']['forSale']
1122180
def data(request):
    """"""
    columns = [
        ColumnDT(User.id),
        ColumnDT(User.name),
        ColumnDT(Address.description),
        ColumnDT(func.strftime("%d-%m-%Y", User.birthday)),
        ColumnDT(User.age)
    ]

    query = DBSession.query().select_from(User).join(Address).filter(
        Address.id > 4)

    rowTable = DataTables(request.GET, query, columns)

    return rowTable.output_result()
592635
def get_homes(self, query=None, gps_lat=None, gps_lng=None, offset=0, items_per_grid=8):
        
        params = {
            'is_guided_search': 'true',
            'version': '1.3.9',
            'section_offset': '0',
            'items_offset': str(offset),
            'adults': '0',
            'screen_size': 'small',
            'source': 'explore_tabs',
            'items_per_grid': str(items_per_grid),
            '_format': 'for_explore_search_native',
            'metadata_only': 'false',
            'refinement_paths[]': '/homes',
            'timezone': 'Europe/Lisbon',
            'satori_version': '1.0.7'
        }

        if not query and not (gps_lat and gps_lng):
            raise MissingParameterError("Missing query or gps coordinates")

        if query:
            params['query'] = query

        if gps_lat and gps_lng:
            params['gps_lat'] = gps_lat
            params['gps_lng'] = gps_lng

        r = self._session.get(API_URL + '/explore_tabs', params=params)
        r.raise_for_status()

        return r.json()
152765
def _update_details(self,data):
        ''''''
        # DeviceName, IconID, HouseID, DeviceID always present
        self.device_id = data['DeviceID']
        self.device_name = data['DeviceName']
        self.properties = data
307418
def get_model_home():
    '''
    
    '''
    d = os.path.join(get_data_home(), 'nnp_models')
    if not os.path.isdir(d):
        os.makedirs(d)
    return d
304153
def get_deep_search_results(self, address, zipcode):
        

        url = 'http://www.zillow.com/webservice/GetDeepSearchResults.htm'
        params = {
            'address': address,
            'citystatezip': zipcode,
            'zws-id': self.api_key
        }
        return self.get_data(url, params)
43417
def info(self):
        """"""

        return self._h._get_resource(
            resource=('apps', self.name),
            obj=App,
        )
776707
def properties(self):
        """"""
        properties = {'id': self._id}
        if self._name is not None:
            properties['name'] = self._name

        return properties