body stringlengths 26 98.2k | body_hash int64 -9,222,864,604,528,158,000 9,221,803,474B | docstring stringlengths 1 16.8k | path stringlengths 5 230 | name stringlengths 1 96 | repository_name stringlengths 7 89 | lang stringclasses 1
value | body_without_docstring stringlengths 20 98.2k |
|---|---|---|---|---|---|---|---|
def profiler_main():
'Manage a profiler daemon.'
parser = _common_args()
parser.add_argument('--action', required=True, choices=('start', 'stop', 'restart'))
(args, _) = parser.parse_known_args()
cfg = confpy.api.parse_options(files=(args.config,), env_prefix='PYPERF')
proc = cfg.daemon.process(... | 8,079,506,965,881,688,000 | Manage a profiler daemon. | pyperf/cmd/daemons.py | profiler_main | kevinconway/PyPerf | python | def profiler_main():
parser = _common_args()
parser.add_argument('--action', required=True, choices=('start', 'stop', 'restart'))
(args, _) = parser.parse_known_args()
cfg = confpy.api.parse_options(files=(args.config,), env_prefix='PYPERF')
proc = cfg.daemon.process(source_transport=cfg.transp... |
def send_request():
'Send a profile request to the daemon.'
parser = _common_args()
parser.add_argument('--identifier', required=True, help='The unique message identifier.')
parser.add_argument('--setup', default='pass', help='Any setup code if needed for the profile.')
parser.add_argument('--code',... | 305,964,982,401,217,100 | Send a profile request to the daemon. | pyperf/cmd/daemons.py | send_request | kevinconway/PyPerf | python | def send_request():
parser = _common_args()
parser.add_argument('--identifier', required=True, help='The unique message identifier.')
parser.add_argument('--setup', default='pass', help='Any setup code if needed for the profile.')
parser.add_argument('--code', required=True, help='The code to profi... |
def fetch_result():
'Fetch a result from the transport.'
parser = _common_args()
(args, _) = parser.parse_known_args()
cfg = confpy.api.parse_options(files=(args.config,), env_prefix='PYPERF')
transport = cfg.transport.result()
msg = transport.fetch()
if (msg is not None):
transport.... | -8,180,299,108,872,845,000 | Fetch a result from the transport. | pyperf/cmd/daemons.py | fetch_result | kevinconway/PyPerf | python | def fetch_result():
parser = _common_args()
(args, _) = parser.parse_known_args()
cfg = confpy.api.parse_options(files=(args.config,), env_prefix='PYPERF')
transport = cfg.transport.result()
msg = transport.fetch()
if (msg is not None):
transport.complete(msg)
pprint.pprint(... |
def fetch_error():
'Fetch an error from the transport.'
parser = _common_args()
(args, _) = parser.parse_known_args()
cfg = confpy.api.parse_options(files=(args.config,), env_prefix='PYPERF')
transport = cfg.transport.error()
msg = transport.fetch()
if (msg is not None):
transport.co... | -6,559,388,247,714,032,000 | Fetch an error from the transport. | pyperf/cmd/daemons.py | fetch_error | kevinconway/PyPerf | python | def fetch_error():
parser = _common_args()
(args, _) = parser.parse_known_args()
cfg = confpy.api.parse_options(files=(args.config,), env_prefix='PYPERF')
transport = cfg.transport.error()
msg = transport.fetch()
if (msg is not None):
transport.complete(msg)
pprint.pprint(ms... |
def main():
'\n Calls the TEST functions in this module, but ONLY if the method\n to be tested has at least a partial implementation. That is,\n a TEST function will not be called until you begin work\n on the code that it is testing.\n '
if m1t.is_implemented('__init__'):
run_tes... | 5,256,363,472,586,403,000 | Calls the TEST functions in this module, but ONLY if the method
to be tested has at least a partial implementation. That is,
a TEST function will not be called until you begin work
on the code that it is testing. | src/m1_Line.py | main | jarskijr/10-MoreImplementingClasses | python | def main():
'\n Calls the TEST functions in this module, but ONLY if the method\n to be tested has at least a partial implementation. That is,\n a TEST function will not be called until you begin work\n on the code that it is testing.\n '
if m1t.is_implemented('__init__'):
run_tes... |
def run_test_init():
' Tests the __init__ method of the Line class. '
m1t.run_test_init()
p1 = Point(30, 17)
p2 = Point(50, 80)
line = Line(p1, p2)
print(line.start)
print(line.end)
print((line.start == p1))
print((line.start is p1))
print('The above should print:')
print... | -6,119,020,046,497,032,000 | Tests the __init__ method of the Line class. | src/m1_Line.py | run_test_init | jarskijr/10-MoreImplementingClasses | python | def run_test_init():
' '
m1t.run_test_init()
p1 = Point(30, 17)
p2 = Point(50, 80)
line = Line(p1, p2)
print(line.start)
print(line.end)
print((line.start == p1))
print((line.start is p1))
print('The above should print:')
print(' Point(30, 17)')
print(' Point(50, 80)')... |
def run_test_clone():
' Tests the clone method of the Line class. '
m1t.run_test_clone()
p1 = Point(30, 17)
p2 = Point(50, 80)
line1 = Line(p1, p2)
line2 = line1.clone()
print(line1)
print(line2)
print((line1 == line2))
print((line1 is line2))
print((line1.start is line2.... | 1,896,268,899,303,365,400 | Tests the clone method of the Line class. | src/m1_Line.py | run_test_clone | jarskijr/10-MoreImplementingClasses | python | def run_test_clone():
' '
m1t.run_test_clone()
p1 = Point(30, 17)
p2 = Point(50, 80)
line1 = Line(p1, p2)
line2 = line1.clone()
print(line1)
print(line2)
print((line1 == line2))
print((line1 is line2))
print((line1.start is line2.start))
print((line1.end is line2.end))
... |
def run_test_reverse():
' Tests the reverse method of the Line class. '
m1t.run_test_reverse()
p1 = Point(30, 17)
p2 = Point(50, 80)
line1 = Line(p1, p2)
line2 = line1.clone()
print(line1)
line1.reverse()
print(line1)
print((line1 == line2))
line1.reverse()
print((lin... | 6,098,073,931,951,551,000 | Tests the reverse method of the Line class. | src/m1_Line.py | run_test_reverse | jarskijr/10-MoreImplementingClasses | python | def run_test_reverse():
' '
m1t.run_test_reverse()
p1 = Point(30, 17)
p2 = Point(50, 80)
line1 = Line(p1, p2)
line2 = line1.clone()
print(line1)
line1.reverse()
print(line1)
print((line1 == line2))
line1.reverse()
print((line1 == line2))
print('The above should print... |
def run_test_slope():
' Tests the slope method of the Line class. '
m1t.run_test_slope()
p1 = Point(30, 3)
p2 = Point(50, 8)
line1 = Line(p1, p2)
print(line1.slope())
line2 = Line(Point(10, 10), Point(10, 5))
print(line2.slope())
print((line2.slope() == 'inf'))
print('The abo... | -4,538,909,826,125,890,600 | Tests the slope method of the Line class. | src/m1_Line.py | run_test_slope | jarskijr/10-MoreImplementingClasses | python | def run_test_slope():
' '
m1t.run_test_slope()
p1 = Point(30, 3)
p2 = Point(50, 8)
line1 = Line(p1, p2)
print(line1.slope())
line2 = Line(Point(10, 10), Point(10, 5))
print(line2.slope())
print((line2.slope() == 'inf'))
print('The above should print:')
print(' 0.25 (approxi... |
def run_test_length():
' Tests the length method of the Line class. '
m1t.run_test_length()
p1 = Point(166, 10)
p2 = Point(100, 10)
line1 = Line(p1, p2)
print(line1.length())
p3 = Point(0, 0)
p4 = Point(3, 4)
line2 = Line(p3, p4)
print(line2.length())
print('The above sho... | 7,216,471,456,114,710,000 | Tests the length method of the Line class. | src/m1_Line.py | run_test_length | jarskijr/10-MoreImplementingClasses | python | def run_test_length():
' '
m1t.run_test_length()
p1 = Point(166, 10)
p2 = Point(100, 10)
line1 = Line(p1, p2)
print(line1.length())
p3 = Point(0, 0)
p4 = Point(3, 4)
line2 = Line(p3, p4)
print(line2.length())
print('The above should print:')
print(' 66.0')
print(' ... |
def run_test_get_number_of_clones():
' Tests the get_number_of_clones method of the Line class. '
m1t.run_test_get_number_of_clones()
line1 = Line(Point(500, 20), Point(100, 8))
line2 = line1.clone()
line3 = line1.clone()
line4 = line3.clone()
line5 = line1.clone()
print(line1.get_nu... | 849,224,913,853,879,400 | Tests the get_number_of_clones method of the Line class. | src/m1_Line.py | run_test_get_number_of_clones | jarskijr/10-MoreImplementingClasses | python | def run_test_get_number_of_clones():
' '
m1t.run_test_get_number_of_clones()
line1 = Line(Point(500, 20), Point(100, 8))
line2 = line1.clone()
line3 = line1.clone()
line4 = line3.clone()
line5 = line1.clone()
print(line1.get_number_of_clones())
print(line2.get_number_of_clones())
... |
def run_test_line_plus():
' Tests the line_plus method of the Line class. '
m1t.run_test_line_plus()
line1 = Line(Point(500, 20), Point(100, 8))
line2 = Line(Point(100, 13), Point(400, 8))
line3 = line1.line_plus(line2)
print(line3)
print('The above should print: Line[(600, 33), (500, 1... | 7,124,646,992,694,879,000 | Tests the line_plus method of the Line class. | src/m1_Line.py | run_test_line_plus | jarskijr/10-MoreImplementingClasses | python | def run_test_line_plus():
' '
m1t.run_test_line_plus()
line1 = Line(Point(500, 20), Point(100, 8))
line2 = Line(Point(100, 13), Point(400, 8))
line3 = line1.line_plus(line2)
print(line3)
print('The above should print: Line[(600, 33), (500, 16)]') |
def run_test_line_minus():
' Tests the line_minus method of the Line class. '
m1t.run_test_line_minus()
line1 = Line(Point(500, 20), Point(100, 8))
line2 = Line(Point(100, 13), Point(400, 8))
line3 = line1.line_minus(line2)
print(line3)
print('The above should print: Line[(400, 7), (-30... | -5,429,520,580,984,952,000 | Tests the line_minus method of the Line class. | src/m1_Line.py | run_test_line_minus | jarskijr/10-MoreImplementingClasses | python | def run_test_line_minus():
' '
m1t.run_test_line_minus()
line1 = Line(Point(500, 20), Point(100, 8))
line2 = Line(Point(100, 13), Point(400, 8))
line3 = line1.line_minus(line2)
print(line3)
print('The above should print: Line[(400, 7), (-300, 0)]') |
def run_test_midpoint():
' Tests the midpoint method of the Line class. '
m1t.run_test_midpoint()
p1 = Point(3, 10)
p2 = Point(9, 20)
line1 = Line(p1, p2)
print(line1.midpoint())
print('The above should print: Point(6, 15)') | -3,315,284,670,767,092,000 | Tests the midpoint method of the Line class. | src/m1_Line.py | run_test_midpoint | jarskijr/10-MoreImplementingClasses | python | def run_test_midpoint():
' '
m1t.run_test_midpoint()
p1 = Point(3, 10)
p2 = Point(9, 20)
line1 = Line(p1, p2)
print(line1.midpoint())
print('The above should print: Point(6, 15)') |
def run_test_is_parallel():
' Tests the is_parallel method of the Line class. '
m1t.run_test_is_parallel()
line1 = Line(Point(15, 30), Point(17, 50))
line2 = Line(Point(10, 10), Point(15, 60))
line3 = Line(Point(10, 10), Point(80, 80))
line4 = Line(Point(10, 10), Point(10, 20))
print(lin... | -3,567,636,817,371,249,700 | Tests the is_parallel method of the Line class. | src/m1_Line.py | run_test_is_parallel | jarskijr/10-MoreImplementingClasses | python | def run_test_is_parallel():
' '
m1t.run_test_is_parallel()
line1 = Line(Point(15, 30), Point(17, 50))
line2 = Line(Point(10, 10), Point(15, 60))
line3 = Line(Point(10, 10), Point(80, 80))
line4 = Line(Point(10, 10), Point(10, 20))
print(line1.is_parallel(line2))
print(line2.is_parallel(... |
def run_test_reset():
' Tests the reset method of the Line class. '
m1t.run_test_reset()
p1 = Point((- 3), (- 4))
p2 = Point(3, 4)
line1 = Line(p1, p2)
line2 = Line(Point(0, 1), Point(10, 20))
line1.start = Point(100, 300)
line2.end = Point(99, 4)
line1.reverse()
print(line1)... | -8,753,697,459,281,271,000 | Tests the reset method of the Line class. | src/m1_Line.py | run_test_reset | jarskijr/10-MoreImplementingClasses | python | def run_test_reset():
' '
m1t.run_test_reset()
p1 = Point((- 3), (- 4))
p2 = Point(3, 4)
line1 = Line(p1, p2)
line2 = Line(Point(0, 1), Point(10, 20))
line1.start = Point(100, 300)
line2.end = Point(99, 4)
line1.reverse()
print(line1)
print(line2)
line1.reset()
line2... |
def __init__(self, x, y):
' Sets instance variables x and y to the given coordinates. '
self.x = x
self.y = y | 6,931,114,761,715,498,000 | Sets instance variables x and y to the given coordinates. | src/m1_Line.py | __init__ | jarskijr/10-MoreImplementingClasses | python | def __init__(self, x, y):
' '
self.x = x
self.y = y |
def __repr__(self):
'\n Returns a string representation of this Point.\n For each coordinate (x and y), the representation:\n - Uses no decimal points if the number is close to an integer,\n - Else it uses 2 decimal places after the decimal point.\n Examples:\n Point... | 2,343,136,736,900,668,000 | Returns a string representation of this Point.
For each coordinate (x and y), the representation:
- Uses no decimal points if the number is close to an integer,
- Else it uses 2 decimal places after the decimal point.
Examples:
Point(10, 3.14)
Point(3.01, 2.99) | src/m1_Line.py | __repr__ | jarskijr/10-MoreImplementingClasses | python | def __repr__(self):
'\n Returns a string representation of this Point.\n For each coordinate (x and y), the representation:\n - Uses no decimal points if the number is close to an integer,\n - Else it uses 2 decimal places after the decimal point.\n Examples:\n Point... |
def __eq__(self, p2):
'\n Defines == for Points: a == b is equivalent to a.__eq__(b).\n Treats two numbers as "equal" if they are within 6 decimal\n places of each other for both x and y coordinates.\n '
return ((round(self.x, 6) == round(p2.x, 6)) and (round(self.y, 6) == round(... | -8,077,836,118,265,361,000 | Defines == for Points: a == b is equivalent to a.__eq__(b).
Treats two numbers as "equal" if they are within 6 decimal
places of each other for both x and y coordinates. | src/m1_Line.py | __eq__ | jarskijr/10-MoreImplementingClasses | python | def __eq__(self, p2):
'\n Defines == for Points: a == b is equivalent to a.__eq__(b).\n Treats two numbers as "equal" if they are within 6 decimal\n places of each other for both x and y coordinates.\n '
return ((round(self.x, 6) == round(p2.x, 6)) and (round(self.y, 6) == round(... |
def clone(self):
' Returns a new Point at the same (x, y) as this Point. '
return Point(self.x, self.y) | 437,393,966,495,241,300 | Returns a new Point at the same (x, y) as this Point. | src/m1_Line.py | clone | jarskijr/10-MoreImplementingClasses | python | def clone(self):
' '
return Point(self.x, self.y) |
def distance_from(self, p2):
' Returns the distance this Point is from the given Point. '
dx_squared = ((self.x - p2.x) ** 2)
dy_squared = ((self.y - p2.y) ** 2)
return math.sqrt((dx_squared + dy_squared)) | 1,669,929,206,180,372,500 | Returns the distance this Point is from the given Point. | src/m1_Line.py | distance_from | jarskijr/10-MoreImplementingClasses | python | def distance_from(self, p2):
' '
dx_squared = ((self.x - p2.x) ** 2)
dy_squared = ((self.y - p2.y) ** 2)
return math.sqrt((dx_squared + dy_squared)) |
def halfway_to(self, p2):
'\n Given another Point object p2, returns a new Point\n that is half-way between this Point and the given Point (p2).\n '
return Point(((self.x + p2.x) / 2), ((self.y + p2.y) / 2)) | -8,890,632,525,613,203,000 | Given another Point object p2, returns a new Point
that is half-way between this Point and the given Point (p2). | src/m1_Line.py | halfway_to | jarskijr/10-MoreImplementingClasses | python | def halfway_to(self, p2):
'\n Given another Point object p2, returns a new Point\n that is half-way between this Point and the given Point (p2).\n '
return Point(((self.x + p2.x) / 2), ((self.y + p2.y) / 2)) |
def plus(self, p2):
'\n Returns a Point whose coordinates are those of this Point\n PLUS the given Point. For example:\n p1 = Point(500, 20)\n p2 = Point(100, 13)\n p3 = p1.plus(p2)\n print(p3)\n would print: Point(600, 33)\n '
return Po... | 439,977,120,140,109,250 | Returns a Point whose coordinates are those of this Point
PLUS the given Point. For example:
p1 = Point(500, 20)
p2 = Point(100, 13)
p3 = p1.plus(p2)
print(p3)
would print: Point(600, 33) | src/m1_Line.py | plus | jarskijr/10-MoreImplementingClasses | python | def plus(self, p2):
'\n Returns a Point whose coordinates are those of this Point\n PLUS the given Point. For example:\n p1 = Point(500, 20)\n p2 = Point(100, 13)\n p3 = p1.plus(p2)\n print(p3)\n would print: Point(600, 33)\n '
return Po... |
def minus(self, p2):
'\n Returns a Point whose coordinates are those of this Point\n MINUS the given Point. For example:\n p1 = Point(500, 20)\n p2 = Point(100, 13)\n p3 = p1.minus(p2)\n print(p3)\n would print: Point(400, 7)\n '
return ... | -226,412,463,627,691,400 | Returns a Point whose coordinates are those of this Point
MINUS the given Point. For example:
p1 = Point(500, 20)
p2 = Point(100, 13)
p3 = p1.minus(p2)
print(p3)
would print: Point(400, 7) | src/m1_Line.py | minus | jarskijr/10-MoreImplementingClasses | python | def minus(self, p2):
'\n Returns a Point whose coordinates are those of this Point\n MINUS the given Point. For example:\n p1 = Point(500, 20)\n p2 = Point(100, 13)\n p3 = p1.minus(p2)\n print(p3)\n would print: Point(400, 7)\n '
return ... |
def __repr__(self):
"\n What comes in:\n -- self\n What goes out: Returns a string representation of this Line,\n in the form:\n Line[(x1, y1), (x2, y2)]\n Side effects: None.\n Note: print(BLAH) causes BLAH's __repr__ to be called.\n BLAH's __re... | 3,928,050,505,639,531,000 | What comes in:
-- self
What goes out: Returns a string representation of this Line,
in the form:
Line[(x1, y1), (x2, y2)]
Side effects: None.
Note: print(BLAH) causes BLAH's __repr__ to be called.
BLAH's __repr__ returns a string,
which the print function then prints.
Example: Since the print ... | src/m1_Line.py | __repr__ | jarskijr/10-MoreImplementingClasses | python | def __repr__(self):
"\n What comes in:\n -- self\n What goes out: Returns a string representation of this Line,\n in the form:\n Line[(x1, y1), (x2, y2)]\n Side effects: None.\n Note: print(BLAH) causes BLAH's __repr__ to be called.\n BLAH's __re... |
def __eq__(self, line2):
"\n What comes in:\n -- self\n -- a Line object\n What goes out: Returns True if:\n this Line's start point is equal to line2's start point AND\n this Line's end point is equal to line2's end point.\n Returns False otherw... | -2,334,047,882,251,001,000 | What comes in:
-- self
-- a Line object
What goes out: Returns True if:
this Line's start point is equal to line2's start point AND
this Line's end point is equal to line2's end point.
Returns False otherwise.
Side effects: None.
Note: a == b is equivalent to a.__eq__(b).
Examples:
p1 = Po... | src/m1_Line.py | __eq__ | jarskijr/10-MoreImplementingClasses | python | def __eq__(self, line2):
"\n What comes in:\n -- self\n -- a Line object\n What goes out: Returns True if:\n this Line's start point is equal to line2's start point AND\n this Line's end point is equal to line2's end point.\n Returns False otherw... |
def line_plus(self, other_line):
"\n What comes in:\n -- self\n -- another Line object\n What goes out:\n -- Returns a Line whose:\n -- start is the sum of this Line's start (a Point)\n and the other_line's start (another Point).\n ... | 7,048,618,442,946,980,000 | What comes in:
-- self
-- another Line object
What goes out:
-- Returns a Line whose:
-- start is the sum of this Line's start (a Point)
and the other_line's start (another Point).
-- end is the sum of this Line's end (a Point)
and the other_line's end (another Point).
Side effec... | src/m1_Line.py | line_plus | jarskijr/10-MoreImplementingClasses | python | def line_plus(self, other_line):
"\n What comes in:\n -- self\n -- another Line object\n What goes out:\n -- Returns a Line whose:\n -- start is the sum of this Line's start (a Point)\n and the other_line's start (another Point).\n ... |
def line_minus(self, other_line):
"\n What comes in:\n -- self\n -- another Line object\n What goes out:\n -- Returns a Line whose:\n -- start is this Line's start (a Point)\n minus the other_line's start (another Point).\n -- end ... | -2,517,935,610,742,812,700 | What comes in:
-- self
-- another Line object
What goes out:
-- Returns a Line whose:
-- start is this Line's start (a Point)
minus the other_line's start (another Point).
-- end is this Line's end (a Point)
minus the other_line's end (another Point).
Side effects: None.
Example... | src/m1_Line.py | line_minus | jarskijr/10-MoreImplementingClasses | python | def line_minus(self, other_line):
"\n What comes in:\n -- self\n -- another Line object\n What goes out:\n -- Returns a Line whose:\n -- start is this Line's start (a Point)\n minus the other_line's start (another Point).\n -- end ... |
def midpoint(self):
'\n What comes in:\n -- self\n What goes out: returns a Point at the midpoint of this Line.\n Side effects: None.\n\n Example:\n p1 = Point(3, 10)\n p2 = Point(9, 20)\n line1 = Line(p1, p2)\n\n print(line1.midpoint(... | -8,627,433,882,126,673,000 | What comes in:
-- self
What goes out: returns a Point at the midpoint of this Line.
Side effects: None.
Example:
p1 = Point(3, 10)
p2 = Point(9, 20)
line1 = Line(p1, p2)
print(line1.midpoint()) # Should print: Point(6, 15)
Type hints:
:rtype: Point | src/m1_Line.py | midpoint | jarskijr/10-MoreImplementingClasses | python | def midpoint(self):
'\n What comes in:\n -- self\n What goes out: returns a Point at the midpoint of this Line.\n Side effects: None.\n\n Example:\n p1 = Point(3, 10)\n p2 = Point(9, 20)\n line1 = Line(p1, p2)\n\n print(line1.midpoint(... |
def is_parallel(self, line2):
'\n What comes in:\n -- self\n -- another Line object (line2)\n What goes out: Returns True if this Line is parallel to the\n given Line (line2). Returns False otherwise.\n *** SEE THE IMPORTANT NOTE BELOW, re ROUNDING numbers.\n... | -5,667,649,960,552,140,000 | What comes in:
-- self
-- another Line object (line2)
What goes out: Returns True if this Line is parallel to the
given Line (line2). Returns False otherwise.
*** SEE THE IMPORTANT NOTE BELOW, re ROUNDING numbers.
Side effects: None.
Examples:
line1 = Line(Point(15, 30), Point(17, 50)) # slope is 1... | src/m1_Line.py | is_parallel | jarskijr/10-MoreImplementingClasses | python | def is_parallel(self, line2):
'\n What comes in:\n -- self\n -- another Line object (line2)\n What goes out: Returns True if this Line is parallel to the\n given Line (line2). Returns False otherwise.\n *** SEE THE IMPORTANT NOTE BELOW, re ROUNDING numbers.\n... |
def _leaf_extent_id_to_clone_ops(ids_and_extents: Iterable[Tuple[(InodeID, Extent)]]):
'\n To collect the parts of a Chunk that are cloned, we will run a variation\n on the standard interval-overlap algorithm. We first sort the starts &\n ends of each interval, and then do a sequential scan that uses star... | 527,612,937,277,127,500 | To collect the parts of a Chunk that are cloned, we will run a variation
on the standard interval-overlap algorithm. We first sort the starts &
ends of each interval, and then do a sequential scan that uses starts to
add, and ends to remove, a tracking object from a "current intervals"
structure.
This function simply... | antlir/btrfs_diff/extents_to_chunks.py | _leaf_extent_id_to_clone_ops | SaurabhAgarwala/antlir | python | def _leaf_extent_id_to_clone_ops(ids_and_extents: Iterable[Tuple[(InodeID, Extent)]]):
'\n To collect the parts of a Chunk that are cloned, we will run a variation\n on the standard interval-overlap algorithm. We first sort the starts &\n ends of each interval, and then do a sequential scan that uses star... |
def _leaf_ref_to_chunk_clones_from_clone_ops(extent_id: int, clone_ops: Iterable[_CloneOp]):
'As per `_leaf_extent_id_to_clone_ops`, this computes interval overlaps'
active_ops: Dict[(_CloneExtentRef, _CloneOp)] = {}
leaf_ref_to_chunk_clones = defaultdict(list)
for op in sorted(clone_ops):
if (o... | -5,223,127,182,947,979,000 | As per `_leaf_extent_id_to_clone_ops`, this computes interval overlaps | antlir/btrfs_diff/extents_to_chunks.py | _leaf_ref_to_chunk_clones_from_clone_ops | SaurabhAgarwala/antlir | python | def _leaf_ref_to_chunk_clones_from_clone_ops(extent_id: int, clone_ops: Iterable[_CloneOp]):
active_ops: Dict[(_CloneExtentRef, _CloneOp)] = {}
leaf_ref_to_chunk_clones = defaultdict(list)
for op in sorted(clone_ops):
if (op.action is _CloneOp.POP):
pushed_op = active_ops.pop(op.ref... |
def _id_to_leaf_idx_to_chunk_clones(ids_and_extents: Iterable[Tuple[(InodeID, Extent)]]):
'Aggregates newly created ChunkClones per InodeID, and per "trimmed leaf"'
id_to_leaf_idx_to_chunk_clones = defaultdict(dict)
for (extent_id, clone_ops) in _leaf_extent_id_to_clone_ops(ids_and_extents).items():
... | -4,177,678,356,634,461,700 | Aggregates newly created ChunkClones per InodeID, and per "trimmed leaf" | antlir/btrfs_diff/extents_to_chunks.py | _id_to_leaf_idx_to_chunk_clones | SaurabhAgarwala/antlir | python | def _id_to_leaf_idx_to_chunk_clones(ids_and_extents: Iterable[Tuple[(InodeID, Extent)]]):
id_to_leaf_idx_to_chunk_clones = defaultdict(dict)
for (extent_id, clone_ops) in _leaf_extent_id_to_clone_ops(ids_and_extents).items():
leaf_ref_to_chunk_clones = _leaf_ref_to_chunk_clones_from_clone_ops(exten... |
def extents_to_chunks_with_clones(ids_and_extents: Sequence[Tuple[(InodeID, Extent)]]) -> Iterable[Tuple[(InodeID, Sequence[Chunk])]]:
"\n Converts the nested, history-preserving `Extent` structures into flat\n sequences of `Chunk`s, while being careful to annotate cloned parts as\n described in this file'... | -30,538,634,863,049,348 | Converts the nested, history-preserving `Extent` structures into flat
sequences of `Chunk`s, while being careful to annotate cloned parts as
described in this file's docblock. The `InodeID`s are needed to ensure
that the `Chunk`s' `Clone` objects refer to the appropriate files. | antlir/btrfs_diff/extents_to_chunks.py | extents_to_chunks_with_clones | SaurabhAgarwala/antlir | python | def extents_to_chunks_with_clones(ids_and_extents: Sequence[Tuple[(InodeID, Extent)]]) -> Iterable[Tuple[(InodeID, Sequence[Chunk])]]:
"\n Converts the nested, history-preserving `Extent` structures into flat\n sequences of `Chunk`s, while being careful to annotate cloned parts as\n described in this file'... |
def test_coordinate_vars():
'\n Tests the coordinate variables functionality with respect to\n reorientation of coordinate systems.\n '
A = CoordSysCartesian('A')
assert (BaseScalar('A.x', 0, A, 'A_x', '\\mathbf{{x}_{A}}') == A.x)
assert (BaseScalar('A.y', 1, A, 'A_y', '\\mathbf{{y}_{A}}') == A... | -5,084,472,095,242,765,000 | Tests the coordinate variables functionality with respect to
reorientation of coordinate systems. | sympy/vector/tests/test_coordsysrect.py | test_coordinate_vars | Anshnrag02/sympy | python | def test_coordinate_vars():
'\n Tests the coordinate variables functionality with respect to\n reorientation of coordinate systems.\n '
A = CoordSysCartesian('A')
assert (BaseScalar('A.x', 0, A, 'A_x', '\\mathbf{{x}_{A}}') == A.x)
assert (BaseScalar('A.y', 1, A, 'A_y', '\\mathbf{{y}_{A}}') == A... |
def test_vector():
'\n Tests the effects of orientation of coordinate systems on\n basic vector operations.\n '
N = CoordSysCartesian('N')
A = N.orient_new_axis('A', q1, N.k)
B = A.orient_new_axis('B', q2, A.i)
C = B.orient_new_axis('C', q3, B.j)
v1 = (((a * N.i) + (b * N.j)) + (c * N.k... | -7,440,557,086,236,066,000 | Tests the effects of orientation of coordinate systems on
basic vector operations. | sympy/vector/tests/test_coordsysrect.py | test_vector | Anshnrag02/sympy | python | def test_vector():
'\n Tests the effects of orientation of coordinate systems on\n basic vector operations.\n '
N = CoordSysCartesian('N')
A = N.orient_new_axis('A', q1, N.k)
B = A.orient_new_axis('B', q2, A.i)
C = B.orient_new_axis('C', q3, B.j)
v1 = (((a * N.i) + (b * N.j)) + (c * N.k... |
def test_locatenew_point():
'\n Tests Point class, and locate_new method in CoordSysCartesian.\n '
A = CoordSysCartesian('A')
assert isinstance(A.origin, Point)
v = (((a * A.i) + (b * A.j)) + (c * A.k))
C = A.locate_new('C', v)
assert (C.origin.position_wrt(A) == C.position_wrt(A) == C.ori... | -988,462,583,724,789,000 | Tests Point class, and locate_new method in CoordSysCartesian. | sympy/vector/tests/test_coordsysrect.py | test_locatenew_point | Anshnrag02/sympy | python | def test_locatenew_point():
'\n \n '
A = CoordSysCartesian('A')
assert isinstance(A.origin, Point)
v = (((a * A.i) + (b * A.j)) + (c * A.k))
C = A.locate_new('C', v)
assert (C.origin.position_wrt(A) == C.position_wrt(A) == C.origin.position_wrt(A.origin) == v)
assert (A.origin.position... |
def usage():
'Print helpful, accurate usage statement to stdout.'
print('Usage: rotate_molecule.py -f filename')
print()
print(' Description of command...')
print(' [-f] filename')
print(' Optional parameters:')
print(' [-o] alternative output filename')
print("... | 7,428,389,739,618,546,000 | Print helpful, accurate usage statement to stdout. | AutoDockTools/Utilities24/rotate_molecule.py | usage | e-mayo/autodocktools-prepare-py3k | python | def usage():
print('Usage: rotate_molecule.py -f filename')
print()
print(' Description of command...')
print(' [-f] filename')
print(' Optional parameters:')
print(' [-o] alternative output filename')
print(" (default is 'rotated_' +filename)")
prin... |
def __init__(self, port=None, path='redis-server', **extra_args):
'\n :param port: port number to start the redis server on. Specify none to automatically generate\n :type port: int|None\n :param extra_args: any extra arguments kwargs will be passed to redis server as --key val\n '
s... | -7,137,479,020,550,939,000 | :param port: port number to start the redis server on. Specify none to automatically generate
:type port: int|None
:param extra_args: any extra arguments kwargs will be passed to redis server as --key val | RAMP/disposableredis/__init__.py | __init__ | MPalarya/RAMP | python | def __init__(self, port=None, path='redis-server', **extra_args):
'\n :param port: port number to start the redis server on. Specify none to automatically generate\n :type port: int|None\n :param extra_args: any extra arguments kwargs will be passed to redis server as --key val\n '
s... |
def client(self):
'\n :rtype: redis.StrictRedis\n '
return redis.StrictRedis(port=self.port, decode_responses=True) | 6,858,181,793,222,088,000 | :rtype: redis.StrictRedis | RAMP/disposableredis/__init__.py | client | MPalarya/RAMP | python | def client(self):
'\n \n '
return redis.StrictRedis(port=self.port, decode_responses=True) |
def sample(population, k):
'Chooses k unique random elements from a bag.\n\n Returns a new bag containing elements from the population while\n leaving the original population unchanged.\n\n Parameters\n ----------\n population: Bag\n Elements to sample.\n k: integer, optional\n Numbe... | -23,125,142,183,938,040 | Chooses k unique random elements from a bag.
Returns a new bag containing elements from the population while
leaving the original population unchanged.
Parameters
----------
population: Bag
Elements to sample.
k: integer, optional
Number of elements to sample.
Examples
--------
>>> import dask.bag as db # do... | ServerComponent/venv/Lib/site-packages/dask/bag/random.py | sample | CDU55/FakeNews | python | def sample(population, k):
'Chooses k unique random elements from a bag.\n\n Returns a new bag containing elements from the population while\n leaving the original population unchanged.\n\n Parameters\n ----------\n population: Bag\n Elements to sample.\n k: integer, optional\n Numbe... |
def choices(population, k=1):
'\n Return a k sized list of elements chosen with replacement.\n\n Parameters\n ----------\n population: Bag\n Elements to sample.\n k: integer, optional\n Number of elements to sample.\n\n Examples\n --------\n >>> import dask.bag as db # doctest:... | -3,130,375,494,300,238,300 | Return a k sized list of elements chosen with replacement.
Parameters
----------
population: Bag
Elements to sample.
k: integer, optional
Number of elements to sample.
Examples
--------
>>> import dask.bag as db # doctest: +SKIP
... from dask.bag import random
...
... b = db.from_sequence(range(5), npartition... | ServerComponent/venv/Lib/site-packages/dask/bag/random.py | choices | CDU55/FakeNews | python | def choices(population, k=1):
'\n Return a k sized list of elements chosen with replacement.\n\n Parameters\n ----------\n population: Bag\n Elements to sample.\n k: integer, optional\n Number of elements to sample.\n\n Examples\n --------\n >>> import dask.bag as db # doctest:... |
def _sample_map_partitions(population, k, replace):
'\n Map function used on the sample and choices functions.\n Parameters\n ----------\n population : list\n List of elements to sample.\n k : int, optional\n Number of elements to sample. Default is 1.\n\n Returns\n -------\n s... | -4,155,118,698,904,341,000 | Map function used on the sample and choices functions.
Parameters
----------
population : list
List of elements to sample.
k : int, optional
Number of elements to sample. Default is 1.
Returns
-------
sample: list
List of sampled elements from the partition.
lx: int
Number of elements on the partition.... | ServerComponent/venv/Lib/site-packages/dask/bag/random.py | _sample_map_partitions | CDU55/FakeNews | python | def _sample_map_partitions(population, k, replace):
'\n Map function used on the sample and choices functions.\n Parameters\n ----------\n population : list\n List of elements to sample.\n k : int, optional\n Number of elements to sample. Default is 1.\n\n Returns\n -------\n s... |
def _sample_reduce(reduce_iter, k, replace):
'\n Reduce function used on the sample and choice functions.\n\n Parameters\n ----------\n reduce_iter : iterable\n Each element is a tuple coming generated by the _sample_map_partitions function.\n\n Returns a sequence of uniformly distributed samp... | 2,513,519,958,655,585,000 | Reduce function used on the sample and choice functions.
Parameters
----------
reduce_iter : iterable
Each element is a tuple coming generated by the _sample_map_partitions function.
Returns a sequence of uniformly distributed samples; | ServerComponent/venv/Lib/site-packages/dask/bag/random.py | _sample_reduce | CDU55/FakeNews | python | def _sample_reduce(reduce_iter, k, replace):
'\n Reduce function used on the sample and choice functions.\n\n Parameters\n ----------\n reduce_iter : iterable\n Each element is a tuple coming generated by the _sample_map_partitions function.\n\n Returns a sequence of uniformly distributed samp... |
def _weighted_sampling_without_replacement(population, weights, k):
'\n Source:\n Weighted random sampling with a reservoir, Pavlos S. Efraimidis, Paul G. Spirakis\n '
elt = [((math.log(rnd.random()) / weights[i]), i) for i in range(len(weights))]
return [population[x[1]] for x in heapq.nlarges... | 3,281,393,158,215,064,600 | Source:
Weighted random sampling with a reservoir, Pavlos S. Efraimidis, Paul G. Spirakis | ServerComponent/venv/Lib/site-packages/dask/bag/random.py | _weighted_sampling_without_replacement | CDU55/FakeNews | python | def _weighted_sampling_without_replacement(population, weights, k):
'\n Source:\n Weighted random sampling with a reservoir, Pavlos S. Efraimidis, Paul G. Spirakis\n '
elt = [((math.log(rnd.random()) / weights[i]), i) for i in range(len(weights))]
return [population[x[1]] for x in heapq.nlarges... |
def kSimilarity(self, A, B):
'\n :type A: str\n :type B: str\n :rtype: int\n '
def neighbors(s):
for (i, c) in enumerate(s):
if (c != B[i]):
break
t = list(s)
for j in xrange((i + 1), len(s)):
if (t[j] == B[i]):
... | -6,274,109,689,851,230,000 | :type A: str
:type B: str
:rtype: int | Python/k-similar-strings.py | kSimilarity | RideGreg/LeetCode | python | def kSimilarity(self, A, B):
'\n :type A: str\n :type B: str\n :rtype: int\n '
def neighbors(s):
for (i, c) in enumerate(s):
if (c != B[i]):
break
t = list(s)
for j in xrange((i + 1), len(s)):
if (t[j] == B[i]):
... |
@classmethod
def from_file(cls, filename, hdu_hdu='HDU_INDEX', hdu_obs='OBS_INDEX'):
'Create from a FITS file.\n\n The FITS file must contain both index files.\n\n Parameters\n ----------\n filename : str, Path\n FITS filename\n hdu_hdu : str or int\n FITS HD... | 3,118,659,519,337,359,400 | Create from a FITS file.
The FITS file must contain both index files.
Parameters
----------
filename : str, Path
FITS filename
hdu_hdu : str or int
FITS HDU name or number for the HDU index table
hdu_obs : str or int
FITS HDU name or number for the observation index table | gammapy/data/data_store.py | from_file | qpiel/gammapy | python | @classmethod
def from_file(cls, filename, hdu_hdu='HDU_INDEX', hdu_obs='OBS_INDEX'):
'Create from a FITS file.\n\n The FITS file must contain both index files.\n\n Parameters\n ----------\n filename : str, Path\n FITS filename\n hdu_hdu : str or int\n FITS HD... |
@classmethod
def from_dir(cls, base_dir, hdu_table_filename=None, obs_table_filename=None):
'Create from a directory.\n\n Parameters\n ----------\n base_dir : str, Path\n Base directory of the data files.\n hdu_table_filename : str, Path\n Filename of the HDU index ... | 8,706,081,717,159,003,000 | Create from a directory.
Parameters
----------
base_dir : str, Path
Base directory of the data files.
hdu_table_filename : str, Path
Filename of the HDU index file. May be specified either relative
to `base_dir` or as an absolute path. If None, the default filename
will be looked for.
obs_table_filenam... | gammapy/data/data_store.py | from_dir | qpiel/gammapy | python | @classmethod
def from_dir(cls, base_dir, hdu_table_filename=None, obs_table_filename=None):
'Create from a directory.\n\n Parameters\n ----------\n base_dir : str, Path\n Base directory of the data files.\n hdu_table_filename : str, Path\n Filename of the HDU index ... |
@classmethod
def from_config(cls, config):
'Create from a config dict.'
base_dir = config['base_dir']
hdu_table_filename = config.get('hduindx', cls.DEFAULT_HDU_TABLE)
obs_table_filename = config.get('obsindx', cls.DEFAULT_OBS_TABLE)
hdu_table_filename = cls._find_file(hdu_table_filename, base_dir)
... | 5,788,775,811,130,244,000 | Create from a config dict. | gammapy/data/data_store.py | from_config | qpiel/gammapy | python | @classmethod
def from_config(cls, config):
base_dir = config['base_dir']
hdu_table_filename = config.get('hduindx', cls.DEFAULT_HDU_TABLE)
obs_table_filename = config.get('obsindx', cls.DEFAULT_OBS_TABLE)
hdu_table_filename = cls._find_file(hdu_table_filename, base_dir)
obs_table_filename = cls... |
@staticmethod
def _find_file(filename, dir):
"Find a file at an absolute or relative location.\n\n - First tries ``Path(filename)``\n - Second tries ``Path(dir) / filename``\n - Raises ``OSError`` if both don't exist.\n "
path1 = make_path(filename)
path2 = (make_path(dir) / file... | -6,604,903,917,612,430,000 | Find a file at an absolute or relative location.
- First tries ``Path(filename)``
- Second tries ``Path(dir) / filename``
- Raises ``OSError`` if both don't exist. | gammapy/data/data_store.py | _find_file | qpiel/gammapy | python | @staticmethod
def _find_file(filename, dir):
"Find a file at an absolute or relative location.\n\n - First tries ``Path(filename)``\n - Second tries ``Path(dir) / filename``\n - Raises ``OSError`` if both don't exist.\n "
path1 = make_path(filename)
path2 = (make_path(dir) / file... |
def info(self, show=True):
'Print some info.'
s = 'Data store:\n'
s += self.hdu_table.summary()
s += '\n\n'
s += self.obs_table.summary()
if show:
print(s)
else:
return s | 3,470,897,961,016,105,500 | Print some info. | gammapy/data/data_store.py | info | qpiel/gammapy | python | def info(self, show=True):
s = 'Data store:\n'
s += self.hdu_table.summary()
s += '\n\n'
s += self.obs_table.summary()
if show:
print(s)
else:
return s |
def obs(self, obs_id):
'Access a given `~gammapy.data.DataStoreObservation`.\n\n Parameters\n ----------\n obs_id : int\n Observation ID.\n\n Returns\n -------\n observation : `~gammapy.data.DataStoreObservation`\n Observation container\n '
... | 9,200,233,249,087,507,000 | Access a given `~gammapy.data.DataStoreObservation`.
Parameters
----------
obs_id : int
Observation ID.
Returns
-------
observation : `~gammapy.data.DataStoreObservation`
Observation container | gammapy/data/data_store.py | obs | qpiel/gammapy | python | def obs(self, obs_id):
'Access a given `~gammapy.data.DataStoreObservation`.\n\n Parameters\n ----------\n obs_id : int\n Observation ID.\n\n Returns\n -------\n observation : `~gammapy.data.DataStoreObservation`\n Observation container\n '
... |
def get_observations(self, obs_id, skip_missing=False):
'Generate a `~gammapy.data.Observations`.\n\n Parameters\n ----------\n obs_id : list\n Observation IDs.\n skip_missing : bool, optional\n Skip missing observations, default: False\n\n Returns\n -... | -351,004,946,236,869,570 | Generate a `~gammapy.data.Observations`.
Parameters
----------
obs_id : list
Observation IDs.
skip_missing : bool, optional
Skip missing observations, default: False
Returns
-------
observations : `~gammapy.data.Observations`
Container holding a list of `~gammapy.data.DataStoreObservation` | gammapy/data/data_store.py | get_observations | qpiel/gammapy | python | def get_observations(self, obs_id, skip_missing=False):
'Generate a `~gammapy.data.Observations`.\n\n Parameters\n ----------\n obs_id : list\n Observation IDs.\n skip_missing : bool, optional\n Skip missing observations, default: False\n\n Returns\n -... |
def copy_obs(self, obs_id, outdir, hdu_class=None, verbose=False, overwrite=False):
'Create a new `~gammapy.data.DataStore` containing a subset of observations.\n\n Parameters\n ----------\n obs_id : array-like, `~gammapy.data.ObservationTable`\n List of observations to copy\n ... | 1,393,341,914,337,598,500 | Create a new `~gammapy.data.DataStore` containing a subset of observations.
Parameters
----------
obs_id : array-like, `~gammapy.data.ObservationTable`
List of observations to copy
outdir : str, Path
Directory for the new store
hdu_class : list of str
see :attr:`gammapy.data.HDUIndexTable.VALID_HDU_CLASS`
... | gammapy/data/data_store.py | copy_obs | qpiel/gammapy | python | def copy_obs(self, obs_id, outdir, hdu_class=None, verbose=False, overwrite=False):
'Create a new `~gammapy.data.DataStore` containing a subset of observations.\n\n Parameters\n ----------\n obs_id : array-like, `~gammapy.data.ObservationTable`\n List of observations to copy\n ... |
def check(self, checks='all'):
'Check index tables and data files.\n\n This is a generator that yields a list of dicts.\n '
checker = DataStoreChecker(self)
return checker.run(checks=checks) | -4,447,423,972,648,946,000 | Check index tables and data files.
This is a generator that yields a list of dicts. | gammapy/data/data_store.py | check | qpiel/gammapy | python | def check(self, checks='all'):
'Check index tables and data files.\n\n This is a generator that yields a list of dicts.\n '
checker = DataStoreChecker(self)
return checker.run(checks=checks) |
def check_obs_table(self):
'Checks for the observation index table.'
checker = ObservationTableChecker(self.data_store.obs_table)
for record in checker.run():
(yield record) | -6,397,188,248,187,160,000 | Checks for the observation index table. | gammapy/data/data_store.py | check_obs_table | qpiel/gammapy | python | def check_obs_table(self):
checker = ObservationTableChecker(self.data_store.obs_table)
for record in checker.run():
(yield record) |
def check_hdu_table(self):
'Checks for the HDU index table.'
t = self.data_store.hdu_table
m = t.meta
if (m.get('HDUCLAS1', '') != 'INDEX'):
(yield {'level': 'error', 'hdu': 'hdu-index', 'msg': 'Invalid header key. Must have HDUCLAS1=INDEX'})
if (m.get('HDUCLAS2', '') != 'HDU'):
(yie... | -1,683,391,674,228,314,600 | Checks for the HDU index table. | gammapy/data/data_store.py | check_hdu_table | qpiel/gammapy | python | def check_hdu_table(self):
t = self.data_store.hdu_table
m = t.meta
if (m.get('HDUCLAS1', ) != 'INDEX'):
(yield {'level': 'error', 'hdu': 'hdu-index', 'msg': 'Invalid header key. Must have HDUCLAS1=INDEX'})
if (m.get('HDUCLAS2', ) != 'HDU'):
(yield {'level': 'error', 'hdu': 'hdu-ind... |
def check_consistency(self):
'Consistency checks between multiple HDUs'
obs_table_obs_id = set(self.data_store.obs_table['OBS_ID'])
hdu_table_obs_id = set(self.data_store.hdu_table['OBS_ID'])
if (not (obs_table_obs_id == hdu_table_obs_id)):
(yield {'level': 'error', 'msg': 'Inconsistent OBS_ID i... | -3,145,264,212,553,814,000 | Consistency checks between multiple HDUs | gammapy/data/data_store.py | check_consistency | qpiel/gammapy | python | def check_consistency(self):
obs_table_obs_id = set(self.data_store.obs_table['OBS_ID'])
hdu_table_obs_id = set(self.data_store.hdu_table['OBS_ID'])
if (not (obs_table_obs_id == hdu_table_obs_id)):
(yield {'level': 'error', 'msg': 'Inconsistent OBS_ID in obs and HDU index tables'}) |
def check_observations(self):
'Perform some sanity checks for all observations.'
for obs_id in self.data_store.obs_table['OBS_ID']:
obs = self.data_store.obs(obs_id)
for record in ObservationChecker(obs).run():
(yield record) | 820,165,116,716,392,800 | Perform some sanity checks for all observations. | gammapy/data/data_store.py | check_observations | qpiel/gammapy | python | def check_observations(self):
for obs_id in self.data_store.obs_table['OBS_ID']:
obs = self.data_store.obs(obs_id)
for record in ObservationChecker(obs).run():
(yield record) |
def trim5p3p_helper(r, seq_5p, seq_3p_rev):
"\n Search for 5' and 3' in the first and last 100 bp window\n "
s1 = str(r.seq[:100])
s2 = str(r.reverse_complement().seq[:100])
o1 = parasail.sg_qx_trace(s1, seq_5p, 3, 1, SCOREMAT)
o2 = parasail.sg_qe_db_trace(s2, seq_3p_rev, 3, 1, SCOREMAT)
l... | -4,305,561,221,391,130,000 | Search for 5' and 3' in the first and last 100 bp window | beta/trim_primers.py | trim5p3p_helper | ArthurDondi/cDNA_Cupcake | python | def trim5p3p_helper(r, seq_5p, seq_3p_rev):
"\n \n "
s1 = str(r.seq[:100])
s2 = str(r.reverse_complement().seq[:100])
o1 = parasail.sg_qx_trace(s1, seq_5p, 3, 1, SCOREMAT)
o2 = parasail.sg_qe_db_trace(s2, seq_3p_rev, 3, 1, SCOREMAT)
lenA = None
if (o2.score >= MINSCORE_3P):
len... |
@raises(ohsome.OhsomeException)
def test_handle_multiple_responses_throw_timeouterror():
'\n Tests counting elements within a bounding box for two timestamps\n :return:\n '
bboxes = [8.67066, 49.41423, 8.68177, 49.4204]
time = '2010-01-01/2011-01-01/P1Y'
keys = ['building']
values = ['']
... | 2,038,496,404,154,034,000 | Tests counting elements within a bounding box for two timestamps
:return: | src/ohsome/tests/test_ohsome_client.py | test_handle_multiple_responses_throw_timeouterror | redfrexx/osm_association_rules | python | @raises(ohsome.OhsomeException)
def test_handle_multiple_responses_throw_timeouterror():
'\n Tests counting elements within a bounding box for two timestamps\n :return:\n '
bboxes = [8.67066, 49.41423, 8.68177, 49.4204]
time = '2010-01-01/2011-01-01/P1Y'
keys = ['building']
values = []
... |
def test_elements_count():
'\n Tests counting elements within a bounding box for two timestamps\n :return:\n '
bboxes = [8.67066, 49.41423, 8.68177, 49.4204]
time = '2010-01-01/2011-01-01/P1Y'
keys = ['building']
values = ['']
timestamps = ['2010-01-01T00:00:00Z', '2011-01-01T00:00:00Z'... | -5,813,278,776,934,570,000 | Tests counting elements within a bounding box for two timestamps
:return: | src/ohsome/tests/test_ohsome_client.py | test_elements_count | redfrexx/osm_association_rules | python | def test_elements_count():
'\n Tests counting elements within a bounding box for two timestamps\n :return:\n '
bboxes = [8.67066, 49.41423, 8.68177, 49.4204]
time = '2010-01-01/2011-01-01/P1Y'
keys = ['building']
values = []
timestamps = ['2010-01-01T00:00:00Z', '2011-01-01T00:00:00Z']
... |
def test_elements_count_group_by_key():
'\n Tests counting elements within a bounding box and grouping them by keys\n :return:\n '
bboxes = '8.67066,49.41423,8.68177,49.4204'
time = '2010-01-01/2011-01-01/P1Y'
groupByKeys = ['building']
timestamps = ['2010-01-01T00:00:00Z', '2011-01-01T00:0... | 4,378,477,051,556,733,000 | Tests counting elements within a bounding box and grouping them by keys
:return: | src/ohsome/tests/test_ohsome_client.py | test_elements_count_group_by_key | redfrexx/osm_association_rules | python | def test_elements_count_group_by_key():
'\n Tests counting elements within a bounding box and grouping them by keys\n :return:\n '
bboxes = '8.67066,49.41423,8.68177,49.4204'
time = '2010-01-01/2011-01-01/P1Y'
groupByKeys = ['building']
timestamps = ['2010-01-01T00:00:00Z', '2011-01-01T00:0... |
def test_elemets_count_ratio():
'\n Tests count ratio\n :return:\n '
bboxes = '8.67066,49.41423,8.68177,49.4204'
time = '2010-01-01'
keys = ['building']
keys2 = ['addr:city']
values = ['']
values2 = ['']
expected = 365.0
client = ohsome.OhsomeClient()
response = client.e... | -6,645,920,146,652,629,000 | Tests count ratio
:return: | src/ohsome/tests/test_ohsome_client.py | test_elemets_count_ratio | redfrexx/osm_association_rules | python | def test_elemets_count_ratio():
'\n Tests count ratio\n :return:\n '
bboxes = '8.67066,49.41423,8.68177,49.4204'
time = '2010-01-01'
keys = ['building']
keys2 = ['addr:city']
values = []
values2 = []
expected = 365.0
client = ohsome.OhsomeClient()
response = client.eleme... |
@raises(AssertionError)
def test_elements_count_exception():
'\n Tests whether a TypeError is raised if the result cannot be converted to a geodataframe object\n :return:\n '
bboxes = '8.67066,49.41423,8.68177,49.4204'
time = '2010-01-01/2011-01-01/P1Y'
keys = ['building']
values = ['']
... | 4,637,099,277,073,996,000 | Tests whether a TypeError is raised if the result cannot be converted to a geodataframe object
:return: | src/ohsome/tests/test_ohsome_client.py | test_elements_count_exception | redfrexx/osm_association_rules | python | @raises(AssertionError)
def test_elements_count_exception():
'\n Tests whether a TypeError is raised if the result cannot be converted to a geodataframe object\n :return:\n '
bboxes = '8.67066,49.41423,8.68177,49.4204'
time = '2010-01-01/2011-01-01/P1Y'
keys = ['building']
values = []
c... |
def test_elements_geometry():
'\n Tests whether the result of an elements/geometry query can be converted to a geodataframe\n :return:\n '
bboxes = '8.67066,49.41423,8.68177,49.4204'
time = '2010-01-01'
keys = ['landuse']
values = ['grass']
client = ohsome.OhsomeClient()
response = ... | 7,416,005,179,180,065,000 | Tests whether the result of an elements/geometry query can be converted to a geodataframe
:return: | src/ohsome/tests/test_ohsome_client.py | test_elements_geometry | redfrexx/osm_association_rules | python | def test_elements_geometry():
'\n Tests whether the result of an elements/geometry query can be converted to a geodataframe\n :return:\n '
bboxes = '8.67066,49.41423,8.68177,49.4204'
time = '2010-01-01'
keys = ['landuse']
values = ['grass']
client = ohsome.OhsomeClient()
response = ... |
def test_to_file_assert_filetype():
'\n Asserts whether an error is thrown if the output file is not json or geojson\n :return:\n '
output_file = './out.shp' | -9,188,493,300,800,411,000 | Asserts whether an error is thrown if the output file is not json or geojson
:return: | src/ohsome/tests/test_ohsome_client.py | test_to_file_assert_filetype | redfrexx/osm_association_rules | python | def test_to_file_assert_filetype():
'\n Asserts whether an error is thrown if the output file is not json or geojson\n :return:\n '
output_file = './out.shp' |
def test_format_coordinates():
'\n Asserts that coordinates of a MultiPolygon are concerted correctly\n :return:\n '
bpolys = geojson.FeatureCollection([{'type': 'Feature', 'geometry': {'coordinates': [[[[13, 51], [13, 51.1], [13.1, 51.1], [13.1, 51], [13, 51]], [[13, 51], [14, 51.1], [14.1, 51.1], [14... | -4,140,947,888,958,577,000 | Asserts that coordinates of a MultiPolygon are concerted correctly
:return: | src/ohsome/tests/test_ohsome_client.py | test_format_coordinates | redfrexx/osm_association_rules | python | def test_format_coordinates():
'\n Asserts that coordinates of a MultiPolygon are concerted correctly\n :return:\n '
bpolys = geojson.FeatureCollection([{'type': 'Feature', 'geometry': {'coordinates': [[[[13, 51], [13, 51.1], [13.1, 51.1], [13.1, 51], [13, 51]], [[13, 51], [14, 51.1], [14.1, 51.1], [14... |
def test_promise_return():
'\n Testing that when a workflow is local executed but a local wf execution context already exists, Promise objects\n are returned wrapping Flyte literals instead of the unpacked dict.\n '
@task
def t1(a: int) -> typing.NamedTuple('OutputsBC', t1_int_output=int, c=str):
... | -1,850,010,718,450,448,600 | Testing that when a workflow is local executed but a local wf execution context already exists, Promise objects
are returned wrapping Flyte literals instead of the unpacked dict. | tests/flytekit/unit/core/test_type_hints.py | test_promise_return | ThomVett/flytek | python | def test_promise_return():
'\n Testing that when a workflow is local executed but a local wf execution context already exists, Promise objects\n are returned wrapping Flyte literals instead of the unpacked dict.\n '
@task
def t1(a: int) -> typing.NamedTuple('OutputsBC', t1_int_output=int, c=str):
... |
def __init__(__self__, *, storage_class_name: pulumi.Input[str], api_version: Optional[pulumi.Input[str]]=None, capacity: Optional[pulumi.Input[str]]=None, kind: Optional[pulumi.Input[str]]=None, maximum_volume_size: Optional[pulumi.Input[str]]=None, metadata: Optional[pulumi.Input['_meta.v1.ObjectMetaArgs']]=None, nod... | -1,888,684,912,498,286,300 | The set of arguments for constructing a CSIStorageCapacity resource.
:param pulumi.Input[str] storage_class_name: The name of the StorageClass that the reported capacity applies to. It must meet the same requirements as the name of a StorageClass object (non-empty, DNS subdomain). If that object no longer exists, the C... | sdk/python/pulumi_kubernetes/storage/v1beta1/CSIStorageCapacity.py | __init__ | Teshel/pulumi-kubernetes | python | def __init__(__self__, *, storage_class_name: pulumi.Input[str], api_version: Optional[pulumi.Input[str]]=None, capacity: Optional[pulumi.Input[str]]=None, kind: Optional[pulumi.Input[str]]=None, maximum_volume_size: Optional[pulumi.Input[str]]=None, metadata: Optional[pulumi.Input['_meta.v1.ObjectMetaArgs']]=None, nod... |
@property
@pulumi.getter(name='storageClassName')
def storage_class_name(self) -> pulumi.Input[str]:
'\n The name of the StorageClass that the reported capacity applies to. It must meet the same requirements as the name of a StorageClass object (non-empty, DNS subdomain). If that object no longer exists, the... | -7,997,320,526,267,109,000 | The name of the StorageClass that the reported capacity applies to. It must meet the same requirements as the name of a StorageClass object (non-empty, DNS subdomain). If that object no longer exists, the CSIStorageCapacity object is obsolete and should be removed by its creator. This field is immutable. | sdk/python/pulumi_kubernetes/storage/v1beta1/CSIStorageCapacity.py | storage_class_name | Teshel/pulumi-kubernetes | python | @property
@pulumi.getter(name='storageClassName')
def storage_class_name(self) -> pulumi.Input[str]:
'\n \n '
return pulumi.get(self, 'storage_class_name') |
@property
@pulumi.getter(name='apiVersion')
def api_version(self) -> Optional[pulumi.Input[str]]:
'\n APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git... | 2,540,031,417,868,839,000 | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | sdk/python/pulumi_kubernetes/storage/v1beta1/CSIStorageCapacity.py | api_version | Teshel/pulumi-kubernetes | python | @property
@pulumi.getter(name='apiVersion')
def api_version(self) -> Optional[pulumi.Input[str]]:
'\n \n '
return pulumi.get(self, 'api_version') |
@property
@pulumi.getter
def capacity(self) -> Optional[pulumi.Input[str]]:
'\n Capacity is the value reported by the CSI driver in its GetCapacityResponse for a GetCapacityRequest with topology and parameters that match the previous fields.\n\n The semantic is currently (CSI spec 1.2) defined as: The... | 6,273,461,043,150,981,000 | Capacity is the value reported by the CSI driver in its GetCapacityResponse for a GetCapacityRequest with topology and parameters that match the previous fields.
The semantic is currently (CSI spec 1.2) defined as: The available capacity, in bytes, of the storage that can be used to provision volumes. If not set, that... | sdk/python/pulumi_kubernetes/storage/v1beta1/CSIStorageCapacity.py | capacity | Teshel/pulumi-kubernetes | python | @property
@pulumi.getter
def capacity(self) -> Optional[pulumi.Input[str]]:
'\n Capacity is the value reported by the CSI driver in its GetCapacityResponse for a GetCapacityRequest with topology and parameters that match the previous fields.\n\n The semantic is currently (CSI spec 1.2) defined as: The... |
@property
@pulumi.getter
def kind(self) -> Optional[pulumi.Input[str]]:
'\n Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contribut... | -7,224,738,725,622,071,000 | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | sdk/python/pulumi_kubernetes/storage/v1beta1/CSIStorageCapacity.py | kind | Teshel/pulumi-kubernetes | python | @property
@pulumi.getter
def kind(self) -> Optional[pulumi.Input[str]]:
'\n \n '
return pulumi.get(self, 'kind') |
@property
@pulumi.getter(name='maximumVolumeSize')
def maximum_volume_size(self) -> Optional[pulumi.Input[str]]:
'\n MaximumVolumeSize is the value reported by the CSI driver in its GetCapacityResponse for a GetCapacityRequest with topology and parameters that match the previous fields.\n\n This is de... | -8,693,613,806,452,367,000 | MaximumVolumeSize is the value reported by the CSI driver in its GetCapacityResponse for a GetCapacityRequest with topology and parameters that match the previous fields.
This is defined since CSI spec 1.4.0 as the largest size that may be used in a CreateVolumeRequest.capacity_range.required_bytes field to create a v... | sdk/python/pulumi_kubernetes/storage/v1beta1/CSIStorageCapacity.py | maximum_volume_size | Teshel/pulumi-kubernetes | python | @property
@pulumi.getter(name='maximumVolumeSize')
def maximum_volume_size(self) -> Optional[pulumi.Input[str]]:
'\n MaximumVolumeSize is the value reported by the CSI driver in its GetCapacityResponse for a GetCapacityRequest with topology and parameters that match the previous fields.\n\n This is de... |
@property
@pulumi.getter
def metadata(self) -> Optional[pulumi.Input['_meta.v1.ObjectMetaArgs']]:
"\n Standard object's metadata. The name has no particular meaning. It must be be a DNS subdomain (dots allowed, 253 characters). To ensure that there are no conflicts with other CSI drivers on the cluster, the ... | 3,211,347,561,544,616,000 | Standard object's metadata. The name has no particular meaning. It must be be a DNS subdomain (dots allowed, 253 characters). To ensure that there are no conflicts with other CSI drivers on the cluster, the recommendation is to use csisc-<uuid>, a generated name, or a reverse-domain name which ends with the unique CSI ... | sdk/python/pulumi_kubernetes/storage/v1beta1/CSIStorageCapacity.py | metadata | Teshel/pulumi-kubernetes | python | @property
@pulumi.getter
def metadata(self) -> Optional[pulumi.Input['_meta.v1.ObjectMetaArgs']]:
"\n Standard object's metadata. The name has no particular meaning. It must be be a DNS subdomain (dots allowed, 253 characters). To ensure that there are no conflicts with other CSI drivers on the cluster, the ... |
@property
@pulumi.getter(name='nodeTopology')
def node_topology(self) -> Optional[pulumi.Input['_meta.v1.LabelSelectorArgs']]:
'\n NodeTopology defines which nodes have access to the storage for which capacity was reported. If not set, the storage is not accessible from any node in the cluster. If empty, the... | 1,422,756,585,959,106,600 | NodeTopology defines which nodes have access to the storage for which capacity was reported. If not set, the storage is not accessible from any node in the cluster. If empty, the storage is accessible from all nodes. This field is immutable. | sdk/python/pulumi_kubernetes/storage/v1beta1/CSIStorageCapacity.py | node_topology | Teshel/pulumi-kubernetes | python | @property
@pulumi.getter(name='nodeTopology')
def node_topology(self) -> Optional[pulumi.Input['_meta.v1.LabelSelectorArgs']]:
'\n \n '
return pulumi.get(self, 'node_topology') |
@overload
def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions]=None, api_version: Optional[pulumi.Input[str]]=None, capacity: Optional[pulumi.Input[str]]=None, kind: Optional[pulumi.Input[str]]=None, maximum_volume_size: Optional[pulumi.Input[str]]=None, metadata: Optional[pulumi.Input[pulu... | 2,079,734,043,246,291,500 | CSIStorageCapacity stores the result of one CSI GetCapacity call. For a given StorageClass, this describes the available capacity in a particular topology segment. This can be used when considering where to instantiate new PersistentVolumes.
For example this can express things like: - StorageClass "standard" has "123... | sdk/python/pulumi_kubernetes/storage/v1beta1/CSIStorageCapacity.py | __init__ | Teshel/pulumi-kubernetes | python | @overload
def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions]=None, api_version: Optional[pulumi.Input[str]]=None, capacity: Optional[pulumi.Input[str]]=None, kind: Optional[pulumi.Input[str]]=None, maximum_volume_size: Optional[pulumi.Input[str]]=None, metadata: Optional[pulumi.Input[pulu... |
@overload
def __init__(__self__, resource_name: str, args: CSIStorageCapacityArgs, opts: Optional[pulumi.ResourceOptions]=None):
'\n CSIStorageCapacity stores the result of one CSI GetCapacity call. For a given StorageClass, this describes the available capacity in a particular topology segment. This can be... | -1,265,522,706,516,158,700 | CSIStorageCapacity stores the result of one CSI GetCapacity call. For a given StorageClass, this describes the available capacity in a particular topology segment. This can be used when considering where to instantiate new PersistentVolumes.
For example this can express things like: - StorageClass "standard" has "123... | sdk/python/pulumi_kubernetes/storage/v1beta1/CSIStorageCapacity.py | __init__ | Teshel/pulumi-kubernetes | python | @overload
def __init__(__self__, resource_name: str, args: CSIStorageCapacityArgs, opts: Optional[pulumi.ResourceOptions]=None):
'\n CSIStorageCapacity stores the result of one CSI GetCapacity call. For a given StorageClass, this describes the available capacity in a particular topology segment. This can be... |
@staticmethod
def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions]=None) -> 'CSIStorageCapacity':
"\n Get an existing CSIStorageCapacity resource's state with the given name, id, and optional extra\n properties used to qualify the lookup.\n\n :param str reso... | 4,905,509,871,798,751,000 | Get an existing CSIStorageCapacity resource's state with the given name, id, and optional extra
properties used to qualify the lookup.
:param str resource_name: The unique name of the resulting resource.
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
:param pulumi.ResourceOptions opts: ... | sdk/python/pulumi_kubernetes/storage/v1beta1/CSIStorageCapacity.py | get | Teshel/pulumi-kubernetes | python | @staticmethod
def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions]=None) -> 'CSIStorageCapacity':
"\n Get an existing CSIStorageCapacity resource's state with the given name, id, and optional extra\n properties used to qualify the lookup.\n\n :param str reso... |
@property
@pulumi.getter(name='apiVersion')
def api_version(self) -> pulumi.Output[Optional[str]]:
'\n APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://gi... | 3,559,738,647,590,309,000 | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | sdk/python/pulumi_kubernetes/storage/v1beta1/CSIStorageCapacity.py | api_version | Teshel/pulumi-kubernetes | python | @property
@pulumi.getter(name='apiVersion')
def api_version(self) -> pulumi.Output[Optional[str]]:
'\n \n '
return pulumi.get(self, 'api_version') |
@property
@pulumi.getter
def capacity(self) -> pulumi.Output[Optional[str]]:
'\n Capacity is the value reported by the CSI driver in its GetCapacityResponse for a GetCapacityRequest with topology and parameters that match the previous fields.\n\n The semantic is currently (CSI spec 1.2) defined as: Th... | -2,227,383,833,680,026,600 | Capacity is the value reported by the CSI driver in its GetCapacityResponse for a GetCapacityRequest with topology and parameters that match the previous fields.
The semantic is currently (CSI spec 1.2) defined as: The available capacity, in bytes, of the storage that can be used to provision volumes. If not set, that... | sdk/python/pulumi_kubernetes/storage/v1beta1/CSIStorageCapacity.py | capacity | Teshel/pulumi-kubernetes | python | @property
@pulumi.getter
def capacity(self) -> pulumi.Output[Optional[str]]:
'\n Capacity is the value reported by the CSI driver in its GetCapacityResponse for a GetCapacityRequest with topology and parameters that match the previous fields.\n\n The semantic is currently (CSI spec 1.2) defined as: Th... |
@property
@pulumi.getter
def kind(self) -> pulumi.Output[Optional[str]]:
'\n Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contribu... | 3,342,389,159,407,362,600 | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | sdk/python/pulumi_kubernetes/storage/v1beta1/CSIStorageCapacity.py | kind | Teshel/pulumi-kubernetes | python | @property
@pulumi.getter
def kind(self) -> pulumi.Output[Optional[str]]:
'\n \n '
return pulumi.get(self, 'kind') |
@property
@pulumi.getter(name='maximumVolumeSize')
def maximum_volume_size(self) -> pulumi.Output[Optional[str]]:
'\n MaximumVolumeSize is the value reported by the CSI driver in its GetCapacityResponse for a GetCapacityRequest with topology and parameters that match the previous fields.\n\n This is d... | -1,424,734,522,101,174,300 | MaximumVolumeSize is the value reported by the CSI driver in its GetCapacityResponse for a GetCapacityRequest with topology and parameters that match the previous fields.
This is defined since CSI spec 1.4.0 as the largest size that may be used in a CreateVolumeRequest.capacity_range.required_bytes field to create a v... | sdk/python/pulumi_kubernetes/storage/v1beta1/CSIStorageCapacity.py | maximum_volume_size | Teshel/pulumi-kubernetes | python | @property
@pulumi.getter(name='maximumVolumeSize')
def maximum_volume_size(self) -> pulumi.Output[Optional[str]]:
'\n MaximumVolumeSize is the value reported by the CSI driver in its GetCapacityResponse for a GetCapacityRequest with topology and parameters that match the previous fields.\n\n This is d... |
@property
@pulumi.getter
def metadata(self) -> pulumi.Output[Optional['_meta.v1.outputs.ObjectMeta']]:
"\n Standard object's metadata. The name has no particular meaning. It must be be a DNS subdomain (dots allowed, 253 characters). To ensure that there are no conflicts with other CSI drivers on the cluster,... | -1,247,645,133,006,876,400 | Standard object's metadata. The name has no particular meaning. It must be be a DNS subdomain (dots allowed, 253 characters). To ensure that there are no conflicts with other CSI drivers on the cluster, the recommendation is to use csisc-<uuid>, a generated name, or a reverse-domain name which ends with the unique CSI ... | sdk/python/pulumi_kubernetes/storage/v1beta1/CSIStorageCapacity.py | metadata | Teshel/pulumi-kubernetes | python | @property
@pulumi.getter
def metadata(self) -> pulumi.Output[Optional['_meta.v1.outputs.ObjectMeta']]:
"\n Standard object's metadata. The name has no particular meaning. It must be be a DNS subdomain (dots allowed, 253 characters). To ensure that there are no conflicts with other CSI drivers on the cluster,... |
@property
@pulumi.getter(name='nodeTopology')
def node_topology(self) -> pulumi.Output[Optional['_meta.v1.outputs.LabelSelector']]:
'\n NodeTopology defines which nodes have access to the storage for which capacity was reported. If not set, the storage is not accessible from any node in the cluster. If empty... | 551,171,195,398,054,000 | NodeTopology defines which nodes have access to the storage for which capacity was reported. If not set, the storage is not accessible from any node in the cluster. If empty, the storage is accessible from all nodes. This field is immutable. | sdk/python/pulumi_kubernetes/storage/v1beta1/CSIStorageCapacity.py | node_topology | Teshel/pulumi-kubernetes | python | @property
@pulumi.getter(name='nodeTopology')
def node_topology(self) -> pulumi.Output[Optional['_meta.v1.outputs.LabelSelector']]:
'\n \n '
return pulumi.get(self, 'node_topology') |
@property
@pulumi.getter(name='storageClassName')
def storage_class_name(self) -> pulumi.Output[str]:
'\n The name of the StorageClass that the reported capacity applies to. It must meet the same requirements as the name of a StorageClass object (non-empty, DNS subdomain). If that object no longer exists, th... | -8,851,942,988,545,265,000 | The name of the StorageClass that the reported capacity applies to. It must meet the same requirements as the name of a StorageClass object (non-empty, DNS subdomain). If that object no longer exists, the CSIStorageCapacity object is obsolete and should be removed by its creator. This field is immutable. | sdk/python/pulumi_kubernetes/storage/v1beta1/CSIStorageCapacity.py | storage_class_name | Teshel/pulumi-kubernetes | python | @property
@pulumi.getter(name='storageClassName')
def storage_class_name(self) -> pulumi.Output[str]:
'\n \n '
return pulumi.get(self, 'storage_class_name') |
def is_git_dir(self):
'\n 判断是否为git目录\n\n @param path:\n @return:\n '
d = (self.path + '/.git')
if osp.isdir(d):
if (osp.isdir(osp.join(d, 'objects')) and osp.isdir(osp.join(d, 'refs'))):
headref = osp.join(d, 'HEAD')
return (osp.isfile(headref) or ... | 1,796,436,861,509,386,200 | 判断是否为git目录
@param path:
@return: | walle/service/git/repo.py | is_git_dir | lgq9220/walle-web | python | def is_git_dir(self):
'\n 判断是否为git目录\n\n @param path:\n @return:\n '
d = (self.path + '/.git')
if osp.isdir(d):
if (osp.isdir(osp.join(d, 'objects')) and osp.isdir(osp.join(d, 'refs'))):
headref = osp.join(d, 'HEAD')
return (osp.isfile(headref) or ... |
def clone(self, url):
'\n 检出项目\n\n @param branch:\n @param kwargs:\n @return:\n '
return PyRepo.clone_from(url, self.path) | -4,446,506,467,057,233,000 | 检出项目
@param branch:
@param kwargs:
@return: | walle/service/git/repo.py | clone | lgq9220/walle-web | python | def clone(self, url):
'\n 检出项目\n\n @param branch:\n @param kwargs:\n @return:\n '
return PyRepo.clone_from(url, self.path) |
def pull(self):
'\n 更新项目\n\n @param branch:\n @param kwargs:\n @return:\n '
repo = PyRepo(self.path)
return repo.remote().pull() | -2,441,616,973,202,321,000 | 更新项目
@param branch:
@param kwargs:
@return: | walle/service/git/repo.py | pull | lgq9220/walle-web | python | def pull(self):
'\n 更新项目\n\n @param branch:\n @param kwargs:\n @return:\n '
repo = PyRepo(self.path)
return repo.remote().pull() |
def checkout_2_commit(self, branch, commit):
'\n @todo 未完成\n @param branch:\n @param commit:\n @return:\n '
PyRepo(self.path).git.checkout(branch)
PyRepo(self.path).head.set_commit(commit) | -5,856,124,168,358,864,000 | @todo 未完成
@param branch:
@param commit:
@return: | walle/service/git/repo.py | checkout_2_commit | lgq9220/walle-web | python | def checkout_2_commit(self, branch, commit):
'\n @todo 未完成\n @param branch:\n @param commit:\n @return:\n '
PyRepo(self.path).git.checkout(branch)
PyRepo(self.path).head.set_commit(commit) |
def branches(self):
'\n 获取所有分支\n\n @param branch:\n @param kwargs:\n @return:\n '
branches = PyRepo(self.path).remote().refs
return [str(branch).strip().lstrip('origin').lstrip('/') for branch in branches if (not str(branch).strip().startswith('origin/HEAD'))] | 2,956,419,816,064,421,400 | 获取所有分支
@param branch:
@param kwargs:
@return: | walle/service/git/repo.py | branches | lgq9220/walle-web | python | def branches(self):
'\n 获取所有分支\n\n @param branch:\n @param kwargs:\n @return:\n '
branches = PyRepo(self.path).remote().refs
return [str(branch).strip().lstrip('origin').lstrip('/') for branch in branches if (not str(branch).strip().startswith('origin/HEAD'))] |
def tags(self):
'\n 获取所有tag\n\n @param branch:\n @param kwargs:\n @return:\n '
return [str(tag) for tag in PyRepo(self.path).tags] | 3,719,169,435,290,927,000 | 获取所有tag
@param branch:
@param kwargs:
@return: | walle/service/git/repo.py | tags | lgq9220/walle-web | python | def tags(self):
'\n 获取所有tag\n\n @param branch:\n @param kwargs:\n @return:\n '
return [str(tag) for tag in PyRepo(self.path).tags] |
def commits(self, branch):
'\n 获取分支的commits\n\n @param branch:\n @param kwargs:\n @return:\n '
self.checkout_2_branch(branch)
commit_log = PyGit.Git(self.path).log('--pretty=%h #@_@# %an #@_@# %s', max_count=50)
commit_list = commit_log.split('\n')
commits = []
... | 7,243,843,317,773,868,000 | 获取分支的commits
@param branch:
@param kwargs:
@return: | walle/service/git/repo.py | commits | lgq9220/walle-web | python | def commits(self, branch):
'\n 获取分支的commits\n\n @param branch:\n @param kwargs:\n @return:\n '
self.checkout_2_branch(branch)
commit_log = PyGit.Git(self.path).log('--pretty=%h #@_@# %an #@_@# %s', max_count=50)
commit_list = commit_log.split('\n')
commits = []
... |
def test_regular(self, posturl, s3conn, pubsub, crash_generator):
'Post a valid crash and verify the contents made it to S3.'
(raw_crash, dumps) = crash_generator.generate()
crash_payload = mini_poster.assemble_crash_payload_dict(raw_crash, dumps)
resp = mini_poster.post_crash(posturl, crash_payload, du... | 99,417,856,098,789,150 | Post a valid crash and verify the contents made it to S3. | tests/systemtest/test_post_crash.py | test_regular | Mozilla-GitHub-Standards/ca053cb8c97310481ca4524f115cd80002b8bbd773c6bdc00eb9955dd3d48e83 | python | def test_regular(self, posturl, s3conn, pubsub, crash_generator):
(raw_crash, dumps) = crash_generator.generate()
crash_payload = mini_poster.assemble_crash_payload_dict(raw_crash, dumps)
resp = mini_poster.post_crash(posturl, crash_payload, dumps)
time.sleep(SLEEP_TIME)
crash_id = content_to_c... |
def test_compressed_crash(self, posturl, s3conn, pubsub, crash_generator):
'Post a compressed crash and verify contents made it to S3.'
(raw_crash, dumps) = crash_generator.generate()
crash_payload = mini_poster.assemble_crash_payload_dict(raw_crash, dumps)
resp = mini_poster.post_crash(posturl, crash_p... | -54,558,160,317,365,016 | Post a compressed crash and verify contents made it to S3. | tests/systemtest/test_post_crash.py | test_compressed_crash | Mozilla-GitHub-Standards/ca053cb8c97310481ca4524f115cd80002b8bbd773c6bdc00eb9955dd3d48e83 | python | def test_compressed_crash(self, posturl, s3conn, pubsub, crash_generator):
(raw_crash, dumps) = crash_generator.generate()
crash_payload = mini_poster.assemble_crash_payload_dict(raw_crash, dumps)
resp = mini_poster.post_crash(posturl, crash_payload, compressed=True)
time.sleep(SLEEP_TIME)
cras... |
@app.route('/', methods=['GET'])
def server_status():
'\n Get status.\n ---\n describe: get status\n responses:\n 200:\n description: OK\n '
logger.info('GET /')
return ('', 200) | -8,569,340,285,813,509,000 | Get status.
---
describe: get status
responses:
200:
description: OK | dcs_rest_client.py | server_status | 5GEVE/5geve-wp4-dcs-signalling-topic-handler | python | @app.route('/', methods=['GET'])
def server_status():
'\n Get status.\n ---\n describe: get status\n responses:\n 200:\n description: OK\n '
logger.info('GET /')
return (, 200) |
@app.route('/spec', methods=['GET'])
def spec():
'\n Get swagger specification.\n ---\n describe: get swagger specification\n responses:\n swagger:\n description: swagger specification\n '
swag = swagger(app)
swag['info']['version'] = '1.0'
swag['info']['title'] = 'DCS REST AP... | 3,071,032,749,776,101,000 | Get swagger specification.
---
describe: get swagger specification
responses:
swagger:
description: swagger specification | dcs_rest_client.py | spec | 5GEVE/5geve-wp4-dcs-signalling-topic-handler | python | @app.route('/spec', methods=['GET'])
def spec():
'\n Get swagger specification.\n ---\n describe: get swagger specification\n responses:\n swagger:\n description: swagger specification\n '
swag = swagger(app)
swag['info']['version'] = '1.0'
swag['info']['title'] = 'DCS REST AP... |
@app.route('/portal/dcs/start_signalling/', methods=['POST'])
def start_dcs():
'\n Start signalling topics.\n ---\n describe: start signalling topics\n responses:\n 201:\n description: accepted request\n 400:\n description: error processing the request\n '
logger.info('Req... | 6,490,691,433,022,938,000 | Start signalling topics.
---
describe: start signalling topics
responses:
201:
description: accepted request
400:
description: error processing the request | dcs_rest_client.py | start_dcs | 5GEVE/5geve-wp4-dcs-signalling-topic-handler | python | @app.route('/portal/dcs/start_signalling/', methods=['POST'])
def start_dcs():
'\n Start signalling topics.\n ---\n describe: start signalling topics\n responses:\n 201:\n description: accepted request\n 400:\n description: error processing the request\n '
logger.info('Req... |
@app.route('/portal/dcs/stop_signalling/', methods=['DELETE'])
def stop_dcs():
'\n Stop signalling topics.\n ---\n describe: stop signalling topics\n responses:\n 201:\n description: accepted request\n 400:\n description: error processing the request\n '
logger.info('Reque... | -1,923,893,096,943,920,000 | Stop signalling topics.
---
describe: stop signalling topics
responses:
201:
description: accepted request
400:
description: error processing the request | dcs_rest_client.py | stop_dcs | 5GEVE/5geve-wp4-dcs-signalling-topic-handler | python | @app.route('/portal/dcs/stop_signalling/', methods=['DELETE'])
def stop_dcs():
'\n Stop signalling topics.\n ---\n describe: stop signalling topics\n responses:\n 201:\n description: accepted request\n 400:\n description: error processing the request\n '
logger.info('Reque... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.