:param desc: The describe hash of a DNAnexus entity
    :type desc: dict

    Depending on the class of the entity, this method will print a
    formatted and human-readable string containing the data in *desc*.
771908
def print_desc(desc, verbose=False):
    '''
    
    '''
    if desc['class'] in ['project', 'workspace', 'container']:
        print_project_desc(desc, verbose=verbose)
    elif desc['class'] == 'app':
        print_app_desc(desc, verbose=verbose)
    elif desc['class'] == 'globalworkflow':
        print_globalworkflow_desc(desc, verbose=verbose)
    elif desc['class'] in ['job', 'analysis']:
        print_execution_desc(desc)
    elif desc['class'] == 'user':
        print_user_desc(desc)
    elif desc['class'] in ['org', 'team']:
        print_generic_desc(desc)
    else:
        print_data_obj_desc(desc, verbose=verbose)
747536
def display_path_info(descriptor, class_, namespace):
    
    paths = CONN.EnumerateInstanceNames(class_, namespace=interop)  # noqa: F821
    print('%ss: count=%s' % (descriptor, len(paths)))
    for path in paths:
        print('%s: %s' % (descriptor, path))
    return paths
1319905
public static TypeDesc forDescriptor(String desc)
        throws IllegalArgumentException
    {
        // TODO: Figure out how to cache these. Using a plain IdentityMap poses
        // a problem. The back reference to the key causes a memory leak.

        TypeDesc td;
        int cursor = 0;
        int dim = 0;
        try {
            char c;
            while ((c = desc.charAt(cursor++)) == '[') {
                dim++;
            }

            switch (c) {
            case 'V':
                td = VOID;
                break;
            case 'Z':
                td = BOOLEAN;
                break;
            case 'C':
                td = CHAR;
                break;
            case 'B':
                td = BYTE;
                break;
            case 'S':
                td = SHORT;
                break;
            case 'I':
                td = INT;
                break;
            case 'J':
                td = LONG;
                break;
            case 'F':
                td = FLOAT;
                break;
            case 'D':
                td = DOUBLE;
                break;
            case 'L':
                if (dim > 0) {
                    desc = desc.substring(dim);
                    cursor = 1;
                }
                StringBuffer name = new StringBuffer(desc.length() - 2);
                while ((c = desc.charAt(cursor++)) != ';') {
                    if (c == '/') {
                        c = '.';
                    }
                    name.append(c);
                }
                td = intern(new ObjectType(desc, name.toString()));
                break;
            default:
                throw invalidDescriptor(desc);
            }
        }
        catch (NullPointerException e) {
            throw invalidDescriptor(desc);
        }
        catch (IndexOutOfBoundsException e) {
            throw invalidDescriptor(desc);
        }

        if (cursor != desc.length()) {
            throw invalidDescriptor(desc);
        }

        while (--dim >= 0) {
            td = td.toArrayType();
        }

        return td;
    }
996932
public function setDescription($desc)
    {
        $descAttribute = $this->descriptionAttribute;
        return is_string($descAttribute) ? $this->$descAttribute = $desc : null;
    }
486484
def prt_txt_desc2nts(self, prt, desc2nts, prtfmt):
        """"""
        # 1-D: data to print is a flat list of namedtuples
        if 'flat' in desc2nts:
            nts = desc2nts.get('flat')
            # sys.stdout.write("FLAT NTS: {FLDS}\n".format(FLDS=" ".join(next(iter(nts))._fields)))
            prt_txt(prt, nts, prtfmt)
        # 2-D: data to print is a list of [(section, nts), ...
        else:
            for section, nts in desc2nts['sections']:
                prt.write("\nSECTION: {SEC}\n".format(SEC=section))
                prt_txt(prt, nts, prtfmt)
            grprobj = self.sortobj.grprobj
            dat = SummarySec2dHdrGos().summarize_sec2hdrnts(desc2nts['sections'])
            ugos_y = dat['G'].intersection(grprobj.usrgos)
            ugos_n = dat['U'].intersection(grprobj.usrgos)
            return {'GO_DESC':'usr', 'SECs':len(dat['S']), 'GOs':len(ugos_y),
                    'UNGRP':len(ugos_n), 'undesc':'ungrpd'}
1308
public static MethodDesc forDescriptor(String desc) 
        throws IllegalArgumentException
    {
        try {
            int cursor = 0;
            char c;

            if ((c = desc.charAt(cursor++)) != '(') {
                throw invalidDescriptor(desc);
            }

            StringBuffer buf = new StringBuffer();
            List<TypeDesc> list = new ArrayList<TypeDesc>();

            while ((c = desc.charAt(cursor++)) != ')') {
                switch (c) {
                case 'V':
                case 'I':
                case 'C':
                case 'Z':
                case 'D':
                case 'F':
                case 'J':
                case 'B':
                case 'S':
                    buf.append(c);
                    break;
                case '[':
                    buf.append(c);
                    continue;
                case 'L':
                    while (true) {
                        buf.append(c);
                        if (c == ';') {
                            break;
                        }
                        c = desc.charAt(cursor++);
                    }
                    break;
                default:
                    throw invalidDescriptor(desc);
                }

                list.add(TypeDesc.forDescriptor(buf.toString()));
                buf.setLength(0);
            }

            TypeDesc ret = TypeDesc.forDescriptor(desc.substring(cursor));

            TypeDesc[] tds = list.toArray(new TypeDesc[list.size()]);

            return intern(new MethodDesc(desc, ret, tds));
        } catch (NullPointerException e) {
            throw invalidDescriptor(desc);
        } catch (IndexOutOfBoundsException e) {
            throw invalidDescriptor(desc);
        }
    }
359023
def desc(self):
        
        if 'ects' in self:
            fmt = '%s (%s, S%d) [%s, %.2f ECTS]'
            fields = ('title', 'code', 'semester', 'status', 'ects')
        else:
            fmt = '%s'
            fields = ('title',)

        s = fmt % tuple([self[f] for f in fields])

        if self['followed'] and self['session']:
            res = self['result']
            if self.get('jury', 0) > 0:
                res = self['jury']

            s += ' --> %.2f/20 (%s)' % (res, self['session'])

        return s
34133
def render_desc(desc):
    """"""
    desc = desc + '.'
    desc_lines = split_len(desc, 54)
    if len(desc_lines) > 1:
        join_str = "'\n%s'" % (' '*21)
        lines_str = join_str.join(desc_lines)
        out = "('%s')" % lines_str
    else:
        out = "'%s'" % desc_lines[0]
    return out
210667
def describe(self):
        
        return {
            "name": self.name,
            "params": self.params,
            "returns": self.returns,
            "description": self.description,
        }
811159
def ParseMessage(descriptor, byte_str):
  
  result_class = MakeClass(descriptor)
  new_msg = result_class()
  new_msg.ParseFromString(byte_str)
  return new_msg
651935
def as_dict(self):
        
        d = {"@module": self.__class__.__module__,
             "@class": self.__class__.__name__}
        # print("in as_dict", type(self.x), type(self.c), type(self.xc))
        if self.x is not None: d["x"] = self.x.as_dict()
        if self.c is not None: d["c"] = self.c.as_dict()
        if self.xc is not None: d["xc"] = self.xc.as_dict()
        return d
20664
public static TypeDesc forDescriptor(final String desc) throws IllegalArgumentException {
        TypeDesc type = cDescriptorsToInstances.get(desc);
        if (type != null) {
            return type;
        }

        // TODO: Support generics in descriptor.

        String rootDesc = desc;
        int cursor = 0;
        int dim = 0;
        try {
            char c;
            while ((c = rootDesc.charAt(cursor++)) == '[') {
                dim++;
            }

            switch (c) {
            case 'V':
                type = VOID;
                break;
            case 'Z':
                type = BOOLEAN;
                break;
            case 'C':
                type = CHAR;
                break;
            case 'B':
                type = BYTE;
                break;
            case 'S':
                type = SHORT;
                break;
            case 'I':
                type = INT;
                break;
            case 'J':
                type = LONG;
                break;
            case 'F':
                type = FLOAT;
                break;
            case 'D':
                type = DOUBLE;
                break;
            case 'L':
                if (dim > 0) {
                    rootDesc = rootDesc.substring(dim);
                    cursor = 1;
                }
                StringBuffer name = new StringBuffer(rootDesc.length() - 2);
                while ((c = rootDesc.charAt(cursor++)) != ';') {
                    if (c == '/') {
                        c = '.';
                    }
                    name.append(c);
                }
                type = intern(new ObjectType(rootDesc, name.toString()));
                break;
            default:
                throw invalidDescriptor(desc);
            }
        } catch (NullPointerException e) {
            throw invalidDescriptor(desc);
        } catch (IndexOutOfBoundsException e) {
            throw invalidDescriptor(desc);
        }

        if (cursor != rootDesc.length()) {
            throw invalidDescriptor(desc);
        }

        while (--dim >= 0) {
            type = type.toArrayType();
        }

        cDescriptorsToInstances.put(desc, type);
        return type;
    }
477877
def record(self):
        # type: () -> bytes
        '''
        
        '''
        if not self._initialized:
            raise pycdlibexception.PyCdlibInternalError('UDF Terminating Descriptor not initialized')

        rec = struct.pack(self.FMT, b'\x00' * 16, b'\x00' * 496)[16:]
        return self.desc_tag.record(rec) + rec
653740
def _descr_str(descr, data, region):
    
    if data:
        name = dd.get_sample_name(data)
        if name:
            descr = "{0} : {1}".format(descr, name)
        elif "work_bam" in data:
            descr = "{0} : {1}".format(descr, os.path.basename(data["work_bam"]))
    if region:
        descr = "{0} : {1}".format(descr, region)
    return descr
203425
def write_desc(self) -> None:
        

        path = os.path.join(self.exp_dir, "model_description.txt")
        with open(path, "w") as desc_f:
            for key, val in self.__dict__.items():
                print("%s=%s" % (key, val), file=desc_f)

        import json
        json_path = os.path.join(self.exp_dir, "model_description.json")
        desc = { } #type: Dict[str, Any]
        # For use in decoding from a saved model
        desc["topology"] = {
            "batch_x_name" : self.batch_x.name, #type: ignore
            "batch_x_lens_name" : self.batch_x_lens.name, #type: ignore
            "dense_decoded_name" : self.dense_decoded.name #type: ignore
        }
        desc["model_type"] = str(self.__class__)
        for key, val in self.__dict__.items():
            if isinstance(val, int):
                desc[str(key)] = val
            elif isinstance(val, tf.Tensor):
                desc[key] = {
                    "type": "tf.Tensor",
                    "name": val.name, #type: ignore
                    "shape": str(val.shape), #type: ignore
                    "dtype" : str(val.dtype), #type: ignore
                    "value" : str(val),
                }
            elif isinstance(val, tf.SparseTensor): #type: ignore
                desc[key] = {
                    "type": "tf.SparseTensor",
                    "value": str(val), #type: ignore
                }
            else:
                desc[str(key)] = str(val)
        with open(json_path, "w") as json_desc_f:
            json.dump(desc, json_desc_f, skipkeys=True)
513722
public static void printCode(String code, String desc) {
        System.out.println("--------------------------" + desc + " begin--------------------------");
        System.out.println(code);
        System.out.println("--------------------------" + desc + " end--------------------------");
    }
867390
def description(self) -> str:
        ''''''

        return '{0.uuid.hex}—{1}'.format(self, self.context.module)