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 |
|---|---|---|---|---|---|---|---|---|---|
04ac5fae217f8b73a4239f8f999ba80da80b3c7ba853669f1e3168a04ede7408 | def AbsToRelativePath(self, parentPath):
' Used to convert path to relative path for saving (disk format) '
parentPathLen = len(parentPath)
if self.filePath.startswith((parentPath + os.sep)):
self.filePath = ('.' + self.filePath[parentPathLen:])
if (os.sep != '/'):
self.filePath ... | Used to convert path to relative path for saving (disk format) | noval/project/basemodel.py | AbsToRelativePath | bopopescu/NovalIDE | 0 | python | def AbsToRelativePath(self, parentPath):
' '
parentPathLen = len(parentPath)
if self.filePath.startswith((parentPath + os.sep)):
self.filePath = ('.' + self.filePath[parentPathLen:])
if (os.sep != '/'):
self.filePath = self.filePath.replace(os.sep, '/')
else:
pass | def AbsToRelativePath(self, parentPath):
' '
parentPathLen = len(parentPath)
if self.filePath.startswith((parentPath + os.sep)):
self.filePath = ('.' + self.filePath[parentPathLen:])
if (os.sep != '/'):
self.filePath = self.filePath.replace(os.sep, '/')
else:
pass<|d... |
edf098282ea266b2a740ff95f502c9fd8611f9cfc5d8607c3283355835cc026f | def RelativeToAbsPath(self, parentPath):
' Used to convert path to absolute path (for any necessary disk access) '
if self.filePath.startswith('./'):
self.filePath = os.path.normpath(os.path.join(parentPath, self.filePath)) | Used to convert path to absolute path (for any necessary disk access) | noval/project/basemodel.py | RelativeToAbsPath | bopopescu/NovalIDE | 0 | python | def RelativeToAbsPath(self, parentPath):
' '
if self.filePath.startswith('./'):
self.filePath = os.path.normpath(os.path.join(parentPath, self.filePath)) | def RelativeToAbsPath(self, parentPath):
' '
if self.filePath.startswith('./'):
self.filePath = os.path.normpath(os.path.join(parentPath, self.filePath))<|docstring|>Used to convert path to absolute path (for any necessary disk access)<|endoftext|> |
4bedf094ab6ca2b2453ac75b138cc40e8ebaec83b0f7978d5f55f7f33615f80a | def initialize(self):
' Required method for xmlmarshaller '
pass | Required method for xmlmarshaller | noval/project/basemodel.py | initialize | bopopescu/NovalIDE | 0 | python | def initialize(self):
' '
pass | def initialize(self):
' '
pass<|docstring|>Required method for xmlmarshaller<|endoftext|> |
80919f00c9dc67934badee45f79ff6b648768c1b5f1236d3f46801e12fcc49fb | def defer(obj, *args, **kwargs):
"\n This is a replacement for google.appengine.ext.deferred.defer which doesn't\n suffer the bug where tasks are deferred non-transactionally when they hit a\n certain limit.\n\n It also *always* uses an entity group, unless you pass _small_task=True in w... | This is a replacement for google.appengine.ext.deferred.defer which doesn't
suffer the bug where tasks are deferred non-transactionally when they hit a
certain limit.
It also *always* uses an entity group, unless you pass _small_task=True in which
case it *never* uses an entity group (but you are limited by 100K) | djangae/deferred.py | defer | pgoy-nerdery/djangae | 0 | python | def defer(obj, *args, **kwargs):
"\n This is a replacement for google.appengine.ext.deferred.defer which doesn't\n suffer the bug where tasks are deferred non-transactionally when they hit a\n certain limit.\n\n It also *always* uses an entity group, unless you pass _small_task=True in w... | def defer(obj, *args, **kwargs):
"\n This is a replacement for google.appengine.ext.deferred.defer which doesn't\n suffer the bug where tasks are deferred non-transactionally when they hit a\n certain limit.\n\n It also *always* uses an entity group, unless you pass _small_task=True in w... |
0fd9bb37826c205a29916b1fdc8b504e3694b4765863b2003d1900f7052361af | def lcs(seq1, seq2):
'Find length of longest common subsequence in two sequences.'
dp = [[None for x in range((len(seq2) + 1))] for y in range((len(seq1) + 1))]
for x in range((len(seq1) + 1)):
for y in range((len(seq2) + 1)):
if ((not x) or (not y)):
dp[x][y] = 0
... | Find length of longest common subsequence in two sequences. | DynamicProgramming/LongestCommonSubsequence.py | lcs | kopok2/algorithms | 0 | python | def lcs(seq1, seq2):
dp = [[None for x in range((len(seq2) + 1))] for y in range((len(seq1) + 1))]
for x in range((len(seq1) + 1)):
for y in range((len(seq2) + 1)):
if ((not x) or (not y)):
dp[x][y] = 0
elif (seq1[(x - 1)] == seq2[(y - 1)]):
d... | def lcs(seq1, seq2):
dp = [[None for x in range((len(seq2) + 1))] for y in range((len(seq1) + 1))]
for x in range((len(seq1) + 1)):
for y in range((len(seq2) + 1)):
if ((not x) or (not y)):
dp[x][y] = 0
elif (seq1[(x - 1)] == seq2[(y - 1)]):
d... |
455e36f239bfa477b96e3c125664e5010606a67f6716605b4eb68e5dfc5a7dd2 | @jwt_required
def post(self):
'post an order by the user'
data = PlaceOrder.parser.parse_args()
current_user = get_jwt_identity()['username']
name = data['name']
quantity = data['quantity']
phonenumber = data['phonenumber']
meal_item = FoodMenu().get_by_name(name)
if (data['phonenumber']... | post an order by the user | app/api/v2/user/users.py | post | salma-nyagaka/FastFoodFastApi | 0 | python | @jwt_required
def post(self):
data = PlaceOrder.parser.parse_args()
current_user = get_jwt_identity()['username']
name = data['name']
quantity = data['quantity']
phonenumber = data['phonenumber']
meal_item = FoodMenu().get_by_name(name)
if (data['phonenumber'].strip() == ):
retu... | @jwt_required
def post(self):
data = PlaceOrder.parser.parse_args()
current_user = get_jwt_identity()['username']
name = data['name']
quantity = data['quantity']
phonenumber = data['phonenumber']
meal_item = FoodMenu().get_by_name(name)
if (data['phonenumber'].strip() == ):
retu... |
17833b7bbf6395670629a1843309650779e77a86081ffd877b272ccf1d0eddbe | @jwt_required
def get(self):
' get all orders '
current_user = get_jwt_identity()['username']
orders = FoodOrder().get_all_orders_by_username(current_user)
if orders:
return ({'Orders': [order.serialize() for order in orders]}, 200)
return ({'message': 'No order history'}, 404) | get all orders | app/api/v2/user/users.py | get | salma-nyagaka/FastFoodFastApi | 0 | python | @jwt_required
def get(self):
' '
current_user = get_jwt_identity()['username']
orders = FoodOrder().get_all_orders_by_username(current_user)
if orders:
return ({'Orders': [order.serialize() for order in orders]}, 200)
return ({'message': 'No order history'}, 404) | @jwt_required
def get(self):
' '
current_user = get_jwt_identity()['username']
orders = FoodOrder().get_all_orders_by_username(current_user)
if orders:
return ({'Orders': [order.serialize() for order in orders]}, 200)
return ({'message': 'No order history'}, 404)<|docstring|>get all orders<... |
5a5983a7d600e8f161f96cf9418db01a5e05481cfe39be70e2d7aad15e623df2 | def get(self):
' Get all food items '
data = FoodMenu().get_all_menu()
food_menus = []
if data:
for food_menu in data:
food_menus.append(food_menu.serialize())
return ({'Food menu': food_menus, 'message': 'These are the available food items'}, 200)
return ({'Food menu': '... | Get all food items | app/api/v2/user/users.py | get | salma-nyagaka/FastFoodFastApi | 0 | python | def get(self):
' '
data = FoodMenu().get_all_menu()
food_menus = []
if data:
for food_menu in data:
food_menus.append(food_menu.serialize())
return ({'Food menu': food_menus, 'message': 'These are the available food items'}, 200)
return ({'Food menu': 'There are no meals... | def get(self):
' '
data = FoodMenu().get_all_menu()
food_menus = []
if data:
for food_menu in data:
food_menus.append(food_menu.serialize())
return ({'Food menu': food_menus, 'message': 'These are the available food items'}, 200)
return ({'Food menu': 'There are no meals... |
482b878c6fac3b7ffc02a82a24298ed9579fe5e734087fd662bd28dfa7bb46a1 | @jwt_required
def get(self, status):
' get all food orders '
foodorders = FoodOrder().get_all()
if foodorders:
orders = [order.serialize() for order in foodorders if (order.status == status)]
if orders:
return ({'orders': orders}, 200)
return ({'message': 'Not found'}, 40... | get all food orders | app/api/v2/user/users.py | get | salma-nyagaka/FastFoodFastApi | 0 | python | @jwt_required
def get(self, status):
' '
foodorders = FoodOrder().get_all()
if foodorders:
orders = [order.serialize() for order in foodorders if (order.status == status)]
if orders:
return ({'orders': orders}, 200)
return ({'message': 'Not found'}, 404)
return ({'me... | @jwt_required
def get(self, status):
' '
foodorders = FoodOrder().get_all()
if foodorders:
orders = [order.serialize() for order in foodorders if (order.status == status)]
if orders:
return ({'orders': orders}, 200)
return ({'message': 'Not found'}, 404)
return ({'me... |
812d33db77608309b8fb7942e665e40e562e3df1772911fdaccbbb5050cd82cd | @jwt_required
def delete(self, id):
' Delete an order'
order = FoodOrder().get_by_id(id)
if order:
order.delete(id)
return ({'message': 'Successfully Deleted'}, 200)
return ({'message': 'Order item not found'}, 404) | Delete an order | app/api/v2/user/users.py | delete | salma-nyagaka/FastFoodFastApi | 0 | python | @jwt_required
def delete(self, id):
' '
order = FoodOrder().get_by_id(id)
if order:
order.delete(id)
return ({'message': 'Successfully Deleted'}, 200)
return ({'message': 'Order item not found'}, 404) | @jwt_required
def delete(self, id):
' '
order = FoodOrder().get_by_id(id)
if order:
order.delete(id)
return ({'message': 'Successfully Deleted'}, 200)
return ({'message': 'Order item not found'}, 404)<|docstring|>Delete an order<|endoftext|> |
eb1155285f2e8c4f71d5987af51a264fc79d65267a4453fa0c2202359fe27a84 | @pytest.mark.parametrize('number_of_eth_accounts', [0])
def test_query_empty_blockchain_balances(rotkehlchen_api_server):
'Make sure that querying balances for all blockchains works when no accounts are tracked\n\n Regression test for https://github.com/rotki/rotki/issues/848\n '
response = requests.get(a... | Make sure that querying balances for all blockchains works when no accounts are tracked
Regression test for https://github.com/rotki/rotki/issues/848 | rotkehlchen/tests/api/test_blockchain.py | test_query_empty_blockchain_balances | VoR0220/rotki | 1 | python | @pytest.mark.parametrize('number_of_eth_accounts', [0])
def test_query_empty_blockchain_balances(rotkehlchen_api_server):
'Make sure that querying balances for all blockchains works when no accounts are tracked\n\n Regression test for https://github.com/rotki/rotki/issues/848\n '
response = requests.get(a... | @pytest.mark.parametrize('number_of_eth_accounts', [0])
def test_query_empty_blockchain_balances(rotkehlchen_api_server):
'Make sure that querying balances for all blockchains works when no accounts are tracked\n\n Regression test for https://github.com/rotki/rotki/issues/848\n '
response = requests.get(a... |
ea2fd170426c70e843e3c960c32d7474d2c03ff68a012bc4c0bbb0a733eaefbf | @pytest.mark.parametrize('number_of_eth_accounts', [0])
@pytest.mark.parametrize('btc_accounts', [[UNIT_BTC_ADDRESS1, UNIT_BTC_ADDRESS2, 'bc1qhkje0xfvhmgk6mvanxwy09n45df03tj3h3jtnf']])
def test_query_bitcoin_blockchain_bech32_balances(rotkehlchen_api_server, ethereum_accounts, btc_accounts, caplog):
'Test that quer... | Test that querying Bech32 bitcoin addresses works fine | rotkehlchen/tests/api/test_blockchain.py | test_query_bitcoin_blockchain_bech32_balances | VoR0220/rotki | 1 | python | @pytest.mark.parametrize('number_of_eth_accounts', [0])
@pytest.mark.parametrize('btc_accounts', [[UNIT_BTC_ADDRESS1, UNIT_BTC_ADDRESS2, 'bc1qhkje0xfvhmgk6mvanxwy09n45df03tj3h3jtnf']])
def test_query_bitcoin_blockchain_bech32_balances(rotkehlchen_api_server, ethereum_accounts, btc_accounts, caplog):
caplog.set... | @pytest.mark.parametrize('number_of_eth_accounts', [0])
@pytest.mark.parametrize('btc_accounts', [[UNIT_BTC_ADDRESS1, UNIT_BTC_ADDRESS2, 'bc1qhkje0xfvhmgk6mvanxwy09n45df03tj3h3jtnf']])
def test_query_bitcoin_blockchain_bech32_balances(rotkehlchen_api_server, ethereum_accounts, btc_accounts, caplog):
caplog.set... |
bdf1828deb3070dbe8e1e0c17362b7ecad8508b0cd6e86b90e37cd47f5f9de85 | @pytest.mark.parametrize('number_of_eth_accounts', [2])
@pytest.mark.parametrize('btc_accounts', [[UNIT_BTC_ADDRESS1, UNIT_BTC_ADDRESS2]])
@pytest.mark.parametrize('mocked_current_prices', [{'RDN': FVal('0.1135'), 'ETH': FVal('212.92'), 'BTC': FVal('8849.04')}])
def test_query_blockchain_balances(rotkehlchen_api_server... | Test that the query blockchain balances endpoint works when queried asynchronously | rotkehlchen/tests/api/test_blockchain.py | test_query_blockchain_balances | VoR0220/rotki | 1 | python | @pytest.mark.parametrize('number_of_eth_accounts', [2])
@pytest.mark.parametrize('btc_accounts', [[UNIT_BTC_ADDRESS1, UNIT_BTC_ADDRESS2]])
@pytest.mark.parametrize('mocked_current_prices', [{'RDN': FVal('0.1135'), 'ETH': FVal('212.92'), 'BTC': FVal('8849.04')}])
def test_query_blockchain_balances(rotkehlchen_api_server... | @pytest.mark.parametrize('number_of_eth_accounts', [2])
@pytest.mark.parametrize('btc_accounts', [[UNIT_BTC_ADDRESS1, UNIT_BTC_ADDRESS2]])
@pytest.mark.parametrize('mocked_current_prices', [{'RDN': FVal('0.1135'), 'ETH': FVal('212.92'), 'BTC': FVal('8849.04')}])
def test_query_blockchain_balances(rotkehlchen_api_server... |
02bdcfa54bf8ed3f14986a50641276427076c1f7e20edb4ca94dd294d7c3c2c1 | @pytest.mark.parametrize('number_of_eth_accounts', [2])
def test_query_blockchain_balances_ignore_cache(rotkehlchen_api_server, ethereum_accounts, btc_accounts):
'Test that the query blockchain balances endpoint can ignore the cache'
rotki = rotkehlchen_api_server.rest_api.rotkehlchen
setup = setup_balances... | Test that the query blockchain balances endpoint can ignore the cache | rotkehlchen/tests/api/test_blockchain.py | test_query_blockchain_balances_ignore_cache | VoR0220/rotki | 1 | python | @pytest.mark.parametrize('number_of_eth_accounts', [2])
def test_query_blockchain_balances_ignore_cache(rotkehlchen_api_server, ethereum_accounts, btc_accounts):
rotki = rotkehlchen_api_server.rest_api.rotkehlchen
setup = setup_balances(rotki, ethereum_accounts=ethereum_accounts, btc_accounts=btc_accounts)... | @pytest.mark.parametrize('number_of_eth_accounts', [2])
def test_query_blockchain_balances_ignore_cache(rotkehlchen_api_server, ethereum_accounts, btc_accounts):
rotki = rotkehlchen_api_server.rest_api.rotkehlchen
setup = setup_balances(rotki, ethereum_accounts=ethereum_accounts, btc_accounts=btc_accounts)... |
23bb812476a401c511fd1c4c63558b21666af7c2b9ef81db908b4ba726b10abe | @pytest.mark.parametrize('number_of_eth_accounts', [2])
@pytest.mark.parametrize('btc_accounts', [[UNIT_BTC_ADDRESS1, UNIT_BTC_ADDRESS2]])
@pytest.mark.parametrize('query_balances_before_first_modification', [True, False])
def test_add_blockchain_accounts(rotkehlchen_api_server, ethereum_accounts, btc_accounts, query_b... | Test that the endpoint adding blockchain accounts works properly | rotkehlchen/tests/api/test_blockchain.py | test_add_blockchain_accounts | VoR0220/rotki | 1 | python | @pytest.mark.parametrize('number_of_eth_accounts', [2])
@pytest.mark.parametrize('btc_accounts', [[UNIT_BTC_ADDRESS1, UNIT_BTC_ADDRESS2]])
@pytest.mark.parametrize('query_balances_before_first_modification', [True, False])
def test_add_blockchain_accounts(rotkehlchen_api_server, ethereum_accounts, btc_accounts, query_b... | @pytest.mark.parametrize('number_of_eth_accounts', [2])
@pytest.mark.parametrize('btc_accounts', [[UNIT_BTC_ADDRESS1, UNIT_BTC_ADDRESS2]])
@pytest.mark.parametrize('query_balances_before_first_modification', [True, False])
def test_add_blockchain_accounts(rotkehlchen_api_server, ethereum_accounts, btc_accounts, query_b... |
e0d621c16c889cf709608657c29735d8147d5b08cf559293e2831e4aab81ce02 | @pytest.mark.parametrize('include_etherscan_key', [False])
@pytest.mark.parametrize('number_of_eth_accounts', [0])
def test_no_etherscan_is_detected(rotkehlchen_api_server):
'Make sure that interacting with ethereum without an etherscan key is given a warning'
rotki = rotkehlchen_api_server.rest_api.rotkehlchen... | Make sure that interacting with ethereum without an etherscan key is given a warning | rotkehlchen/tests/api/test_blockchain.py | test_no_etherscan_is_detected | VoR0220/rotki | 1 | python | @pytest.mark.parametrize('include_etherscan_key', [False])
@pytest.mark.parametrize('number_of_eth_accounts', [0])
def test_no_etherscan_is_detected(rotkehlchen_api_server):
rotki = rotkehlchen_api_server.rest_api.rotkehlchen
new_address = make_ethereum_address()
setup = setup_balances(rotki, ethereum_... | @pytest.mark.parametrize('include_etherscan_key', [False])
@pytest.mark.parametrize('number_of_eth_accounts', [0])
def test_no_etherscan_is_detected(rotkehlchen_api_server):
rotki = rotkehlchen_api_server.rest_api.rotkehlchen
new_address = make_ethereum_address()
setup = setup_balances(rotki, ethereum_... |
0ddb5c366741e3f677ca596bf019eafb4a31152fa7aebd4985867a9b020e0535 | @pytest.mark.parametrize('number_of_eth_accounts', [0])
def test_addding_non_checksummed_eth_account_works(rotkehlchen_api_server):
'Test that adding a non checksummed eth account can be handled properly'
rotki = rotkehlchen_api_server.rest_api.rotkehlchen
account = '0x7bd904a3db59fa3879bd4c246303e6ef3ac3a4... | Test that adding a non checksummed eth account can be handled properly | rotkehlchen/tests/api/test_blockchain.py | test_addding_non_checksummed_eth_account_works | VoR0220/rotki | 1 | python | @pytest.mark.parametrize('number_of_eth_accounts', [0])
def test_addding_non_checksummed_eth_account_works(rotkehlchen_api_server):
rotki = rotkehlchen_api_server.rest_api.rotkehlchen
account = '0x7bd904a3db59fa3879bd4c246303e6ef3ac3a4c6'
new_eth_accounts = [to_checksum_address(account)]
eth_balanc... | @pytest.mark.parametrize('number_of_eth_accounts', [0])
def test_addding_non_checksummed_eth_account_works(rotkehlchen_api_server):
rotki = rotkehlchen_api_server.rest_api.rotkehlchen
account = '0x7bd904a3db59fa3879bd4c246303e6ef3ac3a4c6'
new_eth_accounts = [to_checksum_address(account)]
eth_balanc... |
9b714fb1da598329be9ec84155f48818fcb7a42e8ab4cd0fe25b8c384a853329 | @pytest.mark.parametrize('number_of_eth_accounts', [0])
def test_addding_editing_ens_account_works(rotkehlchen_api_server):
'Test that adding an ENS eth account can be handled properly\n\n This test mocks all etherscan queries apart from the ENS ones\n '
resolved_account = '0x9531C059098e3d194fF87FebB587a... | Test that adding an ENS eth account can be handled properly
This test mocks all etherscan queries apart from the ENS ones | rotkehlchen/tests/api/test_blockchain.py | test_addding_editing_ens_account_works | VoR0220/rotki | 1 | python | @pytest.mark.parametrize('number_of_eth_accounts', [0])
def test_addding_editing_ens_account_works(rotkehlchen_api_server):
'Test that adding an ENS eth account can be handled properly\n\n This test mocks all etherscan queries apart from the ENS ones\n '
resolved_account = '0x9531C059098e3d194fF87FebB587a... | @pytest.mark.parametrize('number_of_eth_accounts', [0])
def test_addding_editing_ens_account_works(rotkehlchen_api_server):
'Test that adding an ENS eth account can be handled properly\n\n This test mocks all etherscan queries apart from the ENS ones\n '
resolved_account = '0x9531C059098e3d194fF87FebB587a... |
d10a0162240f1e89600f1ef56fe3b283bf29fdc57419d8ee059f7d6267c5e391 | @pytest.mark.parametrize('ethereum_accounts', [['0x9531C059098e3d194fF87FebB587aB07B30B1306']])
def test_deleting_ens_account_works(rotkehlchen_api_server, ethereum_accounts):
'Test that deleting an ENS eth account can be handled properly\n\n This test mocks all etherscan queries apart from the ENS ones\n '
... | Test that deleting an ENS eth account can be handled properly
This test mocks all etherscan queries apart from the ENS ones | rotkehlchen/tests/api/test_blockchain.py | test_deleting_ens_account_works | VoR0220/rotki | 1 | python | @pytest.mark.parametrize('ethereum_accounts', [['0x9531C059098e3d194fF87FebB587aB07B30B1306']])
def test_deleting_ens_account_works(rotkehlchen_api_server, ethereum_accounts):
'Test that deleting an ENS eth account can be handled properly\n\n This test mocks all etherscan queries apart from the ENS ones\n '
... | @pytest.mark.parametrize('ethereum_accounts', [['0x9531C059098e3d194fF87FebB587aB07B30B1306']])
def test_deleting_ens_account_works(rotkehlchen_api_server, ethereum_accounts):
'Test that deleting an ENS eth account can be handled properly\n\n This test mocks all etherscan queries apart from the ENS ones\n '
... |
2d1150abb1212eeac6af0785c1d99c69896d69070cb45404e0d435faa17839b1 | @pytest.mark.parametrize('method', ['PUT', 'DELETE'])
def test_blockchain_accounts_endpoint_errors(rotkehlchen_api_server, api_port, method):
'\n Test /api/(version)/blockchains/(name) for edge cases and errors.\n\n Test for errors when both adding and removing a blockhain account. Both put/delete\n '
... | Test /api/(version)/blockchains/(name) for edge cases and errors.
Test for errors when both adding and removing a blockhain account. Both put/delete | rotkehlchen/tests/api/test_blockchain.py | test_blockchain_accounts_endpoint_errors | VoR0220/rotki | 1 | python | @pytest.mark.parametrize('method', ['PUT', 'DELETE'])
def test_blockchain_accounts_endpoint_errors(rotkehlchen_api_server, api_port, method):
'\n Test /api/(version)/blockchains/(name) for edge cases and errors.\n\n Test for errors when both adding and removing a blockhain account. Both put/delete\n '
... | @pytest.mark.parametrize('method', ['PUT', 'DELETE'])
def test_blockchain_accounts_endpoint_errors(rotkehlchen_api_server, api_port, method):
'\n Test /api/(version)/blockchains/(name) for edge cases and errors.\n\n Test for errors when both adding and removing a blockhain account. Both put/delete\n '
... |
48fe5af90eeb121261a8a0891cb22c3b06c50fb3de0aaa2d8181d3638c116730 | @pytest.mark.parametrize('number_of_eth_accounts', [0])
def test_add_blockchain_accounts_with_tags_and_label_and_querying_them(rotkehlchen_api_server):
'Test that adding account with labels and tags works correctly'
rotki = rotkehlchen_api_server.rest_api.rotkehlchen
tag1 = {'name': 'public', 'description':... | Test that adding account with labels and tags works correctly | rotkehlchen/tests/api/test_blockchain.py | test_add_blockchain_accounts_with_tags_and_label_and_querying_them | VoR0220/rotki | 1 | python | @pytest.mark.parametrize('number_of_eth_accounts', [0])
def test_add_blockchain_accounts_with_tags_and_label_and_querying_them(rotkehlchen_api_server):
rotki = rotkehlchen_api_server.rest_api.rotkehlchen
tag1 = {'name': 'public', 'description': 'My public accounts', 'background_color': 'ffffff', 'foregroun... | @pytest.mark.parametrize('number_of_eth_accounts', [0])
def test_add_blockchain_accounts_with_tags_and_label_and_querying_them(rotkehlchen_api_server):
rotki = rotkehlchen_api_server.rest_api.rotkehlchen
tag1 = {'name': 'public', 'description': 'My public accounts', 'background_color': 'ffffff', 'foregroun... |
0bd0bf6c24c73205987a9eb1399e1f7d3424ac9c3c6f007e9ba0313f3a866bb5 | @pytest.mark.parametrize('number_of_eth_accounts', [3])
@pytest.mark.parametrize('btc_accounts', [[UNIT_BTC_ADDRESS1, UNIT_BTC_ADDRESS2]])
def test_edit_blockchain_accounts(rotkehlchen_api_server, ethereum_accounts):
'Test that the endpoint editing blockchain accounts works properly'
tag1 = {'name': 'public', '... | Test that the endpoint editing blockchain accounts works properly | rotkehlchen/tests/api/test_blockchain.py | test_edit_blockchain_accounts | VoR0220/rotki | 1 | python | @pytest.mark.parametrize('number_of_eth_accounts', [3])
@pytest.mark.parametrize('btc_accounts', [[UNIT_BTC_ADDRESS1, UNIT_BTC_ADDRESS2]])
def test_edit_blockchain_accounts(rotkehlchen_api_server, ethereum_accounts):
tag1 = {'name': 'public', 'description': 'My public accounts', 'background_color': 'ffffff', '... | @pytest.mark.parametrize('number_of_eth_accounts', [3])
@pytest.mark.parametrize('btc_accounts', [[UNIT_BTC_ADDRESS1, UNIT_BTC_ADDRESS2]])
def test_edit_blockchain_accounts(rotkehlchen_api_server, ethereum_accounts):
tag1 = {'name': 'public', 'description': 'My public accounts', 'background_color': 'ffffff', '... |
67bcb3df7c8a46b7be203d8b4666f70eef00a4510039aeebee82bda15a0482f5 | @pytest.mark.parametrize('number_of_eth_accounts', [2])
def test_edit_blockchain_account_errors(rotkehlchen_api_server, ethereum_accounts):
'Test that errors are handled properly in the edit accounts endpoint'
tag1 = {'name': 'public', 'description': 'My public accounts', 'background_color': 'ffffff', 'foregrou... | Test that errors are handled properly in the edit accounts endpoint | rotkehlchen/tests/api/test_blockchain.py | test_edit_blockchain_account_errors | VoR0220/rotki | 1 | python | @pytest.mark.parametrize('number_of_eth_accounts', [2])
def test_edit_blockchain_account_errors(rotkehlchen_api_server, ethereum_accounts):
tag1 = {'name': 'public', 'description': 'My public accounts', 'background_color': 'ffffff', 'foreground_color': '000000'}
response = requests.put(api_url_for(rotkehlc... | @pytest.mark.parametrize('number_of_eth_accounts', [2])
def test_edit_blockchain_account_errors(rotkehlchen_api_server, ethereum_accounts):
tag1 = {'name': 'public', 'description': 'My public accounts', 'background_color': 'ffffff', 'foreground_color': '000000'}
response = requests.put(api_url_for(rotkehlc... |
27934cb26c2081b5e1015044811aab2ffa95d50c3449fd5e479666a7ec79cfde | @pytest.mark.parametrize('number_of_eth_accounts', [4])
@pytest.mark.parametrize('btc_accounts', [[UNIT_BTC_ADDRESS1, UNIT_BTC_ADDRESS2]])
@pytest.mark.parametrize('query_balances_before_first_modification', [True, False])
def test_remove_blockchain_accounts(rotkehlchen_api_server, ethereum_accounts, btc_accounts, quer... | Test that the endpoint removing blockchain accounts works properly | rotkehlchen/tests/api/test_blockchain.py | test_remove_blockchain_accounts | VoR0220/rotki | 1 | python | @pytest.mark.parametrize('number_of_eth_accounts', [4])
@pytest.mark.parametrize('btc_accounts', [[UNIT_BTC_ADDRESS1, UNIT_BTC_ADDRESS2]])
@pytest.mark.parametrize('query_balances_before_first_modification', [True, False])
def test_remove_blockchain_accounts(rotkehlchen_api_server, ethereum_accounts, btc_accounts, quer... | @pytest.mark.parametrize('number_of_eth_accounts', [4])
@pytest.mark.parametrize('btc_accounts', [[UNIT_BTC_ADDRESS1, UNIT_BTC_ADDRESS2]])
@pytest.mark.parametrize('query_balances_before_first_modification', [True, False])
def test_remove_blockchain_accounts(rotkehlchen_api_server, ethereum_accounts, btc_accounts, quer... |
93e56e6e8c04e98362d1ec160bf7b7e578a0c6971f5c50600586d02636809c4d | @pytest.mark.parametrize('number_of_eth_accounts', [2])
def test_remove_nonexisting_blockchain_account_along_with_existing(rotkehlchen_api_server, ethereum_accounts):
'Test that if an existing and a non-existing account are given to remove, nothing is'
rotki = rotkehlchen_api_server.rest_api.rotkehlchen
tag... | Test that if an existing and a non-existing account are given to remove, nothing is | rotkehlchen/tests/api/test_blockchain.py | test_remove_nonexisting_blockchain_account_along_with_existing | VoR0220/rotki | 1 | python | @pytest.mark.parametrize('number_of_eth_accounts', [2])
def test_remove_nonexisting_blockchain_account_along_with_existing(rotkehlchen_api_server, ethereum_accounts):
rotki = rotkehlchen_api_server.rest_api.rotkehlchen
tag1 = {'name': 'public', 'description': 'My public accounts', 'background_color': 'ffff... | @pytest.mark.parametrize('number_of_eth_accounts', [2])
def test_remove_nonexisting_blockchain_account_along_with_existing(rotkehlchen_api_server, ethereum_accounts):
rotki = rotkehlchen_api_server.rest_api.rotkehlchen
tag1 = {'name': 'public', 'description': 'My public accounts', 'background_color': 'ffff... |
bc27a726fe7dbd5155c809e81d22c3e103d107c7df6e49836269bb0e536ae999 | @pytest.mark.parametrize('number_of_eth_accounts', [0])
def test_remove_blockchain_account_with_tags_removes_mapping(rotkehlchen_api_server):
'Test that removing an account with tags remove the mappings'
rotki = rotkehlchen_api_server.rest_api.rotkehlchen
tag1 = {'name': 'public', 'description': 'My public ... | Test that removing an account with tags remove the mappings | rotkehlchen/tests/api/test_blockchain.py | test_remove_blockchain_account_with_tags_removes_mapping | VoR0220/rotki | 1 | python | @pytest.mark.parametrize('number_of_eth_accounts', [0])
def test_remove_blockchain_account_with_tags_removes_mapping(rotkehlchen_api_server):
rotki = rotkehlchen_api_server.rest_api.rotkehlchen
tag1 = {'name': 'public', 'description': 'My public accounts', 'background_color': 'ffffff', 'foreground_color': ... | @pytest.mark.parametrize('number_of_eth_accounts', [0])
def test_remove_blockchain_account_with_tags_removes_mapping(rotkehlchen_api_server):
rotki = rotkehlchen_api_server.rest_api.rotkehlchen
tag1 = {'name': 'public', 'description': 'My public accounts', 'background_color': 'ffffff', 'foreground_color': ... |
2ce3440104a5807831463b55f664a74b23c8474f14938f2346118c6f18be6bee | def update_positions(self):
'Update the positions of robots and the ball'
self.ball_translation = self.ball_translation_field.getSFVec3f()
for robot in ROBOT_NAMES:
t = self.robot_translation_fields[robot].getSFVec3f()
self.robot_translation[robot] = t
r = self.robot_rotation_fields[... | Update the positions of robots and the ball | controllers/rcj_soccer_referee_supervisor/referee/supervisor.py | update_positions | fdmxfarhan/rcj-class | 2 | python | def update_positions(self):
self.ball_translation = self.ball_translation_field.getSFVec3f()
for robot in ROBOT_NAMES:
t = self.robot_translation_fields[robot].getSFVec3f()
self.robot_translation[robot] = t
r = self.robot_rotation_fields[robot].getSFRotation()
self.robot_rot... | def update_positions(self):
self.ball_translation = self.ball_translation_field.getSFVec3f()
for robot in ROBOT_NAMES:
t = self.robot_translation_fields[robot].getSFVec3f()
self.robot_translation[robot] = t
r = self.robot_rotation_fields[robot].getSFRotation()
self.robot_rot... |
de9fd0358584fd8cfd627369009782d3048ba08d9a612b94cd66e05bbbf29136 | def get_robot_translation(self, robot: str) -> list:
'Return the position of the robot.\n\n Args:\n robot (str): The robot whose position is returned\n\n Returns:\n list: x, y and z coordinates\n '
return self.robot_translation[robot] | Return the position of the robot.
Args:
robot (str): The robot whose position is returned
Returns:
list: x, y and z coordinates | controllers/rcj_soccer_referee_supervisor/referee/supervisor.py | get_robot_translation | fdmxfarhan/rcj-class | 2 | python | def get_robot_translation(self, robot: str) -> list:
'Return the position of the robot.\n\n Args:\n robot (str): The robot whose position is returned\n\n Returns:\n list: x, y and z coordinates\n '
return self.robot_translation[robot] | def get_robot_translation(self, robot: str) -> list:
'Return the position of the robot.\n\n Args:\n robot (str): The robot whose position is returned\n\n Returns:\n list: x, y and z coordinates\n '
return self.robot_translation[robot]<|docstring|>Return the position of... |
8daed7075dd18085355156775f1643b835f6ebec2ae94812e1cbca07a3b6ca4d | def get_ball_translation(self) -> list:
'Return the position of the ball.\n\n Returns:\n list: x, y and z coordinates\n '
return self.ball_translation | Return the position of the ball.
Returns:
list: x, y and z coordinates | controllers/rcj_soccer_referee_supervisor/referee/supervisor.py | get_ball_translation | fdmxfarhan/rcj-class | 2 | python | def get_ball_translation(self) -> list:
'Return the position of the ball.\n\n Returns:\n list: x, y and z coordinates\n '
return self.ball_translation | def get_ball_translation(self) -> list:
'Return the position of the ball.\n\n Returns:\n list: x, y and z coordinates\n '
return self.ball_translation<|docstring|>Return the position of the ball.
Returns:
list: x, y and z coordinates<|endoftext|> |
3716639fd6f332db3bae587b6b5d0e5f148ef6c4588ee1c54d644e87333df3cc | def set_robot_position(self, robot_name: str, position: List[float]):
'Set the position of a robot.\n\n Args:\n robot_name (str): The robot we are moving\n position (list of floats): The actual position\n '
tr_field = self.robot_translation_fields[robot_name]
tr_field.set... | Set the position of a robot.
Args:
robot_name (str): The robot we are moving
position (list of floats): The actual position | controllers/rcj_soccer_referee_supervisor/referee/supervisor.py | set_robot_position | fdmxfarhan/rcj-class | 2 | python | def set_robot_position(self, robot_name: str, position: List[float]):
'Set the position of a robot.\n\n Args:\n robot_name (str): The robot we are moving\n position (list of floats): The actual position\n '
tr_field = self.robot_translation_fields[robot_name]
tr_field.set... | def set_robot_position(self, robot_name: str, position: List[float]):
'Set the position of a robot.\n\n Args:\n robot_name (str): The robot we are moving\n position (list of floats): The actual position\n '
tr_field = self.robot_translation_fields[robot_name]
tr_field.set... |
b9e8e311a1c1766e5a480762f46c932bc1976dd6f1ad345eb658b778d391231b | def set_robot_rotation(self, robot_name: str, rotation: List[float]):
'Set the rotation of a robot.\n\n Args:\n robot_name (str): The robot we are rotating\n rotation (list of floats): The actual rotation\n '
rot_field = self.robot_rotation_fields[robot_name]
rot_field.se... | Set the rotation of a robot.
Args:
robot_name (str): The robot we are rotating
rotation (list of floats): The actual rotation | controllers/rcj_soccer_referee_supervisor/referee/supervisor.py | set_robot_rotation | fdmxfarhan/rcj-class | 2 | python | def set_robot_rotation(self, robot_name: str, rotation: List[float]):
'Set the rotation of a robot.\n\n Args:\n robot_name (str): The robot we are rotating\n rotation (list of floats): The actual rotation\n '
rot_field = self.robot_rotation_fields[robot_name]
rot_field.se... | def set_robot_rotation(self, robot_name: str, rotation: List[float]):
'Set the rotation of a robot.\n\n Args:\n robot_name (str): The robot we are rotating\n rotation (list of floats): The actual rotation\n '
rot_field = self.robot_rotation_fields[robot_name]
rot_field.se... |
f39c409f821624318a8ed546ea99fdf448882e0924159686129524a05fa0832a | def set_ball_position(self, position: List[float]):
'Set the position of the ball.\n\n Args:\n position (list of floats): The actual position\n '
self.ball_translation_field.setSFVec3f(position)
self.reset_ball_velocity()
self.ball.resetPhysics()
self.ball_translation = posi... | Set the position of the ball.
Args:
position (list of floats): The actual position | controllers/rcj_soccer_referee_supervisor/referee/supervisor.py | set_ball_position | fdmxfarhan/rcj-class | 2 | python | def set_ball_position(self, position: List[float]):
'Set the position of the ball.\n\n Args:\n position (list of floats): The actual position\n '
self.ball_translation_field.setSFVec3f(position)
self.reset_ball_velocity()
self.ball.resetPhysics()
self.ball_translation = posi... | def set_ball_position(self, position: List[float]):
'Set the position of the ball.\n\n Args:\n position (list of floats): The actual position\n '
self.ball_translation_field.setSFVec3f(position)
self.reset_ball_velocity()
self.ball.resetPhysics()
self.ball_translation = posi... |
e55dcd91154573a8a24fcbe12bd0eaa0025889830886aa71a55422b6114e86db | def reset_robot_velocity(self, robot_name: str):
"Reset the robot's velocity.\n\n Args:\n robot_name (str): The robot we set the velocity for\n "
self.robot_nodes[robot_name].setVelocity([0, 0, 0, 0, 0, 0]) | Reset the robot's velocity.
Args:
robot_name (str): The robot we set the velocity for | controllers/rcj_soccer_referee_supervisor/referee/supervisor.py | reset_robot_velocity | fdmxfarhan/rcj-class | 2 | python | def reset_robot_velocity(self, robot_name: str):
"Reset the robot's velocity.\n\n Args:\n robot_name (str): The robot we set the velocity for\n "
self.robot_nodes[robot_name].setVelocity([0, 0, 0, 0, 0, 0]) | def reset_robot_velocity(self, robot_name: str):
"Reset the robot's velocity.\n\n Args:\n robot_name (str): The robot we set the velocity for\n "
self.robot_nodes[robot_name].setVelocity([0, 0, 0, 0, 0, 0])<|docstring|>Reset the robot's velocity.
Args:
robot_name (str): The robot w... |
bb75a471a859b147973cb1b6229bbfde404e5dd8faf22f5579da97ab9f486182 | def reset_ball_velocity(self):
"Reset the ball's velocity."
self.ball.setVelocity([0, 0, 0, 0, 0, 0]) | Reset the ball's velocity. | controllers/rcj_soccer_referee_supervisor/referee/supervisor.py | reset_ball_velocity | fdmxfarhan/rcj-class | 2 | python | def reset_ball_velocity(self):
self.ball.setVelocity([0, 0, 0, 0, 0, 0]) | def reset_ball_velocity(self):
self.ball.setVelocity([0, 0, 0, 0, 0, 0])<|docstring|>Reset the ball's velocity.<|endoftext|> |
a6446f09e9659ae168fc98ac01dd6f8c5910f97d8958b1c5ea5aa67a8b188648 | def is_neutral_spot_occupied(self, ns_x: float, ns_y: float) -> bool:
'Check whether the specific neutral spot is occupied\n\n Args:\n ns_x (float): x position of the neutral spot\n ns_y (float): y position of the neutral spot\n\n Returns:\n bool: Whether the neutral s... | Check whether the specific neutral spot is occupied
Args:
ns_x (float): x position of the neutral spot
ns_y (float): y position of the neutral spot
Returns:
bool: Whether the neutral spot is unoccupied | controllers/rcj_soccer_referee_supervisor/referee/supervisor.py | is_neutral_spot_occupied | fdmxfarhan/rcj-class | 2 | python | def is_neutral_spot_occupied(self, ns_x: float, ns_y: float) -> bool:
'Check whether the specific neutral spot is occupied\n\n Args:\n ns_x (float): x position of the neutral spot\n ns_y (float): y position of the neutral spot\n\n Returns:\n bool: Whether the neutral s... | def is_neutral_spot_occupied(self, ns_x: float, ns_y: float) -> bool:
'Check whether the specific neutral spot is occupied\n\n Args:\n ns_x (float): x position of the neutral spot\n ns_y (float): y position of the neutral spot\n\n Returns:\n bool: Whether the neutral s... |
9b1bb51b8cced5877ab1c9dd422e174e5b5f1290a366eef1c3aa2e2b8f774fbd | def get_unoccupied_neutral_spots_sorted(self, distance_type: NeutralSpotDistanceType, object_name: str) -> List[Tuple[(str, float)]]:
'Get sorted pairs of (neutral_spot, distance)\n sorted according to distance_type.\n Furthest distance type -> descending order\n Nearest distance type -> ascend... | Get sorted pairs of (neutral_spot, distance)
sorted according to distance_type.
Furthest distance type -> descending order
Nearest distance type -> ascending order
Args:
distance_type (NeutralSpotDistanceType): Either nearest or furthest
object_name (str): Get the spot for this object
Returns:
list: sorte... | controllers/rcj_soccer_referee_supervisor/referee/supervisor.py | get_unoccupied_neutral_spots_sorted | fdmxfarhan/rcj-class | 2 | python | def get_unoccupied_neutral_spots_sorted(self, distance_type: NeutralSpotDistanceType, object_name: str) -> List[Tuple[(str, float)]]:
'Get sorted pairs of (neutral_spot, distance)\n sorted according to distance_type.\n Furthest distance type -> descending order\n Nearest distance type -> ascend... | def get_unoccupied_neutral_spots_sorted(self, distance_type: NeutralSpotDistanceType, object_name: str) -> List[Tuple[(str, float)]]:
'Get sorted pairs of (neutral_spot, distance)\n sorted according to distance_type.\n Furthest distance type -> descending order\n Nearest distance type -> ascend... |
a7ca837600ba35bcd657f30cdda10f4e840a314409842925b99646a26631e671 | def move_object_to_neutral_spot(self, object_name: str, neutral_spot: str):
"Move the robot to the specified neutral spot.\n\n Args:\n object_name (str): Name of the object (Ball or robot's name)\n neutral_spot (str): The spot the robot will be moved to\n "
(x, y) = NEUTRAL_S... | Move the robot to the specified neutral spot.
Args:
object_name (str): Name of the object (Ball or robot's name)
neutral_spot (str): The spot the robot will be moved to | controllers/rcj_soccer_referee_supervisor/referee/supervisor.py | move_object_to_neutral_spot | fdmxfarhan/rcj-class | 2 | python | def move_object_to_neutral_spot(self, object_name: str, neutral_spot: str):
"Move the robot to the specified neutral spot.\n\n Args:\n object_name (str): Name of the object (Ball or robot's name)\n neutral_spot (str): The spot the robot will be moved to\n "
(x, y) = NEUTRAL_S... | def move_object_to_neutral_spot(self, object_name: str, neutral_spot: str):
"Move the robot to the specified neutral spot.\n\n Args:\n object_name (str): Name of the object (Ball or robot's name)\n neutral_spot (str): The spot the robot will be moved to\n "
(x, y) = NEUTRAL_S... |
919a8a9e385bbe808aded519454783a5b2b146495ce3c02634bf6a2045ce269f | def emit_data(self, packet: bytes):
'Send packet via emitter\n\n Args:\n packet (bytes): the packet to be sent\n '
self.emitter.send(packet) | Send packet via emitter
Args:
packet (bytes): the packet to be sent | controllers/rcj_soccer_referee_supervisor/referee/supervisor.py | emit_data | fdmxfarhan/rcj-class | 2 | python | def emit_data(self, packet: bytes):
'Send packet via emitter\n\n Args:\n packet (bytes): the packet to be sent\n '
self.emitter.send(packet) | def emit_data(self, packet: bytes):
'Send packet via emitter\n\n Args:\n packet (bytes): the packet to be sent\n '
self.emitter.send(packet)<|docstring|>Send packet via emitter
Args:
packet (bytes): the packet to be sent<|endoftext|> |
03cc221e04e6b80da10424d72f7bf341df931cc8a8302655c0ac8968b9bcae4d | def draw_team_names(self, team_name_blue: str, team_name_yellow: str):
'Visualize (draw) the names of the teams.\n\n Args:\n team_name_blue (str): name of the blue team\n team_name_yellow (str): name of the yellow team\n '
self.setLabel(LabelIDs.BLUE_TEAM.value, team_name_blu... | Visualize (draw) the names of the teams.
Args:
team_name_blue (str): name of the blue team
team_name_yellow (str): name of the yellow team | controllers/rcj_soccer_referee_supervisor/referee/supervisor.py | draw_team_names | fdmxfarhan/rcj-class | 2 | python | def draw_team_names(self, team_name_blue: str, team_name_yellow: str):
'Visualize (draw) the names of the teams.\n\n Args:\n team_name_blue (str): name of the blue team\n team_name_yellow (str): name of the yellow team\n '
self.setLabel(LabelIDs.BLUE_TEAM.value, team_name_blu... | def draw_team_names(self, team_name_blue: str, team_name_yellow: str):
'Visualize (draw) the names of the teams.\n\n Args:\n team_name_blue (str): name of the blue team\n team_name_yellow (str): name of the yellow team\n '
self.setLabel(LabelIDs.BLUE_TEAM.value, team_name_blu... |
888dc79a3f173fcc4301d21b880085463e8ca21e3bb164eb211b280db1a7bab2 | def draw_scores(self, blue: int, yellow: int):
'Visualize (draw) the provide scores for both the blue and\n the yellow teams.\n\n Args:\n blue (int): score of the blue team\n yellow (int): score of the yellow team\n '
self.setLabel(LabelIDs.BLUE_SCORE.value, str(blue),... | Visualize (draw) the provide scores for both the blue and
the yellow teams.
Args:
blue (int): score of the blue team
yellow (int): score of the yellow team | controllers/rcj_soccer_referee_supervisor/referee/supervisor.py | draw_scores | fdmxfarhan/rcj-class | 2 | python | def draw_scores(self, blue: int, yellow: int):
'Visualize (draw) the provide scores for both the blue and\n the yellow teams.\n\n Args:\n blue (int): score of the blue team\n yellow (int): score of the yellow team\n '
self.setLabel(LabelIDs.BLUE_SCORE.value, str(blue),... | def draw_scores(self, blue: int, yellow: int):
'Visualize (draw) the provide scores for both the blue and\n the yellow teams.\n\n Args:\n blue (int): score of the blue team\n yellow (int): score of the yellow team\n '
self.setLabel(LabelIDs.BLUE_SCORE.value, str(blue),... |
45cab31d0ae4712b4a1c480fbaba3902b54292dde1c925d623cb390e17de6167 | def draw_time(self, time: int):
'Visualize (draw) the current match time\n\n Args:\n time (int): the current match time\n '
self.setLabel(LabelIDs.TIME.value, time_to_string(time), 0.45, 0.01, 0.1, 0, 0.0, 'Arial') | Visualize (draw) the current match time
Args:
time (int): the current match time | controllers/rcj_soccer_referee_supervisor/referee/supervisor.py | draw_time | fdmxfarhan/rcj-class | 2 | python | def draw_time(self, time: int):
'Visualize (draw) the current match time\n\n Args:\n time (int): the current match time\n '
self.setLabel(LabelIDs.TIME.value, time_to_string(time), 0.45, 0.01, 0.1, 0, 0.0, 'Arial') | def draw_time(self, time: int):
'Visualize (draw) the current match time\n\n Args:\n time (int): the current match time\n '
self.setLabel(LabelIDs.TIME.value, time_to_string(time), 0.45, 0.01, 0.1, 0, 0.0, 'Arial')<|docstring|>Visualize (draw) the current match time
Args:
time (int... |
92bcbd6971abd116ced6eb0961efc635b53c366544795011a7090586e0f7fbe9 | def draw_event_messages(self, messages: List[str]):
'Visualize (draw) the event messages from queue\n\n Args:\n messages: List of string messages to be drawn\n '
if messages:
self.setLabel(LabelIDs.EVENT_MESSAGES.value, '\n'.join(messages), 0.01, (0.95 - ((len(messages) - 1) * 0... | Visualize (draw) the event messages from queue
Args:
messages: List of string messages to be drawn | controllers/rcj_soccer_referee_supervisor/referee/supervisor.py | draw_event_messages | fdmxfarhan/rcj-class | 2 | python | def draw_event_messages(self, messages: List[str]):
'Visualize (draw) the event messages from queue\n\n Args:\n messages: List of string messages to be drawn\n '
if messages:
self.setLabel(LabelIDs.EVENT_MESSAGES.value, '\n'.join(messages), 0.01, (0.95 - ((len(messages) - 1) * 0... | def draw_event_messages(self, messages: List[str]):
'Visualize (draw) the event messages from queue\n\n Args:\n messages: List of string messages to be drawn\n '
if messages:
self.setLabel(LabelIDs.EVENT_MESSAGES.value, '\n'.join(messages), 0.01, (0.95 - ((len(messages) - 1) * 0... |
cac1ced868f96d02c6b12a40793428f014d868b23c04c47e1462e2155eafb462 | def draw_goal_sign(self, transparency: float=0.0):
'Visualize (draw) a GOAL! sign after goal gets scored.\n\n Args:\n transparency (float): the transparecny of the text, with 0 meaning\n no transparency and 1 meaning total transparency (the text will\n not be visible)... | Visualize (draw) a GOAL! sign after goal gets scored.
Args:
transparency (float): the transparecny of the text, with 0 meaning
no transparency and 1 meaning total transparency (the text will
not be visible). | controllers/rcj_soccer_referee_supervisor/referee/supervisor.py | draw_goal_sign | fdmxfarhan/rcj-class | 2 | python | def draw_goal_sign(self, transparency: float=0.0):
'Visualize (draw) a GOAL! sign after goal gets scored.\n\n Args:\n transparency (float): the transparecny of the text, with 0 meaning\n no transparency and 1 meaning total transparency (the text will\n not be visible)... | def draw_goal_sign(self, transparency: float=0.0):
'Visualize (draw) a GOAL! sign after goal gets scored.\n\n Args:\n transparency (float): the transparecny of the text, with 0 meaning\n no transparency and 1 meaning total transparency (the text will\n not be visible)... |
cc2f5f0d156d9ef2a1c376475e8b0d86f79026f524b25c2f26a81197c9718aec | def hide_goal_sign(self):
'Hide the GOAL! once the game is again in progress.'
self.setLabel(LabelIDs.GOAL.value, '', 0.3, 0.4, 0.4, 16711680, 1.0, 'Verdana') | Hide the GOAL! once the game is again in progress. | controllers/rcj_soccer_referee_supervisor/referee/supervisor.py | hide_goal_sign | fdmxfarhan/rcj-class | 2 | python | def hide_goal_sign(self):
self.setLabel(LabelIDs.GOAL.value, , 0.3, 0.4, 0.4, 16711680, 1.0, 'Verdana') | def hide_goal_sign(self):
self.setLabel(LabelIDs.GOAL.value, , 0.3, 0.4, 0.4, 16711680, 1.0, 'Verdana')<|docstring|>Hide the GOAL! once the game is again in progress.<|endoftext|> |
8ac9e7dca44b1adfed191857d6d3261d0c4c6f60849e8f15766bd5ce75d7cc7f | def firstMissingPositive(self, nums):
'\n :type nums: List[int]\n :rtype: int\n '
i = 0
while (i < len(nums)):
j = (nums[i] - 1)
if ((0 <= j < len(nums)) and (nums[i] != nums[j])):
(nums[i], nums[j]) = (nums[j], nums[i])
else:
i += 1
f... | :type nums: List[int]
:rtype: int | leetcode/41.first-missing-positive.py | firstMissingPositive | geemaple/algorithm | 177 | python | def firstMissingPositive(self, nums):
'\n :type nums: List[int]\n :rtype: int\n '
i = 0
while (i < len(nums)):
j = (nums[i] - 1)
if ((0 <= j < len(nums)) and (nums[i] != nums[j])):
(nums[i], nums[j]) = (nums[j], nums[i])
else:
i += 1
f... | def firstMissingPositive(self, nums):
'\n :type nums: List[int]\n :rtype: int\n '
i = 0
while (i < len(nums)):
j = (nums[i] - 1)
if ((0 <= j < len(nums)) and (nums[i] != nums[j])):
(nums[i], nums[j]) = (nums[j], nums[i])
else:
i += 1
f... |
2fe3211b9d1daff6c7e1da9c42892319c47bf8c4ed2b8a0e3937b0074d695622 | def dict_to_category(category_dict: Dict[(str, Any)], ignore_extra_keys=True) -> Category:
'Calls specific Category object constructor based on the structure of the `category_dict`.\n\n Args:\n category_dict (Dict[str, Any]): One of COCO Category dictionaries.\n ignore_extra_keys (bool, optional): ... | Calls specific Category object constructor based on the structure of the `category_dict`.
Args:
category_dict (Dict[str, Any]): One of COCO Category dictionaries.
ignore_extra_keys (bool, optional): Ignore the fact dictionary has more fields than specified in dataset. Defaults to True.
Raises:
ValueError:... | structures/category.py | dict_to_category | RossTsenov/COCO-Dataclass | 0 | python | def dict_to_category(category_dict: Dict[(str, Any)], ignore_extra_keys=True) -> Category:
'Calls specific Category object constructor based on the structure of the `category_dict`.\n\n Args:\n category_dict (Dict[str, Any]): One of COCO Category dictionaries.\n ignore_extra_keys (bool, optional): ... | def dict_to_category(category_dict: Dict[(str, Any)], ignore_extra_keys=True) -> Category:
'Calls specific Category object constructor based on the structure of the `category_dict`.\n\n Args:\n category_dict (Dict[str, Any]): One of COCO Category dictionaries.\n ignore_extra_keys (bool, optional): ... |
262a4bad4aa9e4be770671bfe3cdc4531a58b1456f3e51d1913dee6529ef7b4c | @classmethod
def from_dict(cls, category_dict: Dict[(str, Any)], ignore_extra_keys=True):
'Generates Object Detection Category dataclass from dictionary.\n\n Args:\n category_dict (Dict[str, Any]): Dictionary objects that has COCO Object Detection Category structure.\n ignore_extra_keys... | Generates Object Detection Category dataclass from dictionary.
Args:
category_dict (Dict[str, Any]): Dictionary objects that has COCO Object Detection Category structure.
ignore_extra_keys (bool, optional): Ignore the fact dictionary has more fields than specified in dataset. Defaults to True.
Returns:
Ob... | structures/category.py | from_dict | RossTsenov/COCO-Dataclass | 0 | python | @classmethod
def from_dict(cls, category_dict: Dict[(str, Any)], ignore_extra_keys=True):
'Generates Object Detection Category dataclass from dictionary.\n\n Args:\n category_dict (Dict[str, Any]): Dictionary objects that has COCO Object Detection Category structure.\n ignore_extra_keys... | @classmethod
def from_dict(cls, category_dict: Dict[(str, Any)], ignore_extra_keys=True):
'Generates Object Detection Category dataclass from dictionary.\n\n Args:\n category_dict (Dict[str, Any]): Dictionary objects that has COCO Object Detection Category structure.\n ignore_extra_keys... |
d87381403896afc46cfdc6193ec4d3342ec76b3c86c2811142ba769b3e367272 | @classmethod
def from_dict(cls, category_dict: Dict[(str, Any)], ignore_extra_keys=True):
'Generates Keypoint Detection Category dataclass from dictionary.\n\n Args:\n category_dict (Dict[str, Any]): Dictionary objects that has COCO Keypoint Detection Category structure.\n ignore_extra_... | Generates Keypoint Detection Category dataclass from dictionary.
Args:
category_dict (Dict[str, Any]): Dictionary objects that has COCO Keypoint Detection Category structure.
ignore_extra_keys (bool, optional): Ignore the fact dictionary has more fields than specified in dataset. Defaults to True.
Returns:
... | structures/category.py | from_dict | RossTsenov/COCO-Dataclass | 0 | python | @classmethod
def from_dict(cls, category_dict: Dict[(str, Any)], ignore_extra_keys=True):
'Generates Keypoint Detection Category dataclass from dictionary.\n\n Args:\n category_dict (Dict[str, Any]): Dictionary objects that has COCO Keypoint Detection Category structure.\n ignore_extra_... | @classmethod
def from_dict(cls, category_dict: Dict[(str, Any)], ignore_extra_keys=True):
'Generates Keypoint Detection Category dataclass from dictionary.\n\n Args:\n category_dict (Dict[str, Any]): Dictionary objects that has COCO Keypoint Detection Category structure.\n ignore_extra_... |
0d42cd54b09d1789d73356315aa4d0d1c4a303a518752d2e6074916588839ece | @classmethod
def from_dict(cls, category_dict: Dict[(str, Any)], ignore_extra_keys=True):
'Generates Panoptic Segmentation Category dataclass from dictionary.\n\n Args:\n category_dict (Dict[str, Any]): Dictionary objects that has COCO Panoptic Segmentation Category structure.\n ignore_... | Generates Panoptic Segmentation Category dataclass from dictionary.
Args:
category_dict (Dict[str, Any]): Dictionary objects that has COCO Panoptic Segmentation Category structure.
ignore_extra_keys (bool, optional): Ignore the fact dictionary has more fields than specified in dataset. Defaults to True.
Retur... | structures/category.py | from_dict | RossTsenov/COCO-Dataclass | 0 | python | @classmethod
def from_dict(cls, category_dict: Dict[(str, Any)], ignore_extra_keys=True):
'Generates Panoptic Segmentation Category dataclass from dictionary.\n\n Args:\n category_dict (Dict[str, Any]): Dictionary objects that has COCO Panoptic Segmentation Category structure.\n ignore_... | @classmethod
def from_dict(cls, category_dict: Dict[(str, Any)], ignore_extra_keys=True):
'Generates Panoptic Segmentation Category dataclass from dictionary.\n\n Args:\n category_dict (Dict[str, Any]): Dictionary objects that has COCO Panoptic Segmentation Category structure.\n ignore_... |
297c5b26a019a957b509b0ba8d7d3656abe10bce3fae4343a7b706d34fbfb26d | def __init__(self, url, height=None, width=None, itype=None):
'\n Constructor\n '
self.url = url
self.height = height
self.width = width
self.type = itype | Constructor | ceda_markup/opensearch/osimage.py | __init__ | cedadev/cedaMarkup | 0 | python | def __init__(self, url, height=None, width=None, itype=None):
'\n \n '
self.url = url
self.height = height
self.width = width
self.type = itype | def __init__(self, url, height=None, width=None, itype=None):
'\n \n '
self.url = url
self.height = height
self.width = width
self.type = itype<|docstring|>Constructor<|endoftext|> |
fbffc8a2d51a031d6828f1d3d2165ec4881ba9538fef8e6e3eae312764f48466 | @api.doc('List of all registred backends')
@api.marshal_with(_version)
@api.response(400, 'Invalid Request')
def get(self):
'Returns the current version of this service framework.'
return {'version': FORC_VERSION} | Returns the current version of this service framework. | FlaskOpenRestyConfigurator/app/main/controller/utils.py | get | deNBI/simpleVMWebGateway | 1 | python | @api.doc('List of all registred backends')
@api.marshal_with(_version)
@api.response(400, 'Invalid Request')
def get(self):
return {'version': FORC_VERSION} | @api.doc('List of all registred backends')
@api.marshal_with(_version)
@api.response(400, 'Invalid Request')
def get(self):
return {'version': FORC_VERSION}<|docstring|>Returns the current version of this service framework.<|endoftext|> |
8d5f7cff3795b3194af47ddc4a5124e52e46b62fb4d152631bbbefdac8cc2b05 | def update_hubspot_activity(email, latest_active_at, days_active):
'Updates Hubspot contact with latest activity dates.'
contacts_url = 'https://api.hubapi.com/crm/v3/objects/contacts'
query_string = {'hapikey': HUBSPOT_API_KEY}
date = datetime.datetime.strptime((latest_active_at + ' +0000'), '%Y-%m-%d ... | Updates Hubspot contact with latest activity dates. | libs/update_api_user_metrics.py | update_hubspot_activity | phc-health/covid-data-model | 155 | python | def update_hubspot_activity(email, latest_active_at, days_active):
contacts_url = 'https://api.hubapi.com/crm/v3/objects/contacts'
query_string = {'hapikey': HUBSPOT_API_KEY}
date = datetime.datetime.strptime((latest_active_at + ' +0000'), '%Y-%m-%d %z')
url = f'https://api.hubapi.com/contacts/v1/c... | def update_hubspot_activity(email, latest_active_at, days_active):
contacts_url = 'https://api.hubapi.com/crm/v3/objects/contacts'
query_string = {'hapikey': HUBSPOT_API_KEY}
date = datetime.datetime.strptime((latest_active_at + ' +0000'), '%Y-%m-%d %z')
url = f'https://api.hubapi.com/contacts/v1/c... |
00c4d564dc06a3966bd71cf554ea84cb25e9c233b267c37f38432b242b4c2a16 | def _run_query(database: str, query: str) -> List[dict]:
'Runs athena query.\n\n Args:\n database: Name of Athena database.\n query: Query to run.\n\n Returns: List of {<field_name>: <value>, ...} records.\n '
client = boto3.client('athena')
start_query_response = client.start_query_e... | Runs athena query.
Args:
database: Name of Athena database.
query: Query to run.
Returns: List of {<field_name>: <value>, ...} records. | libs/update_api_user_metrics.py | _run_query | phc-health/covid-data-model | 155 | python | def _run_query(database: str, query: str) -> List[dict]:
'Runs athena query.\n\n Args:\n database: Name of Athena database.\n query: Query to run.\n\n Returns: List of {<field_name>: <value>, ...} records.\n '
client = boto3.client('athena')
start_query_response = client.start_query_e... | def _run_query(database: str, query: str) -> List[dict]:
'Runs athena query.\n\n Args:\n database: Name of Athena database.\n query: Query to run.\n\n Returns: List of {<field_name>: <value>, ...} records.\n '
client = boto3.client('athena')
start_query_response = client.start_query_e... |
81fcef890899dc5ba5dfa3e8dbdd12164ba3b35f997371abf2de4a5faae960d0 | def update_google_sheet(sheet: gspread.Spreadsheet, worksheet_name: str, data: List[Dict[(str, Any)]]):
'Updates Google Sheet with latest data.\n\n Args:\n sheet: Google Sheet to update\n worksheet_name: Name of worksheet to update.\n data: List of rows containing user activity.\n '
w... | Updates Google Sheet with latest data.
Args:
sheet: Google Sheet to update
worksheet_name: Name of worksheet to update.
data: List of rows containing user activity. | libs/update_api_user_metrics.py | update_google_sheet | phc-health/covid-data-model | 155 | python | def update_google_sheet(sheet: gspread.Spreadsheet, worksheet_name: str, data: List[Dict[(str, Any)]]):
'Updates Google Sheet with latest data.\n\n Args:\n sheet: Google Sheet to update\n worksheet_name: Name of worksheet to update.\n data: List of rows containing user activity.\n '
w... | def update_google_sheet(sheet: gspread.Spreadsheet, worksheet_name: str, data: List[Dict[(str, Any)]]):
'Updates Google Sheet with latest data.\n\n Args:\n sheet: Google Sheet to update\n worksheet_name: Name of worksheet to update.\n data: List of rows containing user activity.\n '
w... |
767c5ce10f1754eae69e6e1499d17fa4110956a8ced330cdb8ef3b29a9ea387a | def update_hubspot_users(data: List[Dict[(str, Any)]], only_update_recent: bool=True):
'Updates hubspot users with usage activity.\n\n Args:\n data: List of query results.\n only_update_recent: If True only updates users with usage in the past 2 days.\n '
if (not HUBSPOT_API_KEY):
_l... | Updates hubspot users with usage activity.
Args:
data: List of query results.
only_update_recent: If True only updates users with usage in the past 2 days. | libs/update_api_user_metrics.py | update_hubspot_users | phc-health/covid-data-model | 155 | python | def update_hubspot_users(data: List[Dict[(str, Any)]], only_update_recent: bool=True):
'Updates hubspot users with usage activity.\n\n Args:\n data: List of query results.\n only_update_recent: If True only updates users with usage in the past 2 days.\n '
if (not HUBSPOT_API_KEY):
_l... | def update_hubspot_users(data: List[Dict[(str, Any)]], only_update_recent: bool=True):
'Updates hubspot users with usage activity.\n\n Args:\n data: List of query results.\n only_update_recent: If True only updates users with usage in the past 2 days.\n '
if (not HUBSPOT_API_KEY):
_l... |
3b60980a225751e5019addbb05097cfc7cf7c8b158380386f5bb544f1a0ec22d | def script(js_file):
'\n Returns a route to the JS folder. Renders the JS file in the js folder\n Error 404 is seen in the server log if not found\n :param js_file:\n :return:\n '
if ('http' in js_file):
return (('<script type="text/javascript" src="' + js_file) + '"></script>')
retur... | Returns a route to the JS folder. Renders the JS file in the js folder
Error 404 is seen in the server log if not found
:param js_file:
:return: | bast/view.py | script | hamzzy/Bast | 0 | python | def script(js_file):
'\n Returns a route to the JS folder. Renders the JS file in the js folder\n Error 404 is seen in the server log if not found\n :param js_file:\n :return:\n '
if ('http' in js_file):
return (('<script type="text/javascript" src="' + js_file) + '"></script>')
retur... | def script(js_file):
'\n Returns a route to the JS folder. Renders the JS file in the js folder\n Error 404 is seen in the server log if not found\n :param js_file:\n :return:\n '
if ('http' in js_file):
return (('<script type="text/javascript" src="' + js_file) + '"></script>')
retur... |
98166e10affdd6211be904ff84f5244bf0035df058108ff23c18960ec0532dd1 | def css(css_file):
'\n Returns a route to the CSS File and renders it to the server\n Error 404 is seen in the server log if not found\n :param css_file:\n :return:\n '
if ('http' in css_file):
return (('<link rel="stylesheet" href="' + css_file) + '">')
return (('<link rel="styleshee... | Returns a route to the CSS File and renders it to the server
Error 404 is seen in the server log if not found
:param css_file:
:return: | bast/view.py | css | hamzzy/Bast | 0 | python | def css(css_file):
'\n Returns a route to the CSS File and renders it to the server\n Error 404 is seen in the server log if not found\n :param css_file:\n :return:\n '
if ('http' in css_file):
return (('<link rel="stylesheet" href="' + css_file) + '">')
return (('<link rel="styleshee... | def css(css_file):
'\n Returns a route to the CSS File and renders it to the server\n Error 404 is seen in the server log if not found\n :param css_file:\n :return:\n '
if ('http' in css_file):
return (('<link rel="stylesheet" href="' + css_file) + '">')
return (('<link rel="styleshee... |
7d27530f715e23a147278cc67623c1ec8054214ca449d5d934b06f2f8cb2d5ba | def image(image_file, alt_name='image'):
'\n Returns a route to the image file and renders it to the server\n Error 404 is thrown in server log if not found\n :param alt_name:\n :param image_file:\n :return:\n '
if ('http' in image_file):
return (((('<img src="' + image_file) + '" alt=... | Returns a route to the image file and renders it to the server
Error 404 is thrown in server log if not found
:param alt_name:
:param image_file:
:return: | bast/view.py | image | hamzzy/Bast | 0 | python | def image(image_file, alt_name='image'):
'\n Returns a route to the image file and renders it to the server\n Error 404 is thrown in server log if not found\n :param alt_name:\n :param image_file:\n :return:\n '
if ('http' in image_file):
return (((('<img src="' + image_file) + '" alt=... | def image(image_file, alt_name='image'):
'\n Returns a route to the image file and renders it to the server\n Error 404 is thrown in server log if not found\n :param alt_name:\n :param image_file:\n :return:\n '
if ('http' in image_file):
return (((('<img src="' + image_file) + '" alt=... |
d6e8607c302f2381790fd20b3dbcc5ade5f47fcfb50d98b25a563d4aef615f2e | def get_current_branch():
'\n Get the current branch name.\n '
command = 'git rev-parse --abbrev-ref HEAD'
with chdir(get_root()):
return run_command(command, capture='out').stdout.strip() | Get the current branch name. | datadog_checks_dev/datadog_checks/dev/tooling/git.py | get_current_branch | woopstar/integrations-core | 0 | python | def get_current_branch():
'\n \n '
command = 'git rev-parse --abbrev-ref HEAD'
with chdir(get_root()):
return run_command(command, capture='out').stdout.strip() | def get_current_branch():
'\n \n '
command = 'git rev-parse --abbrev-ref HEAD'
with chdir(get_root()):
return run_command(command, capture='out').stdout.strip()<|docstring|>Get the current branch name.<|endoftext|> |
b09b2de021671e06dc22a8e02a78253d31b4432572dc11430d194d6515c011ee | def files_changed():
'\n Return the list of file changed in the current branch compared to `master`\n '
with chdir(get_root()):
result = run_command('git diff --name-only master...', capture='out')
changed_files = result.stdout.splitlines()
return [f for f in changed_files if f] | Return the list of file changed in the current branch compared to `master` | datadog_checks_dev/datadog_checks/dev/tooling/git.py | files_changed | woopstar/integrations-core | 0 | python | def files_changed():
'\n \n '
with chdir(get_root()):
result = run_command('git diff --name-only master...', capture='out')
changed_files = result.stdout.splitlines()
return [f for f in changed_files if f] | def files_changed():
'\n \n '
with chdir(get_root()):
result = run_command('git diff --name-only master...', capture='out')
changed_files = result.stdout.splitlines()
return [f for f in changed_files if f]<|docstring|>Return the list of file changed in the current branch compared to `maste... |
24833122c418caa4798da7b5ca935f5f7bf92c0df0296db31fdc8a4ea25407a5 | def parse_pr_numbers(git_log_lines):
'\n Parse PR numbers from commit messages. At GitHub those have the format:\n\n `here is the message (#1234)`\n\n being `1234` the PR number.\n '
prs = []
for line in git_log_lines:
pr_number = parse_pr_number(line)
if pr_number:
... | Parse PR numbers from commit messages. At GitHub those have the format:
`here is the message (#1234)`
being `1234` the PR number. | datadog_checks_dev/datadog_checks/dev/tooling/git.py | parse_pr_numbers | woopstar/integrations-core | 0 | python | def parse_pr_numbers(git_log_lines):
'\n Parse PR numbers from commit messages. At GitHub those have the format:\n\n `here is the message (#1234)`\n\n being `1234` the PR number.\n '
prs = []
for line in git_log_lines:
pr_number = parse_pr_number(line)
if pr_number:
... | def parse_pr_numbers(git_log_lines):
'\n Parse PR numbers from commit messages. At GitHub those have the format:\n\n `here is the message (#1234)`\n\n being `1234` the PR number.\n '
prs = []
for line in git_log_lines:
pr_number = parse_pr_number(line)
if pr_number:
... |
683ac5cb89ff172e722a1279023b2354fd285929213ab4910fa1df1bf47bd61c | def get_commits_since(check_name, target_tag=None):
'\n Get the list of commits from `target_tag` to `HEAD` for the given check\n '
root = get_root()
target_path = os.path.join(root, check_name)
command = 'git log --pretty=%s {}{}'.format(('' if (target_tag is None) else '{}... '.format(target_tag... | Get the list of commits from `target_tag` to `HEAD` for the given check | datadog_checks_dev/datadog_checks/dev/tooling/git.py | get_commits_since | woopstar/integrations-core | 0 | python | def get_commits_since(check_name, target_tag=None):
'\n \n '
root = get_root()
target_path = os.path.join(root, check_name)
command = 'git log --pretty=%s {}{}'.format(( if (target_tag is None) else '{}... '.format(target_tag)), target_path)
with chdir(root):
return run_command(command... | def get_commits_since(check_name, target_tag=None):
'\n \n '
root = get_root()
target_path = os.path.join(root, check_name)
command = 'git log --pretty=%s {}{}'.format(( if (target_tag is None) else '{}... '.format(target_tag)), target_path)
with chdir(root):
return run_command(command... |
c635d5e14a5021665d82744d411d99316a0626e2c2ede671c363b98a6336504a | def git_show_file(path, ref):
'\n Return the contents of a file at a given tag\n '
root = get_root()
command = 'git show {}:{}'.format(ref, path)
with chdir(root):
return run_command(command, capture=True).stdout | Return the contents of a file at a given tag | datadog_checks_dev/datadog_checks/dev/tooling/git.py | git_show_file | woopstar/integrations-core | 0 | python | def git_show_file(path, ref):
'\n \n '
root = get_root()
command = 'git show {}:{}'.format(ref, path)
with chdir(root):
return run_command(command, capture=True).stdout | def git_show_file(path, ref):
'\n \n '
root = get_root()
command = 'git show {}:{}'.format(ref, path)
with chdir(root):
return run_command(command, capture=True).stdout<|docstring|>Return the contents of a file at a given tag<|endoftext|> |
07372b2b95462d01cb209e8f657bcbd601d46aa2f8156ec0208a63e3debb0774 | def git_commit(targets, message, force=False, sign=False):
'\n Commit the changes for the given targets.\n '
root = get_root()
target_paths = []
for t in targets:
target_paths.append(os.path.join(root, t))
with chdir(root):
result = run_command('git add{} {}'.format((' -f' if f... | Commit the changes for the given targets. | datadog_checks_dev/datadog_checks/dev/tooling/git.py | git_commit | woopstar/integrations-core | 0 | python | def git_commit(targets, message, force=False, sign=False):
'\n \n '
root = get_root()
target_paths = []
for t in targets:
target_paths.append(os.path.join(root, t))
with chdir(root):
result = run_command('git add{} {}'.format((' -f' if force else ), ' '.join(target_paths)))
... | def git_commit(targets, message, force=False, sign=False):
'\n \n '
root = get_root()
target_paths = []
for t in targets:
target_paths.append(os.path.join(root, t))
with chdir(root):
result = run_command('git add{} {}'.format((' -f' if force else ), ' '.join(target_paths)))
... |
e0cbb708b7c5c7327c51393be31ba8fdc3de72bdc68438136c9317ad1efdc44c | def git_tag(tag_name, push=False):
'\n Tag the repo using an annotated tag.\n '
with chdir(get_root()):
result = run_command('git tag -a {} -m "{}"'.format(tag_name, tag_name), capture=True)
if push:
if (result.code != 0):
return result
return run_co... | Tag the repo using an annotated tag. | datadog_checks_dev/datadog_checks/dev/tooling/git.py | git_tag | woopstar/integrations-core | 0 | python | def git_tag(tag_name, push=False):
'\n \n '
with chdir(get_root()):
result = run_command('git tag -a {} -m "{}"'.format(tag_name, tag_name), capture=True)
if push:
if (result.code != 0):
return result
return run_command('git push origin {}'.format(ta... | def git_tag(tag_name, push=False):
'\n \n '
with chdir(get_root()):
result = run_command('git tag -a {} -m "{}"'.format(tag_name, tag_name), capture=True)
if push:
if (result.code != 0):
return result
return run_command('git push origin {}'.format(ta... |
321e930604bdf1dc5fe9b870c4fce9c2ac265dc82577728221923d9e0d41b72b | def git_tag_list(pattern=None):
'\n Return a list of all the tags in the git repo matching a regex passed in\n `pattern`. If `pattern` is None, return all the tags.\n '
with chdir(get_root()):
result = run_command('git tag', capture=True).stdout
result = result.splitlines()
if (not ... | Return a list of all the tags in the git repo matching a regex passed in
`pattern`. If `pattern` is None, return all the tags. | datadog_checks_dev/datadog_checks/dev/tooling/git.py | git_tag_list | woopstar/integrations-core | 0 | python | def git_tag_list(pattern=None):
'\n Return a list of all the tags in the git repo matching a regex passed in\n `pattern`. If `pattern` is None, return all the tags.\n '
with chdir(get_root()):
result = run_command('git tag', capture=True).stdout
result = result.splitlines()
if (not ... | def git_tag_list(pattern=None):
'\n Return a list of all the tags in the git repo matching a regex passed in\n `pattern`. If `pattern` is None, return all the tags.\n '
with chdir(get_root()):
result = run_command('git tag', capture=True).stdout
result = result.splitlines()
if (not ... |
1fbe3c64739a4507be8b6646cb0e592f16b042e5512b8c8f9482db20744f6e1f | def logistic_loss_step(x_, rho, X, y, tensor_name, calculate_by_hand=True):
'Calculate gradient of logistic loss via pytorch autograd.'
if calculate_by_hand:
prob = torch.exp(((- y) * torch.matmul(X, x_.data)))
alpha = (prob / (1 + prob))
x_.grad = ((rho * x_.data) - torch.mean(((alpha *... | Calculate gradient of logistic loss via pytorch autograd. | scripts/pytorch_opt_linear_speedup_test.py | logistic_loss_step | ymchen7/bluefog | 1 | python | def logistic_loss_step(x_, rho, X, y, tensor_name, calculate_by_hand=True):
if calculate_by_hand:
prob = torch.exp(((- y) * torch.matmul(X, x_.data)))
alpha = (prob / (1 + prob))
x_.grad = ((rho * x_.data) - torch.mean(((alpha * y) * X), dim=0).reshape((- 1), 1))
return
else... | def logistic_loss_step(x_, rho, X, y, tensor_name, calculate_by_hand=True):
if calculate_by_hand:
prob = torch.exp(((- y) * torch.matmul(X, x_.data)))
alpha = (prob / (1 + prob))
x_.grad = ((rho * x_.data) - torch.mean(((alpha * y) * X), dim=0).reshape((- 1), 1))
return
else... |
1bd26663abd4c028b58c11f7960c4540b50118e99b08b5f06189117846123adc | def to_dict(self) -> Dict[(str, Any)]:
'Convert attributes of class to dict'
return self._inputs | Convert attributes of class to dict | src/tf_transformers/core/transformer_config.py | to_dict | legacyai/tf-transformers | 116 | python | def to_dict(self) -> Dict[(str, Any)]:
return self._inputs | def to_dict(self) -> Dict[(str, Any)]:
return self._inputs<|docstring|>Convert attributes of class to dict<|endoftext|> |
eeadcdc9b14e9c06ad7de5074a79e538ba124ca9600739db2787c98034143b90 | def get_hpo_info(project_id: str) -> List[Dict]:
' Returns a list of HPOs\n\n :param project_id\n :type project_id: str\n :return: a list of HPOs\n :rtype: List[Dict]\n '
client = bq.get_client(project_id)
hpo_list = []
hpo_table_query = bq_consts.GET_HPO_CONTENTS_QUERY.format(project_id=... | Returns a list of HPOs
:param project_id
:type project_id: str
:return: a list of HPOs
:rtype: List[Dict] | data_steward/tools/store_participant_summary_results.py | get_hpo_info | lrwb-aou/curation | 16 | python | def get_hpo_info(project_id: str) -> List[Dict]:
' Returns a list of HPOs\n\n :param project_id\n :type project_id: str\n :return: a list of HPOs\n :rtype: List[Dict]\n '
client = bq.get_client(project_id)
hpo_list = []
hpo_table_query = bq_consts.GET_HPO_CONTENTS_QUERY.format(project_id=... | def get_hpo_info(project_id: str) -> List[Dict]:
' Returns a list of HPOs\n\n :param project_id\n :type project_id: str\n :return: a list of HPOs\n :rtype: List[Dict]\n '
client = bq.get_client(project_id)
hpo_list = []
hpo_table_query = bq_consts.GET_HPO_CONTENTS_QUERY.format(project_id=... |
93d571a7e64c57381daecce28d5b6ce610ebe058fbc115b73950cbd03516567d | def cross_entropy_error(y, t):
'交叉熵误差(cross entropy error)'
if (y.ndim == 1):
t = t.reshape(1, t.size)
y = y.reshape(1, y.size)
batch_size = y.shape[0]
return ((- np.sum((t * np.log((y + 1e-07))))) / batch_size) | 交叉熵误差(cross entropy error) | third_party/deep_leaning_from_scratch/common/functions.py | cross_entropy_error | KentWangYQ/py3-poc | 0 | python | def cross_entropy_error(y, t):
if (y.ndim == 1):
t = t.reshape(1, t.size)
y = y.reshape(1, y.size)
batch_size = y.shape[0]
return ((- np.sum((t * np.log((y + 1e-07))))) / batch_size) | def cross_entropy_error(y, t):
if (y.ndim == 1):
t = t.reshape(1, t.size)
y = y.reshape(1, y.size)
batch_size = y.shape[0]
return ((- np.sum((t * np.log((y + 1e-07))))) / batch_size)<|docstring|>交叉熵误差(cross entropy error)<|endoftext|> |
7a4cc3da10faea427b6b5c7f8cb6c6428c6807e2bcb3450e8318c1f87a6528a3 | def read_reaction(line):
' Interpret the parser output for a reaction line.\n '
rtype = (line[1][0][0] if ((line[1] != []) and (line[1][0] != [])) else None)
rate = (float(line[1][1][0]) if ((line[1] != []) and (line[1][1] != [])) else None)
error = (float(line[1][1][1]) if ((line[1] != []) and (line... | Interpret the parser output for a reaction line. | dsdobjects/objectio.py | read_reaction | DNA-and-Natural-Algorithms-Group/dsdobjects | 0 | python | def read_reaction(line):
' \n '
rtype = (line[1][0][0] if ((line[1] != []) and (line[1][0] != [])) else None)
rate = (float(line[1][1][0]) if ((line[1] != []) and (line[1][1] != [])) else None)
error = (float(line[1][1][1]) if ((line[1] != []) and (line[1][1] != []) and (len(line[1][1]) == 2)) else N... | def read_reaction(line):
' \n '
rtype = (line[1][0][0] if ((line[1] != []) and (line[1][0] != [])) else None)
rate = (float(line[1][1][0]) if ((line[1] != []) and (line[1][1] != [])) else None)
error = (float(line[1][1][1]) if ((line[1] != []) and (line[1][1] != []) and (len(line[1][1]) == 2)) else N... |
2610a69f9eea2a92991e4712f03e458cd310ecc42bb9a8eb2f7bb7a2074ffb5a | def resolve_kernel_loops(loop):
' Return a sequence, structure pair from kernel format.\n '
sequen = []
struct = []
for dom in loop:
if isinstance(dom, str):
sequen.append(dom)
if (dom == '+'):
struct.append('+')
else:
struct... | Return a sequence, structure pair from kernel format. | dsdobjects/objectio.py | resolve_kernel_loops | DNA-and-Natural-Algorithms-Group/dsdobjects | 0 | python | def resolve_kernel_loops(loop):
' \n '
sequen = []
struct = []
for dom in loop:
if isinstance(dom, str):
sequen.append(dom)
if (dom == '+'):
struct.append('+')
else:
struct.append('.')
elif isinstance(dom, list):
... | def resolve_kernel_loops(loop):
' \n '
sequen = []
struct = []
for dom in loop:
if isinstance(dom, str):
sequen.append(dom)
if (dom == '+'):
struct.append('+')
else:
struct.append('.')
elif isinstance(dom, list):
... |
d4fc9f32d1eeb28f3f2ae07f679d992a42a8018746c97320645f974ec6bfe371 | def read_pil(data, is_file=False, ignore=None):
' Read PIL file format.\n Args:\n data (str): Is either the PIL file in string format or the path to a file.\n is_file (bool, optional): True if data is a path to a file, False otherwise\n ignore (list, optional): A list of identifiers that sho... | Read PIL file format.
Args:
data (str): Is either the PIL file in string format or the path to a file.
is_file (bool, optional): True if data is a path to a file, False otherwise
ignore (list, optional): A list of identifiers that should be ignored. | dsdobjects/objectio.py | read_pil | DNA-and-Natural-Algorithms-Group/dsdobjects | 0 | python | def read_pil(data, is_file=False, ignore=None):
' Read PIL file format.\n Args:\n data (str): Is either the PIL file in string format or the path to a file.\n is_file (bool, optional): True if data is a path to a file, False otherwise\n ignore (list, optional): A list of identifiers that sho... | def read_pil(data, is_file=False, ignore=None):
' Read PIL file format.\n Args:\n data (str): Is either the PIL file in string format or the path to a file.\n is_file (bool, optional): True if data is a path to a file, False otherwise\n ignore (list, optional): A list of identifiers that sho... |
aa56695f206eaf625cbe60fd8dd4087952265cce279aaf96046c9bc9cd6f1fdd | def read_pil_line(raw):
' Interpret a single line of PIL input format. '
if isinstance(raw, str):
[line] = parse_pil_string(raw)
else:
line = raw
name = line[1]
if ((line[0] == 'dl-domain') and (Domain is not None)):
dlen = (5 if (line[2] == 'short') else (15 if (line[2] == ... | Interpret a single line of PIL input format. | dsdobjects/objectio.py | read_pil_line | DNA-and-Natural-Algorithms-Group/dsdobjects | 0 | python | def read_pil_line(raw):
' '
if isinstance(raw, str):
[line] = parse_pil_string(raw)
else:
line = raw
name = line[1]
if ((line[0] == 'dl-domain') and (Domain is not None)):
dlen = (5 if (line[2] == 'short') else (15 if (line[2] == 'long') else int(line[2])))
anon = D... | def read_pil_line(raw):
' '
if isinstance(raw, str):
[line] = parse_pil_string(raw)
else:
line = raw
name = line[1]
if ((line[0] == 'dl-domain') and (Domain is not None)):
dlen = (5 if (line[2] == 'short') else (15 if (line[2] == 'long') else int(line[2])))
anon = D... |
870154b4b8f6a286eff9d7d6277698c7e5dc590420e26bd1f87f4747f9a92612 | def select_at_indexes(indexes, array):
'Returns the contents of ``array`` at the multi-dimensional integer\n array ``indexes``. Leading dimensions of ``array`` must match the\n dimensions of ``indexes``.\n '
dim = len(indexes.shape)
assert (indexes.shape == array.shape[:dim])
num = int(np.prod(... | Returns the contents of ``array`` at the multi-dimensional integer
array ``indexes``. Leading dimensions of ``array`` must match the
dimensions of ``indexes``. | rlpyt/utils/array.py | select_at_indexes | taodav/rlpyt | 2,122 | python | def select_at_indexes(indexes, array):
'Returns the contents of ``array`` at the multi-dimensional integer\n array ``indexes``. Leading dimensions of ``array`` must match the\n dimensions of ``indexes``.\n '
dim = len(indexes.shape)
assert (indexes.shape == array.shape[:dim])
num = int(np.prod(... | def select_at_indexes(indexes, array):
'Returns the contents of ``array`` at the multi-dimensional integer\n array ``indexes``. Leading dimensions of ``array`` must match the\n dimensions of ``indexes``.\n '
dim = len(indexes.shape)
assert (indexes.shape == array.shape[:dim])
num = int(np.prod(... |
8805c485d31030e31dc8144f11fec9eb1581ee33068afaad01ac1a4fff8710c5 | def to_onehot(indexes, dim, dtype=None):
'Converts integer values in multi-dimensional array ``indexes``\n to one-hot values of size ``dim``; expanded in an additional\n trailing dimension.'
dtype = (indexes.dtype if (dtype is None) else dtype)
onehot = np.zeros((indexes.size, dim), dtype=dtype)
o... | Converts integer values in multi-dimensional array ``indexes``
to one-hot values of size ``dim``; expanded in an additional
trailing dimension. | rlpyt/utils/array.py | to_onehot | taodav/rlpyt | 2,122 | python | def to_onehot(indexes, dim, dtype=None):
'Converts integer values in multi-dimensional array ``indexes``\n to one-hot values of size ``dim``; expanded in an additional\n trailing dimension.'
dtype = (indexes.dtype if (dtype is None) else dtype)
onehot = np.zeros((indexes.size, dim), dtype=dtype)
o... | def to_onehot(indexes, dim, dtype=None):
'Converts integer values in multi-dimensional array ``indexes``\n to one-hot values of size ``dim``; expanded in an additional\n trailing dimension.'
dtype = (indexes.dtype if (dtype is None) else dtype)
onehot = np.zeros((indexes.size, dim), dtype=dtype)
o... |
27c875ecdc218a557e53a92610b1293818e1688af913d8ea138ca370cafd8b0c | def from_onehot(onehot, dtype=None):
'Argmax over trailing dimension of array ``onehot``. Optional return\n dtype specification.'
return np.asarray(np.argmax(onehot, axis=(- 1)), dtype=dtype) | Argmax over trailing dimension of array ``onehot``. Optional return
dtype specification. | rlpyt/utils/array.py | from_onehot | taodav/rlpyt | 2,122 | python | def from_onehot(onehot, dtype=None):
'Argmax over trailing dimension of array ``onehot``. Optional return\n dtype specification.'
return np.asarray(np.argmax(onehot, axis=(- 1)), dtype=dtype) | def from_onehot(onehot, dtype=None):
'Argmax over trailing dimension of array ``onehot``. Optional return\n dtype specification.'
return np.asarray(np.argmax(onehot, axis=(- 1)), dtype=dtype)<|docstring|>Argmax over trailing dimension of array ``onehot``. Optional return
dtype specification.<|endoftext|> |
7d25a02f92300f284371b18b38f4dc339f5fbf06e35ffdd97fef133a61b59fe2 | def valid_mean(array, valid=None, axis=None):
'Mean of ``array``, accounting for optional mask ``valid``,\n optionally along an axis.'
if (valid is None):
return array.mean(axis=axis)
return ((array * valid).sum(axis=axis) / valid.sum(axis=axis)) | Mean of ``array``, accounting for optional mask ``valid``,
optionally along an axis. | rlpyt/utils/array.py | valid_mean | taodav/rlpyt | 2,122 | python | def valid_mean(array, valid=None, axis=None):
'Mean of ``array``, accounting for optional mask ``valid``,\n optionally along an axis.'
if (valid is None):
return array.mean(axis=axis)
return ((array * valid).sum(axis=axis) / valid.sum(axis=axis)) | def valid_mean(array, valid=None, axis=None):
'Mean of ``array``, accounting for optional mask ``valid``,\n optionally along an axis.'
if (valid is None):
return array.mean(axis=axis)
return ((array * valid).sum(axis=axis) / valid.sum(axis=axis))<|docstring|>Mean of ``array``, accounting for opti... |
6eb35eb9c9c56e22e05d7a8afe448d1b2093d9a3b163d7e778ccf51ed93fb6e1 | def infer_leading_dims(array, dim):
"Determine any leading dimensions of ``array``, which can have up to two\n leading dimensions more than the number of data dimensions, ``dim``. Used\n to check for [B] or [T,B] leading. Returns size of leading dimensions (or\n 1 if they don't exist), the data shape, an... | Determine any leading dimensions of ``array``, which can have up to two
leading dimensions more than the number of data dimensions, ``dim``. Used
to check for [B] or [T,B] leading. Returns size of leading dimensions (or
1 if they don't exist), the data shape, and whether the leading dimensions
where found. | rlpyt/utils/array.py | infer_leading_dims | taodav/rlpyt | 2,122 | python | def infer_leading_dims(array, dim):
"Determine any leading dimensions of ``array``, which can have up to two\n leading dimensions more than the number of data dimensions, ``dim``. Used\n to check for [B] or [T,B] leading. Returns size of leading dimensions (or\n 1 if they don't exist), the data shape, an... | def infer_leading_dims(array, dim):
"Determine any leading dimensions of ``array``, which can have up to two\n leading dimensions more than the number of data dimensions, ``dim``. Used\n to check for [B] or [T,B] leading. Returns size of leading dimensions (or\n 1 if they don't exist), the data shape, an... |
ceed3355a9e524eab2cf01195288d26c2efd67dc71c777b97dee81df3fd10126 | @register(pattern='^\\.gdauth(?: |$)', outgoing=True)
async def generate_credentials(gdrive):
' - Only generate once for long run - '
if (helper.get_credentials(str(gdrive.from_id)) is not None):
(await gdrive.edit('`Anda sudah mengotorisasi token...`'))
(await asyncio.sleep(2.5))
(await... | - Only generate once for long run - | userbot/modules/gdrive.py | generate_credentials | syiibamir/syiibamir | 6 | python | @register(pattern='^\\.gdauth(?: |$)', outgoing=True)
async def generate_credentials(gdrive):
' '
if (helper.get_credentials(str(gdrive.from_id)) is not None):
(await gdrive.edit('`Anda sudah mengotorisasi token...`'))
(await asyncio.sleep(2.5))
(await gdrive.delete())
return Fa... | @register(pattern='^\\.gdauth(?: |$)', outgoing=True)
async def generate_credentials(gdrive):
' '
if (helper.get_credentials(str(gdrive.from_id)) is not None):
(await gdrive.edit('`Anda sudah mengotorisasi token...`'))
(await asyncio.sleep(2.5))
(await gdrive.delete())
return Fa... |
5b74bfbd37412defcb67e32cefb725674eaa1af32058b0aac554a0f47fd24f0d | async def create_app(gdrive):
' - Create google drive service app - '
creds = helper.get_credentials(str(gdrive.from_id))
if (creds is not None):
' - Repack credential objects from strings - '
creds = pickle.loads(base64.b64decode(creds.encode()))
if ((not creds) or (not creds.valid)):
... | - Create google drive service app - | userbot/modules/gdrive.py | create_app | syiibamir/syiibamir | 6 | python | async def create_app(gdrive):
' '
creds = helper.get_credentials(str(gdrive.from_id))
if (creds is not None):
' - Repack credential objects from strings - '
creds = pickle.loads(base64.b64decode(creds.encode()))
if ((not creds) or (not creds.valid)):
if (creds and creds.expired ... | async def create_app(gdrive):
' '
creds = helper.get_credentials(str(gdrive.from_id))
if (creds is not None):
' - Repack credential objects from strings - '
creds = pickle.loads(base64.b64decode(creds.encode()))
if ((not creds) or (not creds.valid)):
if (creds and creds.expired ... |
5eb2666a7cd7af3cd765e1c92015a421f74c33e206a8a0550bebeea2b5d8a5af | @register(pattern='^\\.gdreset(?: |$)', outgoing=True)
async def reset_credentials(gdrive):
' - Reset credentials or change account - '
(await gdrive.edit('`Mengatur ulang informasi...`'))
helper.clear_credentials(str(gdrive.from_id))
(await gdrive.edit('`Selesai...`'))
(await asyncio.sleep(1))
... | - Reset credentials or change account - | userbot/modules/gdrive.py | reset_credentials | syiibamir/syiibamir | 6 | python | @register(pattern='^\\.gdreset(?: |$)', outgoing=True)
async def reset_credentials(gdrive):
' '
(await gdrive.edit('`Mengatur ulang informasi...`'))
helper.clear_credentials(str(gdrive.from_id))
(await gdrive.edit('`Selesai...`'))
(await asyncio.sleep(1))
(await gdrive.delete())
return | @register(pattern='^\\.gdreset(?: |$)', outgoing=True)
async def reset_credentials(gdrive):
' '
(await gdrive.edit('`Mengatur ulang informasi...`'))
helper.clear_credentials(str(gdrive.from_id))
(await gdrive.edit('`Selesai...`'))
(await asyncio.sleep(1))
(await gdrive.delete())
return<|doc... |
ce1d2eb6facca754af58b3f38f17fae413c5ced4b66173fda1f60d4099b015f1 | async def get_raw_name(file_path):
' - Get file_name from file_path - '
return file_path.split('/')[(- 1)] | - Get file_name from file_path - | userbot/modules/gdrive.py | get_raw_name | syiibamir/syiibamir | 6 | python | async def get_raw_name(file_path):
' '
return file_path.split('/')[(- 1)] | async def get_raw_name(file_path):
' '
return file_path.split('/')[(- 1)]<|docstring|>- Get file_name from file_path -<|endoftext|> |
377453703988c9c512251e581636eff3a0c169ddee3a534ad344a098087ff782 | async def get_mimeType(name):
' - Check mimeType given file - '
mimeType = guess_type(name)[0]
if (not mimeType):
mimeType = 'text/plain'
return mimeType | - Check mimeType given file - | userbot/modules/gdrive.py | get_mimeType | syiibamir/syiibamir | 6 | python | async def get_mimeType(name):
' '
mimeType = guess_type(name)[0]
if (not mimeType):
mimeType = 'text/plain'
return mimeType | async def get_mimeType(name):
' '
mimeType = guess_type(name)[0]
if (not mimeType):
mimeType = 'text/plain'
return mimeType<|docstring|>- Check mimeType given file -<|endoftext|> |
83a7fdce77f350a7def81b08d8385eef0590c48901812a1eafe2cc149e311eed | @register(pattern='^\\.gdf (mkdir|rm|chck) (.*)', outgoing=True)
async def google_drive_managers(gdrive):
' - Google Drive folder/file management - '
(await gdrive.edit('`Mengirim informasi...`'))
service = (await create_app(gdrive))
if (service is False):
return None
' - Split name if conta... | - Google Drive folder/file management - | userbot/modules/gdrive.py | google_drive_managers | syiibamir/syiibamir | 6 | python | @register(pattern='^\\.gdf (mkdir|rm|chck) (.*)', outgoing=True)
async def google_drive_managers(gdrive):
' '
(await gdrive.edit('`Mengirim informasi...`'))
service = (await create_app(gdrive))
if (service is False):
return None
' - Split name if contains spaces by using ; - '
f_name = ... | @register(pattern='^\\.gdf (mkdir|rm|chck) (.*)', outgoing=True)
async def google_drive_managers(gdrive):
' '
(await gdrive.edit('`Mengirim informasi...`'))
service = (await create_app(gdrive))
if (service is False):
return None
' - Split name if contains spaces by using ; - '
f_name = ... |
0092c9ea764860b15757f7bc078c1bd2759e3a918cb8b1613a4b5883b623d608 | @register(pattern='^\\.gdabort(?: |$)', outgoing=True)
async def cancel_process(gdrive):
'\n Abort process for download and upload\n '
global is_cancelled
downloads = aria2.get_downloads()
(await gdrive.edit('`Membatalkan...`'))
if (len(downloads) != 0):
aria2.remove_all(force=True)
... | Abort process for download and upload | userbot/modules/gdrive.py | cancel_process | syiibamir/syiibamir | 6 | python | @register(pattern='^\\.gdabort(?: |$)', outgoing=True)
async def cancel_process(gdrive):
'\n \n '
global is_cancelled
downloads = aria2.get_downloads()
(await gdrive.edit('`Membatalkan...`'))
if (len(downloads) != 0):
aria2.remove_all(force=True)
aria2.autopurge()
is_cancel... | @register(pattern='^\\.gdabort(?: |$)', outgoing=True)
async def cancel_process(gdrive):
'\n \n '
global is_cancelled
downloads = aria2.get_downloads()
(await gdrive.edit('`Membatalkan...`'))
if (len(downloads) != 0):
aria2.remove_all(force=True)
aria2.autopurge()
is_cancel... |
1695f8d38af53725a1865cbf8939d4e765bfd2a3e295b282be7d6181bedc5b95 | @register(pattern='^\\.gdfset (put|rm)(?: |$)(.*)', outgoing=True)
async def set_upload_folder(gdrive):
' - Set parents dir for upload/check/makedir/remove - '
(await gdrive.edit('`Mengirim informasi...`'))
global parent_Id
exe = gdrive.pattern_match.group(1)
if (exe == 'rm'):
if (G_DRIVE_FO... | - Set parents dir for upload/check/makedir/remove - | userbot/modules/gdrive.py | set_upload_folder | syiibamir/syiibamir | 6 | python | @register(pattern='^\\.gdfset (put|rm)(?: |$)(.*)', outgoing=True)
async def set_upload_folder(gdrive):
' '
(await gdrive.edit('`Mengirim informasi...`'))
global parent_Id
exe = gdrive.pattern_match.group(1)
if (exe == 'rm'):
if (G_DRIVE_FOLDER_ID is not None):
parent_Id = G_DRI... | @register(pattern='^\\.gdfset (put|rm)(?: |$)(.*)', outgoing=True)
async def set_upload_folder(gdrive):
' '
(await gdrive.edit('`Mengirim informasi...`'))
global parent_Id
exe = gdrive.pattern_match.group(1)
if (exe == 'rm'):
if (G_DRIVE_FOLDER_ID is not None):
parent_Id = G_DRI... |
5627019f7c0be91246abdfcbf2adbc843167cf5aecd213e99f13f5fa4cfa232a | def _get_redist_is_l2_to_l1(self):
'\n Getter method for redist_is_l2_to_l1, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l2_to_l1 (isis-status)\n\n YANG Description: If IS-IS route redistribution from level-2 into level-1 is enabled\n '
return sel... | Getter method for redist_is_l2_to_l1, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l2_to_l1 (isis-status)
YANG Description: If IS-IS route redistribution from level-2 into level-1 is enabled | pybind/slxos/v16r_1_00b/isis_state/router_isis_config/is_address_family_v4/redist_isis/__init__.py | _get_redist_is_l2_to_l1 | shivharis/pybind | 0 | python | def _get_redist_is_l2_to_l1(self):
'\n Getter method for redist_is_l2_to_l1, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l2_to_l1 (isis-status)\n\n YANG Description: If IS-IS route redistribution from level-2 into level-1 is enabled\n '
return sel... | def _get_redist_is_l2_to_l1(self):
'\n Getter method for redist_is_l2_to_l1, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l2_to_l1 (isis-status)\n\n YANG Description: If IS-IS route redistribution from level-2 into level-1 is enabled\n '
return sel... |
899fc862825b5a6e6a63758400b62ac32af43ffbeb1a90dd78a1122ea6c6c7aa | def _set_redist_is_l2_to_l1(self, v, load=False):
'\n Setter method for redist_is_l2_to_l1, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l2_to_l1 (isis-status)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_redist_... | Setter method for redist_is_l2_to_l1, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l2_to_l1 (isis-status)
If this variable is read-only (config: false) in the
source YANG file, then _set_redist_is_l2_to_l1 is considered as a private
method. Backends looking to popu... | pybind/slxos/v16r_1_00b/isis_state/router_isis_config/is_address_family_v4/redist_isis/__init__.py | _set_redist_is_l2_to_l1 | shivharis/pybind | 0 | python | def _set_redist_is_l2_to_l1(self, v, load=False):
'\n Setter method for redist_is_l2_to_l1, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l2_to_l1 (isis-status)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_redist_... | def _set_redist_is_l2_to_l1(self, v, load=False):
'\n Setter method for redist_is_l2_to_l1, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l2_to_l1 (isis-status)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_redist_... |
de7ac6cc253adfd481aafbf9bfc443b78ef07fc442daedcad644a19ab64fcf59 | def _get_redist_is_l2_to_l1_prefix(self):
'\n Getter method for redist_is_l2_to_l1_prefix, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l2_to_l1_prefix (string)\n\n YANG Description: Prefix list name for level-2 to level-1 route distribution\n '
re... | Getter method for redist_is_l2_to_l1_prefix, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l2_to_l1_prefix (string)
YANG Description: Prefix list name for level-2 to level-1 route distribution | pybind/slxos/v16r_1_00b/isis_state/router_isis_config/is_address_family_v4/redist_isis/__init__.py | _get_redist_is_l2_to_l1_prefix | shivharis/pybind | 0 | python | def _get_redist_is_l2_to_l1_prefix(self):
'\n Getter method for redist_is_l2_to_l1_prefix, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l2_to_l1_prefix (string)\n\n YANG Description: Prefix list name for level-2 to level-1 route distribution\n '
re... | def _get_redist_is_l2_to_l1_prefix(self):
'\n Getter method for redist_is_l2_to_l1_prefix, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l2_to_l1_prefix (string)\n\n YANG Description: Prefix list name for level-2 to level-1 route distribution\n '
re... |
7f9b602c574e416d993ff36605b88e6c93f1ac4fe687ef0dc39cdfccc82a1e21 | def _set_redist_is_l2_to_l1_prefix(self, v, load=False):
'\n Setter method for redist_is_l2_to_l1_prefix, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l2_to_l1_prefix (string)\n If this variable is read-only (config: false) in the\n source YANG file, t... | Setter method for redist_is_l2_to_l1_prefix, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l2_to_l1_prefix (string)
If this variable is read-only (config: false) in the
source YANG file, then _set_redist_is_l2_to_l1_prefix is considered as a private
method. Backends... | pybind/slxos/v16r_1_00b/isis_state/router_isis_config/is_address_family_v4/redist_isis/__init__.py | _set_redist_is_l2_to_l1_prefix | shivharis/pybind | 0 | python | def _set_redist_is_l2_to_l1_prefix(self, v, load=False):
'\n Setter method for redist_is_l2_to_l1_prefix, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l2_to_l1_prefix (string)\n If this variable is read-only (config: false) in the\n source YANG file, t... | def _set_redist_is_l2_to_l1_prefix(self, v, load=False):
'\n Setter method for redist_is_l2_to_l1_prefix, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l2_to_l1_prefix (string)\n If this variable is read-only (config: false) in the\n source YANG file, t... |
a1044a77077d91756a18be1b8d80b0f22bccd06f3ef7c491770125f52e92b2b8 | def _get_redist_is_l1_to_l2(self):
'\n Getter method for redist_is_l1_to_l2, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l1_to_l2 (isis-status)\n\n YANG Description: If IS-IS route redistribution from level-1 into level-2 is enabled\n '
return sel... | Getter method for redist_is_l1_to_l2, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l1_to_l2 (isis-status)
YANG Description: If IS-IS route redistribution from level-1 into level-2 is enabled | pybind/slxos/v16r_1_00b/isis_state/router_isis_config/is_address_family_v4/redist_isis/__init__.py | _get_redist_is_l1_to_l2 | shivharis/pybind | 0 | python | def _get_redist_is_l1_to_l2(self):
'\n Getter method for redist_is_l1_to_l2, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l1_to_l2 (isis-status)\n\n YANG Description: If IS-IS route redistribution from level-1 into level-2 is enabled\n '
return sel... | def _get_redist_is_l1_to_l2(self):
'\n Getter method for redist_is_l1_to_l2, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l1_to_l2 (isis-status)\n\n YANG Description: If IS-IS route redistribution from level-1 into level-2 is enabled\n '
return sel... |
bd27a8a0bef75a80909659cb3d542b47b30516b0486653cddfacc0f2273d19a5 | def _set_redist_is_l1_to_l2(self, v, load=False):
'\n Setter method for redist_is_l1_to_l2, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l1_to_l2 (isis-status)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_redist_... | Setter method for redist_is_l1_to_l2, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l1_to_l2 (isis-status)
If this variable is read-only (config: false) in the
source YANG file, then _set_redist_is_l1_to_l2 is considered as a private
method. Backends looking to popu... | pybind/slxos/v16r_1_00b/isis_state/router_isis_config/is_address_family_v4/redist_isis/__init__.py | _set_redist_is_l1_to_l2 | shivharis/pybind | 0 | python | def _set_redist_is_l1_to_l2(self, v, load=False):
'\n Setter method for redist_is_l1_to_l2, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l1_to_l2 (isis-status)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_redist_... | def _set_redist_is_l1_to_l2(self, v, load=False):
'\n Setter method for redist_is_l1_to_l2, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l1_to_l2 (isis-status)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_redist_... |
c501eb28e28130f2ea91f54cb810605c6ce6de6e3daf862dc7d3ab98c11cadb4 | def _get_redist_is_l1_to_l2_prefix(self):
'\n Getter method for redist_is_l1_to_l2_prefix, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l1_to_l2_prefix (string)\n\n YANG Description: Prefix list name for level-1 to level-2 route distribution\n '
re... | Getter method for redist_is_l1_to_l2_prefix, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l1_to_l2_prefix (string)
YANG Description: Prefix list name for level-1 to level-2 route distribution | pybind/slxos/v16r_1_00b/isis_state/router_isis_config/is_address_family_v4/redist_isis/__init__.py | _get_redist_is_l1_to_l2_prefix | shivharis/pybind | 0 | python | def _get_redist_is_l1_to_l2_prefix(self):
'\n Getter method for redist_is_l1_to_l2_prefix, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l1_to_l2_prefix (string)\n\n YANG Description: Prefix list name for level-1 to level-2 route distribution\n '
re... | def _get_redist_is_l1_to_l2_prefix(self):
'\n Getter method for redist_is_l1_to_l2_prefix, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l1_to_l2_prefix (string)\n\n YANG Description: Prefix list name for level-1 to level-2 route distribution\n '
re... |
d569b6fd5fff8fc41e4a9b75f73569668c9b286a615814debc8111756e78e9e7 | def _set_redist_is_l1_to_l2_prefix(self, v, load=False):
'\n Setter method for redist_is_l1_to_l2_prefix, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l1_to_l2_prefix (string)\n If this variable is read-only (config: false) in the\n source YANG file, t... | Setter method for redist_is_l1_to_l2_prefix, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l1_to_l2_prefix (string)
If this variable is read-only (config: false) in the
source YANG file, then _set_redist_is_l1_to_l2_prefix is considered as a private
method. Backends... | pybind/slxos/v16r_1_00b/isis_state/router_isis_config/is_address_family_v4/redist_isis/__init__.py | _set_redist_is_l1_to_l2_prefix | shivharis/pybind | 0 | python | def _set_redist_is_l1_to_l2_prefix(self, v, load=False):
'\n Setter method for redist_is_l1_to_l2_prefix, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l1_to_l2_prefix (string)\n If this variable is read-only (config: false) in the\n source YANG file, t... | def _set_redist_is_l1_to_l2_prefix(self, v, load=False):
'\n Setter method for redist_is_l1_to_l2_prefix, mapped from YANG variable /isis_state/router_isis_config/is_address_family_v4/redist_isis/redist_is_l1_to_l2_prefix (string)\n If this variable is read-only (config: false) in the\n source YANG file, t... |
4c3dbaa0371ef67db9664ca15135ef3051178cbddd345f6cdbf434b73e2095af | def __init__(self, request_url, client, options):
'Constructs a new UserRequest.\n\n Args:\n request_url (str): The url to perform the UserRequest\n on\n client (:class:`GraphClient<microsoft.msgraph.request.graph_client.GraphClient>`):\n The client which w... | Constructs a new UserRequest.
Args:
request_url (str): The url to perform the UserRequest
on
client (:class:`GraphClient<microsoft.msgraph.request.graph_client.GraphClient>`):
The client which will be used for the request
options (list of :class:`Option<microsoft.msgraph.options.Option>`):
... | src/python2/request/user_request.py | __init__ | microsoftarchive/msgraph-sdk-python | 7 | python | def __init__(self, request_url, client, options):
'Constructs a new UserRequest.\n\n Args:\n request_url (str): The url to perform the UserRequest\n on\n client (:class:`GraphClient<microsoft.msgraph.request.graph_client.GraphClient>`):\n The client which w... | def __init__(self, request_url, client, options):
'Constructs a new UserRequest.\n\n Args:\n request_url (str): The url to perform the UserRequest\n on\n client (:class:`GraphClient<microsoft.msgraph.request.graph_client.GraphClient>`):\n The client which w... |
e519f17e2194cbcf2bead536cf4a76943e5effb434910cc89aa63a29ffe1e3cd | def delete(self):
'Deletes the specified User.'
self.method = 'DELETE'
self.send() | Deletes the specified User. | src/python2/request/user_request.py | delete | microsoftarchive/msgraph-sdk-python | 7 | python | def delete(self):
self.method = 'DELETE'
self.send() | def delete(self):
self.method = 'DELETE'
self.send()<|docstring|>Deletes the specified User.<|endoftext|> |
dd9a0da76fe693bb2aaa4602d3842d4048aaa9ba50cdb56b3cefba4e000de363 | def get(self):
'Gets the specified User.\n \n Returns:\n :class:`User<microsoft.msgraph.model.user.User>`:\n The User.\n '
self.method = 'GET'
entity = User(json.loads(self.send().content))
self._initialize_collection_properties(entity)
return entity | Gets the specified User.
Returns:
:class:`User<microsoft.msgraph.model.user.User>`:
The User. | src/python2/request/user_request.py | get | microsoftarchive/msgraph-sdk-python | 7 | python | def get(self):
'Gets the specified User.\n \n Returns:\n :class:`User<microsoft.msgraph.model.user.User>`:\n The User.\n '
self.method = 'GET'
entity = User(json.loads(self.send().content))
self._initialize_collection_properties(entity)
return entity | def get(self):
'Gets the specified User.\n \n Returns:\n :class:`User<microsoft.msgraph.model.user.User>`:\n The User.\n '
self.method = 'GET'
entity = User(json.loads(self.send().content))
self._initialize_collection_properties(entity)
return entity<|d... |
a50a6d0525ccf452236005c2bdc61fcd782ddae912ab944360f1af4cef185295 | def update(self, user):
'Updates the specified User.\n \n Args:\n user (:class:`User<microsoft.msgraph.model.user.User>`):\n The User to update.\n\n Returns:\n :class:`User<microsoft.msgraph.model.user.User>`:\n The updated User.\n '
... | Updates the specified User.
Args:
user (:class:`User<microsoft.msgraph.model.user.User>`):
The User to update.
Returns:
:class:`User<microsoft.msgraph.model.user.User>`:
The updated User. | src/python2/request/user_request.py | update | microsoftarchive/msgraph-sdk-python | 7 | python | def update(self, user):
'Updates the specified User.\n \n Args:\n user (:class:`User<microsoft.msgraph.model.user.User>`):\n The User to update.\n\n Returns:\n :class:`User<microsoft.msgraph.model.user.User>`:\n The updated User.\n '
... | def update(self, user):
'Updates the specified User.\n \n Args:\n user (:class:`User<microsoft.msgraph.model.user.User>`):\n The User to update.\n\n Returns:\n :class:`User<microsoft.msgraph.model.user.User>`:\n The updated User.\n '
... |
9e7a921b2ba3f27041f7dc7af7e2acb33c82d4ac8de644de87ae84863e298bf1 | def getAdapterType():
'\n Name of the registred Adapter\n '
return 'Ens.InboundAdapter' | Name of the registred Adapter | src/python/reddit/bs.py | getAdapterType | grongierisc/iris-python-interoperability-template | 0 | python | def getAdapterType():
'\n \n '
return 'Ens.InboundAdapter' | def getAdapterType():
'\n \n '
return 'Ens.InboundAdapter'<|docstring|>Name of the registred Adapter<|endoftext|> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.