Register a text key.

        If the key you need to register is a simple one-to-one mapping
        of MP4 atom name to EasyMP4Tags key, then you can use this
        function::

            EasyMP4Tags.RegisterTextKey("artist", "\xa9ART")
438985
def RegisterTextKey(cls, key, atomid):
        
        def getter(tags, key):
            return tags[atomid]

        def setter(tags, key, value):
            tags[atomid] = value

        def deleter(tags, key):
            del(tags[atomid])

        cls.RegisterKey(key, getter, setter, deleter)
879469
def tagged_item_key(self, key):
        
        return '%s:%s' % (hashlib.sha1(encode(self._tags.get_namespace())).hexdigest(), key)
716412
def tag(self, *tag, **kwtags):
        """"""
        if not tag:
            pass
        elif len(tag) == 1 and isinstance(tag[0], dict):
            self._meta.update(tag[0])
        else:
            raise TypeError('Tags must be provided as key-word arguments or '
                            'a dictionary')
        self._meta.update(kwtags)
        return self
973552
protected void registerMacroTags() {
        addMacroTagProvider(new ActorLmlMacroTagProvider(), "actor");
        addMacroTagProvider(new AnyNotNullLmlMacroTagProvider(), "anyNotNull", "any");
        addMacroTagProvider(new ArgumentLmlMacroTagProvider(), "nls", "argument", "preference");
        addMacroTagProvider(new ArgumentReplacementLmlMacroTagProvider(), "replace", "replaceArguments", "noOp",
                "root");
        addMacroTagProvider(new AssignLmlMacroTagProvider(), "assign", "var", "val");
        addMacroTagProvider(new CalculationLmlMacroTagProvider(), "calculate", "calculation");
        addMacroTagProvider(new ChangeListenerLmlMacroTagProvider(), "onChange", "changeListener");
        addMacroTagProvider(new ClickListenerLmlMacroTagProvider(), "onClick", "clickListener");
        addMacroTagProvider(new CommentLmlMacroTagProvider(), "comment", "FIXME", "TODO");
        addMacroTagProvider(new ConditionalLmlMacroTagProvider(), "if", "test", "check");
        addMacroTagProvider(new EvaluateLmlMacroTagProvider(), "eval", "evaluate", "invoke");
        addMacroTagProvider(new ExceptionLmlMacroTagProvider(), "exception", "throw", "error");
        addMacroTagProvider(new ForEachLmlMacroTagProvider(), "forEach", "for", "each");
        addMacroTagProvider(new ImportAbsoluteLmlMacroTagProvider(), "absoluteImport");
        addMacroTagProvider(new ImportClasspathLmlMacroTagProvider(), "classpathImport");
        addMacroTagProvider(new ImportExternallLmlMacroTagProvider(), "externalImport");
        addMacroTagProvider(new ImportInternalLmlMacroTagProvider(), "import", "internalImport");
        addMacroTagProvider(new ImportLocalLmlMacroTagProvider(), "localImport");
        addMacroTagProvider(new InputListenerLmlMacroTagProvider(), "inputListener", "onInput");
        addMacroTagProvider(new LoggerDebugLmlMacroTagProvider(), "debug", "logDebug", "trace", "logTrace");
        addMacroTagProvider(new LoggerErrorLmlMacroTagProvider(), "logError");
        addMacroTagProvider(new LoggerInfoLmlMacroTagProvider(), "log", "logInfo", "info");
        addMacroTagProvider(new LoopLmlMacroTagProvider(), "loop", "times");
        addMacroTagProvider(new MetaLmlMacroTagProvider(), "macro");
        addMacroTagProvider(new NestedForEachLmlMacroTagProvider(), "forEachNested", "nested", "eachNested");
        addMacroTagProvider(new NewAttributeLmlMacroTagProvider(), "newAttribute", "attribute");
        addMacroTagProvider(new NewTagLmlMacroTagProvider(), "newTag", "tag");
        addMacroTagProvider(new NullCheckLmlMacroTagProvider(), "notNull", "ifNotNull", "exists");
        addMacroTagProvider(new RandomLmlMacroTagProvider(), "random");
        addMacroTagProvider(new StyleLmlMacroTagProvider(), "style");
        addMacroTagProvider(new StyleSheetImportLmlMacroTagProvider(), "importStyleSheet");
        addMacroTagProvider(new TableCellLmlMacroTagProvider(), "cell", "tableCell");
        addMacroTagProvider(new TableColumnLmlMacroTagProvider(), "column", "tableColumn");
        addMacroTagProvider(new TableRowLmlMacroTagProvider(), "row", "tableRow");
        addMacroTagProvider(new WhileLmlMacroTagProvider(), "while", "until");
    }
230697
def set_key(self, key='C'):
        """"""
        if isinstance(key, Key):
            key = key.name[0]
        self.track_data += self.key_signature_event(key)
386861
def register_shortcut(self, qaction_or_qshortcut, context, name,
                          add_sc_to_tip=False):
        
        self.main.register_shortcut(qaction_or_qshortcut, context,
                                    name, add_sc_to_tip)
982718
def tag_file(filename, artist, title, year=None, genre=None, artwork_url=None, album=None, track_number=None, url=None):
    

    try:
        audio = EasyMP3(filename)
        audio.tags = None
        audio["artist"] = artist
        audio["title"] = title
        if year:
            audio["date"] = str(year)
        if album:
            audio["album"] = album
        if track_number:
            audio["tracknumber"] = track_number
        if genre:
            audio["genre"] = genre
        if url: # saves the tag as WOAR
            audio["website"] = url
        audio.save()

        if artwork_url:

            artwork_url = artwork_url.replace('https', 'http')

            mime = 'image/jpeg'
            if '.jpg' in artwork_url:
                mime = 'image/jpeg'
            if '.png' in artwork_url:
                mime = 'image/png'

            if '-large' in artwork_url:
                new_artwork_url = artwork_url.replace('-large', '-t500x500')
                try:
                    image_data = requests.get(new_artwork_url).content
                except Exception as e:
                    # No very large image available.
                    image_data = requests.get(artwork_url).content
            else:
                image_data = requests.get(artwork_url).content

            audio = MP3(filename, ID3=OldID3)
            audio.tags.add(
                APIC(
                    encoding=3,  # 3 is for utf-8
                    mime=mime,
                    type=3,  # 3 is for the cover image
                    desc='Cover',
                    data=image_data
                )
            )
            audio.save()

        # because there is software that doesn't seem to use WOAR we save url tag again as WXXX
        if url:
            audio = MP3(filename, ID3=OldID3)
            audio.tags.add( WXXX( encoding=3, url=url ) )
            audio.save()

        return True

    except Exception as e:
        puts(colored.red("Problem tagging file: ") + colored.white("Is this file a WAV?"))
        return False
1110381
private void pushTag(String qName) {
		final String currentTag = getCurrentTag();
		if ("".equals(currentTag)) {
			mTagStack.push(qName);
		} else {
			mTagStack.push(getCurrentTag() + "." + qName);
		}
	}
1250487
def bind_key(key, kcb=nil, &bl)
      kcb = bl if kcb.nil? && !bl.nil?

      cb = lambda do |cdktype, widget, component, key|
        kcb.call component, key
      end

      component.bind(:ENTRY, key, cb, self)
    end
107105
public static void register(final Map<String, Taglet> tagletMap) {
        ManualTaglet t = new ManualTaglet();
        tagletMap.put(t.getName(), t);
    }
364566
def register(cls, name, klass, content_type='text/plain'):
        
        cls.EMITTERS[name] = (klass, content_type)
1121194
def register(self, key, **kwargs):
        """"""
        dimensions = dict((k, str(v)) for k, v in kwargs.items())
        composite_key = self._composite_name(key, dimensions)
        self._metadata[composite_key] = {
            'metric': key,
            'dimensions': dimensions
        }
        return composite_key
9581
def register_image(kwargs=None, call=None):
    '''
    
    '''

    if call != 'function':
        log.error(
            'The create_volume function must be called with -f or --function.'
        )
        return False

    if 'ami_name' not in kwargs:
        log.error('ami_name must be specified to register an image.')
        return False

    block_device_mapping = kwargs.get('block_device_mapping', None)
    if not block_device_mapping:
        if 'snapshot_id' not in kwargs:
            log.error('snapshot_id or block_device_mapping must be specified to register an image.')
            return False
        if 'root_device_name' not in kwargs:
            log.error('root_device_name or block_device_mapping must be specified to register an image.')
            return False
        block_device_mapping = [{
            'DeviceName': kwargs['root_device_name'],
            'Ebs': {
                'VolumeType': kwargs.get('volume_type', 'gp2'),
                'SnapshotId': kwargs['snapshot_id'],
             }
        }]

    if not isinstance(block_device_mapping, list):
        block_device_mapping = [block_device_mapping]

    params = {'Action': 'RegisterImage',
              'Name': kwargs['ami_name']}

    params.update(_param_from_config('BlockDeviceMapping', block_device_mapping))

    if 'root_device_name' in kwargs:
        params['RootDeviceName'] = kwargs['root_device_name']

    if 'description' in kwargs:
        params['Description'] = kwargs['description']

    if 'virtualization_type' in kwargs:
        params['VirtualizationType'] = kwargs['virtualization_type']

    if 'architecture' in kwargs:
        params['Architecture'] = kwargs['architecture']

    log.debug(params)

    data = aws.query(params,
                     return_url=True,
                     return_root=True,
                     location=get_location(),
                     provider=get_provider(),
                     opts=__opts__,
                     sigver='4')

    r_data = {}
    for d in data[0]:
        for k, v in d.items():
            r_data[k] = v

    return r_data
244039
private static int encodeTag(Tag tag, StringBuilder stringBuilder) {
    String key = tag.getKey().getName();
    String value = tag.getValue().asString();
    int charsOfTag = key.length() + value.length();
    // This should never happen with our current constraints (<= 255 chars) on tags.
    checkArgument(
        charsOfTag <= TAG_SERIALIZED_SIZE_LIMIT,
        "Serialized size of tag " + tag + " exceeds limit " + TAG_SERIALIZED_SIZE_LIMIT);

    // TODO(songy23): do we want to encode TagMetadata?
    stringBuilder.append(key).append(TAG_KEY_VALUE_DELIMITER).append(value);
    return charsOfTag;
  }
520877
private function registerScript()
    {
        ZeroClipboardAsset::register($this->getView());

        $clipboardVar = 'client' . preg_replace('/[^0-9a-zA-Z_$]/', '_', $this->id);
        $this->getView()->registerJs('var ' . $clipboardVar . ';', View::POS_HEAD);
        $this->getView()->registerJs(
            $clipboardVar . " = new ZeroClipboard($('#" . $this->id . "'));

            " . $clipboardVar . ".on('copy', function (event) {
                var clipboard = event.clipboardData;

                clipboard.setData('text/plain', " . $this->text . ');
            });'
        );

        if ($this->enableAftercopy) {
            $this->getView()->registerJs($clipboardVar . ".on('aftercopy', function(event) {
                var oldLabel = $('#" . $this->id . "').html();

                $('#" . $this->id . "').html('" . $this->afterCopyLabel . "');

                setTimeout(function() {
                    $('#" . $this->id . "').html(oldLabel);
                }, 1000);
            });");
        }
    }
622718
function registerCustomKeywords(ajv) {
    //register $desc - aka. property description keyword
    ajv.addKeyword('$desc', {
        schema: false,
        valid: true,
        metaSchema: {
            type: 'string'
        },
    });

    //$toJSON keyword tries to coerce valid JSON data
    ajv.addKeyword('$toJSON', {
        modifying: true,
        statements: true,
        valid: true,
        metaSchema: {
            type: 'object'
        },
        validate: function(schema, data, parentSchema, dataPath, parentData, prop) {
            if (   typeof data === 'object'
                && data !== null
                && typeof data.toJSON === 'function'
                && parentData
            ) {
                parentData[prop] = data.toJSON();
            } else if (typeof data === 'string') {
                parentData[prop] = JSON.parse(data);
            }
        }
    });

    //type: 'string',
    //format: 'media-type'
    ajv.addFormat('media-type', function(val) {
        try {
            mimeTyper.parse(val);
            return true;
        } catch(e) {
            return false;
        }
    });

    return ajv;
}
226265
public function registerAssets()
    {
        $view = $this->getView();
        $id = $this->options['id'];
        $settings = $this->settings;
        $assets = $this->assets;
        if ($this->preset) {
            $preset = $this->getPreset($this->preset);
            if (isset($preset['settings'])) {
                $settings = ArrayHelper::merge($preset['settings'], $settings);
            }
            if (isset($preset['assets'])) {
                $assets = ArrayHelper::merge($preset['assets'], $assets);
            }
        }
        $settings = Json::encode($settings);
        $js = "CodeMirror.fromTextArea(document.getElementById('$id'), $settings);";
        $view->registerJs($js);
        CodemirrorAsset::register($this->view, $assets);
    }