Prints the DATA_DIRECTORY fields.
503093
def showDataDirectoriesData(peInstance):
    
    
    print "[+] Data directories:\n"
    dirs = peInstance.ntHeaders.optionalHeader.dataDirectory
    counter = 1
    for dir in dirs:
        print "[%d] --> Name: %s -- RVA: 0x%08x -- SIZE: 0x%08x" % (counter,  dir.name.value,  dir.rva.value,  dir.size.value)
        counter += 1
772907
def print_fieldrefs(doc, loader, stream):
    # type: (List[Dict[Text, Any]], Loader, IO) -> None
    """"""
    obj = extend_and_specialize(doc, loader)

    primitives = set(("http://www.w3.org/2001/XMLSchema#string",
                      "http://www.w3.org/2001/XMLSchema#boolean",
                      "http://www.w3.org/2001/XMLSchema#int",
                      "http://www.w3.org/2001/XMLSchema#long",
                      "https://w3id.org/cwl/salad#null",
                      "https://w3id.org/cwl/salad#enum",
                      "https://w3id.org/cwl/salad#array",
                      "https://w3id.org/cwl/salad#record",
                      "https://w3id.org/cwl/salad#Any"))

    stream.write("digraph {\n")
    for entry in obj:
        if entry.get("abstract"):
            continue
        if entry["type"] == "record":
            label = shortname(entry["name"])
            for field in entry.get("fields", []):
                found = set()  # type: Set[Text]
                field_name = shortname(field["name"])
                replace_type(field["type"], {}, loader, found, find_embeds=False)
                for each_type in found:
                    if each_type not in primitives:
                        stream.write(
                            "\"%s\" -> \"%s\" [label=\"%s\"];\n"
                            % (label, shortname(each_type), field_name))
    stream.write("}\n")
518840
def _chk_fields(field_data, field_formatter):
        """"""
        if len(field_data) == len(field_formatter):
            return
        len_dat = len(field_data)
        len_fmt = len(field_formatter)
        msg = [
            "FIELD DATA({d}) != FORMATTER({f})".format(d=len_dat, f=len_fmt),
            "DAT({N}): {D}".format(N=len_dat, D=field_data),
            "FMT({N}): {F}".format(N=len_fmt, F=field_formatter)]
        raise Exception("\n".join(msg))
68454
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, FIELD_NAME, 40, null, null);
        field = new FieldInfo(this, FIELD_CLASS, 40, null, null);
        field = new FieldInfo(this, BASE_FIELD_NAME, 40, null, null);
        field = new FieldInfo(this, DEPENDENT_FIELD_NAME, 40, null, null);
        field = new FieldInfo(this, MINIMUM_LENGTH, 4, null, null);
        field.setDataClass(Short.class);
        field = new FieldInfo(this, MAXIMUM_LENGTH, 5, null, null);
        field.setDataClass(Short.class);
        field = new FieldInfo(this, DEFAULT_VALUE, 50, null, null);
        field = new FieldInfo(this, INITIAL_VALUE, 50, null, null);
        field = new FieldInfo(this, FIELD_DESCRIPTION, 100, null, null);
        field = new FieldInfo(this, FIELD_DESC_VERTICAL, 14, null, null);
        field = new FieldInfo(this, FIELD_TYPE, 1, null, null);
        field = new FieldInfo(this, FIELD_DIMENSION, 3, null, null);
        field.setDataClass(Short.class);
        field = new FieldInfo(this, FIELD_FILE_NAME, 40, null, null);
        field = new FieldInfo(this, FIELD_SEQ_NO, 4, null, null);
        field.setDataClass(Short.class);
        field = new FieldInfo(this, FIELD_NOT_NULL, 1, null, null);
        field.setDataClass(Boolean.class);
        //field = new FieldInfo(this, DATA_CLASS, 20, null, null);
        field = new FieldInfo(this, HIDDEN, 10, null, null);
        field.setDataClass(Boolean.class);
        field = new FieldInfo(this, INCLUDE_SCOPE, 10, null, new Integer(0x004));
        field.setDataClass(Integer.class);
    }
1168471
def _default_output_dir():
  """"""
  try:
    dataset_name = gin.query_parameter("inputs.dataset_name")
  except ValueError:
    dataset_name = "random"
  dir_name = "{model_name}_{dataset_name}_{timestamp}".format(
      model_name=gin.query_parameter("train.model").configurable.name,
      dataset_name=dataset_name,
      timestamp=datetime.datetime.now().strftime("%Y%m%d_%H%M"),
  )
  dir_path = os.path.join("~", "trax", dir_name)
  print()
  trax.log("No --output_dir specified")
  return dir_path
587463
def write_data_set(file_path, dataset, output_dir, color_array_info, new_name=None, compress=True):
    """"""
    fileName = new_name if new_name else os.path.basename(file_path)
    dataset_dir = os.path.join(output_dir, fileName)
    data_dir = os.path.join(dataset_dir, 'data')

    if not os.path.exists(data_dir):
        os.makedirs(data_dir)

    root = {}
    root['metadata'] = {}
    root['metadata']['name'] = fileName

    writer = writer_mapping[dataset.GetClassName()]
    if writer:
        writer(dataset_dir, data_dir, dataset, color_array_info, root, compress)
    else:
        print(dataObject.GetClassName(), 'is not supported')

    with open(os.path.join(dataset_dir, "index.json"), 'w') as f:
        f.write(json.dumps(root, indent=2))

    return dataset_dir
179943
def showOptionalHeaderData(peInstance):
    
    
    print "[+] IMAGE_OPTIONAL_HEADER:\n"
    ohFields = peInstance.ntHeaders.optionalHeader.getFields()
    for field in ohFields:
        if not isinstance(ohFields[field],  datadirs.DataDirectory):
            print "--> %s = 0x%08x" % (field,  ohFields[field].value)
1219264
def __datasets_desc():
    """"""
    datasets = __get_data_folder_path() + 'datasets.csv'
    df = pd.read_csv(datasets)
    df = df[['Item', 'Title']]
    df.columns = ['dataset_id', 'title']
    # print('a list of the available datasets:')
    return df
348192
def generate_folder_names(self):
        """"""
        self.project_dir = os.path.join(prms.Paths.outdatadir, self.project)
        self.batch_dir = os.path.join(self.project_dir, self.name)
        self.raw_dir = os.path.join(self.batch_dir, "raw_data")
261471
private File printDirectoryName(String indent, File directory) {

    System.out.printf(String.format("%s%n", concatIndentAndDirectoryName(indent, directory)));

    return directory;
  }
505960
def listdir(self, folder_id='0', offset=None, limit=None, fields=None):
		''
		if fields is not None\
			and not isinstance(fields, types.StringTypes): fields = ','.join(fields)
		return self(
			join('folders', folder_id, 'items'),
			dict(offset=offset, limit=limit, fields=fields) )
117419
def print_db_stats():
    
    dbroot = get_db_root()
    n_ids = len(list(dbroot.glob("[N,W]*")))
    print("Number of WACs and NACs in database: {}".format(n_ids))
    print("These kind of data are in the database: (returning pd.DataFrame)")
    d = {}
    for key, val in PathManager.extensions.items():
        d[key] = [len(list(dbroot.glob("**/*" + val)))]
    return pd.DataFrame(d)
371694
def _dump(self):  # pragma: no cover
        

        print(70 * "-")
        print("ID lookup table:")
        for name in self.__id_lut:
            id_ = self.__id_lut[name]
            print("  %s -> %d" % (name, id_))

        print(70 * "-")
        print("%-4s %-60s %s" % ("ID", "Filename", "Refcount"))
        print(70 * "-")
        for id_ in self.__entries:
            entry = self.__entries[id_]
            print("%04d %-60s %d" % (id_, entry.filename, entry.refcount))
676716
def printDatawraps() :
	""""""
	l = listDatawraps()
	printf("Available datawraps for boostraping\n")
	for k, v in l.iteritems() :
		printf(k)
		printf("~"*len(k) + "|")
		for vv in v :
			printf(" "*len(k) + "|" + "~~~:> " + vv)
		printf('\n')
406466
def print_app_meta_data(self):
        
        l_metaData  = dir(self)
        l_classVar  = [x for x in l_metaData if x.isupper() ]
        for str_var in l_classVar:
            str_val = getattr(self, str_var)
            print("%20s: %s" % (str_var, str_val))
780555
public void printFormFields(ChainWriter out, int indent) throws IOException {
		if("true".equals(req.getParameter("search_engine"))) printHiddenField(out, indent, "search_engine", "true");
	}
465599
def print_horiz_table(self, data):
        """"""

        # Build list of returned objects
        return_objects = list()
        fields = self.job_args.get('fields')
        if not fields:
            fields = set()
            for item_dict in data:
                for field_item in item_dict.keys():
                    fields.add(field_item)
            fields = sorted(fields)

        for obj in data:
            item_struct = dict()
            for item in fields:
                item_struct[item] = obj.get(item)
            else:
                return_objects.append(item_struct)

        table = prettytable.PrettyTable(fields)
        for obj in return_objects:
            table.add_row([obj.get(i) for i in fields])

        for tbl in table.align.keys():
            table.align[tbl] = 'l'

        sort_key = self.job_args.get('sort_by')
        if sort_key:
            table.sortby = sort_key

        self.printer(table)