Returns the GUID for the organization currently targeted.
13740
def get_organization_guid(self):
        
        if 'PREDIX_ORGANIZATION_GUID' in os.environ:
            return os.environ['PREDIX_ORGANIZATION_GUID']
        else:
            info = self._get_organization_info()
            for key in ('Guid', 'GUID'):
                if key in info.keys():
                    return info[key]
            raise ValueError('Unable to determine cf organization guid')
165229
function getGuildID($guild) {
        if($guild === null || $guild === 'global') {
            return 'global';
        }
        
        return $this->client->guilds->resolve($guild)->id;
    }
860046
def get_type_id(context, **kw):
    
    portal_type = kw.get("portal_type", None)
    if portal_type:
        return portal_type

    # Override by provided marker interface
    if IAnalysisRequestPartition.providedBy(context):
        return "AnalysisRequestPartition"
    elif IAnalysisRequestRetest.providedBy(context):
        return "AnalysisRequestRetest"
    elif IAnalysisRequestSecondary.providedBy(context):
        return "AnalysisRequestSecondary"

    return api.get_portal_type(context)
568692
def organization_related(self, id, **kwargs):
        ""
        api_path = "/api/v2/organizations/{id}/related.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, **kwargs)
211492
public static function guid()
    {
        return sprintf(
            '%s-%s-%s-%s-%s',
            bin2hex(openssl_random_pseudo_bytes(4)),
            bin2hex(openssl_random_pseudo_bytes(2)),
            bin2hex(openssl_random_pseudo_bytes(2)),
            bin2hex(openssl_random_pseudo_bytes(2)),
            bin2hex(openssl_random_pseudo_bytes(6))
        );
    }
381621
public DbOrganization getOrganization(final String organizationId) {
        final DbOrganization dbOrganization = repositoryHandler.getOrganization(organizationId);

        if(dbOrganization == null){
            throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND)
                    .entity("Organization " + organizationId + " does not exist.").build());
        }

        return dbOrganization;
    }
758800
def _get_resource_uri(self, guid=None):
        
        uri = self.uri + '/v1/resource'
        if guid:
            uri += '/' + urllib.quote_plus(guid)
        return uri
918774
public function getListEmployeesManager($guid = null, $limit = CAKE_LDAP_SYNC_AD_LIMIT) {
		$result = [];
		if (!$this->hasField('manager_id')) {
			return $result;
		}

		$conditions = [];
		if (!empty($guid)) {
			$conditions[$this->alias . '.' . CAKE_LDAP_LDAP_ATTRIBUTE_OBJECT_GUID] = $guid;
		}
		$fields = [
			$this->alias . '.id',
			$this->alias . '.manager_id',
			$this->alias . '.' . $this->displayField . ' AS name',
		];
		$order = [
			$this->alias . '.id' => 'asc',
		];
		$this->recursive = -1;
		$data = $this->find('all', compact('fields', 'conditions', 'order', 'limit'));
		if (empty($data)) {
			return $result;
		}

		$result = Hash::combine($data, '{n}.' . $this->alias . '.id', '{n}.' . $this->alias);

		return $result;
	}
895130
public function getOrganizationIdByUrl()
    {
        $urls    = $this->getOrganizationUrls();
        $current = $this->util->getCurrentURI();

        if (isset($urls[$current])) {
            return $urls[$current];
        }
    }
341484
protected PortletRequestInfoImpl getTargetedPortletRequestInfo(
            final PortalRequestInfoImpl portalRequestInfo,
            final PortletRequestInfoImpl targetedPortletRequestInfo,
            final IPortletWindowId targetedPortletWindowId) {

        if (targetedPortletWindowId == null) {
            return targetedPortletRequestInfo;
        }

        return portalRequestInfo.getPortletRequestInfo(targetedPortletWindowId);
    }
830823
public function getActiveOrganizationId()
    {
        $request = $this->getRequest();
        if ($request->isPost()) {
            $orgId = parent::getActiveOrganizationId();
            $topId = $request->getParam($this->topOrganizationFieldName);

            $children = $this->getChildOrganizations($topId);
            if ($orgId && isset($children[$orgId])) {
                return $orgId;
            }

            return $topId;
        }
    }
812972
def guid(self):
        '''
        
        '''
        iden = hashlib.md5()
        props = {'size': self.size}

        for name, item in self.hashes:
            iden.update(item.digest())
            props[name] = item.hexdigest()

        return iden.hexdigest(), props
1124144
def identifier_director(**kwargs):
    """"""
    ark = kwargs.get('ark', None)
    domain_name = kwargs.get('domain_name', None)
    # Set default scheme if it is None or is not supplied.
    scheme = kwargs.get('scheme') or 'http'
    qualifier = kwargs.get('qualifier', None)
    content = kwargs.get('content', '')
    # See if the ark and domain name were given.
    if ark and qualifier == 'ark':
        content = 'ark: %s' % ark
    if domain_name and ark and qualifier == 'permalink':
        # Create the permalink URL.
        if not domain_name.endswith('/'):
            domain_name += '/'
        permalink_url = '%s://%s%s' % (scheme, domain_name, ark)
        # Make sure it has a trailing slash.
        if not permalink_url.endswith('/'):
            permalink_url += '/'
        content = permalink_url
    else:
        if qualifier:
            content = '%s: %s' % (string.lower(qualifier), content)
    return DCIdentifier(content=content)
827797
def identifier_director(**kwargs):
    """"""
    ark = kwargs.get('ark', None)
    qualifier = kwargs.get('qualifier', None)
    content = kwargs.get('content', '')

    # See if the ark and domain name were given.
    if ark:
        content = 'http://digital.library.unt.edu/%s' % ark
    elif qualifier:
        content = '%s: %s' % (qualifier, content)
    return ETD_MSIdentifier(content=content)
553091
def _target_id_from_htm(self, line):
        
        # Detecting modern mbed.htm file format
        m = re.search("\\?code=([a-fA-F0-9]+)", line)
        if m:
            result = m.groups()[0]
            return result
        # Last resort, we can try to see if old mbed.htm format is there
        m = re.search("\\?auth=([a-fA-F0-9]+)", line)
        if m:
            result = m.groups()[0]
            return result

        return None
1370408
def getTarget(self):
        
        return self.getCenter().offset(self._target.x, self._target.y)
493665
def identifier_director(**kwargs):
    """"""
    qualifier = kwargs.get('qualifier', '')
    content = kwargs.get('content', '')
    if qualifier == 'ISBN':
        return CitationISBN(content=content)
    elif qualifier == 'ISSN':
        return CitationISSN(content=content)
    elif qualifier == 'DOI':
        return CitationDOI(content=content)
    elif qualifier == 'REP-NO':
        return CitationTechnicalReportNumber(content=content)
    else:
        return None