Build the clock face
547814
function(excludeHours, time) {
			var t        = this;
			var children = this.factory.$wrapper.find('ul');
			var lists    = [];
			var offset   = 0;

			time     = time ? time : this.factory.time.getDayCounter(this.showSeconds);

			if(time.length > children.length) {
				$.each(time, function(i, digit) {
					lists.push(t.createList(digit));
				});
			}

			this.factory.lists = lists;

			if(this.showSeconds) {
				$(this.createDivider('Seconds')).insertBefore(this.factory.lists[this.factory.lists.length - 2].$obj);
			}
			else
			{
				offset = 2;
			}

			$(this.createDivider('Minutes')).insertBefore(this.factory.lists[this.factory.lists.length - 4 + offset].$obj);
			$(this.createDivider('Hours')).insertBefore(this.factory.lists[this.factory.lists.length - 6 + offset].$obj);
			$(this.createDivider('Days', true)).insertBefore(this.factory.lists[0].$obj);

			this._clearExcessDigits();

			if(this.autoStart) {
				this.start();
			}
		}
864963
function(obj, digit, options) {
			
			this.lists 	  = [];
			this.running  = false;
			this.base(options);		
			this.$wrapper = $(obj).addClass(this.classes.wrapper);
			this.time     = new FlipClock.Time(this, digit ? Math.round(digit) : 0);
			this.timer    = new FlipClock.Timer(this, options);

			this.lang     = this.loadLanguage(this.language);
			this.face     = this.loadClockFace(this.clockFace, options);

			if(this.autoStart) {
				this.start();
			}
		}
92111
function(callback) {
			var t = this;

			if(!t.running && (!t.countdown || t.countdown && t.time.time > 0)) {
				t.face.start(t.time);
				t.timer.start(function() {
					t.flip();
					
					if(typeof callback === "function") {
						callback();
					}	
				});
			}
			else {
				t.log('Trying to start timer when countdown already at 0');
			}
		}
665097
function(time, doNotAddPlayClass) {
			if(!time) {
				time = this.factory.time.getDayCounter(this.showSeconds);
			}

			this.autoIncrement();

			this.base(time, doNotAddPlayClass);
		}
1297916
def _set_time(self, m):
        ''''''
        # really just left here for profiling
        m._timestamp = self.timestamp
        if len(m._fieldnames) > 0 and self.clock is not None:
            self.clock.set_message_timestamp(m)
505216
private void createHourPointer() {
        double width  = size * 0.09733333;
        double height = size * 0.42066667;
        hour.setCache(false);
        hour.getElements().clear();
        hour.getElements().add(new MoveTo(0.0, 0.0));
        hour.getElements().add(new CubicCurveTo(0.0, 0.0, 0.0, 0.884310618066561 * height, 0.0, 0.884310618066561 * height));
        hour.getElements().add(new CubicCurveTo(0.0, 0.9477020602218701 * height, 0.22602739726027396 * width, height, 0.5 * width, height));
        hour.getElements().add(new CubicCurveTo(0.773972602739726 * width, height, width, 0.9477020602218701 * height, width, 0.884310618066561 * height));
        hour.getElements().add(new CubicCurveTo(width, 0.884310618066561 * height, width, 0.0, width, 0.0));
        hour.getElements().add(new LineTo(0.0, 0.0));
        hour.getElements().add(new ClosePath());
        hour.setCache(true);
        hour.setCacheHint(CacheHint.ROTATE);
    }
1098340
public void setHideTime(boolean enable, final boolean useDarkTheme) {
        if(enable && !shouldHideTime) {
            // hide the time spinner and show a button to show it instead
            timeSpinner.setVisibility(GONE);
            ImageButton timeButton = (ImageButton) LayoutInflater.from(getContext()).inflate(R.layout.time_button, null);
            timeButton.setImageResource(useDarkTheme ? R.drawable.ic_action_time_dark : R.drawable.ic_action_time_light);
            timeButton.setOnClickListener(new OnClickListener() {
                @Override
                public void onClick(View v) {
                    setHideTime(false, useDarkTheme);
                }
            });
            this.addView(timeButton);
        } else if(!enable && shouldHideTime) {
            timeSpinner.setVisibility(VISIBLE);
            this.removeViewAt(2);
        }
        shouldHideTime = enable;
    }
198519
public static function get() : Clock
    {
        if (self::$clock === null) {
            self::$clock = new SystemClock();
        }

        return self::$clock;
    }
759152
@Override protected void resize() {
        width  = clock.getWidth() - clock.getInsets().getLeft() - clock.getInsets().getRight();
        height = clock.getHeight() - clock.getInsets().getTop() - clock.getInsets().getBottom();

        if (aspectRatio * width > height) {
            width = 1 / (aspectRatio / height);
        } else if (1 / (aspectRatio / height) > width) {
            height = aspectRatio * width;
        }

        if (width > 0 && height > 0) {
            pane.setMaxSize(width, height);
            pane.relocate((clock.getWidth() - height) * 0.5, (clock.getHeight() - height) * 0.5);

            if (clock.isTextVisible()) {
                if (null == customFont) {
                    timeText.setFont(Locale.US == clock.getLocale() ? Fonts.robotoLight(0.5 * height) : Fonts.robotoLight(0.6 * height));
                } else {
                    timeText.setFont(Locale.US == clock.getLocale() ? new Font(customFont.getName(), 0.5 * height) : new Font(customFont.getName(), 0.6 * height));
                }
                timeText.setX((width - timeText.getLayoutBounds().getWidth()) * 0.5);
                if (clock.isDateVisible()) {
                    timeText.setY(height * 0.3);
                } else {
                    timeText.setY(height * 0.5);
                }
            }
            if (clock.isDateVisible()) {
                if (null == customFont) {
                    dateText.setFont(Fonts.robotoLight(0.3 * height));
                } else {
                    dateText.setFont(new Font(customFont.getName(), 0.3 * height));
                }
                dateText.setX((width - dateText.getLayoutBounds().getWidth()) * 0.5);
                dateText.setY(height * 0.8);
            }
        }
    }
938570
private void syncTime() {
		try {
			Long ovhTime = new ApiOvhAuth(this).time_GET();
			long myTime = System.currentTimeMillis() / 1000L;
			timeOffset = myTime - ovhTime;
		} catch (Exception e) {
			log.error("Failed syncronized Ovh Clock");
			timeOffset = 0L;
		}
	}
811007
def generate_face(shape=None, face_r=1.0, smile_r1=0.5, smile_r2=0.7, eye_r=0.2):
    
    # TODO add axis (ax=0)
    if shape is None:
        shape = [32, 32]
    nd = len(shape)
    if nd == 2:
        sh2 = shape
    else:
        sh2 = shape[1:]
    fc2 = _get_face2(
        sh2, face_r=face_r, smile_r1=smile_r1, smile_r2=smile_r2, eye_r=eye_r
    )

    if nd == 2:
        return fc2
    else:
        fc3 = np.zeros(shape)
        for i in range(fc3.shape[0]):
            fc3[i, :, :] = fc2
        return fc3
353669
def rebuildDays( self ):
        
        time = QTime(0, 0, 0)
        hour = True
        
        x = 6
        y = 6 + 24
        
        w = self.width() - 12 - 25
        
        dh         = 48
        indent     = 58
        text_data  = []
        
        vlines      = []
        hlines      = [QLine(x, y, w, y)]
        time_grids  = []
        
        for i in range(48):
            if ( hour ):
                hlines.append(QLine(x, y, w, y))
                text_data.append((x,
                                  y + 6, 
                                  indent - 6, 
                                  dh, 
                                  Qt.AlignRight | Qt.AlignTop,
                                  time.toString('hap')))
            else:
                hlines.append(QLine(x + indent, y, w, y))
            
            time_grids.append((time, y, dh / 2))
            
            # move onto the next line
            hour = not hour
            time = time.addSecs(30 * 60)
            y += dh / 2
        
        hlines.append(QLine(x, y, w, y))
        
        h = y
        y = 6 + 24
        
        # load the grid
        vlines.append(QLine(x, y, x, h))
        vlines.append(QLine(x + indent, y, x + indent, h))
        vlines.append(QLine(w, y, w, h))
        
        today     = QDate.currentDate()
        curr_date = self.currentDate()
        
        # load the days
        if ( self.currentMode() == XCalendarScene.Mode.Week ):
            date = self.currentDate()
            day_of_week = date.dayOfWeek()
            if ( day_of_week == 7 ):
                day_of_week = 0
            
            min_date = date.addDays(-day_of_week)
            max_date = date.addDays(6-day_of_week)
            
            self._minimumDate = min_date
            self._maximumDate = max_date
            
            dw    = (w - (x + indent)) / 7.0
            vx    = x + indent
            date  = min_date
            
            for i in range(7):
                vlines.append(QLine(vx, y, vx, h))
                
                text_data.append((vx + 6,
                                  6,
                                  dw,
                                  24,
                                  Qt.AlignCenter,
                                  date.toString('ddd MM/dd')))
                
                self._dateGrid[date.toJulianDay()] = ((0, i),
                                                      QRectF(vx, y, dw, h - y))
                
                # create the date grid for date time options
                for r, data in enumerate(time_grids):
                    time, ty, th = data
                    dtime = QDateTime(date, time)
                    key = dtime.toTime_t()
                    self._dateTimeGrid[key] = ((r, i), QRectF(vx, ty, dw, th))
                
                if ( date == curr_date ):
                    self._buildData['curr_date'] = QRectF(vx, y, dw, h - 29)
                elif ( date == today ):
                    self._buildData['today'] = QRectF(vx, y, dw, h - 29)
                
                date = date.addDays(1)
                vx += dw
        
        # load a single day
        else:
            date = self.currentDate()
            
            self._maximumDate = date
            self._minimumDate = date
            
            text_data.append((x + indent,
                              6,
                              w,
                              24,
                              Qt.AlignCenter,
                              date.toString('ddd MM/dd')))
            
            self._dateGrid[date.toJulianDay()] = ((0, 0), 
                                                  QRectF(x, y, w - x, h - y))
            
            # create the date grid for date time options
            for r, data in enumerate(time_grids):
                time, ty, th = data
                dtime = QDateTime(date, time)
                key = dtime.toTime_t()
                rect = QRectF(x + indent, ty, w - (x + indent), th)
                self._dateTimeGrid[key] = ((r, 0), rect)
        
        self._buildData['grid'] = hlines + vlines
        self._buildData['regular_text'] = text_data
        
        rect = self.sceneRect()
        rect.setHeight(h + 6)
        
        super(XCalendarScene, self).setSceneRect(rect)
38115
def update_clock(self, dt):
        
        dt = dt.astimezone(self.tzinfo)
        fmt = "%H:%M"
        if self.show_seconds:
            fmt = "%H:%M:%S"

        self.time_txt.text = dt.strftime(fmt)

        suppl_text = "{0} {1}".format(dt.strftime("%Y-%m-%d"), self.timezone)
        self.suppl_txt.text = suppl_text

        self.viewer.redraw(whence=3)
39440
@Nonnull
  public Date build ()
  {
    Calendar cal;
    if (m_aTZ != null && m_aLocale != null)
      cal = Calendar.getInstance (m_aTZ, m_aLocale);
    else
      if (m_aTZ != null)
        cal = Calendar.getInstance (m_aTZ, Locale.getDefault (Locale.Category.FORMAT));
      else
        if (m_aLocale != null)
          cal = Calendar.getInstance (TimeZone.getDefault (), m_aLocale);
        else
          cal = PDTFactory.createCalendar ();

    cal.set (Calendar.YEAR, m_nYear);
    cal.set (Calendar.MONTH, m_nMonth - 1);
    cal.set (Calendar.DAY_OF_MONTH, m_nDay);
    cal.set (Calendar.HOUR_OF_DAY, m_nHour);
    cal.set (Calendar.MINUTE, m_nMinute);
    cal.set (Calendar.SECOND, m_nSecond);
    cal.set (Calendar.MILLISECOND, 0);
    return cal.getTime ();
  }
741648
def _build_time(time, kwargs):
    
    tz = kwargs.pop('tz', 'UTC')
    if time:
        if kwargs:
            raise ValueError('Cannot pass kwargs and a time')
        else:
            return ensure_utc(time, tz)
    elif not kwargs:
        raise ValueError('Must pass a time or kwargs')
    else:
        return datetime.time(**kwargs)
627396
public void setMorphTime(float time) {
		for (int i=0;i<figures.size();i++) {
			Figure figure = (Figure) figures.get(i);
			MorphShape shape = (MorphShape) figure.getShape();
			shape.setMorphTime(time);
		}
	}
982838
def add!(timings)
      timings.descriptions.each{|d|
        add_cpu_time(d, timings.cpu_time(d))
        add_wall_time(d, timings.wall_time(d))
      }
    end