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 |
|---|---|---|---|---|---|---|---|---|---|
410101a61fb0ddb3bf4c525a724c5d081f1d14c5974ae01245c9d7768bb09b6a | def test_one_pool(self):
'Test the creation of one pool with all the storage capacity\n\n Test Description:\n Create a pool with all the capacity of all servers. Verify that the pool created\n effectively used all the available storage and there is no more available storage.\n\n ... | Test the creation of one pool with all the storage capacity
Test Description:
Create a pool with all the capacity of all servers. Verify that the pool created
effectively used all the available storage and there is no more available storage.
:avocado: tags=all,pr,daily_regression
:avocado: tags=vm
:avocado: t... | src/tests/ftest/pool/create_all_vm.py | test_one_pool | zalsader/daos | 0 | python | def test_one_pool(self):
'Test the creation of one pool with all the storage capacity\n\n Test Description:\n Create a pool with all the capacity of all servers. Verify that the pool created\n effectively used all the available storage and there is no more available storage.\n\n ... | def test_one_pool(self):
'Test the creation of one pool with all the storage capacity\n\n Test Description:\n Create a pool with all the capacity of all servers. Verify that the pool created\n effectively used all the available storage and there is no more available storage.\n\n ... |
68b3611711d87f761948ed961f419ffb0e17f03a050ed3d68ad2db1986591327 | def test_recycle_pools(self):
'Test the pool creation and destruction\n\n Test Description:\n Create a pool with all the capacity of all servers. Verify that the pool created\n effectively used all the available storage. Destroy the pool and repeat these steps 100\n times. Fo... | Test the pool creation and destruction
Test Description:
Create a pool with all the capacity of all servers. Verify that the pool created
effectively used all the available storage. Destroy the pool and repeat these steps 100
times. For each iteration, check that the size of the created pool is always the ... | src/tests/ftest/pool/create_all_vm.py | test_recycle_pools | zalsader/daos | 0 | python | def test_recycle_pools(self):
'Test the pool creation and destruction\n\n Test Description:\n Create a pool with all the capacity of all servers. Verify that the pool created\n effectively used all the available storage. Destroy the pool and repeat these steps 100\n times. Fo... | def test_recycle_pools(self):
'Test the pool creation and destruction\n\n Test Description:\n Create a pool with all the capacity of all servers. Verify that the pool created\n effectively used all the available storage. Destroy the pool and repeat these steps 100\n times. Fo... |
b312a6a9351f7bd92ce085ab1a7d2e771a1139d9b6317d5c61253af9b11caaea | def check_pool_distribution(self):
'Check if the size used on each hosts is more or less uniform\n '
self.assertGreater(len(self.server_managers), 0, 'No server managers')
try:
self.log.info('Retrieving available size')
result = self.server_managers[0].dmg.storage_query_usage()
ex... | Check if the size used on each hosts is more or less uniform | src/tests/ftest/pool/create_all_vm.py | check_pool_distribution | zalsader/daos | 0 | python | def check_pool_distribution(self):
'\n '
self.assertGreater(len(self.server_managers), 0, 'No server managers')
try:
self.log.info('Retrieving available size')
result = self.server_managers[0].dmg.storage_query_usage()
except CommandFailure as error:
self.fail('dmg command... | def check_pool_distribution(self):
'\n '
self.assertGreater(len(self.server_managers), 0, 'No server managers')
try:
self.log.info('Retrieving available size')
result = self.server_managers[0].dmg.storage_query_usage()
except CommandFailure as error:
self.fail('dmg command... |
62e4c66c625bbb61337dc3693037f8edae8e376ef1f393618d0ad6c9f32eadcd | def test_two_pools(self):
'Test the creation of two pools with 50% and 100% of the available storage\n\n Test Description:\n Create a first pool with 50% of all the capacity of all servers. Verify that the pool\n created effectively used 50% of the available storage and also check that ... | Test the creation of two pools with 50% and 100% of the available storage
Test Description:
Create a first pool with 50% of all the capacity of all servers. Verify that the pool
created effectively used 50% of the available storage and also check that the pool is
well balanced (i.e. more or less use the sa... | src/tests/ftest/pool/create_all_vm.py | test_two_pools | zalsader/daos | 0 | python | def test_two_pools(self):
'Test the creation of two pools with 50% and 100% of the available storage\n\n Test Description:\n Create a first pool with 50% of all the capacity of all servers. Verify that the pool\n created effectively used 50% of the available storage and also check that ... | def test_two_pools(self):
'Test the creation of two pools with 50% and 100% of the available storage\n\n Test Description:\n Create a first pool with 50% of all the capacity of all servers. Verify that the pool\n created effectively used 50% of the available storage and also check that ... |
27d59c4ff23b81f5f654eeb5492ef609a4cb27d42abffdc2fe233da187a95797 | def get_serializer_fields(self, draft=False):
'\n Get the respective serializer fields for all the form fields.\n '
serializer_fields = OrderedDict()
form_fields = self.get_form_fields()
for (field_id, field) in form_fields.items():
serializer_fields[field_id] = self._get_field(fie... | Get the respective serializer fields for all the form fields. | hypha/apply/api/v1/stream_serializers.py | get_serializer_fields | jvasile/hypha | 20 | python | def get_serializer_fields(self, draft=False):
'\n \n '
serializer_fields = OrderedDict()
form_fields = self.get_form_fields()
for (field_id, field) in form_fields.items():
serializer_fields[field_id] = self._get_field(field, self.get_serializer_field_class(field), draft)
return... | def get_serializer_fields(self, draft=False):
'\n \n '
serializer_fields = OrderedDict()
form_fields = self.get_form_fields()
for (field_id, field) in form_fields.items():
serializer_fields[field_id] = self._get_field(field, self.get_serializer_field_class(field), draft)
return... |
0c2a1bc20004b48fd002ec48549427a65f4b52e90312abcc978b9bdaf33f1db2 | def _get_field(self, form_field, serializer_field_class, draft=False):
'\n Get the serializer field from the form field with all\n the kwargs defined.\n '
kwargs = self._get_field_kwargs(form_field, serializer_field_class)
field_kwargs = kwargs.copy()
for (kwarg, value) in kwargs.it... | Get the serializer field from the form field with all
the kwargs defined. | hypha/apply/api/v1/stream_serializers.py | _get_field | jvasile/hypha | 20 | python | def _get_field(self, form_field, serializer_field_class, draft=False):
'\n Get the serializer field from the form field with all\n the kwargs defined.\n '
kwargs = self._get_field_kwargs(form_field, serializer_field_class)
field_kwargs = kwargs.copy()
for (kwarg, value) in kwargs.it... | def _get_field(self, form_field, serializer_field_class, draft=False):
'\n Get the serializer field from the form field with all\n the kwargs defined.\n '
kwargs = self._get_field_kwargs(form_field, serializer_field_class)
field_kwargs = kwargs.copy()
for (kwarg, value) in kwargs.it... |
600f191eeebdfd22ac4fc590770bdd38c0ffeef662d6a397b973b8146e67ca9d | def find_function_args(self, func):
'\n Get the list of parameter names which function accepts.\n '
try:
spec = (inspect.getfullargspec(func) if hasattr(inspect, 'getfullargspec') else inspect.getargspec(func))
return [i for i in spec[0] if (i not in IGNORE_ARGS)]
except TypeEr... | Get the list of parameter names which function accepts. | hypha/apply/api/v1/stream_serializers.py | find_function_args | jvasile/hypha | 20 | python | def find_function_args(self, func):
'\n \n '
try:
spec = (inspect.getfullargspec(func) if hasattr(inspect, 'getfullargspec') else inspect.getargspec(func))
return [i for i in spec[0] if (i not in IGNORE_ARGS)]
except TypeError:
return [] | def find_function_args(self, func):
'\n \n '
try:
spec = (inspect.getfullargspec(func) if hasattr(inspect, 'getfullargspec') else inspect.getargspec(func))
return [i for i in spec[0] if (i not in IGNORE_ARGS)]
except TypeError:
return []<|docstring|>Get the list of para... |
a1fea703c52221e1a76b7f6382cdb65a97a0c4a84999d4fdaf0f15324e283a63 | def find_class_args(self, klass):
'\n Find all class arguments (parameters) which can be passed in ``__init__``.\n '
args = set()
for i in klass.mro():
if ((i is object) or (not hasattr(i, '__init__'))):
continue
args |= set(self.find_function_args(i.__init__))
... | Find all class arguments (parameters) which can be passed in ``__init__``. | hypha/apply/api/v1/stream_serializers.py | find_class_args | jvasile/hypha | 20 | python | def find_class_args(self, klass):
'\n \n '
args = set()
for i in klass.mro():
if ((i is object) or (not hasattr(i, '__init__'))):
continue
args |= set(self.find_function_args(i.__init__))
return list(args) | def find_class_args(self, klass):
'\n \n '
args = set()
for i in klass.mro():
if ((i is object) or (not hasattr(i, '__init__'))):
continue
args |= set(self.find_function_args(i.__init__))
return list(args)<|docstring|>Find all class arguments (parameters) which ... |
89de0500a354a8c5a6c57d96299474ee2f0609e436decc6fea308bdf5a7bd8e5 | def _get_field_kwargs(self, form_field, serializer_field_class):
'\n For a given Form field, determine what validation attributes\n have been set. Includes things like max_length, required, etc.\n These will be used to create an instance of ``rest_framework.fields.Field``.\n :param form... | For a given Form field, determine what validation attributes
have been set. Includes things like max_length, required, etc.
These will be used to create an instance of ``rest_framework.fields.Field``.
:param form_field: a ``django.forms.field.Field`` instance
:return: dictionary of attributes to set | hypha/apply/api/v1/stream_serializers.py | _get_field_kwargs | jvasile/hypha | 20 | python | def _get_field_kwargs(self, form_field, serializer_field_class):
'\n For a given Form field, determine what validation attributes\n have been set. Includes things like max_length, required, etc.\n These will be used to create an instance of ``rest_framework.fields.Field``.\n :param form... | def _get_field_kwargs(self, form_field, serializer_field_class):
'\n For a given Form field, determine what validation attributes\n have been set. Includes things like max_length, required, etc.\n These will be used to create an instance of ``rest_framework.fields.Field``.\n :param form... |
64c2698299fce6838f6fe5e33c9dd802686a4d3ba4ef218ac2053f2d836b0c0b | def get_serializer_field_class(self, field):
'\n Assumes that a serializer field exist with the same name as form field.\n\n TODO:\n In case there are form fields not existing in serializer fields, we would\n have to create mapping b/w form fields and serializer fields to get the\n ... | Assumes that a serializer field exist with the same name as form field.
TODO:
In case there are form fields not existing in serializer fields, we would
have to create mapping b/w form fields and serializer fields to get the
respective classes. But for now this works. | hypha/apply/api/v1/stream_serializers.py | get_serializer_field_class | jvasile/hypha | 20 | python | def get_serializer_field_class(self, field):
'\n Assumes that a serializer field exist with the same name as form field.\n\n TODO:\n In case there are form fields not existing in serializer fields, we would\n have to create mapping b/w form fields and serializer fields to get the\n ... | def get_serializer_field_class(self, field):
'\n Assumes that a serializer field exist with the same name as form field.\n\n TODO:\n In case there are form fields not existing in serializer fields, we would\n have to create mapping b/w form fields and serializer fields to get the\n ... |
ff3e30299671a506e481dc236d47b6614c7d02e0b5b168fb6e7bcd24424c7443 | def update_config(self, config):
' Set up the resource library, public directory and\n template directory for the preview\n '
self.text_formats = config.get('ckan.preview.text_formats', '').split()
if (not self.text_formats):
self.text_formats = DEFAULT_TEXT_FORMATS
self.xml_format... | Set up the resource library, public directory and
template directory for the preview | ckanext/textpreview/plugin.py | update_config | anjianhua/ckan | 1 | python | def update_config(self, config):
' Set up the resource library, public directory and\n template directory for the preview\n '
self.text_formats = config.get('ckan.preview.text_formats', ).split()
if (not self.text_formats):
self.text_formats = DEFAULT_TEXT_FORMATS
self.xml_formats ... | def update_config(self, config):
' Set up the resource library, public directory and\n template directory for the preview\n '
self.text_formats = config.get('ckan.preview.text_formats', ).split()
if (not self.text_formats):
self.text_formats = DEFAULT_TEXT_FORMATS
self.xml_formats ... |
cf99741c85b9d51a3c71323525065c074565702dc6a767965e5fcba3ffdeb8e9 | def setplot(plotdata=None):
' \n Specify what is to be plotted at each frame.\n Input: plotdata, an instance of pyclaw.plotters.data.ClawPlotData.\n Output: a modified version of plotdata.\n \n '
from clawpack.visclaw import colormaps, geoplot
from numpy import linspace
if (plotdata is N... | Specify what is to be plotted at each frame.
Input: plotdata, an instance of pyclaw.plotters.data.ClawPlotData.
Output: a modified version of plotdata. | examples/tsunami/chile2010/setplot.py | setplot | dmelgarm/geoclaw | 51 | python | def setplot(plotdata=None):
' \n Specify what is to be plotted at each frame.\n Input: plotdata, an instance of pyclaw.plotters.data.ClawPlotData.\n Output: a modified version of plotdata.\n \n '
from clawpack.visclaw import colormaps, geoplot
from numpy import linspace
if (plotdata is N... | def setplot(plotdata=None):
' \n Specify what is to be plotted at each frame.\n Input: plotdata, an instance of pyclaw.plotters.data.ClawPlotData.\n Output: a modified version of plotdata.\n \n '
from clawpack.visclaw import colormaps, geoplot
from numpy import linspace
if (plotdata is N... |
9f188575b07225d94dad753951ee60a6285e7e0c3d2e31b378c6777125b80ade | @pytest.mark.parametrize('likelihood_setup', likelihood_setups)
@pytest.mark.parametrize('mu, var', [[Datum.Fmu, tf.zeros_like(Datum.Fmu)]])
def test_conditional_mean_and_variance(likelihood_setup, mu, var):
'\n Here we make sure that the conditional_mean and conditional_var functions\n give the same result a... | Here we make sure that the conditional_mean and conditional_var functions
give the same result as the predict_mean_and_var function if the prediction
has no uncertainty. | tests/gpflow/likelihoods/test_likelihoods.py | test_conditional_mean_and_variance | prakharverma/GPflow | 1 | python | @pytest.mark.parametrize('likelihood_setup', likelihood_setups)
@pytest.mark.parametrize('mu, var', [[Datum.Fmu, tf.zeros_like(Datum.Fmu)]])
def test_conditional_mean_and_variance(likelihood_setup, mu, var):
'\n Here we make sure that the conditional_mean and conditional_var functions\n give the same result a... | @pytest.mark.parametrize('likelihood_setup', likelihood_setups)
@pytest.mark.parametrize('mu, var', [[Datum.Fmu, tf.zeros_like(Datum.Fmu)]])
def test_conditional_mean_and_variance(likelihood_setup, mu, var):
'\n Here we make sure that the conditional_mean and conditional_var functions\n give the same result a... |
85bbcae5f88a508bd8cceea470f8ec116a5aed48457ff11d7457925b542033ed | @pytest.mark.parametrize('likelihood_setup', likelihood_setups)
def test_variational_expectations(likelihood_setup):
'\n Here we make sure that the variational_expectations gives the same result\n as log_prob if the latent function has no uncertainty.\n '
likelihood = likelihood_setup.likelihood
F ... | Here we make sure that the variational_expectations gives the same result
as log_prob if the latent function has no uncertainty. | tests/gpflow/likelihoods/test_likelihoods.py | test_variational_expectations | prakharverma/GPflow | 1 | python | @pytest.mark.parametrize('likelihood_setup', likelihood_setups)
def test_variational_expectations(likelihood_setup):
'\n Here we make sure that the variational_expectations gives the same result\n as log_prob if the latent function has no uncertainty.\n '
likelihood = likelihood_setup.likelihood
F ... | @pytest.mark.parametrize('likelihood_setup', likelihood_setups)
def test_variational_expectations(likelihood_setup):
'\n Here we make sure that the variational_expectations gives the same result\n as log_prob if the latent function has no uncertainty.\n '
likelihood = likelihood_setup.likelihood
F ... |
58cf660ba71461a87cee972afa2390a19902f2bb45b9e9f3bc73caf87914032c | @pytest.mark.parametrize('likelihood_setup', filter_analytic_scalar_likelihood('_variational_expectations'))
@pytest.mark.parametrize('mu, var', [[Datum.Fmu, Datum.Fvar]])
def test_scalar_likelihood_quadrature_variational_expectation(likelihood_setup, mu, var):
'\n Where quadrature methods have been overwritten,... | Where quadrature methods have been overwritten, make sure the new code
does something close to the quadrature. | tests/gpflow/likelihoods/test_likelihoods.py | test_scalar_likelihood_quadrature_variational_expectation | prakharverma/GPflow | 1 | python | @pytest.mark.parametrize('likelihood_setup', filter_analytic_scalar_likelihood('_variational_expectations'))
@pytest.mark.parametrize('mu, var', [[Datum.Fmu, Datum.Fvar]])
def test_scalar_likelihood_quadrature_variational_expectation(likelihood_setup, mu, var):
'\n Where quadrature methods have been overwritten,... | @pytest.mark.parametrize('likelihood_setup', filter_analytic_scalar_likelihood('_variational_expectations'))
@pytest.mark.parametrize('mu, var', [[Datum.Fmu, Datum.Fvar]])
def test_scalar_likelihood_quadrature_variational_expectation(likelihood_setup, mu, var):
'\n Where quadrature methods have been overwritten,... |
aaff37d6d4c7685e02fdc7447008677d1b6aed3a2c0820f2be972c47cc8edfd4 | def add_role(self):
'添加角色信息'
credential = self.get_credential
pid_list = self.validated_data.pop('pid_list')
try:
with transaction.atomic():
role = self.Meta.model.objects.create(**credential)
role.permission.add(*pid_list)
except DatabaseError:
raise DataForm... | 添加角色信息 | manager_app/serializers/role_serializers.py | add_role | syz247179876/e_mall | 7 | python | def add_role(self):
credential = self.get_credential
pid_list = self.validated_data.pop('pid_list')
try:
with transaction.atomic():
role = self.Meta.model.objects.create(**credential)
role.permission.add(*pid_list)
except DatabaseError:
raise DataFormatError(... | def add_role(self):
credential = self.get_credential
pid_list = self.validated_data.pop('pid_list')
try:
with transaction.atomic():
role = self.Meta.model.objects.create(**credential)
role.permission.add(*pid_list)
except DatabaseError:
raise DataFormatError(... |
e2b033f131e3e19590925e4280e577f881e83b194f22d078dfb1c0bc1184091f | def modify_role(self):
'修改角色信息'
data = self.context.get('request').data
permission_list = self.validated_data.pop('pid_list')
try:
with transaction.atomic():
role = self.Meta.model.objects.get(pk=data.get('pk'))
role.permission.set(permission_list)
rid = self.... | 修改角色信息 | manager_app/serializers/role_serializers.py | modify_role | syz247179876/e_mall | 7 | python | def modify_role(self):
data = self.context.get('request').data
permission_list = self.validated_data.pop('pid_list')
try:
with transaction.atomic():
role = self.Meta.model.objects.get(pk=data.get('pk'))
role.permission.set(permission_list)
rid = self.validate... | def modify_role(self):
data = self.context.get('request').data
permission_list = self.validated_data.pop('pid_list')
try:
with transaction.atomic():
role = self.Meta.model.objects.get(pk=data.get('pk'))
role.permission.set(permission_list)
rid = self.validate... |
63b9d9cfb92fa1cfd958c28e50b4e9b6fcc8f5f11bb284531a1bfacc46b8f2db | def validate_sid(self, value):
'校验sid对应的商家是否存在'
try:
return self.Meta.s_model.objects.get(pk=value)
except self.Meta.s_model.DoesNotExist:
raise DataNotExist() | 校验sid对应的商家是否存在 | manager_app/serializers/role_serializers.py | validate_sid | syz247179876/e_mall | 7 | python | def validate_sid(self, value):
try:
return self.Meta.s_model.objects.get(pk=value)
except self.Meta.s_model.DoesNotExist:
raise DataNotExist() | def validate_sid(self, value):
try:
return self.Meta.s_model.objects.get(pk=value)
except self.Meta.s_model.DoesNotExist:
raise DataNotExist()<|docstring|>校验sid对应的商家是否存在<|endoftext|> |
b546482861bd510fc2047c40a0ac78eb9f08435bc8f782378dab6e16f01f1eae | def validate_rid(self, value):
'校验rid对应的角色是否存在'
try:
return self.Meta.r_model.objects.get(pk=value)
except self.Meta.r_model.DoesNotExist:
raise DataNotExist() | 校验rid对应的角色是否存在 | manager_app/serializers/role_serializers.py | validate_rid | syz247179876/e_mall | 7 | python | def validate_rid(self, value):
try:
return self.Meta.r_model.objects.get(pk=value)
except self.Meta.r_model.DoesNotExist:
raise DataNotExist() | def validate_rid(self, value):
try:
return self.Meta.r_model.objects.get(pk=value)
except self.Meta.r_model.DoesNotExist:
raise DataNotExist()<|docstring|>校验rid对应的角色是否存在<|endoftext|> |
87fe5f75059ddaf8e568075bfeda68db7a018d21adc719ed51c1b2cad23c2ed5 | def modify(self):
'修改某个用户的角色'
if self.validated_data.pop('is_all'):
return self.modify_all()
else:
return self.modify_aim() | 修改某个用户的角色 | manager_app/serializers/role_serializers.py | modify | syz247179876/e_mall | 7 | python | def modify(self):
if self.validated_data.pop('is_all'):
return self.modify_all()
else:
return self.modify_aim() | def modify(self):
if self.validated_data.pop('is_all'):
return self.modify_all()
else:
return self.modify_aim()<|docstring|>修改某个用户的角色<|endoftext|> |
ef979e3ca4168d7cf046d6d94dd2bedbfc0b8f9b6e72bb2f9f5f6e206605787d | def modify_all(self):
'修改所有商家的角色'
return self.Meta.s_model.objects.all().update(role=self.validated_data.pop('role')) | 修改所有商家的角色 | manager_app/serializers/role_serializers.py | modify_all | syz247179876/e_mall | 7 | python | def modify_all(self):
return self.Meta.s_model.objects.all().update(role=self.validated_data.pop('role')) | def modify_all(self):
return self.Meta.s_model.objects.all().update(role=self.validated_data.pop('role'))<|docstring|>修改所有商家的角色<|endoftext|> |
86dd5e1ead409bc8355acf1932f830f74cf9a0e574c8bee65f4161b8d693dc49 | def modify_aim(self):
'修改指定商家的角色'
seller = self.validated_data.pop('seller')
seller.role = self.validated_data.pop('role')
seller.save()
return 1 | 修改指定商家的角色 | manager_app/serializers/role_serializers.py | modify_aim | syz247179876/e_mall | 7 | python | def modify_aim(self):
seller = self.validated_data.pop('seller')
seller.role = self.validated_data.pop('role')
seller.save()
return 1 | def modify_aim(self):
seller = self.validated_data.pop('seller')
seller.role = self.validated_data.pop('role')
seller.save()
return 1<|docstring|>修改指定商家的角色<|endoftext|> |
83a898e00d11ad447142fb58c48ce45ef731e8be6d82cc8f96ef113880473756 | def setupCore(self):
'\n status:\n 0 : waiting\n 1 : running\n -1 : crashed\n '
self.status = 0
self.fpath_mrls = ''
self.fpath_urls = ''
self.fpath_mls = ''
self.sapp = Polar() | status:
0 : waiting
1 : running
-1 : crashed | uglyGui.py | setupCore | ycroft/STOKES_polar | 1 | python | def setupCore(self):
'\n status:\n 0 : waiting\n 1 : running\n -1 : crashed\n '
self.status = 0
self.fpath_mrls =
self.fpath_urls =
self.fpath_mls =
self.sapp = Polar() | def setupCore(self):
'\n status:\n 0 : waiting\n 1 : running\n -1 : crashed\n '
self.status = 0
self.fpath_mrls =
self.fpath_urls =
self.fpath_mls =
self.sapp = Polar()<|docstring|>status:
0 : waiting
1 : running
-1... |
24d4dafccb12fee34d8bd3d91a94da73cc158f8f6cd75d9bb58830560f82b83d | def __init__(self, client: Union[('ConnectionType', 'SessionType')]) -> None:
'Initialize a new instance of Browser\n\n :param client: The client instance to be used to communicate with the remote browser instance\n '
self.client: Union[('ConnectionType', 'SessionType')] = client | Initialize a new instance of Browser
:param client: The client instance to be used to communicate with the remote browser instance | cripy/protocol/browser.py | __init__ | Phill240/chrome-remote-interface-py | 5 | python | def __init__(self, client: Union[('ConnectionType', 'SessionType')]) -> None:
'Initialize a new instance of Browser\n\n :param client: The client instance to be used to communicate with the remote browser instance\n '
self.client: Union[('ConnectionType', 'SessionType')] = client | def __init__(self, client: Union[('ConnectionType', 'SessionType')]) -> None:
'Initialize a new instance of Browser\n\n :param client: The client instance to be used to communicate with the remote browser instance\n '
self.client: Union[('ConnectionType', 'SessionType')] = client<|docstring|>Initi... |
801304960a71a1ec0176d00c0895a83e7e36660bd962d5ff310117e8c8688cdd | def grantPermissions(self, origin: str, permissions: List[str], browserContextId: Optional[str]=None) -> Awaitable[Dict]:
'\n Grant specific permissions to the given origin and reject all others.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#me... | Grant specific permissions to the given origin and reject all others.
Status: Experimental
See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-grantPermissions`
:param origin: The origin
:param permissions: The permissions
:param browserContextId: BrowserContext to override permissions. When o... | cripy/protocol/browser.py | grantPermissions | Phill240/chrome-remote-interface-py | 5 | python | def grantPermissions(self, origin: str, permissions: List[str], browserContextId: Optional[str]=None) -> Awaitable[Dict]:
'\n Grant specific permissions to the given origin and reject all others.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#me... | def grantPermissions(self, origin: str, permissions: List[str], browserContextId: Optional[str]=None) -> Awaitable[Dict]:
'\n Grant specific permissions to the given origin and reject all others.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#me... |
ac8deff37fa17c21fa4f7e7f1c398a12ef77f5f186d4ec455e58a068ed801147 | def resetPermissions(self, browserContextId: Optional[str]=None) -> Awaitable[Dict]:
'\n Reset all permission management for all origins.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-resetPermissions`\n\n :param browserContextId:... | Reset all permission management for all origins.
Status: Experimental
See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-resetPermissions`
:param browserContextId: BrowserContext to reset permissions. When omitted, default browser context is used.
:return: The results of the command | cripy/protocol/browser.py | resetPermissions | Phill240/chrome-remote-interface-py | 5 | python | def resetPermissions(self, browserContextId: Optional[str]=None) -> Awaitable[Dict]:
'\n Reset all permission management for all origins.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-resetPermissions`\n\n :param browserContextId:... | def resetPermissions(self, browserContextId: Optional[str]=None) -> Awaitable[Dict]:
'\n Reset all permission management for all origins.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-resetPermissions`\n\n :param browserContextId:... |
9614179830cd22e686697649893d76e0d06fc0e9038987c92142acdaf4230700 | def close(self) -> Awaitable[Dict]:
'\n Close browser gracefully.\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-close`\n\n :return: The results of the command\n '
return self.client.send('Browser.close', {}) | Close browser gracefully.
See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-close`
:return: The results of the command | cripy/protocol/browser.py | close | Phill240/chrome-remote-interface-py | 5 | python | def close(self) -> Awaitable[Dict]:
'\n Close browser gracefully.\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-close`\n\n :return: The results of the command\n '
return self.client.send('Browser.close', {}) | def close(self) -> Awaitable[Dict]:
'\n Close browser gracefully.\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-close`\n\n :return: The results of the command\n '
return self.client.send('Browser.close', {})<|docstring|>Close browser gracefully.
See ... |
72afae313afecad6666e659258e27092d26a49c514bb812a1933177ff31730a5 | def crash(self) -> Awaitable[Dict]:
'\n Crashes browser on the main thread.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-crash`\n\n :return: The results of the command\n '
return self.client.send('Browser.crash', {}) | Crashes browser on the main thread.
Status: Experimental
See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-crash`
:return: The results of the command | cripy/protocol/browser.py | crash | Phill240/chrome-remote-interface-py | 5 | python | def crash(self) -> Awaitable[Dict]:
'\n Crashes browser on the main thread.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-crash`\n\n :return: The results of the command\n '
return self.client.send('Browser.crash', {}) | def crash(self) -> Awaitable[Dict]:
'\n Crashes browser on the main thread.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-crash`\n\n :return: The results of the command\n '
return self.client.send('Browser.crash', {})<|... |
bd26f77a36e6153e61223c28dbfd544aa091bd581a404bf3f8d64d5be5104c7f | def crashGpuProcess(self) -> Awaitable[Dict]:
'\n Crashes GPU process.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-crashGpuProcess`\n\n :return: The results of the command\n '
return self.client.send('Browser.crashGpu... | Crashes GPU process.
Status: Experimental
See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-crashGpuProcess`
:return: The results of the command | cripy/protocol/browser.py | crashGpuProcess | Phill240/chrome-remote-interface-py | 5 | python | def crashGpuProcess(self) -> Awaitable[Dict]:
'\n Crashes GPU process.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-crashGpuProcess`\n\n :return: The results of the command\n '
return self.client.send('Browser.crashGpu... | def crashGpuProcess(self) -> Awaitable[Dict]:
'\n Crashes GPU process.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-crashGpuProcess`\n\n :return: The results of the command\n '
return self.client.send('Browser.crashGpu... |
0d7434aaf407c806f2ae30484cb7bfc15ec5c9968d9f2a0e1eba1b450ba8fbd3 | def getVersion(self) -> Awaitable[Dict]:
'\n Returns version information.\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-getVersion`\n\n :return: The results of the command\n '
return self.client.send('Browser.getVersion', {}) | Returns version information.
See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-getVersion`
:return: The results of the command | cripy/protocol/browser.py | getVersion | Phill240/chrome-remote-interface-py | 5 | python | def getVersion(self) -> Awaitable[Dict]:
'\n Returns version information.\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-getVersion`\n\n :return: The results of the command\n '
return self.client.send('Browser.getVersion', {}) | def getVersion(self) -> Awaitable[Dict]:
'\n Returns version information.\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-getVersion`\n\n :return: The results of the command\n '
return self.client.send('Browser.getVersion', {})<|docstring|>Returns versi... |
e8d19a23ee97563e65d8cd2c81bc131b7b3e63c53a77ff73f1d5c3ab809f342a | def getBrowserCommandLine(self) -> Awaitable[Dict]:
'\n Returns the command line switches for the browser process if, and only if\n --enable-automation is on the commandline.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-getBrowse... | Returns the command line switches for the browser process if, and only if
--enable-automation is on the commandline.
Status: Experimental
See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-getBrowserCommandLine`
:return: The results of the command | cripy/protocol/browser.py | getBrowserCommandLine | Phill240/chrome-remote-interface-py | 5 | python | def getBrowserCommandLine(self) -> Awaitable[Dict]:
'\n Returns the command line switches for the browser process if, and only if\n --enable-automation is on the commandline.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-getBrowse... | def getBrowserCommandLine(self) -> Awaitable[Dict]:
'\n Returns the command line switches for the browser process if, and only if\n --enable-automation is on the commandline.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-getBrowse... |
500d44c973658571d244edaf10757ed985010935e59546523cd0718501a9023c | def getHistograms(self, query: Optional[str]=None, delta: Optional[bool]=None) -> Awaitable[Dict]:
'\n Get Chrome histograms.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-getHistograms`\n\n :param query: Requested substring in na... | Get Chrome histograms.
Status: Experimental
See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-getHistograms`
:param query: Requested substring in name. Only histograms which have query as a
substring in their name are extracted. An empty or absent query returns
all histograms.
:param delta... | cripy/protocol/browser.py | getHistograms | Phill240/chrome-remote-interface-py | 5 | python | def getHistograms(self, query: Optional[str]=None, delta: Optional[bool]=None) -> Awaitable[Dict]:
'\n Get Chrome histograms.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-getHistograms`\n\n :param query: Requested substring in na... | def getHistograms(self, query: Optional[str]=None, delta: Optional[bool]=None) -> Awaitable[Dict]:
'\n Get Chrome histograms.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-getHistograms`\n\n :param query: Requested substring in na... |
c0937abe0b93dad1b65dbec37e6a55c31e229b35b286984a20f9b08704e0ad2d | def getHistogram(self, name: str, delta: Optional[bool]=None) -> Awaitable[Dict]:
'\n Get a Chrome histogram by name.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-getHistogram`\n\n :param name: Requested histogram name.\n ... | Get a Chrome histogram by name.
Status: Experimental
See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-getHistogram`
:param name: Requested histogram name.
:param delta: If true, retrieve delta since last call.
:return: The results of the command | cripy/protocol/browser.py | getHistogram | Phill240/chrome-remote-interface-py | 5 | python | def getHistogram(self, name: str, delta: Optional[bool]=None) -> Awaitable[Dict]:
'\n Get a Chrome histogram by name.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-getHistogram`\n\n :param name: Requested histogram name.\n ... | def getHistogram(self, name: str, delta: Optional[bool]=None) -> Awaitable[Dict]:
'\n Get a Chrome histogram by name.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-getHistogram`\n\n :param name: Requested histogram name.\n ... |
6a9b33e9b67124e2bd38d51a47a3611180aa95dfb6f1fe21beaa7849751d53a3 | def getWindowBounds(self, windowId: int) -> Awaitable[Dict]:
'\n Get position and size of the browser window.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-getWindowBounds`\n\n :param windowId: Browser window id.\n :return:... | Get position and size of the browser window.
Status: Experimental
See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-getWindowBounds`
:param windowId: Browser window id.
:return: The results of the command | cripy/protocol/browser.py | getWindowBounds | Phill240/chrome-remote-interface-py | 5 | python | def getWindowBounds(self, windowId: int) -> Awaitable[Dict]:
'\n Get position and size of the browser window.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-getWindowBounds`\n\n :param windowId: Browser window id.\n :return:... | def getWindowBounds(self, windowId: int) -> Awaitable[Dict]:
'\n Get position and size of the browser window.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-getWindowBounds`\n\n :param windowId: Browser window id.\n :return:... |
afa318d9473083243fa78a527690728c611cdaab4a225a0c71faf2d406caf16e | def getWindowForTarget(self, targetId: Optional[str]=None) -> Awaitable[Dict]:
'\n Get the browser window that contains the devtools target.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-getWindowForTarget`\n\n :param targetId: De... | Get the browser window that contains the devtools target.
Status: Experimental
See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-getWindowForTarget`
:param targetId: Devtools agent host id. If called as a part of the session, associated targetId is used.
:return: The results of the command | cripy/protocol/browser.py | getWindowForTarget | Phill240/chrome-remote-interface-py | 5 | python | def getWindowForTarget(self, targetId: Optional[str]=None) -> Awaitable[Dict]:
'\n Get the browser window that contains the devtools target.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-getWindowForTarget`\n\n :param targetId: De... | def getWindowForTarget(self, targetId: Optional[str]=None) -> Awaitable[Dict]:
'\n Get the browser window that contains the devtools target.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-getWindowForTarget`\n\n :param targetId: De... |
909284ccad9fe42de0f3b013be78d2f8ea37ab691f71fde9a649d439f8976a3f | def setWindowBounds(self, windowId: int, bounds: Dict[(str, Any)]) -> Awaitable[Dict]:
"\n Set position and/or size of the browser window.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-setWindowBounds`\n\n :param windowId: Browser... | Set position and/or size of the browser window.
Status: Experimental
See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-setWindowBounds`
:param windowId: Browser window id.
:param bounds: New window bounds. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined
with 'left', ... | cripy/protocol/browser.py | setWindowBounds | Phill240/chrome-remote-interface-py | 5 | python | def setWindowBounds(self, windowId: int, bounds: Dict[(str, Any)]) -> Awaitable[Dict]:
"\n Set position and/or size of the browser window.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-setWindowBounds`\n\n :param windowId: Browser... | def setWindowBounds(self, windowId: int, bounds: Dict[(str, Any)]) -> Awaitable[Dict]:
"\n Set position and/or size of the browser window.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-setWindowBounds`\n\n :param windowId: Browser... |
f64e89efe2f84aab1b157dcdaed93864801e4c1ee60858d5d9711a3aff1b42ac | def setDockTile(self, badgeLabel: Optional[str]=None, image: Optional[str]=None) -> Awaitable[Dict]:
'\n Set dock tile details, platform-specific.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-setDockTile`\n\n :param badgeLabel: T... | Set dock tile details, platform-specific.
Status: Experimental
See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-setDockTile`
:param badgeLabel: The badgeLabel
:param image: Png encoded image.
:return: The results of the command | cripy/protocol/browser.py | setDockTile | Phill240/chrome-remote-interface-py | 5 | python | def setDockTile(self, badgeLabel: Optional[str]=None, image: Optional[str]=None) -> Awaitable[Dict]:
'\n Set dock tile details, platform-specific.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-setDockTile`\n\n :param badgeLabel: T... | def setDockTile(self, badgeLabel: Optional[str]=None, image: Optional[str]=None) -> Awaitable[Dict]:
'\n Set dock tile details, platform-specific.\n\n Status: Experimental\n\n See `https://chromedevtools.github.io/devtools-protocol/tot/Browser#method-setDockTile`\n\n :param badgeLabel: T... |
2d92b69c9328dafe7ed1f44452294e26e35e24a185eceb0abb5c6d6faecda97c | def pre_config(output_path):
'\n Pre config with output path\n '
self.assertEqual(output_path, 'output_path')
raise WasHere | Pre config with output path | vunit/test/unit/test_test_suites.py | pre_config | imd1/vunit | 2 | python | def pre_config(output_path):
'\n \n '
self.assertEqual(output_path, 'output_path')
raise WasHere | def pre_config(output_path):
'\n \n '
self.assertEqual(output_path, 'output_path')
raise WasHere<|docstring|>Pre config with output path<|endoftext|> |
254ff1729558cdb2f03b61fd087b42911c810d4a87d3c89a11fefcfec99dd2da | def pre_config(output_path, simulator_output_path):
'\n Pre config with output path\n '
self.assertEqual(output_path, 'output_path')
self.assertEqual(simulator_output_path, 'simulator_output_path')
raise WasHere | Pre config with output path | vunit/test/unit/test_test_suites.py | pre_config | imd1/vunit | 2 | python | def pre_config(output_path, simulator_output_path):
'\n \n '
self.assertEqual(output_path, 'output_path')
self.assertEqual(simulator_output_path, 'simulator_output_path')
raise WasHere | def pre_config(output_path, simulator_output_path):
'\n \n '
self.assertEqual(output_path, 'output_path')
self.assertEqual(simulator_output_path, 'simulator_output_path')
raise WasHere<|docstring|>Pre config with output path<|endoftext|> |
197a1da24ff3e66509af229bed9496042c5fbbe6e9a286aa7639bedd0615bb83 | def pre_config(self, output_path, simulator_output_path):
'\n Pre config with output path\n '
assert (self.value == 2)
assert (output_path == 'output_path')
assert (simulator_output_path == 'simulator_output_path')
raise WasHere | Pre config with output path | vunit/test/unit/test_test_suites.py | pre_config | imd1/vunit | 2 | python | def pre_config(self, output_path, simulator_output_path):
'\n \n '
assert (self.value == 2)
assert (output_path == 'output_path')
assert (simulator_output_path == 'simulator_output_path')
raise WasHere | def pre_config(self, output_path, simulator_output_path):
'\n \n '
assert (self.value == 2)
assert (output_path == 'output_path')
assert (simulator_output_path == 'simulator_output_path')
raise WasHere<|docstring|>Pre config with output path<|endoftext|> |
05ea199d4e2420681e14d1bd5f445286713b38e11b6cfba2a2bef3aae82d3ca1 | def parse_public_key(public_key) -> List[str]:
'\n Parse input public key to a list of public SSH key with basic checking\n\n Parameters:\n public_key:\n - (str): The public key that will be able to authenticate the SSH connection\n - (List[str]): A list of public keys that will b... | Parse input public key to a list of public SSH key with basic checking
Parameters:
public_key:
- (str): The public key that will be able to authenticate the SSH connection
- (List[str]): A list of public keys that will be able to authenticate the SSH connection
- (str): Link to a text file ... | colab_ssh/ssh.py | parse_public_key | Apon77/colab_ssh | 45 | python | def parse_public_key(public_key) -> List[str]:
'\n Parse input public key to a list of public SSH key with basic checking\n\n Parameters:\n public_key:\n - (str): The public key that will be able to authenticate the SSH connection\n - (List[str]): A list of public keys that will b... | def parse_public_key(public_key) -> List[str]:
'\n Parse input public key to a list of public SSH key with basic checking\n\n Parameters:\n public_key:\n - (str): The public key that will be able to authenticate the SSH connection\n - (List[str]): A list of public keys that will b... |
336477b8e53760ea50e6472306cbb113cedc9a48655f0d95364936ce34bc17b3 | def config_ssh_server(public_key: List[str], msg: str):
'\n Install SSH server, config it and set the appropriate public_key for authentication\n\n Parameters:\n public_key (List[str]): A list of string of parsed public keys\n msg (str): Variable that contain the whole message that will be prin... | Install SSH server, config it and set the appropriate public_key for authentication
Parameters:
public_key (List[str]): A list of string of parsed public keys
msg (str): Variable that contain the whole message that will be print out at the end of the setup process | colab_ssh/ssh.py | config_ssh_server | Apon77/colab_ssh | 45 | python | def config_ssh_server(public_key: List[str], msg: str):
'\n Install SSH server, config it and set the appropriate public_key for authentication\n\n Parameters:\n public_key (List[str]): A list of string of parsed public keys\n msg (str): Variable that contain the whole message that will be prin... | def config_ssh_server(public_key: List[str], msg: str):
'\n Install SSH server, config it and set the appropriate public_key for authentication\n\n Parameters:\n public_key (List[str]): A list of string of parsed public keys\n msg (str): Variable that contain the whole message that will be prin... |
09450e4590c94900e9c886c2a6d51d94fa3713d09f9ba6189af9c9da7c19e987 | def process(model, dataloader, top_k):
'\n Executes only a forward pass of model over the dataset and computes accuracy\n Parameters\n ----------\n model : model.BaseModel\n A base model, which may contain some model.PreNormLayer layers.\n dataloader : torch.utils.data.DataLoader\n Data... | Executes only a forward pass of model over the dataset and computes accuracy
Parameters
----------
model : model.BaseModel
A base model, which may contain some model.PreNormLayer layers.
dataloader : torch.utils.data.DataLoader
Dataset to use for training the model.
top_k : list
list of `k` (int) to estimat... | examples/03_test.py | process | Sandbergo/ecole | 0 | python | def process(model, dataloader, top_k):
'\n Executes only a forward pass of model over the dataset and computes accuracy\n Parameters\n ----------\n model : model.BaseModel\n A base model, which may contain some model.PreNormLayer layers.\n dataloader : torch.utils.data.DataLoader\n Data... | def process(model, dataloader, top_k):
'\n Executes only a forward pass of model over the dataset and computes accuracy\n Parameters\n ----------\n model : model.BaseModel\n A base model, which may contain some model.PreNormLayer layers.\n dataloader : torch.utils.data.DataLoader\n Data... |
dd439e03e38a78a53df7e617e441fc28d04c923a6552c35b1a6a8b61aed37ad5 | def construct_linearPETC_traffic_from_file(file_name):
'\n\n @param file_name:\n @return:\n\n Originally written\n\n '
if (not os.path.exists(file_name)):
print(f'File {file_name} could not be found.')
return None
dict_key_to_attrs = {'Dynamics': None, 'Controller': None, 'Trigge... | @param file_name:
@return:
Originally written | ETCetera/util/construct_from_file_linearPETC.py | construct_linearPETC_traffic_from_file | ggleizer/ETCetera | 0 | python | def construct_linearPETC_traffic_from_file(file_name):
'\n\n @param file_name:\n @return:\n\n Originally written\n\n '
if (not os.path.exists(file_name)):
print(f'File {file_name} could not be found.')
return None
dict_key_to_attrs = {'Dynamics': None, 'Controller': None, 'Trigge... | def construct_linearPETC_traffic_from_file(file_name):
'\n\n @param file_name:\n @return:\n\n Originally written\n\n '
if (not os.path.exists(file_name)):
print(f'File {file_name} could not be found.')
return None
dict_key_to_attrs = {'Dynamics': None, 'Controller': None, 'Trigge... |
850cc36bce4f3e1e9a146b25825259f8cce926568aa94f23941d2fede0523f1c | def run_kernel(kernel, num_results, current_state, previous_kernel_results=None, reducer=(), previous_reducer_state=None, trace_fn=_trace_everything, parallel_iterations=10, seed=None, name=None):
"Runs a Markov chain defined by the given `TransitionKernel`.\n\n This is meant as a (more) helpful frontend to the lo... | Runs a Markov chain defined by the given `TransitionKernel`.
This is meant as a (more) helpful frontend to the low-level
`TransitionKernel`-based MCMC API, supporting several main features:
- Running a batch of multiple independent chains using SIMD parallelism
- Tracing the history of the chains, or not tracing it t... | tensorflow_probability/python/experimental/mcmc/run.py | run_kernel | joshchang/probability | 3,670 | python | def run_kernel(kernel, num_results, current_state, previous_kernel_results=None, reducer=(), previous_reducer_state=None, trace_fn=_trace_everything, parallel_iterations=10, seed=None, name=None):
"Runs a Markov chain defined by the given `TransitionKernel`.\n\n This is meant as a (more) helpful frontend to the lo... | def run_kernel(kernel, num_results, current_state, previous_kernel_results=None, reducer=(), previous_reducer_state=None, trace_fn=_trace_everything, parallel_iterations=10, seed=None, name=None):
"Runs a Markov chain defined by the given `TransitionKernel`.\n\n This is meant as a (more) helpful frontend to the lo... |
953bffdb26aa361627440466efdaa124d53bfc53868694904defbe33563f4352 | def __init__(self, source, dlock, lockMetadata):
'\n Initialize a cooperator\n '
self.source = source
self.dlock = dlock
self.lockMetadata = lockMetadata
self.primary = False | Initialize a cooperator | osaka/cooperator.py | __init__ | riverma/osaka | 2 | python | def __init__(self, source, dlock, lockMetadata):
'\n \n '
self.source = source
self.dlock = dlock
self.lockMetadata = lockMetadata
self.primary = False | def __init__(self, source, dlock, lockMetadata):
'\n \n '
self.source = source
self.dlock = dlock
self.lockMetadata = lockMetadata
self.primary = False<|docstring|>Initialize a cooperator<|endoftext|> |
2a0066181ce098cb916ae1232abeff298dee9e711a20306bd3bd7ba44ceb5657 | def __enter__(self):
'\n Enter this cooperate block\n @param:\n '
try:
lockMetadata = copy.copy(self.lockMetadata)
lockMetadata['source'] = self.source
self.dlock.lock(lockMetadata)
self.primary = True
except OsakaException as ose:
if ('Lock file ... | Enter this cooperate block
@param: | osaka/cooperator.py | __enter__ | riverma/osaka | 2 | python | def __enter__(self):
'\n Enter this cooperate block\n @param:\n '
try:
lockMetadata = copy.copy(self.lockMetadata)
lockMetadata['source'] = self.source
self.dlock.lock(lockMetadata)
self.primary = True
except OsakaException as ose:
if ('Lock file ... | def __enter__(self):
'\n Enter this cooperate block\n @param:\n '
try:
lockMetadata = copy.copy(self.lockMetadata)
lockMetadata['source'] = self.source
self.dlock.lock(lockMetadata)
self.primary = True
except OsakaException as ose:
if ('Lock file ... |
5959e9523babf1c5d7a576cb2ce889effd9566d85e90b15d72d81045854dc125 | def __exit__(self, exception_type, exception_value, traceback):
'\n Handle exceptions in the with block\n @param exception_type: exception type\n @param exception_value: exception value\n @param traceback: traceback of exception\n '
if (not self.primary):
return
el... | Handle exceptions in the with block
@param exception_type: exception type
@param exception_value: exception value
@param traceback: traceback of exception | osaka/cooperator.py | __exit__ | riverma/osaka | 2 | python | def __exit__(self, exception_type, exception_value, traceback):
'\n Handle exceptions in the with block\n @param exception_type: exception type\n @param exception_value: exception value\n @param traceback: traceback of exception\n '
if (not self.primary):
return
el... | def __exit__(self, exception_type, exception_value, traceback):
'\n Handle exceptions in the with block\n @param exception_type: exception type\n @param exception_value: exception value\n @param traceback: traceback of exception\n '
if (not self.primary):
return
el... |
8d5822fff87937c6ece2715908d89aa606493b51b6d60a09bfca5d048819a76b | def whenLocked(self):
'\n What to do when a file is already locked\n '
ex_source = self.dlock.getLockMetadata('source')
error = self.dlock.getLockMetadata('error')
ouri = self.dlock.ouri
if (ex_source is None):
raise CooperationNotPossibleException('No source specified. Coopera... | What to do when a file is already locked | osaka/cooperator.py | whenLocked | riverma/osaka | 2 | python | def whenLocked(self):
'\n \n '
ex_source = self.dlock.getLockMetadata('source')
error = self.dlock.getLockMetadata('error')
ouri = self.dlock.ouri
if (ex_source is None):
raise CooperationNotPossibleException('No source specified. Cooperation not possible for {0}'.format(ouri))... | def whenLocked(self):
'\n \n '
ex_source = self.dlock.getLockMetadata('source')
error = self.dlock.getLockMetadata('error')
ouri = self.dlock.ouri
if (ex_source is None):
raise CooperationNotPossibleException('No source specified. Cooperation not possible for {0}'.format(ouri))... |
211ec82bce86ba7c58dd4e3257946daeec1fc7c93b6b3d1d3510dca31df83022 | def isPrimary(self):
'\n Is this the primary responsible for download\n '
return self.primary | Is this the primary responsible for download | osaka/cooperator.py | isPrimary | riverma/osaka | 2 | python | def isPrimary(self):
'\n \n '
return self.primary | def isPrimary(self):
'\n \n '
return self.primary<|docstring|>Is this the primary responsible for download<|endoftext|> |
956c0dfc310a580f8d1feb0a4ec46f1837703bdaea26e8317c54d680ad39b42f | def __init__(self, dlock, timeout, interval=0.5):
'\n Initialize this spinner\n @param dlock: lock to spin on\n '
self.dlock = dlock
self.timeout = timeout
self.interval = interval | Initialize this spinner
@param dlock: lock to spin on | osaka/cooperator.py | __init__ | riverma/osaka | 2 | python | def __init__(self, dlock, timeout, interval=0.5):
'\n Initialize this spinner\n @param dlock: lock to spin on\n '
self.dlock = dlock
self.timeout = timeout
self.interval = interval | def __init__(self, dlock, timeout, interval=0.5):
'\n Initialize this spinner\n @param dlock: lock to spin on\n '
self.dlock = dlock
self.timeout = timeout
self.interval = interval<|docstring|>Initialize this spinner
@param dlock: lock to spin on<|endoftext|> |
d7873c72de7ea9762738f9e3f907deb6382dd5ad3b2fbadd7a41d306390c8262 | def spin(self):
'\n Will spin on this lock until download completes or error is detected\n '
tm = 0
while True:
error = self.dlock.getLockMetadata('error')
if (error is not None):
raise OsakaException(('Cooperation error: ' + error))
elif (not self.dlock.isL... | Will spin on this lock until download completes or error is detected | osaka/cooperator.py | spin | riverma/osaka | 2 | python | def spin(self):
'\n \n '
tm = 0
while True:
error = self.dlock.getLockMetadata('error')
if (error is not None):
raise OsakaException(('Cooperation error: ' + error))
elif (not self.dlock.isLocked()):
return
elif ((self.timeout != (- 1)) a... | def spin(self):
'\n \n '
tm = 0
while True:
error = self.dlock.getLockMetadata('error')
if (error is not None):
raise OsakaException(('Cooperation error: ' + error))
elif (not self.dlock.isLocked()):
return
elif ((self.timeout != (- 1)) a... |
746b0158eea0f4c78f012ca35058dc075d1b3daba5b08b56f5708cba499ffbd4 | @single(slice_nargs=2)
def segment(self, uri: str, buffer: bytes, *args, **kwargs) -> List[Dict]:
"\n Segments PDF files. Extracts data from them.\n\n Checks if the input is a string of the filename,\n or if it's the file in bytes.\n It will then extract the data from the file, creating ... | Segments PDF files. Extracts data from them.
Checks if the input is a string of the filename,
or if it's the file in bytes.
It will then extract the data from the file, creating a list for images,
and text.
:param uri: File name of PDF
:type uri: str
:param buffer: PDF file in bytes
:type buffer: bytes
:returns: A li... | segmenters/nlp/PDFExtractorSegmenter/__init__.py | segment | Harshdeep1996/jina-hub | 106 | python | @single(slice_nargs=2)
def segment(self, uri: str, buffer: bytes, *args, **kwargs) -> List[Dict]:
"\n Segments PDF files. Extracts data from them.\n\n Checks if the input is a string of the filename,\n or if it's the file in bytes.\n It will then extract the data from the file, creating ... | @single(slice_nargs=2)
def segment(self, uri: str, buffer: bytes, *args, **kwargs) -> List[Dict]:
"\n Segments PDF files. Extracts data from them.\n\n Checks if the input is a string of the filename,\n or if it's the file in bytes.\n It will then extract the data from the file, creating ... |
fca7993deb7f6b4bdc6bbb39fc9972a8f37167bdbdaf1e3c828f46d7a56fd33e | def apply(self, args, evaluation):
'Or[args___]'
args = args.get_sequence()
leaves = []
for arg in args:
result = arg.evaluate(evaluation)
if result.is_true():
return Symbol('True')
elif (result != Symbol('False')):
leaves.append(result)
if leaves:
... | Or[args___] | mathics/builtin/logic.py | apply | bnjones/Mathics | 1 | python | def apply(self, args, evaluation):
args = args.get_sequence()
leaves = []
for arg in args:
result = arg.evaluate(evaluation)
if result.is_true():
return Symbol('True')
elif (result != Symbol('False')):
leaves.append(result)
if leaves:
if (len(... | def apply(self, args, evaluation):
args = args.get_sequence()
leaves = []
for arg in args:
result = arg.evaluate(evaluation)
if result.is_true():
return Symbol('True')
elif (result != Symbol('False')):
leaves.append(result)
if leaves:
if (len(... |
b9f63c8600ba9819424244f3dda9daacd9593f4efd7d1bdcf065aba80329e887 | def apply(self, args, evaluation):
'And[args___]'
args = args.get_sequence()
leaves = []
for arg in args:
result = arg.evaluate(evaluation)
if (result == Symbol('False')):
return Symbol('False')
elif (not result.is_true()):
leaves.append(result)
if lea... | And[args___] | mathics/builtin/logic.py | apply | bnjones/Mathics | 1 | python | def apply(self, args, evaluation):
args = args.get_sequence()
leaves = []
for arg in args:
result = arg.evaluate(evaluation)
if (result == Symbol('False')):
return Symbol('False')
elif (not result.is_true()):
leaves.append(result)
if leaves:
i... | def apply(self, args, evaluation):
args = args.get_sequence()
leaves = []
for arg in args:
result = arg.evaluate(evaluation)
if (result == Symbol('False')):
return Symbol('False')
elif (not result.is_true()):
leaves.append(result)
if leaves:
i... |
86d38c4b8dcf3baf366700fc41ff5b632a6191f5142172b356347a24251ee6dc | def get_login_url(self, userid):
'\n 获取登录企业邮的url\n\n :param userid: 成员UserID\n :return:\n '
return self._get('/service/get_login_url', {'userid': userid}) | 获取登录企业邮的url
:param userid: 成员UserID
:return: | exmail/client/api/service.py | get_login_url | ni-ning/exmail-sdk | 5 | python | def get_login_url(self, userid):
'\n 获取登录企业邮的url\n\n :param userid: 成员UserID\n :return:\n '
return self._get('/service/get_login_url', {'userid': userid}) | def get_login_url(self, userid):
'\n 获取登录企业邮的url\n\n :param userid: 成员UserID\n :return:\n '
return self._get('/service/get_login_url', {'userid': userid})<|docstring|>获取登录企业邮的url
:param userid: 成员UserID
:return:<|endoftext|> |
d2969594fd941de319592db8129695e3f4a98e9ccefec58ba8b4d72b89677b72 | def __init__(self, kronecker_model: KroneckerModel, personalization_map: np.ndarray, average_fit: np.ndarray, output_name: str, gait_fingerprint: np.ndarray=None, subject_name: np.ndarray=None):
"\n Initialize the PersonalKModel Object\n\n Keyword arguments:\n kronecker_model -- KroneckerModel ... | Initialize the PersonalKModel Object
Keyword arguments:
kronecker_model -- KroneckerModel object
personalization_map -- Numpy array with shape
(num_gait_fingerprints, model_output_size)
average_fit -- Numpy array with
shape (1, model_output_size)
gait_fingerprint -- an individual... | kmodel/personal_k_model.py | __init__ | jmontp/Prosthetic_Adaptation | 0 | python | def __init__(self, kronecker_model: KroneckerModel, personalization_map: np.ndarray, average_fit: np.ndarray, output_name: str, gait_fingerprint: np.ndarray=None, subject_name: np.ndarray=None):
"\n Initialize the PersonalKModel Object\n\n Keyword arguments:\n kronecker_model -- KroneckerModel ... | def __init__(self, kronecker_model: KroneckerModel, personalization_map: np.ndarray, average_fit: np.ndarray, output_name: str, gait_fingerprint: np.ndarray=None, subject_name: np.ndarray=None):
"\n Initialize the PersonalKModel Object\n\n Keyword arguments:\n kronecker_model -- KroneckerModel ... |
fb397ceb99893215a6c54c55cb788383fd83e8957916e8d9ff2f71b35d3606c9 | def get_subject_name(self):
'\n Returns the subjects name, if any\n\n This is useful is the instance to this object is stored\n '
return self.subject_name | Returns the subjects name, if any
This is useful is the instance to this object is stored | kmodel/personal_k_model.py | get_subject_name | jmontp/Prosthetic_Adaptation | 0 | python | def get_subject_name(self):
'\n Returns the subjects name, if any\n\n This is useful is the instance to this object is stored\n '
return self.subject_name | def get_subject_name(self):
'\n Returns the subjects name, if any\n\n This is useful is the instance to this object is stored\n '
return self.subject_name<|docstring|>Returns the subjects name, if any
This is useful is the instance to this object is stored<|endoftext|> |
b123c0cc25398390e2dfb6904d276b7685181e41b20bebd8dce0ae4326c62371 | def set_pmap(self, new_pmap):
'\n Set the personalization map of the model\n '
self.pmap = new_pmap | Set the personalization map of the model | kmodel/personal_k_model.py | set_pmap | jmontp/Prosthetic_Adaptation | 0 | python | def set_pmap(self, new_pmap):
'\n \n '
self.pmap = new_pmap | def set_pmap(self, new_pmap):
'\n \n '
self.pmap = new_pmap<|docstring|>Set the personalization map of the model<|endoftext|> |
2c95a908154312eafe6f0bcf886fe70c9c68445cc94b9d7d5248a7ba7ede94c5 | def evaluate(self, input_data, use_personalized_fit=False, use_average_fit=False):
'\n Evaluate a Kronecker Model multiplied by \n the (average fit plus personalization map times gait fingerprint) \n which gives a scalar output\n\n In the default behavior, it will use the gait fi... | Evaluate a Kronecker Model multiplied by
the (average fit plus personalization map times gait fingerprint)
which gives a scalar output
In the default behavior, it will use the gait fingerprint in the input_dataset,
which is a numpy array that has a column corresponding to each model input and
then the gait ... | kmodel/personal_k_model.py | evaluate | jmontp/Prosthetic_Adaptation | 0 | python | def evaluate(self, input_data, use_personalized_fit=False, use_average_fit=False):
'\n Evaluate a Kronecker Model multiplied by \n the (average fit plus personalization map times gait fingerprint) \n which gives a scalar output\n\n In the default behavior, it will use the gait fi... | def evaluate(self, input_data, use_personalized_fit=False, use_average_fit=False):
'\n Evaluate a Kronecker Model multiplied by \n the (average fit plus personalization map times gait fingerprint) \n which gives a scalar output\n\n In the default behavior, it will use the gait fi... |
5f154e0336050bd81ca18534ff142dbef9e1a6c79401952e1869d76b24be6849 | def __init__(self, lb, ub):
' This method is used to create an instance of the Parameter class.\n\n Syntax: Parameter(lb,ub)\n\n Args:\n (1) lb: Lower bound value of the parameter.\n\n (2) ub: Upper bound value of the parameter.\n '
self.lb = lb
self.ub = ub
se... | This method is used to create an instance of the Parameter class.
Syntax: Parameter(lb,ub)
Args:
(1) lb: Lower bound value of the parameter.
(2) ub: Upper bound value of the parameter. | hydroutils/Parameter.py | __init__ | sopanpatil/hydroutils | 3 | python | def __init__(self, lb, ub):
' This method is used to create an instance of the Parameter class.\n\n Syntax: Parameter(lb,ub)\n\n Args:\n (1) lb: Lower bound value of the parameter.\n\n (2) ub: Upper bound value of the parameter.\n '
self.lb = lb
self.ub = ub
se... | def __init__(self, lb, ub):
' This method is used to create an instance of the Parameter class.\n\n Syntax: Parameter(lb,ub)\n\n Args:\n (1) lb: Lower bound value of the parameter.\n\n (2) ub: Upper bound value of the parameter.\n '
self.lb = lb
self.ub = ub
se... |
9f4e0256d36e1a27e95d94afbf9ffb2c5b09d95b9b28020bbdfacb1cbff5e4bc | def updatevelocity(self, param1, param2, w):
' This method is used by the PSO algorithm.'
x = numpy.random.uniform(0, 1)
y = numpy.random.uniform(0, 1)
c1 = 2
c2 = 2
self.velocity = (((w * self.velocity) + ((c1 * x) * (param1.value - self.value))) + ((c2 * y) * (param2.value - self.value))) | This method is used by the PSO algorithm. | hydroutils/Parameter.py | updatevelocity | sopanpatil/hydroutils | 3 | python | def updatevelocity(self, param1, param2, w):
' '
x = numpy.random.uniform(0, 1)
y = numpy.random.uniform(0, 1)
c1 = 2
c2 = 2
self.velocity = (((w * self.velocity) + ((c1 * x) * (param1.value - self.value))) + ((c2 * y) * (param2.value - self.value))) | def updatevelocity(self, param1, param2, w):
' '
x = numpy.random.uniform(0, 1)
y = numpy.random.uniform(0, 1)
c1 = 2
c2 = 2
self.velocity = (((w * self.velocity) + ((c1 * x) * (param1.value - self.value))) + ((c2 * y) * (param2.value - self.value)))<|docstring|>This method is used by the PSO al... |
72b57f4dbe0d1afe7638e5a324305ba8bcdb7e0908e3c0d9bbffc8b4eb2cffec | def updatevalue(self):
' This method is used by the PSO algorithm.'
sf = 0.9
if ((self.value + self.velocity) < self.lb):
self.velocity = (sf * (self.lb - self.value))
if ((self.value + self.velocity) > self.ub):
self.velocity = (sf * (self.ub - self.value))
self.value += self.veloci... | This method is used by the PSO algorithm. | hydroutils/Parameter.py | updatevalue | sopanpatil/hydroutils | 3 | python | def updatevalue(self):
' '
sf = 0.9
if ((self.value + self.velocity) < self.lb):
self.velocity = (sf * (self.lb - self.value))
if ((self.value + self.velocity) > self.ub):
self.velocity = (sf * (self.ub - self.value))
self.value += self.velocity | def updatevalue(self):
' '
sf = 0.9
if ((self.value + self.velocity) < self.lb):
self.velocity = (sf * (self.lb - self.value))
if ((self.value + self.velocity) > self.ub):
self.velocity = (sf * (self.ub - self.value))
self.value += self.velocity<|docstring|>This method is used by the... |
b93f980f03a8aa8f452aad89340ceef6ace40d0a01d9c89d821d10d3aefc9ccc | def machine_parameters(input_data):
'\n This function consider as a pre-defined database for the machine data\n it needs the machine capacity and returns all machine data\n '
machine_data = {'locking_force': int(), 'injection_force': int(), 'plunger_diameter': [int(), int()], 'injection_speed_range': [... | This function consider as a pre-defined database for the machine data
it needs the machine capacity and returns all machine data | Cold Chamber HPDC/HPDC.py | machine_parameters | XecusM/HPDC | 0 | python | def machine_parameters(input_data):
'\n This function consider as a pre-defined database for the machine data\n it needs the machine capacity and returns all machine data\n '
machine_data = {'locking_force': int(), 'injection_force': int(), 'plunger_diameter': [int(), int()], 'injection_speed_range': [... | def machine_parameters(input_data):
'\n This function consider as a pre-defined database for the machine data\n it needs the machine capacity and returns all machine data\n '
machine_data = {'locking_force': int(), 'injection_force': int(), 'plunger_diameter': [int(), int()], 'injection_speed_range': [... |
a599bbbcb8ddbf77c6c1e3b0739596e963766af924e8a21f3ba4e53099602888 | def part_paramters(input_data):
'\n This function is to calculate the part volume, projection area and maximum gate width allowed\n The fuction needs part paramters and shape to return the calculated data\n '
part_data = {'volume': float(), 'projection_area': float(), 'max_gate_width': floa... | This function is to calculate the part volume, projection area and maximum gate width allowed
The fuction needs part paramters and shape to return the calculated data | Cold Chamber HPDC/HPDC.py | part_paramters | XecusM/HPDC | 0 | python | def part_paramters(input_data):
'\n This function is to calculate the part volume, projection area and maximum gate width allowed\n The fuction needs part paramters and shape to return the calculated data\n '
part_data = {'volume': float(), 'projection_area': float(), 'max_gate_width': floa... | def part_paramters(input_data):
'\n This function is to calculate the part volume, projection area and maximum gate width allowed\n The fuction needs part paramters and shape to return the calculated data\n '
part_data = {'volume': float(), 'projection_area': float(), 'max_gate_width': floa... |
128a9823cccb0c0387218b8f388b29bea8996ba93739fe6c4d80c130db300c2e | def intial_parameters(input_data, part_data):
'\n This function for set the intial parameters for the gating system calculation\n '
intial_data = {'s': float(), 'gate_velocity': float(), 'k': float(), 'z': float(), 'cd': [float(), float()], 'overflow_gateland': float(), 'overflow_gatelength': float(), 'ov... | This function for set the intial parameters for the gating system calculation | Cold Chamber HPDC/HPDC.py | intial_parameters | XecusM/HPDC | 0 | python | def intial_parameters(input_data, part_data):
'\n \n '
intial_data = {'s': float(), 'gate_velocity': float(), 'k': float(), 'z': float(), 'cd': [float(), float()], 'overflow_gateland': float(), 'overflow_gatelength': float(), 'overflow_gateheight': float(), 'overflow_volume': float(), 'vent_height': float... | def intial_parameters(input_data, part_data):
'\n \n '
intial_data = {'s': float(), 'gate_velocity': float(), 'k': float(), 'z': float(), 'cd': [float(), float()], 'overflow_gateland': float(), 'overflow_gatelength': float(), 'overflow_gateheight': float(), 'overflow_volume': float(), 'vent_height': float... |
83f317d1940fb5cb0a024672b7bf11ed6b8dc1506a8c42f9988085ae1307d282 | def cavities_numbers(intial_data, part_data, machine_data):
'\n This function to calculate maximum number of cavities allowed for the part data and selected machine\n '
cavity_data = {'max_filling_time': float(), 'max_ncavities': [int(), int(), int()]}
cavity_data['max_filling_time'] = ((intial_data['... | This function to calculate maximum number of cavities allowed for the part data and selected machine | Cold Chamber HPDC/HPDC.py | cavities_numbers | XecusM/HPDC | 0 | python | def cavities_numbers(intial_data, part_data, machine_data):
'\n \n '
cavity_data = {'max_filling_time': float(), 'max_ncavities': [int(), int(), int()]}
cavity_data['max_filling_time'] = ((intial_data['k'] * (((intial_data['metal_temp_gate'] - intial_data['min_metal_temp']) + (intial_data['s'] * intia... | def cavities_numbers(intial_data, part_data, machine_data):
'\n \n '
cavity_data = {'max_filling_time': float(), 'max_ncavities': [int(), int(), int()]}
cavity_data['max_filling_time'] = ((intial_data['k'] * (((intial_data['metal_temp_gate'] - intial_data['min_metal_temp']) + (intial_data['s'] * intia... |
f6e9e042a3c5e71d2e4921f61d5d94554d423dd632f17ae08d8b9d9caa08ddf5 | def gate_area(intial_data, part_data, cavity_data, input_data):
'\n This function is to calculate the gate area with its dimensions for both cavity inlet and overflow\n '
gate_data = {'gate_area': float(), 'gate_height': float(), 'gate_width': float(), 'overflow_gatearea': float(), 'overflow_gatewidth': f... | This function is to calculate the gate area with its dimensions for both cavity inlet and overflow | Cold Chamber HPDC/HPDC.py | gate_area | XecusM/HPDC | 0 | python | def gate_area(intial_data, part_data, cavity_data, input_data):
'\n \n '
gate_data = {'gate_area': float(), 'gate_height': float(), 'gate_width': float(), 'overflow_gatearea': float(), 'overflow_gatewidth': float(), 'overflow_width': float(), 'overflow_height': float(), 'overflow_length': float()}
if ... | def gate_area(intial_data, part_data, cavity_data, input_data):
'\n \n '
gate_data = {'gate_area': float(), 'gate_height': float(), 'gate_width': float(), 'overflow_gatearea': float(), 'overflow_gatewidth': float(), 'overflow_width': float(), 'overflow_height': float(), 'overflow_length': float()}
if ... |
2eb8677b68b3d386c38e2eaba8e814dde7080c11d9c81e701a866e1a0e7235b7 | def runner_area(intial_data, gate_data, input_data):
'\n This function for calculating runner dimensions\n '
runner_data = {'runner_area': float(), 'runner_height': float(), 'runner_width': float()}
if (input_data['material'] == 'AlSi12 (230)'):
if ((10 <= intial_data['flow_angle']) and (intia... | This function for calculating runner dimensions | Cold Chamber HPDC/HPDC.py | runner_area | XecusM/HPDC | 0 | python | def runner_area(intial_data, gate_data, input_data):
'\n \n '
runner_data = {'runner_area': float(), 'runner_height': float(), 'runner_width': float()}
if (input_data['material'] == 'AlSi12 (230)'):
if ((10 <= intial_data['flow_angle']) and (intial_data['flow_angle'] <= 35)):
runne... | def runner_area(intial_data, gate_data, input_data):
'\n \n '
runner_data = {'runner_area': float(), 'runner_height': float(), 'runner_width': float()}
if (input_data['material'] == 'AlSi12 (230)'):
if ((10 <= intial_data['flow_angle']) and (intial_data['flow_angle'] <= 35)):
runne... |
74af6b7f1b5575083aab461bd12444ecbbb0a92f17c7d5ed92f4cbff64e0946e | def gate_sections(gate_data, runner_data):
'\n This function is to give a detailed dimensions for the gate\n '
gate_details = {'areas': [float(), float(), float(), float(), float(), float(), float(), float()], 'heights': [float(), float(), float(), float(), float(), float(), float(), float()], 'widths': [... | This function is to give a detailed dimensions for the gate | Cold Chamber HPDC/HPDC.py | gate_sections | XecusM/HPDC | 0 | python | def gate_sections(gate_data, runner_data):
'\n \n '
gate_details = {'areas': [float(), float(), float(), float(), float(), float(), float(), float()], 'heights': [float(), float(), float(), float(), float(), float(), float(), float()], 'widths': [float(), float(), float(), float(), float(), float(), float... | def gate_sections(gate_data, runner_data):
'\n \n '
gate_details = {'areas': [float(), float(), float(), float(), float(), float(), float(), float()], 'heights': [float(), float(), float(), float(), float(), float(), float(), float()], 'widths': [float(), float(), float(), float(), float(), float(), float... |
1c78253b7cdb48ccc701fa194f83c712debe069afaa72df7ed40cc0ef6df013c | def gates_pos(input_data):
'\n This function is to locate the optimum location for gate and overflow\n By calculate the optimum GSS and OSS\n '
gates_positions = {'gss': float(), 'oss': float(), 'porosity': float()}
pos_array = [[float(), float(), float()], [float(), float(), float()]]
if (inpu... | This function is to locate the optimum location for gate and overflow
By calculate the optimum GSS and OSS | Cold Chamber HPDC/HPDC.py | gates_pos | XecusM/HPDC | 0 | python | def gates_pos(input_data):
'\n This function is to locate the optimum location for gate and overflow\n By calculate the optimum GSS and OSS\n '
gates_positions = {'gss': float(), 'oss': float(), 'porosity': float()}
pos_array = [[float(), float(), float()], [float(), float(), float()]]
if (inpu... | def gates_pos(input_data):
'\n This function is to locate the optimum location for gate and overflow\n By calculate the optimum GSS and OSS\n '
gates_positions = {'gss': float(), 'oss': float(), 'porosity': float()}
pos_array = [[float(), float(), float()], [float(), float(), float()]]
if (inpu... |
168874d538d5c30ce78e3d2a45e6a48397f26e6069328cba176c0bb83e6a0b48 | def cache(cachetype: spec.CachetypeSpec, add_cache_args: bool=True, **cache_kwargs) -> typing.Callable[([typing.Callable[(P, R)]], typing.Callable[(P, R)])]:
"decorate function to add a cache\n\n ## Added Function Args\n - these parameters are added to every decorated function:\n - cache_load: bool of ... | decorate function to add a cache
## Added Function Args
- these parameters are added to every decorated function:
- cache_load: bool of whether to load the result from cache
- cache_save: bool of whether to save the result to cache
- cache_verbose: bool of whether to print cache usage information
- avoid a... | toolcache/cache_decorator.py | cache | sslivkoff/toolcache | 0 | python | def cache(cachetype: spec.CachetypeSpec, add_cache_args: bool=True, **cache_kwargs) -> typing.Callable[([typing.Callable[(P, R)]], typing.Callable[(P, R)])]:
"decorate function to add a cache\n\n ## Added Function Args\n - these parameters are added to every decorated function:\n - cache_load: bool of ... | def cache(cachetype: spec.CachetypeSpec, add_cache_args: bool=True, **cache_kwargs) -> typing.Callable[([typing.Callable[(P, R)]], typing.Callable[(P, R)])]:
"decorate function to add a cache\n\n ## Added Function Args\n - these parameters are added to every decorated function:\n - cache_load: bool of ... |
2e08dee88921784aaf886353a9254f771ad265bcc43c1f0214a32f165cc73cbc | def _create_new_f(old_f: typing.Callable[(P, R)], cache_instance, add_cache_args) -> typing.Callable[(P, R)]:
'create new function by decorating old_f to use cache_instance\n\n ## Inputs\n - old_f: function to be decorated\n - cache_instance: BaseCache instance for function to use\n - add_cache_args: bo... | create new function by decorating old_f to use cache_instance
## Inputs
- old_f: function to be decorated
- cache_instance: BaseCache instance for function to use
- add_cache_args: bool of whether to add cache control args to function | toolcache/cache_decorator.py | _create_new_f | sslivkoff/toolcache | 0 | python | def _create_new_f(old_f: typing.Callable[(P, R)], cache_instance, add_cache_args) -> typing.Callable[(P, R)]:
'create new function by decorating old_f to use cache_instance\n\n ## Inputs\n - old_f: function to be decorated\n - cache_instance: BaseCache instance for function to use\n - add_cache_args: bo... | def _create_new_f(old_f: typing.Callable[(P, R)], cache_instance, add_cache_args) -> typing.Callable[(P, R)]:
'create new function by decorating old_f to use cache_instance\n\n ## Inputs\n - old_f: function to be decorated\n - cache_instance: BaseCache instance for function to use\n - add_cache_args: bo... |
56d59f83ae9bf497dcaffa5aa9047f465703feb9e3af716865b5f7047c8565a9 | def execute_with_cache(old_f, args, kwargs, cache_instance, cache_load=True, cache_save=True, cache_verbose=None):
'execute old_f with specified inputs and use cache if appropriate\n\n ## Inputs\n - old_f: function to call\n - args: list of input args\n - kwargs: dict of input kwargs\n - cache_instan... | execute old_f with specified inputs and use cache if appropriate
## Inputs
- old_f: function to call
- args: list of input args
- kwargs: dict of input kwargs
- cache_instance: BaseCache instance to use
- cache_load: bool of whether to attempt to load from cache
- cache_save: bool of whether to save output to cache
- ... | toolcache/cache_decorator.py | execute_with_cache | sslivkoff/toolcache | 0 | python | def execute_with_cache(old_f, args, kwargs, cache_instance, cache_load=True, cache_save=True, cache_verbose=None):
'execute old_f with specified inputs and use cache if appropriate\n\n ## Inputs\n - old_f: function to call\n - args: list of input args\n - kwargs: dict of input kwargs\n - cache_instan... | def execute_with_cache(old_f, args, kwargs, cache_instance, cache_load=True, cache_save=True, cache_verbose=None):
'execute old_f with specified inputs and use cache if appropriate\n\n ## Inputs\n - old_f: function to call\n - args: list of input args\n - kwargs: dict of input kwargs\n - cache_instan... |
c1cceb10e8f0fc2bef8a0f1d39226a33a8b7d7eece0bb6e2c6875131c671cec0 | def spawn(self, path, args, env=None):
'Spawn the task.\n \n There appears to be two calls, the first in this something undocumented\n is done to the terminal and the sceond to actually start the function\n Returns tid\n path path to executable\n args arguments to task... | Spawn the task.
There appears to be two calls, the first in this something undocumented
is done to the terminal and the sceond to actually start the function
Returns tid
path path to executable
args arguments to task
env environment dictionary
` | ObitSystem/ObitTalk/python/Proxy/Task.py | spawn | sarrvesh/Obit | 5 | python | def spawn(self, path, args, env=None):
'Spawn the task.\n \n There appears to be two calls, the first in this something undocumented\n is done to the terminal and the sceond to actually start the function\n Returns tid\n path path to executable\n args arguments to task... | def spawn(self, path, args, env=None):
'Spawn the task.\n \n There appears to be two calls, the first in this something undocumented\n is done to the terminal and the sceond to actually start the function\n Returns tid\n path path to executable\n args arguments to task... |
4466cf6bbd95fc32432903cb1f25eafbda5ec3a0f675b74697ed7ecbaa5e0b18 | def finished(self, tid):
'Check whether the task has finished.\n \n tid = Task id in pid table of process\n '
time.sleep(0.1)
return (self._pid[tid] == 0) | Check whether the task has finished.
tid = Task id in pid table of process | ObitSystem/ObitTalk/python/Proxy/Task.py | finished | sarrvesh/Obit | 5 | python | def finished(self, tid):
'Check whether the task has finished.\n \n tid = Task id in pid table of process\n '
time.sleep(0.1)
return (self._pid[tid] == 0) | def finished(self, tid):
'Check whether the task has finished.\n \n tid = Task id in pid table of process\n '
time.sleep(0.1)
return (self._pid[tid] == 0)<|docstring|>Check whether the task has finished.
tid = Task id in pid table of process<|endoftext|> |
eed139cc9a0ddf16d9d7962b440b4c684fcd12fd478105cb2765940b7908ba04 | def messages(self, tid):
'Return task messages\n \n Returns list of messages\n tid = Task id in pid table of process\n '
try:
(iwtd, owtd, ewtd) = select.select([tid], [], [], 0.25)
except:
return []
if (tid in iwtd):
try:
messages = os.r... | Return task messages
Returns list of messages
tid = Task id in pid table of process | ObitSystem/ObitTalk/python/Proxy/Task.py | messages | sarrvesh/Obit | 5 | python | def messages(self, tid):
'Return task messages\n \n Returns list of messages\n tid = Task id in pid table of process\n '
try:
(iwtd, owtd, ewtd) = select.select([tid], [], [], 0.25)
except:
return []
if (tid in iwtd):
try:
messages = os.r... | def messages(self, tid):
'Return task messages\n \n Returns list of messages\n tid = Task id in pid table of process\n '
try:
(iwtd, owtd, ewtd) = select.select([tid], [], [], 0.25)
except:
return []
if (tid in iwtd):
try:
messages = os.r... |
4bb48406dfcbbde6c6e5ecc65b424b000fc868148c783696ef3d0f40da2d0586 | def feed(self, tid, banana):
"Feed the task a BANANA.\n \n Pass a message to a running task's sdtin\n tid = Task id in pid table of process\n bananna = text message to pass to task input\n "
os.write(tid, six.ensure_binary(banana))
pass | Feed the task a BANANA.
Pass a message to a running task's sdtin
tid = Task id in pid table of process
bananna = text message to pass to task input | ObitSystem/ObitTalk/python/Proxy/Task.py | feed | sarrvesh/Obit | 5 | python | def feed(self, tid, banana):
"Feed the task a BANANA.\n \n Pass a message to a running task's sdtin\n tid = Task id in pid table of process\n bananna = text message to pass to task input\n "
os.write(tid, six.ensure_binary(banana))
pass | def feed(self, tid, banana):
"Feed the task a BANANA.\n \n Pass a message to a running task's sdtin\n tid = Task id in pid table of process\n bananna = text message to pass to task input\n "
os.write(tid, six.ensure_binary(banana))
pass<|docstring|>Feed the task a BA... |
01d5d1ea364cbedbc37c0a9f7340fcbf730e5cd914595548933944a4f5f8efdf | def wait(self, tid):
'Wait for the task to finish.\n \n tid = Task id in pid table of process\n '
assert self.finished(tid)
del self._pid[tid]
os.close(tid)
return | Wait for the task to finish.
tid = Task id in pid table of process | ObitSystem/ObitTalk/python/Proxy/Task.py | wait | sarrvesh/Obit | 5 | python | def wait(self, tid):
'Wait for the task to finish.\n \n tid = Task id in pid table of process\n '
assert self.finished(tid)
del self._pid[tid]
os.close(tid)
return | def wait(self, tid):
'Wait for the task to finish.\n \n tid = Task id in pid table of process\n '
assert self.finished(tid)
del self._pid[tid]
os.close(tid)
return<|docstring|>Wait for the task to finish.
tid = Task id in pid table of process<|endoftext|> |
306a82ae2158e81d109a2c8e1e4ac5f0f4f4538596999d31d8e2bc09244fb2de | def abort(self, tid, sig=signal.SIGKILL):
'Abort the task\n \n Calls abort function for task tid\n None return value\n tid = Task id in pid table of process to be terminated\n sig = signal to sent to the task\n '
os.kill(self._pid[tid], sig)
del self._pid[tid]
... | Abort the task
Calls abort function for task tid
None return value
tid = Task id in pid table of process to be terminated
sig = signal to sent to the task | ObitSystem/ObitTalk/python/Proxy/Task.py | abort | sarrvesh/Obit | 5 | python | def abort(self, tid, sig=signal.SIGKILL):
'Abort the task\n \n Calls abort function for task tid\n None return value\n tid = Task id in pid table of process to be terminated\n sig = signal to sent to the task\n '
os.kill(self._pid[tid], sig)
del self._pid[tid]
... | def abort(self, tid, sig=signal.SIGKILL):
'Abort the task\n \n Calls abort function for task tid\n None return value\n tid = Task id in pid table of process to be terminated\n sig = signal to sent to the task\n '
os.kill(self._pid[tid], sig)
del self._pid[tid]
... |
04619f174b7624b9d67f88a2fc8e80ea65cfe4cb586ed809e65902fc49cb6780 | def mouseMoveEvent(self, ev):
'Update line with last point and current coordinates.'
try:
if QT5:
pos = self.transformPos(ev.localPos())
else:
pos = self.transformPos(ev.posF())
except AttributeError:
return
self.prevMovePoint = pos
self.restoreCursor(... | Update line with last point and current coordinates. | labelme/widgets/canvas.py | mouseMoveEvent | airsimonhan/label-for-dicom-ima | 2 | python | def mouseMoveEvent(self, ev):
try:
if QT5:
pos = self.transformPos(ev.localPos())
else:
pos = self.transformPos(ev.posF())
except AttributeError:
return
self.prevMovePoint = pos
self.restoreCursor()
if self.drawing():
self.line.shape_type ... | def mouseMoveEvent(self, ev):
try:
if QT5:
pos = self.transformPos(ev.localPos())
else:
pos = self.transformPos(ev.posF())
except AttributeError:
return
self.prevMovePoint = pos
self.restoreCursor()
if self.drawing():
self.line.shape_type ... |
748faab2506b5618919d6abc20532b498c22b8e4a98a42dc335898a221b927f6 | def selectShapePoint(self, point, multiple_selection_mode):
'Select the first shape created which contains this point.'
if self.selectedVertex():
(index, shape) = (self.hVertex, self.hShape)
shape.highlightVertex(index, shape.MOVE_VERTEX)
else:
for shape in reversed(self.shapes):
... | Select the first shape created which contains this point. | labelme/widgets/canvas.py | selectShapePoint | airsimonhan/label-for-dicom-ima | 2 | python | def selectShapePoint(self, point, multiple_selection_mode):
if self.selectedVertex():
(index, shape) = (self.hVertex, self.hShape)
shape.highlightVertex(index, shape.MOVE_VERTEX)
else:
for shape in reversed(self.shapes):
if (self.isVisible(shape) and shape.containsPoint(... | def selectShapePoint(self, point, multiple_selection_mode):
if self.selectedVertex():
(index, shape) = (self.hVertex, self.hShape)
shape.highlightVertex(index, shape.MOVE_VERTEX)
else:
for shape in reversed(self.shapes):
if (self.isVisible(shape) and shape.containsPoint(... |
21f446172b1b58895bb35ef3456df0874c447e728f9445dd53819cac05e804ad | def transformPos(self, point):
'Convert from widget-logical coordinates to painter-logical ones.'
return ((point / self.scale) - self.offsetToCenter()) | Convert from widget-logical coordinates to painter-logical ones. | labelme/widgets/canvas.py | transformPos | airsimonhan/label-for-dicom-ima | 2 | python | def transformPos(self, point):
return ((point / self.scale) - self.offsetToCenter()) | def transformPos(self, point):
return ((point / self.scale) - self.offsetToCenter())<|docstring|>Convert from widget-logical coordinates to painter-logical ones.<|endoftext|> |
eda43ed229eb42ad06bd57b0c6aa09df7d9f173eebce89663bebc58fdbd1f8d4 | def intersectingEdges(self, point1, point2, points):
"Find intersecting edges.\n\n For each edge formed by `points', yield the intersection\n with the line segment `(x1,y1) - (x2,y2)`, if it exists.\n Also return the distance of `(x2,y2)' to the middle of the\n edge along with its index,... | Find intersecting edges.
For each edge formed by `points', yield the intersection
with the line segment `(x1,y1) - (x2,y2)`, if it exists.
Also return the distance of `(x2,y2)' to the middle of the
edge along with its index, so that the one closest can be chosen. | labelme/widgets/canvas.py | intersectingEdges | airsimonhan/label-for-dicom-ima | 2 | python | def intersectingEdges(self, point1, point2, points):
"Find intersecting edges.\n\n For each edge formed by `points', yield the intersection\n with the line segment `(x1,y1) - (x2,y2)`, if it exists.\n Also return the distance of `(x2,y2)' to the middle of the\n edge along with its index,... | def intersectingEdges(self, point1, point2, points):
"Find intersecting edges.\n\n For each edge formed by `points', yield the intersection\n with the line segment `(x1,y1) - (x2,y2)`, if it exists.\n Also return the distance of `(x2,y2)' to the middle of the\n edge along with its index,... |
a5282ec38a2b83999ffd504bcea737c8aca73884403e03a2b47098a44a53535d | def submit_job(self, post_data, model):
'\n Post the contents of post_data to the API endpoint\n <model>/prediction.\n\n Returns the task id used to poll the job.\n\n Throws AFLOWmlError if invalid model, HTTPError or invalid response.\n '
if (model not in self.supported_model... | Post the contents of post_data to the API endpoint
<model>/prediction.
Returns the task id used to poll the job.
Throws AFLOWmlError if invalid model, HTTPError or invalid response. | src/data/aflowml/client.py | submit_job | gregwinther/predicting-solid-state-qubit-material-hosts | 3 | python | def submit_job(self, post_data, model):
'\n Post the contents of post_data to the API endpoint\n <model>/prediction.\n\n Returns the task id used to poll the job.\n\n Throws AFLOWmlError if invalid model, HTTPError or invalid response.\n '
if (model not in self.supported_model... | def submit_job(self, post_data, model):
'\n Post the contents of post_data to the API endpoint\n <model>/prediction.\n\n Returns the task id used to poll the job.\n\n Throws AFLOWmlError if invalid model, HTTPError or invalid response.\n '
if (model not in self.supported_model... |
adac352409d7301c328b792b382076a8795af6c4a65924fc94debab394172e31 | def poll_job(self, job_id, fields=[]):
'\n From the job id, polls the API enpoint /prediction/result/<job_id> to\n check the status of the job. Polls until status = SUCCESS.\n\n Returns prediction object as a dictionary.\n\n Throws AFLOWmlAPIError if unable to poll job, status = FAILURE,... | From the job id, polls the API enpoint /prediction/result/<job_id> to
check the status of the job. Polls until status = SUCCESS.
Returns prediction object as a dictionary.
Throws AFLOWmlAPIError if unable to poll job, status = FAILURE,
HTTPError or invalid response. | src/data/aflowml/client.py | poll_job | gregwinther/predicting-solid-state-qubit-material-hosts | 3 | python | def poll_job(self, job_id, fields=[]):
'\n From the job id, polls the API enpoint /prediction/result/<job_id> to\n check the status of the job. Polls until status = SUCCESS.\n\n Returns prediction object as a dictionary.\n\n Throws AFLOWmlAPIError if unable to poll job, status = FAILURE,... | def poll_job(self, job_id, fields=[]):
'\n From the job id, polls the API enpoint /prediction/result/<job_id> to\n check the status of the job. Polls until status = SUCCESS.\n\n Returns prediction object as a dictionary.\n\n Throws AFLOWmlAPIError if unable to poll job, status = FAILURE,... |
71145597e36bb0033a6ee5fc5657394b04d4373da90915a1fd88de723badf317 | def get_prediction(self, post_data, model, fields=[]):
'\n Calls submit_job and poll_job methods to get a prediction.\n\n Takes the contents of post_data and the model as arguements.\n\n Returns the prediction results as a dictionary.\n '
job_id = self.submit_job(post_data, model)
... | Calls submit_job and poll_job methods to get a prediction.
Takes the contents of post_data and the model as arguements.
Returns the prediction results as a dictionary. | src/data/aflowml/client.py | get_prediction | gregwinther/predicting-solid-state-qubit-material-hosts | 3 | python | def get_prediction(self, post_data, model, fields=[]):
'\n Calls submit_job and poll_job methods to get a prediction.\n\n Takes the contents of post_data and the model as arguements.\n\n Returns the prediction results as a dictionary.\n '
job_id = self.submit_job(post_data, model)
... | def get_prediction(self, post_data, model, fields=[]):
'\n Calls submit_job and poll_job methods to get a prediction.\n\n Takes the contents of post_data and the model as arguements.\n\n Returns the prediction results as a dictionary.\n '
job_id = self.submit_job(post_data, model)
... |
400e89eaaabb22d9da2b908b81d605ffb352bc9fb67595006a5997f781c60276 | @property
def proxy(self):
'\n 强制不走代理,失败原因未知,需要工具测试下\n '
return None | 强制不走代理,失败原因未知,需要工具测试下 | dags/rockflow/common/nasdaq.py | proxy | day253/airflow-dags | 2 | python | @property
def proxy(self):
'\n \n '
return None | @property
def proxy(self):
'\n \n '
return None<|docstring|>强制不走代理,失败原因未知,需要工具测试下<|endoftext|> |
08c7b2edec12d170dfb067da8b33bea52b166c4522de990d09eff0a206add8db | def get_url(self) -> yarl.URL:
'Attempt to get a URL.'
return self.url | Attempt to get a URL. | genshin/client/routes.py | get_url | thesadru/genshin.py | 63 | python | def get_url(self) -> yarl.URL:
return self.url | def get_url(self) -> yarl.URL:
return self.url<|docstring|>Attempt to get a URL.<|endoftext|> |
a459917e90f912183830c37c6175d7f0a683b71e98f6ec434fa8d1bb3e4166b1 | def get_url(self, region: types.Region) -> yarl.URL:
'Attempt to get a URL.'
if (not self.urls[region]):
raise RuntimeError(f'URL does not support {region.name} region.')
return self.urls[region] | Attempt to get a URL. | genshin/client/routes.py | get_url | thesadru/genshin.py | 63 | python | def get_url(self, region: types.Region) -> yarl.URL:
if (not self.urls[region]):
raise RuntimeError(f'URL does not support {region.name} region.')
return self.urls[region] | def get_url(self, region: types.Region) -> yarl.URL:
if (not self.urls[region]):
raise RuntimeError(f'URL does not support {region.name} region.')
return self.urls[region]<|docstring|>Attempt to get a URL.<|endoftext|> |
cafd5e8900e97ec8bc46e3477cde562ce666a524cb768bc6940fd18b34ed5174 | def get_url(self, region: types.Region, game: types.Game) -> yarl.URL:
'Attempt to get a URL.'
if (not self.urls[region]):
raise RuntimeError(f'URL does not support {region.name} region.')
if (not self.urls[region][game]):
raise RuntimeError(f'URL does not support {game.name} game for {regio... | Attempt to get a URL. | genshin/client/routes.py | get_url | thesadru/genshin.py | 63 | python | def get_url(self, region: types.Region, game: types.Game) -> yarl.URL:
if (not self.urls[region]):
raise RuntimeError(f'URL does not support {region.name} region.')
if (not self.urls[region][game]):
raise RuntimeError(f'URL does not support {game.name} game for {region.name} region.')
r... | def get_url(self, region: types.Region, game: types.Game) -> yarl.URL:
if (not self.urls[region]):
raise RuntimeError(f'URL does not support {region.name} region.')
if (not self.urls[region][game]):
raise RuntimeError(f'URL does not support {game.name} game for {region.name} region.')
r... |
dc6eb1462d2cb82631f91088fab0b6d23067edaf463000275e1e2d9be262858c | def __call__(self, *args, **kwargs):
'Call the operation with the given args and kwargs.\n\n :rtype: zeep.xsd.CompoundValue\n\n '
if self._proxy._client._default_soapheaders:
op_soapheaders = kwargs.get('_soapheaders')
if op_soapheaders:
soapheaders = copy.deepcopy(self... | Call the operation with the given args and kwargs.
:rtype: zeep.xsd.CompoundValue | src/zeep/proxy.py | __call__ | Alireza2n/python-zeep | 3 | python | def __call__(self, *args, **kwargs):
'Call the operation with the given args and kwargs.\n\n :rtype: zeep.xsd.CompoundValue\n\n '
if self._proxy._client._default_soapheaders:
op_soapheaders = kwargs.get('_soapheaders')
if op_soapheaders:
soapheaders = copy.deepcopy(self... | def __call__(self, *args, **kwargs):
'Call the operation with the given args and kwargs.\n\n :rtype: zeep.xsd.CompoundValue\n\n '
if self._proxy._client._default_soapheaders:
op_soapheaders = kwargs.get('_soapheaders')
if op_soapheaders:
soapheaders = copy.deepcopy(self... |
edc43622c28e41cfe1861c608296226048544066b1bc4563ca3cb6b42c040e30 | def __getattr__(self, key):
'Return the OperationProxy for the given key.\n\n :rtype: OperationProxy()\n\n '
return self[key] | Return the OperationProxy for the given key.
:rtype: OperationProxy() | src/zeep/proxy.py | __getattr__ | Alireza2n/python-zeep | 3 | python | def __getattr__(self, key):
'Return the OperationProxy for the given key.\n\n :rtype: OperationProxy()\n\n '
return self[key] | def __getattr__(self, key):
'Return the OperationProxy for the given key.\n\n :rtype: OperationProxy()\n\n '
return self[key]<|docstring|>Return the OperationProxy for the given key.
:rtype: OperationProxy()<|endoftext|> |
faf5eff3c28d1a9d90b0c9022b1d7888413d088e2e37bb6dfdbb60d8c57a5270 | def __getitem__(self, key):
'Return the OperationProxy for the given key.\n\n :rtype: OperationProxy()\n\n '
try:
return self._operations[key]
except KeyError:
raise AttributeError(('Service has no operation %r' % key)) | Return the OperationProxy for the given key.
:rtype: OperationProxy() | src/zeep/proxy.py | __getitem__ | Alireza2n/python-zeep | 3 | python | def __getitem__(self, key):
'Return the OperationProxy for the given key.\n\n :rtype: OperationProxy()\n\n '
try:
return self._operations[key]
except KeyError:
raise AttributeError(('Service has no operation %r' % key)) | def __getitem__(self, key):
'Return the OperationProxy for the given key.\n\n :rtype: OperationProxy()\n\n '
try:
return self._operations[key]
except KeyError:
raise AttributeError(('Service has no operation %r' % key))<|docstring|>Return the OperationProxy for the given key.
... |
5290e08829ae4810c53338a1ad32a7170b4c835d6edfeff253aedd402a8e2363 | def __iter__(self):
' Return iterator over the services and their callables. '
return iter(self._operations.items()) | Return iterator over the services and their callables. | src/zeep/proxy.py | __iter__ | Alireza2n/python-zeep | 3 | python | def __iter__(self):
' '
return iter(self._operations.items()) | def __iter__(self):
' '
return iter(self._operations.items())<|docstring|>Return iterator over the services and their callables.<|endoftext|> |
9c29d5fc30a98b408d7b6319882366d61e889d23dbabb7c234b661d742fe6284 | def __dir__(self):
' Return the names of the operations. '
return list(itertools.chain(dir(super(ServiceProxy, self)), self._operations)) | Return the names of the operations. | src/zeep/proxy.py | __dir__ | Alireza2n/python-zeep | 3 | python | def __dir__(self):
' '
return list(itertools.chain(dir(super(ServiceProxy, self)), self._operations)) | def __dir__(self):
' '
return list(itertools.chain(dir(super(ServiceProxy, self)), self._operations))<|docstring|>Return the names of the operations.<|endoftext|> |
596e00738ce39efe6714a2340fe2e988d31ebda52eb42edf2848978e2026ba0d | def angle(a, b):
' Compute oriented angle (in degrees) between "up" axis and AB.\n a and b coordinates are from a top-left origin '
ab_vec = ((b[1] - a[1]), (a[0] - b[0]))
res = ((atan2(*ab_vec) * 180) / pi)
if (res < 0):
res += 360
return res | Compute oriented angle (in degrees) between "up" axis and AB.
a and b coordinates are from a top-left origin | day-10/part-1/thore.py | angle | TPXP/adventofcode-2019 | 8 | python | def angle(a, b):
' Compute oriented angle (in degrees) between "up" axis and AB.\n a and b coordinates are from a top-left origin '
ab_vec = ((b[1] - a[1]), (a[0] - b[0]))
res = ((atan2(*ab_vec) * 180) / pi)
if (res < 0):
res += 360
return res | def angle(a, b):
' Compute oriented angle (in degrees) between "up" axis and AB.\n a and b coordinates are from a top-left origin '
ab_vec = ((b[1] - a[1]), (a[0] - b[0]))
res = ((atan2(*ab_vec) * 180) / pi)
if (res < 0):
res += 360
return res<|docstring|>Compute oriented angle (in de... |
71841366c1146cdcfecc731ca8fb703238a3e622878b9869caae88ef4cca1abd | def __call__(self, *x):
'\n Evaluate the feature vector in the given raw input. If more than one\n element is passed, the raw input is concatenated before computing the\n features.\n\n Args:\n *x (list): the raw input.\n\n Returns:\n The features vector compu... | Evaluate the feature vector in the given raw input. If more than one
element is passed, the raw input is concatenated before computing the
features.
Args:
*x (list): the raw input.
Returns:
The features vector computed from the raw input. | mushroom_rl/features/_implementations/features_implementation.py | __call__ | rebeccaathar/mushroom-rl | 344 | python | def __call__(self, *x):
'\n Evaluate the feature vector in the given raw input. If more than one\n element is passed, the raw input is concatenated before computing the\n features.\n\n Args:\n *x (list): the raw input.\n\n Returns:\n The features vector compu... | def __call__(self, *x):
'\n Evaluate the feature vector in the given raw input. If more than one\n element is passed, the raw input is concatenated before computing the\n features.\n\n Args:\n *x (list): the raw input.\n\n Returns:\n The features vector compu... |
13fe9fa667156a9732bda7912ca256fbe66d2564455209675cba2da2972c56ec | @property
def size(self):
'\n Returns:\n The number of elements in the features vector.\n\n '
raise NotImplementedError | Returns:
The number of elements in the features vector. | mushroom_rl/features/_implementations/features_implementation.py | size | rebeccaathar/mushroom-rl | 344 | python | @property
def size(self):
'\n Returns:\n The number of elements in the features vector.\n\n '
raise NotImplementedError | @property
def size(self):
'\n Returns:\n The number of elements in the features vector.\n\n '
raise NotImplementedError<|docstring|>Returns:
The number of elements in the features vector.<|endoftext|> |
bf8b5a1e029abb6f00b7d50b1447689d06b2839674fdcf263a3e376f203dec43 | @classmethod
def make_tag_name(cls, name, _re_tag_name=re.compile('[A-Z]+[a-z]*')):
'Convert a tag name from CamelCase to lower-case-and-hyphens'
def repl(match):
return ('-' + match.group(0))
return _re_tag_name.sub(repl, name).strip('_-').lower() | Convert a tag name from CamelCase to lower-case-and-hyphens | moya/elements/elementbasemeta.py | make_tag_name | moyaproject/moya | 129 | python | @classmethod
def make_tag_name(cls, name, _re_tag_name=re.compile('[A-Z]+[a-z]*')):
def repl(match):
return ('-' + match.group(0))
return _re_tag_name.sub(repl, name).strip('_-').lower() | @classmethod
def make_tag_name(cls, name, _re_tag_name=re.compile('[A-Z]+[a-z]*')):
def repl(match):
return ('-' + match.group(0))
return _re_tag_name.sub(repl, name).strip('_-').lower()<|docstring|>Convert a tag name from CamelCase to lower-case-and-hyphens<|endoftext|> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.