Utility function. Creates a new annotation.

@param string $date
@param string $note
@param int $starred
@return array
344182
private function makeAnnotation($date, $note, $starred = 0)
    {
        return array('date'    => $date,
                     'note'    => $note,
                     'starred' => (int)$starred,
                     'user'    => Piwik::getCurrentUserLogin());
    }
355501
public static DateLabel forDate(String id, Date date) {
        return DateLabel.forDatePattern(id, new Model<Date>(date), DATE_PATTERN);
    }
946071
public function annotation(String $class, String $function = NULL) : stdClass
    {
        if( strstr($class, '::') )
        {
            $method = explode('::', $class);

            $class    = $method[0];
            $function = $method[1];
        }

        if( $function[0] === '$' )
        {
            $class = $this->property($class, ltrim($function, '$'));
        }
        else
        {
            if( $function === NULL )
            {
                $class = $this->class($class);
            }
            else
            {
                $class = $class->getMethod($function);
            }
        } 
        
        preg_match_all('/@(\w+.*?)\s+(.*?)\s+\*/s', $class->getDocComment(), $match);

        $keys   = $match[1] ?? [];
        $values = $match[2] ?? [];
    
        $values = array_map(function($data)
        {
            if( Json::check($data) )
            {
                return Json::decodeObject($data);
            }
            elseif( $data[0] === ':' )
            {
                return eval('?><?php return ' . ltrim(Base::suffix($data, ';'), ':'));
            }

            return $data;

        }, $values);

        return (object) array_combine($keys, $values);
    }
179087
public static function addNote(
        int $object_id, string $title, string $note): Note
    {

        return Note::create([
            'object_type' => __CLASS__,
            'object_id'   => $object_id,
            'title'       => $title,
            'note'        => $note,
        ]);

    }
766470
public function parse($value, $annotation = null)
    {
        $json = static::jsonDecode($value);
        if (JSON_ERROR_NONE != json_last_error()) {
            throw new ParserException("Raw value must be a valid JSON string. Invalid value '{$value}' given.");
        }

        return $json;
    }
392278
protected JNote createAnchorNote(Note note, Point2D base, ScoreMetrics metrics) {
//		JNote jNote = new JNote(note, base, metrics);
		JNote jNote = new JChordNote(note, getClef(), base, metrics);
		//note.set
		return jNote;
	}
68230
public function getSingleNotesData(int $character_id, int $note_id)
    {

        return response()->json(
            CharacterInfo::getNote($character_id, $note_id)->first());

    }
36903
protected function createAnnotationObjects(array $annotations)
    {
        $objects     = array();

        //var_dump($annotations);

        foreach ($annotations as $name => $args) {
            $name = ucfirst($name);
            $class = $this->defaultNamespace . $name . 'Annotation';

            if (in_array(strtolower($name), self::getExcludeAnnotationList())) {
                continue;
            }

            if (! array_key_exists($class, $objects)) {
                if (!class_exists($class)) {
                    if ($this->strict) {
                        throw new \Exception(sprintf('Annotation Class Not Found: %s', $class));
                    } else {
                        continue;
                    }
                }

                $objects[$name] = new $class();
            }
            //var_dump($args);
            foreach ($args as $key => $value) {
                $objects[$name]->set($key, $value);
            }
        }

        return $objects;
    }
717831
def note(id, type, feature)
      _notes
      @_notes[id][type] = RSS_Note.new(id, type, feature)
    end
382345
public static function fromStrings($nb_date, $na_date, $tz = null): self
    {
        $nb = self::_createDateTime($nb_date, $tz);
        $na = self::_createDateTime($na_date, $tz);
        return new self($nb, $na);
    }
565094
private String getAnnotations(Annotate annotator, String stringFromClient)
      throws JDOMException, IOException {
    // get a breader from the string coming from the client
    BufferedReader clientReader = new BufferedReader(
        new StringReader(stringFromClient));
    KAFDocument kaf = KAFDocument.createFromStream(clientReader);
    KAFDocument.LinguisticProcessor newLp = kaf.addLinguisticProcessor(
        "entities", "ixa-pipe-nerc-" + Files.getNameWithoutExtension(model),
        version + "-" + commit);
    newLp.setBeginTimestamp();
    annotator.annotateNEsToKAF(kaf);
    // get outputFormat
    String kafToString = null;
    if (outputFormat.equalsIgnoreCase("conll03")) {
      kafToString = annotator.annotateNEsToCoNLL2003(kaf);
    } else if (outputFormat.equalsIgnoreCase("conll02")) {
      kafToString = annotator.annotateNEsToCoNLL2002(kaf);
    } else {
      newLp.setEndTimestamp();
      kafToString = kaf.toString();
    }
    return kafToString;
  }
587495
private function computeNotes($lineConfig, $notesToReturn, $newCalendar, $aggregation)
    {
        $layoutConfig = $lineConfig->getLayoutConfig();

        foreach ($newCalendar->notes as $note) {
            if (($note->type == 'notes' || $this->isExceptionInsideSeason($note, $lineConfig->getSeason())) &&
                ($layoutConfig->dispatchesNotes() || !in_array($note->id, $this->computedNotesId))) {
                $note->calendarId = $newCalendar->id;
                $this->computedNotesId[] = $note->id;

                if (!isset($this->colorNotes[$note->id])) {
                    $this->colorNotes[$note->id] = $this->getNewColor($layoutConfig->getNotesColors());
                }

                $note->color = $this->colorNotes[$note->id];
                $notesToReturn[] = $note;
            }
        }

        return $notesToReturn;
    }
711065
public void annotation(String annotation) throws IOException {
    indent();
    out.write("@");
    type(annotation);
    out.write("\n");
  }
798047
private function create($annotation, $context)
    {
        $logger = $this->getLogger();
        $name = $annotation['name'];
        if (!$this->isValidName($name)) {
            return null;
        }
        $annotationClass = $this->resolveClassName($name, $context['declaringClass']);
        if (!$annotationClass) {
            if (isset($this->imports[$name])) {
                $annotationClass = $this->imports[$name];
            } else {
                $logger->warning("Unknown annotation '$name' at {$annotation['file']}:{$annotation['line']}");
                return null;
            }
        }
        if (!class_exists($annotationClass)) {
            $logger->warning("Annotation class '$annotationClass' does not exist"
                             ." at {$annotation['file']}:{$annotation['line']}");
            return null;
        }
        if (!is_subclass_of($annotationClass, Annotation::class)) {
            $logger->warning("Annotation class '$annotationClass' at {$annotation['file']}:{$annotation['line']}"
                             ." is not subclass of " . Annotation::class);
            return null;
        }
        $context['file'] = $annotation['file'];
        $context['line'] = $annotation['line'];
        $args = (new PhalconAnnotation($annotation))->getArguments() ?: [];
        return new $annotationClass($args, new Context($context));
    }
119441
public void indexAnnotation(final Annotation note) {
    if (search != null) {
      search.indexAnnotation(note).addErrback(new PluginError());
    }
    if( rt_publisher != null ) {
    	rt_publisher.publishAnnotation(note);
    }
  }
391894
public static function add_annotation(annotation $annotation) {
        global $DB;

        $annotation->id = null;
        return $DB->insert_record('assignfeedback_editpdf_annot', $annotation);
    }
232204
public static function createFromString($annotation) {
		preg_match('/^\@mixin (.+)\s*(.+)?$/', $annotation, $matches);
		if ($matches) {
			return static::create('@mixin', $matches[1]);
		}

		preg_match('/^(\@property|\@method|\@var|\@param) ([^ ]+) (.+)$/', $annotation, $matches);
		if (!$matches) {
			return null;
		}
		return static::create($matches[1], $matches[2], $matches[3]);
	}