return custom pseudo medias replaced with custom medias
770500
function transformMedia(media, customMedias) {
	const transpiledMedias = [];

	for (const index in media.nodes) {
		const { value, nodes } = media.nodes[index];
		const key = value.replace(customPseudoRegExp, '$1');

		if (key in customMedias) {
			for (const replacementMedia of customMedias[key].nodes) {
				// use the first available modifier unless they cancel each other out
				const modifier = media.modifier !== replacementMedia.modifier
					? media.modifier || replacementMedia.modifier
				: '';
				const mediaClone = media.clone({
					modifier,
					// conditionally use the raws from the first available modifier
					raws: !modifier || media.modifier
						? { ...media.raws }
					: { ...replacementMedia.raws },
					type: media.type || replacementMedia.type,
				});

				// conditionally include more replacement raws when the type is present
				if (mediaClone.type === replacementMedia.type) {
					Object.assign(mediaClone.raws, {
						and: replacementMedia.raws.and,
						beforeAnd: replacementMedia.raws.beforeAnd,
						beforeExpression: replacementMedia.raws.beforeExpression
					});
				}

				mediaClone.nodes.splice(index, 1, ...replacementMedia.clone().nodes.map(node => {
					// use raws and spacing from the current usage
					if (media.nodes[index].raws.and) {
						node.raws = { ...media.nodes[index].raws };
					}

					node.spaces = { ...media.nodes[index].spaces };

					return node;
				}));

				// remove the currently transformed key to prevent recursion
				const nextCustomMedia = getCustomMediasWithoutKey(customMedias, key);
				const retranspiledMedias = transformMedia(mediaClone, nextCustomMedia);

				if (retranspiledMedias.length) {
					transpiledMedias.push(...retranspiledMedias);
				} else {
					transpiledMedias.push(mediaClone);
				}
			}

			return transpiledMedias;
		} else if (nodes && nodes.length) {
			transformMediaList(media.nodes[index], customMedias);
		}
	}

	return transpiledMedias;
}
1342075
def adjust_response(self, response):
        ''

        try:
            c1 = self._replace(response.content,
                               self.header_placeholder,
                               self.embedded_holder.css)

            response.content = self._replace(c1,
                                             self.footer_placeholder,
                                             "\n".join([self.embedded_holder.config,
                                                        self.embedded_holder.scripts]))
        except AttributeError:
            # Catch the "FileResponse instance has no `content` attribute" error when serving media files in the Django development server.
            pass

        return response
837159
function extractMediaQuery(props){
    var mediaValue = props.length && props[0];
    if(Object.keys(fucss.media).indexOf(mediaValue) !== -1){
      return props.shift();
    }
  }
471726
def get_new_media(self, api_media):
        
        return Media(site_id=self.site_id,
                     wp_id=api_media["ID"],
                     **self.api_object_data("media", api_media))
859323
def media(request):
    """"""
    return {
        'PAGES_MEDIA_URL': settings.PAGES_MEDIA_URL,
        'PAGES_STATIC_URL': settings.PAGES_STATIC_URL,
        'PAGE_USE_SITE_ID': settings.PAGE_USE_SITE_ID,
        'PAGE_HIDE_SITES': settings.PAGE_HIDE_SITES,
        'PAGE_LANGUAGES': settings.PAGE_LANGUAGES,
    }
1275439
private function hookMediaList() {
		if(!$this->mediaListIntegration) {
			return;
		}

		add_action('admin_init', function() {
			add_filter('manage_media_columns', function($cols) {
				$cols["cloud"] = 'Cloud';

				return $cols;
			});

			add_action('manage_media_custom_column', function($column_name, $id) {
				if($column_name == "cloud") {
					$meta = wp_get_attachment_metadata($id);
					if(!empty($meta) && isset($meta['s3'])) {
						echo "<a href='".$meta['s3']['url']."' target=_blank>View</a>";
					}
				}
			}, 10, 2);
		});

		add_action('wp_enqueue_media', function() {
			add_action('admin_head', function() {
				if(get_current_screen()->base == 'upload') {
					?>
                    <style>
                        th.column-s3, td.column-s3 {
                            width: 60px !important;
                            max-width: 60px !important;
                        }
                    </style>
					<?php
				}
			});
		});
	}
954288
def _media(self):
        
        css = ['markymark/css/markdown-editor.css']
        iconlibrary_css = getattr(
            settings,
            'MARKYMARK_FONTAWESOME_CSS',
            'markymark/fontawesome/fontawesome.min.css'
        )
        if iconlibrary_css:
            css.append(iconlibrary_css)

        media = forms.Media(
            css={'all': css},
            js=('markymark/js/markdown-editor.js',)
        )

        # Use official extension loading to initialize all extensions
        # and hook in extension-defined media files.
        renderer = initialize_renderer()

        for extension in renderer.registeredExtensions:
            if hasattr(extension, 'media'):
                media += extension.media
        return media
792117
def getMedia(self, uri):
        """"""

        r = self.doQuery('media/' + uri)

        if r.status_code == 200:
            content_type = 'application/octet-stream'

            if 'content-type' in r.headers:
                content_type = r.headers['content-type']

            cache_control = None

            if 'cache-control' in r.headers:
                cache_control = r.headers['cache-control']

            return (r.content, content_type, cache_control)
        else:
            return (None, None, None)
211211
def media(self):
        
        js = ['admin/js/core.js',
              'zinnia/admin/mptt/js/mptt_m2m_selectbox.js',
              'admin/js/SelectFilter2.js']
        return Media(js=[staticfiles_storage.url(path) for path in js])
1004968
def style(self, id):
        """"""
        return self._serve_file(os.path.join(media_path, 'style', id))
576730
def attach(self, media: typing.Union[InputMedia, typing.Dict]):
        
        if isinstance(media, dict):
            if 'type' not in media:
                raise ValueError(f"Invalid media!")

            media_type = media['type']
            if media_type == 'photo':
                media = InputMediaPhoto(**media)
            elif media_type == 'video':
                media = InputMediaVideo(**media)
            # elif media_type == 'document':
            #     media = InputMediaDocument(**media)
            # elif media_type == 'audio':
            #     media = InputMediaAudio(**media)
            # elif media_type == 'animation':
            #     media = InputMediaAnimation(**media)
            else:
                raise TypeError(f"Invalid media type '{media_type}'!")

        elif not isinstance(media, InputMedia):
            raise TypeError(f"Media must be an instance of InputMedia or dict, not {type(media).__name__}")

        elif media.type in ['document', 'audio', 'animation']:
            raise ValueError(f"This type of media is not supported by media groups!")

        self.media.append(media)
1355757
function customize () {
  var q1 = {
    name: 'title',
    message: 'What is your scene\'s title? (e.g., Forest Scene)',
    type: 'input',
    default: 'aframe-boilerplate'
  };

  var q2 = {
    name: 'handControls',
    message: 'Do you want tracked controls with hand models?',
    type: 'confirm',
    default: false
  };

  // Go.
  return new Promise(function (resolve) {
    inquirer.prompt([q1, q2]).then(function (answers) {
      // Slugify.
      answers.shortTitle = answers.title.toLowerCase().replace(/\s+/g, '-'
);
      run(answers)
      resolve(answers.shortTitle);
    });
  });

  /**
   * Do all the string replacements.
   */
  function run (answers) {
    answers.aframeVersion = aframeVersion;
    ls(['index.html', 'package.json', 'README.md']).forEach(function (file) {
      fs.writeFileSync(file, nunjucks.render(file, answers));
    });
  }
}
667699
def get_template_context(src, container="div", classes="", inner_classes="", alt="", background_image=False, no_css=False, aria_hidden=False):
    """"""
    context = {
        "container": container,
        "classes": classes,
        "aspect_padding_bottom": aspect_ratio_percent(src),
        "alt": alt,
        "background_image": background_image,
        "no_css": no_css,
        "inner_classes": inner_classes,
        "aria_hidden": aria_hidden,
    }

    # We can't do any of the srcset (or JS switching fallback) if we don't
    # have a thumbnail library installed.
    if not get_thumbnail_engine():
        context["image"] = src
        return context

    sizes = get_image_sizes(src)
    context["image_sizes"] = sizes

    # Set the first image in the list as the one to be rendered initially
    # (pre-JS-fallback). `if sizes` might not be a necessary check...
    context["image"] = sizes[0]

    context["image_sizes_json"] = json.dumps(sizes)
    srcset_items = ["{} {}w".format(size["url"], size["width"]) for size in sizes]

    context["image_sizes_srcset"] = ", ".join(srcset_items)
    return context
917093
def media(self, form):
        
        js = ['admin/js/core.js', 'admin/js/admin/RelatedObjectLookups.js',
              'admin/js/jquery.min.js', 'admin/js/jquery.init.js']

        media = forms.Media(
            js=['%s%s' % (settings.STATIC_URL, u) for u in js],
        )

        if form:
            for name, field in form.fields.items():
                media = media + field.widget.media

        return media
1128484
def get_media_backend(fail_silently=True, handles_media_types=None, 
    handles_file_extensions=None, supports_thumbnails=None):
        
        backends = app_settings.MEDIA_TREE_MEDIA_BACKENDS
        if not len(backends):
            if not fail_silently:
                raise ImproperlyConfigured('There is no media backend configured.'  \
                    + ' Please define `MEDIA_TREE_MEDIA_BACKENDS` in your settings.')
            else:
                return False
        
        for path in backends:
            # Traverse backends until there is one supporting what's requested:
            backend = get_module_attr(path)
            if (not handles_media_types or backend.handles_media_types(handles_media_types))  \
                and (not handles_file_extensions or backend.handles_file_extensions(handles_file_extensions))  \
                and (not supports_thumbnails or backend.supports_thumbnails()):
                    return backend
    
        if not fail_silently:
            raise ImproperlyConfigured('There is no media backend configured to handle'  \
                ' the specified file types.')
        return False
1325312
function extras(src, js, options) {
		if (options.superword) {
			js = suber.pseudokeyword(
				js,
				getwords(options.superword, defaultoptions.superword),
				getwords(options.classword, defaultoptions.classword)
			);
		}
		return js;
	}
1252144
def add_material(self, media_file, media_type='icon'):
        
        res = self._post(
            'shakearound/material/add',
            files={
                'media': media_file
            },
            params={
                'type': media_type
            },
            result_processor=lambda x: x['data']
        )
        return res