Guess a specific time within the given span.

 span - The Chronic::Span object to calcuate a guess from.

 Returns a new Time object.
11121
def guess(span, mode = :middle)
      return span if not mode
      return span.begin + span.width / 2 if span.width > 1 and (mode == true or mode == :middle)
      return span.end if mode == :end
      span.begin
    end
17495
def time(value):
    
    if isinstance(value, str):
        value = to_time(value)
    return literal(value, type=dt.time)
758247
def parsetime(text):
    '''
    

    '''
    mins, maxs = text.split('-', 1)
    minv = s_time.parse(mins)
    maxv = s_time.parse(maxs, base=minv)
    return minv, maxv
320167
def determine_check_cron_time(check)
      cron_parser = CronParser.new(check[:cron])
      current_time = Time.now
      next_cron_time = cron_parser.next(current_time)
      next_cron_time - current_time
    end
821881
def start_span(self, name='span'):
        
        span = trace_span.BlankSpan(name, context_tracer=self)
        return span
354125
def from_time(cls, source):
        
        return cls(hours=source.hour, minutes=source.minute,
            seconds=source.second, milliseconds=source.microsecond // 1000)
547967
def _validate_prepare_time(self, t, pos_c):
        
        if hasattr(t, 'unit'):
            t = t.decompose(self.units).value

        if not isiterable(t):
            t = np.atleast_1d(t)

        t = np.ascontiguousarray(t.ravel())

        if len(t) > 1:
            if len(t) != pos_c.shape[0]:
                raise ValueError("If passing in an array of times, it must have a shape "
                                 "compatible with the input position(s).")

        return t
649133
def find_within(tags, span, pointer)
      puts "--#{span}" if Chronic.debug
      return span if tags.empty?

      head = tags.shift
      head.start = (pointer == :future ? span.begin : span.end)
      h = head.this(:none)

      if span.cover?(h.begin) || span.cover?(h.end)
        find_within(tags, h, pointer)
      end
    end
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
158957
def timecode(time_now, interval):
    
    i = time.mktime(time_now.timetuple())
    return int(i / interval)
130659
def guess(cls, sample):
        
        if isinstance(sample, TypeEngine):
            return sample
        if isinstance(sample, bool):
            return cls.boolean
        elif isinstance(sample, int):
            return cls.integer
        elif isinstance(sample, float):
            return cls.float
        elif isinstance(sample, datetime):
            return cls.datetime
        elif isinstance(sample, date):
            return cls.date
        return cls.text
1190957
def span(self):
        
        other = VersionRange(None)
        bound = _Bound(self.bounds[0].lower, self.bounds[-1].upper)
        other.bounds = [bound]
        return other
294035
def get_time():
    
    import datetime
    time=make_pathable_string('%s' % datetime.datetime.now())
    return time.replace('-','_').replace(':','_').replace('.','_')
787545
def time_from_number(self, value):
        
        if not isinstance(value, numbers.Real):
            return None
        delta = datetime.timedelta(days=value)
        minutes, second = divmod(delta.seconds, 60)
        hour, minute = divmod(minutes, 60)
        return datetime.time(hour, minute, second)
299106
def parse_time
      s0 = @current_pos
      if match_str("(") != :failed
        match_spaces
        s3 = parse_ms
        if s3 != :failed
          match_spaces
          if match_str("/") != :failed
            match_spaces
            s5 = parse_hms
            s5 = parse_ms(with_hour: true) if s5 == :failed
            if s5 != :failed
              match_spaces
              if match_str(")") != :failed
                @reported_pos = s0
                s0 = { "now" => s3, "total" => s5 }
              else
                @current_pos = s0
                s0 = :failed
              end
            else
              @current_pos = s0
              s0 = :failed
            end
          else
            @current_pos = s0
            s0 = :failed
          end
        else
          @current_pos = s0
          s0 = :failed
        end
      else
        @current_pos = s0
        s0 = :failed
      end
      s0
    end
1093561
def datetimeAt(self, x):
        
        gantt = self.ganttWidget()
        dstart = gantt.dateTimeStart()
        distance = int(x / float(gantt.cellWidth()))
        
        # calculate the time for a minute
        if scale == gantt.Timescale.Minute:
            return dstart.addSecs(distance)
        
        # calculate the time for an hour
        elif scale == gantt.Timescale.Hour:
            return dstart.addSecs(distance * 2.0)

        # calculate the time for a day
        elif scale == gantt.Timescale.Day:
            dstart = QDateTime(gantt.dateStart(), QTime(0, 0, 0))
            return dstart.addSecs(distance * (60 * 2.0))
        
        # calculate the time off the date only
        else:
            date = self.dateAt(x)
            return QDateTime(date, QTime(0, 0, 0))
693484
def _StrftimeGm(value, unused_context, args):
    
    time_tuple = time.gmtime(value)
    return _StrftimeHelper(args, time_tuple)