parse-time attr definition
507900
def parse_define_attr(name, spec)
      err(ParseError, "Can't define '#{name}' outside a node") unless
        @last_node

      err(RedefinedError, "Can't redefine '#{name}' in node #{@last_node}") if
        @node_attrs[@last_node].member? name

      @node_attrs[@last_node] << name

      checks = spec.map do |a|
        n = a.index('.') ? a : "#{@last_node}.#{a}"
        "_x.member?('#{n}') ? raise('#{n}') : #{a}#{POST}(_x + ['#{n}'])"
      end.join(';')

      code =
        "class #{@last_node}; def self.#{name}#{POST}(_x); #{checks}; end; end"

      # pp code

      @pm.module_eval(code)

      begin
        parse_call_attr(@last_node, name)
      rescue RuntimeError
        err(RecursionError, "'#{name}' is recursive")
      end
    end
1173902
private void parseAttrs(Context context, AttributeSet attrs) {
        if (attrs != null) {
            TypedArray typedArray = context.getTheme().obtainStyledAttributes(attrs, R.styleable.BottomNavigationBar, 0, 0);

            mActiveColor = typedArray.getColor(R.styleable.BottomNavigationBar_bnbActiveColor, Utils.fetchContextColor(context, R.attr.colorAccent));
            mInActiveColor = typedArray.getColor(R.styleable.BottomNavigationBar_bnbInactiveColor, Color.LTGRAY);
            mBackgroundColor = typedArray.getColor(R.styleable.BottomNavigationBar_bnbBackgroundColor, Color.WHITE);
            mAutoHideEnabled = typedArray.getBoolean(R.styleable.BottomNavigationBar_bnbAutoHideEnabled, true);
            mElevation = typedArray.getDimension(R.styleable.BottomNavigationBar_bnbElevation, getResources().getDimension(R.dimen.bottom_navigation_elevation));

            setAnimationDuration(typedArray.getInt(R.styleable.BottomNavigationBar_bnbAnimationDuration, DEFAULT_ANIMATION_DURATION));

            switch (typedArray.getInt(R.styleable.BottomNavigationBar_bnbMode, MODE_DEFAULT)) {
                case MODE_FIXED:
                    mMode = MODE_FIXED;
                    break;

                case MODE_SHIFTING:
                    mMode = MODE_SHIFTING;
                    break;

                case MODE_FIXED_NO_TITLE:
                    mMode = MODE_FIXED_NO_TITLE;
                    break;

                case MODE_SHIFTING_NO_TITLE:
                    mMode = MODE_SHIFTING_NO_TITLE;
                    break;

                case MODE_DEFAULT:
                default:
                    mMode = MODE_DEFAULT;
                    break;
            }

            switch (typedArray.getInt(R.styleable.BottomNavigationBar_bnbBackgroundStyle, BACKGROUND_STYLE_DEFAULT)) {
                case BACKGROUND_STYLE_STATIC:
                    mBackgroundStyle = BACKGROUND_STYLE_STATIC;
                    break;

                case BACKGROUND_STYLE_RIPPLE:
                    mBackgroundStyle = BACKGROUND_STYLE_RIPPLE;
                    break;

                case BACKGROUND_STYLE_DEFAULT:
                default:
                    mBackgroundStyle = BACKGROUND_STYLE_DEFAULT;
                    break;
            }

            typedArray.recycle();
        } else {
            mActiveColor = Utils.fetchContextColor(context, R.attr.colorAccent);
            mInActiveColor = Color.LTGRAY;
            mBackgroundColor = Color.WHITE;
            mElevation = getResources().getDimension(R.dimen.bottom_navigation_elevation);
        }
    }
213891
function(attr) {
      var startIndex, newAttr,
        i = 0,
        hasEndBracket = true;
      startIndex = attr.indexOf('[', i);
      if (startIndex < 0) {
        return attr;
      }
      newAttr = attr.substring(0, startIndex + 1);
      while (startIndex > 0 && hasEndBracket) {
         i = attr.indexOf(']', i) + 1;
         hasEndBracket = i > 0;
         startIndex = attr.indexOf('[', i);
         if (startIndex > 0) {
           newAttr = newAttr + attr.substring(i - 1, startIndex + 1);
         }
      }
      newAttr = newAttr + attr.substring(i - 1);
      return newAttr;
    }
642185
function parseDateTime(str)
{
	/*
	 * This is irritatingly implicit, but significantly more concise than
	 * alternatives.  The "+str" will convert a string containing only a
	 * number directly to a Number, or NaN for other strings.  Thus, if the
	 * conversion succeeds, we use it (this is the milliseconds-since-epoch
	 * case).  Otherwise, we pass the string directly to the Date
	 * constructor to parse.
	 */
	var numeric = +str;
	if (!isNaN(numeric)) {
		return (new Date(numeric));
	} else {
		return (new Date(str));
	}
}
758247
def parsetime(text):
    '''
    

    '''
    mins, maxs = text.split('-', 1)
    minv = s_time.parse(mins)
    maxv = s_time.parse(maxs, base=minv)
    return minv, maxv
189975
function(i) {
			var timeStr = this.toString();
			var length  = timeStr.length;
			
			if(timeStr[length - i])	 {
				return timeStr[length - i];
			}
			
			return false;
		}
1274454
def parse_timestr(timestr):
    
    timedelta_secs = parse_timedelta(timestr)
    sync_start = datetime.now()

    if timedelta_secs:
        target = datetime.now() + timedelta(seconds=timedelta_secs)
    elif timestr.isdigit():
        target = datetime.now() + timedelta(seconds=int(timestr))
    else:
        try:
            target = parse(timestr)
        except:
            # unfortunately, dateutil doesn't raise the best exceptions
            raise ValueError("Unable to parse '{}'".format(timestr))

        # When I do "termdown 10" (the two cases above), I want a
        # countdown for the next 10 seconds. Okay. But when I do
        # "termdown 23:52", I want a countdown that ends at that exact
        # moment -- the countdown is related to real time. Thus, I want
        # my frames to be drawn at full seconds, so I enforce
        # microsecond=0.
        sync_start = sync_start.replace(microsecond=0)
    try:
        # try to convert target to naive local timezone
        target = target.astimezone(tz=tz.tzlocal()).replace(tzinfo=None)
    except ValueError:
        # parse() already returned a naive datetime, all is well
        pass
    return (sync_start, target)
322631
public java.util.Date getDate(String attr) {
		return (java.util.Date)attrs.get(attr);
	}
935868
def parseSingleAttr(self, attrValue):
        

        results = self.parseAttributes(temp=attrValue)
        if 'temp' in results[1]:
            return results[1]['temp']
        else:
            return results[0]['temp']
302225
def parse_value(self, value):
        """"""
        if value is None:
            return value
        if isinstance(value, datetime.time):
            return value
        return parse(value).timetz()
929633
void insert_data(AttributeValue attr_val, TimeVal t)
	{
		if (size()>=max_elt)
			remove(0);
		add(new RingElt(attr_val, t));
		/*
		for (int i=0 ; i<size() ; i++)
			System.out.println(elementAt(i).toString());
		*/
	}
434811
function(attr) {
        var start;
        var end;
        var attributes = this.attributes;

        this.runtimeAttributes[attr] = {};
        
        var isset = function(prop) {
            return (typeof prop !== 'undefined');
        };
        
        if ( !isset(attributes[attr]['to']) && !isset(attributes[attr]['by']) ) {
            return false; // note return; nothing to animate to
        }
        
        start = ( isset(attributes[attr]['from']) ) ? attributes[attr]['from'] : this.getAttribute(attr);

        // To beats by, per SMIL 2.1 spec
        if ( isset(attributes[attr]['to']) ) {
            end = attributes[attr]['to'];
        } else if ( isset(attributes[attr]['by']) ) {
            if (start.constructor == Array) {
                end = [];
                for (var i = 0, len = start.length; i < len; ++i) {
                    end[i] = start[i] + attributes[attr]['by'][i] * 1; // times 1 to cast "by" 
                }
            } else {
                end = start + attributes[attr]['by'] * 1;
            }
        }
        
        this.runtimeAttributes[attr].start = start;
        this.runtimeAttributes[attr].end = end;

        // set units if needed
        this.runtimeAttributes[attr].unit = ( isset(attributes[attr].unit) ) ?
                attributes[attr]['unit'] : this.getDefaultUnit(attr);
        return true;
    }
533628
public Object parseObject(String pStr, ParsePosition pStatus) {
	Time t = parse(pStr);
	
	pStatus.setIndex(pStr.length()); // Not 100%
	
	return t;
    }
422982
private static long parseToTimeMillis(String dateStr, TimeZone tz) {
		String format;
		if (dateStr.length() <= 10) {
			format = DATE_FORMAT_STRING;
		} else {
			format = TIMESTAMP_FORMAT_STRING;
		}
		return parseToTimeMillis(dateStr, format, tz) + getMillis(dateStr);
	}
611160
public static int parseDurationString(String timeStr) {
        int seconds = 0;
        Matcher matcher = timeStringPattern.matcher(timeStr);
        while (matcher.find()) {
            String s = matcher.group();
            String[] parts = s.split("(?<=[yMwdhms])(?=\\d)|(?<=\\d)(?=[yMwdhms])");
            int numb = Integer.parseInt(parts[0]);
            String type = parts[1];
            switch (type) {
                case "s":
                    seconds = seconds + (numb);
                    break;
                case "m":
                    seconds = seconds + (numb * 60);
                    break;
                case "h":
                    seconds = seconds + (numb * 60 * 60);
                    break;
                case "d":
                    seconds = seconds + (numb * 60 * 60 * 24);
                    break;
                case "w":
                    seconds = seconds + (numb * 60 * 60 * 24 * 7);
                    break;
                case "M":
                    seconds = seconds + (numb * 60 * 60 * 24 * 30);
                    break;
                case "y":
                    seconds = seconds + (numb * 60 * 60 * 24 * 365);
                    break;
                default:
            }
        }
        return seconds;
    }
882670
def time_for(value)
      if value.is_a? Numeric
        Time.at value
      elsif value.respond_to? :to_s
        Time.parse value.to_s
      else
        value.to_time
      end
    rescue ArgumentError => boom
      raise boom
    rescue Exception
      raise ArgumentError, "unable to convert #{value.inspect} to a Time object"
    end
1101116
def parse(input):
    '''
    
    '''
    if isinstance(input, datetime):
        return input
    if isinstance(input, date):
        return date_to_datetime(input)
    if isinstance(input, time):
        return time_to_datetime(input)
    if isinstance(input, (int, float)):
        return timestamp_to_datetime(input)
    if isinstance(input, (str)):
        return string_to_data_time(input)
    return None