:returns: list of dict representing shares informations
12378
def get_share_info(self, grantee_type=None, grantee_id=None,
                       grantee_name=None, owner=None, owner_type='name'):
        
        params = {}
        if grantee_type:
            if 'grantee' not in params.keys():
                params['grantee'] = {}
            params['grantee'].update({'type': grantee_type})
        if grantee_id:
            if 'grantee' not in params.keys():
                params['grantee'] = {}
            params['grantee'].update({'id': grantee_id})
        if grantee_name:
            if 'grantee' not in params.keys():
                params['grantee'] = {}
            params['grantee'].update({'name': grantee_name})
        if owner:
            params['owner'] = {'by': owner_type, '_content': owner}

        try:
            resp = self.request('GetShareInfo', params)
        # if user never logged in, no mailbox was created
        except ZimbraSoapServerError as e:
            if 'mailbox not found for account' in str(e):
                return []
            else:
                raise e
        if resp and isinstance(resp['share'], list):
            return resp['share']
        elif resp and isinstance(resp['share'], dict):
            return [resp['share']]
        else:
            return []
70193
def dividend_receivable(self):
        
        return sum(d['quantity'] * d['dividend_per_share'] for d in six.itervalues(self._dividend_receivable))
444393
def as_dict(self):
        

        result_dict = super(Benchmark, self).as_dict()

        statuses = list()
        titles = list()
        descriptions = list()
        front_matters = list()
        rear_matters = list()
        platforms = list()
        version = None
        profiles = list()
        groups = list()

        for child in self.children:
            if isinstance(child, Version):
                version = child.as_dict()
            elif isinstance(child, Status):
                statuses.append(child.as_dict())
            elif isinstance(child, Title):
                titles.append(child.as_dict())
            elif isinstance(child, Description):
                descriptions.append(child.as_dict())
            elif isinstance(child, FrontMatter):
                front_matters.append(child.as_dict())
            elif isinstance(child, RearMatter):
                rear_matters.append(child.as_dict())
            elif isinstance(child, Platform):
                platforms.append(child.as_dict())
            elif isinstance(child, Profile):
                profiles.append(child.as_dict())
            elif isinstance(child, Group):
                groups.append(child.as_dict())

        if version is not None:
            result_dict['version'] = version
        if len(statuses) > 0:
            result_dict['statuses'] = statuses
        if len(titles) > 0:
            result_dict['titles'] = titles
        if len(descriptions) > 0:
            result_dict['descriptions'] = descriptions
        if len(front_matters) > 0:
            result_dict['front_matters'] = front_matters
        if len(rear_matters) > 0:
            result_dict['rear_matters'] = rear_matters
        if len(platforms) > 0:
            result_dict['platforms'] = platforms
        if len(profiles) > 0:
            result_dict['profiles'] = profiles
        if len(groups) > 0:
            result_dict['groups'] = groups

        return result_dict
252397
def info(self):
        
        result = dict()
        for name, namespace in self._namespaces.items():
            result[name] = namespace.info_all()
        return result
637068
def _to_dict(self):
        
        if self.all_:
            return {"all": True}

        return {
            "keys": self.keys,
            "ranges": [keyrange._to_dict() for keyrange in self.ranges],
        }
1085857
def as_dict(self):
        
        return dict((f, self[i]) for f, i in self.__field_positions.items())
1178161
def list_share_single_file(cookie, tokens, uk, shareid):
    '''
    '''
    def parse_share_page(content):
        tree = html.fromstring(content)
        script_sel = CSS('script')
        scripts = script_sel(tree)
        for script in scripts:
            if (script.text and (script.text.find('viewsingle_param') > -1 or
                script.text.find('mpan.viewlist_param') > -1)):
                break
        else:
            logger.warn('pcs.parse_share_page: failed to get filelist, %s', url)
            return None
        start = script.text.find('viewsingle_param.list=JSON.parse(')
        end = script.text.find(');mpan.viewsingle_param.username')
        if start == -1 or end == -1:
            start = script.text.find('listArr:JSON.parse(')
            end = script.text.find('),rootPath:')
            if start == -1 or end == -1:
                return None
            else:
                json_str = script.text[start+19:end]
        else:
            json_str = script.text[start+33:end]
        try:
            return json.loads(json.loads(json_str))
        except ValueError:
            logger.warn(traceback.format_exc())
            return None

    url = ''.join([
        const.PAN_URL, 'wap/link',
        '?shareid=', shareid,
        '&uk=', uk,
        '&third=0',
    ])
    req = net.urlopen(url, headers={
        'Cookie': cookie.header_output(),
        'Referer': const.SHARE_REFERER,
    })
    if req:
        return parse_share_page(req.data.decode())
    else:
        return None
594230
def common_attributes(self):
        
        features = self._data["features"]
        if not features: return []
        elif len(features) == 1: return features[0]["properties"].keys()
        else:
            fields = set(features[0]["properties"].keys())
            for feature in features[1:]:
                fields.intersection_update(feature["properties"].keys())
            return list(fields)
1185331
def get_all(self, security):
        
        url = 'http://www.google.com/finance?q=%s' % security
        page = self._request(url)

        soup = BeautifulSoup(page)
        snapData = soup.find("table", {"class": "snap-data"})
        if snapData is None:
            raise UfException(Errors.STOCK_SYMBOL_ERROR, "Can find data for stock %s, security error?" % security)
        data = {}
        for row in snapData.findAll('tr'):
            keyTd, valTd = row.findAll('td')
            data[keyTd.getText()] = valTd.getText()

        return data
783180
public function listShares() {
		$command = sprintf(
			'%s %s %s -L %s',
			$this->system->getSmbclientPath(),
			$this->getAuthFileArgument(),
			$this->getAuth()->getExtraCommandLineArguments(),
			escapeshellarg('//' . $this->getHost())
		);
		$connection = new RawConnection($command);
		$connection->writeAuthentication($this->getAuth()->getUsername(), $this->getAuth()->getPassword());
		$connection->connect();
		if (!$connection->isValid()) {
			throw new ConnectionException($connection->readLine());
		}

		$parser = new Parser($this->timezoneProvider);

		$output = $connection->readAll();
		if (isset($output[0])) {
			$parser->checkConnectionError($output[0]);
		}

		// sometimes we get an empty line first
		if (count($output) < 2) {
			$output = $connection->readAll();
		}

		if (isset($output[0])) {
			$parser->checkConnectionError($output[0]);
		}

		$shareNames = $parser->parseListShares($output);

		$shares = [];
		foreach ($shareNames as $name => $description) {
			$shares[] = $this->getShare($name);
		}
		return $shares;
	}
421622
def to_description_dict(self):
        
        return {
            'certificateArn': self.arn,
            'certificateId': self.certificate_id,
            'status': self.status,
            'certificatePem': self.certificate_pem,
            'ownedBy': self.owner,
            'creationDate': self.creation_date,
            'lastModifiedDate': self.last_modified_date,
            'transferData': self.transfer_data
        }
727939
def contents_list_pairs(self):
        ''''''
        return (tuple(getattr(self.generator, name) for name in names)
                for names in self.info.get('contents_lists', []))
825523
def data(self):
        '''
        '''
        d = {}
        for val, key in self._fields.items():
            val = getattr(self, val)
            if val is not None:
                d[key] = val
        return d
467701
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'key') and self.key is not None:
            _dict['key'] = self.key
        if hasattr(self,
                   'matching_results') and self.matching_results is not None:
            _dict['matching_results'] = self.matching_results
        if hasattr(self, 'aggregations') and self.aggregations is not None:
            _dict['aggregations'] = [x._to_dict() for x in self.aggregations]
        return _dict
1373942
def stream_info(self):
        
        accum = {}
        for key in self.keys:
            accum[key] = self.database.xinfo_stream(key)
        return accum
1150330
def get_num_shares(self) -> Decimal:
        
        from pydatum import Datum
        today = Datum().today()
        return self.get_num_shares_on(today)
1294110
def dict(self):
        

        d = {p.key: getattr(self, p.key) for p in self.__mapper__.attrs if p.key not in ('data')}

        d['secret'] = 'not available'

        if self.secret_password:
            try:
                d['secret'] = self.decrypt_secret()
            except AccountDecryptionError:
                pass

        if self.data:
            for k, v in self.data.items():
                d[k] = v

        return {k: v for k, v in d.items()}