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 |
|---|---|---|---|---|---|---|---|---|---|
fca6cf70a6d7fbd1d10578387b0b0d8562dfb058f5bf919899c3f93bf7d2346a | def build_transaction(self, tokens_to_wrap: List[ITokenBundleToken], uri_for_wrapped_token: str, recipient: str, tx_params: Optional[TxParams]=None) -> dict:
'Construct calldata to be used as input to the method.'
(tokens_to_wrap, uri_for_wrapped_token, recipient) = self.validate_and_normalize_inputs(tokens_to_... | Construct calldata to be used as input to the method. | thirdweb/abi/multiwrap.py | build_transaction | nftlabs/nftlabs-sdk-python | 30 | python | def build_transaction(self, tokens_to_wrap: List[ITokenBundleToken], uri_for_wrapped_token: str, recipient: str, tx_params: Optional[TxParams]=None) -> dict:
(tokens_to_wrap, uri_for_wrapped_token, recipient) = self.validate_and_normalize_inputs(tokens_to_wrap, uri_for_wrapped_token, recipient)
tx_params =... | def build_transaction(self, tokens_to_wrap: List[ITokenBundleToken], uri_for_wrapped_token: str, recipient: str, tx_params: Optional[TxParams]=None) -> dict:
(tokens_to_wrap, uri_for_wrapped_token, recipient) = self.validate_and_normalize_inputs(tokens_to_wrap, uri_for_wrapped_token, recipient)
tx_params =... |
2f892c323993d84917535c0b82aac3233f494eb0c70ec4874141cbf1a69f7317 | def estimate_gas(self, tokens_to_wrap: List[ITokenBundleToken], uri_for_wrapped_token: str, recipient: str, tx_params: Optional[TxParams]=None) -> int:
'Estimate gas consumption of method call.'
(tokens_to_wrap, uri_for_wrapped_token, recipient) = self.validate_and_normalize_inputs(tokens_to_wrap, uri_for_wrapp... | Estimate gas consumption of method call. | thirdweb/abi/multiwrap.py | estimate_gas | nftlabs/nftlabs-sdk-python | 30 | python | def estimate_gas(self, tokens_to_wrap: List[ITokenBundleToken], uri_for_wrapped_token: str, recipient: str, tx_params: Optional[TxParams]=None) -> int:
(tokens_to_wrap, uri_for_wrapped_token, recipient) = self.validate_and_normalize_inputs(tokens_to_wrap, uri_for_wrapped_token, recipient)
tx_params = super... | def estimate_gas(self, tokens_to_wrap: List[ITokenBundleToken], uri_for_wrapped_token: str, recipient: str, tx_params: Optional[TxParams]=None) -> int:
(tokens_to_wrap, uri_for_wrapped_token, recipient) = self.validate_and_normalize_inputs(tokens_to_wrap, uri_for_wrapped_token, recipient)
tx_params = super... |
5be96e16dcd15ae31233b2fce25711abf14a9605d5a89fe1356a65a73a7a80a6 | def __init__(self, web3_or_provider: Union[(Web3, BaseProvider)], contract_address: str, validator: MultiwrapValidator=None):
'Get an instance of wrapper for smart contract.\n\n :param web3_or_provider: Either an instance of `web3.Web3`:code: or\n `web3.providers.base.BaseProvider`:code:\n ... | Get an instance of wrapper for smart contract.
:param web3_or_provider: Either an instance of `web3.Web3`:code: or
`web3.providers.base.BaseProvider`:code:
:param contract_address: where the contract has been deployed
:param validator: for validation of method inputs. | thirdweb/abi/multiwrap.py | __init__ | nftlabs/nftlabs-sdk-python | 30 | python | def __init__(self, web3_or_provider: Union[(Web3, BaseProvider)], contract_address: str, validator: MultiwrapValidator=None):
'Get an instance of wrapper for smart contract.\n\n :param web3_or_provider: Either an instance of `web3.Web3`:code: or\n `web3.providers.base.BaseProvider`:code:\n ... | def __init__(self, web3_or_provider: Union[(Web3, BaseProvider)], contract_address: str, validator: MultiwrapValidator=None):
'Get an instance of wrapper for smart contract.\n\n :param web3_or_provider: Either an instance of `web3.Web3`:code: or\n `web3.providers.base.BaseProvider`:code:\n ... |
dd22877dc55dfaaf775c3dfa7353c9d5f7af975284c2ac94d902859f548312f3 | def get_approval_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for Approval event.\n\n :param tx_hash: hash of transaction emitting Approval event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_eth.contract(address=to_c... | Get log entry for Approval event.
:param tx_hash: hash of transaction emitting Approval event | thirdweb/abi/multiwrap.py | get_approval_event | nftlabs/nftlabs-sdk-python | 30 | python | def get_approval_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for Approval event.\n\n :param tx_hash: hash of transaction emitting Approval event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_eth.contract(address=to_c... | def get_approval_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for Approval event.\n\n :param tx_hash: hash of transaction emitting Approval event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_eth.contract(address=to_c... |
2285ce7f1c963f78b0d0f1bf5229cd33ab8caf8f5757d87ed84b783397c2ea2f | def get_approval_for_all_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for ApprovalForAll event.\n\n :param tx_hash: hash of transaction emitting ApprovalForAll event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_eth.c... | Get log entry for ApprovalForAll event.
:param tx_hash: hash of transaction emitting ApprovalForAll event | thirdweb/abi/multiwrap.py | get_approval_for_all_event | nftlabs/nftlabs-sdk-python | 30 | python | def get_approval_for_all_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for ApprovalForAll event.\n\n :param tx_hash: hash of transaction emitting ApprovalForAll event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_eth.c... | def get_approval_for_all_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for ApprovalForAll event.\n\n :param tx_hash: hash of transaction emitting ApprovalForAll event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_eth.c... |
3b349ae729928ec69ad68f610610383d2c1a14d3dea286ef87c56027f6f487d6 | def get_contract_uri_updated_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for ContractURIUpdated event.\n\n :param tx_hash: hash of transaction emitting ContractURIUpdated event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self... | Get log entry for ContractURIUpdated event.
:param tx_hash: hash of transaction emitting ContractURIUpdated event | thirdweb/abi/multiwrap.py | get_contract_uri_updated_event | nftlabs/nftlabs-sdk-python | 30 | python | def get_contract_uri_updated_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for ContractURIUpdated event.\n\n :param tx_hash: hash of transaction emitting ContractURIUpdated event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self... | def get_contract_uri_updated_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for ContractURIUpdated event.\n\n :param tx_hash: hash of transaction emitting ContractURIUpdated event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self... |
28fe9ab2275ca867c791324fd8c4a9c33d490285382a37aa3881c3e5d191d775 | def get_default_royalty_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for DefaultRoyalty event.\n\n :param tx_hash: hash of transaction emitting DefaultRoyalty event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_eth.co... | Get log entry for DefaultRoyalty event.
:param tx_hash: hash of transaction emitting DefaultRoyalty event | thirdweb/abi/multiwrap.py | get_default_royalty_event | nftlabs/nftlabs-sdk-python | 30 | python | def get_default_royalty_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for DefaultRoyalty event.\n\n :param tx_hash: hash of transaction emitting DefaultRoyalty event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_eth.co... | def get_default_royalty_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for DefaultRoyalty event.\n\n :param tx_hash: hash of transaction emitting DefaultRoyalty event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_eth.co... |
08626ca22ee62846505e77fce7b27dd72386e9d3fe3d63dceff10690dba50d62 | def get_owner_updated_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for OwnerUpdated event.\n\n :param tx_hash: hash of transaction emitting OwnerUpdated event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_eth.contract... | Get log entry for OwnerUpdated event.
:param tx_hash: hash of transaction emitting OwnerUpdated event | thirdweb/abi/multiwrap.py | get_owner_updated_event | nftlabs/nftlabs-sdk-python | 30 | python | def get_owner_updated_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for OwnerUpdated event.\n\n :param tx_hash: hash of transaction emitting OwnerUpdated event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_eth.contract... | def get_owner_updated_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for OwnerUpdated event.\n\n :param tx_hash: hash of transaction emitting OwnerUpdated event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_eth.contract... |
01614399129aa7d8f47ded10947dfea8ccf3f139c0b413f23e7cf89b6f426776 | def get_role_admin_changed_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for RoleAdminChanged event.\n\n :param tx_hash: hash of transaction emitting RoleAdminChanged event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3... | Get log entry for RoleAdminChanged event.
:param tx_hash: hash of transaction emitting RoleAdminChanged event | thirdweb/abi/multiwrap.py | get_role_admin_changed_event | nftlabs/nftlabs-sdk-python | 30 | python | def get_role_admin_changed_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for RoleAdminChanged event.\n\n :param tx_hash: hash of transaction emitting RoleAdminChanged event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3... | def get_role_admin_changed_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for RoleAdminChanged event.\n\n :param tx_hash: hash of transaction emitting RoleAdminChanged event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3... |
85369f4dec7eaad742669df32906f11a5129264117d415628406695c036f784f | def get_role_granted_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for RoleGranted event.\n\n :param tx_hash: hash of transaction emitting RoleGranted event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_eth.contract(ad... | Get log entry for RoleGranted event.
:param tx_hash: hash of transaction emitting RoleGranted event | thirdweb/abi/multiwrap.py | get_role_granted_event | nftlabs/nftlabs-sdk-python | 30 | python | def get_role_granted_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for RoleGranted event.\n\n :param tx_hash: hash of transaction emitting RoleGranted event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_eth.contract(ad... | def get_role_granted_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for RoleGranted event.\n\n :param tx_hash: hash of transaction emitting RoleGranted event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_eth.contract(ad... |
76d2edfc6ea2a6f2b29216f1efc17372c7500f744902d0945012f199304da3e2 | def get_role_revoked_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for RoleRevoked event.\n\n :param tx_hash: hash of transaction emitting RoleRevoked event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_eth.contract(ad... | Get log entry for RoleRevoked event.
:param tx_hash: hash of transaction emitting RoleRevoked event | thirdweb/abi/multiwrap.py | get_role_revoked_event | nftlabs/nftlabs-sdk-python | 30 | python | def get_role_revoked_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for RoleRevoked event.\n\n :param tx_hash: hash of transaction emitting RoleRevoked event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_eth.contract(ad... | def get_role_revoked_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for RoleRevoked event.\n\n :param tx_hash: hash of transaction emitting RoleRevoked event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_eth.contract(ad... |
159f615bb7b0a25bde072644d8cce6aadb856ca14bb52d07652209625edc3923 | def get_royalty_for_token_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for RoyaltyForToken event.\n\n :param tx_hash: hash of transaction emitting RoyaltyForToken event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_et... | Get log entry for RoyaltyForToken event.
:param tx_hash: hash of transaction emitting RoyaltyForToken event | thirdweb/abi/multiwrap.py | get_royalty_for_token_event | nftlabs/nftlabs-sdk-python | 30 | python | def get_royalty_for_token_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for RoyaltyForToken event.\n\n :param tx_hash: hash of transaction emitting RoyaltyForToken event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_et... | def get_royalty_for_token_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for RoyaltyForToken event.\n\n :param tx_hash: hash of transaction emitting RoyaltyForToken event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_et... |
f4cbc28886d1cd9a767e92f1df3a3dd24c49e1006b129aeb696575ccc3476d96 | def get_tokens_unwrapped_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for TokensUnwrapped event.\n\n :param tx_hash: hash of transaction emitting TokensUnwrapped event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_eth... | Get log entry for TokensUnwrapped event.
:param tx_hash: hash of transaction emitting TokensUnwrapped event | thirdweb/abi/multiwrap.py | get_tokens_unwrapped_event | nftlabs/nftlabs-sdk-python | 30 | python | def get_tokens_unwrapped_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for TokensUnwrapped event.\n\n :param tx_hash: hash of transaction emitting TokensUnwrapped event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_eth... | def get_tokens_unwrapped_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for TokensUnwrapped event.\n\n :param tx_hash: hash of transaction emitting TokensUnwrapped event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_eth... |
49e8253d03eaafcd41fc042ae610feba4f2af8e148f70b3fcfa9e59b09ede2b7 | def get_tokens_wrapped_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for TokensWrapped event.\n\n :param tx_hash: hash of transaction emitting TokensWrapped event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_eth.contr... | Get log entry for TokensWrapped event.
:param tx_hash: hash of transaction emitting TokensWrapped event | thirdweb/abi/multiwrap.py | get_tokens_wrapped_event | nftlabs/nftlabs-sdk-python | 30 | python | def get_tokens_wrapped_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for TokensWrapped event.\n\n :param tx_hash: hash of transaction emitting TokensWrapped event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_eth.contr... | def get_tokens_wrapped_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for TokensWrapped event.\n\n :param tx_hash: hash of transaction emitting TokensWrapped event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_eth.contr... |
1fc7b178ba0babc6a6972b20d47faead51951f656099c7afd2400738ed51a047 | def get_transfer_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for Transfer event.\n\n :param tx_hash: hash of transaction emitting Transfer event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_eth.contract(address=to_c... | Get log entry for Transfer event.
:param tx_hash: hash of transaction emitting Transfer event | thirdweb/abi/multiwrap.py | get_transfer_event | nftlabs/nftlabs-sdk-python | 30 | python | def get_transfer_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for Transfer event.\n\n :param tx_hash: hash of transaction emitting Transfer event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_eth.contract(address=to_c... | def get_transfer_event(self, tx_hash: Union[(HexBytes, bytes)]) -> Tuple[AttributeDict]:
'Get log entry for Transfer event.\n\n :param tx_hash: hash of transaction emitting Transfer event\n '
tx_receipt = self._web3_eth.getTransactionReceipt(tx_hash)
return self._web3_eth.contract(address=to_c... |
e89a76374e80c559f622e462224c015f22f2158a4295469dc3bc2ca3a42c34d7 | @staticmethod
def abi():
'Return the ABI to the underlying contract.'
return json.loads('[{"inputs":[{"internalType":"address","name":"_nativeTokenWrapper","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner"... | Return the ABI to the underlying contract. | thirdweb/abi/multiwrap.py | abi | nftlabs/nftlabs-sdk-python | 30 | python | @staticmethod
def abi():
return json.loads('[{"inputs":[{"internalType":"address","name":"_nativeTokenWrapper","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internal... | @staticmethod
def abi():
return json.loads('[{"inputs":[{"internalType":"address","name":"_nativeTokenWrapper","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internal... |
b4336b2f4ff09a59fdb8a71ccd0ec60fbbfa9d48fcaa737fa0421d6700066b46 | def setUp(self):
'Set up the tests.'
webcompat.app.config['TESTING'] = True
self.app = webcompat.app.test_client() | Set up the tests. | tests/unit/test_urls.py | setUp | softvision-oana-arbuzov/webcompat.com | 2 | python | def setUp(self):
webcompat.app.config['TESTING'] = True
self.app = webcompat.app.test_client() | def setUp(self):
webcompat.app.config['TESTING'] = True
self.app = webcompat.app.test_client()<|docstring|>Set up the tests.<|endoftext|> |
ff56221943b1285762627cbf28c4dbc317906c6ba43c726f3d605cdcfd3bdde0 | def tearDown(self):
'Tear down the tests.'
pass | Tear down the tests. | tests/unit/test_urls.py | tearDown | softvision-oana-arbuzov/webcompat.com | 2 | python | def tearDown(self):
pass | def tearDown(self):
pass<|docstring|>Tear down the tests.<|endoftext|> |
027011c3faaacbe7c461bd1b4ad98fa64714dad3513684cb3fa63d90f8326820 | def test_home(self):
'Test that the home page exists.'
rv = self.app.get('/', environ_base=headers)
self.assertEqual(rv.status_code, 200) | Test that the home page exists. | tests/unit/test_urls.py | test_home | softvision-oana-arbuzov/webcompat.com | 2 | python | def test_home(self):
rv = self.app.get('/', environ_base=headers)
self.assertEqual(rv.status_code, 200) | def test_home(self):
rv = self.app.get('/', environ_base=headers)
self.assertEqual(rv.status_code, 200)<|docstring|>Test that the home page exists.<|endoftext|> |
f934a2d976af52ae2e6baa2ac6f7624e111861b8244eacf4e58a687b4ac2a9d3 | def test_new_issue(self):
'Test that /issues/new exists.'
rv = self.app.get('/issues/new', environ_base=headers)
self.assertEqual(rv.status_code, 200) | Test that /issues/new exists. | tests/unit/test_urls.py | test_new_issue | softvision-oana-arbuzov/webcompat.com | 2 | python | def test_new_issue(self):
rv = self.app.get('/issues/new', environ_base=headers)
self.assertEqual(rv.status_code, 200) | def test_new_issue(self):
rv = self.app.get('/issues/new', environ_base=headers)
self.assertEqual(rv.status_code, 200)<|docstring|>Test that /issues/new exists.<|endoftext|> |
20160344198928338f17075030d30ef61cdf2aa1fd84984366a7721f2b86fa36 | def test_about(self):
'Test that /about exists.'
rv = self.app.get('/about')
self.assertEqual(rv.status_code, 200) | Test that /about exists. | tests/unit/test_urls.py | test_about | softvision-oana-arbuzov/webcompat.com | 2 | python | def test_about(self):
rv = self.app.get('/about')
self.assertEqual(rv.status_code, 200) | def test_about(self):
rv = self.app.get('/about')
self.assertEqual(rv.status_code, 200)<|docstring|>Test that /about exists.<|endoftext|> |
8e63b22f49f9ad55b1e238f708f73418f0b57ea3a65b42fd01263aac879375a7 | def test_privacy(self):
'Test that /privacy exists.'
rv = self.app.get('/privacy')
self.assertEqual(rv.status_code, 200) | Test that /privacy exists. | tests/unit/test_urls.py | test_privacy | softvision-oana-arbuzov/webcompat.com | 2 | python | def test_privacy(self):
rv = self.app.get('/privacy')
self.assertEqual(rv.status_code, 200) | def test_privacy(self):
rv = self.app.get('/privacy')
self.assertEqual(rv.status_code, 200)<|docstring|>Test that /privacy exists.<|endoftext|> |
81ae576278e8c537f1e6d6a7c55823ffd90607bc41b8d8e1facad211a5cdb9ae | def test_contributors(self):
'Test that /contributors exists.'
rv = self.app.get('/contributors')
self.assertEqual(rv.status_code, 200) | Test that /contributors exists. | tests/unit/test_urls.py | test_contributors | softvision-oana-arbuzov/webcompat.com | 2 | python | def test_contributors(self):
rv = self.app.get('/contributors')
self.assertEqual(rv.status_code, 200) | def test_contributors(self):
rv = self.app.get('/contributors')
self.assertEqual(rv.status_code, 200)<|docstring|>Test that /contributors exists.<|endoftext|> |
3de4e5cefee81069134d38ab3d55fac948197733d5688abcccfdd0ba104ed62d | def test_contributors_report_bug(self):
'Test that /contributors/report-bug exists.'
rv = self.app.get('/contributors/report-bug')
self.assertEqual(rv.status_code, 200) | Test that /contributors/report-bug exists. | tests/unit/test_urls.py | test_contributors_report_bug | softvision-oana-arbuzov/webcompat.com | 2 | python | def test_contributors_report_bug(self):
rv = self.app.get('/contributors/report-bug')
self.assertEqual(rv.status_code, 200) | def test_contributors_report_bug(self):
rv = self.app.get('/contributors/report-bug')
self.assertEqual(rv.status_code, 200)<|docstring|>Test that /contributors/report-bug exists.<|endoftext|> |
e2b3ac1470e160260ecbdee5d64e5ca309c63640a03bb74f1e2572f1d2bac5cb | def test_contributors_diagnose_bug(self):
'Test that /contributors/diagnose-bug exists.'
rv = self.app.get('/contributors/diagnose-bug')
self.assertEqual(rv.status_code, 200) | Test that /contributors/diagnose-bug exists. | tests/unit/test_urls.py | test_contributors_diagnose_bug | softvision-oana-arbuzov/webcompat.com | 2 | python | def test_contributors_diagnose_bug(self):
rv = self.app.get('/contributors/diagnose-bug')
self.assertEqual(rv.status_code, 200) | def test_contributors_diagnose_bug(self):
rv = self.app.get('/contributors/diagnose-bug')
self.assertEqual(rv.status_code, 200)<|docstring|>Test that /contributors/diagnose-bug exists.<|endoftext|> |
7384c441257453045cb2da5361efb95181fd305435f0f422e45b4b33e126d7d1 | def test_contributors_reproduce_bug(self):
'Test that /contributors/reproduce-bug exists.'
rv = self.app.get('/contributors/reproduce-bug')
self.assertEqual(rv.status_code, 200) | Test that /contributors/reproduce-bug exists. | tests/unit/test_urls.py | test_contributors_reproduce_bug | softvision-oana-arbuzov/webcompat.com | 2 | python | def test_contributors_reproduce_bug(self):
rv = self.app.get('/contributors/reproduce-bug')
self.assertEqual(rv.status_code, 200) | def test_contributors_reproduce_bug(self):
rv = self.app.get('/contributors/reproduce-bug')
self.assertEqual(rv.status_code, 200)<|docstring|>Test that /contributors/reproduce-bug exists.<|endoftext|> |
5ecb025e9ab1fb3e5ce4cffd9c847a74d6a074900a9892121f3cc5bc4152cb9c | def test_contributors_site_outreach(self):
'Test that /contributors/site-outreach exists.'
rv = self.app.get('/contributors/site-outreach')
self.assertEqual(rv.status_code, 200) | Test that /contributors/site-outreach exists. | tests/unit/test_urls.py | test_contributors_site_outreach | softvision-oana-arbuzov/webcompat.com | 2 | python | def test_contributors_site_outreach(self):
rv = self.app.get('/contributors/site-outreach')
self.assertEqual(rv.status_code, 200) | def test_contributors_site_outreach(self):
rv = self.app.get('/contributors/site-outreach')
self.assertEqual(rv.status_code, 200)<|docstring|>Test that /contributors/site-outreach exists.<|endoftext|> |
42a21e2f54fbcf6eadd5734bb40760f64756d72b8ed831414b99cd56fdb4c4d3 | def test_contributors_build_tools(self):
'Test that /contributors/build-tools exists.'
rv = self.app.get('/contributors/build-tools')
self.assertEqual(rv.status_code, 200) | Test that /contributors/build-tools exists. | tests/unit/test_urls.py | test_contributors_build_tools | softvision-oana-arbuzov/webcompat.com | 2 | python | def test_contributors_build_tools(self):
rv = self.app.get('/contributors/build-tools')
self.assertEqual(rv.status_code, 200) | def test_contributors_build_tools(self):
rv = self.app.get('/contributors/build-tools')
self.assertEqual(rv.status_code, 200)<|docstring|>Test that /contributors/build-tools exists.<|endoftext|> |
6a3e7b7cbc62fa85593536c4ba0a13f7940d5414550a01210ecc6ce0334d816a | def test_contributors_web_research(self):
'Test that /contributors/web-platform-research exists.'
rv = self.app.get('/contributors/web-platform-research')
self.assertEqual(rv.status_code, 200) | Test that /contributors/web-platform-research exists. | tests/unit/test_urls.py | test_contributors_web_research | softvision-oana-arbuzov/webcompat.com | 2 | python | def test_contributors_web_research(self):
rv = self.app.get('/contributors/web-platform-research')
self.assertEqual(rv.status_code, 200) | def test_contributors_web_research(self):
rv = self.app.get('/contributors/web-platform-research')
self.assertEqual(rv.status_code, 200)<|docstring|>Test that /contributors/web-platform-research exists.<|endoftext|> |
065818a6cf17be6beee1933f6312d6948726dab52decd6896428bc98f64d8f29 | def test_contributors_events(self):
'Test that /contributors/organize-webcompat-events exists.'
rv = self.app.get('/contributors/organize-webcompat-events')
self.assertEqual(rv.status_code, 200) | Test that /contributors/organize-webcompat-events exists. | tests/unit/test_urls.py | test_contributors_events | softvision-oana-arbuzov/webcompat.com | 2 | python | def test_contributors_events(self):
rv = self.app.get('/contributors/organize-webcompat-events')
self.assertEqual(rv.status_code, 200) | def test_contributors_events(self):
rv = self.app.get('/contributors/organize-webcompat-events')
self.assertEqual(rv.status_code, 200)<|docstring|>Test that /contributors/organize-webcompat-events exists.<|endoftext|> |
f7096d2910cae83a8e03dc79e58d109af2689c566c6eaac72fc54a332b2de476 | def test_contact(self):
'Test that /contact exists.'
rv = self.app.get('/contact')
self.assertEqual(rv.status_code, 200) | Test that /contact exists. | tests/unit/test_urls.py | test_contact | softvision-oana-arbuzov/webcompat.com | 2 | python | def test_contact(self):
rv = self.app.get('/contact')
self.assertEqual(rv.status_code, 200) | def test_contact(self):
rv = self.app.get('/contact')
self.assertEqual(rv.status_code, 200)<|docstring|>Test that /contact exists.<|endoftext|> |
d9729652a83b8c03452f7e9c01956f9dcead7eb5bb9a3fc77f9376c1f7310d71 | def test_activity_page_401_if_not_logged_in(self):
'Test that asks user to log in before displaying activity.'
rv = self.app.get('/me')
self.assertEqual(rv.status_code, 401) | Test that asks user to log in before displaying activity. | tests/unit/test_urls.py | test_activity_page_401_if_not_logged_in | softvision-oana-arbuzov/webcompat.com | 2 | python | def test_activity_page_401_if_not_logged_in(self):
rv = self.app.get('/me')
self.assertEqual(rv.status_code, 401) | def test_activity_page_401_if_not_logged_in(self):
rv = self.app.get('/me')
self.assertEqual(rv.status_code, 401)<|docstring|>Test that asks user to log in before displaying activity.<|endoftext|> |
239e178b433672cec4f378260cd27e2f9063d40d88bcfdf96a694221717d0b45 | def test_issue_int(self):
'Test if issues are really integer.\n\n * an issue only displays if <number> is an integer\n * /issues/<number> exists, and does not redirect.\n '
rv = self.app.get('/issues/3')
self.assertEqual(rv.status_code, 200)
self.assertNotEqual(rv.status_code, 404)
... | Test if issues are really integer.
* an issue only displays if <number> is an integer
* /issues/<number> exists, and does not redirect. | tests/unit/test_urls.py | test_issue_int | softvision-oana-arbuzov/webcompat.com | 2 | python | def test_issue_int(self):
'Test if issues are really integer.\n\n * an issue only displays if <number> is an integer\n * /issues/<number> exists, and does not redirect.\n '
rv = self.app.get('/issues/3')
self.assertEqual(rv.status_code, 200)
self.assertNotEqual(rv.status_code, 404)
... | def test_issue_int(self):
'Test if issues are really integer.\n\n * an issue only displays if <number> is an integer\n * /issues/<number> exists, and does not redirect.\n '
rv = self.app.get('/issues/3')
self.assertEqual(rv.status_code, 200)
self.assertNotEqual(rv.status_code, 404)
... |
467f8453de91d5a4932bacce6ecbdf12c595d25f2fc2604f8b2eb70e924cc245 | def test_issue_redirect(self):
'Test that the /issues/<number> exists, and does not redirect.'
rv = self.app.get('/issues/3')
self.assertEqual(rv.status_code, 200)
self.assertNotEqual(rv.status_code, 307) | Test that the /issues/<number> exists, and does not redirect. | tests/unit/test_urls.py | test_issue_redirect | softvision-oana-arbuzov/webcompat.com | 2 | python | def test_issue_redirect(self):
rv = self.app.get('/issues/3')
self.assertEqual(rv.status_code, 200)
self.assertNotEqual(rv.status_code, 307) | def test_issue_redirect(self):
rv = self.app.get('/issues/3')
self.assertEqual(rv.status_code, 200)
self.assertNotEqual(rv.status_code, 307)<|docstring|>Test that the /issues/<number> exists, and does not redirect.<|endoftext|> |
59c3c592edf9fc1e9d45b5db24ac90ff5595749756899de8c0cf7865064da33b | def test_issues_list_page(self):
'Test that the /issues route gets 200 and does not redirect.'
rv = self.app.get('/issues')
self.assertEqual(rv.status_code, 200)
self.assertNotEqual(rv.status_code, 307) | Test that the /issues route gets 200 and does not redirect. | tests/unit/test_urls.py | test_issues_list_page | softvision-oana-arbuzov/webcompat.com | 2 | python | def test_issues_list_page(self):
rv = self.app.get('/issues')
self.assertEqual(rv.status_code, 200)
self.assertNotEqual(rv.status_code, 307) | def test_issues_list_page(self):
rv = self.app.get('/issues')
self.assertEqual(rv.status_code, 200)
self.assertNotEqual(rv.status_code, 307)<|docstring|>Test that the /issues route gets 200 and does not redirect.<|endoftext|> |
a9f341fbecdb2fbf7b0b96986290777b1265e283ba6f214b3cdf6ead0e13e19c | def test_csp_report_uri(self):
'Test POST to /csp-report w/ correct content-type returns 204.'
headers = {'Content-Type': 'application/csp-report'}
rv = self.app.post('/csp-report', headers=headers)
self.assertEqual(rv.status_code, 204) | Test POST to /csp-report w/ correct content-type returns 204. | tests/unit/test_urls.py | test_csp_report_uri | softvision-oana-arbuzov/webcompat.com | 2 | python | def test_csp_report_uri(self):
headers = {'Content-Type': 'application/csp-report'}
rv = self.app.post('/csp-report', headers=headers)
self.assertEqual(rv.status_code, 204) | def test_csp_report_uri(self):
headers = {'Content-Type': 'application/csp-report'}
rv = self.app.post('/csp-report', headers=headers)
self.assertEqual(rv.status_code, 204)<|docstring|>Test POST to /csp-report w/ correct content-type returns 204.<|endoftext|> |
90877a27c451a9ef0a45de4b4a3ad7e5f531209931842b3e8f64560be6ed322f | def test_csp_report_uri_bad_content_type(self):
'Test POST w/ wrong content-type to /csp-report returns 400.'
headers = {'Content-Type': 'application/json'}
rv = self.app.post('/csp-report', headers=headers)
self.assertNotEqual(rv.status_code, 204)
self.assertEqual(rv.status_code, 400) | Test POST w/ wrong content-type to /csp-report returns 400. | tests/unit/test_urls.py | test_csp_report_uri_bad_content_type | softvision-oana-arbuzov/webcompat.com | 2 | python | def test_csp_report_uri_bad_content_type(self):
headers = {'Content-Type': 'application/json'}
rv = self.app.post('/csp-report', headers=headers)
self.assertNotEqual(rv.status_code, 204)
self.assertEqual(rv.status_code, 400) | def test_csp_report_uri_bad_content_type(self):
headers = {'Content-Type': 'application/json'}
rv = self.app.post('/csp-report', headers=headers)
self.assertNotEqual(rv.status_code, 204)
self.assertEqual(rv.status_code, 400)<|docstring|>Test POST w/ wrong content-type to /csp-report returns 400.<|e... |
c4dd8b133567beb6df2241edcaecc2f833aad24f434835b95cc30b0cb3516a8e | def test_tools_cssfixme(self):
'Test that the /tools/cssfixme route gets 200.'
rv = self.app.get('/tools/cssfixme')
self.assertEqual(rv.status_code, 410) | Test that the /tools/cssfixme route gets 200. | tests/unit/test_urls.py | test_tools_cssfixme | softvision-oana-arbuzov/webcompat.com | 2 | python | def test_tools_cssfixme(self):
rv = self.app.get('/tools/cssfixme')
self.assertEqual(rv.status_code, 410) | def test_tools_cssfixme(self):
rv = self.app.get('/tools/cssfixme')
self.assertEqual(rv.status_code, 410)<|docstring|>Test that the /tools/cssfixme route gets 200.<|endoftext|> |
0a0ff17ff4744324eff21296f787e8f447d0da31f32fb7b3472a439cab6e4113 | def test_rate_limit(self):
'Rate Limit URI sends 410 Gone.'
rv = self.app.get('/rate_limit')
self.assertEqual(rv.status_code, 410) | Rate Limit URI sends 410 Gone. | tests/unit/test_urls.py | test_rate_limit | softvision-oana-arbuzov/webcompat.com | 2 | python | def test_rate_limit(self):
rv = self.app.get('/rate_limit')
self.assertEqual(rv.status_code, 410) | def test_rate_limit(self):
rv = self.app.get('/rate_limit')
self.assertEqual(rv.status_code, 410)<|docstring|>Rate Limit URI sends 410 Gone.<|endoftext|> |
ba673270073dbdfd390e8da9a048c09bb4487b8c6c61772e0c5819d38eef3d13 | def test_missing_parameters_for_new_issue(self):
'Sends 400 to POST on /issues/new with missing parameters.'
rv = self.app.post('/issues/new', data=dict(url='foo'))
self.assertEqual(rv.status_code, 400) | Sends 400 to POST on /issues/new with missing parameters. | tests/unit/test_urls.py | test_missing_parameters_for_new_issue | softvision-oana-arbuzov/webcompat.com | 2 | python | def test_missing_parameters_for_new_issue(self):
rv = self.app.post('/issues/new', data=dict(url='foo'))
self.assertEqual(rv.status_code, 400) | def test_missing_parameters_for_new_issue(self):
rv = self.app.post('/issues/new', data=dict(url='foo'))
self.assertEqual(rv.status_code, 400)<|docstring|>Sends 400 to POST on /issues/new with missing parameters.<|endoftext|> |
97302fb35180406d3bfb0dc793c4ce3acba60a24877dd3c94002acb6c89651d7 | def test_new_issue_should_not_crash(self):
'/issues/new POST exit with 400 if missing parameters.'
data = {'problem_category': u'mobile_site_bug', 'description': u'foo', 'submit_type': u'github-proxy-report', 'url': u'http://example.com', 'os': u'Foobar', 'browser': u'BarFoo'}
rv = self.app.post('/issues/ne... | /issues/new POST exit with 400 if missing parameters. | tests/unit/test_urls.py | test_new_issue_should_not_crash | softvision-oana-arbuzov/webcompat.com | 2 | python | def test_new_issue_should_not_crash(self):
data = {'problem_category': u'mobile_site_bug', 'description': u'foo', 'submit_type': u'github-proxy-report', 'url': u'http://example.com', 'os': u'Foobar', 'browser': u'BarFoo'}
rv = self.app.post('/issues/new', data=data)
self.assertEqual(rv.status_code, 400... | def test_new_issue_should_not_crash(self):
data = {'problem_category': u'mobile_site_bug', 'description': u'foo', 'submit_type': u'github-proxy-report', 'url': u'http://example.com', 'os': u'Foobar', 'browser': u'BarFoo'}
rv = self.app.post('/issues/new', data=data)
self.assertEqual(rv.status_code, 400... |
3355bc29e93e8c091130d14cc8c19855f73b540e38031ed8dde9bd4e331266dd | def test_dashboard_triage(self):
'Request to /dashboard/triage should be 200.'
rv = self.app.get('/dashboard/triage')
self.assertEqual(rv.status_code, 200)
self.assertTrue(('<h1><a href="/">Webcompat.com</a> // Triage Dashboard</h1>' in rv.data))
self.assertTrue(('text/html' in rv.content_type)) | Request to /dashboard/triage should be 200. | tests/unit/test_urls.py | test_dashboard_triage | softvision-oana-arbuzov/webcompat.com | 2 | python | def test_dashboard_triage(self):
rv = self.app.get('/dashboard/triage')
self.assertEqual(rv.status_code, 200)
self.assertTrue(('<h1><a href="/">Webcompat.com</a> // Triage Dashboard</h1>' in rv.data))
self.assertTrue(('text/html' in rv.content_type)) | def test_dashboard_triage(self):
rv = self.app.get('/dashboard/triage')
self.assertEqual(rv.status_code, 200)
self.assertTrue(('<h1><a href="/">Webcompat.com</a> // Triage Dashboard</h1>' in rv.data))
self.assertTrue(('text/html' in rv.content_type))<|docstring|>Request to /dashboard/triage should ... |
0be02369ae9350ac50e8d7348be311c37d749479cbcbdb93c56b6044536d7ea5 | def test_dashboard_route(self):
'Request to /dashboard should be 404.\n\n For now, the dashboard route has no purpose.\n '
rv = self.app.get('/dashboard/')
content_test = ('Lost in Punk Cat Space (404)' in rv.data)
self.assertEqual(rv.status_code, 404)
self.assertTrue(('text/html' in r... | Request to /dashboard should be 404.
For now, the dashboard route has no purpose. | tests/unit/test_urls.py | test_dashboard_route | softvision-oana-arbuzov/webcompat.com | 2 | python | def test_dashboard_route(self):
'Request to /dashboard should be 404.\n\n For now, the dashboard route has no purpose.\n '
rv = self.app.get('/dashboard/')
content_test = ('Lost in Punk Cat Space (404)' in rv.data)
self.assertEqual(rv.status_code, 404)
self.assertTrue(('text/html' in r... | def test_dashboard_route(self):
'Request to /dashboard should be 404.\n\n For now, the dashboard route has no purpose.\n '
rv = self.app.get('/dashboard/')
content_test = ('Lost in Punk Cat Space (404)' in rv.data)
self.assertEqual(rv.status_code, 404)
self.assertTrue(('text/html' in r... |
b17b99cbf52823fb268a2890345c280adf303b7d079a2d1e2ab3865480f11ac0 | def load_deps(path):
'Load dependencies from requirements file'
with open(path) as fp:
return [line.strip() for line in fp if (not is_ignored(line))] | Load dependencies from requirements file | setup.py | load_deps | yonittanenbaum/mlrun | 0 | python | def load_deps(path):
with open(path) as fp:
return [line.strip() for line in fp if (not is_ignored(line))] | def load_deps(path):
with open(path) as fp:
return [line.strip() for line in fp if (not is_ignored(line))]<|docstring|>Load dependencies from requirements file<|endoftext|> |
d6868b14ba9352a49c57690d10365ff9c0c6266a6f97a5fd51c7a8efe65ddb8d | def reward_function(params):
'\n Stay in the track and incentive higher speeds\n '
MAX_REWARD = float(10000)
if (params['progress'] == 100):
return MAX_REWARD
all_wheels_on_track = params['all_wheels_on_track']
distance_from_center = params['distance_from_center']
track_width = par... | Stay in the track and incentive higher speeds | deepracer/rewards/time-trial/speed_incentivized_simple_track_follow.py | reward_function | spowers42/rl-racing | 0 | python | def reward_function(params):
'\n \n '
MAX_REWARD = float(10000)
if (params['progress'] == 100):
return MAX_REWARD
all_wheels_on_track = params['all_wheels_on_track']
distance_from_center = params['distance_from_center']
track_width = params['track_width']
reward = 0.001
if ... | def reward_function(params):
'\n \n '
MAX_REWARD = float(10000)
if (params['progress'] == 100):
return MAX_REWARD
all_wheels_on_track = params['all_wheels_on_track']
distance_from_center = params['distance_from_center']
track_width = params['track_width']
reward = 0.001
if ... |
68841d9e24e51befa61546debcaf2408ae44ef69acb7d1a9ac813e34b8b69f5a | def my_inference_detector(model, data):
'Inference image(s) with the detector.\n\n Args:\n model (nn.Module): The loaded detector.\n imgs (str/ndarray or list[str/ndarray]): Either image files or loaded\n images.\n\n Returns:\n If imgs is a str, a generator will be returned, ot... | Inference image(s) with the detector.
Args:
model (nn.Module): The loaded detector.
imgs (str/ndarray or list[str/ndarray]): Either image files or loaded
images.
Returns:
If imgs is a str, a generator will be returned, otherwise return the
detection results directly. | UFPMP-Det-Tools/eval_script/ufpmp_det_eval.py | my_inference_detector | PuAnysh/UFPMP-Det | 9 | python | def my_inference_detector(model, data):
'Inference image(s) with the detector.\n\n Args:\n model (nn.Module): The loaded detector.\n imgs (str/ndarray or list[str/ndarray]): Either image files or loaded\n images.\n\n Returns:\n If imgs is a str, a generator will be returned, ot... | def my_inference_detector(model, data):
'Inference image(s) with the detector.\n\n Args:\n model (nn.Module): The loaded detector.\n imgs (str/ndarray or list[str/ndarray]): Either image files or loaded\n images.\n\n Returns:\n If imgs is a str, a generator will be returned, ot... |
207f67dd87ec988b3549a0a139539ecf3ec5edb2114b4bfc7449a2b6d37baada | def py_cpu_nms(dets, thresh):
'Pure Python NMS baseline.'
dets = np.array(dets)
x1 = dets[(:, 0)]
y1 = dets[(:, 1)]
x2 = dets[(:, 2)]
y2 = dets[(:, 3)]
scores = dets[(:, 4)]
areas = (((x2 - x1) + 1) * ((y2 - y1) + 1))
order = scores.argsort()[::(- 1)]
keep = []
while (order.s... | Pure Python NMS baseline. | UFPMP-Det-Tools/eval_script/ufpmp_det_eval.py | py_cpu_nms | PuAnysh/UFPMP-Det | 9 | python | def py_cpu_nms(dets, thresh):
dets = np.array(dets)
x1 = dets[(:, 0)]
y1 = dets[(:, 1)]
x2 = dets[(:, 2)]
y2 = dets[(:, 3)]
scores = dets[(:, 4)]
areas = (((x2 - x1) + 1) * ((y2 - y1) + 1))
order = scores.argsort()[::(- 1)]
keep = []
while (order.size > 0):
i = order... | def py_cpu_nms(dets, thresh):
dets = np.array(dets)
x1 = dets[(:, 0)]
y1 = dets[(:, 1)]
x2 = dets[(:, 2)]
y2 = dets[(:, 3)]
scores = dets[(:, 4)]
areas = (((x2 - x1) + 1) * ((y2 - y1) + 1))
order = scores.argsort()[::(- 1)]
keep = []
while (order.size > 0):
i = order... |
b5fdb3435d45051dca51a28210bb8e7086da30e9e01a28fa41b6866c8cb90cb9 | def __call__(self, results, bbox=None, img_data=None):
'Call function to load images into results.\n\n Args:\n results (dict): A result dict contains the file name\n of the image to be read.\n\n Returns:\n dict: ``results`` will be returned containing loaded image.... | Call function to load images into results.
Args:
results (dict): A result dict contains the file name
of the image to be read.
Returns:
dict: ``results`` will be returned containing loaded image. | UFPMP-Det-Tools/eval_script/ufpmp_det_eval.py | __call__ | PuAnysh/UFPMP-Det | 9 | python | def __call__(self, results, bbox=None, img_data=None):
'Call function to load images into results.\n\n Args:\n results (dict): A result dict contains the file name\n of the image to be read.\n\n Returns:\n dict: ``results`` will be returned containing loaded image.... | def __call__(self, results, bbox=None, img_data=None):
'Call function to load images into results.\n\n Args:\n results (dict): A result dict contains the file name\n of the image to be read.\n\n Returns:\n dict: ``results`` will be returned containing loaded image.... |
fea8e7de41bc3058a86d5ab89ebed39d4df65d648bd945e8fd7195800911ddbb | def __init__(self):
'\n Constructor that will appropriately initialize a supervised learning object\n @ In, None\n @ Out, None\n '
super().__init__()
import sklearn
import sklearn.multiclass
self.model = sklearn.multiclass.OutputCodeClassifier | Constructor that will appropriately initialize a supervised learning object
@ In, None
@ Out, None | framework/SupervisedLearning/ScikitLearn/MultiClass/OutputCodeClassifier.py | __init__ | greenwoodms06/raven | 1 | python | def __init__(self):
'\n Constructor that will appropriately initialize a supervised learning object\n @ In, None\n @ Out, None\n '
super().__init__()
import sklearn
import sklearn.multiclass
self.model = sklearn.multiclass.OutputCodeClassifier | def __init__(self):
'\n Constructor that will appropriately initialize a supervised learning object\n @ In, None\n @ Out, None\n '
super().__init__()
import sklearn
import sklearn.multiclass
self.model = sklearn.multiclass.OutputCodeClassifier<|docstring|>Constructor that will appr... |
655c31687e9737678c96d3c37d5f38871acc36ff63a6f2c9f2242a24ecc50cb1 | @classmethod
def getInputSpecification(cls):
'\n Method to get a reference to a class that specifies the input data for\n class cls.\n @ In, cls, the class for which we are retrieving the specification\n @ Out, inputSpecification, InputData.ParameterInput, class to use for\n specifying in... | Method to get a reference to a class that specifies the input data for
class cls.
@ In, cls, the class for which we are retrieving the specification
@ Out, inputSpecification, InputData.ParameterInput, class to use for
specifying input of cls. | framework/SupervisedLearning/ScikitLearn/MultiClass/OutputCodeClassifier.py | getInputSpecification | greenwoodms06/raven | 1 | python | @classmethod
def getInputSpecification(cls):
'\n Method to get a reference to a class that specifies the input data for\n class cls.\n @ In, cls, the class for which we are retrieving the specification\n @ Out, inputSpecification, InputData.ParameterInput, class to use for\n specifying in... | @classmethod
def getInputSpecification(cls):
'\n Method to get a reference to a class that specifies the input data for\n class cls.\n @ In, cls, the class for which we are retrieving the specification\n @ Out, inputSpecification, InputData.ParameterInput, class to use for\n specifying in... |
d5c36203d4cb584faf29b263b27cd91068103eeac8de0405a517e24cd8559e5d | def _handleInput(self, paramInput):
'\n Function to handle the common parts of the distribution parameter input.\n @ In, paramInput, ParameterInput, the already parsed input.\n @ Out, None\n '
super()._handleInput(paramInput)
(settings, notFound) = paramInput.findNodesAndExtractValues(['co... | Function to handle the common parts of the distribution parameter input.
@ In, paramInput, ParameterInput, the already parsed input.
@ Out, None | framework/SupervisedLearning/ScikitLearn/MultiClass/OutputCodeClassifier.py | _handleInput | greenwoodms06/raven | 1 | python | def _handleInput(self, paramInput):
'\n Function to handle the common parts of the distribution parameter input.\n @ In, paramInput, ParameterInput, the already parsed input.\n @ Out, None\n '
super()._handleInput(paramInput)
(settings, notFound) = paramInput.findNodesAndExtractValues(['co... | def _handleInput(self, paramInput):
'\n Function to handle the common parts of the distribution parameter input.\n @ In, paramInput, ParameterInput, the already parsed input.\n @ Out, None\n '
super()._handleInput(paramInput)
(settings, notFound) = paramInput.findNodesAndExtractValues(['co... |
786787ce3e5a22bfa39bd78c88d0936f411b5cb0a296604a49272f6e39a50905 | def setEstimator(self, estimatorList):
'\n Initialization method\n @ In, estimatorList, list of ROM instances/estimators used by ROM\n @ Out, None\n '
if (len(estimatorList) != 1):
self.raiseAWarning('ROM', self.name, 'can only accept one estimator, but multiple estimators are provided... | Initialization method
@ In, estimatorList, list of ROM instances/estimators used by ROM
@ Out, None | framework/SupervisedLearning/ScikitLearn/MultiClass/OutputCodeClassifier.py | setEstimator | greenwoodms06/raven | 1 | python | def setEstimator(self, estimatorList):
'\n Initialization method\n @ In, estimatorList, list of ROM instances/estimators used by ROM\n @ Out, None\n '
if (len(estimatorList) != 1):
self.raiseAWarning('ROM', self.name, 'can only accept one estimator, but multiple estimators are provided... | def setEstimator(self, estimatorList):
'\n Initialization method\n @ In, estimatorList, list of ROM instances/estimators used by ROM\n @ Out, None\n '
if (len(estimatorList) != 1):
self.raiseAWarning('ROM', self.name, 'can only accept one estimator, but multiple estimators are provided... |
b11541dfc3544767bd47c523854676ffb0b87e4783f4e3be87c95cd1db8de212 | def add_user(new_user):
'\n Add new user to userlist\n '
User.add_user(new_user) | Add new user to userlist | start.py | add_user | IsaiahKe/flask_Vault | 0 | python | def add_user(new_user):
'\n \n '
User.add_user(new_user) | def add_user(new_user):
'\n \n '
User.add_user(new_user)<|docstring|>Add new user to userlist<|endoftext|> |
ad1146ca3ce7e2c35643f22d723edd87f977e445f22c45e21423601d5ac24dbf | def add_credential(credential):
'\n Add credential to credential list\n '
Credential.add_credential(credential) | Add credential to credential list | start.py | add_credential | IsaiahKe/flask_Vault | 0 | python | def add_credential(credential):
'\n \n '
Credential.add_credential(credential) | def add_credential(credential):
'\n \n '
Credential.add_credential(credential)<|docstring|>Add credential to credential list<|endoftext|> |
2ea4c34a0c292cdc4b42fc68cb4016b5ddb67033d0cd187ca59bbfbbd6e460fb | def delete_all():
'\n empty all list\n '
Credential.delete_all() | empty all list | start.py | delete_all | IsaiahKe/flask_Vault | 0 | python | def delete_all():
'\n \n '
Credential.delete_all() | def delete_all():
'\n \n '
Credential.delete_all()<|docstring|>empty all list<|endoftext|> |
72ff4f9840386d5398e4188c7fd7d31a85f35700963cbad76fff4ef1a91e43d9 | def delete_by_account_name(name):
'\n Delete by account name\n '
Credential.delete_by_account(name) | Delete by account name | start.py | delete_by_account_name | IsaiahKe/flask_Vault | 0 | python | def delete_by_account_name(name):
'\n \n '
Credential.delete_by_account(name) | def delete_by_account_name(name):
'\n \n '
Credential.delete_by_account(name)<|docstring|>Delete by account name<|endoftext|> |
eecf4e5ce1a4e37d170a5a9abe1a06ba3a31f3888e427b22cac0d57f696b3350 | def __init__(self, USER_API_KEY):
"\n Parameters\n ----------\n USER_API_KEY: str\n User's API key generated from the Materials Project database.\n See https://materialsproject.org/open\n "
self.user_api_key = USER_API_KEY
self.fp = {}
self.implemented_f... | Parameters
----------
USER_API_KEY: str
User's API key generated from the Materials Project database.
See https://materialsproject.org/open | gibbsml/ellingham/fingerprint.py | __init__ | atomisticnet/gibbsml | 5 | python | def __init__(self, USER_API_KEY):
"\n Parameters\n ----------\n USER_API_KEY: str\n User's API key generated from the Materials Project database.\n See https://materialsproject.org/open\n "
self.user_api_key = USER_API_KEY
self.fp = {}
self.implemented_f... | def __init__(self, USER_API_KEY):
"\n Parameters\n ----------\n USER_API_KEY: str\n User's API key generated from the Materials Project database.\n See https://materialsproject.org/open\n "
self.user_api_key = USER_API_KEY
self.fp = {}
self.implemented_f... |
6f5253652425662f4f5bde9afa1e3bab2faa1e174d3b95070f9699562d87b0de | def extract_mp_features(self, id_mo, id_m1='', id_m2='', id_oxygen='mp-12957', selected_features='all', label=None, mo_energy_correction=True):
"\n Generates a feature set for an oxidation for a given metal\n oxide (AxByOz) from the elements (A and B).\n\n Parameters\n ----------\n ... | Generates a feature set for an oxidation for a given metal
oxide (AxByOz) from the elements (A and B).
Parameters
----------
id_mo: str
Materials Project mp-id for the metal oxide or chemical formula
of the metal oxide, e.g. 'Al2SiO5' or 'mp-4753'.
id_m1: str
(optional) Materials Project mp-id for the meta... | gibbsml/ellingham/fingerprint.py | extract_mp_features | atomisticnet/gibbsml | 5 | python | def extract_mp_features(self, id_mo, id_m1=, id_m2=, id_oxygen='mp-12957', selected_features='all', label=None, mo_energy_correction=True):
"\n Generates a feature set for an oxidation for a given metal\n oxide (AxByOz) from the elements (A and B).\n\n Parameters\n ----------\n id... | def extract_mp_features(self, id_mo, id_m1=, id_m2=, id_oxygen='mp-12957', selected_features='all', label=None, mo_energy_correction=True):
"\n Generates a feature set for an oxidation for a given metal\n oxide (AxByOz) from the elements (A and B).\n\n Parameters\n ----------\n id... |
0c43707edb9ed6db0e2d54842aa1bc55053e9369b602a335f87721bf53abf3e8 | def _find_id(self, compound):
" Find Materials Project ID for a given compound.\n\n Parameters\n ----------\n compound: str\n Compound formula. Examples: ``'Li2O'``,\n ``'AlLiO2'``, ``'Mg2SiO4'``.\n user_api: str\n Materials P... | Find Materials Project ID for a given compound.
Parameters
----------
compound: str
Compound formula. Examples: ``'Li2O'``,
``'AlLiO2'``, ``'Mg2SiO4'``.
user_api: str
Materials Project users API.
Returns
-------
id_compound: str
Materials Project compound ID. | gibbsml/ellingham/fingerprint.py | _find_id | atomisticnet/gibbsml | 5 | python | def _find_id(self, compound):
" Find Materials Project ID for a given compound.\n\n Parameters\n ----------\n compound: str\n Compound formula. Examples: ``'Li2O'``,\n ``'AlLiO2'``, ``'Mg2SiO4'``.\n user_api: str\n Materials P... | def _find_id(self, compound):
" Find Materials Project ID for a given compound.\n\n Parameters\n ----------\n compound: str\n Compound formula. Examples: ``'Li2O'``,\n ``'AlLiO2'``, ``'Mg2SiO4'``.\n user_api: str\n Materials P... |
a4aac19791ee77889bb9cf2923e2f607c6613f558c2ccbb1878e15b9669d7eaa | def add_feature(self, description, value):
"\n Parameters\n ----------\n description: str\n Description of the property to append (e.g. 'Formation energy').\n value: float\n Numerical value for a given property.\n\n Returns\n -------\n Adds a fe... | Parameters
----------
description: str
Description of the property to append (e.g. 'Formation energy').
value: float
Numerical value for a given property.
Returns
-------
Adds a feature to the fingerprint (stored in self.fp). | gibbsml/ellingham/fingerprint.py | add_feature | atomisticnet/gibbsml | 5 | python | def add_feature(self, description, value):
"\n Parameters\n ----------\n description: str\n Description of the property to append (e.g. 'Formation energy').\n value: float\n Numerical value for a given property.\n\n Returns\n -------\n Adds a fe... | def add_feature(self, description, value):
"\n Parameters\n ----------\n description: str\n Description of the property to append (e.g. 'Formation energy').\n value: float\n Numerical value for a given property.\n\n Returns\n -------\n Adds a fe... |
d0094bc0237b9f980ffee3ffdb6ba8ac96a98bf8d905f0f9bf910b6ac5535d7e | def add_target_feature(self, description, value):
"\n Parameters\n ----------\n description: str\n Description of the property to be appended (e.g. 'Reduction\n temperature').\n value: float\n Numerical value for a given property.\n\n Returns\n ... | Parameters
----------
description: str
Description of the property to be appended (e.g. 'Reduction
temperature').
value: float
Numerical value for a given property.
Returns
-------
Adds a target feature to the fingerprint (stored in self.fp).
Note: In this case the properties and values will be only used f... | gibbsml/ellingham/fingerprint.py | add_target_feature | atomisticnet/gibbsml | 5 | python | def add_target_feature(self, description, value):
"\n Parameters\n ----------\n description: str\n Description of the property to be appended (e.g. 'Reduction\n temperature').\n value: float\n Numerical value for a given property.\n\n Returns\n ... | def add_target_feature(self, description, value):
"\n Parameters\n ----------\n description: str\n Description of the property to be appended (e.g. 'Reduction\n temperature').\n value: float\n Numerical value for a given property.\n\n Returns\n ... |
b997254d5a347f2ccb3084da598d166d62109b7889b34dacac5986cd0b899524 | def get_labels(self):
'\n Returns the list of species (labelled), e.g. CaO-mp-2605.\n '
return list(self.fp.keys()) | Returns the list of species (labelled), e.g. CaO-mp-2605. | gibbsml/ellingham/fingerprint.py | get_labels | atomisticnet/gibbsml | 5 | python | def get_labels(self):
'\n \n '
return list(self.fp.keys()) | def get_labels(self):
'\n \n '
return list(self.fp.keys())<|docstring|>Returns the list of species (labelled), e.g. CaO-mp-2605.<|endoftext|> |
02d34ec3eb459c98930034bfb42e40d21aab6d56ac974a9fcf6dfe7efa88ba65 | def get_features_names(self):
'\n Returns a list containing the names of the features, e.g. formation\n energy (kJ/mol).\n '
species = list(self.fp.keys())
features_names = list(self.fp[species[0]]['features'].keys())
return features_names | Returns a list containing the names of the features, e.g. formation
energy (kJ/mol). | gibbsml/ellingham/fingerprint.py | get_features_names | atomisticnet/gibbsml | 5 | python | def get_features_names(self):
'\n Returns a list containing the names of the features, e.g. formation\n energy (kJ/mol).\n '
species = list(self.fp.keys())
features_names = list(self.fp[species[0]]['features'].keys())
return features_names | def get_features_names(self):
'\n Returns a list containing the names of the features, e.g. formation\n energy (kJ/mol).\n '
species = list(self.fp.keys())
features_names = list(self.fp[species[0]]['features'].keys())
return features_names<|docstring|>Returns a list containing the n... |
0b8d7829f90c22d800cae598dddab71ea44eeac41a39d0e4b5723305accb7ba3 | def get_target_features_names(self):
'\n Returns the list of target features. These features are\n user-defined and must be included with the add_target_features\n function.\n '
species = list(self.fp.keys())
features_names = list(self.fp[species[0]]['target_features'].keys())
... | Returns the list of target features. These features are
user-defined and must be included with the add_target_features
function. | gibbsml/ellingham/fingerprint.py | get_target_features_names | atomisticnet/gibbsml | 5 | python | def get_target_features_names(self):
'\n Returns the list of target features. These features are\n user-defined and must be included with the add_target_features\n function.\n '
species = list(self.fp.keys())
features_names = list(self.fp[species[0]]['target_features'].keys())
... | def get_target_features_names(self):
'\n Returns the list of target features. These features are\n user-defined and must be included with the add_target_features\n function.\n '
species = list(self.fp.keys())
features_names = list(self.fp[species[0]]['target_features'].keys())
... |
063353fdbf2a2630abffc31bdf9a3e3f45d80df6db0bc9a14deb3c1c20925c8e | def dump_set(self, filename='fingerprint.json'):
'\n Parameters\n ----------\n filename: str\n Name of the file to save the generated Fingerprint class.\n\n Returns\n -------\n Saves the whole Fingerprint class into a json file.\n '
self.label = 0.0
... | Parameters
----------
filename: str
Name of the file to save the generated Fingerprint class.
Returns
-------
Saves the whole Fingerprint class into a json file. | gibbsml/ellingham/fingerprint.py | dump_set | atomisticnet/gibbsml | 5 | python | def dump_set(self, filename='fingerprint.json'):
'\n Parameters\n ----------\n filename: str\n Name of the file to save the generated Fingerprint class.\n\n Returns\n -------\n Saves the whole Fingerprint class into a json file.\n '
self.label = 0.0
... | def dump_set(self, filename='fingerprint.json'):
'\n Parameters\n ----------\n filename: str\n Name of the file to save the generated Fingerprint class.\n\n Returns\n -------\n Saves the whole Fingerprint class into a json file.\n '
self.label = 0.0
... |
4569602b19d261b5d7cd97766c7cb47149ca3dc6952e02177d3d4a202345f2ae | def load_set(self, filename):
'\n Parameters\n ----------\n filename: str\n Name of the file to load (json format).\n\n Returns\n -------\n Load a json file containing a previously saved Fingerprint (see\n dump_set function).\n '
with open(filen... | Parameters
----------
filename: str
Name of the file to load (json format).
Returns
-------
Load a json file containing a previously saved Fingerprint (see
dump_set function). | gibbsml/ellingham/fingerprint.py | load_set | atomisticnet/gibbsml | 5 | python | def load_set(self, filename):
'\n Parameters\n ----------\n filename: str\n Name of the file to load (json format).\n\n Returns\n -------\n Load a json file containing a previously saved Fingerprint (see\n dump_set function).\n '
with open(filen... | def load_set(self, filename):
'\n Parameters\n ----------\n filename: str\n Name of the file to load (json format).\n\n Returns\n -------\n Load a json file containing a previously saved Fingerprint (see\n dump_set function).\n '
with open(filen... |
48ce9cdb82e2936e9c4ac660159436f8cab213a00375afce248dcbeba95b67b4 | def initialize(self):
' An overridden initializer method.\n\n This method adds the window to the static set of Windows.\n\n '
super(Window, self).initialize()
Window.windows.add(self) | An overridden initializer method.
This method adds the window to the static set of Windows. | enaml/widgets/window.py | initialize | AndiEcker/enaml | 1,080 | python | def initialize(self):
' An overridden initializer method.\n\n This method adds the window to the static set of Windows.\n\n '
super(Window, self).initialize()
Window.windows.add(self) | def initialize(self):
' An overridden initializer method.\n\n This method adds the window to the static set of Windows.\n\n '
super(Window, self).initialize()
Window.windows.add(self)<|docstring|>An overridden initializer method.
This method adds the window to the static set of Windows.<|endo... |
9003acd451fae75ceb6043314be43e2d382c06c5f26196a07d644631dc38854c | def destroy(self):
' An overridden destructor method.\n\n This method removes the window from the static set of Windows.\n\n '
super(Window, self).destroy()
Window.windows.discard(self) | An overridden destructor method.
This method removes the window from the static set of Windows. | enaml/widgets/window.py | destroy | AndiEcker/enaml | 1,080 | python | def destroy(self):
' An overridden destructor method.\n\n This method removes the window from the static set of Windows.\n\n '
super(Window, self).destroy()
Window.windows.discard(self) | def destroy(self):
' An overridden destructor method.\n\n This method removes the window from the static set of Windows.\n\n '
super(Window, self).destroy()
Window.windows.discard(self)<|docstring|>An overridden destructor method.
This method removes the window from the static set of Windows.... |
aa21c0ab7c94839b6e2f8a141487cb3939ddf9f5d2a75bde61c319fd21b1e987 | def central_widget(self):
' Get the central widget defined on the window.\n\n The last `Container` child of the window is the central widget.\n\n '
for child in reversed(self.children):
if isinstance(child, Container):
return child | Get the central widget defined on the window.
The last `Container` child of the window is the central widget. | enaml/widgets/window.py | central_widget | AndiEcker/enaml | 1,080 | python | def central_widget(self):
' Get the central widget defined on the window.\n\n The last `Container` child of the window is the central widget.\n\n '
for child in reversed(self.children):
if isinstance(child, Container):
return child | def central_widget(self):
' Get the central widget defined on the window.\n\n The last `Container` child of the window is the central widget.\n\n '
for child in reversed(self.children):
if isinstance(child, Container):
return child<|docstring|>Get the central widget defined on ... |
c4976f7da412e8585c9d08ad489680cb94047c2383649f0c1546e0cf09757ef2 | def position(self):
' Get the position of the window frame.\n\n Returns\n -------\n result : Pos\n The current position of the window frame.\n\n '
if self.proxy_is_active:
return self.proxy.position()
return Pos((- 1), (- 1)) | Get the position of the window frame.
Returns
-------
result : Pos
The current position of the window frame. | enaml/widgets/window.py | position | AndiEcker/enaml | 1,080 | python | def position(self):
' Get the position of the window frame.\n\n Returns\n -------\n result : Pos\n The current position of the window frame.\n\n '
if self.proxy_is_active:
return self.proxy.position()
return Pos((- 1), (- 1)) | def position(self):
' Get the position of the window frame.\n\n Returns\n -------\n result : Pos\n The current position of the window frame.\n\n '
if self.proxy_is_active:
return self.proxy.position()
return Pos((- 1), (- 1))<|docstring|>Get the position of the... |
1cb03f615a5b04c7133f7b9425c27b91b2381a16e4d93ea61b8e61622d74714f | def set_position(self, pos):
' Set the position of the window frame.\n\n Parameters\n ----------\n pos : Pos\n The desired position of the window the window frame.\n\n '
if self.proxy_is_active:
self.proxy.set_position(pos) | Set the position of the window frame.
Parameters
----------
pos : Pos
The desired position of the window the window frame. | enaml/widgets/window.py | set_position | AndiEcker/enaml | 1,080 | python | def set_position(self, pos):
' Set the position of the window frame.\n\n Parameters\n ----------\n pos : Pos\n The desired position of the window the window frame.\n\n '
if self.proxy_is_active:
self.proxy.set_position(pos) | def set_position(self, pos):
' Set the position of the window frame.\n\n Parameters\n ----------\n pos : Pos\n The desired position of the window the window frame.\n\n '
if self.proxy_is_active:
self.proxy.set_position(pos)<|docstring|>Set the position of the windo... |
d79339f1b08a9bad66c88eace19cbb7640b68c405d074d619968012aa298c83f | def size(self):
' Get the size of the window client area.\n\n Returns\n -------\n result : Size\n The current size of the window client area.\n\n '
if self.proxy_is_active:
return self.proxy.size()
return Size((- 1), (- 1)) | Get the size of the window client area.
Returns
-------
result : Size
The current size of the window client area. | enaml/widgets/window.py | size | AndiEcker/enaml | 1,080 | python | def size(self):
' Get the size of the window client area.\n\n Returns\n -------\n result : Size\n The current size of the window client area.\n\n '
if self.proxy_is_active:
return self.proxy.size()
return Size((- 1), (- 1)) | def size(self):
' Get the size of the window client area.\n\n Returns\n -------\n result : Size\n The current size of the window client area.\n\n '
if self.proxy_is_active:
return self.proxy.size()
return Size((- 1), (- 1))<|docstring|>Get the size of the windo... |
76f0b4b9c77d5fd6eaa0a197ab03f79972086eace7dbc46df2d5b8ea2f8752e9 | def set_size(self, size):
' Set the size of the window client area.\n\n Parameters\n ----------\n size : Size\n The desired size of the window client area.\n\n '
if self.proxy_is_active:
self.proxy.set_size(size) | Set the size of the window client area.
Parameters
----------
size : Size
The desired size of the window client area. | enaml/widgets/window.py | set_size | AndiEcker/enaml | 1,080 | python | def set_size(self, size):
' Set the size of the window client area.\n\n Parameters\n ----------\n size : Size\n The desired size of the window client area.\n\n '
if self.proxy_is_active:
self.proxy.set_size(size) | def set_size(self, size):
' Set the size of the window client area.\n\n Parameters\n ----------\n size : Size\n The desired size of the window client area.\n\n '
if self.proxy_is_active:
self.proxy.set_size(size)<|docstring|>Set the size of the window client area.
... |
cf096b4dcbf84bcb60fabf9ee9aad1d233291dd7574dbf858b8c06c8e25a86aa | def geometry(self):
' Get the geometry of the window client area.\n\n Returns\n -------\n result : Rect\n The current geometry of the window client area.\n\n '
if self.proxy_is_active:
return self.proxy.geometry()
return Rect((- 1), (- 1), (- 1), (- 1)) | Get the geometry of the window client area.
Returns
-------
result : Rect
The current geometry of the window client area. | enaml/widgets/window.py | geometry | AndiEcker/enaml | 1,080 | python | def geometry(self):
' Get the geometry of the window client area.\n\n Returns\n -------\n result : Rect\n The current geometry of the window client area.\n\n '
if self.proxy_is_active:
return self.proxy.geometry()
return Rect((- 1), (- 1), (- 1), (- 1)) | def geometry(self):
' Get the geometry of the window client area.\n\n Returns\n -------\n result : Rect\n The current geometry of the window client area.\n\n '
if self.proxy_is_active:
return self.proxy.geometry()
return Rect((- 1), (- 1), (- 1), (- 1))<|docstr... |
ed1180bf23c9ea3eca315a050de183aaed0a04e4733faf969ea8722ea7d94367 | def set_geometry(self, rect):
' Set the geometry of the window client area.\n\n Parameters\n ----------\n rect : Rect\n The desired geometry of the window client area.\n\n '
if self.proxy_is_active:
self.proxy.set_geometry(rect) | Set the geometry of the window client area.
Parameters
----------
rect : Rect
The desired geometry of the window client area. | enaml/widgets/window.py | set_geometry | AndiEcker/enaml | 1,080 | python | def set_geometry(self, rect):
' Set the geometry of the window client area.\n\n Parameters\n ----------\n rect : Rect\n The desired geometry of the window client area.\n\n '
if self.proxy_is_active:
self.proxy.set_geometry(rect) | def set_geometry(self, rect):
' Set the geometry of the window client area.\n\n Parameters\n ----------\n rect : Rect\n The desired geometry of the window client area.\n\n '
if self.proxy_is_active:
self.proxy.set_geometry(rect)<|docstring|>Set the geometry of the ... |
97b1985c8a5a7f3e9c549d5f636096ee92965d25a1d120b083b5764262d8e996 | def frame_geometry(self):
' Get the geometry of the window frame.\n\n Returns\n -------\n result : Rect\n The current geometry of the window frame.\n\n '
if self.proxy_is_active:
return self.proxy.frame_geometry()
return Rect((- 1), (- 1), (- 1), (- 1)) | Get the geometry of the window frame.
Returns
-------
result : Rect
The current geometry of the window frame. | enaml/widgets/window.py | frame_geometry | AndiEcker/enaml | 1,080 | python | def frame_geometry(self):
' Get the geometry of the window frame.\n\n Returns\n -------\n result : Rect\n The current geometry of the window frame.\n\n '
if self.proxy_is_active:
return self.proxy.frame_geometry()
return Rect((- 1), (- 1), (- 1), (- 1)) | def frame_geometry(self):
' Get the geometry of the window frame.\n\n Returns\n -------\n result : Rect\n The current geometry of the window frame.\n\n '
if self.proxy_is_active:
return self.proxy.frame_geometry()
return Rect((- 1), (- 1), (- 1), (- 1))<|docstr... |
636d55ec74b6ba1eefeb1dcc5191725c79a566a6e3eefc8f2d16ba8af9bc00e3 | def maximize(self):
' Maximize the window.\n\n '
if self.proxy_is_active:
self.proxy.maximize() | Maximize the window. | enaml/widgets/window.py | maximize | AndiEcker/enaml | 1,080 | python | def maximize(self):
' \n\n '
if self.proxy_is_active:
self.proxy.maximize() | def maximize(self):
' \n\n '
if self.proxy_is_active:
self.proxy.maximize()<|docstring|>Maximize the window.<|endoftext|> |
032ee8aa2c7c3f5f415d148da6fd2e15f28bce8ea43f31af8ea5967ab7ab5b79 | def is_maximized(self):
' Get whether the window is maximized.\n\n '
if self.proxy_is_active:
return self.proxy.is_maximized()
return False | Get whether the window is maximized. | enaml/widgets/window.py | is_maximized | AndiEcker/enaml | 1,080 | python | def is_maximized(self):
' \n\n '
if self.proxy_is_active:
return self.proxy.is_maximized()
return False | def is_maximized(self):
' \n\n '
if self.proxy_is_active:
return self.proxy.is_maximized()
return False<|docstring|>Get whether the window is maximized.<|endoftext|> |
c18e251ac188c1e879642b18b911afbdbdcb98bb8551ac53c160fa0af044b522 | def minimize(self):
' Minimize the window.\n\n '
if self.proxy_is_active:
self.proxy.minimize() | Minimize the window. | enaml/widgets/window.py | minimize | AndiEcker/enaml | 1,080 | python | def minimize(self):
' \n\n '
if self.proxy_is_active:
self.proxy.minimize() | def minimize(self):
' \n\n '
if self.proxy_is_active:
self.proxy.minimize()<|docstring|>Minimize the window.<|endoftext|> |
3d3b2fa392510dc8bdf164c3cb529a1de9d7dbe97376dc784ede10ee1aca4947 | def is_minimized(self):
' Get whether the window is minimized.\n\n '
if self.proxy_is_active:
return self.proxy.is_minimized()
return False | Get whether the window is minimized. | enaml/widgets/window.py | is_minimized | AndiEcker/enaml | 1,080 | python | def is_minimized(self):
' \n\n '
if self.proxy_is_active:
return self.proxy.is_minimized()
return False | def is_minimized(self):
' \n\n '
if self.proxy_is_active:
return self.proxy.is_minimized()
return False<|docstring|>Get whether the window is minimized.<|endoftext|> |
3b77c392f328813397ce36ac7b8c88e017e4318d0dce6cbf46f3a1e489bc9e75 | def restore(self):
' Restore the window from a maximized or minimized state.\n\n '
if self.proxy_is_active:
self.proxy.restore() | Restore the window from a maximized or minimized state. | enaml/widgets/window.py | restore | AndiEcker/enaml | 1,080 | python | def restore(self):
' \n\n '
if self.proxy_is_active:
self.proxy.restore() | def restore(self):
' \n\n '
if self.proxy_is_active:
self.proxy.restore()<|docstring|>Restore the window from a maximized or minimized state.<|endoftext|> |
77d3c4239a1803a23d6334bc9125f947d75e6d3c1641f0c3d8d2f152c9d9f29e | def send_to_front(self):
' Send the window to the top of the Z-order.\n\n This will only affect the Z-order of the window relative to the\n Z-order of other windows in the same application.\n\n '
if self.proxy_is_active:
self.proxy.send_to_front() | Send the window to the top of the Z-order.
This will only affect the Z-order of the window relative to the
Z-order of other windows in the same application. | enaml/widgets/window.py | send_to_front | AndiEcker/enaml | 1,080 | python | def send_to_front(self):
' Send the window to the top of the Z-order.\n\n This will only affect the Z-order of the window relative to the\n Z-order of other windows in the same application.\n\n '
if self.proxy_is_active:
self.proxy.send_to_front() | def send_to_front(self):
' Send the window to the top of the Z-order.\n\n This will only affect the Z-order of the window relative to the\n Z-order of other windows in the same application.\n\n '
if self.proxy_is_active:
self.proxy.send_to_front()<|docstring|>Send the window to the ... |
e4d3f16e6e4a7fd131063a9d8169e2d887feda309e5395d2664b9bdbda9e1c62 | def send_to_back(self):
' Send the window to the bottom of the Z-order.\n\n This will only affect the Z-order of the window relative to the\n Z-order of other windows in the same application.\n\n '
if self.proxy_is_active:
self.proxy.send_to_back() | Send the window to the bottom of the Z-order.
This will only affect the Z-order of the window relative to the
Z-order of other windows in the same application. | enaml/widgets/window.py | send_to_back | AndiEcker/enaml | 1,080 | python | def send_to_back(self):
' Send the window to the bottom of the Z-order.\n\n This will only affect the Z-order of the window relative to the\n Z-order of other windows in the same application.\n\n '
if self.proxy_is_active:
self.proxy.send_to_back() | def send_to_back(self):
' Send the window to the bottom of the Z-order.\n\n This will only affect the Z-order of the window relative to the\n Z-order of other windows in the same application.\n\n '
if self.proxy_is_active:
self.proxy.send_to_back()<|docstring|>Send the window to the... |
484cae1decb96f2be24d74c1770c9bd789e0af83f2a01e20e2dcc552598cc432 | def activate_window(self):
' Set this window to be the active application window.\n\n This performs the same operation as clicking the mouse on the\n title bar of the window, except that it will not effect the Z\n order of the window.\n\n On Windows, this will cause the taskbar icon to f... | Set this window to be the active application window.
This performs the same operation as clicking the mouse on the
title bar of the window, except that it will not effect the Z
order of the window.
On Windows, this will cause the taskbar icon to flash if the
window does not belong to the active application. | enaml/widgets/window.py | activate_window | AndiEcker/enaml | 1,080 | python | def activate_window(self):
' Set this window to be the active application window.\n\n This performs the same operation as clicking the mouse on the\n title bar of the window, except that it will not effect the Z\n order of the window.\n\n On Windows, this will cause the taskbar icon to f... | def activate_window(self):
' Set this window to be the active application window.\n\n This performs the same operation as clicking the mouse on the\n title bar of the window, except that it will not effect the Z\n order of the window.\n\n On Windows, this will cause the taskbar icon to f... |
7385616c81817e37e0c33050cef8ec98f3f9f9fdb0f40e0dab1eb33e122e38ce | def center_on_screen(self):
' Center the window on the screen.\n\n '
if self.proxy_is_active:
self.proxy.center_on_screen() | Center the window on the screen. | enaml/widgets/window.py | center_on_screen | AndiEcker/enaml | 1,080 | python | def center_on_screen(self):
' \n\n '
if self.proxy_is_active:
self.proxy.center_on_screen() | def center_on_screen(self):
' \n\n '
if self.proxy_is_active:
self.proxy.center_on_screen()<|docstring|>Center the window on the screen.<|endoftext|> |
0ed84c58394630eb03952684fd5101dc618bf034c1b5f1476d996244db36f444 | def center_on_widget(self, other):
' Center this window on another widget.\n\n Parameters\n ----------\n other : Widget\n The widget onto which to center this window.\n\n '
assert isinstance(other, Widget)
if (self.proxy_is_active and other.proxy_is_active):
se... | Center this window on another widget.
Parameters
----------
other : Widget
The widget onto which to center this window. | enaml/widgets/window.py | center_on_widget | AndiEcker/enaml | 1,080 | python | def center_on_widget(self, other):
' Center this window on another widget.\n\n Parameters\n ----------\n other : Widget\n The widget onto which to center this window.\n\n '
assert isinstance(other, Widget)
if (self.proxy_is_active and other.proxy_is_active):
se... | def center_on_widget(self, other):
' Center this window on another widget.\n\n Parameters\n ----------\n other : Widget\n The widget onto which to center this window.\n\n '
assert isinstance(other, Widget)
if (self.proxy_is_active and other.proxy_is_active):
se... |
347b908773a2f89bfa3971880f0880ed0abea71409ac9d927e11db3fd49989da | def close(self):
" Close the window.\n\n This will cause the window to be hidden, the 'closed' event\n to be fired, and the window subsequently destroyed.\n\n "
if self.proxy_is_active:
self.proxy.close() | Close the window.
This will cause the window to be hidden, the 'closed' event
to be fired, and the window subsequently destroyed. | enaml/widgets/window.py | close | AndiEcker/enaml | 1,080 | python | def close(self):
" Close the window.\n\n This will cause the window to be hidden, the 'closed' event\n to be fired, and the window subsequently destroyed.\n\n "
if self.proxy_is_active:
self.proxy.close() | def close(self):
" Close the window.\n\n This will cause the window to be hidden, the 'closed' event\n to be fired, and the window subsequently destroyed.\n\n "
if self.proxy_is_active:
self.proxy.close()<|docstring|>Close the window.
This will cause the window to be hidden, the 'c... |
25a6ec70c308a245b4a3905324896c965099955a1a9b91bc6f88d9911ee9e591 | def show(self):
' Show the window to the screen.\n\n This is a reimplemented parent class method which will init\n and build the window hierarchy if needed.\n\n '
if (not self.is_initialized):
self.initialize()
if (not self.proxy_is_active):
self.activate_proxy()
sup... | Show the window to the screen.
This is a reimplemented parent class method which will init
and build the window hierarchy if needed. | enaml/widgets/window.py | show | AndiEcker/enaml | 1,080 | python | def show(self):
' Show the window to the screen.\n\n This is a reimplemented parent class method which will init\n and build the window hierarchy if needed.\n\n '
if (not self.is_initialized):
self.initialize()
if (not self.proxy_is_active):
self.activate_proxy()
sup... | def show(self):
' Show the window to the screen.\n\n This is a reimplemented parent class method which will init\n and build the window hierarchy if needed.\n\n '
if (not self.is_initialized):
self.initialize()
if (not self.proxy_is_active):
self.activate_proxy()
sup... |
51d81e2216290eb79b877c6f5f89225c5d43a7a207c0d13381a9aa79f1194cb9 | @observe('title', 'modality', 'icon')
def _update_proxy(self, change):
' Update the ProxyWindow when the Window data changes.\n\n '
super(Window, self)._update_proxy(change) | Update the ProxyWindow when the Window data changes. | enaml/widgets/window.py | _update_proxy | AndiEcker/enaml | 1,080 | python | @observe('title', 'modality', 'icon')
def _update_proxy(self, change):
' \n\n '
super(Window, self)._update_proxy(change) | @observe('title', 'modality', 'icon')
def _update_proxy(self, change):
' \n\n '
super(Window, self)._update_proxy(change)<|docstring|>Update the ProxyWindow when the Window data changes.<|endoftext|> |
4b679ce5f0be647fd4337a0de1d7121e17cb49e5db92266ae52e643d38c5b5b1 | @contextmanager
def cached():
'Context manager that enables the caching system within parametrizations\n registered with :func:`register_parametrization`.\n\n The value of the parametrized objects is computed and cached the first time\n they are required when this context manager is active. The cached valu... | Context manager that enables the caching system within parametrizations
registered with :func:`register_parametrization`.
The value of the parametrized objects is computed and cached the first time
they are required when this context manager is active. The cached values are
discarded when leaving the context manager.
... | torch/nn/utils/parametrize.py | cached | joker-eph/pytorch | 60,067 | python | @contextmanager
def cached():
'Context manager that enables the caching system within parametrizations\n registered with :func:`register_parametrization`.\n\n The value of the parametrized objects is computed and cached the first time\n they are required when this context manager is active. The cached valu... | @contextmanager
def cached():
'Context manager that enables the caching system within parametrizations\n registered with :func:`register_parametrization`.\n\n The value of the parametrized objects is computed and cached the first time\n they are required when this context manager is active. The cached valu... |
6890dd4538583e754317fb95bf50b5db50ed6c674605fac5c52c82b3cb6c506a | def _inject_new_class(module: Module) -> None:
'Sets up a module to be parametrized.\n\n This works by substituting the class of the module by a class\n that extends it to be able to inject a property\n\n Args:\n module (nn.Module): module into which to inject the property\n '
cls = module.__... | Sets up a module to be parametrized.
This works by substituting the class of the module by a class
that extends it to be able to inject a property
Args:
module (nn.Module): module into which to inject the property | torch/nn/utils/parametrize.py | _inject_new_class | joker-eph/pytorch | 60,067 | python | def _inject_new_class(module: Module) -> None:
'Sets up a module to be parametrized.\n\n This works by substituting the class of the module by a class\n that extends it to be able to inject a property\n\n Args:\n module (nn.Module): module into which to inject the property\n '
cls = module.__... | def _inject_new_class(module: Module) -> None:
'Sets up a module to be parametrized.\n\n This works by substituting the class of the module by a class\n that extends it to be able to inject a property\n\n Args:\n module (nn.Module): module into which to inject the property\n '
cls = module.__... |
7a39a58d90beb36ee330a43b99c71246ff3c43ceb69956a1adacbb3c1d3dce79 | def _inject_property(module: Module, tensor_name: str) -> None:
'Injects a property into module[tensor_name].\n\n It assumes that the class in the module has already been modified from its\n original one using _inject_new_class and that the tensor under :attr:`tensor_name`\n has already been moved out\n\n ... | Injects a property into module[tensor_name].
It assumes that the class in the module has already been modified from its
original one using _inject_new_class and that the tensor under :attr:`tensor_name`
has already been moved out
Args:
module (nn.Module): module into which to inject the property
tensor_name (... | torch/nn/utils/parametrize.py | _inject_property | joker-eph/pytorch | 60,067 | python | def _inject_property(module: Module, tensor_name: str) -> None:
'Injects a property into module[tensor_name].\n\n It assumes that the class in the module has already been modified from its\n original one using _inject_new_class and that the tensor under :attr:`tensor_name`\n has already been moved out\n\n ... | def _inject_property(module: Module, tensor_name: str) -> None:
'Injects a property into module[tensor_name].\n\n It assumes that the class in the module has already been modified from its\n original one using _inject_new_class and that the tensor under :attr:`tensor_name`\n has already been moved out\n\n ... |
ddc7a99efa8c176d6a6e7edd6dd002c5f0a15c5a3909856a486810136e2f3097 | def register_parametrization(module: Module, tensor_name: str, parametrization: Module, *, unsafe: bool=False) -> Module:
'Adds a parametrization to a tensor in a module.\n\n Assume that ``tensor_name="weight"`` for simplicity. When accessing ``module.weight``,\n the module will return the parametrized versio... | Adds a parametrization to a tensor in a module.
Assume that ``tensor_name="weight"`` for simplicity. When accessing ``module.weight``,
the module will return the parametrized version ``parametrization(module.weight)``.
If the original tensor requires a gradient, the backward pass will differentiate
through :attr:`para... | torch/nn/utils/parametrize.py | register_parametrization | joker-eph/pytorch | 60,067 | python | def register_parametrization(module: Module, tensor_name: str, parametrization: Module, *, unsafe: bool=False) -> Module:
'Adds a parametrization to a tensor in a module.\n\n Assume that ``tensor_name="weight"`` for simplicity. When accessing ``module.weight``,\n the module will return the parametrized versio... | def register_parametrization(module: Module, tensor_name: str, parametrization: Module, *, unsafe: bool=False) -> Module:
'Adds a parametrization to a tensor in a module.\n\n Assume that ``tensor_name="weight"`` for simplicity. When accessing ``module.weight``,\n the module will return the parametrized versio... |
fdff9622be9221f938618f7dacb4da17e2852b1e5de82d45d404999a1732ae04 | def is_parametrized(module: Module, tensor_name: Optional[str]=None) -> bool:
'Returns ``True`` if module has an active parametrization.\n\n If the argument :attr:`tensor_name` is specified, returns ``True`` if\n ``module[tensor_name]`` is parametrized.\n\n Args:\n module (nn.Module): module to quer... | Returns ``True`` if module has an active parametrization.
If the argument :attr:`tensor_name` is specified, returns ``True`` if
``module[tensor_name]`` is parametrized.
Args:
module (nn.Module): module to query
name (str, optional): attribute in the module to query
Default: ``None`` | torch/nn/utils/parametrize.py | is_parametrized | joker-eph/pytorch | 60,067 | python | def is_parametrized(module: Module, tensor_name: Optional[str]=None) -> bool:
'Returns ``True`` if module has an active parametrization.\n\n If the argument :attr:`tensor_name` is specified, returns ``True`` if\n ``module[tensor_name]`` is parametrized.\n\n Args:\n module (nn.Module): module to quer... | def is_parametrized(module: Module, tensor_name: Optional[str]=None) -> bool:
'Returns ``True`` if module has an active parametrization.\n\n If the argument :attr:`tensor_name` is specified, returns ``True`` if\n ``module[tensor_name]`` is parametrized.\n\n Args:\n module (nn.Module): module to quer... |
f3db34c7fb586e0a221851f3482b1ac1681999571a7be33f4965650c421d59eb | def remove_parametrizations(module: Module, tensor_name: str, leave_parametrized: bool=True) -> Module:
'Removes the parametrizations on a tensor in a module.\n\n - If ``leave_parametrized=True``, ``module[tensor_name]`` will be set to\n its current output. In this case, the parametrization shall not change... | Removes the parametrizations on a tensor in a module.
- If ``leave_parametrized=True``, ``module[tensor_name]`` will be set to
its current output. In this case, the parametrization shall not change the ``dtype``
of the tensor.
- If ``leave_parametrized=False``, ``module[tensor_name]`` will be set to
the unparame... | torch/nn/utils/parametrize.py | remove_parametrizations | joker-eph/pytorch | 60,067 | python | def remove_parametrizations(module: Module, tensor_name: str, leave_parametrized: bool=True) -> Module:
'Removes the parametrizations on a tensor in a module.\n\n - If ``leave_parametrized=True``, ``module[tensor_name]`` will be set to\n its current output. In this case, the parametrization shall not change... | def remove_parametrizations(module: Module, tensor_name: str, leave_parametrized: bool=True) -> Module:
'Removes the parametrizations on a tensor in a module.\n\n - If ``leave_parametrized=True``, ``module[tensor_name]`` will be set to\n its current output. In this case, the parametrization shall not change... |
e515300f7b1b9bddba890a1fb03018a733bc99bcc44669318b0156b6aada77ea | def right_inverse(self, value: Tensor) -> None:
'Calls the methods ``right_inverse`` (see :func:`register_parametrization`)\n of the parametrizations in the inverse order they were registered in.\n Then, it stores the result in ``self.original`` if ``right_inverse`` outputs one tensor\n or in `... | Calls the methods ``right_inverse`` (see :func:`register_parametrization`)
of the parametrizations in the inverse order they were registered in.
Then, it stores the result in ``self.original`` if ``right_inverse`` outputs one tensor
or in ``self.original0``, ``self.original1``, ... if it outputs several.
Args:
val... | torch/nn/utils/parametrize.py | right_inverse | joker-eph/pytorch | 60,067 | python | def right_inverse(self, value: Tensor) -> None:
'Calls the methods ``right_inverse`` (see :func:`register_parametrization`)\n of the parametrizations in the inverse order they were registered in.\n Then, it stores the result in ``self.original`` if ``right_inverse`` outputs one tensor\n or in `... | def right_inverse(self, value: Tensor) -> None:
'Calls the methods ``right_inverse`` (see :func:`register_parametrization`)\n of the parametrizations in the inverse order they were registered in.\n Then, it stores the result in ``self.original`` if ``right_inverse`` outputs one tensor\n or in `... |
00eb85dc9797ea90cb99e73ee1fdd2764d9236bcfbdf9d2d30e553d55e40bcfc | def hasPathSum(self, root, sum):
'\n :type root: TreeNode\n :type sum: int\n :rtype: bool\n '
if (not root):
return False
elif ((not root.left) and (not root.right)):
return (root.val == sum)
return (self.hasPathSum(root.left, (sum - root.val)) or self.hasPath... | :type root: TreeNode
:type sum: int
:rtype: bool | 100-199/112-path-sum.py | hasPathSum | bcongdon/leetcode | 4 | python | def hasPathSum(self, root, sum):
'\n :type root: TreeNode\n :type sum: int\n :rtype: bool\n '
if (not root):
return False
elif ((not root.left) and (not root.right)):
return (root.val == sum)
return (self.hasPathSum(root.left, (sum - root.val)) or self.hasPath... | def hasPathSum(self, root, sum):
'\n :type root: TreeNode\n :type sum: int\n :rtype: bool\n '
if (not root):
return False
elif ((not root.left) and (not root.right)):
return (root.val == sum)
return (self.hasPathSum(root.left, (sum - root.val)) or self.hasPath... |
4481db6634b935e149ff85b9c99161ee2ee2dd4bcc225d38d045c25bcd21afc0 | def mock_add_paths(self, path):
'Adds a path and all of its parents to the set of existing paths.'
self._mock_path_exists.add(path) | Adds a path and all of its parents to the set of existing paths. | recipe_modules/path/api.py | mock_add_paths | Acidburn0zzz/luci | 1 | python | def mock_add_paths(self, path):
self._mock_path_exists.add(path) | def mock_add_paths(self, path):
self._mock_path_exists.add(path)<|docstring|>Adds a path and all of its parents to the set of existing paths.<|endoftext|> |
78411f81cb3c1e220f3af2471d59daf45ff1ccca09cbaa1baf361f97fa4c14b5 | def mock_copy_paths(self, source, dest):
'Duplicates a path and all of its children to another path.'
self._mock_path_exists.copy(source, dest) | Duplicates a path and all of its children to another path. | recipe_modules/path/api.py | mock_copy_paths | Acidburn0zzz/luci | 1 | python | def mock_copy_paths(self, source, dest):
self._mock_path_exists.copy(source, dest) | def mock_copy_paths(self, source, dest):
self._mock_path_exists.copy(source, dest)<|docstring|>Duplicates a path and all of its children to another path.<|endoftext|> |
36240cefcbafaa2c63c7963aa62c0dd062dcad4c696e9c002d7a3c49cac39200 | def mock_remove_paths(self, path, filt):
'Removes a path and all of its children from the set of existing paths.'
self._mock_path_exists.remove(path, filt) | Removes a path and all of its children from the set of existing paths. | recipe_modules/path/api.py | mock_remove_paths | Acidburn0zzz/luci | 1 | python | def mock_remove_paths(self, path, filt):
self._mock_path_exists.remove(path, filt) | def mock_remove_paths(self, path, filt):
self._mock_path_exists.remove(path, filt)<|docstring|>Removes a path and all of its children from the set of existing paths.<|endoftext|> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.