// Parse is used to parse a query string into a ComparativeTime instance
420831
func (c *ComparativeTime) Parse(query string) error {
	if len(query) <= 2 {
		return errors.New("qstring: Invalid Timestamp Query")
	}

	c.Operator = parseOperator(query)

	// if no operator was provided and we defaulted to an equality operator
	if !strings.HasPrefix(query, c.Operator) {
		query = fmt.Sprintf("=%s", query)
	}

	var err error
	c.Time, err = time.Parse(time.RFC3339, query[len(c.Operator):])
	if err != nil {
		return err
	}

	return nil
}
47336
func Parse(in string) *Version {
	v := &Version{}

	sp := strings.Split(in, ".")
	if len(sp) != 3 {
		v.err = errors.Errorf("passed string is not following to semver: %s", in)
		return v
	}

	v.major(sp[0])
	v.minor(sp[1])
	v.patch(sp[2])

	return v
}
514080
func Parse(err string) *Error {
	e := new(Error)
	errr := json.Unmarshal([]byte(err), e)
	if errr != nil {
		e.Detail = err
	}
	return e
}
298492
func Parse(args ...string) (Value, error) {
	v, _, err := ParseWithAliases(args...)
	return v, err
}
273323
func Parse(format, timespec string) (time.Time, error) {
	return time.ParseInLocation(format, timespec, Location)
}
1251068
func (c *Client) Parse(url string) (*Result, error) {
	header := make(map[string]string)
	bytes, err := c.session.Get(url, header)
	if err != nil {
		return nil, err
	}

	rssType, err := c.detector.detect(bytes)
	if err != nil {
		return nil, err
	}

	parser, err := getParser(rssType)
	if err != nil {
		return nil, err
	}

	mappableFeed, err := parser.Parse(bytes)
	if err != nil {
		return nil, err
	}

	feedBytes, err := mappableFeed.ToJSON()
	if err != nil {
		return nil, err
	}

	feed := Feed{}
	err = feed.Map(feedBytes)
	if err != nil {
		return nil, err
	}

	ret := makeResult(rssType, feed, mappableFeed)
	return &ret, nil
}
10348
func (parser StringTypeParser) Parse(d DataType) error {
	if value, ok := AsString(d); ok {
		parser.setter(value)
	} else {
		return fmt.Errorf("Error parsing type of %#v as a String", d)
	}
	return nil
}
30606
func (pp *primitiveParser) Parse() map[string]*data {
	pp.loadTypeComments()
	pp.loadStructs()

	visible := make(map[string]*data)
	for k := range pp.structmap {
		if strings.ToUpper(string(k[0])) != string(k[0]) { // not exported
			continue
		}
		pp.visitStruct(visible, k, false)
	}

	return visible
}
347320
func Parse(data string) (map[string]interface{}, error) {
	p, err := parse(data, "", false)
	if err != nil {
		return nil, err
	}
	return p.mapping, nil
}
97337
func (s VersionStr) Parse() (Version, error) {
	raw, err := version.NewVersion(string(s))
	if err != nil {
		return Version{}, err
	}
	return Version{raw}, nil
}
1083139
func (p FloatParser) Parse(field string) (result interface{}, err error) {
	return strconv.ParseFloat(field, 64)
}
1336764
func (c Config) Parse(s string) error {
	c.file = "<string>"
	c.input = s
	return c.parse()
}
58245
func (m *GenericParser) Parse(data interface{}) (e *Entity, err error) {
	val := reflect.ValueOf(data)
	// dereference pointers, and get concrete values from interfaces
	val = deref(val)
	// Map and Struct are the only valid Kinds at the top level.
	switch val.Kind() {
	case reflect.Map:
		e, err = m.parseMap(val)
	case reflect.Struct:
		e, err = m.parseStruct(val)
	default:
		e, err = nil, errors.Errorf("unsupported kind, '%v' in GenericParser: %v", val.Kind(), data)
	}
	if err != nil {
		return e, err
	}
	var subj string
	if !m.SubjectAll {
		if m.EntitySubjecter != nil {
			subj, err = m.EntitySubjecter.Subject(e)
		} else {
			subj, err = m.Subjecter.Subject(data)
		}
		e.Subject = IRI(subj)
	}
	return e, err
}
243915
func (p *Parser) Parse(tokenString string, keyFunc Keyfunc) (*Token, error) {
	return p.ParseWithClaims(tokenString, MapClaims{}, keyFunc)
}
682065
func (p StringParser) Parse(field string) (result interface{}, err error) {
	return field, nil
}
680002
func (s *StringSource) Parse() (tree.RawPolicy, error) {
	return parseLines(s.Name, strings.Split(s.Content, "\n"))
}
1156961
func (p *Parser) Parse(rawURL string) (*Result, error) {
	// split out the path and query
	u, err := url.Parse(rawURL)
	if err != nil {
		return nil, err
	}
	r := &Result{
		URI:         rawURL,
		Path:        u.Path,
		Query:       u.RawQuery,
		QueryFields: u.Query(),
		PathFields:  url.Values{},
	}

	// create the shaped query string
	var queryShape string
	// sort the query parameters
	qKeys := make([]string, 0, len(r.QueryFields))
	for k := range r.QueryFields {
		qKeys = append(qKeys, k)
	}
	sort.Strings(qKeys)

	shapeStrings := make([]string, 0, len(qKeys))
	for _, k := range qKeys {
		for i := 0; i < len(r.QueryFields[k]); i++ {
			shapeStrings = append(shapeStrings, fmt.Sprintf("%s=?", k))
		}
	}
	queryShape = strings.Join(shapeStrings, "&")

	// try and find a shape for the path or use the Path as the shape
	var pathShape string
	pathShape, r.PathFields = p.getPathShape(u.Path)

	// Ok, construct the full shape of the URL
	fullShape := pathShape
	if queryShape != "" {
		fullShape += fmt.Sprintf("?%s", queryShape)
	}
	r.PathShape = pathShape
	r.QueryShape = queryShape
	r.Shape = fullShape

	return r, nil
}