:type span_datas: list of :class:
            `~opencensus.trace.span_data.SpanData`
        :param span_datas:
            SpanData tuples to emit
332431
def emit(self, span_datas):
        
        jaeger_spans = self.translate_to_jaeger(span_datas)

        batch = jaeger.Batch(
            spans=jaeger_spans,
            process=jaeger.Process(serviceName=self.service_name))

        if self.collector is not None:
            self.collector.export(batch)
        self.agent_client.export(batch)
160430
@Benchmark
  @BenchmarkMode(Mode.SampleTime)
  @OutputTimeUnit(TimeUnit.NANOSECONDS)
  public byte[] toBinarySpanContext(Data data) {
    return data.binaryFormat.toByteArray(data.spanContext);
  }
1253333
def _match_channels_to_data(self, data):
        

        data = self._format_data(data)

        matched_channels = []
        for spectrum in data:
            match = self._overlapping_channels(spectrum.disp)
            if not match:
                # TODO: make this warning only appear once.
                logger.warn("No model spectra found matching data channel from "
                    "{0:.0f}-{1:.0f} Angstroms. These data will be ignored."\
                    .format(spectrum.disp[0], spectrum.disp[-1]))

            if len(match) > 1:
                raise ValueError("cannot match multiple channels for one spec")

            if len(match) == 0:
                match = [None]

            matched_channels.append(match[0])

        missing_channels = set(self.channel_names).difference(matched_channels)

        # Now which parameters should be ignored?
        ignore_parameters = []
        if missing_channels:
            for channel in missing_channels:
                ignore_parameters.extend(
                    set(self.parameters).intersection([_.format(channel) \
                        for _ in ("resolution_{}", "f_{}", "z_{}")]))
                
                ignore_parameters.extend(["continuum_{0}_{1}".format(channel, i)\
                    for i in range(self._configuration["model"].get("continuum",
                        {}).get(channel, -1) + 1)])

        if ignore_parameters:
            logger.warn("Ignoring the following model parameters because there "
                "are no data for that channel: {}".format(", ".join(
                    ignore_parameters)))

        return (matched_channels, missing_channels, ignore_parameters)
580330
public function spans()
    {
        // each span returned from opencensus_trace_list should be a
        // OpenCensus\Span object
        $traceId = $this->spanContext()->traceId();
        return array_map(function ($span) use ($traceId) {
            return $this->mapSpan($span, $traceId);
        }, opencensus_trace_list());
    }
203831
def emit(self, data_frame):
        
        if self.result is not None:
            raise MultipleEmitsError()
        data_frame.columns = [self.prefix + '__' + c
                              for c in data_frame.columns]
        self.result = data_frame
931598
def list_data(
		self, previous_data=False, prompt=False, console_row=False,
		console_row_to_cursor=False, console_row_from_cursor=False
	):
		
		return self.split(self.data(
			previous_data, prompt, console_row, console_row_to_cursor, console_row_from_cursor
		))
1105639
def interpret_span(text_spans: str) -> List[int]:
    
    m = regex.match("^(?:(?:([\(\[]\d+, \d+[\)\]])|({\d+}))[,]?\s*)+$",
                    text_spans)

    spans = m.captures(1) + m.captures(2)

    int_spans = []
    for span in spans:
        ints = list(map(int,
                        span[1: -1].split(',')))
        if span[0] == '(':
            ints[0] += 1
        if span[-1] == ']':
            ints[1] += 1
        if span.startswith('{'):
            assert(len(ints) == 1)
            ints.append(ints[0] + 1)

        assert(len(ints) == 2)

        int_spans.append(ints)

    # Merge consecutive spans
    ret = []
    cur_span = int_spans[0]
    for (start, end) in int_spans[1:]:
        if start - 1 == cur_span[-1]:
            cur_span = (cur_span[0],
                        end)
        else:
            ret.append(cur_span)
            cur_span = (start, end)

    if (not ret) or (cur_span != ret[-1]):
        ret.append(cur_span)

    return ret[0]
577443
def __default_emit_trace(self, data):
        
        message = format_trace_data(data)
        self.io.logger.info(message)
65576
def start_basic_span(self, request):
        
        # noinspection PyBroadException
        try:
            # Currently Java does not populate Tracing field, so do not
            # mistaken it for a real trace ID.
            if request.tracing.trace_id:
                context = self.tracer.extract(
                    format=ZIPKIN_SPAN_FORMAT,
                    carrier=request.tracing)
                self.span = self.tracer.start_span(
                    operation_name=request.endpoint,
                    child_of=context,
                    tags={tags.SPAN_KIND: tags.SPAN_KIND_RPC_SERVER},
                )
        except opentracing.UnsupportedFormatException:
            pass  # tracer might not support Zipkin format
        except:
            log.exception('Cannot extract tracing span from Trace field')
1319951
static Span toSpanProto(SpanData spanData) {
    SpanContext spanContext = spanData.getContext();
    TraceId traceId = spanContext.getTraceId();
    SpanId spanId = spanContext.getSpanId();
    Span.Builder spanBuilder =
        Span.newBuilder()
            .setTraceId(toByteString(traceId.getBytes()))
            .setSpanId(toByteString(spanId.getBytes()))
            .setTracestate(toTracestateProto(spanContext.getTracestate()))
            .setName(toTruncatableStringProto(spanData.getName()))
            .setStartTime(toTimestampProto(spanData.getStartTimestamp()))
            .setAttributes(toAttributesProto(spanData.getAttributes()))
            .setTimeEvents(
                toTimeEventsProto(spanData.getAnnotations(), spanData.getMessageEvents()))
            .setLinks(toLinksProto(spanData.getLinks()));

    Kind kind = spanData.getKind();
    if (kind != null) {
      spanBuilder.setKind(toSpanKindProto(kind));
    }

    io.opencensus.trace.Status status = spanData.getStatus();
    if (status != null) {
      spanBuilder.setStatus(toStatusProto(status));
    }

    Timestamp end = spanData.getEndTimestamp();
    if (end != null) {
      spanBuilder.setEndTime(toTimestampProto(end));
    }

    Integer childSpanCount = spanData.getChildSpanCount();
    if (childSpanCount != null) {
      spanBuilder.setChildSpanCount(UInt32Value.newBuilder().setValue(childSpanCount).build());
    }

    Boolean hasRemoteParent = spanData.getHasRemoteParent();
    if (hasRemoteParent != null) {
      spanBuilder.setSameProcessAsParentSpan(BoolValue.of(!hasRemoteParent));
    }

    SpanId parentSpanId = spanData.getParentSpanId();
    if (parentSpanId != null && parentSpanId.isValid()) {
      spanBuilder.setParentSpanId(toByteString(parentSpanId.getBytes()));
    }

    return spanBuilder.build();
  }
1241401
def check_data(self, data):
        
        data_objs = {
            data_src: data.objects.get(data_src) for data_src in data.layer
        }
        self._is_data_loaded = all(data_objs.values())
        return data_objs
442839
def bin_data(data, dim = 40, num_bins = 10):
  
  intervals = generate_RF_bins(data, dim, num_bins)
  binned_data = [numpy.concatenate([bin_number(data[x][i], intervals[i])
      for i in range(len(data[x]))]) for x in range(len(data))]
  return binned_data
110866
def get_messages_from_stream(data):
    
    messages = []
    iterator = HEADER_RE.finditer(data)
    last_pos = 0
    for match in iterator:
        pos = match.span()[0]
        header = read_machine_header(data[pos:])
        h_len = __get_machine_header_length(header)
        cur_last_pos = pos + h_len + header['meta_len'] + header['data_len']

        if cur_last_pos > len(data):
            break

        header, meta, bin_data = parse_message(data[pos:])
        messages.append({'header': header, 'meta': meta, 'data': bin_data})

        last_pos = cur_last_pos

    data = data[last_pos:]
    return messages, data
182905
def _coerce_to_ndarray(cls, data):
        

        if not isinstance(data, (np.ndarray, Index)):
            if data is None or is_scalar(data):
                cls._scalar_data_error(data)

            # other iterable of some kind
            if not isinstance(data, (ABCSeries, list, tuple)):
                data = list(data)
            data = np.asarray(data)
        return data
385078
@Benchmark
  @BenchmarkMode(Mode.AverageTime)
  @OutputTimeUnit(TimeUnit.NANOSECONDS)
  public Span getCurrentSpan(Data data) {
    return data.tracer.getCurrentSpan();
  }
405659
def build_data_availability(datasets_json):
    
    data_availability = None
    if 'availability' in datasets_json and datasets_json.get('availability'):
        # only expect one paragraph of text
        data_availability = datasets_json.get('availability')[0].get('text')
    return data_availability
845325
def spancount(args):
    
    import json

    p = OptionParser(spancount.__doc__)
    opts, args = p.parse_args(args)

    if len(args) != 1:
        sys.exit(not p.print_help())

    fof, = args
    fp = open(fof)
    flist = [row.strip() for row in fp]
    spanCount = "spanCount"
    avgSpanBases = "avgSpanBases"
    fw = open(spanCount, "w")
    for f in flist:
        fp = open(f)
        j = json.load(fp)
        sc = j.get(spanCount, None)
        asb = j.get(avgSpanBases, None)
        print(f, asb, sc, file=fw)
        fw.flush()
    fw.close()