Did I find the right examples for you? yes no

All Samples(30)  |  Call(21)  |  Derive(0)  |  Import(9)

        def unique(iterable, key=lambda x: x):
    yielded = set()
    for item in iterable:
        keyitem = key(item)
        if keyitem not in yielded:
            yielded.add(keyitem)
            yield item
        


src/g/e/Gears-0.7.2/gears/assets.py   Gears(Download)
from .compat import is_py3, str, UnicodeMixin
from .exceptions import GearsUnicodeError
from .utils import cached_property, unique
 
 
    def _iter_unique(self):
        return unique(self._iter_all(), key=lambda asset: asset.absolute_path)
 
    def _asset_from_paths(self, absolute_path, logical_path):
        attributes = AssetAttributes(self.asset.attributes.environment, logical_path)

src/g/e/gears-HEAD/gears/assets.py   gears(Download)
from .compat import is_py3, str, UnicodeMixin
from .exceptions import GearsUnicodeError
from .utils import cached_property, unique
 
 
    def _iter_unique(self):
        return unique(self._iter_all(), key=lambda asset: asset.absolute_path)
 
    def _asset_from_paths(self, absolute_path, logical_path):
        attributes = AssetAttributes(self.asset.attributes.environment, logical_path)

src/b/1/B1python-0.8.7/src/unstable.py   B1python(Download)
            # if the modified energy is inside the bounds and the current
            # energies are different, go on.
            if energies.min()>=energymin and energies.max()<=energymax and len(utils.unique(energies,lambda a,b:(abs(a-b)<energydistance)))==Nenergies:
                ok=True
            else: # if not, drop this and re-calculate new energy
 
    # find all the empty beam FSNs for E1
    ebE1fsns=utils.unique([h['FSNempty'] for h in headerE1])
    # find all the empty beam FSNs for E2
    ebE2fsns=utils.unique([h['FSNempty'] for h in headerE2])

src/b/1/B1python-0.8.7/src/B1io.py   B1python(Download)
        a list of sorted energies
    """
    return utils.unique([p['Energy'] for p in param],lambda a,b:(abs(a-b)<2))
def samplenamesfromparam(param):
    """Return the sample names
        a list of sorted sample titles
    """
    return utils.unique([p['Title'] for p in param])
 
def mandelbrot(real,imag,iters):

src/b/1/B1python-0.8.7/src/guitools.py   B1python(Download)
        if h['Title']==titleofsample:
            params.append(h.copy())
    energies=utils.unique([h['Energy'] for h in header],(lambda a,b:abs(a-b)<2))
 
    axisTransm=plt.gcf().add_axes([hborder,1-vborder-axisheight,axiswidth,axisheight])
    plt.subplot(2,2,4);
    plt.plot(fsn,map(lambda a,b:a/b,piezo,doris),'k',label='ratio')
    for e in utils.unique(energies):
        plt.plot([f for f,e1 in zip(fsn,energies) if e1==e],
                   [p/d for p,d,e1 in zip(piezo,doris,energies) if e1==e],
    plt.twinx()
    plt.plot(fsn,map(lambda a,b:a/b,monitor,doris),'m')
    for e in utils.unique(energies):
        plt.plot([f for f,e1 in zip(fsn,energies) if e1==e],
                   [m/d for m,d,e1 in zip(monitor,doris,energies) if e1==e],

src/b/1/B1python-0.8.7/src/B1macros.py   B1python(Download)
            print 'Energy calibration: %f -> %f' %(euncalib,energyreal[index]);
 
    dist=utils.unique(dist);
    if len(dist)>1:
        raise RuntimeError,'Please give data measured with the same sample-to-detector distance!';
            print 'Energy calibration: %f -> %f' %(euncalib,energyreal[index]);
 
    dist=utils.unique(dist);
    if len(dist)>1:
        raise RuntimeError,'Please give data measured with the same sample-to-detector distance!';
        return
    if samples is None:
        samples=utils.unique([p['Title'] for p in params]);
    if type(samples)!=types.ListType:
        samples=[samples]
            print 'No measurements of %s in the current sequence.' % s
            continue # with the next sample
        dists=utils.unique([p['Dist'] for p in sparams]);
        for d in dists:
            if original_qrange is None:
        print "FSNs:",repr(classfsns)
        #find the distances
        dists=utils.unique([p['Dist'] for p in plist])
        onlyone=False
        if len(dists)<2: #less than two distances: no point of uniting!

src/g/e/Gears-0.7.2/gears/environment.py   Gears(Download)
    SemicolonsProcessor
)
from .utils import get_condition_func, unique
 
 
        paths = map(lambda p: p if p.endswith('*') else p + '*', paths)
 
        results = unique(self._list_paths(paths), lambda x: x[0])
        for logical_path, absolute_path in results:
            asset_attributes = AssetAttributes(self, logical_path)

src/g/e/gears-HEAD/gears/environment.py   gears(Download)
    SemicolonsProcessor
)
from .utils import get_condition_func, unique
 
 
        paths = map(lambda p: p if p.endswith('*') else p + '*', paths)
 
        results = unique(self._list_paths(paths), lambda x: x[0])
        for logical_path, absolute_path in results:
            asset_attributes = AssetAttributes(self, logical_path)

src/b/1/B1python-0.8.7/src/asaxseval.py   B1python(Download)
    """
    if samples is None:
        samples=utils.unique([param[i]['Title'] for i in range(0,len(data))]);
        print "Found samples: ", samples
    if type(samples)!=types.ListType:

src/a/r/arubomu-1.0/old/lib/python/album-old.py   arubomu(Download)
import types
 
from utils import unique
import strxtra
from curses.ascii import isalnum
def outputMany(os, obj, tagname):
    values = filter(None, map(lambda x: getattr(x, tagname), obj))
    uvalues = unique(values)
    fmt = '   <%s>%%s</%s>' % (tagname, tagname)
    for v in uvalues:
def addMany(xmlobj, listobj, tagname):
    values = filter(None, map(lambda x: getattr(x, tagname), listobj))
    uvalues = unique(values)
    for v in uvalues:
        condAddTextElement(xmlobj, tagname, v)

  1 | 2  Next