repository_name
stringlengths
7
55
func_path_in_repository
stringlengths
4
223
func_name
stringlengths
1
134
whole_func_string
stringlengths
75
104k
language
stringclasses
1 value
func_code_string
stringlengths
75
104k
func_code_tokens
listlengths
19
28.4k
func_documentation_string
stringlengths
1
46.9k
func_documentation_tokens
listlengths
1
1.97k
split_name
stringclasses
1 value
func_code_url
stringlengths
87
315
timknip/pycsg
csg/geom.py
Plane.splitPolygon
def splitPolygon(self, polygon, coplanarFront, coplanarBack, front, back): """ Split `polygon` by this plane if needed, then put the polygon or polygon fragments in the appropriate lists. Coplanar polygons go into either `coplanarFront` or `coplanarBack` depending on their orientation wi...
python
def splitPolygon(self, polygon, coplanarFront, coplanarBack, front, back): """ Split `polygon` by this plane if needed, then put the polygon or polygon fragments in the appropriate lists. Coplanar polygons go into either `coplanarFront` or `coplanarBack` depending on their orientation wi...
[ "def", "splitPolygon", "(", "self", ",", "polygon", ",", "coplanarFront", ",", "coplanarBack", ",", "front", ",", "back", ")", ":", "COPLANAR", "=", "0", "# all the vertices are within EPSILON distance from plane", "FRONT", "=", "1", "# all the vertices are in front of ...
Split `polygon` by this plane if needed, then put the polygon or polygon fragments in the appropriate lists. Coplanar polygons go into either `coplanarFront` or `coplanarBack` depending on their orientation with respect to this plane. Polygons in front or in back of this plane go into ei...
[ "Split", "polygon", "by", "this", "plane", "if", "needed", "then", "put", "the", "polygon", "or", "polygon", "fragments", "in", "the", "appropriate", "lists", ".", "Coplanar", "polygons", "go", "into", "either", "coplanarFront", "or", "coplanarBack", "depending"...
train
https://github.com/timknip/pycsg/blob/b8f9710fd15c38dcc275d56a2108f604af38dcc8/csg/geom.py#L192-L260
timknip/pycsg
csg/geom.py
BSPNode.invert
def invert(self): """ Convert solid space to empty space and empty space to solid space. """ for poly in self.polygons: poly.flip() self.plane.flip() if self.front: self.front.invert() if self.back: self.back.invert() ...
python
def invert(self): """ Convert solid space to empty space and empty space to solid space. """ for poly in self.polygons: poly.flip() self.plane.flip() if self.front: self.front.invert() if self.back: self.back.invert() ...
[ "def", "invert", "(", "self", ")", ":", "for", "poly", "in", "self", ".", "polygons", ":", "poly", ".", "flip", "(", ")", "self", ".", "plane", ".", "flip", "(", ")", "if", "self", ".", "front", ":", "self", ".", "front", ".", "invert", "(", ")...
Convert solid space to empty space and empty space to solid space.
[ "Convert", "solid", "space", "to", "empty", "space", "and", "empty", "space", "to", "solid", "space", "." ]
train
https://github.com/timknip/pycsg/blob/b8f9710fd15c38dcc275d56a2108f604af38dcc8/csg/geom.py#L323-L336
timknip/pycsg
csg/geom.py
BSPNode.clipPolygons
def clipPolygons(self, polygons): """ Recursively remove all polygons in `polygons` that are inside this BSP tree. """ if not self.plane: return polygons[:] front = [] back = [] for poly in polygons: self.plane.splitPolygon(poly,...
python
def clipPolygons(self, polygons): """ Recursively remove all polygons in `polygons` that are inside this BSP tree. """ if not self.plane: return polygons[:] front = [] back = [] for poly in polygons: self.plane.splitPolygon(poly,...
[ "def", "clipPolygons", "(", "self", ",", "polygons", ")", ":", "if", "not", "self", ".", "plane", ":", "return", "polygons", "[", ":", "]", "front", "=", "[", "]", "back", "=", "[", "]", "for", "poly", "in", "polygons", ":", "self", ".", "plane", ...
Recursively remove all polygons in `polygons` that are inside this BSP tree.
[ "Recursively", "remove", "all", "polygons", "in", "polygons", "that", "are", "inside", "this", "BSP", "tree", "." ]
train
https://github.com/timknip/pycsg/blob/b8f9710fd15c38dcc275d56a2108f604af38dcc8/csg/geom.py#L338-L360
timknip/pycsg
csg/geom.py
BSPNode.clipTo
def clipTo(self, bsp): """ Remove all polygons in this BSP tree that are inside the other BSP tree `bsp`. """ self.polygons = bsp.clipPolygons(self.polygons) if self.front: self.front.clipTo(bsp) if self.back: self.back.clipTo(bsp)
python
def clipTo(self, bsp): """ Remove all polygons in this BSP tree that are inside the other BSP tree `bsp`. """ self.polygons = bsp.clipPolygons(self.polygons) if self.front: self.front.clipTo(bsp) if self.back: self.back.clipTo(bsp)
[ "def", "clipTo", "(", "self", ",", "bsp", ")", ":", "self", ".", "polygons", "=", "bsp", ".", "clipPolygons", "(", "self", ".", "polygons", ")", "if", "self", ".", "front", ":", "self", ".", "front", ".", "clipTo", "(", "bsp", ")", "if", "self", ...
Remove all polygons in this BSP tree that are inside the other BSP tree `bsp`.
[ "Remove", "all", "polygons", "in", "this", "BSP", "tree", "that", "are", "inside", "the", "other", "BSP", "tree", "bsp", "." ]
train
https://github.com/timknip/pycsg/blob/b8f9710fd15c38dcc275d56a2108f604af38dcc8/csg/geom.py#L362-L371
timknip/pycsg
csg/geom.py
BSPNode.allPolygons
def allPolygons(self): """ Return a list of all polygons in this BSP tree. """ polygons = self.polygons[:] if self.front: polygons.extend(self.front.allPolygons()) if self.back: polygons.extend(self.back.allPolygons()) return polygons
python
def allPolygons(self): """ Return a list of all polygons in this BSP tree. """ polygons = self.polygons[:] if self.front: polygons.extend(self.front.allPolygons()) if self.back: polygons.extend(self.back.allPolygons()) return polygons
[ "def", "allPolygons", "(", "self", ")", ":", "polygons", "=", "self", ".", "polygons", "[", ":", "]", "if", "self", ".", "front", ":", "polygons", ".", "extend", "(", "self", ".", "front", ".", "allPolygons", "(", ")", ")", "if", "self", ".", "back...
Return a list of all polygons in this BSP tree.
[ "Return", "a", "list", "of", "all", "polygons", "in", "this", "BSP", "tree", "." ]
train
https://github.com/timknip/pycsg/blob/b8f9710fd15c38dcc275d56a2108f604af38dcc8/csg/geom.py#L373-L382
timknip/pycsg
csg/geom.py
BSPNode.build
def build(self, polygons): """ Build a BSP tree out of `polygons`. When called on an existing tree, the new polygons are filtered down to the bottom of the tree and become new nodes there. Each set of polygons is partitioned using the first polygon (no heuristic is used to pick a...
python
def build(self, polygons): """ Build a BSP tree out of `polygons`. When called on an existing tree, the new polygons are filtered down to the bottom of the tree and become new nodes there. Each set of polygons is partitioned using the first polygon (no heuristic is used to pick a...
[ "def", "build", "(", "self", ",", "polygons", ")", ":", "if", "len", "(", "polygons", ")", "==", "0", ":", "return", "if", "not", "self", ".", "plane", ":", "self", ".", "plane", "=", "polygons", "[", "0", "]", ".", "plane", ".", "clone", "(", ...
Build a BSP tree out of `polygons`. When called on an existing tree, the new polygons are filtered down to the bottom of the tree and become new nodes there. Each set of polygons is partitioned using the first polygon (no heuristic is used to pick a good split).
[ "Build", "a", "BSP", "tree", "out", "of", "polygons", ".", "When", "called", "on", "an", "existing", "tree", "the", "new", "polygons", "are", "filtered", "down", "to", "the", "bottom", "of", "the", "tree", "and", "become", "new", "nodes", "there", ".", ...
train
https://github.com/timknip/pycsg/blob/b8f9710fd15c38dcc275d56a2108f604af38dcc8/csg/geom.py#L384-L412
evonove/django-money-rates
djmoney_rates/utils.py
get_rate
def get_rate(currency): """Returns the rate from the default currency to `currency`.""" source = get_rate_source() try: return Rate.objects.get(source=source, currency=currency).value except Rate.DoesNotExist: raise CurrencyConversionException( "Rate for %s in %s do not exist...
python
def get_rate(currency): """Returns the rate from the default currency to `currency`.""" source = get_rate_source() try: return Rate.objects.get(source=source, currency=currency).value except Rate.DoesNotExist: raise CurrencyConversionException( "Rate for %s in %s do not exist...
[ "def", "get_rate", "(", "currency", ")", ":", "source", "=", "get_rate_source", "(", ")", "try", ":", "return", "Rate", ".", "objects", ".", "get", "(", "source", "=", "source", ",", "currency", "=", "currency", ")", ".", "value", "except", "Rate", "."...
Returns the rate from the default currency to `currency`.
[ "Returns", "the", "rate", "from", "the", "default", "currency", "to", "currency", "." ]
train
https://github.com/evonove/django-money-rates/blob/ac1f7636b9a38d3e153eb833019342c4d88634c2/djmoney_rates/utils.py#L12-L21
evonove/django-money-rates
djmoney_rates/utils.py
get_rate_source
def get_rate_source(): """Get the default Rate Source and return it.""" backend = money_rates_settings.DEFAULT_BACKEND() try: return RateSource.objects.get(name=backend.get_source_name()) except RateSource.DoesNotExist: raise CurrencyConversionException( "Rate for %s source d...
python
def get_rate_source(): """Get the default Rate Source and return it.""" backend = money_rates_settings.DEFAULT_BACKEND() try: return RateSource.objects.get(name=backend.get_source_name()) except RateSource.DoesNotExist: raise CurrencyConversionException( "Rate for %s source d...
[ "def", "get_rate_source", "(", ")", ":", "backend", "=", "money_rates_settings", ".", "DEFAULT_BACKEND", "(", ")", "try", ":", "return", "RateSource", ".", "objects", ".", "get", "(", "name", "=", "backend", ".", "get_source_name", "(", ")", ")", "except", ...
Get the default Rate Source and return it.
[ "Get", "the", "default", "Rate", "Source", "and", "return", "it", "." ]
train
https://github.com/evonove/django-money-rates/blob/ac1f7636b9a38d3e153eb833019342c4d88634c2/djmoney_rates/utils.py#L24-L32
evonove/django-money-rates
djmoney_rates/utils.py
base_convert_money
def base_convert_money(amount, currency_from, currency_to): """ Convert 'amount' from 'currency_from' to 'currency_to' """ source = get_rate_source() # Get rate for currency_from. if source.base_currency != currency_from: rate_from = get_rate(currency_from) else: # If curren...
python
def base_convert_money(amount, currency_from, currency_to): """ Convert 'amount' from 'currency_from' to 'currency_to' """ source = get_rate_source() # Get rate for currency_from. if source.base_currency != currency_from: rate_from = get_rate(currency_from) else: # If curren...
[ "def", "base_convert_money", "(", "amount", ",", "currency_from", ",", "currency_to", ")", ":", "source", "=", "get_rate_source", "(", ")", "# Get rate for currency_from.", "if", "source", ".", "base_currency", "!=", "currency_from", ":", "rate_from", "=", "get_rate...
Convert 'amount' from 'currency_from' to 'currency_to'
[ "Convert", "amount", "from", "currency_from", "to", "currency_to" ]
train
https://github.com/evonove/django-money-rates/blob/ac1f7636b9a38d3e153eb833019342c4d88634c2/djmoney_rates/utils.py#L35-L55
evonove/django-money-rates
djmoney_rates/utils.py
convert_money
def convert_money(amount, currency_from, currency_to): """ Convert 'amount' from 'currency_from' to 'currency_to' and return a Money instance of the converted amount. """ new_amount = base_convert_money(amount, currency_from, currency_to) return moneyed.Money(new_amount, currency_to)
python
def convert_money(amount, currency_from, currency_to): """ Convert 'amount' from 'currency_from' to 'currency_to' and return a Money instance of the converted amount. """ new_amount = base_convert_money(amount, currency_from, currency_to) return moneyed.Money(new_amount, currency_to)
[ "def", "convert_money", "(", "amount", ",", "currency_from", ",", "currency_to", ")", ":", "new_amount", "=", "base_convert_money", "(", "amount", ",", "currency_from", ",", "currency_to", ")", "return", "moneyed", ".", "Money", "(", "new_amount", ",", "currency...
Convert 'amount' from 'currency_from' to 'currency_to' and return a Money instance of the converted amount.
[ "Convert", "amount", "from", "currency_from", "to", "currency_to", "and", "return", "a", "Money", "instance", "of", "the", "converted", "amount", "." ]
train
https://github.com/evonove/django-money-rates/blob/ac1f7636b9a38d3e153eb833019342c4d88634c2/djmoney_rates/utils.py#L58-L64
Blazemeter/apiritif
apiritif/utilities.py
format_date
def format_date(format_string=None, datetime_obj=None): """ Format a datetime object with Java SimpleDateFormat's-like string. If datetime_obj is not given - use current datetime. If format_string is not given - return number of millisecond since epoch. :param format_string: :param datetime_ob...
python
def format_date(format_string=None, datetime_obj=None): """ Format a datetime object with Java SimpleDateFormat's-like string. If datetime_obj is not given - use current datetime. If format_string is not given - return number of millisecond since epoch. :param format_string: :param datetime_ob...
[ "def", "format_date", "(", "format_string", "=", "None", ",", "datetime_obj", "=", "None", ")", ":", "datetime_obj", "=", "datetime_obj", "or", "datetime", ".", "now", "(", ")", "if", "format_string", "is", "None", ":", "seconds", "=", "int", "(", "datetim...
Format a datetime object with Java SimpleDateFormat's-like string. If datetime_obj is not given - use current datetime. If format_string is not given - return number of millisecond since epoch. :param format_string: :param datetime_obj: :return: :rtype string
[ "Format", "a", "datetime", "object", "with", "Java", "SimpleDateFormat", "s", "-", "like", "string", "." ]
train
https://github.com/Blazemeter/apiritif/blob/27b48a68425949998c2254e5e1e0226882d9eee8/apiritif/utilities.py#L93-L112
crackinglandia/pype32
pype32/utils.py
allZero
def allZero(buffer): """ Tries to determine if a buffer is empty. @type buffer: str @param buffer: Buffer to test if it is empty. @rtype: bool @return: C{True} if the given buffer is empty, i.e. full of zeros, C{False} if it doesn't. """ allZero = True for byte ...
python
def allZero(buffer): """ Tries to determine if a buffer is empty. @type buffer: str @param buffer: Buffer to test if it is empty. @rtype: bool @return: C{True} if the given buffer is empty, i.e. full of zeros, C{False} if it doesn't. """ allZero = True for byte ...
[ "def", "allZero", "(", "buffer", ")", ":", "allZero", "=", "True", "for", "byte", "in", "buffer", ":", "if", "byte", "!=", "\"\\x00\"", ":", "allZero", "=", "False", "break", "return", "allZero" ]
Tries to determine if a buffer is empty. @type buffer: str @param buffer: Buffer to test if it is empty. @rtype: bool @return: C{True} if the given buffer is empty, i.e. full of zeros, C{False} if it doesn't.
[ "Tries", "to", "determine", "if", "a", "buffer", "is", "empty", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L65-L81
crackinglandia/pype32
pype32/utils.py
WriteData.writeByte
def writeByte(self, byte): """ Writes a byte into the L{WriteData} stream object. @type byte: int @param byte: Byte value to write into the stream. """ self.data.write(pack("B" if not self.signed else "b", byte))
python
def writeByte(self, byte): """ Writes a byte into the L{WriteData} stream object. @type byte: int @param byte: Byte value to write into the stream. """ self.data.write(pack("B" if not self.signed else "b", byte))
[ "def", "writeByte", "(", "self", ",", "byte", ")", ":", "self", ".", "data", ".", "write", "(", "pack", "(", "\"B\"", "if", "not", "self", ".", "signed", "else", "\"b\"", ",", "byte", ")", ")" ]
Writes a byte into the L{WriteData} stream object. @type byte: int @param byte: Byte value to write into the stream.
[ "Writes", "a", "byte", "into", "the", "L", "{", "WriteData", "}", "stream", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L106-L113
crackinglandia/pype32
pype32/utils.py
WriteData.writeWord
def writeWord(self, word): """ Writes a word value into the L{WriteData} stream object. @type word: int @param word: Word value to write into the stream. """ self.data.write(pack(self.endianness + ("H" if not self.signed else "h"), word))
python
def writeWord(self, word): """ Writes a word value into the L{WriteData} stream object. @type word: int @param word: Word value to write into the stream. """ self.data.write(pack(self.endianness + ("H" if not self.signed else "h"), word))
[ "def", "writeWord", "(", "self", ",", "word", ")", ":", "self", ".", "data", ".", "write", "(", "pack", "(", "self", ".", "endianness", "+", "(", "\"H\"", "if", "not", "self", ".", "signed", "else", "\"h\"", ")", ",", "word", ")", ")" ]
Writes a word value into the L{WriteData} stream object. @type word: int @param word: Word value to write into the stream.
[ "Writes", "a", "word", "value", "into", "the", "L", "{", "WriteData", "}", "stream", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L115-L122
crackinglandia/pype32
pype32/utils.py
WriteData.writeDword
def writeDword(self, dword): """ Writes a dword value into the L{WriteData} stream object. @type dword: int @param dword: Dword value to write into the stream. """ self.data.write(pack(self.endianness + ("L" if not self.signed else "l"), dword))
python
def writeDword(self, dword): """ Writes a dword value into the L{WriteData} stream object. @type dword: int @param dword: Dword value to write into the stream. """ self.data.write(pack(self.endianness + ("L" if not self.signed else "l"), dword))
[ "def", "writeDword", "(", "self", ",", "dword", ")", ":", "self", ".", "data", ".", "write", "(", "pack", "(", "self", ".", "endianness", "+", "(", "\"L\"", "if", "not", "self", ".", "signed", "else", "\"l\"", ")", ",", "dword", ")", ")" ]
Writes a dword value into the L{WriteData} stream object. @type dword: int @param dword: Dword value to write into the stream.
[ "Writes", "a", "dword", "value", "into", "the", "L", "{", "WriteData", "}", "stream", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L124-L131
crackinglandia/pype32
pype32/utils.py
WriteData.writeQword
def writeQword(self, qword): """ Writes a qword value into the L{WriteData} stream object. @type qword: int @param qword: Qword value to write into the stream. """ self.data.write(pack(self.endianness + ("Q" if not self.signed else "q"), qword))
python
def writeQword(self, qword): """ Writes a qword value into the L{WriteData} stream object. @type qword: int @param qword: Qword value to write into the stream. """ self.data.write(pack(self.endianness + ("Q" if not self.signed else "q"), qword))
[ "def", "writeQword", "(", "self", ",", "qword", ")", ":", "self", ".", "data", ".", "write", "(", "pack", "(", "self", ".", "endianness", "+", "(", "\"Q\"", "if", "not", "self", ".", "signed", "else", "\"q\"", ")", ",", "qword", ")", ")" ]
Writes a qword value into the L{WriteData} stream object. @type qword: int @param qword: Qword value to write into the stream.
[ "Writes", "a", "qword", "value", "into", "the", "L", "{", "WriteData", "}", "stream", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L133-L140
crackinglandia/pype32
pype32/utils.py
WriteData.setOffset
def setOffset(self, value): """ Sets the offset of the L{WriteData} stream object in wich the data is written. @type value: int @param value: Integer value that represent the offset we want to start writing in the L{WriteData} stream. @raise WrongOffsetValue...
python
def setOffset(self, value): """ Sets the offset of the L{WriteData} stream object in wich the data is written. @type value: int @param value: Integer value that represent the offset we want to start writing in the L{WriteData} stream. @raise WrongOffsetValue...
[ "def", "setOffset", "(", "self", ",", "value", ")", ":", "if", "value", ">=", "len", "(", "self", ".", "data", ".", "getvalue", "(", ")", ")", ":", "raise", "excep", ".", "WrongOffsetValueException", "(", "\"Wrong offset value. Must be less than %d\"", "%", ...
Sets the offset of the L{WriteData} stream object in wich the data is written. @type value: int @param value: Integer value that represent the offset we want to start writing in the L{WriteData} stream. @raise WrongOffsetValueException: The value is beyond the total length ...
[ "Sets", "the", "offset", "of", "the", "L", "{", "WriteData", "}", "stream", "object", "in", "wich", "the", "data", "is", "written", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L151-L162
crackinglandia/pype32
pype32/utils.py
WriteData.skipBytes
def skipBytes(self, nroBytes): """ Skips the specified number as parameter to the current value of the L{WriteData} stream. @type nroBytes: int @param nroBytes: The number of bytes to skip. """ self.data.seek(nroBytes + self.data.tell())
python
def skipBytes(self, nroBytes): """ Skips the specified number as parameter to the current value of the L{WriteData} stream. @type nroBytes: int @param nroBytes: The number of bytes to skip. """ self.data.seek(nroBytes + self.data.tell())
[ "def", "skipBytes", "(", "self", ",", "nroBytes", ")", ":", "self", ".", "data", ".", "seek", "(", "nroBytes", "+", "self", ".", "data", ".", "tell", "(", ")", ")" ]
Skips the specified number as parameter to the current value of the L{WriteData} stream. @type nroBytes: int @param nroBytes: The number of bytes to skip.
[ "Skips", "the", "specified", "number", "as", "parameter", "to", "the", "current", "value", "of", "the", "L", "{", "WriteData", "}", "stream", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L164-L171
crackinglandia/pype32
pype32/utils.py
ReadData.readDword
def readDword(self): """ Reads a dword value from the L{ReadData} stream object. @rtype: int @return: The dword value read from the L{ReadData} stream. """ dword = unpack(self.endianness + ('L' if not self.signed else 'l'), self.readAt(self.offset, 4))[0] ...
python
def readDword(self): """ Reads a dword value from the L{ReadData} stream object. @rtype: int @return: The dword value read from the L{ReadData} stream. """ dword = unpack(self.endianness + ('L' if not self.signed else 'l'), self.readAt(self.offset, 4))[0] ...
[ "def", "readDword", "(", "self", ")", ":", "dword", "=", "unpack", "(", "self", ".", "endianness", "+", "(", "'L'", "if", "not", "self", ".", "signed", "else", "'l'", ")", ",", "self", ".", "readAt", "(", "self", ".", "offset", ",", "4", ")", ")"...
Reads a dword value from the L{ReadData} stream object. @rtype: int @return: The dword value read from the L{ReadData} stream.
[ "Reads", "a", "dword", "value", "from", "the", "L", "{", "ReadData", "}", "stream", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L209-L218
crackinglandia/pype32
pype32/utils.py
ReadData.readWord
def readWord(self): """ Reads a word value from the L{ReadData} stream object. @rtype: int @return: The word value read from the L{ReadData} stream. """ word = unpack(self.endianness + ('H' if not self.signed else 'h'), self.readAt(self.offset, 2))[0] sel...
python
def readWord(self): """ Reads a word value from the L{ReadData} stream object. @rtype: int @return: The word value read from the L{ReadData} stream. """ word = unpack(self.endianness + ('H' if not self.signed else 'h'), self.readAt(self.offset, 2))[0] sel...
[ "def", "readWord", "(", "self", ")", ":", "word", "=", "unpack", "(", "self", ".", "endianness", "+", "(", "'H'", "if", "not", "self", ".", "signed", "else", "'h'", ")", ",", "self", ".", "readAt", "(", "self", ".", "offset", ",", "2", ")", ")", ...
Reads a word value from the L{ReadData} stream object. @rtype: int @return: The word value read from the L{ReadData} stream.
[ "Reads", "a", "word", "value", "from", "the", "L", "{", "ReadData", "}", "stream", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L220-L229
crackinglandia/pype32
pype32/utils.py
ReadData.readByte
def readByte(self): """ Reads a byte value from the L{ReadData} stream object. @rtype: int @return: The byte value read from the L{ReadData} stream. """ byte = unpack('B' if not self.signed else 'b', self.readAt(self.offset, 1))[0] self.offset += 1 ...
python
def readByte(self): """ Reads a byte value from the L{ReadData} stream object. @rtype: int @return: The byte value read from the L{ReadData} stream. """ byte = unpack('B' if not self.signed else 'b', self.readAt(self.offset, 1))[0] self.offset += 1 ...
[ "def", "readByte", "(", "self", ")", ":", "byte", "=", "unpack", "(", "'B'", "if", "not", "self", ".", "signed", "else", "'b'", ",", "self", ".", "readAt", "(", "self", ".", "offset", ",", "1", ")", ")", "[", "0", "]", "self", ".", "offset", "+...
Reads a byte value from the L{ReadData} stream object. @rtype: int @return: The byte value read from the L{ReadData} stream.
[ "Reads", "a", "byte", "value", "from", "the", "L", "{", "ReadData", "}", "stream", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L231-L240
crackinglandia/pype32
pype32/utils.py
ReadData.readQword
def readQword(self): """ Reads a qword value from the L{ReadData} stream object. @rtype: int @return: The qword value read from the L{ReadData} stream. """ qword = unpack(self.endianness + ('Q' if not self.signed else 'b'), self.readAt(self.offset, 8))[0] ...
python
def readQword(self): """ Reads a qword value from the L{ReadData} stream object. @rtype: int @return: The qword value read from the L{ReadData} stream. """ qword = unpack(self.endianness + ('Q' if not self.signed else 'b'), self.readAt(self.offset, 8))[0] ...
[ "def", "readQword", "(", "self", ")", ":", "qword", "=", "unpack", "(", "self", ".", "endianness", "+", "(", "'Q'", "if", "not", "self", ".", "signed", "else", "'b'", ")", ",", "self", ".", "readAt", "(", "self", ".", "offset", ",", "8", ")", ")"...
Reads a qword value from the L{ReadData} stream object. @rtype: int @return: The qword value read from the L{ReadData} stream.
[ "Reads", "a", "qword", "value", "from", "the", "L", "{", "ReadData", "}", "stream", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L242-L251
crackinglandia/pype32
pype32/utils.py
ReadData.readString
def readString(self): """ Reads an ASCII string from the L{ReadData} stream object. @rtype: str @return: An ASCII string read form the stream. """ resultStr = "" while self.data[self.offset] != "\x00": resultStr += self.data[self.offset] ...
python
def readString(self): """ Reads an ASCII string from the L{ReadData} stream object. @rtype: str @return: An ASCII string read form the stream. """ resultStr = "" while self.data[self.offset] != "\x00": resultStr += self.data[self.offset] ...
[ "def", "readString", "(", "self", ")", ":", "resultStr", "=", "\"\"", "while", "self", ".", "data", "[", "self", ".", "offset", "]", "!=", "\"\\x00\"", ":", "resultStr", "+=", "self", ".", "data", "[", "self", ".", "offset", "]", "self", ".", "offset...
Reads an ASCII string from the L{ReadData} stream object. @rtype: str @return: An ASCII string read form the stream.
[ "Reads", "an", "ASCII", "string", "from", "the", "L", "{", "ReadData", "}", "stream", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L253-L264
crackinglandia/pype32
pype32/utils.py
ReadData.readAlignedString
def readAlignedString(self, align = 4): """ Reads an ASCII string aligned to the next align-bytes boundary. @type align: int @param align: (Optional) The value we want the ASCII string to be aligned. @rtype: str @return: A 4-bytes aligned (default) ASCI...
python
def readAlignedString(self, align = 4): """ Reads an ASCII string aligned to the next align-bytes boundary. @type align: int @param align: (Optional) The value we want the ASCII string to be aligned. @rtype: str @return: A 4-bytes aligned (default) ASCI...
[ "def", "readAlignedString", "(", "self", ",", "align", "=", "4", ")", ":", "s", "=", "self", ".", "readString", "(", ")", "r", "=", "align", "-", "len", "(", "s", ")", "%", "align", "while", "r", ":", "s", "+=", "self", ".", "data", "[", "self"...
Reads an ASCII string aligned to the next align-bytes boundary. @type align: int @param align: (Optional) The value we want the ASCII string to be aligned. @rtype: str @return: A 4-bytes aligned (default) ASCII string.
[ "Reads", "an", "ASCII", "string", "aligned", "to", "the", "next", "align", "-", "bytes", "boundary", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L266-L282
crackinglandia/pype32
pype32/utils.py
ReadData.read
def read(self, nroBytes): """ Reads data from the L{ReadData} stream object. @type nroBytes: int @param nroBytes: The number of bytes to read. @rtype: str @return: A string containing the read data from the L{ReadData} stream object. @ra...
python
def read(self, nroBytes): """ Reads data from the L{ReadData} stream object. @type nroBytes: int @param nroBytes: The number of bytes to read. @rtype: str @return: A string containing the read data from the L{ReadData} stream object. @ra...
[ "def", "read", "(", "self", ",", "nroBytes", ")", ":", "if", "nroBytes", ">", "self", ".", "length", "-", "self", ".", "offset", ":", "if", "self", ".", "log", ":", "print", "\"Warning: Trying to read: %d bytes - only %d bytes left\"", "%", "(", "nroBytes", ...
Reads data from the L{ReadData} stream object. @type nroBytes: int @param nroBytes: The number of bytes to read. @rtype: str @return: A string containing the read data from the L{ReadData} stream object. @raise DataLengthException: The number of bytes t...
[ "Reads", "data", "from", "the", "L", "{", "ReadData", "}", "stream", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L284-L303
crackinglandia/pype32
pype32/utils.py
ReadData.readAt
def readAt(self, offset, size): """ Reads as many bytes indicated in the size parameter at the specific offset. @type offset: int @param offset: Offset of the value to be read. @type size: int @param size: This parameter indicates how many bytes are going to be read fro...
python
def readAt(self, offset, size): """ Reads as many bytes indicated in the size parameter at the specific offset. @type offset: int @param offset: Offset of the value to be read. @type size: int @param size: This parameter indicates how many bytes are going to be read fro...
[ "def", "readAt", "(", "self", ",", "offset", ",", "size", ")", ":", "if", "offset", ">", "self", ".", "length", ":", "if", "self", ".", "log", ":", "print", "\"Warning: Trying to read: %d bytes - only %d bytes left\"", "%", "(", "nroBytes", ",", "self", ".",...
Reads as many bytes indicated in the size parameter at the specific offset. @type offset: int @param offset: Offset of the value to be read. @type size: int @param size: This parameter indicates how many bytes are going to be read from a given offset. @rtype: str @retu...
[ "Reads", "as", "many", "bytes", "indicated", "in", "the", "size", "parameter", "at", "the", "specific", "offset", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L327-L348
ymyzk/kawasemi
kawasemi/kawasemi.py
Kawasemi.send
def send(self, message, channel_name=None, fail_silently=False, options=None): # type: (Text, Optional[str], bool, Optional[SendOptions]) -> None """Send a notification to channels :param message: A message """ if channel_name is None: channels = self.se...
python
def send(self, message, channel_name=None, fail_silently=False, options=None): # type: (Text, Optional[str], bool, Optional[SendOptions]) -> None """Send a notification to channels :param message: A message """ if channel_name is None: channels = self.se...
[ "def", "send", "(", "self", ",", "message", ",", "channel_name", "=", "None", ",", "fail_silently", "=", "False", ",", "options", "=", "None", ")", ":", "# type: (Text, Optional[str], bool, Optional[SendOptions]) -> None", "if", "channel_name", "is", "None", ":", ...
Send a notification to channels :param message: A message
[ "Send", "a", "notification", "to", "channels" ]
train
https://github.com/ymyzk/kawasemi/blob/a9f62f38ee7c10bf4cd353285db1f477d3d372d1/kawasemi/kawasemi.py#L35-L61
Blazemeter/apiritif
apiritif/http.py
HTTPTarget.request
def request(self, method, path, params=None, headers=None, cookies=None, data=None, json=None, allow_redirects=None, timeout=None): """ Prepares and sends an HTTP request. Returns the HTTPResponse object. :param method: str :param path: str :return: response ...
python
def request(self, method, path, params=None, headers=None, cookies=None, data=None, json=None, allow_redirects=None, timeout=None): """ Prepares and sends an HTTP request. Returns the HTTPResponse object. :param method: str :param path: str :return: response ...
[ "def", "request", "(", "self", ",", "method", ",", "path", ",", "params", "=", "None", ",", "headers", "=", "None", ",", "cookies", "=", "None", ",", "data", "=", "None", ",", "json", "=", "None", ",", "allow_redirects", "=", "None", ",", "timeout", ...
Prepares and sends an HTTP request. Returns the HTTPResponse object. :param method: str :param path: str :return: response :rtype: HTTPResponse
[ "Prepares", "and", "sends", "an", "HTTP", "request", ".", "Returns", "the", "HTTPResponse", "object", "." ]
train
https://github.com/Blazemeter/apiritif/blob/27b48a68425949998c2254e5e1e0226882d9eee8/apiritif/http.py#L392-L421
zsethna/OLGA
olga/load_model.py
load_genomic_CDR3_anchor_pos_and_functionality
def load_genomic_CDR3_anchor_pos_and_functionality(anchor_pos_file_name): """Read anchor position and functionality from file. Parameters ---------- anchor_pos_file_name : str File name for the functionality and position of a conserved residue that defines the CDR3 region for each V or...
python
def load_genomic_CDR3_anchor_pos_and_functionality(anchor_pos_file_name): """Read anchor position and functionality from file. Parameters ---------- anchor_pos_file_name : str File name for the functionality and position of a conserved residue that defines the CDR3 region for each V or...
[ "def", "load_genomic_CDR3_anchor_pos_and_functionality", "(", "anchor_pos_file_name", ")", ":", "anchor_pos_and_functionality", "=", "{", "}", "anchor_pos_file", "=", "open", "(", "anchor_pos_file_name", ",", "'r'", ")", "first_line", "=", "True", "for", "line", "in", ...
Read anchor position and functionality from file. Parameters ---------- anchor_pos_file_name : str File name for the functionality and position of a conserved residue that defines the CDR3 region for each V or J germline sequence. Returns ------- anchor_pos_and_functio...
[ "Read", "anchor", "position", "and", "functionality", "from", "file", "." ]
train
https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L468-L497
zsethna/OLGA
olga/load_model.py
read_igor_V_gene_parameters
def read_igor_V_gene_parameters(params_file_name): """Load raw genV from file. genV is a list of genomic V information. Each element is a list of three elements. The first is the name of the V allele, the second is the genomic sequence trimmed to the CDR3 region for productive sequences, and the ...
python
def read_igor_V_gene_parameters(params_file_name): """Load raw genV from file. genV is a list of genomic V information. Each element is a list of three elements. The first is the name of the V allele, the second is the genomic sequence trimmed to the CDR3 region for productive sequences, and the ...
[ "def", "read_igor_V_gene_parameters", "(", "params_file_name", ")", ":", "params_file", "=", "open", "(", "params_file_name", ",", "'r'", ")", "V_gene_info", "=", "{", "}", "in_V_gene_sec", "=", "False", "for", "line", "in", "params_file", ":", "if", "line", "...
Load raw genV from file. genV is a list of genomic V information. Each element is a list of three elements. The first is the name of the V allele, the second is the genomic sequence trimmed to the CDR3 region for productive sequences, and the last is the full germline sequence. For this 'raw gen...
[ "Load", "raw", "genV", "from", "file", ".", "genV", "is", "a", "list", "of", "genomic", "V", "information", ".", "Each", "element", "is", "a", "list", "of", "three", "elements", ".", "The", "first", "is", "the", "name", "of", "the", "V", "allele", "t...
train
https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L499-L540
zsethna/OLGA
olga/load_model.py
read_igor_D_gene_parameters
def read_igor_D_gene_parameters(params_file_name): """Load genD from file. genD is a list of genomic D information. Each element is a list of the name of the D allele and the germline sequence. Parameters ---------- params_file_name : str File name for a IGOR parameter file. R...
python
def read_igor_D_gene_parameters(params_file_name): """Load genD from file. genD is a list of genomic D information. Each element is a list of the name of the D allele and the germline sequence. Parameters ---------- params_file_name : str File name for a IGOR parameter file. R...
[ "def", "read_igor_D_gene_parameters", "(", "params_file_name", ")", ":", "params_file", "=", "open", "(", "params_file_name", ",", "'r'", ")", "D_gene_info", "=", "{", "}", "in_D_gene_sec", "=", "False", "for", "line", "in", "params_file", ":", "if", "line", "...
Load genD from file. genD is a list of genomic D information. Each element is a list of the name of the D allele and the germline sequence. Parameters ---------- params_file_name : str File name for a IGOR parameter file. Returns ------- genD : list List of genomic...
[ "Load", "genD", "from", "file", ".", "genD", "is", "a", "list", "of", "genomic", "D", "information", ".", "Each", "element", "is", "a", "list", "of", "the", "name", "of", "the", "D", "allele", "and", "the", "germline", "sequence", "." ]
train
https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L542-L580
zsethna/OLGA
olga/load_model.py
read_igor_J_gene_parameters
def read_igor_J_gene_parameters(params_file_name): """Load raw genJ from file. genJ is a list of genomic J information. Each element is a list of three elements. The first is the name of the J allele, the second is the genomic sequence trimmed to the CDR3 region for productive sequences, and the ...
python
def read_igor_J_gene_parameters(params_file_name): """Load raw genJ from file. genJ is a list of genomic J information. Each element is a list of three elements. The first is the name of the J allele, the second is the genomic sequence trimmed to the CDR3 region for productive sequences, and the ...
[ "def", "read_igor_J_gene_parameters", "(", "params_file_name", ")", ":", "params_file", "=", "open", "(", "params_file_name", ",", "'r'", ")", "J_gene_info", "=", "{", "}", "in_J_gene_sec", "=", "False", "for", "line", "in", "params_file", ":", "if", "line", "...
Load raw genJ from file. genJ is a list of genomic J information. Each element is a list of three elements. The first is the name of the J allele, the second is the genomic sequence trimmed to the CDR3 region for productive sequences, and the last is the full germline sequence. For this 'raw gen...
[ "Load", "raw", "genJ", "from", "file", ".", "genJ", "is", "a", "list", "of", "genomic", "J", "information", ".", "Each", "element", "is", "a", "list", "of", "three", "elements", ".", "The", "first", "is", "the", "name", "of", "the", "J", "allele", "t...
train
https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L582-L623
zsethna/OLGA
olga/load_model.py
read_igor_marginals_txt
def read_igor_marginals_txt(marginals_file_name , dim_names=False): """Load raw IGoR model marginals. Parameters ---------- marginals_file_name : str File name for a IGOR model marginals file. Returns ------- model_dict : dict Dictionary with model marginals. dimens...
python
def read_igor_marginals_txt(marginals_file_name , dim_names=False): """Load raw IGoR model marginals. Parameters ---------- marginals_file_name : str File name for a IGOR model marginals file. Returns ------- model_dict : dict Dictionary with model marginals. dimens...
[ "def", "read_igor_marginals_txt", "(", "marginals_file_name", ",", "dim_names", "=", "False", ")", ":", "with", "open", "(", "marginals_file_name", ",", "'r'", ")", "as", "file", ":", "#Model parameters are stored inside a dictionary of ndarrays", "model_dict", "=", "{"...
Load raw IGoR model marginals. Parameters ---------- marginals_file_name : str File name for a IGOR model marginals file. Returns ------- model_dict : dict Dictionary with model marginals. dimension_names_dict : dict Dictionary that defines IGoR model dependecie...
[ "Load", "raw", "IGoR", "model", "marginals", ".", "Parameters", "----------", "marginals_file_name", ":", "str", "File", "name", "for", "a", "IGOR", "model", "marginals", "file", "." ]
train
https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L790-L892
zsethna/OLGA
olga/load_model.py
GenomicData.anchor_and_curate_genV_and_genJ
def anchor_and_curate_genV_and_genJ(self, V_anchor_pos_file, J_anchor_pos_file): """Trim V and J germline sequences to the CDR3 region. Unproductive sequences have an empty string '' for the CDR3 region sequence. Edits the attributes genV and genJ Param...
python
def anchor_and_curate_genV_and_genJ(self, V_anchor_pos_file, J_anchor_pos_file): """Trim V and J germline sequences to the CDR3 region. Unproductive sequences have an empty string '' for the CDR3 region sequence. Edits the attributes genV and genJ Param...
[ "def", "anchor_and_curate_genV_and_genJ", "(", "self", ",", "V_anchor_pos_file", ",", "J_anchor_pos_file", ")", ":", "V_anchor_pos", "=", "load_genomic_CDR3_anchor_pos_and_functionality", "(", "V_anchor_pos_file", ")", "J_anchor_pos", "=", "load_genomic_CDR3_anchor_pos_and_functi...
Trim V and J germline sequences to the CDR3 region. Unproductive sequences have an empty string '' for the CDR3 region sequence. Edits the attributes genV and genJ Parameters ---------- V_anchor_pos_file_name : str File name for the ...
[ "Trim", "V", "and", "J", "germline", "sequences", "to", "the", "CDR3", "region", ".", "Unproductive", "sequences", "have", "an", "empty", "string", "for", "the", "CDR3", "region", "sequence", ".", "Edits", "the", "attributes", "genV", "and", "genJ", "Paramet...
train
https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L129-L167
zsethna/OLGA
olga/load_model.py
GenomicData.generate_cutV_genomic_CDR3_segs
def generate_cutV_genomic_CDR3_segs(self): """Add palindromic inserted nucleotides to germline V sequences. The maximum number of palindromic insertions are appended to the germline V segments so that delV can index directly for number of nucleotides to delete from a segment. ...
python
def generate_cutV_genomic_CDR3_segs(self): """Add palindromic inserted nucleotides to germline V sequences. The maximum number of palindromic insertions are appended to the germline V segments so that delV can index directly for number of nucleotides to delete from a segment. ...
[ "def", "generate_cutV_genomic_CDR3_segs", "(", "self", ")", ":", "max_palindrome", "=", "self", ".", "max_delV_palindrome", "self", ".", "cutV_genomic_CDR3_segs", "=", "[", "]", "for", "CDR3_V_seg", "in", "[", "x", "[", "1", "]", "for", "x", "in", "self", "....
Add palindromic inserted nucleotides to germline V sequences. The maximum number of palindromic insertions are appended to the germline V segments so that delV can index directly for number of nucleotides to delete from a segment. Sets the attribute cutV_genomic_CDR3_se...
[ "Add", "palindromic", "inserted", "nucleotides", "to", "germline", "V", "sequences", ".", "The", "maximum", "number", "of", "palindromic", "insertions", "are", "appended", "to", "the", "germline", "V", "segments", "so", "that", "delV", "can", "index", "directly"...
train
https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L169-L187
zsethna/OLGA
olga/load_model.py
GenomicData.generate_cutJ_genomic_CDR3_segs
def generate_cutJ_genomic_CDR3_segs(self): """Add palindromic inserted nucleotides to germline J sequences. The maximum number of palindromic insertions are appended to the germline J segments so that delJ can index directly for number of nucleotides to delete from a segment. ...
python
def generate_cutJ_genomic_CDR3_segs(self): """Add palindromic inserted nucleotides to germline J sequences. The maximum number of palindromic insertions are appended to the germline J segments so that delJ can index directly for number of nucleotides to delete from a segment. ...
[ "def", "generate_cutJ_genomic_CDR3_segs", "(", "self", ")", ":", "max_palindrome", "=", "self", ".", "max_delJ_palindrome", "self", ".", "cutJ_genomic_CDR3_segs", "=", "[", "]", "for", "CDR3_J_seg", "in", "[", "x", "[", "1", "]", "for", "x", "in", "self", "....
Add palindromic inserted nucleotides to germline J sequences. The maximum number of palindromic insertions are appended to the germline J segments so that delJ can index directly for number of nucleotides to delete from a segment. Sets the attribute cutJ_genomic_CDR3_se...
[ "Add", "palindromic", "inserted", "nucleotides", "to", "germline", "J", "sequences", ".", "The", "maximum", "number", "of", "palindromic", "insertions", "are", "appended", "to", "the", "germline", "J", "segments", "so", "that", "delJ", "can", "index", "directly"...
train
https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L189-L206
zsethna/OLGA
olga/load_model.py
GenomicDataVDJ.load_igor_genomic_data
def load_igor_genomic_data(self, params_file_name, V_anchor_pos_file, J_anchor_pos_file): """Set attributes by loading in genomic data from IGoR parameter file. Sets attributes genV, max_delV_palindrome, cutV_genomic_CDR3_segs, genD, max_delDl_palindrome, max_delDr_palindrome, ...
python
def load_igor_genomic_data(self, params_file_name, V_anchor_pos_file, J_anchor_pos_file): """Set attributes by loading in genomic data from IGoR parameter file. Sets attributes genV, max_delV_palindrome, cutV_genomic_CDR3_segs, genD, max_delDl_palindrome, max_delDr_palindrome, ...
[ "def", "load_igor_genomic_data", "(", "self", ",", "params_file_name", ",", "V_anchor_pos_file", ",", "J_anchor_pos_file", ")", ":", "self", ".", "genV", "=", "read_igor_V_gene_parameters", "(", "params_file_name", ")", "self", ".", "genD", "=", "read_igor_D_gene_para...
Set attributes by loading in genomic data from IGoR parameter file. Sets attributes genV, max_delV_palindrome, cutV_genomic_CDR3_segs, genD, max_delDl_palindrome, max_delDr_palindrome, cutD_genomic_CDR3_segs, genJ, max_delJ_palindrome, and cutJ_genomic_CDR3_segs. ...
[ "Set", "attributes", "by", "loading", "in", "genomic", "data", "from", "IGoR", "parameter", "file", ".", "Sets", "attributes", "genV", "max_delV_palindrome", "cutV_genomic_CDR3_segs", "genD", "max_delDl_palindrome", "max_delDr_palindrome", "cutD_genomic_CDR3_segs", "genJ", ...
train
https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L258-L289
zsethna/OLGA
olga/load_model.py
GenomicDataVDJ.generate_cutD_genomic_CDR3_segs
def generate_cutD_genomic_CDR3_segs(self): """Add palindromic inserted nucleotides to germline V sequences. The maximum number of palindromic insertions are appended to the germline D segments so that delDl and delDr can index directly for number of nucleotides to delete from a...
python
def generate_cutD_genomic_CDR3_segs(self): """Add palindromic inserted nucleotides to germline V sequences. The maximum number of palindromic insertions are appended to the germline D segments so that delDl and delDr can index directly for number of nucleotides to delete from a...
[ "def", "generate_cutD_genomic_CDR3_segs", "(", "self", ")", ":", "max_palindrome_L", "=", "self", ".", "max_delDl_palindrome", "max_palindrome_R", "=", "self", ".", "max_delDr_palindrome", "self", ".", "cutD_genomic_CDR3_segs", "=", "[", "]", "for", "CDR3_D_seg", "in"...
Add palindromic inserted nucleotides to germline V sequences. The maximum number of palindromic insertions are appended to the germline D segments so that delDl and delDr can index directly for number of nucleotides to delete from a segment. Sets the attribute cutV_gen...
[ "Add", "palindromic", "inserted", "nucleotides", "to", "germline", "V", "sequences", ".", "The", "maximum", "number", "of", "palindromic", "insertions", "are", "appended", "to", "the", "germline", "D", "segments", "so", "that", "delDl", "and", "delDr", "can", ...
train
https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L291-L309
zsethna/OLGA
olga/load_model.py
GenomicDataVDJ.read_VDJ_palindrome_parameters
def read_VDJ_palindrome_parameters(self, params_file_name): """Read V, D, and J palindrome parameters from file. Sets the attributes max_delV_palindrome, max_delDl_palindrome, max_delDr_palindrome, and max_delJ_palindrome. Parameters ---------- params_file_n...
python
def read_VDJ_palindrome_parameters(self, params_file_name): """Read V, D, and J palindrome parameters from file. Sets the attributes max_delV_palindrome, max_delDl_palindrome, max_delDr_palindrome, and max_delJ_palindrome. Parameters ---------- params_file_n...
[ "def", "read_VDJ_palindrome_parameters", "(", "self", ",", "params_file_name", ")", ":", "params_file", "=", "open", "(", "params_file_name", ",", "'r'", ")", "in_delV", "=", "False", "in_delDl", "=", "False", "in_delDr", "=", "False", "in_delJ", "=", "False", ...
Read V, D, and J palindrome parameters from file. Sets the attributes max_delV_palindrome, max_delDl_palindrome, max_delDr_palindrome, and max_delJ_palindrome. Parameters ---------- params_file_name : str File name for an IGoR parameter file of a VDJ gen...
[ "Read", "V", "D", "and", "J", "palindrome", "parameters", "from", "file", ".", "Sets", "the", "attributes", "max_delV_palindrome", "max_delDl_palindrome", "max_delDr_palindrome", "and", "max_delJ_palindrome", ".", "Parameters", "----------", "params_file_name", ":", "st...
train
https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L311-L368
zsethna/OLGA
olga/load_model.py
GenomicDataVJ.load_igor_genomic_data
def load_igor_genomic_data(self, params_file_name, V_anchor_pos_file, J_anchor_pos_file): """Set attributes by loading in genomic data from IGoR parameter file. Sets attributes genV, genJ, max_delV_palindrome, max_delJ_palindrome, cutV_genomic_CDR3_segs, and cutJ_genomic_CDR3_segs. ...
python
def load_igor_genomic_data(self, params_file_name, V_anchor_pos_file, J_anchor_pos_file): """Set attributes by loading in genomic data from IGoR parameter file. Sets attributes genV, genJ, max_delV_palindrome, max_delJ_palindrome, cutV_genomic_CDR3_segs, and cutJ_genomic_CDR3_segs. ...
[ "def", "load_igor_genomic_data", "(", "self", ",", "params_file_name", ",", "V_anchor_pos_file", ",", "J_anchor_pos_file", ")", ":", "self", ".", "genV", "=", "read_igor_V_gene_parameters", "(", "params_file_name", ")", "self", ".", "genJ", "=", "read_igor_J_gene_para...
Set attributes by loading in genomic data from IGoR parameter file. Sets attributes genV, genJ, max_delV_palindrome, max_delJ_palindrome, cutV_genomic_CDR3_segs, and cutJ_genomic_CDR3_segs. Parameters ---------- params_file_name : str File name for a...
[ "Set", "attributes", "by", "loading", "in", "genomic", "data", "from", "IGoR", "parameter", "file", ".", "Sets", "attributes", "genV", "genJ", "max_delV_palindrome", "max_delJ_palindrome", "cutV_genomic_CDR3_segs", "and", "cutJ_genomic_CDR3_segs", ".", "Parameters", "--...
train
https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L401-L428
zsethna/OLGA
olga/load_model.py
GenomicDataVJ.read_igor_VJ_palindrome_parameters
def read_igor_VJ_palindrome_parameters(self, params_file_name): """Read V and J palindrome parameters from file. Sets the attributes max_delV_palindrome and max_delJ_palindrome. Parameters ---------- params_file_name : str File name for an IGoR parameter...
python
def read_igor_VJ_palindrome_parameters(self, params_file_name): """Read V and J palindrome parameters from file. Sets the attributes max_delV_palindrome and max_delJ_palindrome. Parameters ---------- params_file_name : str File name for an IGoR parameter...
[ "def", "read_igor_VJ_palindrome_parameters", "(", "self", ",", "params_file_name", ")", ":", "params_file", "=", "open", "(", "params_file_name", ",", "'r'", ")", "in_delV", "=", "False", "in_delJ", "=", "False", "for", "line", "in", "params_file", ":", "if", ...
Read V and J palindrome parameters from file. Sets the attributes max_delV_palindrome and max_delJ_palindrome. Parameters ---------- params_file_name : str File name for an IGoR parameter file of a VJ generative model.
[ "Read", "V", "and", "J", "palindrome", "parameters", "from", "file", ".", "Sets", "the", "attributes", "max_delV_palindrome", "and", "max_delJ_palindrome", ".", "Parameters", "----------", "params_file_name", ":", "str", "File", "name", "for", "an", "IGoR", "param...
train
https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L431-L464
zsethna/OLGA
olga/load_model.py
GenerativeModelVDJ.load_and_process_igor_model
def load_and_process_igor_model(self, marginals_file_name): """Set attributes by reading a generative model from IGoR marginal file. Sets attributes PV, PdelV_given_V, PDJ, PdelJ_given_J, PdelDldelDr_given_D, PinsVD, PinsDJ, Rvd, and Rdj. Parameters ---------- ...
python
def load_and_process_igor_model(self, marginals_file_name): """Set attributes by reading a generative model from IGoR marginal file. Sets attributes PV, PdelV_given_V, PDJ, PdelJ_given_J, PdelDldelDr_given_D, PinsVD, PinsDJ, Rvd, and Rdj. Parameters ---------- ...
[ "def", "load_and_process_igor_model", "(", "self", ",", "marginals_file_name", ")", ":", "raw_model", "=", "read_igor_marginals_txt", "(", "marginals_file_name", ")", "self", ".", "PV", "=", "raw_model", "[", "0", "]", "[", "'v_choice'", "]", "self", ".", "PinsV...
Set attributes by reading a generative model from IGoR marginal file. Sets attributes PV, PdelV_given_V, PDJ, PdelJ_given_J, PdelDldelDr_given_D, PinsVD, PinsDJ, Rvd, and Rdj. Parameters ---------- marginals_file_name : str File name for a IGoR mode...
[ "Set", "attributes", "by", "reading", "a", "generative", "model", "from", "IGoR", "marginal", "file", ".", "Sets", "attributes", "PV", "PdelV_given_V", "PDJ", "PdelJ_given_J", "PdelDldelDr_given_D", "PinsVD", "PinsDJ", "Rvd", "and", "Rdj", ".", "Parameters", "----...
train
https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L681-L731
zsethna/OLGA
olga/load_model.py
GenerativeModelVJ.load_and_process_igor_model
def load_and_process_igor_model(self, marginals_file_name): """Set attributes by reading a generative model from IGoR marginal file. Sets attributes PVJ, PdelV_given_V, PdelJ_given_J, PinsVJ, and Rvj. Parameters ---------- marginals_file_name : str F...
python
def load_and_process_igor_model(self, marginals_file_name): """Set attributes by reading a generative model from IGoR marginal file. Sets attributes PVJ, PdelV_given_V, PdelJ_given_J, PinsVJ, and Rvj. Parameters ---------- marginals_file_name : str F...
[ "def", "load_and_process_igor_model", "(", "self", ",", "marginals_file_name", ")", ":", "raw_model", "=", "read_igor_marginals_txt", "(", "marginals_file_name", ")", "self", ".", "PinsVJ", "=", "raw_model", "[", "0", "]", "[", "'vj_ins'", "]", "self", ".", "Pde...
Set attributes by reading a generative model from IGoR marginal file. Sets attributes PVJ, PdelV_given_V, PdelJ_given_J, PinsVJ, and Rvj. Parameters ---------- marginals_file_name : str File name for a IGoR model marginals file.
[ "Set", "attributes", "by", "reading", "a", "generative", "model", "from", "IGoR", "marginal", "file", ".", "Sets", "attributes", "PVJ", "PdelV_given_V", "PdelJ_given_J", "PinsVJ", "and", "Rvj", ".", "Parameters", "----------", "marginals_file_name", ":", "str", "F...
train
https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L768-L787
crackinglandia/pype32
pype32/directories.py
ImageBoundForwarderRefEntry.parse
def parse(readDataInstance): """ Returns a new L{ImageBoundForwarderRefEntry} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with the corresponding data to generate a new L{ImageBoundForwarderRefEntry} object. @rtype: L...
python
def parse(readDataInstance): """ Returns a new L{ImageBoundForwarderRefEntry} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with the corresponding data to generate a new L{ImageBoundForwarderRefEntry} object. @rtype: L...
[ "def", "parse", "(", "readDataInstance", ")", ":", "boundForwarderEntry", "=", "ImageBoundForwarderRefEntry", "(", ")", "boundForwarderEntry", ".", "timeDateStamp", ".", "value", "=", "readDataInstance", ".", "readDword", "(", ")", "boundForwarderEntry", ".", "offsetM...
Returns a new L{ImageBoundForwarderRefEntry} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with the corresponding data to generate a new L{ImageBoundForwarderRefEntry} object. @rtype: L{ImageBoundForwarderRefEntry} @return: A ...
[ "Returns", "a", "new", "L", "{", "ImageBoundForwarderRefEntry", "}", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L75-L89
crackinglandia/pype32
pype32/directories.py
ImageBoundForwarderRef.parse
def parse(readDataInstance, numberOfEntries): """ Returns a L{ImageBoundForwarderRef} array where every element is a L{ImageBoundForwarderRefEntry} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with the corresponding data to generate ...
python
def parse(readDataInstance, numberOfEntries): """ Returns a L{ImageBoundForwarderRef} array where every element is a L{ImageBoundForwarderRefEntry} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with the corresponding data to generate ...
[ "def", "parse", "(", "readDataInstance", ",", "numberOfEntries", ")", ":", "imageBoundForwarderRefsList", "=", "ImageBoundForwarderRef", "(", ")", "dLength", "=", "len", "(", "readDataInstance", ")", "entryLength", "=", "ImageBoundForwarderRefEntry", "(", ")", ".", ...
Returns a L{ImageBoundForwarderRef} array where every element is a L{ImageBoundForwarderRefEntry} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object with the corresponding data to generate a new L{ImageBoundForwarderRef} object. @type numb...
[ "Returns", "a", "L", "{", "ImageBoundForwarderRef", "}", "array", "where", "every", "element", "is", "a", "L", "{", "ImageBoundForwarderRefEntry", "}", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L107-L135
crackinglandia/pype32
pype32/directories.py
ImageBoundImportDescriptor.parse
def parse(readDataInstance): """ Returns a new L{ImageBoundImportDescriptor} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object containing the data to create a new L{ImageBoundImportDescriptor} object. @rtype: L{ImageBoundI...
python
def parse(readDataInstance): """ Returns a new L{ImageBoundImportDescriptor} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object containing the data to create a new L{ImageBoundImportDescriptor} object. @rtype: L{ImageBoundI...
[ "def", "parse", "(", "readDataInstance", ")", ":", "ibd", "=", "ImageBoundImportDescriptor", "(", ")", "entryData", "=", "readDataInstance", ".", "read", "(", "consts", ".", "SIZEOF_IMAGE_BOUND_IMPORT_ENTRY32", ")", "readDataInstance", ".", "offset", "=", "0", "wh...
Returns a new L{ImageBoundImportDescriptor} object. @type readDataInstance: L{ReadData} @param readDataInstance: A L{ReadData} object containing the data to create a new L{ImageBoundImportDescriptor} object. @rtype: L{ImageBoundImportDescriptor} @return: A new {ImageBou...
[ "Returns", "a", "new", "L", "{", "ImageBoundImportDescriptor", "}", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L153-L182
crackinglandia/pype32
pype32/directories.py
ImageBoundImportDescriptorEntry.parse
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...
python
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", ")", ":", "boundEntry", "=", "ImageBoundImportDescriptorEntry", "(", ")", "boundEntry", ".", "timeDateStamp", ".", "value", "=", "readDataInstance", ".", "readDword", "(", ")", "boundEntry", ".", "offsetModuleName", ".", "v...
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...
[ "Returns", "a", "new", "L", "{", "ImageBoundImportDescriptorEntry", "}", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L215-L236
crackinglandia/pype32
pype32/directories.py
TLSDirectory.parse
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...
python
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", ")", ":", "tlsDir", "=", "TLSDirectory", "(", ")", "tlsDir", ".", "startAddressOfRawData", ".", "value", "=", "readDataInstance", ".", "readDword", "(", ")", "tlsDir", ".", "endAddressOfRawData", ".", "value", "=", "rea...
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.
[ "Returns", "a", "new", "L", "{", "TLSDirectory", "}", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L266-L284
crackinglandia/pype32
pype32/directories.py
TLSDirectory64.parse
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 ...
python
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", ")", ":", "tlsDir", "=", "TLSDirectory64", "(", ")", "tlsDir", ".", "startAddressOfRawData", ".", "value", "=", "readDataInstance", ".", "readQword", "(", ")", "tlsDir", ".", "endAddressOfRawData", ".", "value", "=", "r...
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.
[ "Returns", "a", "new", "L", "{", "TLSDirectory64", "}", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L312-L330
crackinglandia/pype32
pype32/directories.py
ImageLoadConfigDirectory64.parse
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...
python
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", ")", ":", "configDir", "=", "ImageLoadConfigDirectory64", "(", ")", "configDir", ".", "size", ".", "value", "=", "readDataInstance", ".", "readDword", "(", ")", "configDir", ".", "timeDateStamp", ".", "value", "=", "rea...
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...
[ "Returns", "a", "new", "L", "{", "ImageLoadConfigDirectory64", "}", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L473-L512
crackinglandia/pype32
pype32/directories.py
ImageBaseRelocationEntry.parse
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} ...
python
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", ")", ":", "reloc", "=", "ImageBaseRelocationEntry", "(", ")", "reloc", ".", "virtualAddress", ".", "value", "=", "readDataInstance", ".", "readDword", "(", ")", "reloc", ".", "sizeOfBlock", ".", "value", "=", "readDataI...
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}...
[ "Returns", "a", "new", "L", "{", "ImageBaseRelocationEntry", "}", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L537-L552
crackinglandia/pype32
pype32/directories.py
ImageDebugDirectory.parse
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} ...
python
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", ")", ":", "dbgDir", "=", "ImageDebugDirectory", "(", ")", "dbgDir", ".", "characteristics", ".", "value", "=", "readDataInstance", ".", "readDword", "(", ")", "dbgDir", ".", "timeDateStamp", ".", "value", "=", "readData...
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.
[ "Returns", "a", "new", "L", "{", "ImageDebugDirectory", "}", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L587-L608
crackinglandia/pype32
pype32/directories.py
ImageDebugDirectories.parse
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...
python
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", ")", ":", "dbgEntries", "=", "ImageDebugDirectories", "(", ")", "dataLength", "=", "len", "(", "readDataInstance", ")", "toRead", "=", "nDebugEntries", "*", "consts", ".", "SIZEOF_IMAGE_DEBUG_ENTRY32", ...
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} ...
[ "Returns", "a", "new", "L", "{", "ImageDebugDirectories", "}", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L629-L655
crackinglandia/pype32
pype32/directories.py
ImageImportDescriptorEntry.parse
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...
python
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", ")", ":", "iid", "=", "ImageImportDescriptorEntry", "(", ")", "iid", ".", "originalFirstThunk", ".", "value", "=", "readDataInstance", ".", "readDword", "(", ")", "iid", ".", "timeDateStamp", ".", "value", "=", "readDat...
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...
[ "Returns", "a", "new", "L", "{", "ImageImportDescriptorEntry", "}", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L702-L718
crackinglandia/pype32
pype32/directories.py
ImageImportDescriptor.parse
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 ...
python
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", ")", ":", "importEntries", "=", "ImageImportDescriptor", "(", ")", "dataLength", "=", "len", "(", "readDataInstance", ")", "toRead", "=", "nEntries", "*", "consts", ".", "SIZEOF_IMAGE_IMPORT_ENTRY32", "if",...
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}...
[ "Returns", "a", "new", "L", "{", "ImageImportDescriptor", "}", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L743-L769
crackinglandia/pype32
pype32/directories.py
ExportTableEntry.parse
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...
python
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", ")", ":", "exportEntry", "=", "ExportTableEntry", "(", ")", "exportEntry", ".", "functionRva", ".", "value", "=", "readDataInstance", ".", "readDword", "(", ")", "exportEntry", ".", "nameOrdinal", ".", "value", "=", "re...
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.
[ "Returns", "a", "new", "L", "{", "ExportTableEntry", "}", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L850-L866
crackinglandia/pype32
pype32/directories.py
ImageExportTable.parse
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...
python
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", ")", ":", "et", "=", "ImageExportTable", "(", ")", "et", ".", "characteristics", ".", "value", "=", "readDataInstance", ".", "readDword", "(", ")", "et", ".", "timeDateStamp", ".", "value", "=", "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 new L{ImageExportTable} object.
[ "Returns", "a", "new", "L", "{", "ImageExportTable", "}", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L902-L925
crackinglandia/pype32
pype32/directories.py
NETDirectory.parse
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...
python
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", ")", ":", "nd", "=", "NETDirectory", "(", ")", "nd", ".", "directory", "=", "NetDirectory", ".", "parse", "(", "readDataInstance", ")", "nd", ".", "netMetaDataHeader", "=", "NetMetaDataHeader", ".", "parse", "(", "rea...
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.
[ "Returns", "a", "new", "L", "{", "NETDirectory", "}", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L945-L960
crackinglandia/pype32
pype32/directories.py
NetDirectory.parse
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...
python
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", ")", ":", "nd", "=", "NetDirectory", "(", ")", "nd", ".", "cb", ".", "value", "=", "readDataInstance", ".", "readDword", "(", ")", "nd", ".", "majorRuntimeVersion", ".", "value", "=", "readDataInstance", ".", "readW...
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.
[ "Returns", "a", "new", "L", "{", "NetDirectory", "}", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L1001-L1048
crackinglandia/pype32
pype32/directories.py
NetMetaDataHeader.parse
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...
python
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", ")", ":", "nmh", "=", "NetMetaDataHeader", "(", ")", "nmh", ".", "signature", ".", "value", "=", "readDataInstance", ".", "readDword", "(", ")", "nmh", ".", "majorVersion", ".", "value", "=", "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 new L{NetMetaDataHeader} object.
[ "Returns", "a", "new", "L", "{", "NetMetaDataHeader", "}", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L1071-L1091
crackinglandia/pype32
pype32/directories.py
NetMetaDataStreamEntry.parse
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...
python
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", ")", ":", "n", "=", "NetMetaDataStreamEntry", "(", ")", "n", ".", "offset", ".", "value", "=", "readDataInstance", ".", "readDword", "(", ")", "n", ".", "size", ".", "value", "=", "readDataInstance", ".", "readDword...
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.
[ "Returns", "a", "new", "L", "{", "NetMetaDataStreamEntry", "}", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L1113-L1127
crackinglandia/pype32
pype32/directories.py
NetMetaDataStreams.parse
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...
python
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", ")", ":", "streams", "=", "NetMetaDataStreams", "(", ")", "for", "i", "in", "range", "(", "nStreams", ")", ":", "streamEntry", "=", "NetMetaDataStreamEntry", "(", ")", "streamEntry", ".", "offset", "....
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...
[ "Returns", "a", "new", "L", "{", "NetMetaDataStreams", "}", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L1148-L1173
crackinglandia/pype32
pype32/directories.py
NetMetaDataTableHeader.parse
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} ...
python
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", ")", ":", "th", "=", "NetMetaDataTableHeader", "(", ")", "th", ".", "reserved_1", ".", "value", "=", "readDataInstance", ".", "readDword", "(", ")", "th", ".", "majorVersion", ".", "value", "=", "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} @return: A new L{NetMetaDataTableHeader} obj...
[ "Returns", "a", "new", "L", "{", "NetMetaDataTableHeader", "}", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L1195-L1215
crackinglandia/pype32
pype32/directories.py
NetMetaDataTables.parse
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...
python
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", ")", ":", "dt", "=", "NetMetaDataTables", "(", ")", "dt", ".", "netMetaDataTableHeader", "=", "NetMetaDataTableHeader", ".", "parse", "(", "readDataInstance", ")", "dt", ".", "tables", "=", "{",...
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.
[ "Returns", "a", "new", "L", "{", "NetMetaDataTables", "}", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L1237-L1273
crackinglandia/pype32
pype32/directories.py
NetResources.parse
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. ...
python
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", ")", ":", "r", "=", "NetResources", "(", ")", "r", ".", "signature", "=", "readDataInstance", ".", "readDword", "(", ")", "if", "r", ".", "signature", "!=", "0xbeefcace", ":", "return", "r", "r", ".", "readerCount...
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", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L1312-L1366
blockcypher/bcwallet
bcwallet/bc_utils.py
verify_and_fill_address_paths_from_bip32key
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=...
python
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", ")", ":", "assert", "network", ",", "network", "wallet_obj", "=", "Wallet", ".", "deserialize", "(", "master_key", ",", "network", "=", "network", ")", "...
Take address paths and verifies their accuracy client-side. Also fills in all the available metadata (WIF, public key, etc)
[ "Take", "address", "paths", "and", "verifies", "their", "accuracy", "client", "-", "side", "." ]
train
https://github.com/blockcypher/bcwallet/blob/4c623a8e19705332c9398c3fea9d5dc3c1dafb9b/bcwallet/bc_utils.py#L33-L84
tansey/gfl
pygfl/density.py
GraphFusedDensity.solution_path
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...
python
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", ")", ":", "lambda_grid", "=", "np", ".", "exp", "(", "np", ".", "linspace", "(", "np", ".", "log", "(", "self", ".", "max_lambda", ")", ",", "np", ".", "log", "(", "self", ".", "min_lambda", ")", ",", "self", ...
Follows the solution path of the generalized lasso to find the best lambda value.
[ "Follows", "the", "solution", "path", "of", "the", "generalized", "lasso", "to", "find", "the", "best", "lambda", "value", "." ]
train
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/density.py#L123-L240
tansey/gfl
pygfl/density.py
GraphFusedDensity.run
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 ...
python
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", ")", ":", "if", "initial_values", "is", "not", "None", ":", "if", "self", ".", "k", "==", "0", "and", "self", ".", "trails", "is", "not", "None", ":", "betas", ",", "zs", ...
Run the graph-fused logit lasso with a fixed lambda penalty.
[ "Run", "the", "graph", "-", "fused", "logit", "lasso", "with", "a", "fixed", "lambda", "penalty", "." ]
train
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/density.py#L343-L391
tansey/gfl
pygfl/density.py
GraphFusedDensity.data_log_likelihood
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()
python
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", ")", ":", "return", "binom", ".", "logpmf", "(", "successes", ",", "trials", ",", "1.0", "/", "(", "1", "+", "np", ".", "exp", "(", "-", "beta", ")", ")", ")",...
Calculates the log-likelihood of a Polya tree bin given the beta values.
[ "Calculates", "the", "log", "-", "likelihood", "of", "a", "Polya", "tree", "bin", "given", "the", "beta", "values", "." ]
train
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/density.py#L393-L395
Blazemeter/apiritif
apiritif/loadgen.py
spawn_worker
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...
python
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", ")", ":", "setup_logging", "(", "params", ")", "log", ".", "info", "(", "\"Adding worker: idx=%s\\tconcurrency=%s\\tresults=%s\"", ",", "params", ".", "worker_index", ",", "params", ".", "concurrency", ",", "params", ".", "rep...
This method has to be module level function :type params: Params
[ "This", "method", "has", "to", "be", "module", "level", "function" ]
train
https://github.com/Blazemeter/apiritif/blob/27b48a68425949998c2254e5e1e0226882d9eee8/apiritif/loadgen.py#L48-L59
Blazemeter/apiritif
apiritif/loadgen.py
Worker.run_nose
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...
python
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", ")", ":", "thread", ".", "set_index", "(", "params", ".", "thread_index", ")", "log", ".", "debug", "(", "\"[%s] Starting nose iterations: %s\"", ",", "params", ".", "worker_index", ",", "params", ")", "assert", ...
:type params: Params
[ ":", "type", "params", ":", "Params" ]
train
https://github.com/Blazemeter/apiritif/blob/27b48a68425949998c2254e5e1e0226882d9eee8/apiritif/loadgen.py#L161-L209
Blazemeter/apiritif
apiritif/loadgen.py
JTLSampleWriter._write_single_sample
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") ...
python
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", ")", ":", "bytes", "=", "sample", ".", "extras", ".", "get", "(", "\"responseHeadersSize\"", ",", "0", ")", "+", "2", "+", "sample", ".", "extras", ".", "get", "(", "\"responseBodySize\"", ",", "...
:type sample: Sample
[ ":", "type", "sample", ":", "Sample" ]
train
https://github.com/Blazemeter/apiritif/blob/27b48a68425949998c2254e5e1e0226882d9eee8/apiritif/loadgen.py#L346-L376
Blazemeter/apiritif
apiritif/loadgen.py
ApiritifPlugin.addError
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...
python
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", ")", ":", "# 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...
when a test raises an uncaught exception :param test: :param error: :return:
[ "when", "a", "test", "raises", "an", "uncaught", "exception", ":", "param", "test", ":", ":", "param", "error", ":", ":", "return", ":" ]
train
https://github.com/Blazemeter/apiritif/blob/27b48a68425949998c2254e5e1e0226882d9eee8/apiritif/loadgen.py#L490-L504
crackinglandia/pype32
pype32/datadirs.py
Directory.parse
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() ...
python
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", ")", ":", "d", "=", "Directory", "(", ")", "d", ".", "rva", ".", "value", "=", "readDataInstance", ".", "readDword", "(", ")", "d", ".", "size", ".", "value", "=", "readDataInstance", ".", "readDword", "(", ")",...
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.
[ "Returns", "a", "L", "{", "Directory", "}", "-", "like", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/datadirs.py#L79-L92
crackinglandia/pype32
pype32/datadirs.py
DataDirectory.parse
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...
python
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", ")", ":", "if", "len", "(", "readDataInstance", ")", "==", "consts", ".", "IMAGE_NUMBEROF_DIRECTORY_ENTRIES", "*", "8", ":", "newDataDirectory", "=", "DataDirectory", "(", ")", "for", "i", "in", "range", "(", "consts", ...
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...
[ "Returns", "a", "L", "{", "DataDirectory", "}", "-", "like", "object", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/datadirs.py#L121-L140
zsethna/OLGA
olga/compute_pgen.py
main
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('...
python
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", "(", ")", ":", "parser", "=", "OptionParser", "(", "conflict_handler", "=", "\"resolve\"", ")", "parser", ".", "add_option", "(", "'--humanTRA'", ",", "'--human_T_alpha'", ",", "action", "=", "'store_true'", ",", "dest", "=", "'humanTRA'", ",", ...
Compute Pgens from a file and output to another file.
[ "Compute", "Pgens", "from", "a", "file", "and", "output", "to", "another", "file", "." ]
train
https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/compute_pgen.py#L270-L780
tansey/gfl
pygfl/utils.py
create_plateaus
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 ...
python
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", ")", ":", "nodes", "=", "set", "(", "edges", ".", "keys", "(", ")", ")", "if", "plateaus", "is", "None", ":", "plateaus", "=", ...
Creates plateaus of constant value in the data.
[ "Creates", "plateaus", "of", "constant", "value", "in", "the", "data", "." ]
train
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/utils.py#L29-L50
tansey/gfl
pygfl/utils.py
pretty_str
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('...
python
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", ")", ":", "if", "len", "(", "p", ".", "shape", ")", "==", "1", ":", "return", "vector_str", "(", "p", ",", "decimal_pl...
Pretty-print a matrix or vector.
[ "Pretty", "-", "print", "a", "matrix", "or", "vector", "." ]
train
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/utils.py#L148-L154
tansey/gfl
pygfl/utils.py
matrix_str
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)]))
python
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", ")", ":", "return", "'[{0}]'", ".", "format", "(", "\"\\n \"", ".", "join", "(", "[", "(", "str", "(", "i", ")", "if"...
Pretty-print the matrix.
[ "Pretty", "-", "print", "the", "matrix", "." ]
train
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/utils.py#L156-L158
tansey/gfl
pygfl/utils.py
vector_str
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]))
python
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", ")", ":", "style", "=", "'{0:.'", "+", "str", "(", "decimal_places", ")", "+", "'f}'", "return", "'[{0}]'", ".", "format", "(", "\", \"", ".", "join", "(", ...
Pretty-print the vector values.
[ "Pretty", "-", "print", "the", "vector", "values", "." ]
train
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/utils.py#L160-L163
tansey/gfl
pygfl/utils.py
calc_plateaus
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...
python
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", ")", ":", "if", "not", "isinstance", "(", "edges", ",", "dict", ")", ":", "raise", "Exception", "(", "'Edges must be a map from each node to a list of nei...
Calculate the plateaus (degrees of freedom) of a graph of beta values in linear time.
[ "Calculate", "the", "plateaus", "(", "degrees", "of", "freedom", ")", "of", "a", "graph", "of", "beta", "values", "in", "linear", "time", "." ]
train
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/utils.py#L176-L243
tansey/gfl
pygfl/utils.py
nearly_unique
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
python
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", ")", ":", "results", "=", "np", ".", "array", "(", "[", "arr", "[", "0", "]", "]", ")", "for", "x", "in", "arr", ":", "if", "np", ".", "abs", "(", "res...
Heuristic method to return the uniques within some precision in a numpy array
[ "Heuristic", "method", "to", "return", "the", "uniques", "within", "some", "precision", "in", "a", "numpy", "array" ]
train
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/utils.py#L245-L251
tansey/gfl
pygfl/utils.py
hypercube_edges
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]...
python
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", ")", ":", "edges", "=", "[", "]", "nodes", "=", "np", ".", "arange", "(", "np", ".", "product", "(", "dims", ")", ")", ".", "reshape", "(", "dims", ")", "for", "i", ",", "d", ...
Create edge lists for an arbitrary hypercube. TODO: this is probably not the fastest way.
[ "Create", "edge", "lists", "for", "an", "arbitrary", "hypercube", ".", "TODO", ":", "this", "is", "probably", "not", "the", "fastest", "way", "." ]
train
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/utils.py#L299-L309
tansey/gfl
pygfl/utils.py
get_delta
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) ...
python
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", ")", ":", "if", "k", "<", "0", ":", "raise", "Exception", "(", "'k must be at least 0th order.'", ")", "result", "=", "D", "for", "i", "in", "range", "(", "k", ")", ":", "result", "=", "D", ".", "T", ".", "...
Calculate the k-th order trend filtering matrix given the oriented edge incidence matrix and the value of k.
[ "Calculate", "the", "k", "-", "th", "order", "trend", "filtering", "matrix", "given", "the", "oriented", "edge", "incidence", "matrix", "and", "the", "value", "of", "k", "." ]
train
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/utils.py#L390-L398
tansey/gfl
pygfl/utils.py
decompose_delta
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...
python
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", ")", ":", "if", "not", "isspmatrix_coo", "(", "deltak", ")", ":", "deltak", "=", "coo_matrix", "(", "deltak", ")", "dk_rows", "=", "deltak", ".", "shape", "[", "0", "]", "dk_rowbreaks", "=", "np", ".", "cumsum", ...
Decomposes the k-th order trend filtering matrix into a c-compatible set of arrays.
[ "Decomposes", "the", "k", "-", "th", "order", "trend", "filtering", "matrix", "into", "a", "c", "-", "compatible", "set", "of", "arrays", "." ]
train
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/utils.py#L400-L409
tansey/gfl
pygfl/utils.py
matrix_from_edges
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...
python
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", ")", ":", "max_col", "=", "0", "cols", "=", "[", "]", "rows", "=", "[", "]", "vals", "=", "[", "]", "if", "type", "(", "edges", ")", "is", "defaultdict", ":", "edge_list", "=", "[", "]", "for", "i", ",", ...
Returns a sparse penalty matrix (D) from a list of edge pairs. Each edge can have an optional weight associated with it.
[ "Returns", "a", "sparse", "penalty", "matrix", "(", "D", ")", "from", "a", "list", "of", "edge", "pairs", ".", "Each", "edge", "can", "have", "an", "optional", "weight", "associated", "with", "it", "." ]
train
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/utils.py#L411-L436
tansey/gfl
pygfl/utils.py
ks_distance
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)
python
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", ")", ":", "if", "len", "(", "a", ".", "shape", ")", "==", "1", ":", "return", "np", ".", "max", "(", "np", ".", "abs", "(", "a", ".", "cumsum", "(", ")", "-", "b", ".", "cumsum", "(", ")", ")", ")...
Get the Kolmogorov-Smirnov (KS) distance between two densities a and b.
[ "Get", "the", "Kolmogorov", "-", "Smirnov", "(", "KS", ")", "distance", "between", "two", "densities", "a", "and", "b", "." ]
train
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/utils.py#L438-L442
tansey/gfl
pygfl/utils.py
tv_distance
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)
python
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", ")", ":", "if", "len", "(", "a", ".", "shape", ")", "==", "1", ":", "return", "np", ".", "sum", "(", "np", ".", "abs", "(", "a", "-", "b", ")", ")", "return", "np", ".", "sum", "(", "np", ".", "ab...
Get the Total Variation (TV) distance between two densities a and b.
[ "Get", "the", "Total", "Variation", "(", "TV", ")", "distance", "between", "two", "densities", "a", "and", "b", "." ]
train
https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/utils.py#L444-L448
doanguyen/lasotuvi
lasotuvi/Lich_HND.py
jdFromDate
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) ...
python
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", ")", ":", "a", "=", "int", "(", "(", "14", "-", "mm", ")", "/", "12.", ")", "y", "=", "yy", "+", "4800", "-", "a", "m", "=", "mm", "+", "12", "*", "a", "-", "3", "jd", "=", "dd", "...
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.
[ "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", "/", ...
train
https://github.com/doanguyen/lasotuvi/blob/98383a3056f0a0633d6937d364c37eb788661c0d/lasotuvi/Lich_HND.py#L10-L23
doanguyen/lasotuvi
lasotuvi/Lich_HND.py
jdToDate
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: ...
python
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", ")", ":", "if", "(", "jd", ">", "2299160", ")", ":", "# After 5/10/1582, Gregorian calendar", "a", "=", "jd", "+", "32044", "b", "=", "int", "(", "(", "4", "*", "a", "+", "3", ")", "/", "146097.", ")", "c", "=", "a",...
def jdToDate(jd): Convert a Julian day number to day/month/year. jd is an integer.
[ "def", "jdToDate", "(", "jd", ")", ":", "Convert", "a", "Julian", "day", "number", "to", "day", "/", "month", "/", "year", ".", "jd", "is", "an", "integer", "." ]
train
https://github.com/doanguyen/lasotuvi/blob/98383a3056f0a0633d6937d364c37eb788661c0d/lasotuvi/Lich_HND.py#L26-L43
doanguyen/lasotuvi
lasotuvi/Lich_HND.py
NewMoon
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 ...
python
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", ")", ":", "# 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", "+", ...
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.
[ "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", "...
train
https://github.com/doanguyen/lasotuvi/blob/98383a3056f0a0633d6937d364c37eb788661c0d/lasotuvi/Lich_HND.py#L46-L90
doanguyen/lasotuvi
lasotuvi/Lich_HND.py
SunLongitude
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 /...
python
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", ")", ":", "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"...
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.
[ "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", ...
train
https://github.com/doanguyen/lasotuvi/blob/98383a3056f0a0633d6937d364c37eb788661c0d/lasotuvi/Lich_HND.py#L93-L115
doanguyen/lasotuvi
lasotuvi/Lich_HND.py
getLunarMonth11
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)...
python
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", ")", ":", "# off = jdFromDate(31, 12, yy) \\", "# - 2415021.076998695", "off", "=", "jdFromDate", "(", "31", ",", "12", ",", "yy", ")", "-", "2415021.", "k", "=", "int", "(", "off", "/", "29.5305...
def getLunarMonth11(yy, timeZone): Find the day that starts the luner month 11of the given year for the given time zone.
[ "def", "getLunarMonth11", "(", "yy", "timeZone", ")", ":", "Find", "the", "day", "that", "starts", "the", "luner", "month", "11of", "the", "given", "year", "for", "the", "given", "time", "zone", "." ]
train
https://github.com/doanguyen/lasotuvi/blob/98383a3056f0a0633d6937d364c37eb788661c0d/lasotuvi/Lich_HND.py#L153-L165
doanguyen/lasotuvi
lasotuvi/Lich_HND.py
getLeapMonthOffset
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(...
python
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", ")", ":", "k", "=", "int", "(", "(", "a11", "-", "2415021.076998695", ")", "/", "29.530588853", "+", "0.5", ")", "last", "=", "0", "i", "=", "1", "# start with month following lunar month 11", "arc", ...
def getLeapMonthOffset(a11, timeZone): Find the index of the leap month after the month starting on the day a11.
[ "def", "getLeapMonthOffset", "(", "a11", "timeZone", ")", ":", "Find", "the", "index", "of", "the", "leap", "month", "after", "the", "month", "starting", "on", "the", "day", "a11", "." ]
train
https://github.com/doanguyen/lasotuvi/blob/98383a3056f0a0633d6937d364c37eb788661c0d/lasotuvi/Lich_HND.py#L168-L184
doanguyen/lasotuvi
lasotuvi/Lich_HND.py
S2L
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...
python
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", ")", ":", "dayNumber", "=", "jdFromDate", "(", "dd", ",", "mm", ",", "yy", ")", "k", "=", "int", "(", "(", "dayNumber", "-", "2415021.076998695", ")", "/", "29.530588853", ...
def S2L(dd, mm, yy, timeZone = 7): Convert solar date dd/mm/yyyy to the corresponding lunar date.
[ "def", "S2L", "(", "dd", "mm", "yy", "timeZone", "=", "7", ")", ":", "Convert", "solar", "date", "dd", "/", "mm", "/", "yyyy", "to", "the", "corresponding", "lunar", "date", "." ]
train
https://github.com/doanguyen/lasotuvi/blob/98383a3056f0a0633d6937d364c37eb788661c0d/lasotuvi/Lich_HND.py#L187-L223
doanguyen/lasotuvi
lasotuvi/Lich_HND.py
L2S
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(...
python
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", ")", ":", "if", "(", "lunarM", "<", "11", ")", ":", "a11", "=", "getLunarMonth11", "(", "lunarY", "-", "1", ",", "tZ", ")", "b11", "=", "getLunarMon...
def L2S(lunarD, lunarM, lunarY, lunarLeap, tZ = 7): Convert a lunar date to the corresponding solar date.
[ "def", "L2S", "(", "lunarD", "lunarM", "lunarY", "lunarLeap", "tZ", "=", "7", ")", ":", "Convert", "a", "lunar", "date", "to", "the", "corresponding", "solar", "date", "." ]
train
https://github.com/doanguyen/lasotuvi/blob/98383a3056f0a0633d6937d364c37eb788661c0d/lasotuvi/Lich_HND.py#L226-L250
crackinglandia/pype32
pype32/pype32.py
PE.hasMZSignature
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...
python
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", ")", ":", "rd", ".", "setOffset", "(", "0", ")", "sign", "=", "rd", ".", "read", "(", "2", ")", "if", "sign", "==", "\"MZ\"", ":", "return", "True", "return", "False" ]
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.
[ "Check", "for", "MZ", "signature", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L134-L148
crackinglandia/pype32
pype32/pype32.py
PE.hasPESignature
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...
python
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", ")", ":", "rd", ".", "setOffset", "(", "0", ")", "e_lfanew_offset", "=", "unpack", "(", "\"<L\"", ",", "rd", ".", "readAt", "(", "0x3c", ",", "4", ")", ")", "[", "0", "]", "sign", "=", "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.
[ "Check", "for", "PE", "signature", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L150-L165
crackinglandia/pype32
pype32/pype32.py
PE.validate
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! :) ...
python
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", ")", ":", "# Ange Albertini (@angie4771) can kill me for this! :)", "if", "self", ".", "dosHeader", ".", "e_magic", ".", "value", "!=", "consts", ".", "MZ_SIGNATURE", ":", "raise", "excep", ".", "PEException", "(", "\"Invalid MZ signa...
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.
[ "Performs", "validations", "over", "some", "fields", "of", "the", "PE", "structure", "to", "determine", "if", "the", "loaded", "file", "has", "a", "valid", "PE", "format", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L167-L184
crackinglandia/pype32
pype32/pype32.py
PE.readFile
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()...
python
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", ")", ":", "fd", "=", "open", "(", "pathToFile", ",", "\"rb\"", ")", "data", "=", "fd", ".", "read", "(", ")", "fd", ".", "close", "(", ")", "return", "data" ]
Returns data from a file. @type pathToFile: str @param pathToFile: Path to the file. @rtype: str @return: The data from file.
[ "Returns", "data", "from", "a", "file", "." ]
train
https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/pype32.py#L186-L199