Start a span.

        :type name: str
        :param name: The name of the span.

        :rtype: :class:`~opencensus.trace.span.Span`
        :returns: The Span object.
514711
def start_span(self, name='span'):
        
        parent_span = self.current_span()

        # If a span has remote parent span, then the parent_span.span_id
        # should be the span_id from the request header.
        if parent_span is None:
            parent_span = base.NullContextManager(
                span_id=self.span_context.span_id)

        span = trace_span.Span(
            name,
            parent_span=parent_span,
            context_tracer=self)
        with self._spans_list_condition:
            self._spans_list.append(span)
        self.span_context.span_id = span.span_id
        execution_context.set_current_span(span)
        span.start()
        return span
256485
def start(name):
    # type: (str) -> None
    
    hotfix_branch = 'hotfix/' + common.to_branch_name(name)
    master = conf.get('git.master_branch', 'master')

    common.assert_on_branch(master)
    common.git_checkout(hotfix_branch, create=True)
631597
def start_span(
      name,
      type = nil,
      backtrace: nil,
      context: nil,
      trace_context: nil
    )
      return unless (transaction = current_transaction)
      return unless transaction.sampled?

      transaction.inc_started_spans!

      if transaction.max_spans_reached?(config)
        transaction.inc_dropped_spans!
        return
      end

      parent = current_span || transaction

      span = Span.new(
        name: name,
        transaction_id: transaction.id,
        trace_context: trace_context || parent.trace_context.child,
        type: type,
        context: context,
        stacktrace_builder: stacktrace_builder
      )

      if backtrace && config.span_frames_min_duration?
        span.original_backtrace = backtrace
      end

      current_spans.push span

      span.start
    end
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')
786108
def name(self):
        
        if self.m_name == -1 or (self.m_event != const.START_TAG and self.m_event != const.END_TAG):
            return u''

        return self.sb[self.m_name]
1161202
def element_from_span(span: List[int],
                      span_type: str) -> Element:
    
    return Element(span_type,
                   [span[0].idx,
                    span[-1].idx + len(span[-1])],
                   ' '.join(map(str, span)))
1044717
def name(self, name):
        
        if name is None:
            raise ValueError("Invalid value for `name`, must not be `None`")
        if name is not None and len(name) > 200:
            raise ValueError("Invalid value for `name`, length must be less than or equal to `200`")

        self._name = name
1099465
def start(cls, name):
        
        if cls.debug:
            print("Timer", name, "started ...")
        cls.timer_start[name] = time.time()
1287371
def set_name(self,name=None):
        
        if name:
            self.name = name[:254]
        else:
            self.name = self.extract_name()[:254]

        self.save()

        return self.name
1156420
def startElement(self, name, attrs):
        
        if name in self.ignore_start:
            return
        try:
            handler = getattr(self, '_handle_start_%s' % name)
        except AttributeError:
            raise KeyError("Unknown element start '%s'" % name)
        handler(attrs)
1252921
public static SpanContextInformation forSpan(Span span) {
		if (span != null) {
			if (!spanContextMap.containsKey(span)) {
				spanContextMap.putIfAbsent(span, new SpanContextInformation());
			}
			return spanContextMap.get(span);
		}
		return null;
	}
418327
private SpanNamer spanNamer() {
		if (this.spanNamer == null) {
			try {
				this.spanNamer = this.beanFactory.getBean(SpanNamer.class);
			}
			catch (NoSuchBeanDefinitionException e) {
				log.warn(
						"SpanNamer bean not found - will provide a manually created instance");
				return new DefaultSpanNamer();
			}
		}
		return this.spanNamer;
	}
582729
def Create(self, name):
    
    precondition.AssertType(name, Text)

    try:
      constructor = self._constructors[name]
    except KeyError:
      message = "No constructor for name '%s' has been registered"
      message %= name
      raise ValueError(message)

    instance = constructor()
    if not isinstance(instance, self._cls):
      message = ("Constructor %r for name '%s' returned instance of type %r "
                 "(expected %r)")
      message %= (constructor, name, type(instance), self._cls)
      raise TypeError(message)

    return instance
767475
def _name_helper(name: str):
    
    name = name.rstrip()
    if name.endswith(('.service', '.socket', '.target')):
        return name
    return name + '.service'
986009
def endElementNS(self, name, qname):
        
        if self._ns_prefixes_floating_out:
            raise RuntimeError("namespace prefix has not been closed")

        if self._pending_start_element == name:
            self._pending_start_element = False
            self._write(b"/>")
        else:
            self._write(b"</")
            self._write(self._qname(name).encode("utf-8"))
            self._write(b">")

        self._curr_ns_map, self._ns_prefixes_floating_out, self._ns_counter = \
            self._ns_map_stack.pop()
1029346
def widgetForName(self, name):
        
        for iwidget in range(len(self)):
            if self.widget(iwidget).name() == name:
                return self.widget(iwidget)
844513
def name(self):
        
        if hasattr(self._element, "name"):
            return self._element.name
        else:
            return str(self._element)