body_hash stringlengths 64 64 | body stringlengths 23 109k | docstring stringlengths 1 57k | path stringlengths 4 198 | name stringlengths 1 115 | repository_name stringlengths 7 111 | repository_stars float64 0 191k | lang stringclasses 1
value | body_without_docstring stringlengths 14 108k | unified stringlengths 45 133k |
|---|---|---|---|---|---|---|---|---|---|
e6843de2d70bf38954a05a146ec782290ff0c7f638ea74335b172c31b6687602 | def __init__(self, host='localhost', user=None, passwd='', database=None, port=3306, unix_socket=None, charset='', sql_mode=None, read_default_file=None, conv=decoders, use_unicode=None, client_flag=0, cursorclass=Cursor, init_command=None, connect_timeout=None, ssl=None, read_default_group=None, compress=None, named_p... | Establish a connection to the MySQL database. Accepts several
arguments:
host: Host where the database server is located
user: Username to log in as
passwd: Password to use.
database: Database to use, None to not use a particular one.
port: MySQL port to use, default is usually OK.
unix_socket: Optionally, you can use... | asynctorndb/connection.py | __init__ | mayflaver/AsyncTorndb | 103 | python | def __init__(self, host='localhost', user=None, passwd=, database=None, port=3306, unix_socket=None, charset=, sql_mode=None, read_default_file=None, conv=decoders, use_unicode=None, client_flag=0, cursorclass=Cursor, init_command=None, connect_timeout=None, ssl=None, read_default_group=None, compress=None, named_pipe=... | def __init__(self, host='localhost', user=None, passwd=, database=None, port=3306, unix_socket=None, charset=, sql_mode=None, read_default_file=None, conv=decoders, use_unicode=None, client_flag=0, cursorclass=Cursor, init_command=None, connect_timeout=None, ssl=None, read_default_group=None, compress=None, named_pipe=... |
77203e983723c9c3a26e0ef0250259aa610d8ecef9bbba42e28947b3d30b76e3 | @coroutine
def close(self):
' Send the quit message and close the socket '
if self.stream.closed():
raise Error('Already closed')
send_data = (struct.pack('<i', 1) + int2byte(COM_QUIT))
try:
(yield self.stream.write(send_data))
except Exception:
pass
finally:
self... | Send the quit message and close the socket | asynctorndb/connection.py | close | mayflaver/AsyncTorndb | 103 | python | @coroutine
def close(self):
' '
if self.stream.closed():
raise Error('Already closed')
send_data = (struct.pack('<i', 1) + int2byte(COM_QUIT))
try:
(yield self.stream.write(send_data))
except Exception:
pass
finally:
self.stream.close()
self.stream = None | @coroutine
def close(self):
' '
if self.stream.closed():
raise Error('Already closed')
send_data = (struct.pack('<i', 1) + int2byte(COM_QUIT))
try:
(yield self.stream.write(send_data))
except Exception:
pass
finally:
self.stream.close()
self.stream = None... |
f793d272d784f2100a08f4f709ac8bb5c05bf9432d4d0205d9e52415a23aefee | @coroutine
def _send_autocommit_mode(self):
' Set whether or not to commit after every execute() '
self._execute_command(COM_QUERY, ('SET AUTOCOMMIT = %s' % self.escape(self.autocommit_mode)))
(yield self._read_ok_packet()) | Set whether or not to commit after every execute() | asynctorndb/connection.py | _send_autocommit_mode | mayflaver/AsyncTorndb | 103 | python | @coroutine
def _send_autocommit_mode(self):
' '
self._execute_command(COM_QUERY, ('SET AUTOCOMMIT = %s' % self.escape(self.autocommit_mode)))
(yield self._read_ok_packet()) | @coroutine
def _send_autocommit_mode(self):
' '
self._execute_command(COM_QUERY, ('SET AUTOCOMMIT = %s' % self.escape(self.autocommit_mode)))
(yield self._read_ok_packet())<|docstring|>Set whether or not to commit after every execute()<|endoftext|> |
4248b5cdbb9f9ba533c76318aa483a34421d7cdfec88bdc1b26bafc106735559 | @coroutine
def commit(self):
' Commit changes to stable storage '
self._execute_command(COM_QUERY, 'COMMIT')
(yield self._read_ok_packet()) | Commit changes to stable storage | asynctorndb/connection.py | commit | mayflaver/AsyncTorndb | 103 | python | @coroutine
def commit(self):
' '
self._execute_command(COM_QUERY, 'COMMIT')
(yield self._read_ok_packet()) | @coroutine
def commit(self):
' '
self._execute_command(COM_QUERY, 'COMMIT')
(yield self._read_ok_packet())<|docstring|>Commit changes to stable storage<|endoftext|> |
207f216fdd24e9a5042c1331ffafb8dd7861a3c64efc6164defc302c782b6305 | @coroutine
def rollback(self):
' Roll back the current transaction '
(yield self._execute_command(COM_QUERY, 'ROLLBACK'))
(yield self._read_ok_packet()) | Roll back the current transaction | asynctorndb/connection.py | rollback | mayflaver/AsyncTorndb | 103 | python | @coroutine
def rollback(self):
' '
(yield self._execute_command(COM_QUERY, 'ROLLBACK'))
(yield self._read_ok_packet()) | @coroutine
def rollback(self):
' '
(yield self._execute_command(COM_QUERY, 'ROLLBACK'))
(yield self._read_ok_packet())<|docstring|>Roll back the current transaction<|endoftext|> |
30da28a9ba880e0d9b98716ace96819103d6f60e2a86c002b44e4a73569b2ff7 | @coroutine
def select_db(self, db):
'Set current db'
(yield self._execute_command(COM_INIT_DB, db))
(yield self._read_ok_packet()) | Set current db | asynctorndb/connection.py | select_db | mayflaver/AsyncTorndb | 103 | python | @coroutine
def select_db(self, db):
(yield self._execute_command(COM_INIT_DB, db))
(yield self._read_ok_packet()) | @coroutine
def select_db(self, db):
(yield self._execute_command(COM_INIT_DB, db))
(yield self._read_ok_packet())<|docstring|>Set current db<|endoftext|> |
aa8a4838ff689668790e3f0c1bb93bb5f64a4ba8a57738f33201e97c76e94183 | def escape(self, obj):
' Escape whatever value you pass to it '
if isinstance(obj, str_type):
return (("'" + self.escape_string(obj)) + "'")
return escape_item(obj, self.charset) | Escape whatever value you pass to it | asynctorndb/connection.py | escape | mayflaver/AsyncTorndb | 103 | python | def escape(self, obj):
' '
if isinstance(obj, str_type):
return (("'" + self.escape_string(obj)) + "'")
return escape_item(obj, self.charset) | def escape(self, obj):
' '
if isinstance(obj, str_type):
return (("'" + self.escape_string(obj)) + "'")
return escape_item(obj, self.charset)<|docstring|>Escape whatever value you pass to it<|endoftext|> |
465011ceb4399dd42cf42227c3f2f407d4c45a5683ac6a0915d759f2d50dac7d | def literal(self, obj):
'Alias for escape()'
return self.escape(obj) | Alias for escape() | asynctorndb/connection.py | literal | mayflaver/AsyncTorndb | 103 | python | def literal(self, obj):
return self.escape(obj) | def literal(self, obj):
return self.escape(obj)<|docstring|>Alias for escape()<|endoftext|> |
d26a0f6f23bf2918ee6bc50638a66969e229a10255726bdbf871e3de755ff609 | def cursor(self, cursor=None):
' Create a new cursor to execute queries with '
if cursor:
return cursor(self)
return self.cursorclass(self) | Create a new cursor to execute queries with | asynctorndb/connection.py | cursor | mayflaver/AsyncTorndb | 103 | python | def cursor(self, cursor=None):
' '
if cursor:
return cursor(self)
return self.cursorclass(self) | def cursor(self, cursor=None):
' '
if cursor:
return cursor(self)
return self.cursorclass(self)<|docstring|>Create a new cursor to execute queries with<|endoftext|> |
3b92166da523960b4ca2411ab7c7f9186d061f806d1296ff1072816d8d0f3778 | def __enter__(self):
' Context manager that returns a Cursor '
return self.cursor() | Context manager that returns a Cursor | asynctorndb/connection.py | __enter__ | mayflaver/AsyncTorndb | 103 | python | def __enter__(self):
' '
return self.cursor() | def __enter__(self):
' '
return self.cursor()<|docstring|>Context manager that returns a Cursor<|endoftext|> |
cb5fa828fb96b1eee737d252a1733d164859dcd29264fef9c7e1641483d698ce | @coroutine
def __exit__(self, exc, value, traceback):
' On successful exit, commit. On exception, rollback. '
if exc:
(yield self.rollback())
else:
(yield self.commit()) | On successful exit, commit. On exception, rollback. | asynctorndb/connection.py | __exit__ | mayflaver/AsyncTorndb | 103 | python | @coroutine
def __exit__(self, exc, value, traceback):
' '
if exc:
(yield self.rollback())
else:
(yield self.commit()) | @coroutine
def __exit__(self, exc, value, traceback):
' '
if exc:
(yield self.rollback())
else:
(yield self.commit())<|docstring|>On successful exit, commit. On exception, rollback.<|endoftext|> |
dda212a01dfac34c4569c411938e9b3567375862a62bdbbf3186b836ce02491f | @coroutine
def query(self, sql, *args):
'Returns a row list for the given query and parameters.'
cur = self.cursor()
try:
(yield cur.execute(sql, *args))
column_names = [d[0] for d in cur.description]
raise Return([Row(zip(column_names, row)) for row in cur])
finally:
cur... | Returns a row list for the given query and parameters. | asynctorndb/connection.py | query | mayflaver/AsyncTorndb | 103 | python | @coroutine
def query(self, sql, *args):
cur = self.cursor()
try:
(yield cur.execute(sql, *args))
column_names = [d[0] for d in cur.description]
raise Return([Row(zip(column_names, row)) for row in cur])
finally:
cur.close() | @coroutine
def query(self, sql, *args):
cur = self.cursor()
try:
(yield cur.execute(sql, *args))
column_names = [d[0] for d in cur.description]
raise Return([Row(zip(column_names, row)) for row in cur])
finally:
cur.close()<|docstring|>Returns a row list for the given qu... |
0b4ad3a82cd800b4c1dba5b8595da05e7178c1e4b96299516a210faf226fae5d | @coroutine
def get(self, sql, *args):
'Returns the (singular) row returned by the given query.\n \n If the query has no results, returns None. If it has\n more than one result, raises an exception.\n '
rows = (yield self.query(sql, *args))
if (not rows):
raise Return(None)
... | Returns the (singular) row returned by the given query.
If the query has no results, returns None. If it has
more than one result, raises an exception. | asynctorndb/connection.py | get | mayflaver/AsyncTorndb | 103 | python | @coroutine
def get(self, sql, *args):
'Returns the (singular) row returned by the given query.\n \n If the query has no results, returns None. If it has\n more than one result, raises an exception.\n '
rows = (yield self.query(sql, *args))
if (not rows):
raise Return(None)
... | @coroutine
def get(self, sql, *args):
'Returns the (singular) row returned by the given query.\n \n If the query has no results, returns None. If it has\n more than one result, raises an exception.\n '
rows = (yield self.query(sql, *args))
if (not rows):
raise Return(None)
... |
2a493e955a17cfb387aa184bca4742b513a81907f6e61e7dc9f12cdb9d9adadf | @coroutine
def execute(self, sql, *args):
'Executes the given query, returning the lastrowid from the query.'
raise Return((yield self.execute_lastrowid(sql, *args))) | Executes the given query, returning the lastrowid from the query. | asynctorndb/connection.py | execute | mayflaver/AsyncTorndb | 103 | python | @coroutine
def execute(self, sql, *args):
raise Return((yield self.execute_lastrowid(sql, *args))) | @coroutine
def execute(self, sql, *args):
raise Return((yield self.execute_lastrowid(sql, *args)))<|docstring|>Executes the given query, returning the lastrowid from the query.<|endoftext|> |
4f2c61522a570876a64d2eef24f6d3cd04f3f47ffd5bcf4cb695fafde639a3c9 | @coroutine
def execute_lastrowid(self, sql, *args):
'Executes the given query, returning the lastrowid from the query.'
cur = self.cursor()
try:
(yield self._execute(cur, sql, *args))
raise Return(cur.lastrowid)
finally:
cur.close() | Executes the given query, returning the lastrowid from the query. | asynctorndb/connection.py | execute_lastrowid | mayflaver/AsyncTorndb | 103 | python | @coroutine
def execute_lastrowid(self, sql, *args):
cur = self.cursor()
try:
(yield self._execute(cur, sql, *args))
raise Return(cur.lastrowid)
finally:
cur.close() | @coroutine
def execute_lastrowid(self, sql, *args):
cur = self.cursor()
try:
(yield self._execute(cur, sql, *args))
raise Return(cur.lastrowid)
finally:
cur.close()<|docstring|>Executes the given query, returning the lastrowid from the query.<|endoftext|> |
3fccb9a6ffbe3e47ef83f7b670a9543963733e5544ca64f5f4e35fb598b30879 | @coroutine
def execute_rowcount(self, sql, *args):
'Executes the given query, returning the rowcount from the query.'
cur = self.cursor()
try:
(yield self._execute(cur, sql, *args))
raise Return(cur.rowcount)
finally:
cur.close() | Executes the given query, returning the rowcount from the query. | asynctorndb/connection.py | execute_rowcount | mayflaver/AsyncTorndb | 103 | python | @coroutine
def execute_rowcount(self, sql, *args):
cur = self.cursor()
try:
(yield self._execute(cur, sql, *args))
raise Return(cur.rowcount)
finally:
cur.close() | @coroutine
def execute_rowcount(self, sql, *args):
cur = self.cursor()
try:
(yield self._execute(cur, sql, *args))
raise Return(cur.rowcount)
finally:
cur.close()<|docstring|>Executes the given query, returning the rowcount from the query.<|endoftext|> |
d2d196e782c712454c108e683b043edb5dd592da3b69b8bda34446de5a81235c | @coroutine
def executemany(self, sql, args):
'Executes the given query against all the given param sequences.\n\n We return the lastrowid from the query.\n '
raise Return((yield self.executemany_lastrowid(sql, args))) | Executes the given query against all the given param sequences.
We return the lastrowid from the query. | asynctorndb/connection.py | executemany | mayflaver/AsyncTorndb | 103 | python | @coroutine
def executemany(self, sql, args):
'Executes the given query against all the given param sequences.\n\n We return the lastrowid from the query.\n '
raise Return((yield self.executemany_lastrowid(sql, args))) | @coroutine
def executemany(self, sql, args):
'Executes the given query against all the given param sequences.\n\n We return the lastrowid from the query.\n '
raise Return((yield self.executemany_lastrowid(sql, args)))<|docstring|>Executes the given query against all the given param sequences.
We ... |
a375c1a40d92a541f11ec463ccb5d9c4e0c50c056c350a0605d4e7a1370ca33d | @coroutine
def executemany_lastrowid(self, sql, args):
'Executes the given query against all the given param sequences.\n\n We return the lastrowid from the query.\n '
cur = self.cursor()
try:
(yield cur.executemany(sql, args))
raise Return(cur.lastrowid)
finally:
c... | Executes the given query against all the given param sequences.
We return the lastrowid from the query. | asynctorndb/connection.py | executemany_lastrowid | mayflaver/AsyncTorndb | 103 | python | @coroutine
def executemany_lastrowid(self, sql, args):
'Executes the given query against all the given param sequences.\n\n We return the lastrowid from the query.\n '
cur = self.cursor()
try:
(yield cur.executemany(sql, args))
raise Return(cur.lastrowid)
finally:
c... | @coroutine
def executemany_lastrowid(self, sql, args):
'Executes the given query against all the given param sequences.\n\n We return the lastrowid from the query.\n '
cur = self.cursor()
try:
(yield cur.executemany(sql, args))
raise Return(cur.lastrowid)
finally:
c... |
a698318ad340832d5bc5225ae7e27fdd1edcf0dcff7df755c5c1229eeca21193 | @coroutine
def executemany_rowcount(self, sql, args):
'Executes the given query against all the given param sequences.\n\n We return the rowcount from the query.\n '
cur = self.cursor()
try:
(yield cur.executemany(sql, args))
raise Return(cur.rowcount)
finally:
cur.... | Executes the given query against all the given param sequences.
We return the rowcount from the query. | asynctorndb/connection.py | executemany_rowcount | mayflaver/AsyncTorndb | 103 | python | @coroutine
def executemany_rowcount(self, sql, args):
'Executes the given query against all the given param sequences.\n\n We return the rowcount from the query.\n '
cur = self.cursor()
try:
(yield cur.executemany(sql, args))
raise Return(cur.rowcount)
finally:
cur.... | @coroutine
def executemany_rowcount(self, sql, args):
'Executes the given query against all the given param sequences.\n\n We return the rowcount from the query.\n '
cur = self.cursor()
try:
(yield cur.executemany(sql, args))
raise Return(cur.rowcount)
finally:
cur.... |
abfec0e564be9158ea64461ec5db6841e63eee266e2cc8f739169dd06b1e3cec | def ping(self, reconnect=True):
' Check if the server is alive '
if (self.socket is None):
if reconnect:
self._connect()
reconnect = False
else:
raise Error('Already closed')
try:
self._execute_command(COM_PING, '')
return self._read_ok_pac... | Check if the server is alive | asynctorndb/connection.py | ping | mayflaver/AsyncTorndb | 103 | python | def ping(self, reconnect=True):
' '
if (self.socket is None):
if reconnect:
self._connect()
reconnect = False
else:
raise Error('Already closed')
try:
self._execute_command(COM_PING, )
return self._read_ok_packet()
except Exception:
... | def ping(self, reconnect=True):
' '
if (self.socket is None):
if reconnect:
self._connect()
reconnect = False
else:
raise Error('Already closed')
try:
self._execute_command(COM_PING, )
return self._read_ok_packet()
except Exception:
... |
b61757288896040b2e9625db22136fac3746c48bc9559b17902694d34b74553b | @coroutine
def _read_packet(self, packet_type=MysqlPacket):
'Read an entire "mysql packet" in its entirety from the network\n and return a MysqlPacket type that represents the results.\n '
packet = packet_type(self)
(yield packet.recv_packet())
packet.check_error()
raise Return(packet) | Read an entire "mysql packet" in its entirety from the network
and return a MysqlPacket type that represents the results. | asynctorndb/connection.py | _read_packet | mayflaver/AsyncTorndb | 103 | python | @coroutine
def _read_packet(self, packet_type=MysqlPacket):
'Read an entire "mysql packet" in its entirety from the network\n and return a MysqlPacket type that represents the results.\n '
packet = packet_type(self)
(yield packet.recv_packet())
packet.check_error()
raise Return(packet) | @coroutine
def _read_packet(self, packet_type=MysqlPacket):
'Read an entire "mysql packet" in its entirety from the network\n and return a MysqlPacket type that represents the results.\n '
packet = packet_type(self)
(yield packet.recv_packet())
packet.check_error()
raise Return(packet)... |
c570dc702a17c36f36b6914db926b76d7367bd0f167a20bd49a5f515b8f749a0 | @coroutine
def _read_rowdata_packet(self):
'Read a rowdata packet for each data row in the result set.'
rows = []
while True:
packet = MysqlPacket(self.connection)
buff = b''
while True:
packet_header = (yield self.connection.stream.read_bytes(4))
if DEBUG:
... | Read a rowdata packet for each data row in the result set. | asynctorndb/connection.py | _read_rowdata_packet | mayflaver/AsyncTorndb | 103 | python | @coroutine
def _read_rowdata_packet(self):
rows = []
while True:
packet = MysqlPacket(self.connection)
buff = b
while True:
packet_header = (yield self.connection.stream.read_bytes(4))
if DEBUG:
dump_packet(packet_header)
packet_le... | @coroutine
def _read_rowdata_packet(self):
rows = []
while True:
packet = MysqlPacket(self.connection)
buff = b
while True:
packet_header = (yield self.connection.stream.read_bytes(4))
if DEBUG:
dump_packet(packet_header)
packet_le... |
e39fa8f7cefdd754379d1309b1ffde548363dcd13e5a38113385442a346639de | @coroutine
def _get_descriptions(self):
'Read a column descriptor packet for each column in the result.'
self.fields = []
description = []
for i in range_type(self.field_count):
field = (yield self.connection._read_packet(FieldDescriptorPacket))
self.fields.append(field)
descript... | Read a column descriptor packet for each column in the result. | asynctorndb/connection.py | _get_descriptions | mayflaver/AsyncTorndb | 103 | python | @coroutine
def _get_descriptions(self):
self.fields = []
description = []
for i in range_type(self.field_count):
field = (yield self.connection._read_packet(FieldDescriptorPacket))
self.fields.append(field)
description.append(field.description())
eof_packet = (yield self.con... | @coroutine
def _get_descriptions(self):
self.fields = []
description = []
for i in range_type(self.field_count):
field = (yield self.connection._read_packet(FieldDescriptorPacket))
self.fields.append(field)
description.append(field.description())
eof_packet = (yield self.con... |
8e651b3718a8e1ed5acb36dda5944acabf2c55bc6120ca0643674f959bd0568f | @property
def libs(self):
"Export the libraries of SuiteSparse.\n Sample usage: spec['suite-sparse'].libs.ld_flags\n spec['suite-sparse:klu,btf'].libs.ld_flags\n "
all_comps = ['klu', 'btf', 'umfpack', 'cholmod', 'colamd', 'amd', 'camd', 'ccolamd', 'cxsparse', 'ldl', 'rbio', '... | Export the libraries of SuiteSparse.
Sample usage: spec['suite-sparse'].libs.ld_flags
spec['suite-sparse:klu,btf'].libs.ld_flags | var/spack/repos/builtin/packages/suite-sparse/package.py | libs | kresan/spack | 3 | python | @property
def libs(self):
"Export the libraries of SuiteSparse.\n Sample usage: spec['suite-sparse'].libs.ld_flags\n spec['suite-sparse:klu,btf'].libs.ld_flags\n "
all_comps = ['klu', 'btf', 'umfpack', 'cholmod', 'colamd', 'amd', 'camd', 'ccolamd', 'cxsparse', 'ldl', 'rbio', '... | @property
def libs(self):
"Export the libraries of SuiteSparse.\n Sample usage: spec['suite-sparse'].libs.ld_flags\n spec['suite-sparse:klu,btf'].libs.ld_flags\n "
all_comps = ['klu', 'btf', 'umfpack', 'cholmod', 'colamd', 'amd', 'camd', 'ccolamd', 'cxsparse', 'ldl', 'rbio', '... |
2381f372cd69d06a1d537f33efad7eb509bcb034362f2c65cf6f64f51a2547a1 | def test_get_system_date_time(self):
'\n Test we are able to get the correct time\n '
t1 = datetime.datetime.now()
res = self.run_function('system.get_system_date_time')
t2 = datetime.datetime.strptime(res, self.fmt_str)
msg = 'Difference in times is too large. Now: {0} Fake: {1}'.form... | Test we are able to get the correct time | tests/integration/modules/system.py | test_get_system_date_time | ahammond/salt | 0 | python | def test_get_system_date_time(self):
'\n \n '
t1 = datetime.datetime.now()
res = self.run_function('system.get_system_date_time')
t2 = datetime.datetime.strptime(res, self.fmt_str)
msg = 'Difference in times is too large. Now: {0} Fake: {1}'.format(t1, t2)
self.assertTrue(self._sam... | def test_get_system_date_time(self):
'\n \n '
t1 = datetime.datetime.now()
res = self.run_function('system.get_system_date_time')
t2 = datetime.datetime.strptime(res, self.fmt_str)
msg = 'Difference in times is too large. Now: {0} Fake: {1}'.format(t1, t2)
self.assertTrue(self._sam... |
763b095b9cdf7c1de8080271b283f9d7c2283c4b040ca3ca8cf62d5c84facc73 | def test_get_system_date_time_utc(self):
'\n Test we are able to get the correct time with utc\n '
t1 = datetime.datetime.utcnow()
res = self.run_function('system.get_system_date_time', utc=True)
t2 = datetime.datetime.strptime(res, self.fmt_str)
msg = 'Difference in times is too large... | Test we are able to get the correct time with utc | tests/integration/modules/system.py | test_get_system_date_time_utc | ahammond/salt | 0 | python | def test_get_system_date_time_utc(self):
'\n \n '
t1 = datetime.datetime.utcnow()
res = self.run_function('system.get_system_date_time', utc=True)
t2 = datetime.datetime.strptime(res, self.fmt_str)
msg = 'Difference in times is too large. Now: {0} Fake: {1}'.format(t1, t2)
self.ass... | def test_get_system_date_time_utc(self):
'\n \n '
t1 = datetime.datetime.utcnow()
res = self.run_function('system.get_system_date_time', utc=True)
t2 = datetime.datetime.strptime(res, self.fmt_str)
msg = 'Difference in times is too large. Now: {0} Fake: {1}'.format(t1, t2)
self.ass... |
f53e63ba71570e82fec718e93c9c95d40f5a1a2385fbe89ee8a538f777f098d2 | @destructiveTest
@skipIf((os.geteuid() != 0), 'you must be root to run this test')
def test_set_system_date_time(self):
'\n Test changing the system clock. We are only able to set it up to a\n resolution of a second so this test may appear to run in negative time.\n '
self._fake_time = date... | Test changing the system clock. We are only able to set it up to a
resolution of a second so this test may appear to run in negative time. | tests/integration/modules/system.py | test_set_system_date_time | ahammond/salt | 0 | python | @destructiveTest
@skipIf((os.geteuid() != 0), 'you must be root to run this test')
def test_set_system_date_time(self):
'\n Test changing the system clock. We are only able to set it up to a\n resolution of a second so this test may appear to run in negative time.\n '
self._fake_time = date... | @destructiveTest
@skipIf((os.geteuid() != 0), 'you must be root to run this test')
def test_set_system_date_time(self):
'\n Test changing the system clock. We are only able to set it up to a\n resolution of a second so this test may appear to run in negative time.\n '
self._fake_time = date... |
92020a1fed25a8a16207de286e32304305e8e48fb0473d55217bc60dc0425f41 | @destructiveTest
@skipIf((os.geteuid() != 0), 'you must be root to run this test')
def test_set_system_date_time_utc(self):
'\n Test changing the system clock. We are only able to set it up to a\n resolution of a second so this test may appear to run in negative time.\n '
self._fake_time = ... | Test changing the system clock. We are only able to set it up to a
resolution of a second so this test may appear to run in negative time. | tests/integration/modules/system.py | test_set_system_date_time_utc | ahammond/salt | 0 | python | @destructiveTest
@skipIf((os.geteuid() != 0), 'you must be root to run this test')
def test_set_system_date_time_utc(self):
'\n Test changing the system clock. We are only able to set it up to a\n resolution of a second so this test may appear to run in negative time.\n '
self._fake_time = ... | @destructiveTest
@skipIf((os.geteuid() != 0), 'you must be root to run this test')
def test_set_system_date_time_utc(self):
'\n Test changing the system clock. We are only able to set it up to a\n resolution of a second so this test may appear to run in negative time.\n '
self._fake_time = ... |
06f7c5455a39f1143d72966058dc25288293b1f4fc431fd65150704e91aa12bd | @destructiveTest
@skipIf((os.geteuid() != 0), 'you must be root to run this test')
def test_set_system_date_time_posix(self):
'\n Test changing the system clock. We are only able to set it up to a\n resolution of a second so this test may appear to run in negative time.\n '
self._fake_time ... | Test changing the system clock. We are only able to set it up to a
resolution of a second so this test may appear to run in negative time. | tests/integration/modules/system.py | test_set_system_date_time_posix | ahammond/salt | 0 | python | @destructiveTest
@skipIf((os.geteuid() != 0), 'you must be root to run this test')
def test_set_system_date_time_posix(self):
'\n Test changing the system clock. We are only able to set it up to a\n resolution of a second so this test may appear to run in negative time.\n '
self._fake_time ... | @destructiveTest
@skipIf((os.geteuid() != 0), 'you must be root to run this test')
def test_set_system_date_time_posix(self):
'\n Test changing the system clock. We are only able to set it up to a\n resolution of a second so this test may appear to run in negative time.\n '
self._fake_time ... |
81948af8fc56b3bbe9898f60edc5c58a6d4200fd32e0a002e6d44b9ad16ecee7 | @destructiveTest
@skipIf((os.geteuid() != 0), 'you must be root to run this test')
def test_set_system_date_time_posix_utc(self):
'\n Test changing the system clock. We are only able to set it up to a\n resolution of a second so this test may appear to run in negative time.\n '
self._fake_t... | Test changing the system clock. We are only able to set it up to a
resolution of a second so this test may appear to run in negative time. | tests/integration/modules/system.py | test_set_system_date_time_posix_utc | ahammond/salt | 0 | python | @destructiveTest
@skipIf((os.geteuid() != 0), 'you must be root to run this test')
def test_set_system_date_time_posix_utc(self):
'\n Test changing the system clock. We are only able to set it up to a\n resolution of a second so this test may appear to run in negative time.\n '
self._fake_t... | @destructiveTest
@skipIf((os.geteuid() != 0), 'you must be root to run this test')
def test_set_system_date_time_posix_utc(self):
'\n Test changing the system clock. We are only able to set it up to a\n resolution of a second so this test may appear to run in negative time.\n '
self._fake_t... |
5aae2047c1b14f8bb0a7335eabd191b0120c173cca1767a66c76a4297fcedc31 | @destructiveTest
@skipIf((os.geteuid() != 0), 'you must be root to run this test')
def test_set_system_time(self):
'\n Test setting the system time without adjusting the date.\n '
self._fake_time = datetime.datetime.combine(datetime.date.today(), datetime.time(4, 5, 0))
self._save_time()
r... | Test setting the system time without adjusting the date. | tests/integration/modules/system.py | test_set_system_time | ahammond/salt | 0 | python | @destructiveTest
@skipIf((os.geteuid() != 0), 'you must be root to run this test')
def test_set_system_time(self):
'\n \n '
self._fake_time = datetime.datetime.combine(datetime.date.today(), datetime.time(4, 5, 0))
self._save_time()
result = self.run_function('system.set_system_time', ['04... | @destructiveTest
@skipIf((os.geteuid() != 0), 'you must be root to run this test')
def test_set_system_time(self):
'\n \n '
self._fake_time = datetime.datetime.combine(datetime.date.today(), datetime.time(4, 5, 0))
self._save_time()
result = self.run_function('system.set_system_time', ['04... |
fa4e4a06ff03ce7b7597b56496581c96ece734c9fa9db4e138796890d2baa1ae | @destructiveTest
@skipIf((os.geteuid() != 0), 'you must be root to run this test')
def test_set_system_date(self):
'\n Test setting the system date without adjusting the time.\n '
self._fake_time = datetime.datetime.combine(datetime.datetime(2000, 12, 25), datetime.datetime.now().time())
self.... | Test setting the system date without adjusting the time. | tests/integration/modules/system.py | test_set_system_date | ahammond/salt | 0 | python | @destructiveTest
@skipIf((os.geteuid() != 0), 'you must be root to run this test')
def test_set_system_date(self):
'\n \n '
self._fake_time = datetime.datetime.combine(datetime.datetime(2000, 12, 25), datetime.datetime.now().time())
self._save_time()
result = self.run_function('system.set_... | @destructiveTest
@skipIf((os.geteuid() != 0), 'you must be root to run this test')
def test_set_system_date(self):
'\n \n '
self._fake_time = datetime.datetime.combine(datetime.datetime(2000, 12, 25), datetime.datetime.now().time())
self._save_time()
result = self.run_function('system.set_... |
2268b181a174287b1abd966174e76f19d5f96ce71822b4cf74e8ff388ac41f02 | def delete_user(self: api_client.Api, path_params: RequestPathParams=frozendict(), stream: bool=False, timeout: typing.Optional[typing.Union[(int, typing.Tuple)]]=None, skip_deserialization: bool=False) -> typing.Union[api_client.ApiResponseWithoutDeserialization]:
'\n Delete user\n :param skip_deseri... | Delete user
:param skip_deserialization: If true then api_response.response will be set but
api_response.body and api_response.headers will not be deserialized into schema
class instances | samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api_endpoints/delete_user.py | delete_user | joaocmendes/openapi-generator | 0 | python | def delete_user(self: api_client.Api, path_params: RequestPathParams=frozendict(), stream: bool=False, timeout: typing.Optional[typing.Union[(int, typing.Tuple)]]=None, skip_deserialization: bool=False) -> typing.Union[api_client.ApiResponseWithoutDeserialization]:
'\n Delete user\n :param skip_deseri... | def delete_user(self: api_client.Api, path_params: RequestPathParams=frozendict(), stream: bool=False, timeout: typing.Optional[typing.Union[(int, typing.Tuple)]]=None, skip_deserialization: bool=False) -> typing.Union[api_client.ApiResponseWithoutDeserialization]:
'\n Delete user\n :param skip_deseri... |
f08fca5774b8a7114e55b445758dc106c276399f6612dd169676c85fab35bfec | def angles_mean(time, rad, angles, path):
'Generate mean along angles for single simulation.'
out = readpvd(task_root=path, task_id='model', pcs='GROUNDWATER_FLOW')
rt_head = np.zeros((time.shape + rad.shape), dtype=float)
for (select, step) in enumerate(time):
points = out['DATA'][select]['poin... | Generate mean along angles for single simulation. | src/01_run_sim.py | angles_mean | GeoStat-Examples/gstools-pumping-test-ensemble | 2 | python | def angles_mean(time, rad, angles, path):
out = readpvd(task_root=path, task_id='model', pcs='GROUNDWATER_FLOW')
rt_head = np.zeros((time.shape + rad.shape), dtype=float)
for (select, step) in enumerate(time):
points = out['DATA'][select]['points']
radii = np.sqrt(((points[(:, 0)] ** 2)... | def angles_mean(time, rad, angles, path):
out = readpvd(task_root=path, task_id='model', pcs='GROUNDWATER_FLOW')
rt_head = np.zeros((time.shape + rad.shape), dtype=float)
for (select, step) in enumerate(time):
points = out['DATA'][select]['points']
radii = np.sqrt(((points[(:, 0)] ** 2)... |
26495a597c8b366b8186c2d53d5d825addef9008272fae3bbd64263d108aa0f6 | def random_pred_test_data(size: int, seed: int=4321):
'Return a tuple of random tensors representing test and pred. data'
y_pred = tf.random.stateless_normal((size,), seed=(seed, 0))
y_test = tf.random.stateless_normal((size,), seed=(seed, 1))
return (y_pred, y_test) | Return a tuple of random tensors representing test and pred. data | rlo/test/rlo/test_losses.py | random_pred_test_data | tomjaguarpaw/knossos-ksc | 31 | python | def random_pred_test_data(size: int, seed: int=4321):
y_pred = tf.random.stateless_normal((size,), seed=(seed, 0))
y_test = tf.random.stateless_normal((size,), seed=(seed, 1))
return (y_pred, y_test) | def random_pred_test_data(size: int, seed: int=4321):
y_pred = tf.random.stateless_normal((size,), seed=(seed, 0))
y_test = tf.random.stateless_normal((size,), seed=(seed, 1))
return (y_pred, y_test)<|docstring|>Return a tuple of random tensors representing test and pred. data<|endoftext|> |
48657ee3292afd08c4c171f4e07591a342b65edf75c65163472b1fe37ad5ea9e | def check_same_as_tensorflow(ours, theirs):
'Test our "unreduced" implementation (ours) gives the same value as the tensorflow implementation (theirs) after averaging'
size = 1024
(y_pred, y_test) = random_pred_test_data(size)
actual = tf.reduce_mean(ours(y_pred, y_test))
expected = theirs(y_pred, y... | Test our "unreduced" implementation (ours) gives the same value as the tensorflow implementation (theirs) after averaging | rlo/test/rlo/test_losses.py | check_same_as_tensorflow | tomjaguarpaw/knossos-ksc | 31 | python | def check_same_as_tensorflow(ours, theirs):
size = 1024
(y_pred, y_test) = random_pred_test_data(size)
actual = tf.reduce_mean(ours(y_pred, y_test))
expected = theirs(y_pred, y_test)
np.testing.assert_allclose(actual.numpy(), expected.numpy(), rtol=1e-05) | def check_same_as_tensorflow(ours, theirs):
size = 1024
(y_pred, y_test) = random_pred_test_data(size)
actual = tf.reduce_mean(ours(y_pred, y_test))
expected = theirs(y_pred, y_test)
np.testing.assert_allclose(actual.numpy(), expected.numpy(), rtol=1e-05)<|docstring|>Test our "unreduced" implem... |
763c316624ae5b3a3919288d718e4cd2612909272418360a640d4d281caeddaf | def align_face(img, size=(512, 512)):
'\n :param img: input photo, numpy array\n :param size: output shape\n :return: output align face image\n '
if ((img.shape[0] * img.shape[1]) > (512 * 512)):
img = cv2.resize(img, (0, 0), fx=0.5, fy=0.5)
(detector, predictor, facerec) = generate_det... | :param img: input photo, numpy array
:param size: output shape
:return: output align face image | neural/align.py | align_face | Hengle/face-nn | 319 | python | def align_face(img, size=(512, 512)):
'\n :param img: input photo, numpy array\n :param size: output shape\n :return: output align face image\n '
if ((img.shape[0] * img.shape[1]) > (512 * 512)):
img = cv2.resize(img, (0, 0), fx=0.5, fy=0.5)
(detector, predictor, facerec) = generate_det... | def align_face(img, size=(512, 512)):
'\n :param img: input photo, numpy array\n :param size: output shape\n :return: output align face image\n '
if ((img.shape[0] * img.shape[1]) > (512 * 512)):
img = cv2.resize(img, (0, 0), fx=0.5, fy=0.5)
(detector, predictor, facerec) = generate_det... |
21d0927414b6da90443e8f4f629474acf34a8ff56c41af29f177e4d5d6a91e83 | def face_features(path_img, path_save=None):
'\n 提取脸部特征图片\n :param path_img: input photo path, str\n :param path_save: output save image path, str\n :return:\n '
try:
img = cv2.imread(path_img)
if ((img.shape[0] * img.shape[1]) > (512 * 512)):
img = cv2.resize(img, (0,... | 提取脸部特征图片
:param path_img: input photo path, str
:param path_save: output save image path, str
:return: | neural/align.py | face_features | Hengle/face-nn | 319 | python | def face_features(path_img, path_save=None):
'\n 提取脸部特征图片\n :param path_img: input photo path, str\n :param path_save: output save image path, str\n :return:\n '
try:
img = cv2.imread(path_img)
if ((img.shape[0] * img.shape[1]) > (512 * 512)):
img = cv2.resize(img, (0,... | def face_features(path_img, path_save=None):
'\n 提取脸部特征图片\n :param path_img: input photo path, str\n :param path_save: output save image path, str\n :return:\n '
try:
img = cv2.imread(path_img)
if ((img.shape[0] * img.shape[1]) > (512 * 512)):
img = cv2.resize(img, (0,... |
15518380346f8eb5d27e09b3e785d885b97e8061af4d63eeafec75131402763d | def sampling(args):
'Reparameterization trick by sampling fr an isotropic unit Gaussian.\n Arguments\n args (tensor): mean and log of variance of Q(z|X)\n Returns\n z (tensor): sampled latent vector\n '
epsilon_mean = 0.0
epsilon_std = 1.0
(z_mean, z_log_var)... | Reparameterization trick by sampling fr an isotropic unit Gaussian.
Arguments
args (tensor): mean and log of variance of Q(z|X)
Returns
z (tensor): sampled latent vector | Generative_Models/Variational_AE/VAE.py | sampling | Romit-Maulik/Tutorials-Demos-Practice | 8 | python | def sampling(args):
'Reparameterization trick by sampling fr an isotropic unit Gaussian.\n Arguments\n args (tensor): mean and log of variance of Q(z|X)\n Returns\n z (tensor): sampled latent vector\n '
epsilon_mean = 0.0
epsilon_std = 1.0
(z_mean, z_log_var)... | def sampling(args):
'Reparameterization trick by sampling fr an isotropic unit Gaussian.\n Arguments\n args (tensor): mean and log of variance of Q(z|X)\n Returns\n z (tensor): sampled latent vector\n '
epsilon_mean = 0.0
epsilon_std = 1.0
(z_mean, z_log_var)... |
f8ee8306b8b4128398be654320cbddffda671037fc0e021158f61c3cb4faf7a6 | @plugin.register(chain='pricing', requires=['ventures', 'devices'])
def splunk(**kwargs):
'Updates Splunk usage per Venture'
if (not settings.SPLUNK_HOST):
return (False, 'Not configured.', kwargs)
try:
splunk_venture = Venture.objects.get(symbol='splunk_unknown_usage')
except Venture.Do... | Updates Splunk usage per Venture | src/ralph_pricing/plugins/splunk.py | splunk | andrzej-jankowski/ralph_pricing | 0 | python | @plugin.register(chain='pricing', requires=['ventures', 'devices'])
def splunk(**kwargs):
if (not settings.SPLUNK_HOST):
return (False, 'Not configured.', kwargs)
try:
splunk_venture = Venture.objects.get(symbol='splunk_unknown_usage')
except Venture.DoesNotExist:
return (False,... | @plugin.register(chain='pricing', requires=['ventures', 'devices'])
def splunk(**kwargs):
if (not settings.SPLUNK_HOST):
return (False, 'Not configured.', kwargs)
try:
splunk_venture = Venture.objects.get(symbol='splunk_unknown_usage')
except Venture.DoesNotExist:
return (False,... |
3bf0d0f81f65ce78461c30cf6998d7faa5cf16f0747a0f0c39dfd04298000e6d | def setUp(self):
'\n Setup for the tests\n '
super(TestFuzzService, self).setUp()
self.domain_list = [{'domain': 'mywebsite.com'}]
self.origin_list = [{'origin': 'mywebsite1.com', 'port': 443, 'ssl': False}]
self.caching_list = [{'name': 'default', 'ttl': 3600}, {'name': 'home', 'ttl':... | Setup for the tests | tests/security/services/test_fuzz_services.py | setUp | jqxin2006/poppy | 0 | python | def setUp(self):
'\n \n '
super(TestFuzzService, self).setUp()
self.domain_list = [{'domain': 'mywebsite.com'}]
self.origin_list = [{'origin': 'mywebsite1.com', 'port': 443, 'ssl': False}]
self.caching_list = [{'name': 'default', 'ttl': 3600}, {'name': 'home', 'ttl': 1200, 'rules': [{'... | def setUp(self):
'\n \n '
super(TestFuzzService, self).setUp()
self.domain_list = [{'domain': 'mywebsite.com'}]
self.origin_list = [{'origin': 'mywebsite1.com', 'port': 443, 'ssl': False}]
self.caching_list = [{'name': 'default', 'ttl': 3600}, {'name': 'home', 'ttl': 1200, 'rules': [{'... |
1f9533a887122573c44459dc29507d7dd6707880cccbcdca84093045994d4a34 | def reset_defaults(self):
'\n Reset domain_list, origin_list, caching_list, service_name\n and flavor_id to its default value.\n '
self.domain_list = [{'domain': 'mywebsite.com'}]
self.origin_list = [{'origin': 'mywebsite1.com', 'port': 443, 'ssl': False}]
self.caching_list = [{'nam... | Reset domain_list, origin_list, caching_list, service_name
and flavor_id to its default value. | tests/security/services/test_fuzz_services.py | reset_defaults | jqxin2006/poppy | 0 | python | def reset_defaults(self):
'\n Reset domain_list, origin_list, caching_list, service_name\n and flavor_id to its default value.\n '
self.domain_list = [{'domain': 'mywebsite.com'}]
self.origin_list = [{'origin': 'mywebsite1.com', 'port': 443, 'ssl': False}]
self.caching_list = [{'nam... | def reset_defaults(self):
'\n Reset domain_list, origin_list, caching_list, service_name\n and flavor_id to its default value.\n '
self.domain_list = [{'domain': 'mywebsite.com'}]
self.origin_list = [{'origin': 'mywebsite1.com', 'port': 443, 'ssl': False}]
self.caching_list = [{'nam... |
8e06620f0e33f30dcd452d00a36b284cbe361197025ecd48baf360a98e1f14d7 | def check_one_request(self):
'\n Check the response of one request to see whether the application\n generates any 500 errors.\n '
resp = self.client.create_service(service_name=self.service_name, domain_list=self.domain_list, origin_list=self.origin_list, caching_list=self.caching_list, res... | Check the response of one request to see whether the application
generates any 500 errors. | tests/security/services/test_fuzz_services.py | check_one_request | jqxin2006/poppy | 0 | python | def check_one_request(self):
'\n Check the response of one request to see whether the application\n generates any 500 errors.\n '
resp = self.client.create_service(service_name=self.service_name, domain_list=self.domain_list, origin_list=self.origin_list, caching_list=self.caching_list, res... | def check_one_request(self):
'\n Check the response of one request to see whether the application\n generates any 500 errors.\n '
resp = self.client.create_service(service_name=self.service_name, domain_list=self.domain_list, origin_list=self.origin_list, caching_list=self.caching_list, res... |
a8bb756a3bf81772df0cb9c7103324f5d760602fae2d5e3aef6badf967d8f4b9 | @attrib.attr('fuzz')
@ddt.file_data('data_fuzz.json')
def test_fuzz_create_service(self, test_data):
'\n Fuzz the create service calls to see whether 500 errors are generated.\n '
test_string = test_data['fuzz_string']
for key in self.domain_list[0]:
self.service_name = str(uuid.uuid1(... | Fuzz the create service calls to see whether 500 errors are generated. | tests/security/services/test_fuzz_services.py | test_fuzz_create_service | jqxin2006/poppy | 0 | python | @attrib.attr('fuzz')
@ddt.file_data('data_fuzz.json')
def test_fuzz_create_service(self, test_data):
'\n \n '
test_string = test_data['fuzz_string']
for key in self.domain_list[0]:
self.service_name = str(uuid.uuid1())
self.domain_list[0][key] = test_string
self.check_o... | @attrib.attr('fuzz')
@ddt.file_data('data_fuzz.json')
def test_fuzz_create_service(self, test_data):
'\n \n '
test_string = test_data['fuzz_string']
for key in self.domain_list[0]:
self.service_name = str(uuid.uuid1())
self.domain_list[0][key] = test_string
self.check_o... |
555b9296d827ba88c265e461191e1d216599652d2a344093f3443a3952ce54ab | def strip_protocol(url):
'\n Function removing the protocol from the given url.\n\n Args:\n url (str): Target URL as a string.\n\n Returns:\n string: The url without protocol.\n\n '
return PROTOCOL_RE.sub('', url) | Function removing the protocol from the given url.
Args:
url (str): Target URL as a string.
Returns:
string: The url without protocol. | ural/strip_protocol.py | strip_protocol | Yomguithereal/ural | 30 | python | def strip_protocol(url):
'\n Function removing the protocol from the given url.\n\n Args:\n url (str): Target URL as a string.\n\n Returns:\n string: The url without protocol.\n\n '
return PROTOCOL_RE.sub(, url) | def strip_protocol(url):
'\n Function removing the protocol from the given url.\n\n Args:\n url (str): Target URL as a string.\n\n Returns:\n string: The url without protocol.\n\n '
return PROTOCOL_RE.sub(, url)<|docstring|>Function removing the protocol from the given url.
Args:
... |
fa14ac2a74ab90f5c2f6b8d2b43c6c6bad136bc5290a300c908ada9b58fdac41 | def runrootscript(pathname, donotwait):
'Runs script located at given pathname'
if g_dry_run:
iaslog(('Dry run executing root script: %s' % pathname))
return True
try:
if donotwait:
iaslog('Do not wait triggered')
proc = subprocess.Popen(pathname)
... | Runs script located at given pathname | payload/Library/installapplications/installapplications.py | runrootscript | BrandwatchLtd/installapplications | 0 | python | def runrootscript(pathname, donotwait):
if g_dry_run:
iaslog(('Dry run executing root script: %s' % pathname))
return True
try:
if donotwait:
iaslog('Do not wait triggered')
proc = subprocess.Popen(pathname)
iaslog(('Running Script: %s ' % str(pat... | def runrootscript(pathname, donotwait):
if g_dry_run:
iaslog(('Dry run executing root script: %s' % pathname))
return True
try:
if donotwait:
iaslog('Do not wait triggered')
proc = subprocess.Popen(pathname)
iaslog(('Running Script: %s ' % str(pat... |
c74796352a005b7080d0c39fccb348fbe4cbba9150232351d217b41e96a8c11e | def __init__(self, exp_para, image_para, lithosim_para):
'\n Initialization of Neural_ILT_Wrapper\n Args:\n exp_para: experiment-relevant parameters\n image_para: image-relevant parameters\n lithosim_para: lithosim-relevant parameters \n '
print('Laun... | Initialization of Neural_ILT_Wrapper
Args:
exp_para: experiment-relevant parameters
image_para: image-relevant parameters
lithosim_para: lithosim-relevant parameters | neural_ilt.py | __init__ | cuhk-eda/neural-ilt | 14 | python | def __init__(self, exp_para, image_para, lithosim_para):
'\n Initialization of Neural_ILT_Wrapper\n Args:\n exp_para: experiment-relevant parameters\n image_para: image-relevant parameters\n lithosim_para: lithosim-relevant parameters \n '
print('Laun... | def __init__(self, exp_para, image_para, lithosim_para):
'\n Initialization of Neural_ILT_Wrapper\n Args:\n exp_para: experiment-relevant parameters\n image_para: image-relevant parameters\n lithosim_para: lithosim-relevant parameters \n '
print('Laun... |
771fef246d4ef5cce85cb1ca0eca7721b193c38962c8fcfe54a6906aa1d5df28 | def MTRmap(*argv):
' Calculate MTR from a MT "on" and a MT "off" acquisition \n\t \n\n\t INTERFACES\n\t MTRmap(mton_nifti,mtoff_nifti,mtr_output)\n\t MTRmap(mton_nifti,mtoff_nifti,mtr_output,mask_nifti)\n\n\t \n\t PARAMETERS\n\t - mton_nifti: path of a Nifti file storing the 3D MT "on" image ... | Calculate MTR from a MT "on" and a MT "off" acquisition
INTERFACES
MTRmap(mton_nifti,mtoff_nifti,mtr_output)
MTRmap(mton_nifti,mtoff_nifti,mtr_output,mask_nifti)
PARAMETERS
- mton_nifti: path of a Nifti file storing the 3D MT "on" image (with off-res. pulse)
- mtoff_nifti: path of a Nifti file storing the 3D MT ... | myrelax/getMTR.py | MTRmap | fragrussu/MyRelax | 3 | python | def MTRmap(*argv):
' Calculate MTR from a MT "on" and a MT "off" acquisition \n\t \n\n\t INTERFACES\n\t MTRmap(mton_nifti,mtoff_nifti,mtr_output)\n\t MTRmap(mton_nifti,mtoff_nifti,mtr_output,mask_nifti)\n\n\t \n\t PARAMETERS\n\t - mton_nifti: path of a Nifti file storing the 3D MT "on" image ... | def MTRmap(*argv):
' Calculate MTR from a MT "on" and a MT "off" acquisition \n\t \n\n\t INTERFACES\n\t MTRmap(mton_nifti,mtoff_nifti,mtr_output)\n\t MTRmap(mton_nifti,mtoff_nifti,mtr_output,mask_nifti)\n\n\t \n\t PARAMETERS\n\t - mton_nifti: path of a Nifti file storing the 3D MT "on" image ... |
fc1871101f045b8ec772cabd82c92c3767fc1996a1bb8e021f0da5d828fbb4c9 | def add_data(self, field, no_ghost=False):
'Adds a source of data for the block collection.\n\n Given a `data_source` and a `field` to populate from, adds the data\n to the block collection so that is able to be rendered.\n\n Parameters\n ----------\n data_source : YTRegion\n ... | Adds a source of data for the block collection.
Given a `data_source` and a `field` to populate from, adds the data
to the block collection so that is able to be rendered.
Parameters
----------
data_source : YTRegion
A YTRegion object to use as a data source.
field : string
A field to populate from.
no_ghost ... | yt_idv/scene_data/block_collection.py | add_data | chrishavlin/tempidv | 3 | python | def add_data(self, field, no_ghost=False):
'Adds a source of data for the block collection.\n\n Given a `data_source` and a `field` to populate from, adds the data\n to the block collection so that is able to be rendered.\n\n Parameters\n ----------\n data_source : YTRegion\n ... | def add_data(self, field, no_ghost=False):
'Adds a source of data for the block collection.\n\n Given a `data_source` and a `field` to populate from, adds the data\n to the block collection so that is able to be rendered.\n\n Parameters\n ----------\n data_source : YTRegion\n ... |
29b8107c31ee3490c5a78edab3bc63a2a384849ecf61ccfc266540675fcd9bc4 | def eval_fields_3d_no_weights(nc1: int, nc2: int, nc3: int, pad1: int, pad2: int, pad3: int, f_p1: int, f_p2: int, f_p3: int, k1: int, k2: int, k3: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_basis_3: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_spans_... | Parameters
----------
nc1: int
Number of cells in the X direction
nc2: int
Number of cells in the Y direction
nc3: int
Number of cells in the Z direction
pad1: int
Padding in the X direction
pad2: int
Padding in the Y direction
pad3: int
Padding in the Z direction
f_p1: int
Degree in the X... | psydac/core/kernels.py | eval_fields_3d_no_weights | mayuri-dhote/psydac | 0 | python | def eval_fields_3d_no_weights(nc1: int, nc2: int, nc3: int, pad1: int, pad2: int, pad3: int, f_p1: int, f_p2: int, f_p3: int, k1: int, k2: int, k3: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_basis_3: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_spans_... | def eval_fields_3d_no_weights(nc1: int, nc2: int, nc3: int, pad1: int, pad2: int, pad3: int, f_p1: int, f_p2: int, f_p3: int, k1: int, k2: int, k3: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_basis_3: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_spans_... |
34cc5d0e08e3e4a21d096ec44959a7a5b961c2d77e82cc4dcbf1547abcee743b | def eval_fields_2d_no_weights(nc1: int, nc2: int, pad1: int, pad2: int, f_p1: int, f_p2: int, k1: int, k2: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', glob_arr_coeff: 'float[:,:,:]', out_fields: 'float[:,:,:]'):
'\n Parameters\n ... | Parameters
----------
nc1: int
Number of cells in the X direction
nc2: int
Number of cells in the Y direction
pad1: int
Padding in the X direction
pad2: int
Padding in the Y direction
f_p1: int
Degree in the X direction
f_p2: int
Degree in the Y direction
k1: int
Number of evaluation poin... | psydac/core/kernels.py | eval_fields_2d_no_weights | mayuri-dhote/psydac | 0 | python | def eval_fields_2d_no_weights(nc1: int, nc2: int, pad1: int, pad2: int, f_p1: int, f_p2: int, k1: int, k2: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', glob_arr_coeff: 'float[:,:,:]', out_fields: 'float[:,:,:]'):
'\n Parameters\n ... | def eval_fields_2d_no_weights(nc1: int, nc2: int, pad1: int, pad2: int, f_p1: int, f_p2: int, k1: int, k2: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', glob_arr_coeff: 'float[:,:,:]', out_fields: 'float[:,:,:]'):
'\n Parameters\n ... |
732a66e6c7df5071b012a58bf96585620767451b0d3fa603e4ff74bf7190fc27 | def eval_fields_3d_weighted(nc1: int, nc2: int, nc3: int, pad1: int, pad2: int, pad3: int, f_p1: int, f_p2: int, f_p3: int, k1: int, k2: int, k3: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_basis_3: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_spans_3:... | Parameters
----------
nc1: int
Number of cells in the X direction
nc2: int
Number of cells in the Y direction
nc3: int
Number of cells in the Z direction
pad1: int
Padding in the X direction
pad2: int
Padding in the Y direction
pad3: int
Padding in the Z direction
f_p1: int
Degree in the X... | psydac/core/kernels.py | eval_fields_3d_weighted | mayuri-dhote/psydac | 0 | python | def eval_fields_3d_weighted(nc1: int, nc2: int, nc3: int, pad1: int, pad2: int, pad3: int, f_p1: int, f_p2: int, f_p3: int, k1: int, k2: int, k3: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_basis_3: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_spans_3:... | def eval_fields_3d_weighted(nc1: int, nc2: int, nc3: int, pad1: int, pad2: int, pad3: int, f_p1: int, f_p2: int, f_p3: int, k1: int, k2: int, k3: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_basis_3: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_spans_3:... |
de090c3d0fcfd5ae6f64132caeca160355fc24b02f3f6d5f124b4db133db09ec | def eval_fields_2d_weighted(nc1: int, nc2: int, pad1: int, pad2: int, f_p1: int, f_p2: int, k1: int, k2: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_arr_coeff: 'float[:,:,:]', global_arr_weights: 'float[:,:]', out_fields: 'float[:,:... | Parameters
----------
nc1: int
Number of cells in the X direction
nc2: int
Number of cells in the Y direction
pad1: int
Padding in the X direction
pad2: int
Padding in the Y direction
f_p1: int
Degree in the X direction
f_p2: int
Degree in the Y direction
k1: int
Number of evaluation poin... | psydac/core/kernels.py | eval_fields_2d_weighted | mayuri-dhote/psydac | 0 | python | def eval_fields_2d_weighted(nc1: int, nc2: int, pad1: int, pad2: int, f_p1: int, f_p2: int, k1: int, k2: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_arr_coeff: 'float[:,:,:]', global_arr_weights: 'float[:,:]', out_fields: 'float[:,:... | def eval_fields_2d_weighted(nc1: int, nc2: int, pad1: int, pad2: int, f_p1: int, f_p2: int, k1: int, k2: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_arr_coeff: 'float[:,:,:]', global_arr_weights: 'float[:,:]', out_fields: 'float[:,:... |
1be6215d696a2c45a5a140d595b1186121e6c9000c802add063f5695f868653f | def eval_jac_det_3d(nc1: int, nc2: int, nc3: int, pad1: int, pad2: int, pad3: int, f_p1: int, f_p2: int, f_p3: int, k1: int, k2: int, k3: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_basis_3: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_spans_3: 'int[:]... | Parameters
----------
nc1: int
Number of cells in the X direction
nc2: int
Number of cells in the Y direction
nc3: int
Number of cells in the Z direction
pad1: int
Padding in the X direction
pad2: int
Padding in the Y direction
pad3: int
Padding in the Z direction
f_p1: int
Degree in the X... | psydac/core/kernels.py | eval_jac_det_3d | mayuri-dhote/psydac | 0 | python | def eval_jac_det_3d(nc1: int, nc2: int, nc3: int, pad1: int, pad2: int, pad3: int, f_p1: int, f_p2: int, f_p3: int, k1: int, k2: int, k3: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_basis_3: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_spans_3: 'int[:]... | def eval_jac_det_3d(nc1: int, nc2: int, nc3: int, pad1: int, pad2: int, pad3: int, f_p1: int, f_p2: int, f_p3: int, k1: int, k2: int, k3: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_basis_3: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_spans_3: 'int[:]... |
698433e449ac3f6d2b437b27800b308878af7fa3f60305b9b80b6231651cc071 | def eval_jac_det_2d(nc1: int, nc2: int, pad1: int, pad2: int, f_p1: int, f_p2: int, k1: int, k2: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_arr_coeff_x: 'float[:,:]', global_arr_coeff_y: 'float[:,:]', jac_det: 'float[:,:]'):
'\... | Parameters
----------
nc1: int
Number of cells in the X direction
nc2: int
Number of cells in the Y direction
pad1: int
Padding in the X direction
pad2: int
Padding in the Y direction
f_p1: int
Degree in the X direction
f_p2: int
Degree in the Y direction
k1: int
Number of evaluation poin... | psydac/core/kernels.py | eval_jac_det_2d | mayuri-dhote/psydac | 0 | python | def eval_jac_det_2d(nc1: int, nc2: int, pad1: int, pad2: int, f_p1: int, f_p2: int, k1: int, k2: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_arr_coeff_x: 'float[:,:]', global_arr_coeff_y: 'float[:,:]', jac_det: 'float[:,:]'):
'\... | def eval_jac_det_2d(nc1: int, nc2: int, pad1: int, pad2: int, f_p1: int, f_p2: int, k1: int, k2: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_arr_coeff_x: 'float[:,:]', global_arr_coeff_y: 'float[:,:]', jac_det: 'float[:,:]'):
'\... |
33a6732d9bdc5a9f597f6c0189b810101c1df395ac3489f3a19c361b02f21a6c | def eval_jac_det_3d_weights(nc1: int, nc2: int, nc3: int, pad1: int, pad2: int, pad3: int, f_p1: int, f_p2: int, f_p3: int, k1: int, k2: int, k3: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_basis_3: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_spans_3:... | Parameters
----------
nc1: int
Number of cells in the X direction
nc2: int
Number of cells in the Y direction
nc3: int
Number of cells in the Z direction
pad1: int
Padding in the X direction
pad2: int
Padding in the Y direction
pad3: int
Padding in the Z direction
f_p1: int
Degree in the X... | psydac/core/kernels.py | eval_jac_det_3d_weights | mayuri-dhote/psydac | 0 | python | def eval_jac_det_3d_weights(nc1: int, nc2: int, nc3: int, pad1: int, pad2: int, pad3: int, f_p1: int, f_p2: int, f_p3: int, k1: int, k2: int, k3: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_basis_3: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_spans_3:... | def eval_jac_det_3d_weights(nc1: int, nc2: int, nc3: int, pad1: int, pad2: int, pad3: int, f_p1: int, f_p2: int, f_p3: int, k1: int, k2: int, k3: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_basis_3: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_spans_3:... |
21ad3d768a5883c214b26e387d7056737bc7abb4e61a87f65cadf4c367399be5 | def eval_jac_det_2d_weights(nc1: int, nc2: int, pad1: int, pad2: int, f_p1: int, f_p2: int, k1: int, k2: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_arr_coeff_x: 'float[:,:]', global_arr_coeff_y: 'float[:,:]', global_arr_coeff_weigh... | Parameters
----------
nc1: int
Number of cells in the X direction
nc2: int
Number of cells in the Y direction
pad1: int
Padding in the X direction
pad2: int
Padding in the Y direction
f_p1: int
Degree in the X direction
f_p2: int
Degree in the Y direction
k1: int
Number of evaluation poin... | psydac/core/kernels.py | eval_jac_det_2d_weights | mayuri-dhote/psydac | 0 | python | def eval_jac_det_2d_weights(nc1: int, nc2: int, pad1: int, pad2: int, f_p1: int, f_p2: int, k1: int, k2: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_arr_coeff_x: 'float[:,:]', global_arr_coeff_y: 'float[:,:]', global_arr_coeff_weigh... | def eval_jac_det_2d_weights(nc1: int, nc2: int, pad1: int, pad2: int, f_p1: int, f_p2: int, k1: int, k2: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_arr_coeff_x: 'float[:,:]', global_arr_coeff_y: 'float[:,:]', global_arr_coeff_weigh... |
9c986a6c80559f3b4e0f592679678754515908c1f241c3ae13a7a4fa44df7216 | def eval_jacobians_3d(nc1: int, nc2: int, nc3: int, pad1: int, pad2: int, pad3: int, f_p1: int, f_p2: int, f_p3: int, k1: int, k2: int, k3: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_basis_3: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_spans_3: 'int[... | Parameters
----------
nc1: int
Number of cells in the X direction
nc2: int
Number of cells in the Y direction
nc3: int
Number of cells in the Z direction
pad1: int
Padding in the X direction
pad2: int
Padding in the Y direction
pad3: int
Padding in the Z direction
f_p1: int
Degree in the X... | psydac/core/kernels.py | eval_jacobians_3d | mayuri-dhote/psydac | 0 | python | def eval_jacobians_3d(nc1: int, nc2: int, nc3: int, pad1: int, pad2: int, pad3: int, f_p1: int, f_p2: int, f_p3: int, k1: int, k2: int, k3: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_basis_3: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_spans_3: 'int[... | def eval_jacobians_3d(nc1: int, nc2: int, nc3: int, pad1: int, pad2: int, pad3: int, f_p1: int, f_p2: int, f_p3: int, k1: int, k2: int, k3: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_basis_3: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_spans_3: 'int[... |
5fbda78a4a41482981de66de0138ff6a29dc327ba8ffd9e0d9c415a9a2430f2e | def eval_jacobians_2d(nc1: int, nc2: int, pad1: int, pad2: int, f_p1: int, f_p2: int, k1: int, k2: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_arr_coeff_x: 'float[:,:]', global_arr_coeff_y: 'float[:,:]', jacobians: 'float[:,:,:,:]')... | Parameters
----------
nc1: int
Number of cells in the X direction
nc2: int
Number of cells in the Y direction
pad1: int
Padding in the X direction
pad2: int
Padding in the Y direction
f_p1: int
Degree in the X direction
f_p2: int
Degree in the Y direction
k1: int
Number of evaluation poin... | psydac/core/kernels.py | eval_jacobians_2d | mayuri-dhote/psydac | 0 | python | def eval_jacobians_2d(nc1: int, nc2: int, pad1: int, pad2: int, f_p1: int, f_p2: int, k1: int, k2: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_arr_coeff_x: 'float[:,:]', global_arr_coeff_y: 'float[:,:]', jacobians: 'float[:,:,:,:]')... | def eval_jacobians_2d(nc1: int, nc2: int, pad1: int, pad2: int, f_p1: int, f_p2: int, k1: int, k2: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_arr_coeff_x: 'float[:,:]', global_arr_coeff_y: 'float[:,:]', jacobians: 'float[:,:,:,:]')... |
73183c99ef542e464b6766f2ca2ca132c10a86926fc2a529b80f3249b6ff0e22 | def eval_jacobians_3d_weights(nc1: int, nc2: int, nc3: int, pad1: int, pad2: int, pad3: int, f_p1: int, f_p2: int, f_p3: int, k1: int, k2: int, k3: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_basis_3: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_spans_... | Parameters
----------
nc1: int
Number of cells in the X direction
nc2: int
Number of cells in the Y direction
nc3: int
Number of cells in the Z direction
pad1: int
Padding in the X direction
pad2: int
Padding in the Y direction
pad3: int
Padding in the Z direction
f_p1: int
Degree in the X... | psydac/core/kernels.py | eval_jacobians_3d_weights | mayuri-dhote/psydac | 0 | python | def eval_jacobians_3d_weights(nc1: int, nc2: int, nc3: int, pad1: int, pad2: int, pad3: int, f_p1: int, f_p2: int, f_p3: int, k1: int, k2: int, k3: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_basis_3: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_spans_... | def eval_jacobians_3d_weights(nc1: int, nc2: int, nc3: int, pad1: int, pad2: int, pad3: int, f_p1: int, f_p2: int, f_p3: int, k1: int, k2: int, k3: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_basis_3: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_spans_... |
fc7ee821b452d0d3afe01008a7e56a2a74e26b66f23d3f12e094ee1c46e0f1e8 | def eval_jacobians_2d_weights(nc1: int, nc2: int, pad1: int, pad2: int, f_p1: int, f_p2: int, k1: int, k2: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_arr_coeff_x: 'float[:,:]', global_arr_coeff_y: 'float[:,:]', global_arr_coeff_wei... | Parameters
----------
nc1: int
Number of cells in the X direction
nc2: int
Number of cells in the Y direction
pad1: int
Padding in the X direction
pad2: int
Padding in the Y direction
f_p1: int
Degree in the X direction
f_p2: int
Degree in the Y direction
k1: int
Number of evaluation poin... | psydac/core/kernels.py | eval_jacobians_2d_weights | mayuri-dhote/psydac | 0 | python | def eval_jacobians_2d_weights(nc1: int, nc2: int, pad1: int, pad2: int, f_p1: int, f_p2: int, k1: int, k2: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_arr_coeff_x: 'float[:,:]', global_arr_coeff_y: 'float[:,:]', global_arr_coeff_wei... | def eval_jacobians_2d_weights(nc1: int, nc2: int, pad1: int, pad2: int, f_p1: int, f_p2: int, k1: int, k2: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_arr_coeff_x: 'float[:,:]', global_arr_coeff_y: 'float[:,:]', global_arr_coeff_wei... |
cbd7e4954d9d9212e091d15aafc4235bdd9a8b8b1e444b0b6864839e2ef92664 | def eval_jacobians_inv_3d(nc1: int, nc2: int, nc3: int, pad1: int, pad2: int, pad3: int, f_p1: int, f_p2: int, f_p3: int, k1: int, k2: int, k3: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_basis_3: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_spans_3: '... | Parameters
----------
nc1: int
Number of cells in the X direction
nc2: int
Number of cells in the Y direction
nc3: int
Number of cells in the Z direction
pad1: int
Padding in the X direction
pad2: int
Padding in the Y direction
pad3: int
Padding in the Z direction
f_p1: int
Degree in the X... | psydac/core/kernels.py | eval_jacobians_inv_3d | mayuri-dhote/psydac | 0 | python | def eval_jacobians_inv_3d(nc1: int, nc2: int, nc3: int, pad1: int, pad2: int, pad3: int, f_p1: int, f_p2: int, f_p3: int, k1: int, k2: int, k3: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_basis_3: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_spans_3: '... | def eval_jacobians_inv_3d(nc1: int, nc2: int, nc3: int, pad1: int, pad2: int, pad3: int, f_p1: int, f_p2: int, f_p3: int, k1: int, k2: int, k3: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_basis_3: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_spans_3: '... |
3469014c653485fba3ee3e1ff66e8450f97de0a5e53f6b01a9fb4f84dc4e9907 | def eval_jacobians_inv_2d(nc1: int, nc2: int, pad1: int, pad2: int, f_p1: int, f_p2: int, k1: int, k2: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_arr_coeff_x: 'float[:,:]', global_arr_coeff_y: 'float[:,:]', jacobians_inv: 'float[:,... | Parameters
----------
nc1: int
Number of cells in the X direction
nc2: int
Number of cells in the Y direction
pad1: int
Padding in the X direction
pad2: int
Padding in the Y direction
f_p1: int
Degree in the X direction
f_p2: int
Degree in the Y direction
k1: int
Number of evaluation poin... | psydac/core/kernels.py | eval_jacobians_inv_2d | mayuri-dhote/psydac | 0 | python | def eval_jacobians_inv_2d(nc1: int, nc2: int, pad1: int, pad2: int, f_p1: int, f_p2: int, k1: int, k2: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_arr_coeff_x: 'float[:,:]', global_arr_coeff_y: 'float[:,:]', jacobians_inv: 'float[:,... | def eval_jacobians_inv_2d(nc1: int, nc2: int, pad1: int, pad2: int, f_p1: int, f_p2: int, k1: int, k2: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_arr_coeff_x: 'float[:,:]', global_arr_coeff_y: 'float[:,:]', jacobians_inv: 'float[:,... |
05bb51661e2b69c31c28ca57a6de4d171d22bb943211e69236dc8d1c81a86f6b | def eval_jacobians_inv_3d_weights(nc1: int, nc2: int, nc3: int, pad1: int, pad2: int, pad3: int, f_p1: int, f_p2: int, f_p3: int, k1: int, k2: int, k3: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_basis_3: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_sp... | Parameters
----------
nc1: int
Number of cells in the X direction
nc2: int
Number of cells in the Y direction
nc3: int
Number of cells in the Z direction
pad1: int
Padding in the X direction
pad2: int
Padding in the Y direction
pad3: int
Padding in the Z direction
f_p1: int
Degree in the X... | psydac/core/kernels.py | eval_jacobians_inv_3d_weights | mayuri-dhote/psydac | 0 | python | def eval_jacobians_inv_3d_weights(nc1: int, nc2: int, nc3: int, pad1: int, pad2: int, pad3: int, f_p1: int, f_p2: int, f_p3: int, k1: int, k2: int, k3: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_basis_3: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_sp... | def eval_jacobians_inv_3d_weights(nc1: int, nc2: int, nc3: int, pad1: int, pad2: int, pad3: int, f_p1: int, f_p2: int, f_p3: int, k1: int, k2: int, k3: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_basis_3: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_sp... |
246b08b03c90f60c0f2ef0fa94ec2b1250e9d26e5cc46c9045b813eecc47c731 | def eval_jacobians_inv_2d_weights(nc1: int, nc2: int, pad1: int, pad2: int, f_p1: int, f_p2: int, k1: int, k2: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_arr_coeff_x: 'float[:,:]', global_arr_coeff_y: 'float[:,:]', global_arr_coeff... | Parameters
----------
nc1: int
Number of cells in the X direction
nc2: int
Number of cells in the Y direction
pad1: int
Padding in the X direction
pad2: int
Padding in the Y direction
f_p1: int
Degree in the X direction
f_p2: int
Degree in the Y direction
k1: int
Number of evaluation poin... | psydac/core/kernels.py | eval_jacobians_inv_2d_weights | mayuri-dhote/psydac | 0 | python | def eval_jacobians_inv_2d_weights(nc1: int, nc2: int, pad1: int, pad2: int, f_p1: int, f_p2: int, k1: int, k2: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_arr_coeff_x: 'float[:,:]', global_arr_coeff_y: 'float[:,:]', global_arr_coeff... | def eval_jacobians_inv_2d_weights(nc1: int, nc2: int, pad1: int, pad2: int, f_p1: int, f_p2: int, k1: int, k2: int, global_basis_1: 'float[:,:,:,:]', global_basis_2: 'float[:,:,:,:]', global_spans_1: 'int[:]', global_spans_2: 'int[:]', global_arr_coeff_x: 'float[:,:]', global_arr_coeff_y: 'float[:,:]', global_arr_coeff... |
5478164fcab40a880ecee12ab22ffef6f5d7cd94d6a112c88a8a18aa4dd609bf | def pushforward_2d_l2(fields_to_push: 'float[:,:,:]', jac_dets: 'float[:,:]', pushed_fields: 'float[:,:,:]'):
'\n\n Parameters\n ----------\n fields_to_push: ndarray\n Field values to push forward on the mapping\n This array as shape (n_x1, n_x2, n_f) where:\n * n_x1 is the number of p... | Parameters
----------
fields_to_push: ndarray
Field values to push forward on the mapping
This array as shape (n_x1, n_x2, n_f) where:
* n_x1 is the number of points in direction 1 of the implicit grid.
* n_x2 is the number of points in direction 2 of the implicit grid.
* n_f is the number of fields... | psydac/core/kernels.py | pushforward_2d_l2 | mayuri-dhote/psydac | 0 | python | def pushforward_2d_l2(fields_to_push: 'float[:,:,:]', jac_dets: 'float[:,:]', pushed_fields: 'float[:,:,:]'):
'\n\n Parameters\n ----------\n fields_to_push: ndarray\n Field values to push forward on the mapping\n This array as shape (n_x1, n_x2, n_f) where:\n * n_x1 is the number of p... | def pushforward_2d_l2(fields_to_push: 'float[:,:,:]', jac_dets: 'float[:,:]', pushed_fields: 'float[:,:,:]'):
'\n\n Parameters\n ----------\n fields_to_push: ndarray\n Field values to push forward on the mapping\n This array as shape (n_x1, n_x2, n_f) where:\n * n_x1 is the number of p... |
0ee9aac1fb956f0957be9cd043136c014e948370a1957776e9aaf08d81fadd0a | def pushforward_3d_l2(fields_to_push: 'float[:,:,:,:]', jac_dets: 'float[:,:,:]', pushed_fields: 'float[:,:,:,:]'):
'\n\n Parameters\n ----------\n fields_to_push: ndarray\n Field values to push forward on the mapping\n This array as shape (n_x1, n_x2, n_x3, n_f) where:\n * n_x1 is the... | Parameters
----------
fields_to_push: ndarray
Field values to push forward on the mapping
This array as shape (n_x1, n_x2, n_x3, n_f) where:
* n_x1 is the number of points in direction 1 of the implicit grid.
* n_x2 is the number of points in direction 2 of the implicit grid.
* n_x3 is the number of... | psydac/core/kernels.py | pushforward_3d_l2 | mayuri-dhote/psydac | 0 | python | def pushforward_3d_l2(fields_to_push: 'float[:,:,:,:]', jac_dets: 'float[:,:,:]', pushed_fields: 'float[:,:,:,:]'):
'\n\n Parameters\n ----------\n fields_to_push: ndarray\n Field values to push forward on the mapping\n This array as shape (n_x1, n_x2, n_x3, n_f) where:\n * n_x1 is the... | def pushforward_3d_l2(fields_to_push: 'float[:,:,:,:]', jac_dets: 'float[:,:,:]', pushed_fields: 'float[:,:,:,:]'):
'\n\n Parameters\n ----------\n fields_to_push: ndarray\n Field values to push forward on the mapping\n This array as shape (n_x1, n_x2, n_x3, n_f) where:\n * n_x1 is the... |
e036acc054f5234109be8a7e4b8f4a70fc6a7d402fb16f0b05ffb5f003f92d44 | def pushforward_2d_hcurl(fields_to_push: 'float[:,:,:,:]', inv_jac_mats: 'float[:,:,:,:]', pushed_fields: 'float[:,:,:,:]'):
'\n\n Parameters\n ----------\n fields_to_push: ndarray\n Field values to push forward on the mapping\n This array as shape (2, n_x1, n_x2, n_f) where:\n * 2 is ... | Parameters
----------
fields_to_push: ndarray
Field values to push forward on the mapping
This array as shape (2, n_x1, n_x2, n_f) where:
* 2 is the logical dimension of the problem (2 here)
* n_x1 is the number of points in direction 1 of the implicit grid.
* n_x2 is the number of points in directi... | psydac/core/kernels.py | pushforward_2d_hcurl | mayuri-dhote/psydac | 0 | python | def pushforward_2d_hcurl(fields_to_push: 'float[:,:,:,:]', inv_jac_mats: 'float[:,:,:,:]', pushed_fields: 'float[:,:,:,:]'):
'\n\n Parameters\n ----------\n fields_to_push: ndarray\n Field values to push forward on the mapping\n This array as shape (2, n_x1, n_x2, n_f) where:\n * 2 is ... | def pushforward_2d_hcurl(fields_to_push: 'float[:,:,:,:]', inv_jac_mats: 'float[:,:,:,:]', pushed_fields: 'float[:,:,:,:]'):
'\n\n Parameters\n ----------\n fields_to_push: ndarray\n Field values to push forward on the mapping\n This array as shape (2, n_x1, n_x2, n_f) where:\n * 2 is ... |
a8bfc125fc1271ebf9bfa3c0ea58cb52e176877b58eceb256a745b12f8b6c718 | def pushforward_3d_hcurl(fields_to_push: 'float[:,:,:,:,:]', inv_jac_mats: 'float[:,:,:,:,:]', pushed_fields: 'float[:,:,:,:,:]'):
'\n\n Parameters\n ----------\n fields_to_push: ndarray\n Field values to push forward on the mapping\n This array as shape (3, n_x1, n_x2, n_x3, n_f) where:\n ... | Parameters
----------
fields_to_push: ndarray
Field values to push forward on the mapping
This array as shape (3, n_x1, n_x2, n_x3, n_f) where:
* 3 is the logical dimension of the problem
* n_x1 is the number of points in direction 1 of the implicit grid.
* n_x2 is the number of points in direction ... | psydac/core/kernels.py | pushforward_3d_hcurl | mayuri-dhote/psydac | 0 | python | def pushforward_3d_hcurl(fields_to_push: 'float[:,:,:,:,:]', inv_jac_mats: 'float[:,:,:,:,:]', pushed_fields: 'float[:,:,:,:,:]'):
'\n\n Parameters\n ----------\n fields_to_push: ndarray\n Field values to push forward on the mapping\n This array as shape (3, n_x1, n_x2, n_x3, n_f) where:\n ... | def pushforward_3d_hcurl(fields_to_push: 'float[:,:,:,:,:]', inv_jac_mats: 'float[:,:,:,:,:]', pushed_fields: 'float[:,:,:,:,:]'):
'\n\n Parameters\n ----------\n fields_to_push: ndarray\n Field values to push forward on the mapping\n This array as shape (3, n_x1, n_x2, n_x3, n_f) where:\n ... |
303a12cbd3d9176551d57d926d553b05e2bab2860dd50c56090798c1c0fceeb1 | def pushforward_2d_hdiv(fields_to_push: 'float[:,:,:,:]', jac_mats: 'float[:,:,:,:]', pushed_fields: 'float[:,:,:,:]'):
'\n\n Parameters\n ----------\n fields_to_push: ndarray\n Field values to push forward on the mapping\n This array as shape (2, n_x1, n_x2, n_f) where:\n * 2 is the l... | Parameters
----------
fields_to_push: ndarray
Field values to push forward on the mapping
This array as shape (2, n_x1, n_x2, n_f) where:
* 2 is the logical dimension of the problem (2 here)
* n_x1 is the number of points in direction 1 of the implicit grid.
* n_x2 is the number of points in directi... | psydac/core/kernels.py | pushforward_2d_hdiv | mayuri-dhote/psydac | 0 | python | def pushforward_2d_hdiv(fields_to_push: 'float[:,:,:,:]', jac_mats: 'float[:,:,:,:]', pushed_fields: 'float[:,:,:,:]'):
'\n\n Parameters\n ----------\n fields_to_push: ndarray\n Field values to push forward on the mapping\n This array as shape (2, n_x1, n_x2, n_f) where:\n * 2 is the l... | def pushforward_2d_hdiv(fields_to_push: 'float[:,:,:,:]', jac_mats: 'float[:,:,:,:]', pushed_fields: 'float[:,:,:,:]'):
'\n\n Parameters\n ----------\n fields_to_push: ndarray\n Field values to push forward on the mapping\n This array as shape (2, n_x1, n_x2, n_f) where:\n * 2 is the l... |
e6ef1442fa8b22830e674ca23c8a4ebb9d96c88c50771f459b16ca2aa4f76f34 | def pushforward_3d_hdiv(fields_to_push: 'float[:,:,:,:,:]', jac_mats: 'float[:,:,:,:,:]', pushed_fields: 'float[:,:,:,:,:]'):
'\n\n Parameters\n ----------\n fields_to_push: ndarray\n Field values to push forward on the mapping\n This array as shape (3, n_x1, n_x2, n_x3, n_f) where:\n ... | Parameters
----------
fields_to_push: ndarray
Field values to push forward on the mapping
This array as shape (3, n_x1, n_x2, n_x3, n_f) where:
* 3 is the logical dimension of the problem
* n_x1 is the number of points in direction 1 of the implicit grid.
* n_x2 is the number of points in direction ... | psydac/core/kernels.py | pushforward_3d_hdiv | mayuri-dhote/psydac | 0 | python | def pushforward_3d_hdiv(fields_to_push: 'float[:,:,:,:,:]', jac_mats: 'float[:,:,:,:,:]', pushed_fields: 'float[:,:,:,:,:]'):
'\n\n Parameters\n ----------\n fields_to_push: ndarray\n Field values to push forward on the mapping\n This array as shape (3, n_x1, n_x2, n_x3, n_f) where:\n ... | def pushforward_3d_hdiv(fields_to_push: 'float[:,:,:,:,:]', jac_mats: 'float[:,:,:,:,:]', pushed_fields: 'float[:,:,:,:,:]'):
'\n\n Parameters\n ----------\n fields_to_push: ndarray\n Field values to push forward on the mapping\n This array as shape (3, n_x1, n_x2, n_x3, n_f) where:\n ... |
aefc9a4718a37d026dc989f2dc1776bb949ec473bdadf4e5d6aa501f1acbd9b3 | def test_sqpdfo_truncated_cg(self):
'\n Test comparing matlab results with python results\n '
(u, info_t) = sqpdfo_truncated_cg_(self.A, self.b, self.delta, self.max_iter, self.tol)
self.assertEqual(u, 0.816496580927725)
self.assertEqual(info_t.flag, 0)
self.assertEqual(info_t.i... | Test comparing matlab results with python results | tests/sqpdfo_truncated_cg_test.py | test_sqpdfo_truncated_cg | DLR-SC/sqpdfo | 10 | python | def test_sqpdfo_truncated_cg(self):
'\n \n '
(u, info_t) = sqpdfo_truncated_cg_(self.A, self.b, self.delta, self.max_iter, self.tol)
self.assertEqual(u, 0.816496580927725)
self.assertEqual(info_t.flag, 0)
self.assertEqual(info_t.iter, 2)
self.assertEqual(info_t.prec, 0)
... | def test_sqpdfo_truncated_cg(self):
'\n \n '
(u, info_t) = sqpdfo_truncated_cg_(self.A, self.b, self.delta, self.max_iter, self.tol)
self.assertEqual(u, 0.816496580927725)
self.assertEqual(info_t.flag, 0)
self.assertEqual(info_t.iter, 2)
self.assertEqual(info_t.prec, 0)
... |
4791d8d39aa70310f1b8d298d60014f5df48dc0a41722f87775b8c61a0c1354c | def vgg16(pretrained=False, progress=True, **kwargs):
'VGG 16-layer model (configuration "D")\n `"Very Deep Convolutional Networks For Large-Scale Image Recognition" <https://arxiv.org/pdf/1409.1556.pdf>\'_\n Args:\n pretrained (bool): If True, returns a model pre-trained on ImageNet\n progress ... | VGG 16-layer model (configuration "D")
`"Very Deep Convolutional Networks For Large-Scale Image Recognition" <https://arxiv.org/pdf/1409.1556.pdf>'_
Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet
progress (bool): If True, displays a progress bar of the download to stderr | CDS_pretraining/models/vgg.py | vgg16 | VisionLearningGroup/CDS | 7 | python | def vgg16(pretrained=False, progress=True, **kwargs):
'VGG 16-layer model (configuration "D")\n `"Very Deep Convolutional Networks For Large-Scale Image Recognition" <https://arxiv.org/pdf/1409.1556.pdf>\'_\n Args:\n pretrained (bool): If True, returns a model pre-trained on ImageNet\n progress ... | def vgg16(pretrained=False, progress=True, **kwargs):
'VGG 16-layer model (configuration "D")\n `"Very Deep Convolutional Networks For Large-Scale Image Recognition" <https://arxiv.org/pdf/1409.1556.pdf>\'_\n Args:\n pretrained (bool): If True, returns a model pre-trained on ImageNet\n progress ... |
4671c165072e6e9da11c8ef778b5ef1c7eb659cfcf98a40db2db757ab8bdf351 | def load_templates(self):
'\n Loads templates from configuration templates file.\n '
with open(SETTINGS['TEMPLATESFILE'], 'r') as stream:
try:
self.templates = yaml.load(stream)
except yaml.YAMLError as exc:
print(exc) | Loads templates from configuration templates file. | virtapi/model/template.py | load_templates | spiperac/virtapi | 11 | python | def load_templates(self):
'\n \n '
with open(SETTINGS['TEMPLATESFILE'], 'r') as stream:
try:
self.templates = yaml.load(stream)
except yaml.YAMLError as exc:
print(exc) | def load_templates(self):
'\n \n '
with open(SETTINGS['TEMPLATESFILE'], 'r') as stream:
try:
self.templates = yaml.load(stream)
except yaml.YAMLError as exc:
print(exc)<|docstring|>Loads templates from configuration templates file.<|endoftext|> |
7546d8919afdfbc73cd6a5de39d1ce0950728e3613245fa7494d21b21063d0b6 | def save_templates(self):
'\n Save templates from templates object.\n '
with open(SETTINGS['TEMPLATESFILE'], 'w') as stream:
try:
yaml.dump(self.templates, stream)
except yaml.YAMLError as exc:
print(exc) | Save templates from templates object. | virtapi/model/template.py | save_templates | spiperac/virtapi | 11 | python | def save_templates(self):
'\n \n '
with open(SETTINGS['TEMPLATESFILE'], 'w') as stream:
try:
yaml.dump(self.templates, stream)
except yaml.YAMLError as exc:
print(exc) | def save_templates(self):
'\n \n '
with open(SETTINGS['TEMPLATESFILE'], 'w') as stream:
try:
yaml.dump(self.templates, stream)
except yaml.YAMLError as exc:
print(exc)<|docstring|>Save templates from templates object.<|endoftext|> |
7fc7ef37fed9c4307f3e0fe22235a41caab7a71aaadb203430fb39d5d1dc358a | def load_operating_systems(self):
'\n Loading operating systems from templates.\n '
if (self.templates == None):
pass
else:
for template in self.templates:
self.operating_systems.append(str(template['os'])) | Loading operating systems from templates. | virtapi/model/template.py | load_operating_systems | spiperac/virtapi | 11 | python | def load_operating_systems(self):
'\n \n '
if (self.templates == None):
pass
else:
for template in self.templates:
self.operating_systems.append(str(template['os'])) | def load_operating_systems(self):
'\n \n '
if (self.templates == None):
pass
else:
for template in self.templates:
self.operating_systems.append(str(template['os']))<|docstring|>Loading operating systems from templates.<|endoftext|> |
7b6bb83a53d5ff641471cb0c9c9dc13fc1eb079919822a039025a41672a2e91c | def get_os_list(self):
'\n Returns just loaded list of operating systems.\n '
return self.operating_systems | Returns just loaded list of operating systems. | virtapi/model/template.py | get_os_list | spiperac/virtapi | 11 | python | def get_os_list(self):
'\n \n '
return self.operating_systems | def get_os_list(self):
'\n \n '
return self.operating_systems<|docstring|>Returns just loaded list of operating systems.<|endoftext|> |
b2f4a9fa6e0dc6cbaa27b33093ebf2244d554ebde83253c24137c3edec28a592 | def get_os_versions(self, os):
'\n Returns a list of versions for operating system.\n '
versions = []
for template in self.templates:
if (template['os'] == os):
versions.append(template['version'])
return versions | Returns a list of versions for operating system. | virtapi/model/template.py | get_os_versions | spiperac/virtapi | 11 | python | def get_os_versions(self, os):
'\n \n '
versions = []
for template in self.templates:
if (template['os'] == os):
versions.append(template['version'])
return versions | def get_os_versions(self, os):
'\n \n '
versions = []
for template in self.templates:
if (template['os'] == os):
versions.append(template['version'])
return versions<|docstring|>Returns a list of versions for operating system.<|endoftext|> |
d1c70d04b13ae12e3e993d11827b74e770d2b3ba7631334ef1296a99563bf433 | def get_iso_link(self, os, version):
'\n Returns iso path for selected os and version.\n '
iso_link = None
for template in self.templates:
if ((template['os'] == os) and (str(template['version']) == str(version))):
iso_link = template['iso']
return iso_link | Returns iso path for selected os and version. | virtapi/model/template.py | get_iso_link | spiperac/virtapi | 11 | python | def get_iso_link(self, os, version):
'\n \n '
iso_link = None
for template in self.templates:
if ((template['os'] == os) and (str(template['version']) == str(version))):
iso_link = template['iso']
return iso_link | def get_iso_link(self, os, version):
'\n \n '
iso_link = None
for template in self.templates:
if ((template['os'] == os) and (str(template['version']) == str(version))):
iso_link = template['iso']
return iso_link<|docstring|>Returns iso path for selected os and version.... |
abe5ecd75bb1563eaca36b7f332071f186942573604920ca5efea91d535b615c | def fetch_template(self, os, version):
'\n Checks if template exist and if not, download and save it in the standard templates path.\n '
link = self.get_iso_link(os, version)
save_path = SETTINGS['TEMPLATESPATH']
if self.check_exists(link):
print('Template already exists.')
... | Checks if template exist and if not, download and save it in the standard templates path. | virtapi/model/template.py | fetch_template | spiperac/virtapi | 11 | python | def fetch_template(self, os, version):
'\n \n '
link = self.get_iso_link(os, version)
save_path = SETTINGS['TEMPLATESPATH']
if self.check_exists(link):
print('Template already exists.')
return os.path.basename(link)
try:
filename = download(link, save_path)
... | def fetch_template(self, os, version):
'\n \n '
link = self.get_iso_link(os, version)
save_path = SETTINGS['TEMPLATESPATH']
if self.check_exists(link):
print('Template already exists.')
return os.path.basename(link)
try:
filename = download(link, save_path)
... |
bd2a77b643eac32f49fe6f49cddf93cdd3020974eeebc196b21d11fce7752604 | def check_exists(self, template_iso):
'\n Check if template exists.\n '
template_file = '{}/{}'.format(SETTINGS['TEMPLATESPATH'], os.path.basename(template_iso))
exists = os.path.exists(template_file)
return exists | Check if template exists. | virtapi/model/template.py | check_exists | spiperac/virtapi | 11 | python | def check_exists(self, template_iso):
'\n \n '
template_file = '{}/{}'.format(SETTINGS['TEMPLATESPATH'], os.path.basename(template_iso))
exists = os.path.exists(template_file)
return exists | def check_exists(self, template_iso):
'\n \n '
template_file = '{}/{}'.format(SETTINGS['TEMPLATESPATH'], os.path.basename(template_iso))
exists = os.path.exists(template_file)
return exists<|docstring|>Check if template exists.<|endoftext|> |
da4015206e4c77c296b18f3cad705e565f26e8b6137117faf99aa35a47334e40 | def uninstall(project_list):
"Uninstall a list of projects.\n\n Returns a dictionary with the following keys and values:\n\n * `'uninstalled'` - a list of strings containing the names of the projects\n that were successfully uninstalled.\n\n * `'failed'` - a list of strings containing the names of the... | Uninstall a list of projects.
Returns a dictionary with the following keys and values:
* `'uninstalled'` - a list of strings containing the names of the projects
that were successfully uninstalled.
* `'failed'` - a list of strings containing the names of the projects that
failed to uninstall.
:param project_lis... | pip2/commands/uninstall.py | uninstall | osupython/pip2 | 4 | python | def uninstall(project_list):
"Uninstall a list of projects.\n\n Returns a dictionary with the following keys and values:\n\n * `'uninstalled'` - a list of strings containing the names of the projects\n that were successfully uninstalled.\n\n * `'failed'` - a list of strings containing the names of the... | def uninstall(project_list):
"Uninstall a list of projects.\n\n Returns a dictionary with the following keys and values:\n\n * `'uninstalled'` - a list of strings containing the names of the projects\n that were successfully uninstalled.\n\n * `'failed'` - a list of strings containing the names of the... |
850534c40c30e2162d03710742cc7aa43c7263cd86fac3a93bfd4408b8507364 | def get_predicate_subject_complement_phrases(doc, sent):
'\n extract predicates with:\n -subject phrase\n -complement phrase\n\n :param spacy.tokens.Sent sent: spaCy object after processing text\n\n :rtype: list\n :return: list of tuples (predicate, subject, complement)\n '
output = []
... | extract predicates with:
-subject phrase
-complement phrase
:param spacy.tokens.Sent sent: spaCy object after processing text
:rtype: list
:return: list of tuples (predicate, subject, complement) | src/cltl/triple_extraction/spacy_triples/dep_to_triple.py | get_predicate_subject_complement_phrases | leolani/cltl-knowledgeextraction | 0 | python | def get_predicate_subject_complement_phrases(doc, sent):
'\n extract predicates with:\n -subject phrase\n -complement phrase\n\n :param spacy.tokens.Sent sent: spaCy object after processing text\n\n :rtype: list\n :return: list of tuples (predicate, subject, complement)\n '
output = []
... | def get_predicate_subject_complement_phrases(doc, sent):
'\n extract predicates with:\n -subject phrase\n -complement phrase\n\n :param spacy.tokens.Sent sent: spaCy object after processing text\n\n :rtype: list\n :return: list of tuples (predicate, subject, complement)\n '
output = []
... |
63a0bccf23d109b81348716082facc6aea56979a062ef9c63a11b1a0bd440723 | def get_subj_obj_triples_with_spacy(nlp, utterance: str, SPEAKER: str, HEARER: str):
'\n extract predicates with:\n -subject\n -object\n\n :param spacy.tokens.doc.Doc doc: spaCy object after processing text\n\n :rtype: list\n :return: list of tuples (predicate, subject, object)\n '
print('g... | extract predicates with:
-subject
-object
:param spacy.tokens.doc.Doc doc: spaCy object after processing text
:rtype: list
:return: list of tuples (predicate, subject, object) | src/cltl/triple_extraction/spacy_triples/dep_to_triple.py | get_subj_obj_triples_with_spacy | leolani/cltl-knowledgeextraction | 0 | python | def get_subj_obj_triples_with_spacy(nlp, utterance: str, SPEAKER: str, HEARER: str):
'\n extract predicates with:\n -subject\n -object\n\n :param spacy.tokens.doc.Doc doc: spaCy object after processing text\n\n :rtype: list\n :return: list of tuples (predicate, subject, object)\n '
print('g... | def get_subj_obj_triples_with_spacy(nlp, utterance: str, SPEAKER: str, HEARER: str):
'\n extract predicates with:\n -subject\n -object\n\n :param spacy.tokens.doc.Doc doc: spaCy object after processing text\n\n :rtype: list\n :return: list of tuples (predicate, subject, object)\n '
print('g... |
d5ab5e0908fd639e259adcf9351bf82480039c2bd19212f932ee7611d08dbec3 | def get_subj_amod_triples_with_spacy(nlp, utterance: str, SPEAKER: str, HEARER: str):
'\n extract predicates with:\n -subject\n -object\n\n :param spacy.tokens.doc.Doc doc: spaCy object after processing text\n\n :rtype: list\n :return: list of tuples (predicate, subject, object)\n '
print('... | extract predicates with:
-subject
-object
:param spacy.tokens.doc.Doc doc: spaCy object after processing text
:rtype: list
:return: list of tuples (predicate, subject, object) | src/cltl/triple_extraction/spacy_triples/dep_to_triple.py | get_subj_amod_triples_with_spacy | leolani/cltl-knowledgeextraction | 0 | python | def get_subj_amod_triples_with_spacy(nlp, utterance: str, SPEAKER: str, HEARER: str):
'\n extract predicates with:\n -subject\n -object\n\n :param spacy.tokens.doc.Doc doc: spaCy object after processing text\n\n :rtype: list\n :return: list of tuples (predicate, subject, object)\n '
print('... | def get_subj_amod_triples_with_spacy(nlp, utterance: str, SPEAKER: str, HEARER: str):
'\n extract predicates with:\n -subject\n -object\n\n :param spacy.tokens.doc.Doc doc: spaCy object after processing text\n\n :rtype: list\n :return: list of tuples (predicate, subject, object)\n '
print('... |
3f46ac1daacfbdf0c8a0b1b238849695b5580746022b1f806b0548e0df556865 | def get_subj_attr_triples_with_spacy(nlp, utterance: str, SPEAKER: str, HEARER: str):
'\n extract predicates with:\n -subject\n -object\n\n :param spacy.tokens.doc.Doc doc: spaCy object after processing text\n\n :rtype: list\n :return: list of tuples (predicate, subject, object)\n '
print('... | extract predicates with:
-subject
-object
:param spacy.tokens.doc.Doc doc: spaCy object after processing text
:rtype: list
:return: list of tuples (predicate, subject, object) | src/cltl/triple_extraction/spacy_triples/dep_to_triple.py | get_subj_attr_triples_with_spacy | leolani/cltl-knowledgeextraction | 0 | python | def get_subj_attr_triples_with_spacy(nlp, utterance: str, SPEAKER: str, HEARER: str):
'\n extract predicates with:\n -subject\n -object\n\n :param spacy.tokens.doc.Doc doc: spaCy object after processing text\n\n :rtype: list\n :return: list of tuples (predicate, subject, object)\n '
print('... | def get_subj_attr_triples_with_spacy(nlp, utterance: str, SPEAKER: str, HEARER: str):
'\n extract predicates with:\n -subject\n -object\n\n :param spacy.tokens.doc.Doc doc: spaCy object after processing text\n\n :rtype: list\n :return: list of tuples (predicate, subject, object)\n '
print('... |
66a043b964881eee94c84606e4dc1e4e9bfcb79bc8bd727de9d23d57c9871674 | def get_subj_prep_pobj_triples_with_spacy(nlp, utterance: str, SPEAKER: str, HEARER: str):
'\n extract predicates with:\n -subject\n -object\n\n :param spacy.tokens.doc.Doc doc: spaCy object after processing text\n\n :rtype: list\n :return: list of tuples (predicate, subject, object)\n '
pr... | extract predicates with:
-subject
-object
:param spacy.tokens.doc.Doc doc: spaCy object after processing text
:rtype: list
:return: list of tuples (predicate, subject, object) | src/cltl/triple_extraction/spacy_triples/dep_to_triple.py | get_subj_prep_pobj_triples_with_spacy | leolani/cltl-knowledgeextraction | 0 | python | def get_subj_prep_pobj_triples_with_spacy(nlp, utterance: str, SPEAKER: str, HEARER: str):
'\n extract predicates with:\n -subject\n -object\n\n :param spacy.tokens.doc.Doc doc: spaCy object after processing text\n\n :rtype: list\n :return: list of tuples (predicate, subject, object)\n '
pr... | def get_subj_prep_pobj_triples_with_spacy(nlp, utterance: str, SPEAKER: str, HEARER: str):
'\n extract predicates with:\n -subject\n -object\n\n :param spacy.tokens.doc.Doc doc: spaCy object after processing text\n\n :rtype: list\n :return: list of tuples (predicate, subject, object)\n '
pr... |
ac8fd136bb68e15a4a8fa229cb06291029ea1ea3d8e0e1507a39d83c77b93647 | def get(self, spider, **params):
"Get a spider object for a given spider name.\n\n The method gets/sets spider id (and checks if spider exists).\n\n :param spider: a string spider name.\n :return: a spider object.\n :rtype: :class:`scrapinghub.client.spiders.Spider`\n\n Usage::\n\... | Get a spider object for a given spider name.
The method gets/sets spider id (and checks if spider exists).
:param spider: a string spider name.
:return: a spider object.
:rtype: :class:`scrapinghub.client.spiders.Spider`
Usage::
>>> project.spiders.get('spider2')
<scrapinghub.client.spiders.Spider at 0x106e... | scrapinghub/client/spiders.py | get | noviluni/python-scrapinghub | 163 | python | def get(self, spider, **params):
"Get a spider object for a given spider name.\n\n The method gets/sets spider id (and checks if spider exists).\n\n :param spider: a string spider name.\n :return: a spider object.\n :rtype: :class:`scrapinghub.client.spiders.Spider`\n\n Usage::\n\... | def get(self, spider, **params):
"Get a spider object for a given spider name.\n\n The method gets/sets spider id (and checks if spider exists).\n\n :param spider: a string spider name.\n :return: a spider object.\n :rtype: :class:`scrapinghub.client.spiders.Spider`\n\n Usage::\n\... |
c41375c4222812872d9b01acdfdbb71e59202a2b6a56d60914c980470a66de76 | def list(self):
"Get a list of spiders for a project.\n\n :return: a list of dictionaries with spiders metadata.\n :rtype: :class:`list[dict]`\n\n Usage::\n\n >>> project.spiders.list()\n [{'id': 'spider1', 'tags': [], 'type': 'manual', 'version': '123'},\n {'i... | Get a list of spiders for a project.
:return: a list of dictionaries with spiders metadata.
:rtype: :class:`list[dict]`
Usage::
>>> project.spiders.list()
[{'id': 'spider1', 'tags': [], 'type': 'manual', 'version': '123'},
{'id': 'spider2', 'tags': [], 'type': 'manual', 'version': '123'}] | scrapinghub/client/spiders.py | list | noviluni/python-scrapinghub | 163 | python | def list(self):
"Get a list of spiders for a project.\n\n :return: a list of dictionaries with spiders metadata.\n :rtype: :class:`list[dict]`\n\n Usage::\n\n >>> project.spiders.list()\n [{'id': 'spider1', 'tags': [], 'type': 'manual', 'version': '123'},\n {'i... | def list(self):
"Get a list of spiders for a project.\n\n :return: a list of dictionaries with spiders metadata.\n :rtype: :class:`list[dict]`\n\n Usage::\n\n >>> project.spiders.list()\n [{'id': 'spider1', 'tags': [], 'type': 'manual', 'version': '123'},\n {'i... |
8bd57f0c3e3e73e378561e363cc5441d62ceaf6f96e5184b7d9e6600e614c5d8 | def iter(self):
'Iterate through a list of spiders for a project.\n\n :return: an iterator over spiders list where each spider is represented\n as a dict containing its metadata.\n :rtype: :class:`collection.Iterable[dict]`\n\n Provided for the sake of API consistency.\n '
... | Iterate through a list of spiders for a project.
:return: an iterator over spiders list where each spider is represented
as a dict containing its metadata.
:rtype: :class:`collection.Iterable[dict]`
Provided for the sake of API consistency. | scrapinghub/client/spiders.py | iter | noviluni/python-scrapinghub | 163 | python | def iter(self):
'Iterate through a list of spiders for a project.\n\n :return: an iterator over spiders list where each spider is represented\n as a dict containing its metadata.\n :rtype: :class:`collection.Iterable[dict]`\n\n Provided for the sake of API consistency.\n '
... | def iter(self):
'Iterate through a list of spiders for a project.\n\n :return: an iterator over spiders list where each spider is represented\n as a dict containing its metadata.\n :rtype: :class:`collection.Iterable[dict]`\n\n Provided for the sake of API consistency.\n '
... |
64ba6fcf4d4ff7351ae67e294e61c6e076e2280764dbefbb6fef38ebf1201914 | @_wrap_http_errors
def update_tags(self, add=None, remove=None):
'Update tags for the spider.\n\n :param add: (optional) a list of string tags to add.\n :param remove: (optional) a list of string tags to remove.\n '
params = get_tags_for_update(add=add, remove=remove)
path = 'v2/project... | Update tags for the spider.
:param add: (optional) a list of string tags to add.
:param remove: (optional) a list of string tags to remove. | scrapinghub/client/spiders.py | update_tags | noviluni/python-scrapinghub | 163 | python | @_wrap_http_errors
def update_tags(self, add=None, remove=None):
'Update tags for the spider.\n\n :param add: (optional) a list of string tags to add.\n :param remove: (optional) a list of string tags to remove.\n '
params = get_tags_for_update(add=add, remove=remove)
path = 'v2/project... | @_wrap_http_errors
def update_tags(self, add=None, remove=None):
'Update tags for the spider.\n\n :param add: (optional) a list of string tags to add.\n :param remove: (optional) a list of string tags to remove.\n '
params = get_tags_for_update(add=add, remove=remove)
path = 'v2/project... |
27c2426c9006902fb585e482b6c61aafb8f0feed41778f3000a2a3e17b34e3c3 | @_wrap_http_errors
def list_tags(self):
'List spider tags.\n\n :return: a list of spider tags.\n :rtype: :class:`list[str]`\n '
path = 'v2/projects/{}/spiders/{}'.format(self.project_id, self._id)
url = urljoin(self._client._connection.url, path)
response = self._client._connection.... | List spider tags.
:return: a list of spider tags.
:rtype: :class:`list[str]` | scrapinghub/client/spiders.py | list_tags | noviluni/python-scrapinghub | 163 | python | @_wrap_http_errors
def list_tags(self):
'List spider tags.\n\n :return: a list of spider tags.\n :rtype: :class:`list[str]`\n '
path = 'v2/projects/{}/spiders/{}'.format(self.project_id, self._id)
url = urljoin(self._client._connection.url, path)
response = self._client._connection.... | @_wrap_http_errors
def list_tags(self):
'List spider tags.\n\n :return: a list of spider tags.\n :rtype: :class:`list[str]`\n '
path = 'v2/projects/{}/spiders/{}'.format(self.project_id, self._id)
url = urljoin(self._client._connection.url, path)
response = self._client._connection.... |
5be92139adfbb5db2af3119b7e913d9db6add8799a51dde490d0913cda81f65a | def series(power: float, units: Tuple[str], fallback: Optional[str]=None):
"Define a callable to format units in a series.\n\n A series is a collection of units of values increasing linearly from an\n initial unit. For example there're 1024 bytes in 1 KB, 1024 KB in 1 MB,\n 1024 MB in 1 GB. In this case ev... | Define a callable to format units in a series.
A series is a collection of units of values increasing linearly from an
initial unit. For example there're 1024 bytes in 1 KB, 1024 KB in 1 MB,
1024 MB in 1 GB. In this case every time we multiply a number by 1024 we
move to the next unit in the series.
Parameters
------... | bin/lib/python/hurry.py | series | MoHKale/.dotfiles | 9 | python | def series(power: float, units: Tuple[str], fallback: Optional[str]=None):
"Define a callable to format units in a series.\n\n A series is a collection of units of values increasing linearly from an\n initial unit. For example there're 1024 bytes in 1 KB, 1024 KB in 1 MB,\n 1024 MB in 1 GB. In this case ev... | def series(power: float, units: Tuple[str], fallback: Optional[str]=None):
"Define a callable to format units in a series.\n\n A series is a collection of units of values increasing linearly from an\n initial unit. For example there're 1024 bytes in 1 KB, 1024 KB in 1 MB,\n 1024 MB in 1 GB. In this case ev... |
4a92bd8495836270eaf283e6f154ee96cbccd7bda02928daa3e4e1cc5293f802 | def series_wrapper(count: float, limit: float=power) -> Tuple[(float, str)]:
"Return the value of count in the current series.\n\n Parameters\n ----------\n count\n The numerical value to reduce to a unit value in the current\n series.\n limit\n The maximum pos... | Return the value of count in the current series.
Parameters
----------
count
The numerical value to reduce to a unit value in the current
series.
limit
The maximum possible value in a given unit that's acceptable.
For example if this is value is set to 100 then the returned
count is guaranteed to be the firs... | bin/lib/python/hurry.py | series_wrapper | MoHKale/.dotfiles | 9 | python | def series_wrapper(count: float, limit: float=power) -> Tuple[(float, str)]:
"Return the value of count in the current series.\n\n Parameters\n ----------\n count\n The numerical value to reduce to a unit value in the current\n series.\n limit\n The maximum pos... | def series_wrapper(count: float, limit: float=power) -> Tuple[(float, str)]:
"Return the value of count in the current series.\n\n Parameters\n ----------\n count\n The numerical value to reduce to a unit value in the current\n series.\n limit\n The maximum pos... |
4b669446e5648852a79514c09a09ff44c87b616511c2fc48b40a43fa52fcd284 | def forward(self, hidden, encoder_outputs):
'\n hidden : Previous hidden state of the Decoder (Num. Layers * Num. Directions x Batch Size x Hidden Size)\n encoder_outputs: Outputs from Encoder (Sequence Length x Batch Size x Hidden Size)\n\n return: Attention energies in shape (Batch Size x Seq... | hidden : Previous hidden state of the Decoder (Num. Layers * Num. Directions x Batch Size x Hidden Size)
encoder_outputs: Outputs from Encoder (Sequence Length x Batch Size x Hidden Size)
return: Attention energies in shape (Batch Size x Sequence Length) | attention.py | forward | fionn-mac/seq2seq-PyTorch | 1 | python | def forward(self, hidden, encoder_outputs):
'\n hidden : Previous hidden state of the Decoder (Num. Layers * Num. Directions x Batch Size x Hidden Size)\n encoder_outputs: Outputs from Encoder (Sequence Length x Batch Size x Hidden Size)\n\n return: Attention energies in shape (Batch Size x Seq... | def forward(self, hidden, encoder_outputs):
'\n hidden : Previous hidden state of the Decoder (Num. Layers * Num. Directions x Batch Size x Hidden Size)\n encoder_outputs: Outputs from Encoder (Sequence Length x Batch Size x Hidden Size)\n\n return: Attention energies in shape (Batch Size x Seq... |
4cb00dbb1e3b0e2c35b46665a2605a03e1037847c09be22616b13bcc4ce2e516 | def loss_func(y_true, y_pred):
'Content loss based on VGG19'
c_loss = content_loss_22(y_true, y_pred)
l1 = tf.keras.losses.mean_absolute_error(y_true, y_pred)
l2 = tf.keras.losses.mean_squared_error(y_true, y_pred)
total_loss = (((loss_weights[0] * c_loss) + (loss_weights[1] * l1)) + (loss_weights[2... | Content loss based on VGG19 | DFCAN_SR.py | loss_func | m-bizhani/Digital-rock-image-processing | 0 | python | def loss_func(y_true, y_pred):
c_loss = content_loss_22(y_true, y_pred)
l1 = tf.keras.losses.mean_absolute_error(y_true, y_pred)
l2 = tf.keras.losses.mean_squared_error(y_true, y_pred)
total_loss = (((loss_weights[0] * c_loss) + (loss_weights[1] * l1)) + (loss_weights[2] * l2))
return total_los... | def loss_func(y_true, y_pred):
c_loss = content_loss_22(y_true, y_pred)
l1 = tf.keras.losses.mean_absolute_error(y_true, y_pred)
l2 = tf.keras.losses.mean_squared_error(y_true, y_pred)
total_loss = (((loss_weights[0] * c_loss) + (loss_weights[1] * l1)) + (loss_weights[2] * l2))
return total_los... |
8b60aa3dd3a19ab4c9973e9c5f23cb03cfb45c9a0ab1de4b923cb4608325c8b8 | def make_video(images, outvid=None, fps=5, size=None, is_color=True, format='XVID'):
'\n Create a video from a list of images.\n\n @param outvid output video\n @param images list of images to use in the video\n @param fps frame per second\n @param size siz... | Create a video from a list of images.
@param outvid output video
@param images list of images to use in the video
@param fps frame per second
@param size size of each frame
@param is_color color
@param format see http://www.fourcc.org/codecs.php
@return ... | PCA_method/Result_PCA/make_video.py | make_video | YingnanMa/Background_Subtraction_with_a_Freely_Moving_Camera | 0 | python | def make_video(images, outvid=None, fps=5, size=None, is_color=True, format='XVID'):
'\n Create a video from a list of images.\n\n @param outvid output video\n @param images list of images to use in the video\n @param fps frame per second\n @param size siz... | def make_video(images, outvid=None, fps=5, size=None, is_color=True, format='XVID'):
'\n Create a video from a list of images.\n\n @param outvid output video\n @param images list of images to use in the video\n @param fps frame per second\n @param size siz... |
7b2792e9669dc7309532e11d0a6a61d29b9688307e2afbe139b678042f1fd49e | @commands.group(autohelp=True, aliases=['userlog'])
@commands.guild_only()
@checks.admin()
async def userlogset(self, ctx: commands.Context):
'Various User Log settings.' | Various User Log settings. | userlog/userlog.py | userlogset | salazar-brodart/enclave-cog | 0 | python | @commands.group(autohelp=True, aliases=['userlog'])
@commands.guild_only()
@checks.admin()
async def userlogset(self, ctx: commands.Context):
| @commands.group(autohelp=True, aliases=['userlog'])
@commands.guild_only()
@checks.admin()
async def userlogset(self, ctx: commands.Context):
<|docstring|>Various User Log settings.<|endoftext|> |
1f6f4b4924cb85751529a70a240bef486c313b46bd6b7c6da1e4334805385172 | @userlogset.command(name='channel')
async def user_channel_log(self, ctx: commands.Context, channel: typing.Optional[discord.TextChannel]):
'Set the channel for logs.\n\n If the channel is not provided, logging will be disabled.'
if channel:
(await self.config.guild(ctx.guild).channel.set(channel... | Set the channel for logs.
If the channel is not provided, logging will be disabled. | userlog/userlog.py | user_channel_log | salazar-brodart/enclave-cog | 0 | python | @userlogset.command(name='channel')
async def user_channel_log(self, ctx: commands.Context, channel: typing.Optional[discord.TextChannel]):
'Set the channel for logs.\n\n If the channel is not provided, logging will be disabled.'
if channel:
(await self.config.guild(ctx.guild).channel.set(channel... | @userlogset.command(name='channel')
async def user_channel_log(self, ctx: commands.Context, channel: typing.Optional[discord.TextChannel]):
'Set the channel for logs.\n\n If the channel is not provided, logging will be disabled.'
if channel:
(await self.config.guild(ctx.guild).channel.set(channel... |
905227055cbb32267608c906ea19dcc8ffa7d4e7959fa58d8c426b09523a46ae | @userlogset.command(name='join')
async def user_join_log(self, ctx: commands.Context, on_off: typing.Optional[bool]):
'Toggle logging when users join the current server.\n\n If `on_off` is not provided, the state will be flipped.'
target_state = (on_off or (not (await self.config.guild(ctx.guild).join())... | Toggle logging when users join the current server.
If `on_off` is not provided, the state will be flipped. | userlog/userlog.py | user_join_log | salazar-brodart/enclave-cog | 0 | python | @userlogset.command(name='join')
async def user_join_log(self, ctx: commands.Context, on_off: typing.Optional[bool]):
'Toggle logging when users join the current server.\n\n If `on_off` is not provided, the state will be flipped.'
target_state = (on_off or (not (await self.config.guild(ctx.guild).join())... | @userlogset.command(name='join')
async def user_join_log(self, ctx: commands.Context, on_off: typing.Optional[bool]):
'Toggle logging when users join the current server.\n\n If `on_off` is not provided, the state will be flipped.'
target_state = (on_off or (not (await self.config.guild(ctx.guild).join())... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.