Get if the session is premium for a given media type

        @param str media_type       Should be one of ANDROID.MEDIA_TYPE_*
        @return bool
516065
def is_premium(self, media_type):
        
        if self.logged_in:
            if media_type in self._user_data['premium']:
                return True
        return False
487466
def playlist_type=(playlist_type)
      validator = EnumAttributeValidator.new('String', ["iframe", "iframe-only"])
      unless validator.valid?(playlist_type)
        fail ArgumentError, "invalid value for 'playlist_type', must be one of #{validator.allowable_values}."
      end
      @playlist_type = playlist_type
    end
170616
protected function sessionDecode($str)
    {
        $type = ini_get('session.serialize_handler');
        if ($type === 'php') {
            $this->setSessionState($this->unserializePHP($str));
            return true;
        }
        if ($type === 'php_binary') {
            $this->setSessionState(igbinary_unserialize($str));
            return true;
        }
        return false;
    }
188471
@Override
	public List<RecordSessionUrl> getUrlsForType (int type) throws DatabaseException {
    	SqlPreparedStatementWrapper psGetAlluRLSForType = null;
        try {
        	psGetAlluRLSForType = DbSQL.getSingleton().getPreparedStatement("sessionurl.ps.geturlsfortype");
			psGetAlluRLSForType.getPs().setInt(1, type);
			try (ResultSet rs = psGetAlluRLSForType.getPs().executeQuery()) {
				List<RecordSessionUrl> result = new ArrayList<>();
				while (rs.next()) {
					result.add(new RecordSessionUrl(rs.getLong(URLID), rs.getInt(TYPE), rs.getString(URL)));
				}
				return result;
			}
		} catch (SQLException e) {
			throw new DatabaseException(e);
		} finally {
			DbSQL.getSingleton().releasePreparedStatement(psGetAlluRLSForType);
		}
    }
561826
public function mb_str_pad($input, $pad_length, $pad_string = ' ', $pad_type = STR_PAD_RIGHT)
    {
        $diff = strlen($input) - mb_strlen($input);
        return str_pad($input, $pad_length + $diff, $pad_string, $pad_type);
    }
1112862
public static boolean equalsIgnoreParameters(String mediaTypeA, String mediaTypeB) {
    // TODO(mlinder): Make the HttpMediaType.isSameType implementation more performant.
    return (mediaTypeA == null && mediaTypeB == null)
        || mediaTypeA != null
            && mediaTypeB != null
            && new HttpMediaType(mediaTypeA).equalsIgnoreParameters(new HttpMediaType(mediaTypeB));
  }
244955
private static boolean containsIgnoreCase(String str, String searchStr) {
    if (str == null || searchStr == null) {
      return false;
    }
    int len = searchStr.length();
    int max = str.length() - len;
    for (int i = 0; i <= max; i++) {
      if (str.regionMatches(true, i, searchStr, 0, len)) {
        return true;
      }
    }
    return false;
  }
1032233
public boolean mediaIsGIF () {
        String contentType = this.getContentType();
        return contentType != null && this.media != null && contentType.equals("image/gif");
    }
224275
function isType(t, str) {
        // This function gets the type of `t`, typeof and instanceof are unreliable (typeof null === 'object')
        return Object.prototype.toString.call(t).match(/\s([a-zA-Z]+)/)[1].toLowerCase() === str;
    }
1258929
public static MediaType parse(String string) {
        if(string==null) return null;

        Map<String, String> params =  new HashMap<>();
        Matcher typeSubtype = TYPE_SUBTYPE.matcher(string);
        if (!typeSubtype.lookingAt()) return null;
        String type = typeSubtype.group(1).toLowerCase(Locale.US);
        String subtype = typeSubtype.group(2).toLowerCase(Locale.US);

        String charset = null;
        Matcher parameter = PARAMETER.matcher(string);
        for (int s = typeSubtype.end(); s < string.length(); s = parameter.end()) {
            parameter.region(s, string.length());
            if (!parameter.lookingAt()) return null; // This is not a well-formed media type.

            String name = parameter.group(1);
            if (name == null) continue;
            String param = parameter.group(2) != null
                    ? parameter.group(2)  // Value is a token.
                    : parameter.group(3); // Value is a quoted string.
            if(name.equalsIgnoreCase("charset")) {
                if (charset != null && !param.equalsIgnoreCase(charset)) {
                    throw new IllegalArgumentException("Multiple different charsets: " + string);
                }
                charset = param;
            } else {
                params.put(name, param);
            }
        }
        return new MediaType(string, type, subtype, charset, Collections.unmodifiableMap(params));
    }
1056426
public static boolean is_khar(String str)
    {
        if (is_vargiya1(str) || is_vargiya2(str) || is_shar(str)) return true;

        return false;
    }
143605
def media_type_str(mediatype):
    """"""
    if mediatype == const.MEDIA_TYPE_UNKNOWN:
        return 'Unknown'
    if mediatype == const.MEDIA_TYPE_VIDEO:
        return 'Video'
    if mediatype == const.MEDIA_TYPE_MUSIC:
        return 'Music'
    if mediatype == const.MEDIA_TYPE_TV:
        return 'TV'
    return 'Unsupported'
1137175
public static boolean isVisarganta(String str)
	{
		Log.logInfo(" Checking if  is_visarganta:::");
		String s1 = VarnaUtil.getAntyaVarna(str);
		if(isVisarga(s1) )
			return true;		
		return false;
	}
979484
public static boolean is_amadi(String str)
    {
        String s1 = VarnaUtil.getAdiVarna(str);
        if (is_am(s1)) return true;
        return false;
    }
209148
public static boolean isJavaIdentifier( String str ) {
      if( str.length() == 0 || !Character.isJavaIdentifierStart( str.charAt( 0 ) ) ){
         return false;
      }
      for( int i = 1; i < str.length(); i++ ){
         if( !Character.isJavaIdentifierPart( str.charAt( i ) ) ){
            return false;
         }
      }
      return true;
   }
159152
public static MediaType parseMediaType(String mediaType) {
		Assert.hasLength(mediaType, "'mediaType' must not be empty");
		String[] parts = StringUtils.tokenizeToStringArray(mediaType, ";");

		String fullType = parts[0].trim();
		// java.net.HttpURLConnection returns a *; q=.2 Accept header
		if (WILDCARD_TYPE.equals(fullType)) {
			fullType = "*/*";
		}
		int subIndex = fullType.indexOf('/');
		if (subIndex == -1) {
			throw new InvalidMediaTypeException(mediaType, "does not contain '/'");
		}
		if (subIndex == fullType.length() - 1) {
			throw new InvalidMediaTypeException(mediaType, "does not contain subtype after '/'");
		}
		String type = fullType.substring(0, subIndex);
		String subtype = fullType.substring(subIndex + 1, fullType.length());
		if (WILDCARD_TYPE.equals(type) && !WILDCARD_TYPE.equals(subtype)) {
			throw new InvalidMediaTypeException(mediaType, "wildcard type is legal only in '*/*' (all media types)");
		}

		Map<String, String> parameters = null;
		if (parts.length > 1) {
			parameters = new LinkedHashMap<String, String>(parts.length - 1);
			for (int i = 1; i < parts.length; i++) {
				String parameter = parts[i];
				int eqIndex = parameter.indexOf('=');
				if (eqIndex != -1) {
					String attribute = parameter.substring(0, eqIndex);
					String value = parameter.substring(eqIndex + 1, parameter.length());
					parameters.put(attribute, value);
				}
			}
		}

		try {
			return new MediaType(type, subtype, parameters);
		}
		catch (UnsupportedCharsetException ex) {
			throw new InvalidMediaTypeException(mediaType, "unsupported charset '" + ex.getCharsetName() + "'");
		}
		catch (IllegalArgumentException ex) {
			throw new InvalidMediaTypeException(mediaType, ex.getMessage());
		}
	}
1081222
private static function check_type($type=null) {
	if (is_null($type)) {
		return self::TYPE_CONTINUOUS;
	}
	
	if (isset(self::$type_durations[$type]) == false) {
		$exception = bootstrap::get_library('exception');
		throw new $exception('unknown session type');
	}
	
	return $type;
}