Return default mdata map for GradeEntry
434679
def get_grade_entry_mdata():
    """"""
    return {
        'resource': {
            'element_label': {
                'text': 'resource',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'instructions': {
                'text': 'accepts an osid.id.Id object',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'required': False,
            'read_only': False,
            'linked': False,
            'array': False,
            'default_id_values': [''],
            'syntax': 'ID',
            'id_set': [],
        },
        'grade': {
            'element_label': {
                'text': 'grade',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'instructions': {
                'text': 'accepts an osid.id.Id object',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'required': False,
            'read_only': False,
            'linked': False,
            'array': False,
            'default_id_values': [''],
            'syntax': 'ID',
            'id_set': [],
        },
        'ignored_for_calculations': {
            'element_label': {
                'text': 'ignored for calculations',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'instructions': {
                'text': 'enter either true or false.',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'required': False,
            'read_only': False,
            'linked': False,
            'array': False,
            'default_boolean_values': [None],
            'syntax': 'BOOLEAN',
        },
        'score': {
            'element_label': {
                'text': 'score',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'instructions': {
                'text': 'enter a decimal value.',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'required': False,
            'read_only': False,
            'linked': False,
            'array': False,
            'default_decimal_values': [None],
            'syntax': 'DECIMAL',
            'decimal_scale': None,
            'minimum_decimal': None,
            'maximum_decimal': None,
            'decimal_set': [],
        },
        'gradebook_column': {
            'element_label': {
                'text': 'gradebook column',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'instructions': {
                'text': 'accepts an osid.id.Id object',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'required': False,
            'read_only': False,
            'linked': False,
            'array': False,
            'default_id_values': [''],
            'syntax': 'ID',
            'id_set': [],
        },
    }
19817
function getDefaultEntries() {
  let result = {}

  const PROJECT_MAIN = join(PROJECT_SRC_DIR, 'main.js')
  const PROJECT_INDEX = join(PROJECT_SRC_DIR, 'index.js')

  if (existsSync(PROJECT_MAIN))
    result.main = PROJECT_MAIN

  if (existsSync(PROJECT_INDEX))
    result.index = PROJECT_INDEX

  return result
}
471020
def get(content, keep_order=False):
        """"""
        if keep_order:
            from collections import OrderedDict
            dataentry = OrderedDict()
        else:
            dataentry = {}

        found = False
        for line in content.split('\n'):
            if line.strip().startswith('---- dataentry'):
                found = True
                continue
            elif line == '----':
                break
            elif not found:
                continue

            line_split = line.split(':')
            key = line_split[0].strip()
            value = re.sub('#.*$', '', ':'.join(line_split[1:])).strip()
            dataentry.setdefault(key, value)

        if not found:
            raise DokuWikiError('no dataentry found')
        return dataentry
140232
def default (self):
    """"""
    byte = 0
    for bit, name, value0, value1, default in SeqCmdAttrs.Table:
      if default == value1:
        byte = setBit(byte, bit, 1)
    return byte
779912
public Map<String, CSLItemData> toItemData(BibTeXDatabase db) {
		Map<String, CSLItemData> result = new HashMap<>();
		for (Map.Entry<Key, BibTeXEntry> e : db.getEntries().entrySet()) {
			result.put(e.getKey().getValue(), toItemData(e.getValue()));
		}
		return result;
	}
651207
def get_gradebook_column_summary_mdata():
    """"""
    return {
        'gradebook_column': {
            'element_label': {
                'text': 'gradebook column',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'instructions': {
                'text': 'accepts an osid.id.Id object',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'required': False,
            'read_only': False,
            'linked': False,
            'array': False,
            'default_id_values': [''],
            'syntax': 'ID',
            'id_set': [],
        },
    }
342863
def get_quantmap(features, acc_col, quantfields):
    """"""
    qmap = {}
    for feature in features:
        feat_acc = feature.pop(acc_col)
        qmap[feat_acc] = {qf: feature[qf] for qf in quantfields}
    return qmap
1106687
def get_comment_mdata():
    """"""
    return {
        'text': {
            'element_label': {
                'text': 'text',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'instructions': {
                'text': 'enter no more than 256 characters.',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'required': False,
            'read_only': False,
            'linked': False,
            'array': False,
            'default_string_values': [{
                'text': '',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            }],
            'syntax': 'STRING',
            'minimum_string_length': 0,
            'maximum_string_length': 256,
            'string_set': [],
        },
        'reference': {
            'element_label': {
                'text': 'reference',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'instructions': {
                'text': 'accepts an osid.id.Id object',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'required': False,
            'read_only': False,
            'linked': False,
            'array': False,
            'default_id_values': [''],
            'syntax': 'ID',
            'id_set': [],
        },
        'rating': {
            'element_label': {
                'text': 'rating',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'instructions': {
                'text': 'accepts an osid.id.Id object',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'required': False,
            'read_only': False,
            'linked': False,
            'array': False,
            'default_id_values': [''],
            'syntax': 'ID',
            'id_set': [],
        },
    }
1032451
public CSLItemData toItemData(BibTeXEntry e) {
		//get all fields from the BibTeX entry
		Map<String, String> entries = new HashMap<>();
		for (Map.Entry<Key, Value> field : e.getFields().entrySet()) {
			String us = field.getValue().toUserString().replaceAll("\\r", "");
			
			//convert LaTeX string to normal text
			try {
				List<LaTeXObject> objs = latexParser.parse(new StringReader(us));
				us = latexPrinter.print(objs).replaceAll("\\n", " ").replaceAll("\\r", "").trim();
			} catch (ParseException ex) {
				//ignore
			} catch (TokenMgrException err) {
				//ignore
			}
			
			entries.put(field.getKey().getValue().toLowerCase(), us);
		}
		
		//map type
		CSLType type = toType(e.getType());
		
		CSLItemDataBuilder builder = new CSLItemDataBuilder()
			.id(e.getKey().getValue()).type(type);
		
		//map address
		if (entries.containsKey(FIELD_LOCATION)) {
			builder.eventPlace(entries.get(FIELD_LOCATION));
			builder.publisherPlace(entries.get(FIELD_LOCATION));
		} else {
			builder.eventPlace(entries.get(FIELD_ADDRESS));
			builder.publisherPlace(entries.get(FIELD_ADDRESS));
		}
		
		//map author
		if (entries.containsKey(FIELD_AUTHOR)) {
			builder.author(NameParser.parse(entries.get(FIELD_AUTHOR)));
		}
		
		//map editor
		if (entries.containsKey(FIELD_EDITOR)) {
			builder.editor(NameParser.parse(entries.get(FIELD_EDITOR)));
			builder.collectionEditor(NameParser.parse(entries.get(FIELD_EDITOR)));
		}
		
		//map date
		if (type == CSLType.WEBPAGE && entries.containsKey(FIELD_URLDATE)) {
			CSLDate date = DateParser.toDate(entries.get(FIELD_URLDATE));
			builder.issued(date);
		} else if (entries.containsKey(FIELD_DATE)) {
			CSLDate date = DateParser.toDate(entries.get(FIELD_DATE));
			builder.issued(date);
			builder.eventDate(date);
		} else {
			CSLDate date = DateParser.toDate(entries.get(FIELD_YEAR), entries.get(FIELD_MONTH));
			builder.issued(date);
			builder.eventDate(date);
		}
		
		//map journal/journaltitle, booktitle, series
		if (entries.containsKey(FIELD_JOURNAL)) {
			builder.containerTitle(entries.get(FIELD_JOURNAL));
			builder.collectionTitle(entries.get(FIELD_JOURNAL));
		} else if (entries.containsKey(FIELD_JOURNALTITLE)) {
			builder.containerTitle(entries.get(FIELD_JOURNALTITLE));
			builder.collectionTitle(entries.get(FIELD_JOURNALTITLE));
		} else if (entries.containsKey(FIELD_BOOKTITLE)) {
			builder.containerTitle(entries.get(FIELD_BOOKTITLE));
			builder.collectionTitle(entries.get(FIELD_BOOKTITLE));
		} else {
			builder.containerTitle(entries.get(FIELD_SERIES));
			builder.collectionTitle(entries.get(FIELD_SERIES));
		}
		
		//map number and issue
		builder.number(entries.get(FIELD_NUMBER));
		if (entries.containsKey(FIELD_ISSUE)) {
			builder.issue(entries.get(FIELD_ISSUE));
		} else {
			builder.issue(entries.get(FIELD_NUMBER));
		}
		
		//map publisher, insitution, school, organisation
		if (type == CSLType.REPORT) {
			if (entries.containsKey(FIELD_PUBLISHER)) {
				builder.publisher(entries.get(FIELD_PUBLISHER));
			} else if (entries.containsKey(FIELD_INSTITUTION)) {
				builder.publisher(entries.get(FIELD_INSTITUTION));
			} else if (entries.containsKey(FIELD_SCHOOL)) {
				builder.publisher(entries.get(FIELD_SCHOOL));
			} else {
				builder.publisher(entries.get(FIELD_ORGANIZATION));
			}
		} else if (type == CSLType.THESIS) {
			if (entries.containsKey(FIELD_PUBLISHER)) {
				builder.publisher(entries.get(FIELD_PUBLISHER));
			} else if (entries.containsKey(FIELD_SCHOOL)) {
				builder.publisher(entries.get(FIELD_SCHOOL));
			} else if (entries.containsKey(FIELD_INSTITUTION)) {
				builder.publisher(entries.get(FIELD_INSTITUTION));
			} else {
				builder.publisher(entries.get(FIELD_ORGANIZATION));
			}
		} else {
			if (entries.containsKey(FIELD_PUBLISHER)) {
				builder.publisher(entries.get(FIELD_PUBLISHER));
			} else if (entries.containsKey(FIELD_ORGANIZATION)) {
				builder.publisher(entries.get(FIELD_ORGANIZATION));
			} else if (entries.containsKey(FIELD_INSTITUTION)) {
				builder.publisher(entries.get(FIELD_INSTITUTION));
			} else {
				builder.publisher(entries.get(FIELD_SCHOOL));
			}
		}
		
		//map title or chapter
		if (entries.containsKey(FIELD_TITLE)) {
			builder.title(entries.get(FIELD_TITLE));
		} else {
			builder.title(entries.get(FIELD_CHAPTER));
		}
		
		//map pages
		String pages = entries.get(FIELD_PAGES);
		if (pages != null) {
			PageRange pr = PageParser.parse(pages);
			builder.page(pr.getLiteral());
			builder.pageFirst(pr.getPageFirst());
			if (pr.getNumberOfPages() != null) {
				builder.numberOfPages(String.valueOf(pr.getNumberOfPages()));
			}
		}
		
		//map last accessed date
		if (entries.containsKey(FIELD_ACCESSED)) {
			builder.accessed(DateParser.toDate(entries.get(FIELD_ACCESSED)));
		}
		
		//map other attributes
		builder.volume(entries.get(FIELD_VOLUME));
		builder.keyword(entries.get(FIELD_KEYWORDS));
		builder.URL(entries.get(FIELD_URL));
		builder.status(entries.get(FIELD_STATUS));
		builder.ISSN(entries.get(FIELD_ISSN));
		builder.ISBN(entries.get(FIELD_ISBN));
		builder.version(entries.get(FIELD_REVISION));
		builder.annote(entries.get(FIELD_ANNOTE));
		builder.edition(entries.get(FIELD_EDITION));
		builder.abstrct(entries.get(FIELD_ABSTRACT));
		builder.DOI(entries.get(FIELD_DOI));
		builder.note(entries.get(FIELD_NOTE));
		
		//create citation item
		return builder.build();
	}
311340
def _init_map(self, record_types=None, **kwargs):
        """"""
        osid_objects.OsidObjectForm._init_map(self, record_types=record_types)
        self._my_map['outputScore'] = self._output_score_default
        self._my_map['gradeSystemId'] = str(kwargs['grade_system_id'])
        self._my_map['inputScoreEndRange'] = self._input_score_end_range_default
        self._my_map['inputScoreStartRange'] = self._input_score_start_range_default
        self._my_map['assignedGradebookIds'] = [str(kwargs['gradebook_id'])]
857987
def _init_map(self, record_types=None, **kwargs):
        """"""

        osid_objects.OsidSourceableForm._init_map(self)
        osid_objects.OsidObjectForm._init_map(self, record_types=record_types)
        self._my_map['copyrightRegistration'] = self._copyright_registration_default
        self._my_map['assignedRepositoryIds'] = [str(kwargs['repository_id'])]
        self._my_map['copyright'] = self._copyright_default
        self._my_map['title'] = self._title_default
        self._my_map['distributeVerbatim'] = self._distribute_verbatim_default
        self._my_map['createdDate'] = self._created_date_default
        self._my_map['distributeAlterations'] = self._distribute_alterations_default
        self._my_map['principalCreditString'] = self._principal_credit_string_default
        self._my_map['publishedDate'] = self._published_date_default
        self._my_map['sourceId'] = self._source_default
        self._my_map['providerLinkIds'] = self._provider_links_default
        self._my_map['publicDomain'] = self._public_domain_default
        self._my_map['distributeCompositions'] = self._distribute_compositions_default
        self._my_map['compositionId'] = self._composition_default
        self._my_map['published'] = self._published_default
        self._my_map['assetContents'] = []
790335
def get_grade_ids(self):
        
        id_list = []
        for grade_map in self._my_map['grades']:
            id_list.append(Id(grade_map.id))
        if id_list == []:
            raise IllegalState()
        else:
            return IdList(id_list)
567739
def get_item_mdata():
    """"""
    return {
        'learning_objectives': {
            'element_label': {
                'text': 'learning objectives',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'instructions': {
                'text': 'accepts an osid.id.Id[] object',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'required': False,
            'read_only': False,
            'linked': False,
            'array': True,
            'default_id_values': [],
            'syntax': 'ID',
            'id_set': [],
        },
    }
489248
def get_grade_system_mdata():
    """"""
    return {
        'numeric_score_increment': {
            'element_label': {
                'text': 'numeric score increment',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'instructions': {
                'text': 'enter a decimal value.',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'required': False,
            'read_only': False,
            'linked': False,
            'array': False,
            'default_decimal_values': [None],
            'syntax': 'DECIMAL',
            'decimal_scale': None,
            'minimum_decimal': None,
            'maximum_decimal': None,
            'decimal_set': [],
        },
        'lowest_numeric_score': {
            'element_label': {
                'text': 'lowest numeric score',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'instructions': {
                'text': 'enter a decimal value.',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'required': False,
            'read_only': False,
            'linked': False,
            'array': False,
            'default_decimal_values': [None],
            'syntax': 'DECIMAL',
            'decimal_scale': None,
            'minimum_decimal': None,
            'maximum_decimal': None,
            'decimal_set': [],
        },
        'based_on_grades': {
            'element_label': {
                'text': 'based on grades',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'instructions': {
                'text': 'enter either true or false.',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'required': False,
            'read_only': False,
            'linked': False,
            'array': False,
            'default_boolean_values': [None],
            'syntax': 'BOOLEAN',
        },
        'highest_numeric_score': {
            'element_label': {
                'text': 'highest numeric score',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'instructions': {
                'text': 'enter a decimal value.',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'required': False,
            'read_only': False,
            'linked': False,
            'array': False,
            'default_decimal_values': [None],
            'syntax': 'DECIMAL',
            'decimal_scale': None,
            'minimum_decimal': None,
            'maximum_decimal': None,
            'decimal_set': [],
        },
    }
236522
def _nodeGetNonDefaultsDict(self):
        
        dct = {}
        if self.data != self.defaultData:
            dct['data'] = self.data.name()
        return dct
526914
function getHaraldOpsData(defaults) {
 	var init = defaults.init || {}
 	var ops = init.ops || {}
 	var haraldops = defaults.haraldops || {}

	var jsonData = {}
	if (typeof ops.shutDown === 'function') jsonData.haraldopsShutdown = ops.shutDown
	if (typeof ops.sendMail === 'function') jsonData.haraldopsSendMail = ops.sendMail
	if (typeof init.appName === 'string' && init.appName) jsonData.haraldopsAppName = init.appName
	if (typeof init.identifier === 'string' && init.identifier) jsonData.haraldopsidentifier = init.identifier
	if (defaults.views) jsonData.haraldopsViews = defaults.views
	if (init.defaultsFile) jsonData.haraldopsDefaultsFile = init.defaultsFile
	if (typeof init.tmpFolder === 'string' && init.tmpFolder) jsonData.tmpFolder = init.tmpFolder
	if (typeof haraldops.responder === 'string' && haraldops.responder) jsonData.haraldopsResponderUrl = haraldops.responder
	if (typeof ops.responder === 'function') jsonData.haraldopsResponderFn = ops.responder

	jsonData.log = defaults.noInfoLog ? function () {} :
		defaults.apprunner && typeof defaults.apprunner.log === 'function' ? defaults.apprunner.log :
		console.log

	return jsonData
}
948855
def default(self):
        """"""
        import json

        import ambry.bundle.default_files as df
        import os

        path = os.path.join(os.path.dirname(df.__file__), 'notebook.ipynb')

        if six.PY2:
            with open(path, 'rb') as f:
                content_str = f.read()
        else:
            # py3
            with open(path, 'rt', encoding='utf-8') as f:
                content_str = f.read()

        c = json.loads(content_str)

        context = {
            'title': self._bundle.metadata.about.title,
            'summary': self._bundle.metadata.about.title,
            'bundle_vname': self._bundle.identity.vname
        }

        for cell in c['cells']:
            for i in range(len(cell['source'])):
                cell['source'][i] = cell['source'][i].format(**context)

        c['metadata']['ambry'] = {
            'identity': self._bundle.identity.dict
        }

        return json.dumps(c, indent=4)