Retrieve an association. If no handle is specified, return
        the association with the latest expiration.

        (str, str or NoneType) -> Association or NoneType
174854
def getAssociation(self, server_url, handle=None):
        
        if handle is None:
            handle = ''

        # The filename with the empty handle is a prefix of all other
        # associations for the given server URL.
        filename = self.getAssociationFilename(server_url, handle)

        if handle:
            return self._getAssociation(filename)
        else:
            association_files = os.listdir(self.association_dir)
            matching_files = []
            # strip off the path to do the comparison
            name = os.path.basename(filename)
            for association_file in association_files:
                if association_file.startswith(name):
                    matching_files.append(association_file)

            matching_associations = []
            # read the matching files and sort by time issued
            for name in matching_files:
                full_name = os.path.join(self.association_dir, name)
                association = self._getAssociation(full_name)
                if association is not None:
                    matching_associations.append(
                        (association.issued, association))

            matching_associations.sort()

            # return the most recently issued one.
            if matching_associations:
                (_, assoc) = matching_associations[-1]
                return assoc
            else:
                return None
257400
def get_last_ticker(self, symbol):
        
        params = {'symbol': symbol}

        url = u.MARKET_URL + '/market/trade'

        def _wrapper(_func):
            @wraps(_func)
            def handle():
                _func(http_get_request(url, params))

            return handle

        return _wrapper
740213
def get_association(id, **kwargs):
    
    results = search_associations(id=id, **kwargs)
    assoc = results['associations'][0] if len(results['associations']) > 0 else {}
    return assoc
1336054
def get_for_update(self, connection_name='DEFAULT', **kwargs):

        
        if not kwargs:
            raise InvalidQueryError(
                "Can not execute a query without parameters")

        obj = self.pool.connections[connection_name].session.query(
            self._model).with_for_update(
                nowait=True, of=self._model).filter_by(**kwargs).first()
        if not obj:
            raise NotFoundError('Object not found')
        return obj
291579
def get_last_error(self):
        
        error = ctypes.c_int32()
        result = self.library.Par_GetLastError(self.pointer, ctypes.byref(error))
        check_error(result, "partner")
        return error
592860
function associationKey($server_url, $handle = null) 
    {
        return $this->prefix .
               'openid_association_' .
               sha1($server_url) . '_' . sha1($handle);
    }
226607
def get(self, *args, **kwargs):
        
        return self.session.get(*args, **self.get_kwargs(**kwargs))
1313528
def get_object_handle(self, obj):
        
        if obj not in self._object_handles:
            self._object_handles[obj] = self._get_object_handle(obj=obj)

        return self._object_handles[obj]
1351193
def fetch_association(name, includes=nil)
      association = fetch_property(name)

      if includes.present? && ! @resource.association(name).loaded?
        association.includes(includes)
      else
        association
      end
    end
154605
def __get_acl(self, load):
        '''
        
        '''
        if 'eauth' not in load:
            return None
        mod = self.opts['eauth_acl_module']
        if not mod:
            mod = load['eauth']
        fstr = '{0}.acl'.format(mod)
        if fstr not in self.auth:
            return None
        fcall = salt.utils.args.format_call(
            self.auth[fstr],
            load,
            expected_extra_kws=AUTH_INTERNAL_KEYWORDS)
        try:
            return self.auth[fstr](*fcall['args'], **fcall['kwargs'])
        except Exception as e:
            log.debug('Authentication module threw %s', e)
            return None
511284
def get_object_or_this(model, this=None, *args, **kwargs):
    

    return get_object_or_None(model, *args, **kwargs) or this
572501
def save_bt_association(assoc, version)
      assoc_version_args = {
        version_id: version.id,
        foreign_key_name: assoc.foreign_key
      }

      if assoc.options[:polymorphic]
        foreign_type = @record.send(assoc.foreign_type)
        if foreign_type && ::PaperTrail.request.enabled_for_model?(foreign_type.constantize)
          assoc_version_args[:foreign_key_id] = @record.send(assoc.foreign_key)
          assoc_version_args[:foreign_type] = foreign_type
        end
      elsif ::PaperTrail.request.enabled_for_model?(assoc.klass)
        assoc_version_args[:foreign_key_id] = @record.send(assoc.foreign_key)
        assoc_version_args[:foreign_type] = assoc.klass
      end

      if assoc_version_args.key?(:foreign_key_id)
        ::PaperTrail::VersionAssociation.create(assoc_version_args)
      end
    end
303788
def last_updated(self):
        '''
        
        '''
        derived_path = self.context.request.url
        timestamp_key = self.timestamp_key_for(derived_path)

        if self.exists(self.timestamp_key_for, derived_path):
            return self.storage.get(timestamp_key)

        return None
1002014
def get_active_token(self):
        

        expire_time = self.store_handler.has_value("expires")
        access_token = self.store_handler.has_value("access_token")
        if expire_time and access_token:
            expire_time = self.store_handler.get_value("expires")
            if not datetime.now() < datetime.fromtimestamp(float(expire_time)):
                self.store_handler.delete_value("access_token")
                self.store_handler.delete_value("expires")
                logger.info('Access token expired, going to get new token')
                self.auth()
            else:
                logger.info('Access token noy expired yet')
        else:
            self.auth()
        return self.store_handler.get_value("access_token")
674320
protected function getAssoc($handle)
    {
        $oldSession = session_id();
        session_commit();
        session_id($handle);
        session_start();
        $assoc = null;
        if(!empty($_SESSION['assoc'])) {
            $assoc = $_SESSION['assoc'];
        }
        session_commit();
        if($oldSession) {
            session_id($oldSession);
            session_start();
        }
        return $assoc;
    }
912329
def get_value(self):
        
        if (self._value is None) and (self.expr is not None):
            self._value = self.expr.get_value()

        return self._value
1109132
function storeAssociation($server_url, $association)
    {
        // create Redis keys for association itself 
        // and list of associations for this server
        $associationKey = $this->associationKey($server_url, 
            $association->handle);
        $serverKey = $this->associationServerKey($server_url);
        
        // save association to server's associations' keys list
        $this->redis->lpush(
            $serverKey,
            $associationKey
        );

        // Will touch the association list expiration, to avoid filling up
        $newExpiration = ($association->issued + $association->lifetime);

        $expirationKey = $serverKey.'_expires_at';
        $expiration = $this->redis->get($expirationKey);
        if (!$expiration || $newExpiration > $expiration) {
            $this->redis->set($expirationKey, $newExpiration);
            $this->redis->expireat($serverKey, $newExpiration);
            $this->redis->expireat($expirationKey, $newExpiration);
        }

        // save association itself, will automatically expire
        $this->redis->setex(
            $associationKey,
            $newExpiration - time(),
            serialize($association)
        );
    }