return a list of GradPetition objects.
199750
def _process_json(data):
    
    requests = []
    for item in data:
        petition = GradPetition()
        petition.description = item.get('description')
        petition.submit_date = parse_datetime(item.get('submitDate'))
        petition.decision_date = parse_datetime(item.get('decisionDate'))

        if item.get('deptRecommend') and len(item.get('deptRecommend')):
            petition.dept_recommend = item.get('deptRecommend').lower()

        if item.get('gradSchoolDecision') and\
           len(item.get('gradSchoolDecision')):
            petition.gradschool_decision =\
                item.get('gradSchoolDecision').lower()
        requests.append(petition)
    return requests
1052848
def trainable_params_(m):
    
    if isinstance(m, collections.Sequence):
        return [p for p in m if p.requires_grad]
    else:
        return [p for p in m.parameters() if p.requires_grad]
474140
function(grad) {
	var defs = svgedit.utilities.findDefs();
	var existing_grads = $(defs).find("linearGradient, radialGradient");
	var i = existing_grads.length;
	var rad_attrs = ['r', 'cx', 'cy', 'fx', 'fy'];
	while (i--) {
		var og = existing_grads[i];
		if (grad.tagName == "linearGradient") {
			if (grad.getAttribute('x1') != og.getAttribute('x1') ||
				grad.getAttribute('y1') != og.getAttribute('y1') ||
				grad.getAttribute('x2') != og.getAttribute('x2') ||
				grad.getAttribute('y2') != og.getAttribute('y2')) 
			{
				continue;
			}
		} else {
			var grad_attrs = $(grad).attr(rad_attrs);
			var og_attrs = $(og).attr(rad_attrs);
			
			var diff = false;
			$.each(rad_attrs, function(i, attr) {
				if (grad_attrs[attr] != og_attrs[attr]) {diff = true;}
			});
			
			if (diff) {continue;}
		}
		
		// else could be a duplicate, iterate through stops
		var stops = grad.getElementsByTagNameNS(NS.SVG, "stop");
		var ostops = og.getElementsByTagNameNS(NS.SVG, "stop");

		if (stops.length != ostops.length) {
			continue;
		}

		var j = stops.length;
		while (j--) {
			var stop = stops[j];
			var ostop = ostops[j];

			if (stop.getAttribute('offset') != ostop.getAttribute('offset') ||
				stop.getAttribute('stop-opacity') != ostop.getAttribute('stop-opacity') ||
				stop.getAttribute('stop-color') != ostop.getAttribute('stop-color')) 
			{
				break;
			}
		}

		if (j == -1) {
			return og;
		}
	} // for each gradient in defs

	return null;
}
631765
def merge_grad_list(all_grads, all_vars):
    
    return [list(zip(gs, vs)) for gs, vs in zip(all_grads, all_vars)]
832138
def get_prtflds_all(self):
        """"""
        flds = []
        dont_add = set(['_parents', 'method_flds', 'relationship_rev', 'relationship'])
        # Fields: GO NS enrichment name ratio_in_study ratio_in_pop p_uncorrected
        #         depth study_count p_sm_bonferroni p_fdr_bh study_items
        self._flds_append(flds, self.get_prtflds_default(), dont_add)
        # Fields: GO NS goterm
        #         ratio_in_pop pop_n pop_count pop_items name
        #         ratio_in_study study_n study_count study_items
        #         method_flds enrichment p_uncorrected p_sm_bonferroni p_fdr_bh
        self._flds_append(flds, vars(self).keys(), dont_add)
        # Fields: name level is_obsolete namespace id depth parents children _parents alt_ids
        self._flds_append(flds, vars(self.goterm).keys(), dont_add)
        return flds
724236
def eval_grad(self):
        """"""

        # Compute D^T(D Y - S)
        return self.D.T.dot(self.D.dot(self.Y) - self.S)
868826
def get_objects_of_class(cls):
        
        return list(o for o in gc.get_objects() if isinstance(o, cls))
635625
def templates(self):
        """"""
        templates = {}
        result = []
        if self.entry_point_group_templates:
            result = self.load_entry_point_group_templates(
                self.entry_point_group_templates) or []

        for template in result:
            for name, path in template.items():
                templates[name] = path

        return templates
985355
def _process_json(data):
    
    requests = []
    for item in data:
        committee = GradCommittee()
        committee.status = item.get('status')
        committee.committee_type = item.get('committeeType')
        committee.dept = item.get('dept')
        committee.degree_title = item.get('degreeTitle')
        committee.degree_type = item.get('degreeType')
        committee.major_full_name = item.get('majorFullName')
        committee.start_date = datetime_from_string(item.get('startDate'))
        committee.end_date = datetime_from_string(item.get('endDate'))
        for member in item.get('members'):
            if member.get('status') == "inactive":
                continue

            com_mem = GradCommitteeMember()
            com_mem.first_name = member.get('nameFirst')
            com_mem.last_name = member.get('nameLast')

            if member.get('memberType') is not None and\
                    len(member.get('memberType')) > 0:
                com_mem.member_type = member.get('memberType').lower()

            if member.get('readingType') is not None and\
                    len(member.get('readingType')) > 0:
                com_mem.reading_type = member.get('readingType').lower()

            com_mem.dept = member.get('dept')
            com_mem.email = member.get('email')
            com_mem.status = member.get('status')
            committee.members.append(com_mem)

        requests.append(committee)
    return requests
31281
def get_suitable_vis_classes(obj):
    """"""

    ret = []
    for class_ in classes_vis():
        if isinstance(obj, class_.input_classes):
            ret.append(class_)
    return ret
709215
def _getSuitableClasses(self, data):
        """"""
        classes = None
        if data[EI.CLASS] == ELFCLASS.BITS_32:
            if data[EI.DATA] == ELFDATA.LSB:
                classes = LSB_32
            elif data[EI.DATA] == ELFDATA.MSB:
                classes = MSB_32

        elif data[EI.CLASS] == ELFCLASS.BITS_64:
            if data[EI.DATA] == ELFDATA.LSB:
                classes = LSB_64
            elif data[EI.DATA] == ELFDATA.MSB:
                classes = MSB_64

        return classes
478194
def _parse_head(heads, head_grads):
    """"""
    if isinstance(heads, NDArray):
        heads = [heads]
    if isinstance(head_grads, NDArray):
        head_grads = [head_grads]

    head_handles = c_handle_array(heads)

    if head_grads is None:
        hgrad_handles = ctypes.c_void_p(0)
    else:
        assert len(heads) == len(head_grads), \
            "heads and head_grads must be lists of the same length"
        hgrad_handles = c_array(NDArrayHandle,
                                [i.handle if i is not None else NDArrayHandle(0)
                                 for i in head_grads])
    return head_handles, hgrad_handles
39706
def get_study_items(results):
        """"""
        study_items = set()
        for obj in results:
            study_items.update(obj.study_items)
        return study_items
448746
def get_gradebooks(self):
        
        if self.retrieved:
            raise errors.IllegalState('List has already been retrieved.')
        self.retrieved = True
        return objects.GradebookList(self._results, runtime=self._runtime)
414406
def get_object_members(self, want_all):
        """"""
        check, members = super().get_object_members(want_all)
        get_traits = self.object.class_own_traits if self.options.inherited_members \
                     else self.object.class_traits
        trait_members = []
        for name, trait in sorted(get_traits(config=True).items()):
            # put help in __doc__ where autodoc will look for it
            trait.__doc__ = trait.help
            trait_members.append((name, trait))
        return check, trait_members + members
989013
def _list_superclasses(class_def):
    """"""
    superclasses = class_def.get('superClasses', [])
    if superclasses:
        # Make sure to duplicate the list
        return list(superclasses)

    sup = class_def.get('superClass', None)
    if sup:
        return [sup]
    else:
        return []
1324892
def requirements():
  """"""
  requirements_list = []
  with open('requirements.txt') as requirements:
    for install in requirements:
      requirements_list.append(install.strip())
  return requirements_list