Get a native drawable by name as in 'R.drawable.name'.
357130
public static Drawable getDrawable(String name) {
        Resources res = Resources.getSystem();
        int id = res.getIdentifier(name, TYPE_DRAWABLE, NATIVE_PACKAGE);
        return id == 0 ? null : res.getDrawable(id);
    }
632247
def get_index_by_name(self, name):
        """"""
        for i in range(len(self.vertices)):
            if self.vertices[i].name == name:
                return i
        raise ValueError('Reverse look up of name failed.')
731382
public static Drawable createFromXmlInner(Resources r, XmlPullParser parser, AttributeSet attrs, Resources.Theme theme) throws XmlPullParserException, IOException {
        Drawable drawable = null;
        final String name = parser.getName();
        try {
            Class<? extends Drawable> clazz = CLASS_MAP.get(name);
            if (clazz != null) {
                drawable = clazz.newInstance();
            } else if (name.indexOf('.') > 0) {
                drawable = (Drawable) Class.forName(name).newInstance();
            }
        } catch (Exception e) {
            throw new XmlPullParserException("Error while inflating drawable resource", parser, e);
        }
        if (drawable == null) {
            if (Carbon.IS_LOLLIPOP_OR_HIGHER) {
                return Drawable.createFromXmlInner(r, parser, attrs, theme);
            } else {
                return Drawable.createFromXmlInner(r, parser, attrs);
            }
        }
        IMPL.inflate(drawable, r, parser, attrs, theme);
        return drawable;
    }
456446
@NonNull
    public static Drawable getTintDrawable(@NonNull Drawable drawable, @ColorInt int color) {
        drawable = DrawableCompat.wrap(drawable.mutate());
        DrawableCompat.setTint(drawable, color);
        return drawable;
    }
364150
def real_name(self, asname):
        """"""
        for name, _asname in self.names:
            if name == "*":
                return asname
            if not _asname:
                name = name.split(".", 1)[0]
                _asname = name
            if asname == _asname:
                return name
        raise exceptions.AttributeInferenceError(
            "Could not find original name for {attribute} in {target!r}",
            target=self,
            attribute=asname,
        )
828638
def get_menu(self, name):
        """"""
        if name not in self._menus:
            self._menus[name] = self.menuBar().addMenu(name)
        return self._menus[name]
631773
def _GetActualName(name):
   
   if _allowCapitalizedNames:
      name = UncapitalizeVmodlName(name)
   for defMap in _dataDefMap, _managedDefMap, _enumDefMap:
      dic = defMap.get(name)
      if dic:
         return dic[0]
   return None
1011261
def get(self, name: str, default: Any = None) -> np.ndarray:
		
		if name in self:
			return self[name]
		else:
			return default
607397
def parse_name(cls, name: str, default: T = None) -> T:
        """"""
        if not name:
            return default
        name = name.lower()
        return next((item for item in cls if name == item.name.lower()), default)
250760
public Drawable get() {
        final Drawable[] drawables = new Drawable[]{
                mPlaceHolder,
                new BitmapDrawable(mContext.getResources(), Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888)),
        };

        final TransitionDrawable transitionDrawable = new TransitionDrawable(drawables);
        into(new Callback() {
            @Override
            public void onBitmapLoaded(String path, Bitmap bitmap) {
                Log.d(TAG, "callback " + path + " called");
                if (bitmap != null) {
                    Log.d(TAG, "bitmap " + path + " loaded");

                    Drawable drawable = drawables[1];
                    if (drawable != null && drawable instanceof BitmapDrawable) {
                        BitmapDrawable bitmapDrawable = (BitmapDrawable) drawables[1];

                        try {
                            Method method = BitmapDrawable.class.getDeclaredMethod("setBitmap", Bitmap.class);
                            method.setAccessible(true);
                            method.invoke(bitmapDrawable, bitmap);

                            Log.d(TAG, "bitmap " + path + " added to transition");

                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    }

                    transitionDrawable.startTransition(500);
                    Log.d(TAG, "image " + path + " transition started");
                }

            }
        });

        return transitionDrawable;
    }
795943
def to_native(self, obj, name, value):  # pylint:disable=unused-argument
		""""""
		
		if self.mapping:
			for original, new in self.mapping.items():
				value = value.replace(original, new)
		
		return load(value, self.namespace)
1012858
def _maybe_get_default_name(self, name):
        
        if name is None and self.uri.fragment:
            name = self.uri.fragment
        return name
1082278
public boolean getUseIntrinsicPadding() {
        Drawable drawable = getCurrentDrawable();
        if (drawable instanceof IntrinsicPaddingDrawable) {
            return ((IntrinsicPaddingDrawable) drawable).getUseIntrinsicPadding();
        } else {
            return false;
        }
    }
465337
def get_shape(cursor, name):
    """"""
    cursor.execute('select * from [%s]' % name)
    inds = cursor.description[-1][0][1:].split('_')
    return tuple([int(i) for i in inds])
1029346
def widgetForName(self, name):
        
        for iwidget in range(len(self)):
            if self.widget(iwidget).name() == name:
                return self.widget(iwidget)
1153926
private int getFlagResource(Country country) {
        return getContext().getResources().getIdentifier("country_" + country.getIso().toLowerCase(), "drawable", getContext().getPackageName());
    }
839317
def getlist(self, name: str, default: Any = None) -> List[Any]:
        """"""
        return super().get(name, default)