partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
ImageBoundImportDescriptorEntry.parse
Returns a new L{ImageBoundImportDescriptorEntry} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object containing data to create a new L{ImageBoundImportDescriptorEntry}. @rtype: L{ImageBoundImportDescriptorEntry} @return: A new {Imag...
pype32/directories.py
def parse(readDataInstance): """ Returns a new L{ImageBoundImportDescriptorEntry} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object containing data to create a new L{ImageBoundImportDescriptorEntry}. @rtype: L{ImageBoundIm...
def parse(readDataInstance): """ Returns a new L{ImageBoundImportDescriptorEntry} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object containing data to create a new L{ImageBoundImportDescriptorEntry}. @rtype: L{ImageBoundIm...
[ "Returns", "a", "new", "L", "{", "ImageBoundImportDescriptorEntry", "}", "object", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L215-L236
[ "def", "parse", "(", "readDataInstance", ")", ":", "boundEntry", "=", "ImageBoundImportDescriptorEntry", "(", ")", "boundEntry", ".", "timeDateStamp", ".", "value", "=", "readDataInstance", ".", "readDword", "(", ")", "boundEntry", ".", "offsetModuleName", ".", "v...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
TLSDirectory.parse
Returns a new L{TLSDirectory} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object containing data to create a new L{TLSDirectory} object. @rtype: L{TLSDirectory} @return: A new {TLSDirectory} object.
pype32/directories.py
def parse(readDataInstance): """ Returns a new L{TLSDirectory} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object containing data to create a new L{TLSDirectory} object. @rtype: L{TLSDirectory} @return: A new {TLSDi...
def parse(readDataInstance): """ Returns a new L{TLSDirectory} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object containing data to create a new L{TLSDirectory} object. @rtype: L{TLSDirectory} @return: A new {TLSDi...
[ "Returns", "a", "new", "L", "{", "TLSDirectory", "}", "object", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L266-L284
[ "def", "parse", "(", "readDataInstance", ")", ":", "tlsDir", "=", "TLSDirectory", "(", ")", "tlsDir", ".", "startAddressOfRawData", ".", "value", "=", "readDataInstance", ".", "readDword", "(", ")", "tlsDir", ".", "endAddressOfRawData", ".", "value", "=", "rea...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
TLSDirectory64.parse
Returns a new L{TLSDirectory64} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object containing data to create a new L{TLSDirectory64} object. @rtype: L{TLSDirectory64} @return: A new L{TLSDirectory64} object.
pype32/directories.py
def parse(readDataInstance): """ Returns a new L{TLSDirectory64} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object containing data to create a new L{TLSDirectory64} object. @rtype: L{TLSDirectory64} @return: A new ...
def parse(readDataInstance): """ Returns a new L{TLSDirectory64} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object containing data to create a new L{TLSDirectory64} object. @rtype: L{TLSDirectory64} @return: A new ...
[ "Returns", "a", "new", "L", "{", "TLSDirectory64", "}", "object", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L312-L330
[ "def", "parse", "(", "readDataInstance", ")", ":", "tlsDir", "=", "TLSDirectory64", "(", ")", "tlsDir", ".", "startAddressOfRawData", ".", "value", "=", "readDataInstance", ".", "readQword", "(", ")", "tlsDir", ".", "endAddressOfRawData", ".", "value", "=", "r...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
ImageLoadConfigDirectory64.parse
Returns a new L{ImageLoadConfigDirectory64} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object containing data to create a new L{ImageLoadConfigDirectory64} object. @rtype: L{ImageLoadConfigDirectory64} @return: A new L{ImageLoadCo...
pype32/directories.py
def parse(readDataInstance): """ Returns a new L{ImageLoadConfigDirectory64} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object containing data to create a new L{ImageLoadConfigDirectory64} object. @rtype: L{ImageLoadConfig...
def parse(readDataInstance): """ Returns a new L{ImageLoadConfigDirectory64} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object containing data to create a new L{ImageLoadConfigDirectory64} object. @rtype: L{ImageLoadConfig...
[ "Returns", "a", "new", "L", "{", "ImageLoadConfigDirectory64", "}", "object", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L473-L512
[ "def", "parse", "(", "readDataInstance", ")", ":", "configDir", "=", "ImageLoadConfigDirectory64", "(", ")", "configDir", ".", "size", ".", "value", "=", "readDataInstance", ".", "readDword", "(", ")", "configDir", ".", "timeDateStamp", ".", "value", "=", "rea...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
ImageBaseRelocationEntry.parse
Returns a new L{ImageBaseRelocationEntry} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to parse as a L{ImageBaseRelocationEntry} object. @rtype: L{ImageBaseRelocationEntry} @return: A new L{ImageBaseRelocationEntry}...
pype32/directories.py
def parse(readDataInstance): """ Returns a new L{ImageBaseRelocationEntry} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to parse as a L{ImageBaseRelocationEntry} object. @rtype: L{ImageBaseRelocationEntry} ...
def parse(readDataInstance): """ Returns a new L{ImageBaseRelocationEntry} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to parse as a L{ImageBaseRelocationEntry} object. @rtype: L{ImageBaseRelocationEntry} ...
[ "Returns", "a", "new", "L", "{", "ImageBaseRelocationEntry", "}", "object", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L537-L552
[ "def", "parse", "(", "readDataInstance", ")", ":", "reloc", "=", "ImageBaseRelocationEntry", "(", ")", "reloc", ".", "virtualAddress", ".", "value", "=", "readDataInstance", ".", "readDword", "(", ")", "reloc", ".", "sizeOfBlock", ".", "value", "=", "readDataI...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
ImageDebugDirectory.parse
Returns a new L{ImageDebugDirectory} object. @type readDataInstance: L{ReadData} @param readDataInstance: A new L{ReadData} object with data to be parsed as a L{ImageDebugDirectory} object. @rtype: L{ImageDebugDirectory} @return: A new L{ImageDebugDirectory} object.
pype32/directories.py
def parse(readDataInstance): """ Returns a new L{ImageDebugDirectory} object. @type readDataInstance: L{ReadData} @param readDataInstance: A new L{ReadData} object with data to be parsed as a L{ImageDebugDirectory} object. @rtype: L{ImageDebugDirectory} ...
def parse(readDataInstance): """ Returns a new L{ImageDebugDirectory} object. @type readDataInstance: L{ReadData} @param readDataInstance: A new L{ReadData} object with data to be parsed as a L{ImageDebugDirectory} object. @rtype: L{ImageDebugDirectory} ...
[ "Returns", "a", "new", "L", "{", "ImageDebugDirectory", "}", "object", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L587-L608
[ "def", "parse", "(", "readDataInstance", ")", ":", "dbgDir", "=", "ImageDebugDirectory", "(", ")", "dbgDir", ".", "characteristics", ".", "value", "=", "readDataInstance", ".", "readDword", "(", ")", "dbgDir", ".", "timeDateStamp", ".", "value", "=", "readData...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
ImageDebugDirectories.parse
Returns a new L{ImageDebugDirectories} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{ImageDebugDirectories} object. @type nDebugEntries: int @param nDebugEntries: Number of L{ImageDebugDirectory} ...
pype32/directories.py
def parse(readDataInstance, nDebugEntries): """ Returns a new L{ImageDebugDirectories} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{ImageDebugDirectories} object. @type nDebugEntries: in...
def parse(readDataInstance, nDebugEntries): """ Returns a new L{ImageDebugDirectories} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{ImageDebugDirectories} object. @type nDebugEntries: in...
[ "Returns", "a", "new", "L", "{", "ImageDebugDirectories", "}", "object", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L629-L655
[ "def", "parse", "(", "readDataInstance", ",", "nDebugEntries", ")", ":", "dbgEntries", "=", "ImageDebugDirectories", "(", ")", "dataLength", "=", "len", "(", "readDataInstance", ")", "toRead", "=", "nDebugEntries", "*", "consts", ".", "SIZEOF_IMAGE_DEBUG_ENTRY32", ...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
ImageImportDescriptorEntry.parse
Returns a new L{ImageImportDescriptorEntry} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{ImageImportDescriptorEntry}. @rtype: L{ImageImportDescriptorEntry} @return: A new L{ImageImportDescriptorE...
pype32/directories.py
def parse(readDataInstance): """ Returns a new L{ImageImportDescriptorEntry} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{ImageImportDescriptorEntry}. @rtype: L{ImageImportDescriptorEntry...
def parse(readDataInstance): """ Returns a new L{ImageImportDescriptorEntry} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{ImageImportDescriptorEntry}. @rtype: L{ImageImportDescriptorEntry...
[ "Returns", "a", "new", "L", "{", "ImageImportDescriptorEntry", "}", "object", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L702-L718
[ "def", "parse", "(", "readDataInstance", ")", ":", "iid", "=", "ImageImportDescriptorEntry", "(", ")", "iid", ".", "originalFirstThunk", ".", "value", "=", "readDataInstance", ".", "readDword", "(", ")", "iid", ".", "timeDateStamp", ".", "value", "=", "readDat...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
ImageImportDescriptor.parse
Returns a new L{ImageImportDescriptor} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{ImageImportDescriptor} object. @type nEntries: int @param nEntries: The number of L{ImageImportDescriptorEntry}...
pype32/directories.py
def parse(readDataInstance, nEntries): """ Returns a new L{ImageImportDescriptor} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{ImageImportDescriptor} object. @type nEntries: int ...
def parse(readDataInstance, nEntries): """ Returns a new L{ImageImportDescriptor} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{ImageImportDescriptor} object. @type nEntries: int ...
[ "Returns", "a", "new", "L", "{", "ImageImportDescriptor", "}", "object", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L743-L769
[ "def", "parse", "(", "readDataInstance", ",", "nEntries", ")", ":", "importEntries", "=", "ImageImportDescriptor", "(", ")", "dataLength", "=", "len", "(", "readDataInstance", ")", "toRead", "=", "nEntries", "*", "consts", ".", "SIZEOF_IMAGE_IMPORT_ENTRY32", "if",...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
ExportTableEntry.parse
Returns a new L{ExportTableEntry} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{ExportTableEntry} object. @rtype: L{ExportTableEntry} @return: A new L{ExportTableEntry} object.
pype32/directories.py
def parse(readDataInstance): """ Returns a new L{ExportTableEntry} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{ExportTableEntry} object. @rtype: L{ExportTableEntry} @return: A ne...
def parse(readDataInstance): """ Returns a new L{ExportTableEntry} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{ExportTableEntry} object. @rtype: L{ExportTableEntry} @return: A ne...
[ "Returns", "a", "new", "L", "{", "ExportTableEntry", "}", "object", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L850-L866
[ "def", "parse", "(", "readDataInstance", ")", ":", "exportEntry", "=", "ExportTableEntry", "(", ")", "exportEntry", ".", "functionRva", ".", "value", "=", "readDataInstance", ".", "readDword", "(", ")", "exportEntry", ".", "nameOrdinal", ".", "value", "=", "re...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
ImageExportTable.parse
Returns a new L{ImageExportTable} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{ImageExportTable} object. @rtype: L{ImageExportTable} @return: A new L{ImageExportTable} object.
pype32/directories.py
def parse(readDataInstance): """ Returns a new L{ImageExportTable} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{ImageExportTable} object. @rtype: L{ImageExportTable} @return: A ne...
def parse(readDataInstance): """ Returns a new L{ImageExportTable} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{ImageExportTable} object. @rtype: L{ImageExportTable} @return: A ne...
[ "Returns", "a", "new", "L", "{", "ImageExportTable", "}", "object", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L902-L925
[ "def", "parse", "(", "readDataInstance", ")", ":", "et", "=", "ImageExportTable", "(", ")", "et", ".", "characteristics", ".", "value", "=", "readDataInstance", ".", "readDword", "(", ")", "et", ".", "timeDateStamp", ".", "value", "=", "readDataInstance", "....
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
NETDirectory.parse
Returns a new L{NETDirectory} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{NETDirectory} object. @rtype: L{NETDirectory} @return: A new L{NETDirectory} object.
pype32/directories.py
def parse(readDataInstance): """ Returns a new L{NETDirectory} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{NETDirectory} object. @rtype: L{NETDirectory} @return: A new L{NETDirec...
def parse(readDataInstance): """ Returns a new L{NETDirectory} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{NETDirectory} object. @rtype: L{NETDirectory} @return: A new L{NETDirec...
[ "Returns", "a", "new", "L", "{", "NETDirectory", "}", "object", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L945-L960
[ "def", "parse", "(", "readDataInstance", ")", ":", "nd", "=", "NETDirectory", "(", ")", "nd", ".", "directory", "=", "NetDirectory", ".", "parse", "(", "readDataInstance", ")", "nd", ".", "netMetaDataHeader", "=", "NetMetaDataHeader", ".", "parse", "(", "rea...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
NetDirectory.parse
Returns a new L{NetDirectory} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{NetDirectory} object. @rtype: L{NetDirectory} @return: A new L{NetDirectory} object.
pype32/directories.py
def parse(readDataInstance): """ Returns a new L{NetDirectory} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{NetDirectory} object. @rtype: L{NetDirectory} @return: A new L{NetDirec...
def parse(readDataInstance): """ Returns a new L{NetDirectory} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{NetDirectory} object. @rtype: L{NetDirectory} @return: A new L{NetDirec...
[ "Returns", "a", "new", "L", "{", "NetDirectory", "}", "object", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L1001-L1048
[ "def", "parse", "(", "readDataInstance", ")", ":", "nd", "=", "NetDirectory", "(", ")", "nd", ".", "cb", ".", "value", "=", "readDataInstance", ".", "readDword", "(", ")", "nd", ".", "majorRuntimeVersion", ".", "value", "=", "readDataInstance", ".", "readW...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
NetMetaDataHeader.parse
Returns a new L{NetMetaDataHeader} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{NetMetaDataHeader} object. @rtype: L{NetMetaDataHeader} @return: A new L{NetMetaDataHeader} object.
pype32/directories.py
def parse(readDataInstance): """ Returns a new L{NetMetaDataHeader} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{NetMetaDataHeader} object. @rtype: L{NetMetaDataHeader} @return: A...
def parse(readDataInstance): """ Returns a new L{NetMetaDataHeader} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{NetMetaDataHeader} object. @rtype: L{NetMetaDataHeader} @return: A...
[ "Returns", "a", "new", "L", "{", "NetMetaDataHeader", "}", "object", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L1071-L1091
[ "def", "parse", "(", "readDataInstance", ")", ":", "nmh", "=", "NetMetaDataHeader", "(", ")", "nmh", ".", "signature", ".", "value", "=", "readDataInstance", ".", "readDword", "(", ")", "nmh", ".", "majorVersion", ".", "value", "=", "readDataInstance", ".", ...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
NetMetaDataStreamEntry.parse
Returns a new L{NetMetaDataStreamEntry} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{NetMetaDataStreamEntry}. @rtype: L{NetMetaDataStreamEntry} @return: A new L{NetMetaDataStreamEntry} object.
pype32/directories.py
def parse(readDataInstance): """ Returns a new L{NetMetaDataStreamEntry} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{NetMetaDataStreamEntry}. @rtype: L{NetMetaDataStreamEntry} @r...
def parse(readDataInstance): """ Returns a new L{NetMetaDataStreamEntry} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{NetMetaDataStreamEntry}. @rtype: L{NetMetaDataStreamEntry} @r...
[ "Returns", "a", "new", "L", "{", "NetMetaDataStreamEntry", "}", "object", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L1113-L1127
[ "def", "parse", "(", "readDataInstance", ")", ":", "n", "=", "NetMetaDataStreamEntry", "(", ")", "n", ".", "offset", ".", "value", "=", "readDataInstance", ".", "readDword", "(", ")", "n", ".", "size", ".", "value", "=", "readDataInstance", ".", "readDword...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
NetMetaDataStreams.parse
Returns a new L{NetMetaDataStreams} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{NetMetaDataStreams} object. @type nStreams: int @param nStreams: The number of L{NetMetaDataStreamEntry} objects i...
pype32/directories.py
def parse(readDataInstance, nStreams): """ Returns a new L{NetMetaDataStreams} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{NetMetaDataStreams} object. @type nStreams: int @param...
def parse(readDataInstance, nStreams): """ Returns a new L{NetMetaDataStreams} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{NetMetaDataStreams} object. @type nStreams: int @param...
[ "Returns", "a", "new", "L", "{", "NetMetaDataStreams", "}", "object", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L1148-L1173
[ "def", "parse", "(", "readDataInstance", ",", "nStreams", ")", ":", "streams", "=", "NetMetaDataStreams", "(", ")", "for", "i", "in", "range", "(", "nStreams", ")", ":", "streamEntry", "=", "NetMetaDataStreamEntry", "(", ")", "streamEntry", ".", "offset", "....
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
NetMetaDataTableHeader.parse
Returns a new L{NetMetaDataTableHeader} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{NetMetaDataTableHeader} object. @rtype: L{NetMetaDataTableHeader} @return: A new L{NetMetaDataTableHeader} obj...
pype32/directories.py
def parse(readDataInstance): """ Returns a new L{NetMetaDataTableHeader} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{NetMetaDataTableHeader} object. @rtype: L{NetMetaDataTableHeader} ...
def parse(readDataInstance): """ Returns a new L{NetMetaDataTableHeader} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{NetMetaDataTableHeader} object. @rtype: L{NetMetaDataTableHeader} ...
[ "Returns", "a", "new", "L", "{", "NetMetaDataTableHeader", "}", "object", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L1195-L1215
[ "def", "parse", "(", "readDataInstance", ")", ":", "th", "=", "NetMetaDataTableHeader", "(", ")", "th", ".", "reserved_1", ".", "value", "=", "readDataInstance", ".", "readDword", "(", ")", "th", ".", "majorVersion", ".", "value", "=", "readDataInstance", "....
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
NetMetaDataTables.parse
Returns a new L{NetMetaDataTables} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{NetMetaDataTables} object. @rtype: L{NetMetaDataTables} @return: A new L{NetMetaDataTables} object.
pype32/directories.py
def parse(readDataInstance, netMetaDataStreams): """ Returns a new L{NetMetaDataTables} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{NetMetaDataTables} object. @rtype: L{NetMetaDataTables...
def parse(readDataInstance, netMetaDataStreams): """ Returns a new L{NetMetaDataTables} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{NetMetaDataTables} object. @rtype: L{NetMetaDataTables...
[ "Returns", "a", "new", "L", "{", "NetMetaDataTables", "}", "object", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L1237-L1273
[ "def", "parse", "(", "readDataInstance", ",", "netMetaDataStreams", ")", ":", "dt", "=", "NetMetaDataTables", "(", ")", "dt", ".", "netMetaDataTableHeader", "=", "NetMetaDataTableHeader", ".", "parse", "(", "readDataInstance", ")", "dt", ".", "tables", "=", "{",...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
NetResources.parse
Returns a new L{NetResources} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{NetResources} object. @rtype: L{NetResources} @return: A new L{NetResources} object.
pype32/directories.py
def parse(readDataInstance): """ Returns a new L{NetResources} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{NetResources} object. @rtype: L{NetResources} @return: A new L{NetResources} object. ...
def parse(readDataInstance): """ Returns a new L{NetResources} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with data to be parsed as a L{NetResources} object. @rtype: L{NetResources} @return: A new L{NetResources} object. ...
[ "Returns", "a", "new", "L", "{", "NetResources", "}", "object", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L1312-L1366
[ "def", "parse", "(", "readDataInstance", ")", ":", "r", "=", "NetResources", "(", ")", "r", ".", "signature", "=", "readDataInstance", ".", "readDword", "(", ")", "if", "r", ".", "signature", "!=", "0xbeefcace", ":", "return", "r", "r", ".", "readerCount...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
verify_and_fill_address_paths_from_bip32key
Take address paths and verifies their accuracy client-side. Also fills in all the available metadata (WIF, public key, etc)
bcwallet/bc_utils.py
def verify_and_fill_address_paths_from_bip32key(address_paths, master_key, network): ''' Take address paths and verifies their accuracy client-side. Also fills in all the available metadata (WIF, public key, etc) ''' assert network, network wallet_obj = Wallet.deserialize(master_key, network=...
def verify_and_fill_address_paths_from_bip32key(address_paths, master_key, network): ''' Take address paths and verifies their accuracy client-side. Also fills in all the available metadata (WIF, public key, etc) ''' assert network, network wallet_obj = Wallet.deserialize(master_key, network=...
[ "Take", "address", "paths", "and", "verifies", "their", "accuracy", "client", "-", "side", "." ]
blockcypher/bcwallet
python
https://github.com/blockcypher/bcwallet/blob/4c623a8e19705332c9398c3fea9d5dc3c1dafb9b/bcwallet/bc_utils.py#L33-L84
[ "def", "verify_and_fill_address_paths_from_bip32key", "(", "address_paths", ",", "master_key", ",", "network", ")", ":", "assert", "network", ",", "network", "wallet_obj", "=", "Wallet", ".", "deserialize", "(", "master_key", ",", "network", "=", "network", ")", "...
4c623a8e19705332c9398c3fea9d5dc3c1dafb9b
train
GraphFusedDensity.solution_path
Follows the solution path of the generalized lasso to find the best lambda value.
pygfl/density.py
def solution_path(self): '''Follows the solution path of the generalized lasso to find the best lambda value.''' lambda_grid = np.exp(np.linspace(np.log(self.max_lambda), np.log(self.min_lambda), self.lambda_bins)) aic_trace = np.zeros((len(self.bins),lambda_grid.shape[0])) # The AIC score for e...
def solution_path(self): '''Follows the solution path of the generalized lasso to find the best lambda value.''' lambda_grid = np.exp(np.linspace(np.log(self.max_lambda), np.log(self.min_lambda), self.lambda_bins)) aic_trace = np.zeros((len(self.bins),lambda_grid.shape[0])) # The AIC score for e...
[ "Follows", "the", "solution", "path", "of", "the", "generalized", "lasso", "to", "find", "the", "best", "lambda", "value", "." ]
tansey/gfl
python
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/density.py#L123-L240
[ "def", "solution_path", "(", "self", ")", ":", "lambda_grid", "=", "np", ".", "exp", "(", "np", ".", "linspace", "(", "np", ".", "log", "(", "self", ".", "max_lambda", ")", ",", "np", ".", "log", "(", "self", ".", "min_lambda", ")", ",", "self", ...
ae0f078bab57aba9e827ed6162f247ff9dc2aa19
train
GraphFusedDensity.run
Run the graph-fused logit lasso with a fixed lambda penalty.
pygfl/density.py
def run(self, lam, initial_values=None): '''Run the graph-fused logit lasso with a fixed lambda penalty.''' if initial_values is not None: if self.k == 0 and self.trails is not None: betas, zs, us = initial_values else: betas, us = initial_values ...
def run(self, lam, initial_values=None): '''Run the graph-fused logit lasso with a fixed lambda penalty.''' if initial_values is not None: if self.k == 0 and self.trails is not None: betas, zs, us = initial_values else: betas, us = initial_values ...
[ "Run", "the", "graph", "-", "fused", "logit", "lasso", "with", "a", "fixed", "lambda", "penalty", "." ]
tansey/gfl
python
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/density.py#L343-L391
[ "def", "run", "(", "self", ",", "lam", ",", "initial_values", "=", "None", ")", ":", "if", "initial_values", "is", "not", "None", ":", "if", "self", ".", "k", "==", "0", "and", "self", ".", "trails", "is", "not", "None", ":", "betas", ",", "zs", ...
ae0f078bab57aba9e827ed6162f247ff9dc2aa19
train
GraphFusedDensity.data_log_likelihood
Calculates the log-likelihood of a Polya tree bin given the beta values.
pygfl/density.py
def data_log_likelihood(self, successes, trials, beta): '''Calculates the log-likelihood of a Polya tree bin given the beta values.''' return binom.logpmf(successes, trials, 1.0 / (1 + np.exp(-beta))).sum()
def data_log_likelihood(self, successes, trials, beta): '''Calculates the log-likelihood of a Polya tree bin given the beta values.''' return binom.logpmf(successes, trials, 1.0 / (1 + np.exp(-beta))).sum()
[ "Calculates", "the", "log", "-", "likelihood", "of", "a", "Polya", "tree", "bin", "given", "the", "beta", "values", "." ]
tansey/gfl
python
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/density.py#L393-L395
[ "def", "data_log_likelihood", "(", "self", ",", "successes", ",", "trials", ",", "beta", ")", ":", "return", "binom", ".", "logpmf", "(", "successes", ",", "trials", ",", "1.0", "/", "(", "1", "+", "np", ".", "exp", "(", "-", "beta", ")", ")", ")",...
ae0f078bab57aba9e827ed6162f247ff9dc2aa19
train
spawn_worker
This method has to be module level function :type params: Params
apiritif/loadgen.py
def spawn_worker(params): """ This method has to be module level function :type params: Params """ setup_logging(params) log.info("Adding worker: idx=%s\tconcurrency=%s\tresults=%s", params.worker_index, params.concurrency, params.report) worker = Worker(params) worker.star...
def spawn_worker(params): """ This method has to be module level function :type params: Params """ setup_logging(params) log.info("Adding worker: idx=%s\tconcurrency=%s\tresults=%s", params.worker_index, params.concurrency, params.report) worker = Worker(params) worker.star...
[ "This", "method", "has", "to", "be", "module", "level", "function" ]
Blazemeter/apiritif
python
https://github.com/Blazemeter/apiritif/blob/27b48a68425949998c2254e5e1e0226882d9eee8/apiritif/loadgen.py#L48-L59
[ "def", "spawn_worker", "(", "params", ")", ":", "setup_logging", "(", "params", ")", "log", ".", "info", "(", "\"Adding worker: idx=%s\\tconcurrency=%s\\tresults=%s\"", ",", "params", ".", "worker_index", ",", "params", ".", "concurrency", ",", "params", ".", "rep...
27b48a68425949998c2254e5e1e0226882d9eee8
train
Worker.run_nose
:type params: Params
apiritif/loadgen.py
def run_nose(self, params): """ :type params: Params """ thread.set_index(params.thread_index) log.debug("[%s] Starting nose iterations: %s", params.worker_index, params) assert isinstance(params.tests, list) # argv.extend(['--with-apiritif', '--nocapture', '--exe...
def run_nose(self, params): """ :type params: Params """ thread.set_index(params.thread_index) log.debug("[%s] Starting nose iterations: %s", params.worker_index, params) assert isinstance(params.tests, list) # argv.extend(['--with-apiritif', '--nocapture', '--exe...
[ ":", "type", "params", ":", "Params" ]
Blazemeter/apiritif
python
https://github.com/Blazemeter/apiritif/blob/27b48a68425949998c2254e5e1e0226882d9eee8/apiritif/loadgen.py#L161-L209
[ "def", "run_nose", "(", "self", ",", "params", ")", ":", "thread", ".", "set_index", "(", "params", ".", "thread_index", ")", "log", ".", "debug", "(", "\"[%s] Starting nose iterations: %s\"", ",", "params", ".", "worker_index", ",", "params", ")", "assert", ...
27b48a68425949998c2254e5e1e0226882d9eee8
train
JTLSampleWriter._write_single_sample
:type sample: Sample
apiritif/loadgen.py
def _write_single_sample(self, sample): """ :type sample: Sample """ bytes = sample.extras.get("responseHeadersSize", 0) + 2 + sample.extras.get("responseBodySize", 0) message = sample.error_msg if not message: message = sample.extras.get("responseMessage") ...
def _write_single_sample(self, sample): """ :type sample: Sample """ bytes = sample.extras.get("responseHeadersSize", 0) + 2 + sample.extras.get("responseBodySize", 0) message = sample.error_msg if not message: message = sample.extras.get("responseMessage") ...
[ ":", "type", "sample", ":", "Sample" ]
Blazemeter/apiritif
python
https://github.com/Blazemeter/apiritif/blob/27b48a68425949998c2254e5e1e0226882d9eee8/apiritif/loadgen.py#L346-L376
[ "def", "_write_single_sample", "(", "self", ",", "sample", ")", ":", "bytes", "=", "sample", ".", "extras", ".", "get", "(", "\"responseHeadersSize\"", ",", "0", ")", "+", "2", "+", "sample", ".", "extras", ".", "get", "(", "\"responseBodySize\"", ",", "...
27b48a68425949998c2254e5e1e0226882d9eee8
train
ApiritifPlugin.addError
when a test raises an uncaught exception :param test: :param error: :return:
apiritif/loadgen.py
def addError(self, test, error): """ when a test raises an uncaught exception :param test: :param error: :return: """ # test_dict will be None if startTest wasn't called (i.e. exception in setUp/setUpClass) # status=BROKEN if self.current_sample is...
def addError(self, test, error): """ when a test raises an uncaught exception :param test: :param error: :return: """ # test_dict will be None if startTest wasn't called (i.e. exception in setUp/setUpClass) # status=BROKEN if self.current_sample is...
[ "when", "a", "test", "raises", "an", "uncaught", "exception", ":", "param", "test", ":", ":", "param", "error", ":", ":", "return", ":" ]
Blazemeter/apiritif
python
https://github.com/Blazemeter/apiritif/blob/27b48a68425949998c2254e5e1e0226882d9eee8/apiritif/loadgen.py#L490-L504
[ "def", "addError", "(", "self", ",", "test", ",", "error", ")", ":", "# test_dict will be None if startTest wasn't called (i.e. exception in setUp/setUpClass)", "# status=BROKEN", "if", "self", ".", "current_sample", "is", "not", "None", ":", "assertion_name", "=", "error...
27b48a68425949998c2254e5e1e0226882d9eee8
train
Directory.parse
Returns a L{Directory}-like object. @type readDataInstance: L{ReadData} @param readDataInstance: L{ReadData} object to read from. @rtype: L{Directory} @return: L{Directory} object.
pype32/datadirs.py
def parse(readDataInstance): """ Returns a L{Directory}-like object. @type readDataInstance: L{ReadData} @param readDataInstance: L{ReadData} object to read from. @rtype: L{Directory} @return: L{Directory} object. """ d = Directory() ...
def parse(readDataInstance): """ Returns a L{Directory}-like object. @type readDataInstance: L{ReadData} @param readDataInstance: L{ReadData} object to read from. @rtype: L{Directory} @return: L{Directory} object. """ d = Directory() ...
[ "Returns", "a", "L", "{", "Directory", "}", "-", "like", "object", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/datadirs.py#L79-L92
[ "def", "parse", "(", "readDataInstance", ")", ":", "d", "=", "Directory", "(", ")", "d", ".", "rva", ".", "value", "=", "readDataInstance", ".", "readDword", "(", ")", "d", ".", "size", ".", "value", "=", "readDataInstance", ".", "readDword", "(", ")",...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
DataDirectory.parse
Returns a L{DataDirectory}-like object. @type readDataInstance: L{ReadData} @param readDataInstance: L{ReadData} object to read from. @rtype: L{DataDirectory} @return: The L{DataDirectory} object containing L{consts.IMAGE_NUMBEROF_DIRECTORY_ENTRIES} L{Directory} objects...
pype32/datadirs.py
def parse(readDataInstance): """Returns a L{DataDirectory}-like object. @type readDataInstance: L{ReadData} @param readDataInstance: L{ReadData} object to read from. @rtype: L{DataDirectory} @return: The L{DataDirectory} object containing L{consts.IMAGE_NUMBEROF...
def parse(readDataInstance): """Returns a L{DataDirectory}-like object. @type readDataInstance: L{ReadData} @param readDataInstance: L{ReadData} object to read from. @rtype: L{DataDirectory} @return: The L{DataDirectory} object containing L{consts.IMAGE_NUMBEROF...
[ "Returns", "a", "L", "{", "DataDirectory", "}", "-", "like", "object", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/datadirs.py#L121-L140
[ "def", "parse", "(", "readDataInstance", ")", ":", "if", "len", "(", "readDataInstance", ")", "==", "consts", ".", "IMAGE_NUMBEROF_DIRECTORY_ENTRIES", "*", "8", ":", "newDataDirectory", "=", "DataDirectory", "(", ")", "for", "i", "in", "range", "(", "consts", ...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
main
Compute Pgens from a file and output to another file.
olga/compute_pgen.py
def main(): """Compute Pgens from a file and output to another file.""" parser = OptionParser(conflict_handler="resolve") parser.add_option('--humanTRA', '--human_T_alpha', action='store_true', dest='humanTRA', default=False, help='use default human TRA model (T cell alpha chain)') parser.add_option('...
def main(): """Compute Pgens from a file and output to another file.""" parser = OptionParser(conflict_handler="resolve") parser.add_option('--humanTRA', '--human_T_alpha', action='store_true', dest='humanTRA', default=False, help='use default human TRA model (T cell alpha chain)') parser.add_option('...
[ "Compute", "Pgens", "from", "a", "file", "and", "output", "to", "another", "file", "." ]
zsethna/OLGA
python
https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/compute_pgen.py#L270-L780
[ "def", "main", "(", ")", ":", "parser", "=", "OptionParser", "(", "conflict_handler", "=", "\"resolve\"", ")", "parser", ".", "add_option", "(", "'--humanTRA'", ",", "'--human_T_alpha'", ",", "action", "=", "'store_true'", ",", "dest", "=", "'humanTRA'", ",", ...
e825c333f0f9a4eb02132e0bcf86f0dca9123114
train
create_plateaus
Creates plateaus of constant value in the data.
pygfl/utils.py
def create_plateaus(data, edges, plateau_size, plateau_vals, plateaus=None): '''Creates plateaus of constant value in the data.''' nodes = set(edges.keys()) if plateaus is None: plateaus = [] for i in range(len(plateau_vals)): if len(nodes) == 0: break ...
def create_plateaus(data, edges, plateau_size, plateau_vals, plateaus=None): '''Creates plateaus of constant value in the data.''' nodes = set(edges.keys()) if plateaus is None: plateaus = [] for i in range(len(plateau_vals)): if len(nodes) == 0: break ...
[ "Creates", "plateaus", "of", "constant", "value", "in", "the", "data", "." ]
tansey/gfl
python
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/utils.py#L29-L50
[ "def", "create_plateaus", "(", "data", ",", "edges", ",", "plateau_size", ",", "plateau_vals", ",", "plateaus", "=", "None", ")", ":", "nodes", "=", "set", "(", "edges", ".", "keys", "(", ")", ")", "if", "plateaus", "is", "None", ":", "plateaus", "=", ...
ae0f078bab57aba9e827ed6162f247ff9dc2aa19
train
pretty_str
Pretty-print a matrix or vector.
pygfl/utils.py
def pretty_str(p, decimal_places=2, print_zero=True, label_columns=False): '''Pretty-print a matrix or vector.''' if len(p.shape) == 1: return vector_str(p, decimal_places, print_zero) if len(p.shape) == 2: return matrix_str(p, decimal_places, print_zero, label_columns) raise Exception('...
def pretty_str(p, decimal_places=2, print_zero=True, label_columns=False): '''Pretty-print a matrix or vector.''' if len(p.shape) == 1: return vector_str(p, decimal_places, print_zero) if len(p.shape) == 2: return matrix_str(p, decimal_places, print_zero, label_columns) raise Exception('...
[ "Pretty", "-", "print", "a", "matrix", "or", "vector", "." ]
tansey/gfl
python
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/utils.py#L148-L154
[ "def", "pretty_str", "(", "p", ",", "decimal_places", "=", "2", ",", "print_zero", "=", "True", ",", "label_columns", "=", "False", ")", ":", "if", "len", "(", "p", ".", "shape", ")", "==", "1", ":", "return", "vector_str", "(", "p", ",", "decimal_pl...
ae0f078bab57aba9e827ed6162f247ff9dc2aa19
train
matrix_str
Pretty-print the matrix.
pygfl/utils.py
def matrix_str(p, decimal_places=2, print_zero=True, label_columns=False): '''Pretty-print the matrix.''' return '[{0}]'.format("\n ".join([(str(i) if label_columns else '') + vector_str(a, decimal_places, print_zero) for i, a in enumerate(p)]))
def matrix_str(p, decimal_places=2, print_zero=True, label_columns=False): '''Pretty-print the matrix.''' return '[{0}]'.format("\n ".join([(str(i) if label_columns else '') + vector_str(a, decimal_places, print_zero) for i, a in enumerate(p)]))
[ "Pretty", "-", "print", "the", "matrix", "." ]
tansey/gfl
python
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/utils.py#L156-L158
[ "def", "matrix_str", "(", "p", ",", "decimal_places", "=", "2", ",", "print_zero", "=", "True", ",", "label_columns", "=", "False", ")", ":", "return", "'[{0}]'", ".", "format", "(", "\"\\n \"", ".", "join", "(", "[", "(", "str", "(", "i", ")", "if"...
ae0f078bab57aba9e827ed6162f247ff9dc2aa19
train
vector_str
Pretty-print the vector values.
pygfl/utils.py
def vector_str(p, decimal_places=2, print_zero=True): '''Pretty-print the vector values.''' style = '{0:.' + str(decimal_places) + 'f}' return '[{0}]'.format(", ".join([' ' if not print_zero and a == 0 else style.format(a) for a in p]))
def vector_str(p, decimal_places=2, print_zero=True): '''Pretty-print the vector values.''' style = '{0:.' + str(decimal_places) + 'f}' return '[{0}]'.format(", ".join([' ' if not print_zero and a == 0 else style.format(a) for a in p]))
[ "Pretty", "-", "print", "the", "vector", "values", "." ]
tansey/gfl
python
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/utils.py#L160-L163
[ "def", "vector_str", "(", "p", ",", "decimal_places", "=", "2", ",", "print_zero", "=", "True", ")", ":", "style", "=", "'{0:.'", "+", "str", "(", "decimal_places", ")", "+", "'f}'", "return", "'[{0}]'", ".", "format", "(", "\", \"", ".", "join", "(", ...
ae0f078bab57aba9e827ed6162f247ff9dc2aa19
train
calc_plateaus
Calculate the plateaus (degrees of freedom) of a graph of beta values in linear time.
pygfl/utils.py
def calc_plateaus(beta, edges, rel_tol=1e-4, verbose=0): '''Calculate the plateaus (degrees of freedom) of a graph of beta values in linear time.''' if not isinstance(edges, dict): raise Exception('Edges must be a map from each node to a list of neighbors.') to_check = deque(range(len(beta))) ch...
def calc_plateaus(beta, edges, rel_tol=1e-4, verbose=0): '''Calculate the plateaus (degrees of freedom) of a graph of beta values in linear time.''' if not isinstance(edges, dict): raise Exception('Edges must be a map from each node to a list of neighbors.') to_check = deque(range(len(beta))) ch...
[ "Calculate", "the", "plateaus", "(", "degrees", "of", "freedom", ")", "of", "a", "graph", "of", "beta", "values", "in", "linear", "time", "." ]
tansey/gfl
python
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/utils.py#L176-L243
[ "def", "calc_plateaus", "(", "beta", ",", "edges", ",", "rel_tol", "=", "1e-4", ",", "verbose", "=", "0", ")", ":", "if", "not", "isinstance", "(", "edges", ",", "dict", ")", ":", "raise", "Exception", "(", "'Edges must be a map from each node to a list of nei...
ae0f078bab57aba9e827ed6162f247ff9dc2aa19
train
nearly_unique
Heuristic method to return the uniques within some precision in a numpy array
pygfl/utils.py
def nearly_unique(arr, rel_tol=1e-4, verbose=0): '''Heuristic method to return the uniques within some precision in a numpy array''' results = np.array([arr[0]]) for x in arr: if np.abs(results - x).min() > rel_tol: results = np.append(results, x) return results
def nearly_unique(arr, rel_tol=1e-4, verbose=0): '''Heuristic method to return the uniques within some precision in a numpy array''' results = np.array([arr[0]]) for x in arr: if np.abs(results - x).min() > rel_tol: results = np.append(results, x) return results
[ "Heuristic", "method", "to", "return", "the", "uniques", "within", "some", "precision", "in", "a", "numpy", "array" ]
tansey/gfl
python
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/utils.py#L245-L251
[ "def", "nearly_unique", "(", "arr", ",", "rel_tol", "=", "1e-4", ",", "verbose", "=", "0", ")", ":", "results", "=", "np", ".", "array", "(", "[", "arr", "[", "0", "]", "]", ")", "for", "x", "in", "arr", ":", "if", "np", ".", "abs", "(", "res...
ae0f078bab57aba9e827ed6162f247ff9dc2aa19
train
hypercube_edges
Create edge lists for an arbitrary hypercube. TODO: this is probably not the fastest way.
pygfl/utils.py
def hypercube_edges(dims, use_map=False): '''Create edge lists for an arbitrary hypercube. TODO: this is probably not the fastest way.''' edges = [] nodes = np.arange(np.product(dims)).reshape(dims) for i,d in enumerate(dims): for j in range(d-1): for n1, n2 in zip(np.take(nodes, [j]...
def hypercube_edges(dims, use_map=False): '''Create edge lists for an arbitrary hypercube. TODO: this is probably not the fastest way.''' edges = [] nodes = np.arange(np.product(dims)).reshape(dims) for i,d in enumerate(dims): for j in range(d-1): for n1, n2 in zip(np.take(nodes, [j]...
[ "Create", "edge", "lists", "for", "an", "arbitrary", "hypercube", ".", "TODO", ":", "this", "is", "probably", "not", "the", "fastest", "way", "." ]
tansey/gfl
python
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/utils.py#L299-L309
[ "def", "hypercube_edges", "(", "dims", ",", "use_map", "=", "False", ")", ":", "edges", "=", "[", "]", "nodes", "=", "np", ".", "arange", "(", "np", ".", "product", "(", "dims", ")", ")", ".", "reshape", "(", "dims", ")", "for", "i", ",", "d", ...
ae0f078bab57aba9e827ed6162f247ff9dc2aa19
train
get_delta
Calculate the k-th order trend filtering matrix given the oriented edge incidence matrix and the value of k.
pygfl/utils.py
def get_delta(D, k): '''Calculate the k-th order trend filtering matrix given the oriented edge incidence matrix and the value of k.''' if k < 0: raise Exception('k must be at least 0th order.') result = D for i in range(k): result = D.T.dot(result) if i % 2 == 0 else D.dot(result) ...
def get_delta(D, k): '''Calculate the k-th order trend filtering matrix given the oriented edge incidence matrix and the value of k.''' if k < 0: raise Exception('k must be at least 0th order.') result = D for i in range(k): result = D.T.dot(result) if i % 2 == 0 else D.dot(result) ...
[ "Calculate", "the", "k", "-", "th", "order", "trend", "filtering", "matrix", "given", "the", "oriented", "edge", "incidence", "matrix", "and", "the", "value", "of", "k", "." ]
tansey/gfl
python
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/utils.py#L390-L398
[ "def", "get_delta", "(", "D", ",", "k", ")", ":", "if", "k", "<", "0", ":", "raise", "Exception", "(", "'k must be at least 0th order.'", ")", "result", "=", "D", "for", "i", "in", "range", "(", "k", ")", ":", "result", "=", "D", ".", "T", ".", "...
ae0f078bab57aba9e827ed6162f247ff9dc2aa19
train
decompose_delta
Decomposes the k-th order trend filtering matrix into a c-compatible set of arrays.
pygfl/utils.py
def decompose_delta(deltak): '''Decomposes the k-th order trend filtering matrix into a c-compatible set of arrays.''' if not isspmatrix_coo(deltak): deltak = coo_matrix(deltak) dk_rows = deltak.shape[0] dk_rowbreaks = np.cumsum(deltak.getnnz(1), dtype="int32") dk_cols = deltak.col.astyp...
def decompose_delta(deltak): '''Decomposes the k-th order trend filtering matrix into a c-compatible set of arrays.''' if not isspmatrix_coo(deltak): deltak = coo_matrix(deltak) dk_rows = deltak.shape[0] dk_rowbreaks = np.cumsum(deltak.getnnz(1), dtype="int32") dk_cols = deltak.col.astyp...
[ "Decomposes", "the", "k", "-", "th", "order", "trend", "filtering", "matrix", "into", "a", "c", "-", "compatible", "set", "of", "arrays", "." ]
tansey/gfl
python
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/utils.py#L400-L409
[ "def", "decompose_delta", "(", "deltak", ")", ":", "if", "not", "isspmatrix_coo", "(", "deltak", ")", ":", "deltak", "=", "coo_matrix", "(", "deltak", ")", "dk_rows", "=", "deltak", ".", "shape", "[", "0", "]", "dk_rowbreaks", "=", "np", ".", "cumsum", ...
ae0f078bab57aba9e827ed6162f247ff9dc2aa19
train
matrix_from_edges
Returns a sparse penalty matrix (D) from a list of edge pairs. Each edge can have an optional weight associated with it.
pygfl/utils.py
def matrix_from_edges(edges): '''Returns a sparse penalty matrix (D) from a list of edge pairs. Each edge can have an optional weight associated with it.''' max_col = 0 cols = [] rows = [] vals = [] if type(edges) is defaultdict: edge_list = [] for i, neighbors in edges.items...
def matrix_from_edges(edges): '''Returns a sparse penalty matrix (D) from a list of edge pairs. Each edge can have an optional weight associated with it.''' max_col = 0 cols = [] rows = [] vals = [] if type(edges) is defaultdict: edge_list = [] for i, neighbors in edges.items...
[ "Returns", "a", "sparse", "penalty", "matrix", "(", "D", ")", "from", "a", "list", "of", "edge", "pairs", ".", "Each", "edge", "can", "have", "an", "optional", "weight", "associated", "with", "it", "." ]
tansey/gfl
python
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/utils.py#L411-L436
[ "def", "matrix_from_edges", "(", "edges", ")", ":", "max_col", "=", "0", "cols", "=", "[", "]", "rows", "=", "[", "]", "vals", "=", "[", "]", "if", "type", "(", "edges", ")", "is", "defaultdict", ":", "edge_list", "=", "[", "]", "for", "i", ",", ...
ae0f078bab57aba9e827ed6162f247ff9dc2aa19
train
ks_distance
Get the Kolmogorov-Smirnov (KS) distance between two densities a and b.
pygfl/utils.py
def ks_distance(a, b): '''Get the Kolmogorov-Smirnov (KS) distance between two densities a and b.''' if len(a.shape) == 1: return np.max(np.abs(a.cumsum() - b.cumsum())) return np.max(np.abs(a.cumsum(axis=1) - b.cumsum(axis=1)), axis=1)
def ks_distance(a, b): '''Get the Kolmogorov-Smirnov (KS) distance between two densities a and b.''' if len(a.shape) == 1: return np.max(np.abs(a.cumsum() - b.cumsum())) return np.max(np.abs(a.cumsum(axis=1) - b.cumsum(axis=1)), axis=1)
[ "Get", "the", "Kolmogorov", "-", "Smirnov", "(", "KS", ")", "distance", "between", "two", "densities", "a", "and", "b", "." ]
tansey/gfl
python
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/utils.py#L438-L442
[ "def", "ks_distance", "(", "a", ",", "b", ")", ":", "if", "len", "(", "a", ".", "shape", ")", "==", "1", ":", "return", "np", ".", "max", "(", "np", ".", "abs", "(", "a", ".", "cumsum", "(", ")", "-", "b", ".", "cumsum", "(", ")", ")", ")...
ae0f078bab57aba9e827ed6162f247ff9dc2aa19
train
tv_distance
Get the Total Variation (TV) distance between two densities a and b.
pygfl/utils.py
def tv_distance(a, b): '''Get the Total Variation (TV) distance between two densities a and b.''' if len(a.shape) == 1: return np.sum(np.abs(a - b)) return np.sum(np.abs(a - b), axis=1)
def tv_distance(a, b): '''Get the Total Variation (TV) distance between two densities a and b.''' if len(a.shape) == 1: return np.sum(np.abs(a - b)) return np.sum(np.abs(a - b), axis=1)
[ "Get", "the", "Total", "Variation", "(", "TV", ")", "distance", "between", "two", "densities", "a", "and", "b", "." ]
tansey/gfl
python
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/utils.py#L444-L448
[ "def", "tv_distance", "(", "a", ",", "b", ")", ":", "if", "len", "(", "a", ".", "shape", ")", "==", "1", ":", "return", "np", ".", "sum", "(", "np", ".", "abs", "(", "a", "-", "b", ")", ")", "return", "np", ".", "sum", "(", "np", ".", "ab...
ae0f078bab57aba9e827ed6162f247ff9dc2aa19
train
jdFromDate
def jdFromDate(dd, mm, yy): Compute the (integral) Julian day number of day dd/mm/yyyy, i.e., the number of days between 1/1/4713 BC (Julian calendar) and dd/mm/yyyy.
lasotuvi/Lich_HND.py
def jdFromDate(dd, mm, yy): '''def jdFromDate(dd, mm, yy): Compute the (integral) Julian day number of day dd/mm/yyyy, i.e., the number of days between 1/1/4713 BC (Julian calendar) and dd/mm/yyyy.''' a = int((14 - mm) / 12.) y = yy + 4800 - a m = mm + 12 * a - 3 jd = dd + int((153 * m + 2) ...
def jdFromDate(dd, mm, yy): '''def jdFromDate(dd, mm, yy): Compute the (integral) Julian day number of day dd/mm/yyyy, i.e., the number of days between 1/1/4713 BC (Julian calendar) and dd/mm/yyyy.''' a = int((14 - mm) / 12.) y = yy + 4800 - a m = mm + 12 * a - 3 jd = dd + int((153 * m + 2) ...
[ "def", "jdFromDate", "(", "dd", "mm", "yy", ")", ":", "Compute", "the", "(", "integral", ")", "Julian", "day", "number", "of", "day", "dd", "/", "mm", "/", "yyyy", "i", ".", "e", ".", "the", "number", "of", "days", "between", "1", "/", "1", "/", ...
doanguyen/lasotuvi
python
https://github.com/doanguyen/lasotuvi/blob/98383a3056f0a0633d6937d364c37eb788661c0d/lasotuvi/Lich_HND.py#L10-L23
[ "def", "jdFromDate", "(", "dd", ",", "mm", ",", "yy", ")", ":", "a", "=", "int", "(", "(", "14", "-", "mm", ")", "/", "12.", ")", "y", "=", "yy", "+", "4800", "-", "a", "m", "=", "mm", "+", "12", "*", "a", "-", "3", "jd", "=", "dd", "...
98383a3056f0a0633d6937d364c37eb788661c0d
train
jdToDate
def jdToDate(jd): Convert a Julian day number to day/month/year. jd is an integer.
lasotuvi/Lich_HND.py
def jdToDate(jd): '''def jdToDate(jd): Convert a Julian day number to day/month/year. jd is an integer.''' if (jd > 2299160): # After 5/10/1582, Gregorian calendar a = jd + 32044 b = int((4 * a + 3) / 146097.) c = a - int((b * 146097) / 4.) else: ...
def jdToDate(jd): '''def jdToDate(jd): Convert a Julian day number to day/month/year. jd is an integer.''' if (jd > 2299160): # After 5/10/1582, Gregorian calendar a = jd + 32044 b = int((4 * a + 3) / 146097.) c = a - int((b * 146097) / 4.) else: ...
[ "def", "jdToDate", "(", "jd", ")", ":", "Convert", "a", "Julian", "day", "number", "to", "day", "/", "month", "/", "year", ".", "jd", "is", "an", "integer", "." ]
doanguyen/lasotuvi
python
https://github.com/doanguyen/lasotuvi/blob/98383a3056f0a0633d6937d364c37eb788661c0d/lasotuvi/Lich_HND.py#L26-L43
[ "def", "jdToDate", "(", "jd", ")", ":", "if", "(", "jd", ">", "2299160", ")", ":", "# After 5/10/1582, Gregorian calendar", "a", "=", "jd", "+", "32044", "b", "=", "int", "(", "(", "4", "*", "a", "+", "3", ")", "/", "146097.", ")", "c", "=", "a",...
98383a3056f0a0633d6937d364c37eb788661c0d
train
NewMoon
def NewMoon(k): Compute the time of the k-th new moon after the new moon of 1/1/1900 13:52 UCT (measured as the number of days since 1/1/4713 BC noon UCT, e.g., 2451545.125 is 1/1/2000 15:00 UTC. Returns a floating number, e.g., 2415079.9758617813 for k=2 or 2414961.935157746 for k=-2.
lasotuvi/Lich_HND.py
def NewMoon(k): '''def NewMoon(k): Compute the time of the k-th new moon after the new moon of 1/1/1900 13:52 UCT (measured as the number of days since 1/1/4713 BC noon UCT, e.g., 2451545.125 is 1/1/2000 15:00 UTC. Returns a floating number, e.g., 2415079.9758617813 for k=2 or 2414961.935157746 for ...
def NewMoon(k): '''def NewMoon(k): Compute the time of the k-th new moon after the new moon of 1/1/1900 13:52 UCT (measured as the number of days since 1/1/4713 BC noon UCT, e.g., 2451545.125 is 1/1/2000 15:00 UTC. Returns a floating number, e.g., 2415079.9758617813 for k=2 or 2414961.935157746 for ...
[ "def", "NewMoon", "(", "k", ")", ":", "Compute", "the", "time", "of", "the", "k", "-", "th", "new", "moon", "after", "the", "new", "moon", "of", "1", "/", "1", "/", "1900", "13", ":", "52", "UCT", "(", "measured", "as", "the", "number", "of", "...
doanguyen/lasotuvi
python
https://github.com/doanguyen/lasotuvi/blob/98383a3056f0a0633d6937d364c37eb788661c0d/lasotuvi/Lich_HND.py#L46-L90
[ "def", "NewMoon", "(", "k", ")", ":", "# Time in Julian centuries from 1900 January 0.5", "T", "=", "k", "/", "1236.85", "T2", "=", "T", "*", "T", "T3", "=", "T2", "*", "T", "dr", "=", "math", ".", "pi", "/", "180.", "Jd1", "=", "2415020.75933", "+", ...
98383a3056f0a0633d6937d364c37eb788661c0d
train
SunLongitude
def SunLongitude(jdn): Compute the longitude of the sun at any time. Parameter: floating number jdn, the number of days since 1/1/4713 BC noon.
lasotuvi/Lich_HND.py
def SunLongitude(jdn): '''def SunLongitude(jdn): Compute the longitude of the sun at any time. Parameter: floating number jdn, the number of days since 1/1/4713 BC noon. ''' T = (jdn - 2451545.0) / 36525. # Time in Julian centuries # from 2000-01-01 12:00:00 GMT T2 = T * T dr = math.pi /...
def SunLongitude(jdn): '''def SunLongitude(jdn): Compute the longitude of the sun at any time. Parameter: floating number jdn, the number of days since 1/1/4713 BC noon. ''' T = (jdn - 2451545.0) / 36525. # Time in Julian centuries # from 2000-01-01 12:00:00 GMT T2 = T * T dr = math.pi /...
[ "def", "SunLongitude", "(", "jdn", ")", ":", "Compute", "the", "longitude", "of", "the", "sun", "at", "any", "time", ".", "Parameter", ":", "floating", "number", "jdn", "the", "number", "of", "days", "since", "1", "/", "1", "/", "4713", "BC", "noon", ...
doanguyen/lasotuvi
python
https://github.com/doanguyen/lasotuvi/blob/98383a3056f0a0633d6937d364c37eb788661c0d/lasotuvi/Lich_HND.py#L93-L115
[ "def", "SunLongitude", "(", "jdn", ")", ":", "T", "=", "(", "jdn", "-", "2451545.0", ")", "/", "36525.", "# Time in Julian centuries", "# from 2000-01-01 12:00:00 GMT", "T2", "=", "T", "*", "T", "dr", "=", "math", ".", "pi", "/", "180.", "# degree to radian"...
98383a3056f0a0633d6937d364c37eb788661c0d
train
getLunarMonth11
def getLunarMonth11(yy, timeZone): Find the day that starts the luner month 11of the given year for the given time zone.
lasotuvi/Lich_HND.py
def getLunarMonth11(yy, timeZone): '''def getLunarMonth11(yy, timeZone): Find the day that starts the luner month 11of the given year for the given time zone.''' # off = jdFromDate(31, 12, yy) \ # - 2415021.076998695 off = jdFromDate(31, 12, yy) - 2415021. k = int(off / 29.530588853)...
def getLunarMonth11(yy, timeZone): '''def getLunarMonth11(yy, timeZone): Find the day that starts the luner month 11of the given year for the given time zone.''' # off = jdFromDate(31, 12, yy) \ # - 2415021.076998695 off = jdFromDate(31, 12, yy) - 2415021. k = int(off / 29.530588853)...
[ "def", "getLunarMonth11", "(", "yy", "timeZone", ")", ":", "Find", "the", "day", "that", "starts", "the", "luner", "month", "11of", "the", "given", "year", "for", "the", "given", "time", "zone", "." ]
doanguyen/lasotuvi
python
https://github.com/doanguyen/lasotuvi/blob/98383a3056f0a0633d6937d364c37eb788661c0d/lasotuvi/Lich_HND.py#L153-L165
[ "def", "getLunarMonth11", "(", "yy", ",", "timeZone", ")", ":", "# off = jdFromDate(31, 12, yy) \\", "# - 2415021.076998695", "off", "=", "jdFromDate", "(", "31", ",", "12", ",", "yy", ")", "-", "2415021.", "k", "=", "int", "(", "off", "/", "29.5305...
98383a3056f0a0633d6937d364c37eb788661c0d
train
getLeapMonthOffset
def getLeapMonthOffset(a11, timeZone): Find the index of the leap month after the month starting on the day a11.
lasotuvi/Lich_HND.py
def getLeapMonthOffset(a11, timeZone): '''def getLeapMonthOffset(a11, timeZone): Find the index of the leap month after the month starting on the day a11.''' k = int((a11 - 2415021.076998695) / 29.530588853 + 0.5) last = 0 i = 1 # start with month following lunar month 11 arc = getSunLongitude(...
def getLeapMonthOffset(a11, timeZone): '''def getLeapMonthOffset(a11, timeZone): Find the index of the leap month after the month starting on the day a11.''' k = int((a11 - 2415021.076998695) / 29.530588853 + 0.5) last = 0 i = 1 # start with month following lunar month 11 arc = getSunLongitude(...
[ "def", "getLeapMonthOffset", "(", "a11", "timeZone", ")", ":", "Find", "the", "index", "of", "the", "leap", "month", "after", "the", "month", "starting", "on", "the", "day", "a11", "." ]
doanguyen/lasotuvi
python
https://github.com/doanguyen/lasotuvi/blob/98383a3056f0a0633d6937d364c37eb788661c0d/lasotuvi/Lich_HND.py#L168-L184
[ "def", "getLeapMonthOffset", "(", "a11", ",", "timeZone", ")", ":", "k", "=", "int", "(", "(", "a11", "-", "2415021.076998695", ")", "/", "29.530588853", "+", "0.5", ")", "last", "=", "0", "i", "=", "1", "# start with month following lunar month 11", "arc", ...
98383a3056f0a0633d6937d364c37eb788661c0d
train
S2L
def S2L(dd, mm, yy, timeZone = 7): Convert solar date dd/mm/yyyy to the corresponding lunar date.
lasotuvi/Lich_HND.py
def S2L(dd, mm, yy, timeZone=7): '''def S2L(dd, mm, yy, timeZone = 7): Convert solar date dd/mm/yyyy to the corresponding lunar date.''' dayNumber = jdFromDate(dd, mm, yy) k = int((dayNumber - 2415021.076998695) / 29.530588853) monthStart = getNewMoonDay(k + 1, timeZone) if (monthStart > dayNumb...
def S2L(dd, mm, yy, timeZone=7): '''def S2L(dd, mm, yy, timeZone = 7): Convert solar date dd/mm/yyyy to the corresponding lunar date.''' dayNumber = jdFromDate(dd, mm, yy) k = int((dayNumber - 2415021.076998695) / 29.530588853) monthStart = getNewMoonDay(k + 1, timeZone) if (monthStart > dayNumb...
[ "def", "S2L", "(", "dd", "mm", "yy", "timeZone", "=", "7", ")", ":", "Convert", "solar", "date", "dd", "/", "mm", "/", "yyyy", "to", "the", "corresponding", "lunar", "date", "." ]
doanguyen/lasotuvi
python
https://github.com/doanguyen/lasotuvi/blob/98383a3056f0a0633d6937d364c37eb788661c0d/lasotuvi/Lich_HND.py#L187-L223
[ "def", "S2L", "(", "dd", ",", "mm", ",", "yy", ",", "timeZone", "=", "7", ")", ":", "dayNumber", "=", "jdFromDate", "(", "dd", ",", "mm", ",", "yy", ")", "k", "=", "int", "(", "(", "dayNumber", "-", "2415021.076998695", ")", "/", "29.530588853", ...
98383a3056f0a0633d6937d364c37eb788661c0d
train
L2S
def L2S(lunarD, lunarM, lunarY, lunarLeap, tZ = 7): Convert a lunar date to the corresponding solar date.
lasotuvi/Lich_HND.py
def L2S(lunarD, lunarM, lunarY, lunarLeap, tZ=7): '''def L2S(lunarD, lunarM, lunarY, lunarLeap, tZ = 7): Convert a lunar date to the corresponding solar date.''' if (lunarM < 11): a11 = getLunarMonth11(lunarY - 1, tZ) b11 = getLunarMonth11(lunarY, tZ) else: a11 = getLunarMonth11(...
def L2S(lunarD, lunarM, lunarY, lunarLeap, tZ=7): '''def L2S(lunarD, lunarM, lunarY, lunarLeap, tZ = 7): Convert a lunar date to the corresponding solar date.''' if (lunarM < 11): a11 = getLunarMonth11(lunarY - 1, tZ) b11 = getLunarMonth11(lunarY, tZ) else: a11 = getLunarMonth11(...
[ "def", "L2S", "(", "lunarD", "lunarM", "lunarY", "lunarLeap", "tZ", "=", "7", ")", ":", "Convert", "a", "lunar", "date", "to", "the", "corresponding", "solar", "date", "." ]
doanguyen/lasotuvi
python
https://github.com/doanguyen/lasotuvi/blob/98383a3056f0a0633d6937d364c37eb788661c0d/lasotuvi/Lich_HND.py#L226-L250
[ "def", "L2S", "(", "lunarD", ",", "lunarM", ",", "lunarY", ",", "lunarLeap", ",", "tZ", "=", "7", ")", ":", "if", "(", "lunarM", "<", "11", ")", ":", "a11", "=", "getLunarMonth11", "(", "lunarY", "-", "1", ",", "tZ", ")", "b11", "=", "getLunarMon...
98383a3056f0a0633d6937d364c37eb788661c0d
train
PE.hasMZSignature
Check for MZ signature. @type rd: L{ReadData} @param rd: A L{ReadData} object. @rtype: bool @return: True is the given L{ReadData} stream has the MZ signature. Otherwise, False.
pype32/pype32.py
def hasMZSignature(self, rd): """ Check for MZ signature. @type rd: L{ReadData} @param rd: A L{ReadData} object. @rtype: bool @return: True is the given L{ReadData} stream has the MZ signature. Otherwise, False. """ rd.setOffset(0) sign = rd.rea...
def hasMZSignature(self, rd): """ Check for MZ signature. @type rd: L{ReadData} @param rd: A L{ReadData} object. @rtype: bool @return: True is the given L{ReadData} stream has the MZ signature. Otherwise, False. """ rd.setOffset(0) sign = rd.rea...
[ "Check", "for", "MZ", "signature", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L134-L148
[ "def", "hasMZSignature", "(", "self", ",", "rd", ")", ":", "rd", ".", "setOffset", "(", "0", ")", "sign", "=", "rd", ".", "read", "(", "2", ")", "if", "sign", "==", "\"MZ\"", ":", "return", "True", "return", "False" ]
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.hasPESignature
Check for PE signature. @type rd: L{ReadData} @param rd: A L{ReadData} object. @rtype: bool @return: True is the given L{ReadData} stream has the PE signature. Otherwise, False.
pype32/pype32.py
def hasPESignature(self, rd): """ Check for PE signature. @type rd: L{ReadData} @param rd: A L{ReadData} object. @rtype: bool @return: True is the given L{ReadData} stream has the PE signature. Otherwise, False. """ rd.setOffset(0) e_lfanew_offse...
def hasPESignature(self, rd): """ Check for PE signature. @type rd: L{ReadData} @param rd: A L{ReadData} object. @rtype: bool @return: True is the given L{ReadData} stream has the PE signature. Otherwise, False. """ rd.setOffset(0) e_lfanew_offse...
[ "Check", "for", "PE", "signature", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L150-L165
[ "def", "hasPESignature", "(", "self", ",", "rd", ")", ":", "rd", ".", "setOffset", "(", "0", ")", "e_lfanew_offset", "=", "unpack", "(", "\"<L\"", ",", "rd", ".", "readAt", "(", "0x3c", ",", "4", ")", ")", "[", "0", "]", "sign", "=", "rd", ".", ...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.validate
Performs validations over some fields of the PE structure to determine if the loaded file has a valid PE format. @raise PEException: If an invalid value is found into the PE instance.
pype32/pype32.py
def validate(self): """ Performs validations over some fields of the PE structure to determine if the loaded file has a valid PE format. @raise PEException: If an invalid value is found into the PE instance. """ # Ange Albertini (@angie4771) can kill me for this! :) ...
def validate(self): """ Performs validations over some fields of the PE structure to determine if the loaded file has a valid PE format. @raise PEException: If an invalid value is found into the PE instance. """ # Ange Albertini (@angie4771) can kill me for this! :) ...
[ "Performs", "validations", "over", "some", "fields", "of", "the", "PE", "structure", "to", "determine", "if", "the", "loaded", "file", "has", "a", "valid", "PE", "format", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L167-L184
[ "def", "validate", "(", "self", ")", ":", "# Ange Albertini (@angie4771) can kill me for this! :)", "if", "self", ".", "dosHeader", ".", "e_magic", ".", "value", "!=", "consts", ".", "MZ_SIGNATURE", ":", "raise", "excep", ".", "PEException", "(", "\"Invalid MZ signa...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.readFile
Returns data from a file. @type pathToFile: str @param pathToFile: Path to the file. @rtype: str @return: The data from file.
pype32/pype32.py
def readFile(self, pathToFile): """ Returns data from a file. @type pathToFile: str @param pathToFile: Path to the file. @rtype: str @return: The data from file. """ fd = open(pathToFile, "rb") data = fd.read() fd.close()...
def readFile(self, pathToFile): """ Returns data from a file. @type pathToFile: str @param pathToFile: Path to the file. @rtype: str @return: The data from file. """ fd = open(pathToFile, "rb") data = fd.read() fd.close()...
[ "Returns", "data", "from", "a", "file", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L186-L199
[ "def", "readFile", "(", "self", ",", "pathToFile", ")", ":", "fd", "=", "open", "(", "pathToFile", ",", "\"rb\"", ")", "data", "=", "fd", ".", "read", "(", ")", "fd", ".", "close", "(", ")", "return", "data" ]
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.write
Writes data from L{PE} object to a file. @rtype: str @return: The L{PE} stream data. @raise IOError: If the file could not be opened for write operations.
pype32/pype32.py
def write(self, filename = ""): """ Writes data from L{PE} object to a file. @rtype: str @return: The L{PE} stream data. @raise IOError: If the file could not be opened for write operations. """ file_data = str(self) if filename: try:...
def write(self, filename = ""): """ Writes data from L{PE} object to a file. @rtype: str @return: The L{PE} stream data. @raise IOError: If the file could not be opened for write operations. """ file_data = str(self) if filename: try:...
[ "Writes", "data", "from", "L", "{", "PE", "}", "object", "to", "a", "file", ".", "@rtype", ":", "str", "@return", ":", "The", "L", "{", "PE", "}", "stream", "data", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L201-L217
[ "def", "write", "(", "self", ",", "filename", "=", "\"\"", ")", ":", "file_data", "=", "str", "(", "self", ")", "if", "filename", ":", "try", ":", "self", ".", "__write", "(", "filename", ",", "file_data", ")", "except", "IOError", ":", "raise", "IOE...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.__write
Write data to a file. @type thePath: str @param thePath: The file path. @type theData: str @param theData: The data to write.
pype32/pype32.py
def __write(self, thePath, theData): """ Write data to a file. @type thePath: str @param thePath: The file path. @type theData: str @param theData: The data to write. """ fd = open(thePath, "wb") fd.write(theData) fd.c...
def __write(self, thePath, theData): """ Write data to a file. @type thePath: str @param thePath: The file path. @type theData: str @param theData: The data to write. """ fd = open(thePath, "wb") fd.write(theData) fd.c...
[ "Write", "data", "to", "a", "file", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L219-L231
[ "def", "__write", "(", "self", ",", "thePath", ",", "theData", ")", ":", "fd", "=", "open", "(", "thePath", ",", "\"wb\"", ")", "fd", ".", "write", "(", "theData", ")", "fd", ".", "close", "(", ")" ]
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE._updateDirectoriesData
Updates the data in every L{Directory} object. @type peStr: str @param peStr: C{str} representation of the L{PE} object. @rtype: str @return: A C{str} representation of the L{PE} object.
pype32/pype32.py
def _updateDirectoriesData(self, peStr): """ Updates the data in every L{Directory} object. @type peStr: str @param peStr: C{str} representation of the L{PE} object. @rtype: str @return: A C{str} representation of the L{PE} object. """ da...
def _updateDirectoriesData(self, peStr): """ Updates the data in every L{Directory} object. @type peStr: str @param peStr: C{str} representation of the L{PE} object. @rtype: str @return: A C{str} representation of the L{PE} object. """ da...
[ "Updates", "the", "data", "in", "every", "L", "{", "Directory", "}", "object", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L247-L266
[ "def", "_updateDirectoriesData", "(", "self", ",", "peStr", ")", ":", "dataDirs", "=", "self", ".", "ntHeaders", ".", "optionalHeader", ".", "dataDirectory", "wr", "=", "utils", ".", "WriteData", "(", "data", ")", "for", "dir", "in", "dataDirs", ":", "data...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE._getPaddingDataToSectionOffset
Returns the data between the last section header and the begenning of data from the first section. @rtype: str @return: Data between last section header and the begenning of the first section.
pype32/pype32.py
def _getPaddingDataToSectionOffset(self): """ Returns the data between the last section header and the begenning of data from the first section. @rtype: str @return: Data between last section header and the begenning of the first section. """ start = self._getPad...
def _getPaddingDataToSectionOffset(self): """ Returns the data between the last section header and the begenning of data from the first section. @rtype: str @return: Data between last section header and the begenning of the first section. """ start = self._getPad...
[ "Returns", "the", "data", "between", "the", "last", "section", "header", "and", "the", "begenning", "of", "data", "from", "the", "first", "section", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L268-L277
[ "def", "_getPaddingDataToSectionOffset", "(", "self", ")", ":", "start", "=", "self", ".", "_getPaddingToSectionOffset", "(", ")", "end", "=", "self", ".", "sectionHeaders", "[", "0", "]", ".", "pointerToRawData", ".", "value", "-", "start", "return", "self", ...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE._getSignature
Returns the digital signature within a digital signed PE file. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} instance containing a PE file data. @type dataDirectoryInstance: L{DataDirectory} @param dataDirectoryInstance: A L{DataDirectory} o...
pype32/pype32.py
def _getSignature(self, readDataInstance, dataDirectoryInstance): """ Returns the digital signature within a digital signed PE file. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} instance containing a PE file data. @type dataDirector...
def _getSignature(self, readDataInstance, dataDirectoryInstance): """ Returns the digital signature within a digital signed PE file. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} instance containing a PE file data. @type dataDirector...
[ "Returns", "the", "digital", "signature", "within", "a", "digital", "signed", "PE", "file", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L279-L306
[ "def", "_getSignature", "(", "self", ",", "readDataInstance", ",", "dataDirectoryInstance", ")", ":", "signature", "=", "\"\"", "if", "readDataInstance", "is", "not", "None", "and", "dataDirectoryInstance", "is", "not", "None", ":", "securityDirectory", "=", "data...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE._getOverlay
Returns the overlay data from the PE file. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} instance containing the PE file data. @type sectionHdrsInstance: L{SectionHeaders} @param sectionHdrsInstance: A L{SectionHeaders} instance containing t...
pype32/pype32.py
def _getOverlay(self, readDataInstance, sectionHdrsInstance): """ Returns the overlay data from the PE file. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} instance containing the PE file data. @type sectionHdrsInstance: L{SectionHead...
def _getOverlay(self, readDataInstance, sectionHdrsInstance): """ Returns the overlay data from the PE file. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} instance containing the PE file data. @type sectionHdrsInstance: L{SectionHead...
[ "Returns", "the", "overlay", "data", "from", "the", "PE", "file", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L308-L334
[ "def", "_getOverlay", "(", "self", ",", "readDataInstance", ",", "sectionHdrsInstance", ")", ":", "if", "readDataInstance", "is", "not", "None", "and", "sectionHdrsInstance", "is", "not", "None", ":", "# adjust the offset in readDataInstance to the RawOffset + RawSize of th...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.getOffsetFromRva
Converts an offset to an RVA. @type rva: int @param rva: The RVA to be converted. @rtype: int @return: An integer value representing an offset in the PE file.
pype32/pype32.py
def getOffsetFromRva(self, rva): """ Converts an offset to an RVA. @type rva: int @param rva: The RVA to be converted. @rtype: int @return: An integer value representing an offset in the PE file. """ offset = -1 s = self.getSectio...
def getOffsetFromRva(self, rva): """ Converts an offset to an RVA. @type rva: int @param rva: The RVA to be converted. @rtype: int @return: An integer value representing an offset in the PE file. """ offset = -1 s = self.getSectio...
[ "Converts", "an", "offset", "to", "an", "RVA", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L336-L354
[ "def", "getOffsetFromRva", "(", "self", ",", "rva", ")", ":", "offset", "=", "-", "1", "s", "=", "self", ".", "getSectionByRva", "(", "rva", ")", "if", "s", "!=", "offset", ":", "offset", "=", "(", "rva", "-", "self", ".", "sectionHeaders", "[", "s...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.getRvaFromOffset
Converts a RVA to an offset. @type offset: int @param offset: The offset value to be converted to RVA. @rtype: int @return: The RVA obtained from the given offset.
pype32/pype32.py
def getRvaFromOffset(self, offset): """ Converts a RVA to an offset. @type offset: int @param offset: The offset value to be converted to RVA. @rtype: int @return: The RVA obtained from the given offset. """ rva = -1 s = self.getS...
def getRvaFromOffset(self, offset): """ Converts a RVA to an offset. @type offset: int @param offset: The offset value to be converted to RVA. @rtype: int @return: The RVA obtained from the given offset. """ rva = -1 s = self.getS...
[ "Converts", "a", "RVA", "to", "an", "offset", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L356-L372
[ "def", "getRvaFromOffset", "(", "self", ",", "offset", ")", ":", "rva", "=", "-", "1", "s", "=", "self", ".", "getSectionByOffset", "(", "offset", ")", "if", "s", ":", "rva", "=", "(", "offset", "-", "self", ".", "sectionHeaders", "[", "s", "]", "....
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.getSectionByOffset
Given an offset in the file, tries to determine the section this offset belong to. @type offset: int @param offset: Offset value. @rtype: int @return: An index, starting at 0, that represents the section the given offset belongs to.
pype32/pype32.py
def getSectionByOffset(self, offset): """ Given an offset in the file, tries to determine the section this offset belong to. @type offset: int @param offset: Offset value. @rtype: int @return: An index, starting at 0, that represents the section the give...
def getSectionByOffset(self, offset): """ Given an offset in the file, tries to determine the section this offset belong to. @type offset: int @param offset: Offset value. @rtype: int @return: An index, starting at 0, that represents the section the give...
[ "Given", "an", "offset", "in", "the", "file", "tries", "to", "determine", "the", "section", "this", "offset", "belong", "to", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L374-L389
[ "def", "getSectionByOffset", "(", "self", ",", "offset", ")", ":", "index", "=", "-", "1", "for", "i", "in", "range", "(", "len", "(", "self", ".", "sectionHeaders", ")", ")", ":", "if", "(", "offset", "<", "self", ".", "sectionHeaders", "[", "i", ...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.getSectionIndexByName
Given a string representing a section name, tries to find the section index. @type name: str @param name: A section name. @rtype: int @return: The index, starting at 0, of the section.
pype32/pype32.py
def getSectionIndexByName(self, name): """ Given a string representing a section name, tries to find the section index. @type name: str @param name: A section name. @rtype: int @return: The index, starting at 0, of the section. """ index = -1 ...
def getSectionIndexByName(self, name): """ Given a string representing a section name, tries to find the section index. @type name: str @param name: A section name. @rtype: int @return: The index, starting at 0, of the section. """ index = -1 ...
[ "Given", "a", "string", "representing", "a", "section", "name", "tries", "to", "find", "the", "section", "index", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L391-L408
[ "def", "getSectionIndexByName", "(", "self", ",", "name", ")", ":", "index", "=", "-", "1", "if", "name", ":", "for", "i", "in", "range", "(", "len", "(", "self", ".", "sectionHeaders", ")", ")", ":", "if", "self", ".", "sectionHeaders", "[", "i", ...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.getSectionByRva
Given a RVA in the file, tries to determine the section this RVA belongs to. @type rva: int @param rva: RVA value. @rtype: int @return: An index, starting at 1, that represents the section the given RVA belongs to.
pype32/pype32.py
def getSectionByRva(self, rva): """ Given a RVA in the file, tries to determine the section this RVA belongs to. @type rva: int @param rva: RVA value. @rtype: int @return: An index, starting at 1, that represents the section the given RVA belongs to. ...
def getSectionByRva(self, rva): """ Given a RVA in the file, tries to determine the section this RVA belongs to. @type rva: int @param rva: RVA value. @rtype: int @return: An index, starting at 1, that represents the section the given RVA belongs to. ...
[ "Given", "a", "RVA", "in", "the", "file", "tries", "to", "determine", "the", "section", "this", "RVA", "belongs", "to", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L410-L437
[ "def", "getSectionByRva", "(", "self", ",", "rva", ")", ":", "index", "=", "-", "1", "if", "rva", "<", "self", ".", "sectionHeaders", "[", "0", "]", ".", "virtualAddress", ".", "value", ":", "return", "index", "for", "i", "in", "range", "(", "len", ...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE._getPaddingToSectionOffset
Returns the offset to last section header present in the PE file. @rtype: int @return: The offset where the end of the last section header resides in the PE file.
pype32/pype32.py
def _getPaddingToSectionOffset(self): """ Returns the offset to last section header present in the PE file. @rtype: int @return: The offset where the end of the last section header resides in the PE file. """ return len(str(self.dosHeader) + str(self.dosStub) + s...
def _getPaddingToSectionOffset(self): """ Returns the offset to last section header present in the PE file. @rtype: int @return: The offset where the end of the last section header resides in the PE file. """ return len(str(self.dosHeader) + str(self.dosStub) + s...
[ "Returns", "the", "offset", "to", "last", "section", "header", "present", "in", "the", "PE", "file", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L449-L456
[ "def", "_getPaddingToSectionOffset", "(", "self", ")", ":", "return", "len", "(", "str", "(", "self", ".", "dosHeader", ")", "+", "str", "(", "self", ".", "dosStub", ")", "+", "str", "(", "self", ".", "ntHeaders", ")", "+", "str", "(", "self", ".", ...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.fullLoad
Parse all the directories in the PE file.
pype32/pype32.py
def fullLoad(self): """Parse all the directories in the PE file.""" self._parseDirectories(self.ntHeaders.optionalHeader.dataDirectory, self.PE_TYPE)
def fullLoad(self): """Parse all the directories in the PE file.""" self._parseDirectories(self.ntHeaders.optionalHeader.dataDirectory, self.PE_TYPE)
[ "Parse", "all", "the", "directories", "in", "the", "PE", "file", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L458-L460
[ "def", "fullLoad", "(", "self", ")", ":", "self", ".", "_parseDirectories", "(", "self", ".", "ntHeaders", ".", "optionalHeader", ".", "dataDirectory", ",", "self", ".", "PE_TYPE", ")" ]
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE._internalParse
Populates the attributes of the L{PE} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} instance with the data of a PE file.
pype32/pype32.py
def _internalParse(self, readDataInstance): """ Populates the attributes of the L{PE} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} instance with the data of a PE file. """ self.dosHeader = DosHeader.parse(readDataInstance) ...
def _internalParse(self, readDataInstance): """ Populates the attributes of the L{PE} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} instance with the data of a PE file. """ self.dosHeader = DosHeader.parse(readDataInstance) ...
[ "Populates", "the", "attributes", "of", "the", "L", "{", "PE", "}", "object", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L462-L493
[ "def", "_internalParse", "(", "self", ",", "readDataInstance", ")", ":", "self", ".", "dosHeader", "=", "DosHeader", ".", "parse", "(", "readDataInstance", ")", "self", ".", "dosStub", "=", "readDataInstance", ".", "read", "(", "self", ".", "dosHeader", ".",...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.addSection
Adds a new section to the existing L{PE} instance. @type data: str @param data: The data to be added in the new section. @type name: str @param name: (Optional) The name for the new section. @type flags: int @param flags: (Optional) The attribut...
pype32/pype32.py
def addSection(self, data, name =".pype32\x00", flags = 0x60000000): """ Adds a new section to the existing L{PE} instance. @type data: str @param data: The data to be added in the new section. @type name: str @param name: (Optional) The name for the new...
def addSection(self, data, name =".pype32\x00", flags = 0x60000000): """ Adds a new section to the existing L{PE} instance. @type data: str @param data: The data to be added in the new section. @type name: str @param name: (Optional) The name for the new...
[ "Adds", "a", "new", "section", "to", "the", "existing", "L", "{", "PE", "}", "instance", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L495-L532
[ "def", "addSection", "(", "self", ",", "data", ",", "name", "=", "\".pype32\\x00\"", ",", "flags", "=", "0x60000000", ")", ":", "fa", "=", "self", ".", "ntHeaders", ".", "optionalHeader", ".", "fileAlignment", ".", "value", "sa", "=", "self", ".", "ntHea...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.extendSection
Extends an existing section in the L{PE} instance. @type sectionIndex: int @param sectionIndex: The index for the section to be extended. @type data: str @param data: The data to include in the section. @raise IndexError: If an invalid C{sectionIndex} w...
pype32/pype32.py
def extendSection(self, sectionIndex, data): """ Extends an existing section in the L{PE} instance. @type sectionIndex: int @param sectionIndex: The index for the section to be extended. @type data: str @param data: The data to include in the section. ...
def extendSection(self, sectionIndex, data): """ Extends an existing section in the L{PE} instance. @type sectionIndex: int @param sectionIndex: The index for the section to be extended. @type data: str @param data: The data to include in the section. ...
[ "Extends", "an", "existing", "section", "in", "the", "L", "{", "PE", "}", "instance", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L534-L616
[ "def", "extendSection", "(", "self", ",", "sectionIndex", ",", "data", ")", ":", "fa", "=", "self", ".", "ntHeaders", ".", "optionalHeader", ".", "fileAlignment", ".", "value", "sa", "=", "self", ".", "ntHeaders", ".", "optionalHeader", ".", "sectionAlignmen...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE._fixPe
Fixes the necessary fields in the PE file instance in order to create a valid PE32. i.e. SizeOfImage.
pype32/pype32.py
def _fixPe(self): """ Fixes the necessary fields in the PE file instance in order to create a valid PE32. i.e. SizeOfImage. """ sizeOfImage = 0 for sh in self.sectionHeaders: sizeOfImage += sh.misc self.ntHeaders.optionaHeader.sizeoOfImage.value = self._sectio...
def _fixPe(self): """ Fixes the necessary fields in the PE file instance in order to create a valid PE32. i.e. SizeOfImage. """ sizeOfImage = 0 for sh in self.sectionHeaders: sizeOfImage += sh.misc self.ntHeaders.optionaHeader.sizeoOfImage.value = self._sectio...
[ "Fixes", "the", "necessary", "fields", "in", "the", "PE", "file", "instance", "in", "order", "to", "create", "a", "valid", "PE32", ".", "i", ".", "e", ".", "SizeOfImage", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L618-L625
[ "def", "_fixPe", "(", "self", ")", ":", "sizeOfImage", "=", "0", "for", "sh", "in", "self", ".", "sectionHeaders", ":", "sizeOfImage", "+=", "sh", ".", "misc", "self", ".", "ntHeaders", ".", "optionaHeader", ".", "sizeoOfImage", ".", "value", "=", "self"...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE._adjustFileAlignment
Align a value to C{FileAligment}. @type value: int @param value: The value to align. @type fileAlignment: int @param fileAlignment: The value to be used to align the C{value} parameter. @rtype: int @return: The aligned value.
pype32/pype32.py
def _adjustFileAlignment(self, value, fileAlignment): """ Align a value to C{FileAligment}. @type value: int @param value: The value to align. @type fileAlignment: int @param fileAlignment: The value to be used to align the C{value} parameter. ...
def _adjustFileAlignment(self, value, fileAlignment): """ Align a value to C{FileAligment}. @type value: int @param value: The value to align. @type fileAlignment: int @param fileAlignment: The value to be used to align the C{value} parameter. ...
[ "Align", "a", "value", "to", "C", "{", "FileAligment", "}", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L627-L650
[ "def", "_adjustFileAlignment", "(", "self", ",", "value", ",", "fileAlignment", ")", ":", "if", "fileAlignment", ">", "consts", ".", "DEFAULT_FILE_ALIGNMENT", ":", "if", "not", "utils", ".", "powerOfTwo", "(", "fileAlignment", ")", ":", "print", "\"Warning: File...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE._adjustSectionAlignment
Align a value to C{SectionAligment}. @type value: int @param value: The value to be aligned. @type fileAlignment: int @param fileAlignment: The value to be used as C{FileAlignment}. @type sectionAlignment: int @param sectionAlignment: The value...
pype32/pype32.py
def _adjustSectionAlignment(self, value, fileAlignment, sectionAlignment): """ Align a value to C{SectionAligment}. @type value: int @param value: The value to be aligned. @type fileAlignment: int @param fileAlignment: The value to be used as C{FileAlig...
def _adjustSectionAlignment(self, value, fileAlignment, sectionAlignment): """ Align a value to C{SectionAligment}. @type value: int @param value: The value to be aligned. @type fileAlignment: int @param fileAlignment: The value to be used as C{FileAlig...
[ "Align", "a", "value", "to", "C", "{", "SectionAligment", "}", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L652-L677
[ "def", "_adjustSectionAlignment", "(", "self", ",", "value", ",", "fileAlignment", ",", "sectionAlignment", ")", ":", "if", "fileAlignment", "<", "consts", ".", "DEFAULT_FILE_ALIGNMENT", ":", "if", "fileAligment", "!=", "sectionAlignment", ":", "print", "\"FileAlign...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.getDwordAtRva
Returns a C{DWORD} from a given RVA. @type rva: int @param rva: The RVA to get the C{DWORD} from. @rtype: L{DWORD} @return: The L{DWORD} obtained at the given RVA.
pype32/pype32.py
def getDwordAtRva(self, rva): """ Returns a C{DWORD} from a given RVA. @type rva: int @param rva: The RVA to get the C{DWORD} from. @rtype: L{DWORD} @return: The L{DWORD} obtained at the given RVA. """ return datatypes.DWORD.parse(utils....
def getDwordAtRva(self, rva): """ Returns a C{DWORD} from a given RVA. @type rva: int @param rva: The RVA to get the C{DWORD} from. @rtype: L{DWORD} @return: The L{DWORD} obtained at the given RVA. """ return datatypes.DWORD.parse(utils....
[ "Returns", "a", "C", "{", "DWORD", "}", "from", "a", "given", "RVA", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L679-L689
[ "def", "getDwordAtRva", "(", "self", ",", "rva", ")", ":", "return", "datatypes", ".", "DWORD", ".", "parse", "(", "utils", ".", "ReadData", "(", "self", ".", "getDataAtRva", "(", "rva", ",", "4", ")", ")", ")" ]
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.getWordAtRva
Returns a C{WORD} from a given RVA. @type rva: int @param rva: The RVA to get the C{WORD} from. @rtype: L{WORD} @return: The L{WORD} obtained at the given RVA.
pype32/pype32.py
def getWordAtRva(self, rva): """ Returns a C{WORD} from a given RVA. @type rva: int @param rva: The RVA to get the C{WORD} from. @rtype: L{WORD} @return: The L{WORD} obtained at the given RVA. """ return datatypes.WORD.parse(utils.ReadDa...
def getWordAtRva(self, rva): """ Returns a C{WORD} from a given RVA. @type rva: int @param rva: The RVA to get the C{WORD} from. @rtype: L{WORD} @return: The L{WORD} obtained at the given RVA. """ return datatypes.WORD.parse(utils.ReadDa...
[ "Returns", "a", "C", "{", "WORD", "}", "from", "a", "given", "RVA", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L691-L701
[ "def", "getWordAtRva", "(", "self", ",", "rva", ")", ":", "return", "datatypes", ".", "WORD", ".", "parse", "(", "utils", ".", "ReadData", "(", "self", ".", "getDataAtRva", "(", "rva", ",", "2", ")", ")", ")" ]
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.getDwordAtOffset
Returns a C{DWORD} from a given offset. @type offset: int @param offset: The offset to get the C{DWORD} from. @rtype: L{DWORD} @return: The L{DWORD} obtained at the given offset.
pype32/pype32.py
def getDwordAtOffset(self, offset): """ Returns a C{DWORD} from a given offset. @type offset: int @param offset: The offset to get the C{DWORD} from. @rtype: L{DWORD} @return: The L{DWORD} obtained at the given offset. """ return datatyp...
def getDwordAtOffset(self, offset): """ Returns a C{DWORD} from a given offset. @type offset: int @param offset: The offset to get the C{DWORD} from. @rtype: L{DWORD} @return: The L{DWORD} obtained at the given offset. """ return datatyp...
[ "Returns", "a", "C", "{", "DWORD", "}", "from", "a", "given", "offset", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L703-L713
[ "def", "getDwordAtOffset", "(", "self", ",", "offset", ")", ":", "return", "datatypes", ".", "DWORD", ".", "parse", "(", "utils", ".", "ReadData", "(", "self", ".", "getDataAtOffset", "(", "offset", ",", "4", ")", ")", ")" ]
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.getWordAtOffset
Returns a C{WORD} from a given offset. @type offset: int @param offset: The offset to get the C{WORD} from. @rtype: L{WORD} @return: The L{WORD} obtained at the given offset.
pype32/pype32.py
def getWordAtOffset(self, offset): """ Returns a C{WORD} from a given offset. @type offset: int @param offset: The offset to get the C{WORD} from. @rtype: L{WORD} @return: The L{WORD} obtained at the given offset. """ return datatypes.WO...
def getWordAtOffset(self, offset): """ Returns a C{WORD} from a given offset. @type offset: int @param offset: The offset to get the C{WORD} from. @rtype: L{WORD} @return: The L{WORD} obtained at the given offset. """ return datatypes.WO...
[ "Returns", "a", "C", "{", "WORD", "}", "from", "a", "given", "offset", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L715-L725
[ "def", "getWordAtOffset", "(", "self", ",", "offset", ")", ":", "return", "datatypes", ".", "WORD", ".", "parse", "(", "utils", ".", "ReadData", "(", "self", ".", "getDataAtOffset", "(", "offset", ",", "2", ")", ")", ")" ]
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.getQwordAtRva
Returns a C{QWORD} from a given RVA. @type rva: int @param rva: The RVA to get the C{QWORD} from. @rtype: L{QWORD} @return: The L{QWORD} obtained at the given RVA.
pype32/pype32.py
def getQwordAtRva(self, rva): """ Returns a C{QWORD} from a given RVA. @type rva: int @param rva: The RVA to get the C{QWORD} from. @rtype: L{QWORD} @return: The L{QWORD} obtained at the given RVA. """ return datatypes.QWORD.parse(utils....
def getQwordAtRva(self, rva): """ Returns a C{QWORD} from a given RVA. @type rva: int @param rva: The RVA to get the C{QWORD} from. @rtype: L{QWORD} @return: The L{QWORD} obtained at the given RVA. """ return datatypes.QWORD.parse(utils....
[ "Returns", "a", "C", "{", "QWORD", "}", "from", "a", "given", "RVA", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L727-L737
[ "def", "getQwordAtRva", "(", "self", ",", "rva", ")", ":", "return", "datatypes", ".", "QWORD", ".", "parse", "(", "utils", ".", "ReadData", "(", "self", ".", "getDataAtRva", "(", "rva", ",", "8", ")", ")", ")" ]
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.getQwordAtOffset
Returns a C{QWORD} from a given offset. @type offset: int @param offset: The offset to get the C{QWORD} from. @rtype: L{QWORD} @return: The L{QWORD} obtained at the given offset.
pype32/pype32.py
def getQwordAtOffset(self, offset): """ Returns a C{QWORD} from a given offset. @type offset: int @param offset: The offset to get the C{QWORD} from. @rtype: L{QWORD} @return: The L{QWORD} obtained at the given offset. """ return datatyp...
def getQwordAtOffset(self, offset): """ Returns a C{QWORD} from a given offset. @type offset: int @param offset: The offset to get the C{QWORD} from. @rtype: L{QWORD} @return: The L{QWORD} obtained at the given offset. """ return datatyp...
[ "Returns", "a", "C", "{", "QWORD", "}", "from", "a", "given", "offset", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L739-L749
[ "def", "getQwordAtOffset", "(", "self", ",", "offset", ")", ":", "return", "datatypes", ".", "QWORD", ".", "parse", "(", "utils", ".", "ReadData", "(", "self", ".", "getDataAtOffset", "(", "offset", ",", "8", ")", ")", ")" ]
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.getDataAtRva
Gets binary data at a given RVA. @type rva: int @param rva: The RVA to get the data from. @type size: int @param size: The size of the data to be obtained. @rtype: str @return: The data obtained at the given RVA.
pype32/pype32.py
def getDataAtRva(self, rva, size): """ Gets binary data at a given RVA. @type rva: int @param rva: The RVA to get the data from. @type size: int @param size: The size of the data to be obtained. @rtype: str @return: The data obt...
def getDataAtRva(self, rva, size): """ Gets binary data at a given RVA. @type rva: int @param rva: The RVA to get the data from. @type size: int @param size: The size of the data to be obtained. @rtype: str @return: The data obt...
[ "Gets", "binary", "data", "at", "a", "given", "RVA", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L751-L764
[ "def", "getDataAtRva", "(", "self", ",", "rva", ",", "size", ")", ":", "return", "self", ".", "getDataAtOffset", "(", "self", ".", "getOffsetFromRva", "(", "rva", ")", ",", "size", ")" ]
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.getDataAtOffset
Gets binary data at a given offset. @type offset: int @param offset: The offset to get the data from. @type size: int @param size: The size of the data to be obtained. @rtype: str @return: The data obtained at the given offset.
pype32/pype32.py
def getDataAtOffset(self, offset, size): """ Gets binary data at a given offset. @type offset: int @param offset: The offset to get the data from. @type size: int @param size: The size of the data to be obtained. @rtype: str @ret...
def getDataAtOffset(self, offset, size): """ Gets binary data at a given offset. @type offset: int @param offset: The offset to get the data from. @type size: int @param size: The size of the data to be obtained. @rtype: str @ret...
[ "Gets", "binary", "data", "at", "a", "given", "offset", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L766-L780
[ "def", "getDataAtOffset", "(", "self", ",", "offset", ",", "size", ")", ":", "data", "=", "str", "(", "self", ")", "return", "data", "[", "offset", ":", "offset", "+", "size", "]" ]
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.readStringAtRva
Returns a L{String} object from a given RVA. @type rva: int @param rva: The RVA to get the string from. @rtype: L{String} @return: A new L{String} object from the given RVA.
pype32/pype32.py
def readStringAtRva(self, rva): """ Returns a L{String} object from a given RVA. @type rva: int @param rva: The RVA to get the string from. @rtype: L{String} @return: A new L{String} object from the given RVA. """ d = self.getDataAtRva(r...
def readStringAtRva(self, rva): """ Returns a L{String} object from a given RVA. @type rva: int @param rva: The RVA to get the string from. @rtype: L{String} @return: A new L{String} object from the given RVA. """ d = self.getDataAtRva(r...
[ "Returns", "a", "L", "{", "String", "}", "object", "from", "a", "given", "RVA", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L782-L798
[ "def", "readStringAtRva", "(", "self", ",", "rva", ")", ":", "d", "=", "self", ".", "getDataAtRva", "(", "rva", ",", "1", ")", "resultStr", "=", "datatypes", ".", "String", "(", "\"\"", ")", "while", "d", "!=", "\"\\x00\"", ":", "resultStr", ".", "va...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.isExe
Determines if the current L{PE} instance is an Executable file. @rtype: bool @return: C{True} if the current L{PE} instance is an Executable file. Otherwise, returns C{False}.
pype32/pype32.py
def isExe(self): """ Determines if the current L{PE} instance is an Executable file. @rtype: bool @return: C{True} if the current L{PE} instance is an Executable file. Otherwise, returns C{False}. """ if not self.isDll() and not self.isDriver() and ( consts.IMAGE...
def isExe(self): """ Determines if the current L{PE} instance is an Executable file. @rtype: bool @return: C{True} if the current L{PE} instance is an Executable file. Otherwise, returns C{False}. """ if not self.isDll() and not self.isDriver() and ( consts.IMAGE...
[ "Determines", "if", "the", "current", "L", "{", "PE", "}", "instance", "is", "an", "Executable", "file", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L800-L809
[ "def", "isExe", "(", "self", ")", ":", "if", "not", "self", ".", "isDll", "(", ")", "and", "not", "self", ".", "isDriver", "(", ")", "and", "(", "consts", ".", "IMAGE_FILE_EXECUTABLE_IMAGE", "&", "self", ".", "ntHeaders", ".", "fileHeader", ".", "chara...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.isDll
Determines if the current L{PE} instance is a Dynamic Link Library file. @rtype: bool @return: C{True} if the current L{PE} instance is a DLL. Otherwise, returns C{False}.
pype32/pype32.py
def isDll(self): """ Determines if the current L{PE} instance is a Dynamic Link Library file. @rtype: bool @return: C{True} if the current L{PE} instance is a DLL. Otherwise, returns C{False}. """ if (consts.IMAGE_FILE_DLL & self.ntHeaders.fileHeader.characterist...
def isDll(self): """ Determines if the current L{PE} instance is a Dynamic Link Library file. @rtype: bool @return: C{True} if the current L{PE} instance is a DLL. Otherwise, returns C{False}. """ if (consts.IMAGE_FILE_DLL & self.ntHeaders.fileHeader.characterist...
[ "Determines", "if", "the", "current", "L", "{", "PE", "}", "instance", "is", "a", "Dynamic", "Link", "Library", "file", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L811-L820
[ "def", "isDll", "(", "self", ")", ":", "if", "(", "consts", ".", "IMAGE_FILE_DLL", "&", "self", ".", "ntHeaders", ".", "fileHeader", ".", "characteristics", ".", "value", ")", "==", "consts", ".", "IMAGE_FILE_DLL", ":", "return", "True", "return", "False" ...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.isDriver
Determines if the current L{PE} instance is a driver (.sys) file. @rtype: bool @return: C{True} if the current L{PE} instance is a driver. Otherwise, returns C{False}.
pype32/pype32.py
def isDriver(self): """ Determines if the current L{PE} instance is a driver (.sys) file. @rtype: bool @return: C{True} if the current L{PE} instance is a driver. Otherwise, returns C{False}. """ modules = [] imports = self.ntHeaders.optionalHeader.dataDi...
def isDriver(self): """ Determines if the current L{PE} instance is a driver (.sys) file. @rtype: bool @return: C{True} if the current L{PE} instance is a driver. Otherwise, returns C{False}. """ modules = [] imports = self.ntHeaders.optionalHeader.dataDi...
[ "Determines", "if", "the", "current", "L", "{", "PE", "}", "instance", "is", "a", "driver", "(", ".", "sys", ")", "file", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L822-L836
[ "def", "isDriver", "(", "self", ")", ":", "modules", "=", "[", "]", "imports", "=", "self", ".", "ntHeaders", ".", "optionalHeader", ".", "dataDirectory", "[", "consts", ".", "IMPORT_DIRECTORY", "]", ".", "info", "for", "module", "in", "imports", ":", "m...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.isPe32
Determines if the current L{PE} instance is a PE32 file. @rtype: bool @return: C{True} if the current L{PE} instance is a PE32 file. Otherwise, returns C{False}.
pype32/pype32.py
def isPe32(self): """ Determines if the current L{PE} instance is a PE32 file. @rtype: bool @return: C{True} if the current L{PE} instance is a PE32 file. Otherwise, returns C{False}. """ if self.ntHeaders.optionalHeader.magic.value == consts.PE32: re...
def isPe32(self): """ Determines if the current L{PE} instance is a PE32 file. @rtype: bool @return: C{True} if the current L{PE} instance is a PE32 file. Otherwise, returns C{False}. """ if self.ntHeaders.optionalHeader.magic.value == consts.PE32: re...
[ "Determines", "if", "the", "current", "L", "{", "PE", "}", "instance", "is", "a", "PE32", "file", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L838-L847
[ "def", "isPe32", "(", "self", ")", ":", "if", "self", ".", "ntHeaders", ".", "optionalHeader", ".", "magic", ".", "value", "==", "consts", ".", "PE32", ":", "return", "True", "return", "False" ]
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.isPe64
Determines if the current L{PE} instance is a PE64 file. @rtype: bool @return: C{True} if the current L{PE} instance is a PE64 file. Otherwise, returns C{False}.
pype32/pype32.py
def isPe64(self): """ Determines if the current L{PE} instance is a PE64 file. @rtype: bool @return: C{True} if the current L{PE} instance is a PE64 file. Otherwise, returns C{False}. """ if self.ntHeaders.optionalHeader.magic.value == consts.PE64: re...
def isPe64(self): """ Determines if the current L{PE} instance is a PE64 file. @rtype: bool @return: C{True} if the current L{PE} instance is a PE64 file. Otherwise, returns C{False}. """ if self.ntHeaders.optionalHeader.magic.value == consts.PE64: re...
[ "Determines", "if", "the", "current", "L", "{", "PE", "}", "instance", "is", "a", "PE64", "file", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L849-L858
[ "def", "isPe64", "(", "self", ")", ":", "if", "self", ".", "ntHeaders", ".", "optionalHeader", ".", "magic", ".", "value", "==", "consts", ".", "PE64", ":", "return", "True", "return", "False" ]
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.isPeBounded
Determines if the current L{PE} instance is bounded, i.e. has a C{BOUND_IMPORT_DIRECTORY}. @rtype: bool @return: Returns C{True} if the current L{PE} instance is bounded. Otherwise, returns C{False}.
pype32/pype32.py
def isPeBounded(self): """ Determines if the current L{PE} instance is bounded, i.e. has a C{BOUND_IMPORT_DIRECTORY}. @rtype: bool @return: Returns C{True} if the current L{PE} instance is bounded. Otherwise, returns C{False}. """ boundImportsDir = self.ntHeaders...
def isPeBounded(self): """ Determines if the current L{PE} instance is bounded, i.e. has a C{BOUND_IMPORT_DIRECTORY}. @rtype: bool @return: Returns C{True} if the current L{PE} instance is bounded. Otherwise, returns C{False}. """ boundImportsDir = self.ntHeaders...
[ "Determines", "if", "the", "current", "L", "{", "PE", "}", "instance", "is", "bounded", "i", ".", "e", ".", "has", "a", "C", "{", "BOUND_IMPORT_DIRECTORY", "}", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L860-L870
[ "def", "isPeBounded", "(", "self", ")", ":", "boundImportsDir", "=", "self", ".", "ntHeaders", ".", "optionalHeader", ".", "dataDirectory", "[", "consts", ".", "BOUND_IMPORT_DIRECTORY", "]", "if", "boundImportsDir", ".", "rva", ".", "value", "and", "boundImports...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.isNXEnabled
Determines if the current L{PE} instance has the NXCOMPAT (Compatible with Data Execution Prevention) flag enabled. @see: U{http://msdn.microsoft.com/en-us/library/ms235442.aspx} @rtype: bool @return: Returns C{True} if the current L{PE} instance has the NXCOMPAT flag enabled. Otherwise, return...
pype32/pype32.py
def isNXEnabled(self): """ Determines if the current L{PE} instance has the NXCOMPAT (Compatible with Data Execution Prevention) flag enabled. @see: U{http://msdn.microsoft.com/en-us/library/ms235442.aspx} @rtype: bool @return: Returns C{True} if the current L{PE} instance has t...
def isNXEnabled(self): """ Determines if the current L{PE} instance has the NXCOMPAT (Compatible with Data Execution Prevention) flag enabled. @see: U{http://msdn.microsoft.com/en-us/library/ms235442.aspx} @rtype: bool @return: Returns C{True} if the current L{PE} instance has t...
[ "Determines", "if", "the", "current", "L", "{", "PE", "}", "instance", "has", "the", "NXCOMPAT", "(", "Compatible", "with", "Data", "Execution", "Prevention", ")", "flag", "enabled", ".", "@see", ":", "U", "{", "http", ":", "//", "msdn", ".", "microsoft"...
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L872-L880
[ "def", "isNXEnabled", "(", "self", ")", ":", "return", "self", ".", "ntHeaders", ".", "optionalHeader", ".", "dllCharacteristics", ".", "value", "&", "consts", ".", "IMAGE_DLL_CHARACTERISTICS_NX_COMPAT", "==", "consts", ".", "IMAGE_DLL_CHARACTERISTICS_NX_COMPAT" ]
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.isCFGEnabled
Determines if the current L{PE} instance has CFG (Control Flow Guard) flag enabled. @see: U{http://blogs.msdn.com/b/vcblog/archive/2014/12/08/visual-studio-2015-preview-work-in-progress-security-feature.aspx} @see: U{https://msdn.microsoft.com/en-us/library/dn919635%%28v=vs.140%%29.aspx} @rtype...
pype32/pype32.py
def isCFGEnabled(self): """ Determines if the current L{PE} instance has CFG (Control Flow Guard) flag enabled. @see: U{http://blogs.msdn.com/b/vcblog/archive/2014/12/08/visual-studio-2015-preview-work-in-progress-security-feature.aspx} @see: U{https://msdn.microsoft.com/en-us/library/dn...
def isCFGEnabled(self): """ Determines if the current L{PE} instance has CFG (Control Flow Guard) flag enabled. @see: U{http://blogs.msdn.com/b/vcblog/archive/2014/12/08/visual-studio-2015-preview-work-in-progress-security-feature.aspx} @see: U{https://msdn.microsoft.com/en-us/library/dn...
[ "Determines", "if", "the", "current", "L", "{", "PE", "}", "instance", "has", "CFG", "(", "Control", "Flow", "Guard", ")", "flag", "enabled", ".", "@see", ":", "U", "{", "http", ":", "//", "blogs", ".", "msdn", ".", "com", "/", "b", "/", "vcblog", ...
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L886-L895
[ "def", "isCFGEnabled", "(", "self", ")", ":", "return", "self", ".", "ntHeaders", ".", "optionalHeader", ".", "dllCharacteristics", ".", "value", "&", "consts", ".", "IMAGE_DLL_CHARACTERISTICS_GUARD_CF", "==", "consts", ".", "IMAGE_DLL_CHARACTERISTICS_GUARD_CF" ]
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.isASLREnabled
Determines if the current L{PE} instance has the DYNAMICBASE (Use address space layout randomization) flag enabled. @see: U{http://msdn.microsoft.com/en-us/library/bb384887.aspx} @rtype: bool @return: Returns C{True} if the current L{PE} instance has the DYNAMICBASE flag enabled. Otherwise, ret...
pype32/pype32.py
def isASLREnabled(self): """ Determines if the current L{PE} instance has the DYNAMICBASE (Use address space layout randomization) flag enabled. @see: U{http://msdn.microsoft.com/en-us/library/bb384887.aspx} @rtype: bool @return: Returns C{True} if the current L{PE} instance has...
def isASLREnabled(self): """ Determines if the current L{PE} instance has the DYNAMICBASE (Use address space layout randomization) flag enabled. @see: U{http://msdn.microsoft.com/en-us/library/bb384887.aspx} @rtype: bool @return: Returns C{True} if the current L{PE} instance has...
[ "Determines", "if", "the", "current", "L", "{", "PE", "}", "instance", "has", "the", "DYNAMICBASE", "(", "Use", "address", "space", "layout", "randomization", ")", "flag", "enabled", ".", "@see", ":", "U", "{", "http", ":", "//", "msdn", ".", "microsoft"...
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L897-L905
[ "def", "isASLREnabled", "(", "self", ")", ":", "return", "self", ".", "ntHeaders", ".", "optionalHeader", ".", "dllCharacteristics", ".", "value", "&", "consts", ".", "IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE", "==", "consts", ".", "IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE"...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE.isSAFESEHEnabled
Determines if the current L{PE} instance has the SAFESEH (Image has Safe Exception Handlers) flag enabled. @see: U{http://msdn.microsoft.com/en-us/library/9a89h429.aspx} @rtype: bool @return: Returns C{True} if the current L{PE} instance has the SAFESEH flag enabled. Returns C{False} if SAFESEH...
pype32/pype32.py
def isSAFESEHEnabled(self): """ Determines if the current L{PE} instance has the SAFESEH (Image has Safe Exception Handlers) flag enabled. @see: U{http://msdn.microsoft.com/en-us/library/9a89h429.aspx} @rtype: bool @return: Returns C{True} if the current L{PE} instance has the S...
def isSAFESEHEnabled(self): """ Determines if the current L{PE} instance has the SAFESEH (Image has Safe Exception Handlers) flag enabled. @see: U{http://msdn.microsoft.com/en-us/library/9a89h429.aspx} @rtype: bool @return: Returns C{True} if the current L{PE} instance has the S...
[ "Determines", "if", "the", "current", "L", "{", "PE", "}", "instance", "has", "the", "SAFESEH", "(", "Image", "has", "Safe", "Exception", "Handlers", ")", "flag", "enabled", ".", "@see", ":", "U", "{", "http", ":", "//", "msdn", ".", "microsoft", ".", ...
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L907-L926
[ "def", "isSAFESEHEnabled", "(", "self", ")", ":", "NOSEH", "=", "-", "1", "SAFESEH_OFF", "=", "0", "SAFESEH_ON", "=", "1", "if", "self", ".", "ntHeaders", ".", "optionalHeader", ".", "dllCharacteristics", ".", "value", "&", "consts", ".", "IMAGE_DLL_CHARACTE...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE._parseDirectories
Parses all the directories in the L{PE} instance. @type dataDirectoryInstance: L{DataDirectory} @param dataDirectoryInstance: A L{DataDirectory} object with the directories data. @type magic: int @param magic: (Optional) The type of PE. This value could be L{consts.PE32...
pype32/pype32.py
def _parseDirectories(self, dataDirectoryInstance, magic = consts.PE32): """ Parses all the directories in the L{PE} instance. @type dataDirectoryInstance: L{DataDirectory} @param dataDirectoryInstance: A L{DataDirectory} object with the directories data. @type ...
def _parseDirectories(self, dataDirectoryInstance, magic = consts.PE32): """ Parses all the directories in the L{PE} instance. @type dataDirectoryInstance: L{DataDirectory} @param dataDirectoryInstance: A L{DataDirectory} object with the directories data. @type ...
[ "Parses", "all", "the", "directories", "in", "the", "L", "{", "PE", "}", "instance", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L928-L956
[ "def", "_parseDirectories", "(", "self", ",", "dataDirectoryInstance", ",", "magic", "=", "consts", ".", "PE32", ")", ":", "directories", "=", "[", "(", "consts", ".", "EXPORT_DIRECTORY", ",", "self", ".", "_parseExportDirectory", ")", ",", "(", "consts", "....
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE._parseResourceDirectory
Parses the C{IMAGE_RESOURCE_DIRECTORY} directory. @type rva: int @param rva: The RVA where the C{IMAGE_RESOURCE_DIRECTORY} starts. @type size: int @param size: The size of the C{IMAGE_RESOURCE_DIRECTORY} directory. @type magic: int @param magic...
pype32/pype32.py
def _parseResourceDirectory(self, rva, size, magic = consts.PE32): """ Parses the C{IMAGE_RESOURCE_DIRECTORY} directory. @type rva: int @param rva: The RVA where the C{IMAGE_RESOURCE_DIRECTORY} starts. @type size: int @param size: The size of the C{IMAG...
def _parseResourceDirectory(self, rva, size, magic = consts.PE32): """ Parses the C{IMAGE_RESOURCE_DIRECTORY} directory. @type rva: int @param rva: The RVA where the C{IMAGE_RESOURCE_DIRECTORY} starts. @type size: int @param size: The size of the C{IMAG...
[ "Parses", "the", "C", "{", "IMAGE_RESOURCE_DIRECTORY", "}", "directory", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L958-L974
[ "def", "_parseResourceDirectory", "(", "self", ",", "rva", ",", "size", ",", "magic", "=", "consts", ".", "PE32", ")", ":", "return", "self", ".", "getDataAtRva", "(", "rva", ",", "size", ")" ]
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE._parseExceptionDirectory
Parses the C{IMAGE_EXCEPTION_DIRECTORY} directory. @type rva: int @param rva: The RVA where the C{IMAGE_EXCEPTION_DIRECTORY} starts. @type size: int @param size: The size of the C{IMAGE_EXCEPTION_DIRECTORY} directory. @type magic: int @param ma...
pype32/pype32.py
def _parseExceptionDirectory(self, rva, size, magic = consts.PE32): """ Parses the C{IMAGE_EXCEPTION_DIRECTORY} directory. @type rva: int @param rva: The RVA where the C{IMAGE_EXCEPTION_DIRECTORY} starts. @type size: int @param size: The size of the C{I...
def _parseExceptionDirectory(self, rva, size, magic = consts.PE32): """ Parses the C{IMAGE_EXCEPTION_DIRECTORY} directory. @type rva: int @param rva: The RVA where the C{IMAGE_EXCEPTION_DIRECTORY} starts. @type size: int @param size: The size of the C{I...
[ "Parses", "the", "C", "{", "IMAGE_EXCEPTION_DIRECTORY", "}", "directory", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L976-L992
[ "def", "_parseExceptionDirectory", "(", "self", ",", "rva", ",", "size", ",", "magic", "=", "consts", ".", "PE32", ")", ":", "return", "self", ".", "getDataAtRva", "(", "rva", ",", "size", ")" ]
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE._parseDelayImportDirectory
Parses the delay imports directory. @type rva: int @param rva: The RVA where the delay imports directory starts. @type size: int @param size: The size of the delay imports directory. @type magic: int @param magic: (Optional) The type of PE. Thi...
pype32/pype32.py
def _parseDelayImportDirectory(self, rva, size, magic = consts.PE32): """ Parses the delay imports directory. @type rva: int @param rva: The RVA where the delay imports directory starts. @type size: int @param size: The size of the delay imports directo...
def _parseDelayImportDirectory(self, rva, size, magic = consts.PE32): """ Parses the delay imports directory. @type rva: int @param rva: The RVA where the delay imports directory starts. @type size: int @param size: The size of the delay imports directo...
[ "Parses", "the", "delay", "imports", "directory", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L994-L1010
[ "def", "_parseDelayImportDirectory", "(", "self", ",", "rva", ",", "size", ",", "magic", "=", "consts", ".", "PE32", ")", ":", "return", "self", ".", "getDataAtRva", "(", "rva", ",", "size", ")" ]
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE._parseBoundImportDirectory
Parses the bound import directory. @type rva: int @param rva: The RVA where the bound import directory starts. @type size: int @param size: The size of the bound import directory. @type magic: int @param magic: (Optional) The type of PE. This v...
pype32/pype32.py
def _parseBoundImportDirectory(self, rva, size, magic = consts.PE32): """ Parses the bound import directory. @type rva: int @param rva: The RVA where the bound import directory starts. @type size: int @param size: The size of the bound import directory....
def _parseBoundImportDirectory(self, rva, size, magic = consts.PE32): """ Parses the bound import directory. @type rva: int @param rva: The RVA where the bound import directory starts. @type size: int @param size: The size of the bound import directory....
[ "Parses", "the", "bound", "import", "directory", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L1012-L1042
[ "def", "_parseBoundImportDirectory", "(", "self", ",", "rva", ",", "size", ",", "magic", "=", "consts", ".", "PE32", ")", ":", "data", "=", "self", ".", "getDataAtRva", "(", "rva", ",", "size", ")", "rd", "=", "utils", ".", "ReadData", "(", "data", "...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE._parseLoadConfigDirectory
Parses IMAGE_LOAD_CONFIG_DIRECTORY. @type rva: int @param rva: The RVA where the IMAGE_LOAD_CONFIG_DIRECTORY starts. @type size: int @param size: The size of the IMAGE_LOAD_CONFIG_DIRECTORY. @type magic: int @param magic: (Optional) The type of...
pype32/pype32.py
def _parseLoadConfigDirectory(self, rva, size, magic = consts.PE32): """ Parses IMAGE_LOAD_CONFIG_DIRECTORY. @type rva: int @param rva: The RVA where the IMAGE_LOAD_CONFIG_DIRECTORY starts. @type size: int @param size: The size of the IMAGE_LOAD_CONFIG_...
def _parseLoadConfigDirectory(self, rva, size, magic = consts.PE32): """ Parses IMAGE_LOAD_CONFIG_DIRECTORY. @type rva: int @param rva: The RVA where the IMAGE_LOAD_CONFIG_DIRECTORY starts. @type size: int @param size: The size of the IMAGE_LOAD_CONFIG_...
[ "Parses", "IMAGE_LOAD_CONFIG_DIRECTORY", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L1044-L1077
[ "def", "_parseLoadConfigDirectory", "(", "self", ",", "rva", ",", "size", ",", "magic", "=", "consts", ".", "PE32", ")", ":", "# print \"RVA: %x - SIZE: %x\" % (rva, size)", "# I've found some issues when parsing the IMAGE_LOAD_CONFIG_DIRECTORY in some DLLs. ", "# There is an inc...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE._parseTlsDirectory
Parses the TLS directory. @type rva: int @param rva: The RVA where the TLS directory starts. @type size: int @param size: The size of the TLS directory. @type magic: int @param magic: (Optional) The type of PE. This value could be L{consts.PE32...
pype32/pype32.py
def _parseTlsDirectory(self, rva, size, magic = consts.PE32): """ Parses the TLS directory. @type rva: int @param rva: The RVA where the TLS directory starts. @type size: int @param size: The size of the TLS directory. @type magic: int ...
def _parseTlsDirectory(self, rva, size, magic = consts.PE32): """ Parses the TLS directory. @type rva: int @param rva: The RVA where the TLS directory starts. @type size: int @param size: The size of the TLS directory. @type magic: int ...
[ "Parses", "the", "TLS", "directory", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L1079-L1104
[ "def", "_parseTlsDirectory", "(", "self", ",", "rva", ",", "size", ",", "magic", "=", "consts", ".", "PE32", ")", ":", "data", "=", "self", ".", "getDataAtRva", "(", "rva", ",", "size", ")", "rd", "=", "utils", ".", "ReadData", "(", "data", ")", "i...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076
train
PE._parseRelocsDirectory
Parses the relocation directory. @type rva: int @param rva: The RVA where the relocation directory starts. @type size: int @param size: The size of the relocation directory. @type magic: int @param magic: (Optional) The type of PE. This value c...
pype32/pype32.py
def _parseRelocsDirectory(self, rva, size, magic = consts.PE32): """ Parses the relocation directory. @type rva: int @param rva: The RVA where the relocation directory starts. @type size: int @param size: The size of the relocation directory. ...
def _parseRelocsDirectory(self, rva, size, magic = consts.PE32): """ Parses the relocation directory. @type rva: int @param rva: The RVA where the relocation directory starts. @type size: int @param size: The size of the relocation directory. ...
[ "Parses", "the", "relocation", "directory", "." ]
crackinglandia/pype32
python
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L1106-L1130
[ "def", "_parseRelocsDirectory", "(", "self", ",", "rva", ",", "size", ",", "magic", "=", "consts", ".", "PE32", ")", ":", "data", "=", "self", ".", "getDataAtRva", "(", "rva", ",", "size", ")", "#print \"Length Relocation data: %x\" % len(data)", "rd", "=", ...
192fd14dfc0dd36d953739a81c17fbaf5e3d6076