:return:
        a seeder function that returns an event's source id only if that event's
        source space equals to ``event_space``.
427140
def per_event_source_id(event_space):
    
    def f(event):
        if is_event(event):
            v = peel(event)
            if v['source']['space'] == event_space:
                return v['source']['id']
            else:
                return None
        else:
            return None
    return _wrap_none(f)
459176
def PopEvent(self):
    
    try:
      _, _, _, event = heapq.heappop(self._heap)
      return event

    except IndexError:
      return None
757186
protected void ensureEventSource(UUID eventSource, Event event) {
		if (event.getSource() == null) {
			if (eventSource != null) {
				event.setSource(new Address(getSpaceID(), eventSource));
			} else {
				throw new AssertionError("Every event must have a source"); //$NON-NLS-1$
			}
		}
	}
199738
def get_event_name(lambda_name, name):
        
        return '{prefix:.{width}}-{postfix}'.format(prefix=lambda_name, width=max(0, 63 - len(name)), postfix=name)[:64]
1035572
def _FormatSource(self, event):
    
    _, source = self._output_mediator.GetFormattedSources(event)
    if source is None:
      data_type = getattr(event, 'data_type', 'UNKNOWN')
      raise errors.NoFormatterFound(
          'Unable to find event formatter for: {0:s}.'.format(data_type))

    return source
1353460
def GetNewEventId(self, event_time=None):
    """"""
    if event_time is None:
      event_time = int(time.time() * 1e6)

    return "%s:%s:%s" % (event_time, socket.gethostname(), os.getpid())
306056
def get_events(self):
        
        res = copy.copy(self.events)
        del self.events[:]
        return res
415253
def PopEventSource(self):
    
    try:
      _, _, event_source = heapq.heappop(self._heap)

    except IndexError:
      return None

    return event_source
309913
def get_space_guid(self):
        
        if 'PREDIX_SPACE_GUID' in os.environ:
            return os.environ['PREDIX_SPACE_GUID']
        else:
            info = self._get_space_info()
            for key in ('Guid', 'GUID'):
                if key in info.keys():
                    return info[key]
            raise ValueError('Unable to determine cf space guid')
23939
function _reseedSync() {
    if(ctx.pools[0].messageLength >= 32) {
      return _seed();
    }
    // not enough seed data...
    var needed = (32 - ctx.pools[0].messageLength) << 5;
    ctx.collect(ctx.seedFileSync(needed));
    _seed();
  }
799954
def _getEventFromUid(self, request, uid):
        """"""
        event = getEventFromUid(request, uid)
        if event.get_ancestors().filter(id=self.id).exists():
            # only return event if it is a descendant
            return event
847213
def get_event_from_name(self, event_name):
        
        return next((e for e in self.events if e.name == event_name), None)
1274647
def find_or_create_event_by_id(id, &blk)      
      event = id ? find_event_by_id(id)[0] : nil

      if event
        setup_event(event, &blk)
      elsif id
        event = Event.new(id: id, new_event_with_id_specified: true)
        setup_event(event, &blk)
      else
        event = Event.new
        setup_event(event, &blk)
      end
    end
603482
public String newSessionId(long seedTerm) {
        synchronized (random) {
            long r0;
            if (weakRandom) {
                r0 = hashCode() ^ Runtime.getRuntime().freeMemory() ^ random.nextInt() ^ (seedTerm << 32);
            } else {
                r0 = random.nextLong();
            }
            if (r0 < 0) {
                r0 = -r0;
            }

            long r1;
            if (weakRandom) {
                r1 = hashCode() ^ Runtime.getRuntime().freeMemory() ^ random.nextInt() ^ (seedTerm << 32);
            } else {
                r1 = random.nextLong();
            }
            if (r1 < 0) {
                r1 = -r1;
            }

            StringBuilder id = new StringBuilder();
            if (!StringUtils.isEmpty(groupName)) {
                id.append(groupName);
            }
            id.append(Long.toString(r0,36));
            id.append(Long.toString(r1,36));
            id.append(counter.getAndIncrement());
            return id.toString();
        }
    }
1042040
def with_source(self, lease):
        
        self.partition_id = lease.partition_id
        self.epoch = lease.epoch
        self.owner = lease.owner
        self.token = lease.token
        self.event_processor_context = lease.event_processor_context
241707
def get_function_for_aws_event(self, record):
        
        if 's3' in record:
            if ':' in record['s3']['configurationId']:
                return record['s3']['configurationId'].split(':')[-1]

        arn = None
        if 'Sns' in record:
            try:
                message = json.loads(record['Sns']['Message'])
                if message.get('command'):
                    return message['command']
            except ValueError:
                pass
            arn = record['Sns'].get('TopicArn')
        elif 'dynamodb' in record or 'kinesis' in record:
            arn = record.get('eventSourceARN')
        elif 'eventSource' in record and record.get('eventSource') == 'aws:sqs':
            arn = record.get('eventSourceARN')
        elif 's3' in record:
            arn = record['s3']['bucket']['arn']

        if arn:
            return self.settings.AWS_EVENT_MAPPING.get(arn)

        return None
1157736
public SourceType identifyWithEventName(String source, String eventName) {
        if (eventName.startsWith(CREATE_EVENT_PREFIX)) {
            return getCloudTrailSourceType(source);
        }
        return SourceType.Other;
    }