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 |
|---|---|---|---|---|---|---|---|---|---|
7f549429bab90c7f617d8687c91aefb62fce23fa095358a1e5b6e2aed262f06c | @staticmethod
def _get_instance_collection(instance_name: str, nodes: List) -> Optional[bpy.types.Collection]:
"Get the 'instance collection' (container) for this asset."
for node in nodes:
if (not isinstance(node, bpy.types.Collection)):
continue
if (node.name == instance_name):
... | Get the 'instance collection' (container) for this asset. | pype/blender/plugin.py | _get_instance_collection | tokejepsen/pype | 0 | python | @staticmethod
def _get_instance_collection(instance_name: str, nodes: List) -> Optional[bpy.types.Collection]:
for node in nodes:
if (not isinstance(node, bpy.types.Collection)):
continue
if (node.name == instance_name):
return node
return None | @staticmethod
def _get_instance_collection(instance_name: str, nodes: List) -> Optional[bpy.types.Collection]:
for node in nodes:
if (not isinstance(node, bpy.types.Collection)):
continue
if (node.name == instance_name):
return node
return None<|docstring|>Get the 'i... |
2715de84dc4e78ffc7ce3aa60c18247180b39a18c7127d093152d254f42c6387 | @staticmethod
def _get_library_from_container(container: bpy.types.Collection) -> bpy.types.Library:
'Find the library file from the container.\n\n It traverses the objects from this collection, checks if there is only\n 1 library from which the objects come from and returns the library.\n\n Wa... | Find the library file from the container.
It traverses the objects from this collection, checks if there is only
1 library from which the objects come from and returns the library.
Warning:
No nested collections are supported at the moment! | pype/blender/plugin.py | _get_library_from_container | tokejepsen/pype | 0 | python | @staticmethod
def _get_library_from_container(container: bpy.types.Collection) -> bpy.types.Library:
'Find the library file from the container.\n\n It traverses the objects from this collection, checks if there is only\n 1 library from which the objects come from and returns the library.\n\n Wa... | @staticmethod
def _get_library_from_container(container: bpy.types.Collection) -> bpy.types.Library:
'Find the library file from the container.\n\n It traverses the objects from this collection, checks if there is only\n 1 library from which the objects come from and returns the library.\n\n Wa... |
95081a6580b84d2aaa0b1d1c6389a27ed6184baa714139c834a395cec7f09409 | def process_asset(self, context: dict, name: str, namespace: Optional[str]=None, options: Optional[Dict]=None):
'Must be implemented by a sub-class'
raise NotImplementedError('Must be implemented by a sub-class') | Must be implemented by a sub-class | pype/blender/plugin.py | process_asset | tokejepsen/pype | 0 | python | def process_asset(self, context: dict, name: str, namespace: Optional[str]=None, options: Optional[Dict]=None):
raise NotImplementedError() | def process_asset(self, context: dict, name: str, namespace: Optional[str]=None, options: Optional[Dict]=None):
raise NotImplementedError()<|docstring|>Must be implemented by a sub-class<|endoftext|> |
b5bc2ec7941e54ccb1fc85d0de1481d5d5ecd9c2a5d07ca1489c37de2a60b40f | def load(self, context: dict, name: Optional[str]=None, namespace: Optional[str]=None, options: Optional[Dict]=None) -> Optional[bpy.types.Collection]:
'Load asset via database\n\n Arguments:\n context: Full parenthood of representation to load\n name: Use pre-defined name\n ... | Load asset via database
Arguments:
context: Full parenthood of representation to load
name: Use pre-defined name
namespace: Use pre-defined namespace
options: Additional settings dictionary | pype/blender/plugin.py | load | tokejepsen/pype | 0 | python | def load(self, context: dict, name: Optional[str]=None, namespace: Optional[str]=None, options: Optional[Dict]=None) -> Optional[bpy.types.Collection]:
'Load asset via database\n\n Arguments:\n context: Full parenthood of representation to load\n name: Use pre-defined name\n ... | def load(self, context: dict, name: Optional[str]=None, namespace: Optional[str]=None, options: Optional[Dict]=None) -> Optional[bpy.types.Collection]:
'Load asset via database\n\n Arguments:\n context: Full parenthood of representation to load\n name: Use pre-defined name\n ... |
3b6325d8adc613f02efe8cabb681da69793c8dfa117ed457716ff72730ceb4d2 | def update(self, container: Dict, representation: Dict):
'Must be implemented by a sub-class'
raise NotImplementedError('Must be implemented by a sub-class') | Must be implemented by a sub-class | pype/blender/plugin.py | update | tokejepsen/pype | 0 | python | def update(self, container: Dict, representation: Dict):
raise NotImplementedError() | def update(self, container: Dict, representation: Dict):
raise NotImplementedError()<|docstring|>Must be implemented by a sub-class<|endoftext|> |
266f80fa3a7d90f62607d0a35d3faaf9f9104b6d95b14ab17362486786564fee | def remove(self, container: Dict) -> bool:
'Must be implemented by a sub-class'
raise NotImplementedError('Must be implemented by a sub-class') | Must be implemented by a sub-class | pype/blender/plugin.py | remove | tokejepsen/pype | 0 | python | def remove(self, container: Dict) -> bool:
raise NotImplementedError() | def remove(self, container: Dict) -> bool:
raise NotImplementedError()<|docstring|>Must be implemented by a sub-class<|endoftext|> |
c87723d0a3a15f7368e00948e8b326a6efc3fc4e1d1fe29b489bc1ad6573e04e | def __init__(self, otsi_config=None):
'TapiPhotonicMediaOtsiConnectivityServiceEndPointSpec - a model defined in OpenAPI\n\n :param otsi_config: The otsi_config of this TapiPhotonicMediaOtsiConnectivityServiceEndPointSpec. # noqa: E501\n :type otsi_config: TapiPhotonicMediaOtsiTerminationConfigPac\n ... | TapiPhotonicMediaOtsiConnectivityServiceEndPointSpec - a model defined in OpenAPI
:param otsi_config: The otsi_config of this TapiPhotonicMediaOtsiConnectivityServiceEndPointSpec. # noqa: E501
:type otsi_config: TapiPhotonicMediaOtsiTerminationConfigPac | RI/flask_server/tapi_server/models/tapi_photonic_media_otsi_connectivity_service_end_point_spec.py | __init__ | nigel-r-davis/TAPI | 57 | python | def __init__(self, otsi_config=None):
'TapiPhotonicMediaOtsiConnectivityServiceEndPointSpec - a model defined in OpenAPI\n\n :param otsi_config: The otsi_config of this TapiPhotonicMediaOtsiConnectivityServiceEndPointSpec. # noqa: E501\n :type otsi_config: TapiPhotonicMediaOtsiTerminationConfigPac\n ... | def __init__(self, otsi_config=None):
'TapiPhotonicMediaOtsiConnectivityServiceEndPointSpec - a model defined in OpenAPI\n\n :param otsi_config: The otsi_config of this TapiPhotonicMediaOtsiConnectivityServiceEndPointSpec. # noqa: E501\n :type otsi_config: TapiPhotonicMediaOtsiTerminationConfigPac\n ... |
fa3493948a427c0e5f5106eee8953c3915afe87f6361066f2688c1b1f9f5b01f | @classmethod
def from_dict(cls, dikt) -> 'TapiPhotonicMediaOtsiConnectivityServiceEndPointSpec':
'Returns the dict as a model\n\n :param dikt: A dict.\n :type: dict\n :return: The tapi.photonic.media.OtsiConnectivityServiceEndPointSpec of this TapiPhotonicMediaOtsiConnectivityServiceEndPointSpe... | Returns the dict as a model
:param dikt: A dict.
:type: dict
:return: The tapi.photonic.media.OtsiConnectivityServiceEndPointSpec of this TapiPhotonicMediaOtsiConnectivityServiceEndPointSpec. # noqa: E501
:rtype: TapiPhotonicMediaOtsiConnectivityServiceEndPointSpec | RI/flask_server/tapi_server/models/tapi_photonic_media_otsi_connectivity_service_end_point_spec.py | from_dict | nigel-r-davis/TAPI | 57 | python | @classmethod
def from_dict(cls, dikt) -> 'TapiPhotonicMediaOtsiConnectivityServiceEndPointSpec':
'Returns the dict as a model\n\n :param dikt: A dict.\n :type: dict\n :return: The tapi.photonic.media.OtsiConnectivityServiceEndPointSpec of this TapiPhotonicMediaOtsiConnectivityServiceEndPointSpe... | @classmethod
def from_dict(cls, dikt) -> 'TapiPhotonicMediaOtsiConnectivityServiceEndPointSpec':
'Returns the dict as a model\n\n :param dikt: A dict.\n :type: dict\n :return: The tapi.photonic.media.OtsiConnectivityServiceEndPointSpec of this TapiPhotonicMediaOtsiConnectivityServiceEndPointSpe... |
904c34114a98877c52f566fd40d240cb6012061d5f396518706fe7ebe0db31dc | @property
def otsi_config(self):
'Gets the otsi_config of this TapiPhotonicMediaOtsiConnectivityServiceEndPointSpec.\n\n\n :return: The otsi_config of this TapiPhotonicMediaOtsiConnectivityServiceEndPointSpec.\n :rtype: TapiPhotonicMediaOtsiTerminationConfigPac\n '
return self._otsi_config | Gets the otsi_config of this TapiPhotonicMediaOtsiConnectivityServiceEndPointSpec.
:return: The otsi_config of this TapiPhotonicMediaOtsiConnectivityServiceEndPointSpec.
:rtype: TapiPhotonicMediaOtsiTerminationConfigPac | RI/flask_server/tapi_server/models/tapi_photonic_media_otsi_connectivity_service_end_point_spec.py | otsi_config | nigel-r-davis/TAPI | 57 | python | @property
def otsi_config(self):
'Gets the otsi_config of this TapiPhotonicMediaOtsiConnectivityServiceEndPointSpec.\n\n\n :return: The otsi_config of this TapiPhotonicMediaOtsiConnectivityServiceEndPointSpec.\n :rtype: TapiPhotonicMediaOtsiTerminationConfigPac\n '
return self._otsi_config | @property
def otsi_config(self):
'Gets the otsi_config of this TapiPhotonicMediaOtsiConnectivityServiceEndPointSpec.\n\n\n :return: The otsi_config of this TapiPhotonicMediaOtsiConnectivityServiceEndPointSpec.\n :rtype: TapiPhotonicMediaOtsiTerminationConfigPac\n '
return self._otsi_config<... |
3352fc9c516d5238d8e7dbdd0690e70eb285d03d625ac2a863837fe49dc265ac | @otsi_config.setter
def otsi_config(self, otsi_config):
'Sets the otsi_config of this TapiPhotonicMediaOtsiConnectivityServiceEndPointSpec.\n\n\n :param otsi_config: The otsi_config of this TapiPhotonicMediaOtsiConnectivityServiceEndPointSpec.\n :type otsi_config: TapiPhotonicMediaOtsiTerminationConfi... | Sets the otsi_config of this TapiPhotonicMediaOtsiConnectivityServiceEndPointSpec.
:param otsi_config: The otsi_config of this TapiPhotonicMediaOtsiConnectivityServiceEndPointSpec.
:type otsi_config: TapiPhotonicMediaOtsiTerminationConfigPac | RI/flask_server/tapi_server/models/tapi_photonic_media_otsi_connectivity_service_end_point_spec.py | otsi_config | nigel-r-davis/TAPI | 57 | python | @otsi_config.setter
def otsi_config(self, otsi_config):
'Sets the otsi_config of this TapiPhotonicMediaOtsiConnectivityServiceEndPointSpec.\n\n\n :param otsi_config: The otsi_config of this TapiPhotonicMediaOtsiConnectivityServiceEndPointSpec.\n :type otsi_config: TapiPhotonicMediaOtsiTerminationConfi... | @otsi_config.setter
def otsi_config(self, otsi_config):
'Sets the otsi_config of this TapiPhotonicMediaOtsiConnectivityServiceEndPointSpec.\n\n\n :param otsi_config: The otsi_config of this TapiPhotonicMediaOtsiConnectivityServiceEndPointSpec.\n :type otsi_config: TapiPhotonicMediaOtsiTerminationConfi... |
8f54c46bff2611667cc9d0ab15cfd591ee53702fa2f5e6e44ced95f440c3793e | def prepare_img(self, img_list: List):
'\n How to concate the image from an image list\n '
raise NotImplementedError | How to concate the image from an image list | code/visualizer.py | prepare_img | TheShadow29/vognet-pytorch | 70 | python | def prepare_img(self, img_list: List):
'\n \n '
raise NotImplementedError | def prepare_img(self, img_list: List):
'\n \n '
raise NotImplementedError<|docstring|>How to concate the image from an image list<|endoftext|> |
17fd26c655471c0717c43e4405af67f3ed3eea572807dbac3589f47464da64ab | def extract_bbox_per_frame(self, preds):
'\n Obtain the bounding boxes for each frame\n '
raise NotImplementedError | Obtain the bounding boxes for each frame | code/visualizer.py | extract_bbox_per_frame | TheShadow29/vognet-pytorch | 70 | python | def extract_bbox_per_frame(self, preds):
'\n \n '
raise NotImplementedError | def extract_bbox_per_frame(self, preds):
'\n \n '
raise NotImplementedError<|docstring|>Obtain the bounding boxes for each frame<|endoftext|> |
5e252bdd7782319408de6a0f513ead62fe5d43ea7e4dde9303e0b2dd902eb412 | def __init__(self, width, height, aa=1):
'\n :param width and height: size of the window in pixels.\n\n :param aa: antialiasing level, a higher value will give better\n result but also slow down the animation. (aa=2 is recommended)\n '
pyglet.window.Window.__init__(self, width, h... | :param width and height: size of the window in pixels.
:param aa: antialiasing level, a higher value will give better
result but also slow down the animation. (aa=2 is recommended) | src/polytopes/example_wythoff_shader_animation.py | __init__ | GenerousMan/pywonderland | 1 | python | def __init__(self, width, height, aa=1):
'\n :param width and height: size of the window in pixels.\n\n :param aa: antialiasing level, a higher value will give better\n result but also slow down the animation. (aa=2 is recommended)\n '
pyglet.window.Window.__init__(self, width, h... | def __init__(self, width, height, aa=1):
'\n :param width and height: size of the window in pixels.\n\n :param aa: antialiasing level, a higher value will give better\n result but also slow down the animation. (aa=2 is recommended)\n '
pyglet.window.Window.__init__(self, width, h... |
33be351210205a6fdbe7110a9238faafa75ea48568f4bf73112364600dd43859 | def on_key_press(self, symbol, modifiers):
'Keyboard interface.\n '
if (symbol == key.ENTER):
self.save_screenshot()
if (symbol == key.ESCAPE):
pyglet.app.exit() | Keyboard interface. | src/polytopes/example_wythoff_shader_animation.py | on_key_press | GenerousMan/pywonderland | 1 | python | def on_key_press(self, symbol, modifiers):
'\n '
if (symbol == key.ENTER):
self.save_screenshot()
if (symbol == key.ESCAPE):
pyglet.app.exit() | def on_key_press(self, symbol, modifiers):
'\n '
if (symbol == key.ENTER):
self.save_screenshot()
if (symbol == key.ESCAPE):
pyglet.app.exit()<|docstring|>Keyboard interface.<|endoftext|> |
b0a69d4c7f734320cadb5456a5755f6b83ffd2eb6919ab28e7bb0b2699fef4b3 | def on_mouse_release(self, x, y, button, modifiers):
"Don't forget reset 'iMouse' when mouse is released.\n "
with self.shaderA:
self.shaderA.uniformf('iMouse', 0, 0, 0, 0) | Don't forget reset 'iMouse' when mouse is released. | src/polytopes/example_wythoff_shader_animation.py | on_mouse_release | GenerousMan/pywonderland | 1 | python | def on_mouse_release(self, x, y, button, modifiers):
"\n "
with self.shaderA:
self.shaderA.uniformf('iMouse', 0, 0, 0, 0) | def on_mouse_release(self, x, y, button, modifiers):
"\n "
with self.shaderA:
self.shaderA.uniformf('iMouse', 0, 0, 0, 0)<|docstring|>Don't forget reset 'iMouse' when mouse is released.<|endoftext|> |
297d3f42c39d4ab079ec3b06f39c371a1b14c89bd69f3535397740402ebce10d | @main.cli_group
@utils.ssh_command
@click.option('-w', '--server-id', multiple=True, default=[], help='Servers IDs to connect to. You can set this option multiple times.')
@click.option('-r', '--role-name', multiple=True, default=[], help='Role name in cluster. You can set this option multiple times. This option works ... | PDSH for decapod-admin.
pdsh allows user to execute commands on host batches in parallel
using SSH connection.
Please be noticed that -w flag is priority one, all other filters just
won't work at all.
If filter is not set, then it means, that all items in the scope will
be processed (if no role is set, then all role... | backend/admin/decapod_admin/pdsh.py | pdsh | angry-tony/ceph-lcm-decapod | 41 | python | @main.cli_group
@utils.ssh_command
@click.option('-w', '--server-id', multiple=True, default=[], help='Servers IDs to connect to. You can set this option multiple times.')
@click.option('-r', '--role-name', multiple=True, default=[], help='Role name in cluster. You can set this option multiple times. This option works ... | @main.cli_group
@utils.ssh_command
@click.option('-w', '--server-id', multiple=True, default=[], help='Servers IDs to connect to. You can set this option multiple times.')
@click.option('-r', '--role-name', multiple=True, default=[], help='Role name in cluster. You can set this option multiple times. This option works ... |
6a82ebbaad26af0ee5dbab98e1aaf766f60abb2a5aee490edf745d7678a38fca | @utils.command(pdsh, name='exec')
@click.option('-s', '--sudo', is_flag=True, help='Run command as sudo user.')
@click.argument('command', nargs=(- 1), required=True)
@click.pass_context
def execute(ctx, sudo, command):
'Execute command on remote machines.'
if sudo:
command = (['sudo', '-H', '-E', '-n',... | Execute command on remote machines. | backend/admin/decapod_admin/pdsh.py | execute | angry-tony/ceph-lcm-decapod | 41 | python | @utils.command(pdsh, name='exec')
@click.option('-s', '--sudo', is_flag=True, help='Run command as sudo user.')
@click.argument('command', nargs=(- 1), required=True)
@click.pass_context
def execute(ctx, sudo, command):
if sudo:
command = (['sudo', '-H', '-E', '-n', '--'] + list(command))
command =... | @utils.command(pdsh, name='exec')
@click.option('-s', '--sudo', is_flag=True, help='Run command as sudo user.')
@click.argument('command', nargs=(- 1), required=True)
@click.pass_context
def execute(ctx, sudo, command):
if sudo:
command = (['sudo', '-H', '-E', '-n', '--'] + list(command))
command =... |
7522ddfb65030ce1d645ecd9dac1b47fa07f5b328c16655305e053b67cecfb0a | @utils.command(pdsh)
@ssh_file_operations
@click.option('--yes', '-y', is_flag=True, help='Do not ask about confirmation.')
@click.argument('local-path', nargs=(- 1), required=True)
@click.argument('remote-path')
@click.pass_context
def upload(ctx, yes, local_path, remote_path):
'Upload files to remote host.\n\n ... | Upload files to remote host.
When uploading a single file or directory, the remote path can be
either the full path to upload data into or the path to an existing
directory where the data should be placed. In the latter case, the
base file name from the local path will be used as the remote name.
When uploading multi... | backend/admin/decapod_admin/pdsh.py | upload | angry-tony/ceph-lcm-decapod | 41 | python | @utils.command(pdsh)
@ssh_file_operations
@click.option('--yes', '-y', is_flag=True, help='Do not ask about confirmation.')
@click.argument('local-path', nargs=(- 1), required=True)
@click.argument('remote-path')
@click.pass_context
def upload(ctx, yes, local_path, remote_path):
'Upload files to remote host.\n\n ... | @utils.command(pdsh)
@ssh_file_operations
@click.option('--yes', '-y', is_flag=True, help='Do not ask about confirmation.')
@click.argument('local-path', nargs=(- 1), required=True)
@click.argument('remote-path')
@click.pass_context
def upload(ctx, yes, local_path, remote_path):
'Upload files to remote host.\n\n ... |
434d2289c732f7bed30fcf99baf71752fd045a4664563ba3ed4f935f3235c5dc | @utils.command(pdsh)
@ssh_file_operations
@click.option('--flat', is_flag=True, help='Do not create directory with server ID and IP on download')
@click.option('--glob-pattern', is_flag=True, help='Consider remote paths as globs.')
@click.argument('remote-path', nargs=(- 1), required=True)
@click.argument('local-path')... | Download files from remote host.
When downloading a single file or directory, the local path can
be either the full path to download data into or the path to an
existing directory where the data should be placed. In the latter
case, the base file name from the remote path will be used as the
local name.
Local path mu... | backend/admin/decapod_admin/pdsh.py | download | angry-tony/ceph-lcm-decapod | 41 | python | @utils.command(pdsh)
@ssh_file_operations
@click.option('--flat', is_flag=True, help='Do not create directory with server ID and IP on download')
@click.option('--glob-pattern', is_flag=True, help='Consider remote paths as globs.')
@click.argument('remote-path', nargs=(- 1), required=True)
@click.argument('local-path')... | @utils.command(pdsh)
@ssh_file_operations
@click.option('--flat', is_flag=True, help='Do not create directory with server ID and IP on download')
@click.option('--glob-pattern', is_flag=True, help='Consider remote paths as globs.')
@click.argument('remote-path', nargs=(- 1), required=True)
@click.argument('local-path')... |
734b5b58ffb48b62fd8c20a16f3468b466e02898da89cbbdf10434d7210ad754 | def gcd(a, b):
'Calculate the Greatest Common Divisor of a and b.\n\n Unless b==0, the result will have the same sign as b (so that when\n b is divided by it, the result comes out positive).\n '
while b:
(a, b) = (b, (a % b))
return a | Calculate the Greatest Common Divisor of a and b.
Unless b==0, the result will have the same sign as b (so that when
b is divided by it, the result comes out positive). | HW 2/myntl.py | gcd | HasanIjaz-HB/CS411-Cryptography | 0 | python | def gcd(a, b):
'Calculate the Greatest Common Divisor of a and b.\n\n Unless b==0, the result will have the same sign as b (so that when\n b is divided by it, the result comes out positive).\n '
while b:
(a, b) = (b, (a % b))
return a | def gcd(a, b):
'Calculate the Greatest Common Divisor of a and b.\n\n Unless b==0, the result will have the same sign as b (so that when\n b is divided by it, the result comes out positive).\n '
while b:
(a, b) = (b, (a % b))
return a<|docstring|>Calculate the Greatest Common Divisor of a a... |
b313e8af0387d0eec6da8aac20b041ad589de75afb2b0f873fd6f6dba576e676 | def adjust_learning_rate(optimizer, epoch, args):
'Sets the learning rate to the initial LR decayed by 10 every 30 epochs'
'Sets the learning rate to the initial LR decayed by 10 every 10 epochs'
lr = (args.lr * (0.1 ** (epoch // args.step)))
for param_group in optimizer.param_groups:
param_grou... | Sets the learning rate to the initial LR decayed by 10 every 30 epochs | classifier.py | adjust_learning_rate | kampta/PatchVAE | 9 | python | def adjust_learning_rate(optimizer, epoch, args):
'Sets the learning rate to the initial LR decayed by 10 every 10 epochs'
lr = (args.lr * (0.1 ** (epoch // args.step)))
for param_group in optimizer.param_groups:
param_group['lr'] = lr | def adjust_learning_rate(optimizer, epoch, args):
'Sets the learning rate to the initial LR decayed by 10 every 10 epochs'
lr = (args.lr * (0.1 ** (epoch // args.step)))
for param_group in optimizer.param_groups:
param_group['lr'] = lr<|docstring|>Sets the learning rate to the initial LR decaye... |
9ac58a8c4ae439d17a2757c8892bef929aedaf58ff23f1ab2a5e08670d55f6f2 | def accuracy(output, target, topk=(1,)):
'Computes the accuracy over the k top predictions for the specified values of k'
with torch.no_grad():
maxk = max(topk)
batch_size = target.size(0)
(_, pred) = output.topk(maxk, 1, True, True)
pred = pred.t()
correct = pred.eq(targ... | Computes the accuracy over the k top predictions for the specified values of k | classifier.py | accuracy | kampta/PatchVAE | 9 | python | def accuracy(output, target, topk=(1,)):
with torch.no_grad():
maxk = max(topk)
batch_size = target.size(0)
(_, pred) = output.topk(maxk, 1, True, True)
pred = pred.t()
correct = pred.eq(target.view(1, (- 1)).expand_as(pred))
res = []
for k in topk:
... | def accuracy(output, target, topk=(1,)):
with torch.no_grad():
maxk = max(topk)
batch_size = target.size(0)
(_, pred) = output.topk(maxk, 1, True, True)
pred = pred.t()
correct = pred.eq(target.view(1, (- 1)).expand_as(pred))
res = []
for k in topk:
... |
d55dc438842a31a17c430a19eb222ec784235a82255b1a7374589c37a612a421 | def render_yaml(path, variants=None, variant_config_files=None, schema=None, permit_undefined_jinja=False):
"\n Call conda-build's render tool to get a list of dictionaries of the\n rendered YAML file for each variant that will be built.\n "
config = get_or_merge_config(None, variant=variants)
conf... | Call conda-build's render tool to get a list of dictionaries of the
rendered YAML file for each variant that will be built. | open_ce/conda_utils.py | render_yaml | npanpaliya/open-ce-builder | 0 | python | def render_yaml(path, variants=None, variant_config_files=None, schema=None, permit_undefined_jinja=False):
"\n Call conda-build's render tool to get a list of dictionaries of the\n rendered YAML file for each variant that will be built.\n "
config = get_or_merge_config(None, variant=variants)
conf... | def render_yaml(path, variants=None, variant_config_files=None, schema=None, permit_undefined_jinja=False):
"\n Call conda-build's render tool to get a list of dictionaries of the\n rendered YAML file for each variant that will be built.\n "
config = get_or_merge_config(None, variant=variants)
conf... |
21bb808a79bc9c0448602a657aee6856ca9a442ca25636bc93de2cadac76c67d | def get_output_file_paths(meta, variants):
'\n Get the paths of all of the generated packages for a recipe.\n '
config = get_or_merge_config(None, variant=variants)
config.verbose = False
out_files = conda_build.api.get_output_file_paths(meta, config=config)
result = []
for out_file in out... | Get the paths of all of the generated packages for a recipe. | open_ce/conda_utils.py | get_output_file_paths | npanpaliya/open-ce-builder | 0 | python | def get_output_file_paths(meta, variants):
'\n \n '
config = get_or_merge_config(None, variant=variants)
config.verbose = False
out_files = conda_build.api.get_output_file_paths(meta, config=config)
result = []
for out_file in out_files:
path = pathlib.PurePath(out_file)
re... | def get_output_file_paths(meta, variants):
'\n \n '
config = get_or_merge_config(None, variant=variants)
config.verbose = False
out_files = conda_build.api.get_output_file_paths(meta, config=config)
result = []
for out_file in out_files:
path = pathlib.PurePath(out_file)
re... |
c41be459aad312f60f2e525553699e1a3e90e535eff6cce23eee84271ddd6cb1 | def conda_package_info(channels, package):
'\n Get conda package info.\n '
pkg_args = '"{}"'.format(generalize_version(package))
channel_args = ' '.join({'-c "{}"'.format(channel) for channel in channels})
cli = 'conda search --json {} {} --info'.format(channel_args, pkg_args)
(ret_code, std_o... | Get conda package info. | open_ce/conda_utils.py | conda_package_info | npanpaliya/open-ce-builder | 0 | python | def conda_package_info(channels, package):
'\n \n '
pkg_args = '"{}"'.format(generalize_version(package))
channel_args = ' '.join({'-c "{}"'.format(channel) for channel in channels})
cli = 'conda search --json {} {} --info'.format(channel_args, pkg_args)
(ret_code, std_out, _) = run_command_ca... | def conda_package_info(channels, package):
'\n \n '
pkg_args = '"{}"'.format(generalize_version(package))
channel_args = ' '.join({'-c "{}"'.format(channel) for channel in channels})
cli = 'conda search --json {} {} --info'.format(channel_args, pkg_args)
(ret_code, std_out, _) = run_command_ca... |
02d8259d9dabcf2e3ee62e9f21bfb612bdc77a0e03ad296dc39e7e4d3d2d34b2 | def get_latest_package_info(channels, package):
'\n Get the conda package info for the most recent search result.\n '
results = json.loads(conda_package_info(channels, package))
package_infos = results[list(results.keys())[0]]
retval = package_infos[0]
for package_info in package_infos:
... | Get the conda package info for the most recent search result. | open_ce/conda_utils.py | get_latest_package_info | npanpaliya/open-ce-builder | 0 | python | def get_latest_package_info(channels, package):
'\n \n '
results = json.loads(conda_package_info(channels, package))
package_infos = results[list(results.keys())[0]]
retval = package_infos[0]
for package_info in package_infos:
if (package_info['timestamp'] > retval['timestamp']):
... | def get_latest_package_info(channels, package):
'\n \n '
results = json.loads(conda_package_info(channels, package))
package_infos = results[list(results.keys())[0]]
retval = package_infos[0]
for package_info in package_infos:
if (package_info['timestamp'] > retval['timestamp']):
... |
bc37423870932026ae165c47c91133e72988ae386ac422dad53bd6d8ef196249 | def __init__(self, coords=None, preference=0, color='bo'):
'\n\n :param coords: characteristic object\n :param preference: preference\n '
if (coords is None):
coords = []
self.coords = coords
self.preference = preference
self.color = color | :param coords: characteristic object
:param preference: preference | methods/comet.py | __init__ | jwieckowski/mcda | 0 | python | def __init__(self, coords=None, preference=0, color='bo'):
'\n\n :param coords: characteristic object\n :param preference: preference\n '
if (coords is None):
coords = []
self.coords = coords
self.preference = preference
self.color = color | def __init__(self, coords=None, preference=0, color='bo'):
'\n\n :param coords: characteristic object\n :param preference: preference\n '
if (coords is None):
coords = []
self.coords = coords
self.preference = preference
self.color = color<|docstring|>:param coords: charact... |
ab4ef7dd477bc3bade4ddd7434cd6a91be0989feea741811561de6f79a91fdd5 | def __init__(self, data, precision=2):
'\n\n :param data: data from decision matrix\n :param precision: precision of floating point\n '
self.data = data
self.criteria = []
self.results = []
self.preferences = []
self.precision = precision | :param data: data from decision matrix
:param precision: precision of floating point | methods/comet.py | __init__ | jwieckowski/mcda | 0 | python | def __init__(self, data, precision=2):
'\n\n :param data: data from decision matrix\n :param precision: precision of floating point\n '
self.data = data
self.criteria = []
self.results = []
self.preferences = []
self.precision = precision | def __init__(self, data, precision=2):
'\n\n :param data: data from decision matrix\n :param precision: precision of floating point\n '
self.data = data
self.criteria = []
self.results = []
self.preferences = []
self.precision = precision<|docstring|>:param data: data from d... |
5b2459af609a592d2c360d0ac6d4e94722d135db5bc4ccc9d235133c260de93d | def add_data(self, column):
'\n\n :param column: list with data with expected length same as amount of alternatives\n :return: append new column of data to stored data\n '
col = np.array([[i] for i in column])
self.data = np.append(self.data, col, axis=1) | :param column: list with data with expected length same as amount of alternatives
:return: append new column of data to stored data | methods/comet.py | add_data | jwieckowski/mcda | 0 | python | def add_data(self, column):
'\n\n :param column: list with data with expected length same as amount of alternatives\n :return: append new column of data to stored data\n '
col = np.array([[i] for i in column])
self.data = np.append(self.data, col, axis=1) | def add_data(self, column):
'\n\n :param column: list with data with expected length same as amount of alternatives\n :return: append new column of data to stored data\n '
col = np.array([[i] for i in column])
self.data = np.append(self.data, col, axis=1)<|docstring|>:param column: list... |
317047dc4f405ae23f58c88fc49aea21d0da0b1beedd227713d77563bb47b2e6 | def add_criteria(self, criteria):
'\n\n :param criteria: list with criteria\n :return: append list to stored criteria\n '
self.criteria.append(criteria) | :param criteria: list with criteria
:return: append list to stored criteria | methods/comet.py | add_criteria | jwieckowski/mcda | 0 | python | def add_criteria(self, criteria):
'\n\n :param criteria: list with criteria\n :return: append list to stored criteria\n '
self.criteria.append(criteria) | def add_criteria(self, criteria):
'\n\n :param criteria: list with criteria\n :return: append list to stored criteria\n '
self.criteria.append(criteria)<|docstring|>:param criteria: list with criteria
:return: append list to stored criteria<|endoftext|> |
f808f80e95186b69d3734835496e76645c9d5c63f18ddecf47a6918658cbe3d0 | def add_preference(self, preference):
'\n\n :param preference: lit with preferences for criteria\n :return: append list to stored preferences\n '
self.preferences.append(preference) | :param preference: lit with preferences for criteria
:return: append list to stored preferences | methods/comet.py | add_preference | jwieckowski/mcda | 0 | python | def add_preference(self, preference):
'\n\n :param preference: lit with preferences for criteria\n :return: append list to stored preferences\n '
self.preferences.append(preference) | def add_preference(self, preference):
'\n\n :param preference: lit with preferences for criteria\n :return: append list to stored preferences\n '
self.preferences.append(preference)<|docstring|>:param preference: lit with preferences for criteria
:return: append list to stored preferences<|... |
a84ad44beebf26ec82b537b6ec2371c6e1ea296e6d6d2aa9ac79499c1202341e | def create_scope(self, point, criteria):
'\n Create space iterator for some point. Space is a list of values to tfn function (a, m, b).\n :param point: just point\n :param criteria: list of criteria\n :return: space tfn iterator\n '
for (var, criterion) in zip(point.coords, cr... | Create space iterator for some point. Space is a list of values to tfn function (a, m, b).
:param point: just point
:param criteria: list of criteria
:return: space tfn iterator | methods/comet.py | create_scope | jwieckowski/mcda | 0 | python | def create_scope(self, point, criteria):
'\n Create space iterator for some point. Space is a list of values to tfn function (a, m, b).\n :param point: just point\n :param criteria: list of criteria\n :return: space tfn iterator\n '
for (var, criterion) in zip(point.coords, cr... | def create_scope(self, point, criteria):
'\n Create space iterator for some point. Space is a list of values to tfn function (a, m, b).\n :param point: just point\n :param criteria: list of criteria\n :return: space tfn iterator\n '
for (var, criterion) in zip(point.coords, cr... |
6a1a91de24bb0d9a40652e94c6312697d7aa29b3a96b7f5d38626cf20710de41 | def calculate_preference(self, criteria, points, alternatives):
'\n\n :param criteria: criteria with characteristic values\n :param points: list of points of preferences created with Point class\n :param alternatives: list of points of alternatives created with Point class\n :return:\n ... | :param criteria: criteria with characteristic values
:param points: list of points of preferences created with Point class
:param alternatives: list of points of alternatives created with Point class
:return: | methods/comet.py | calculate_preference | jwieckowski/mcda | 0 | python | def calculate_preference(self, criteria, points, alternatives):
'\n\n :param criteria: criteria with characteristic values\n :param points: list of points of preferences created with Point class\n :param alternatives: list of points of alternatives created with Point class\n :return:\n ... | def calculate_preference(self, criteria, points, alternatives):
'\n\n :param criteria: criteria with characteristic values\n :param points: list of points of preferences created with Point class\n :param alternatives: list of points of alternatives created with Point class\n :return:\n ... |
627017eb87db07c3f199e7c560d77e07d8a2e0b904a6baa55e1a8e8ec290f1ba | def run(self):
'\n application of comet method calculations\n :return: lists of preferences for comet submodels and models for alternatives\n '
if (len(self.criteria) != len(self.preferences)):
print('Size of criteria and preferences does not match')
return
self.results ... | application of comet method calculations
:return: lists of preferences for comet submodels and models for alternatives | methods/comet.py | run | jwieckowski/mcda | 0 | python | def run(self):
'\n application of comet method calculations\n :return: lists of preferences for comet submodels and models for alternatives\n '
if (len(self.criteria) != len(self.preferences)):
print('Size of criteria and preferences does not match')
return
self.results ... | def run(self):
'\n application of comet method calculations\n :return: lists of preferences for comet submodels and models for alternatives\n '
if (len(self.criteria) != len(self.preferences)):
print('Size of criteria and preferences does not match')
return
self.results ... |
7d633aecb5ce41422bf203af39824fb04476aeb817edd8780ed3a48c80ef194c | def create_cloudwatch_event(app_name, env, region, rules):
'Create cloudwatch event for lambda from rules.\n\n Args:\n app_name (str): name of the lambda function\n env (str): Environment/Account for lambda function\n region (str): AWS region of the lambda function\n rules (dict): Tri... | Create cloudwatch event for lambda from rules.
Args:
app_name (str): name of the lambda function
env (str): Environment/Account for lambda function
region (str): AWS region of the lambda function
rules (dict): Trigger rules from the settings | src/foremast/awslambda/cloudwatch_event/cloudwatch_event.py | create_cloudwatch_event | JessicaAlan/foremast | 0 | python | def create_cloudwatch_event(app_name, env, region, rules):
'Create cloudwatch event for lambda from rules.\n\n Args:\n app_name (str): name of the lambda function\n env (str): Environment/Account for lambda function\n region (str): AWS region of the lambda function\n rules (dict): Tri... | def create_cloudwatch_event(app_name, env, region, rules):
'Create cloudwatch event for lambda from rules.\n\n Args:\n app_name (str): name of the lambda function\n env (str): Environment/Account for lambda function\n region (str): AWS region of the lambda function\n rules (dict): Tri... |
fe94d3dc0406dd6c642b357f5fc3a3d144557ac6f499adab095e27244fd36e11 | def __init__(self, keyword_length: (int or str), segment_length: int=DEFAULT, seed=DEFAULT):
'\n :param keyword_length: has to be the length of the keyword\n :param segment_length: segment length\n :param seed: seed for random.seed\n '
self.__keyword_length = keyword_length
self.... | :param keyword_length: has to be the length of the keyword
:param segment_length: segment length
:param seed: seed for random.seed | PasswordCardGenerator/PasswordCardGenerator.py | __init__ | BloodVexed/PasswordCardGenerator | 0 | python | def __init__(self, keyword_length: (int or str), segment_length: int=DEFAULT, seed=DEFAULT):
'\n :param keyword_length: has to be the length of the keyword\n :param segment_length: segment length\n :param seed: seed for random.seed\n '
self.__keyword_length = keyword_length
self.... | def __init__(self, keyword_length: (int or str), segment_length: int=DEFAULT, seed=DEFAULT):
'\n :param keyword_length: has to be the length of the keyword\n :param segment_length: segment length\n :param seed: seed for random.seed\n '
self.__keyword_length = keyword_length
self.... |
23502052f49275fae1c01afee6254fc618cb9095462166152d09e023192f7660 | def save(self, filename: str, font_size: int=DEFAULT, background: str=DEFAULT, font: str=DEFAULT, font_color: str=DEFAULT, txt: bool=DEFAULT):
'\n Saves the card as a png or txt\n\n :param filename: filename\n :param font: font\n :param font_size: font size\n :param font_color: fo... | Saves the card as a png or txt
:param filename: filename
:param font: font
:param font_size: font size
:param font_color: font color
:param txt: set to true if you dont want to convert the card to a png
:param background: set the background (in hex) | PasswordCardGenerator/PasswordCardGenerator.py | save | BloodVexed/PasswordCardGenerator | 0 | python | def save(self, filename: str, font_size: int=DEFAULT, background: str=DEFAULT, font: str=DEFAULT, font_color: str=DEFAULT, txt: bool=DEFAULT):
'\n Saves the card as a png or txt\n\n :param filename: filename\n :param font: font\n :param font_size: font size\n :param font_color: fo... | def save(self, filename: str, font_size: int=DEFAULT, background: str=DEFAULT, font: str=DEFAULT, font_color: str=DEFAULT, txt: bool=DEFAULT):
'\n Saves the card as a png or txt\n\n :param filename: filename\n :param font: font\n :param font_size: font size\n :param font_color: fo... |
4b8124135553acef1eb913c32fdbe62c5d9164de36547c4ed413c71cedb7cbe9 | def raw(self) -> typing.List[typing.List[str]]:
'\n Returns self.card\n '
return self.__card | Returns self.card | PasswordCardGenerator/PasswordCardGenerator.py | raw | BloodVexed/PasswordCardGenerator | 0 | python | def raw(self) -> typing.List[typing.List[str]]:
'\n \n '
return self.__card | def raw(self) -> typing.List[typing.List[str]]:
'\n \n '
return self.__card<|docstring|>Returns self.card<|endoftext|> |
7e4d9a152fd5394ced667a1ad1c049bacf3f03a8e5ba1c037399cab67a29dad9 | def get_password(self, keyword: str) -> str:
'\n Gets the password for [keyword]\n '
(password, o, keyword) = ('', 1, keyword.upper())
for i in range(len(keyword)):
o += 1
if (o > len(self.__card)):
raise NameError('Keyword is to long!')
else:
o = 1
for char... | Gets the password for [keyword] | PasswordCardGenerator/PasswordCardGenerator.py | get_password | BloodVexed/PasswordCardGenerator | 0 | python | def get_password(self, keyword: str) -> str:
'\n \n '
(password, o, keyword) = (, 1, keyword.upper())
for i in range(len(keyword)):
o += 1
if (o > len(self.__card)):
raise NameError('Keyword is to long!')
else:
o = 1
for char in keyword:
pos = None
... | def get_password(self, keyword: str) -> str:
'\n \n '
(password, o, keyword) = (, 1, keyword.upper())
for i in range(len(keyword)):
o += 1
if (o > len(self.__card)):
raise NameError('Keyword is to long!')
else:
o = 1
for char in keyword:
pos = None
... |
80fbf2bb06d111e9b5239bac19f75b10ea45024a466defdbcc322b33e2a2ff6e | def test_contex_create_context():
' test_contex_create_context '
context.set_context(mode=context.PYNATIVE_MODE)
if (context._k_context is None):
ctx = context._context()
assert (ctx is not None)
context._k_context = None | test_contex_create_context | tests/ut/python/pynative_mode/test_context.py | test_contex_create_context | madrugado/mindspore | 1 | python | def ():
' '
context.set_context(mode=context.PYNATIVE_MODE)
if (context._k_context is None):
ctx = context._context()
assert (ctx is not None)
context._k_context = None | def ():
' '
context.set_context(mode=context.PYNATIVE_MODE)
if (context._k_context is None):
ctx = context._context()
assert (ctx is not None)
context._k_context = None<|docstring|>test_contex_create_context<|endoftext|> |
6dc126836d4cc2676c2f2f6aaf93b6a2515a6943215a33f0e8013a6eb14de1c9 | def test_switch_mode():
' test_switch_mode '
context.set_context(mode=context.GRAPH_MODE)
assert (context.get_context('mode') == context.GRAPH_MODE)
context.set_context(mode=context.PYNATIVE_MODE)
assert (context.get_context('mode') == context.PYNATIVE_MODE) | test_switch_mode | tests/ut/python/pynative_mode/test_context.py | test_switch_mode | madrugado/mindspore | 1 | python | def ():
' '
context.set_context(mode=context.GRAPH_MODE)
assert (context.get_context('mode') == context.GRAPH_MODE)
context.set_context(mode=context.PYNATIVE_MODE)
assert (context.get_context('mode') == context.PYNATIVE_MODE) | def ():
' '
context.set_context(mode=context.GRAPH_MODE)
assert (context.get_context('mode') == context.GRAPH_MODE)
context.set_context(mode=context.PYNATIVE_MODE)
assert (context.get_context('mode') == context.PYNATIVE_MODE)<|docstring|>test_switch_mode<|endoftext|> |
c72f6b6ca09ff26c97e87bdca8d56e8fee8049d287ec98d99e0f795711292ac7 | def test_set_device_id():
' test_set_device_id '
with pytest.raises(TypeError):
context.set_context(device_id='cpu')
assert (context.get_context('device_id') == 0)
context.set_context(device_id=1)
assert (context.get_context('device_id') == 1) | test_set_device_id | tests/ut/python/pynative_mode/test_context.py | test_set_device_id | madrugado/mindspore | 1 | python | def ():
' '
with pytest.raises(TypeError):
context.set_context(device_id='cpu')
assert (context.get_context('device_id') == 0)
context.set_context(device_id=1)
assert (context.get_context('device_id') == 1) | def ():
' '
with pytest.raises(TypeError):
context.set_context(device_id='cpu')
assert (context.get_context('device_id') == 0)
context.set_context(device_id=1)
assert (context.get_context('device_id') == 1)<|docstring|>test_set_device_id<|endoftext|> |
6574fdb53f3ee41825915a21a17ccadc61a44cc189d2d7c0015215765c16ca0a | def test_device_target():
' test_device_target '
with pytest.raises(TypeError):
context.set_context(device_target=123)
context.set_context(device_target='GPU')
assert (context.get_context('device_target') == 'GPU')
context.set_context(device_target='Ascend')
assert (context.get_context('... | test_device_target | tests/ut/python/pynative_mode/test_context.py | test_device_target | madrugado/mindspore | 1 | python | def ():
' '
with pytest.raises(TypeError):
context.set_context(device_target=123)
context.set_context(device_target='GPU')
assert (context.get_context('device_target') == 'GPU')
context.set_context(device_target='Ascend')
assert (context.get_context('device_target') == 'Ascend')
ass... | def ():
' '
with pytest.raises(TypeError):
context.set_context(device_target=123)
context.set_context(device_target='GPU')
assert (context.get_context('device_target') == 'GPU')
context.set_context(device_target='Ascend')
assert (context.get_context('device_target') == 'Ascend')
ass... |
12ba01886d2b671c6650dfef82f9ebad191cb5105ddc9385490eff3dfd8f61a2 | def test_dump_target():
' test_dump_target '
with pytest.raises(TypeError):
context.set_context(save_dump_path=1)
context.set_context(enable_dump=False)
assert (context.get_context('enable_dump') == False)
context.set_context(enable_dump=True)
assert (context.get_context('enable_dump') =... | test_dump_target | tests/ut/python/pynative_mode/test_context.py | test_dump_target | madrugado/mindspore | 1 | python | def ():
' '
with pytest.raises(TypeError):
context.set_context(save_dump_path=1)
context.set_context(enable_dump=False)
assert (context.get_context('enable_dump') == False)
context.set_context(enable_dump=True)
assert (context.get_context('enable_dump') == True)
assert (context.get_... | def ():
' '
with pytest.raises(TypeError):
context.set_context(save_dump_path=1)
context.set_context(enable_dump=False)
assert (context.get_context('enable_dump') == False)
context.set_context(enable_dump=True)
assert (context.get_context('enable_dump') == True)
assert (context.get_... |
c0f2a3fd3dd3bef2e065afebd81b60900ed9154fb5c8fe8044f24452a2429d8b | def test_set_context():
' test_set_context '
context.set_context(mode=context.GRAPH_MODE, device_target='Ascend', device_id=0, save_graphs=True, save_graphs_path='/mindspore')
assert (context.get_context('device_id') == 0)
assert (context.get_context('device_target') == 'Ascend')
assert context.get_... | test_set_context | tests/ut/python/pynative_mode/test_context.py | test_set_context | madrugado/mindspore | 1 | python | def ():
' '
context.set_context(mode=context.GRAPH_MODE, device_target='Ascend', device_id=0, save_graphs=True, save_graphs_path='/mindspore')
assert (context.get_context('device_id') == 0)
assert (context.get_context('device_target') == 'Ascend')
assert context.get_context('save_graphs')
asser... | def ():
' '
context.set_context(mode=context.GRAPH_MODE, device_target='Ascend', device_id=0, save_graphs=True, save_graphs_path='/mindspore')
assert (context.get_context('device_id') == 0)
assert (context.get_context('device_target') == 'Ascend')
assert context.get_context('save_graphs')
asser... |
be23b7fb26aadcf822b88aa16f428d5d526eb5dc618d6be54ef9b4be6e28f2ba | def solution(resources, args):
'Problem 2 - Version 2\n Calculate each Fibonacci number and sum only the even ones. Skip\n the even check to reduce branching.\n\n Parameters:\n args.number The upper limit of the range of numbers over\n which the sum will be taken\n\n Re... | Problem 2 - Version 2
Calculate each Fibonacci number and sum only the even ones. Skip
the even check to reduce branching.
Parameters:
args.number The upper limit of the range of numbers over
which the sum will be taken
Return:
The sum of the even Fibonacci numbers that are less than
... | solutions/problem002/version002.py | solution | ineedthisforCPEN/projecteuler | 0 | python | def solution(resources, args):
'Problem 2 - Version 2\n Calculate each Fibonacci number and sum only the even ones. Skip\n the even check to reduce branching.\n\n Parameters:\n args.number The upper limit of the range of numbers over\n which the sum will be taken\n\n Re... | def solution(resources, args):
'Problem 2 - Version 2\n Calculate each Fibonacci number and sum only the even ones. Skip\n the even check to reduce branching.\n\n Parameters:\n args.number The upper limit of the range of numbers over\n which the sum will be taken\n\n Re... |
0a3236027acecdaca0d1936d497626450d916d3f08dcbbc22222d910b8626a85 | def network_scheduler(env, network, schedule, confidence_level=None, test=False):
'\n Inputs\n =========================================================================\n env: productionFacility object\n network: policy network object\n schedule: numpy array containing schedule\n confidence_level:... | Inputs
=========================================================================
env: productionFacility object
network: policy network object
schedule: numpy array containing schedule
confidence_level: float or None. If the max probability that comes
from the policy network is below the confidence_level, then the... | ada/scheduler/network_scheduler.py | network_scheduler | hubbs5/public_drl_sc | 4 | python | def network_scheduler(env, network, schedule, confidence_level=None, test=False):
'\n Inputs\n =========================================================================\n env: productionFacility object\n network: policy network object\n schedule: numpy array containing schedule\n confidence_level:... | def network_scheduler(env, network, schedule, confidence_level=None, test=False):
'\n Inputs\n =========================================================================\n env: productionFacility object\n network: policy network object\n schedule: numpy array containing schedule\n confidence_level:... |
633c8a2889a36da2b1ef61277b9424100333e4f98248f921b039c0f7734f6e55 | def q_scheduler(env, network, schedule, epsilon):
'\n Inputs\n =========================================================================\n env: productionFacility object\n network: policy network object\n schedule: numpy array containing schedule\n confidence_level: float or None. If the max proba... | Inputs
=========================================================================
env: productionFacility object
network: policy network object
schedule: numpy array containing schedule
confidence_level: float or None. If the max probability that comes
from the policy network is below the confidence_level, then the... | ada/scheduler/network_scheduler.py | q_scheduler | hubbs5/public_drl_sc | 4 | python | def q_scheduler(env, network, schedule, epsilon):
'\n Inputs\n =========================================================================\n env: productionFacility object\n network: policy network object\n schedule: numpy array containing schedule\n confidence_level: float or None. If the max proba... | def q_scheduler(env, network, schedule, epsilon):
'\n Inputs\n =========================================================================\n env: productionFacility object\n network: policy network object\n schedule: numpy array containing schedule\n confidence_level: float or None. If the max proba... |
0c3166a0ea668a973191cf602266e2595b7a3195ca0ff57d8962b915e1ea8dfd | def ddb_connect():
'connect to the correct dynamoDB tables. Returns the dynamoDB client, and the table object in a\n dictionary of relevant table objects'
ddb = boto3.resource('dynamodb')
tables = dict()
table_name = os.environ.get('INCREMENTATION_TABLE_NAME')
if (table_name is None):
tab... | connect to the correct dynamoDB tables. Returns the dynamoDB client, and the table object in a
dictionary of relevant table objects | 02_increment_counter/python/increment_lib.py | ddb_connect | zapman449/pyatl-lambda-api-gateway | 2 | python | def ddb_connect():
'connect to the correct dynamoDB tables. Returns the dynamoDB client, and the table object in a\n dictionary of relevant table objects'
ddb = boto3.resource('dynamodb')
tables = dict()
table_name = os.environ.get('INCREMENTATION_TABLE_NAME')
if (table_name is None):
tab... | def ddb_connect():
'connect to the correct dynamoDB tables. Returns the dynamoDB client, and the table object in a\n dictionary of relevant table objects'
ddb = boto3.resource('dynamodb')
tables = dict()
table_name = os.environ.get('INCREMENTATION_TABLE_NAME')
if (table_name is None):
tab... |
d9379ef6df93656b528b6bd8294f156fcf60bf0399d887add1696e28413109d2 | def __valid_ddb_response_q(response):
'private function to validate a given DynamoDB query response.'
if ('ResponseMetadata' in response):
if ('HTTPStatusCode' in response['ResponseMetadata']):
if (response['ResponseMetadata']['HTTPStatusCode'] == 200):
return True
return... | private function to validate a given DynamoDB query response. | 02_increment_counter/python/increment_lib.py | __valid_ddb_response_q | zapman449/pyatl-lambda-api-gateway | 2 | python | def __valid_ddb_response_q(response):
if ('ResponseMetadata' in response):
if ('HTTPStatusCode' in response['ResponseMetadata']):
if (response['ResponseMetadata']['HTTPStatusCode'] == 200):
return True
return False | def __valid_ddb_response_q(response):
if ('ResponseMetadata' in response):
if ('HTTPStatusCode' in response['ResponseMetadata']):
if (response['ResponseMetadata']['HTTPStatusCode'] == 200):
return True
return False<|docstring|>private function to validate a given DynamoD... |
00e977863a479a28aad90df22a7d98d44196084f44429392f8d4c66768c3949d | def conditional_get_count(CountName, tables):
'Retrieves the CountName from DynamoDB if it exists. If it does not, return a zero value'
response = tables['incrementation'].get_item(Key={'CountName': CountName})
if (not __valid_ddb_response_q(response)):
msg = 'got error querying incrementation tabl... | Retrieves the CountName from DynamoDB if it exists. If it does not, return a zero value | 02_increment_counter/python/increment_lib.py | conditional_get_count | zapman449/pyatl-lambda-api-gateway | 2 | python | def conditional_get_count(CountName, tables):
response = tables['incrementation'].get_item(Key={'CountName': CountName})
if (not __valid_ddb_response_q(response)):
msg = 'got error querying incrementation table: {}'.format(repr(response))
logging.error(msg)
raise Exception(msg)
... | def conditional_get_count(CountName, tables):
response = tables['incrementation'].get_item(Key={'CountName': CountName})
if (not __valid_ddb_response_q(response)):
msg = 'got error querying incrementation table: {}'.format(repr(response))
logging.error(msg)
raise Exception(msg)
... |
54f56af1b3cb135c996841fc1281db19c9bebe35a01c2afadf8dd22831135c9a | def increment_count(count_value):
'Take a count and increment it.'
try:
count_value['count'] = (count_value['count'] + 1)
except KeyError:
logging.exception('in increment_count, count_value should have key of count, but does not.')
raise | Take a count and increment it. | 02_increment_counter/python/increment_lib.py | increment_count | zapman449/pyatl-lambda-api-gateway | 2 | python | def increment_count(count_value):
try:
count_value['count'] = (count_value['count'] + 1)
except KeyError:
logging.exception('in increment_count, count_value should have key of count, but does not.')
raise | def increment_count(count_value):
try:
count_value['count'] = (count_value['count'] + 1)
except KeyError:
logging.exception('in increment_count, count_value should have key of count, but does not.')
raise<|docstring|>Take a count and increment it.<|endoftext|> |
83460d906d23a6ca7aff82db3ead2db4cf283dabd56a62af2ee55ee5f6d9e912 | def set_count(CountName, count_value, tables):
'Sets a given count_value for CountName'
response = tables['incrementation'].put_item(Item={'CountName': CountName, 'CountValue': json.dumps(count_value)})
if __valid_ddb_response_q(response):
return True
else:
msg = 'failed to put new count... | Sets a given count_value for CountName | 02_increment_counter/python/increment_lib.py | set_count | zapman449/pyatl-lambda-api-gateway | 2 | python | def set_count(CountName, count_value, tables):
response = tables['incrementation'].put_item(Item={'CountName': CountName, 'CountValue': json.dumps(count_value)})
if __valid_ddb_response_q(response):
return True
else:
msg = 'failed to put new count'
logging.error(msg)
rai... | def set_count(CountName, count_value, tables):
response = tables['incrementation'].put_item(Item={'CountName': CountName, 'CountValue': json.dumps(count_value)})
if __valid_ddb_response_q(response):
return True
else:
msg = 'failed to put new count'
logging.error(msg)
rai... |
ddf1b991f2e15f64f8e313a63a9470655b593d25c46b087ea2040f0fc9343972 | def parse_event(event, expected_method):
"Parses the event object passed in via Lambda invocation or API Gateway. If its a Lambda inviocation,\n expects to find a CountName key and use that. If not, it does some sanity checking for 3 keys set by\n API Gateway: resource, path, and httpMethod. If those 3 loo... | Parses the event object passed in via Lambda invocation or API Gateway. If its a Lambda inviocation,
expects to find a CountName key and use that. If not, it does some sanity checking for 3 keys set by
API Gateway: resource, path, and httpMethod. If those 3 look right, it extracts the CountName from the
event['path'... | 02_increment_counter/python/increment_lib.py | parse_event | zapman449/pyatl-lambda-api-gateway | 2 | python | def parse_event(event, expected_method):
"Parses the event object passed in via Lambda invocation or API Gateway. If its a Lambda inviocation,\n expects to find a CountName key and use that. If not, it does some sanity checking for 3 keys set by\n API Gateway: resource, path, and httpMethod. If those 3 loo... | def parse_event(event, expected_method):
"Parses the event object passed in via Lambda invocation or API Gateway. If its a Lambda inviocation,\n expects to find a CountName key and use that. If not, it does some sanity checking for 3 keys set by\n API Gateway: resource, path, and httpMethod. If those 3 loo... |
480cb5f6dc4f78eb1a694e4ca102ba6aaef8bccdf19c377219dabf1be60e0f19 | def make_return(msg, code):
'Create a standardized returnable dictionary.'
result = {'statusCode': int(code), 'body': str(msg), 'headers': {'Content-Type': 'application/json'}}
return result | Create a standardized returnable dictionary. | 02_increment_counter/python/increment_lib.py | make_return | zapman449/pyatl-lambda-api-gateway | 2 | python | def make_return(msg, code):
result = {'statusCode': int(code), 'body': str(msg), 'headers': {'Content-Type': 'application/json'}}
return result | def make_return(msg, code):
result = {'statusCode': int(code), 'body': str(msg), 'headers': {'Content-Type': 'application/json'}}
return result<|docstring|>Create a standardized returnable dictionary.<|endoftext|> |
f86a8a5bf261d6a1ea500419cc3465781ece6897b291fe0232fe6d674d67f02d | def analyze_frame(idx, true_frame, pred_frame):
'\n If strict=True,\n For each dialog_act (frame), set(slot values) must match.\n If dialog_act is incorrect, its set(slot values) is considered wrong.\n '
global total_act
global total_correct
global acts
global k
g... | If strict=True,
For each dialog_act (frame), set(slot values) must match.
If dialog_act is incorrect, its set(slot values) is considered wrong. | mm_dst/gpt2_dst/scripts/analysis.py | analyze_frame | boychaboy/simmc | 2 | python | def analyze_frame(idx, true_frame, pred_frame):
'\n If strict=True,\n For each dialog_act (frame), set(slot values) must match.\n If dialog_act is incorrect, its set(slot values) is considered wrong.\n '
global total_act
global total_correct
global acts
global k
g... | def analyze_frame(idx, true_frame, pred_frame):
'\n If strict=True,\n For each dialog_act (frame), set(slot values) must match.\n If dialog_act is incorrect, its set(slot values) is considered wrong.\n '
global total_act
global total_correct
global acts
global k
g... |
c12fe1d8c32b003ab22a7bb3b56e30e151b3591480297c04913ae96949bf2c28 | async def _track_and_propagate_available_endpoints(self) -> None:
'\n Track new announced endpoints and propagate them across all other existing endpoints.\n '
async for ev in self._endpoint.stream(EventBusConnected):
self._available_endpoints = (self._available_endpoints + (ev.connection_... | Track new announced endpoints and propagate them across all other existing endpoints. | trinity/extensibility/component_manager.py | _track_and_propagate_available_endpoints | gengmoqi/trinity | 0 | python | async def _track_and_propagate_available_endpoints(self) -> None:
'\n \n '
async for ev in self._endpoint.stream(EventBusConnected):
self._available_endpoints = (self._available_endpoints + (ev.connection_config,))
self.logger.debug('New EventBus Endpoint connected %s', ev.connecti... | async def _track_and_propagate_available_endpoints(self) -> None:
'\n \n '
async for ev in self._endpoint.stream(EventBusConnected):
self._available_endpoints = (self._available_endpoints + (ev.connection_config,))
self.logger.debug('New EventBus Endpoint connected %s', ev.connecti... |
00b2f7fc3309fdde30dc80fac2110773413f239dd1821fa8f8909fe0d4d831aa | @pytest.mark.asyncio(timeout=150)
async def test_dryrun_and_deploy(server, client, resource_container, environment):
'\n dryrun and deploy a configuration model\n\n There is a second agent with an undefined resource. The server will shortcut the dryrun and deploy for this resource\n without an agent being ... | dryrun and deploy a configuration model
There is a second agent with an undefined resource. The server will shortcut the dryrun and deploy for this resource
without an agent being present. | tests/agent_server/test_dryrun.py | test_dryrun_and_deploy | inmanta/inmanta-core | 6 | python | @pytest.mark.asyncio(timeout=150)
async def test_dryrun_and_deploy(server, client, resource_container, environment):
'\n dryrun and deploy a configuration model\n\n There is a second agent with an undefined resource. The server will shortcut the dryrun and deploy for this resource\n without an agent being ... | @pytest.mark.asyncio(timeout=150)
async def test_dryrun_and_deploy(server, client, resource_container, environment):
'\n dryrun and deploy a configuration model\n\n There is a second agent with an undefined resource. The server will shortcut the dryrun and deploy for this resource\n without an agent being ... |
e733ba11b9082e6f248a8959826dc0e51bf6fc60abd13d4087ad91129fce26e3 | @pytest.mark.asyncio(timeout=30)
async def test_dryrun_failures(resource_container, server, agent, client, environment, clienthelper):
'\n test dryrun scaling\n '
env_id = environment
version = (await clienthelper.get_version())
resources = [{'key': 'key1', 'value': 'value1', 'id': ('test::Noprov[... | test dryrun scaling | tests/agent_server/test_dryrun.py | test_dryrun_failures | inmanta/inmanta-core | 6 | python | @pytest.mark.asyncio(timeout=30)
async def test_dryrun_failures(resource_container, server, agent, client, environment, clienthelper):
'\n \n '
env_id = environment
version = (await clienthelper.get_version())
resources = [{'key': 'key1', 'value': 'value1', 'id': ('test::Noprov[agent1,key=key1],v=... | @pytest.mark.asyncio(timeout=30)
async def test_dryrun_failures(resource_container, server, agent, client, environment, clienthelper):
'\n \n '
env_id = environment
version = (await clienthelper.get_version())
resources = [{'key': 'key1', 'value': 'value1', 'id': ('test::Noprov[agent1,key=key1],v=... |
eb7beb59af6a156c48e3aee9186bcf33a3b9e7893d2dc9129cc0cb8a79715d9c | @pytest.mark.asyncio(timeout=30)
async def test_dryrun_scale(resource_container, server, client, environment, agent, clienthelper):
'\n test dryrun scaling\n '
version = (await clienthelper.get_version())
env_id = environment
resources = []
for i in range(1, 100):
resources.append({'ke... | test dryrun scaling | tests/agent_server/test_dryrun.py | test_dryrun_scale | inmanta/inmanta-core | 6 | python | @pytest.mark.asyncio(timeout=30)
async def test_dryrun_scale(resource_container, server, client, environment, agent, clienthelper):
'\n \n '
version = (await clienthelper.get_version())
env_id = environment
resources = []
for i in range(1, 100):
resources.append({'key': ('key%d' % i), ... | @pytest.mark.asyncio(timeout=30)
async def test_dryrun_scale(resource_container, server, client, environment, agent, clienthelper):
'\n \n '
version = (await clienthelper.get_version())
env_id = environment
resources = []
for i in range(1, 100):
resources.append({'key': ('key%d' % i), ... |
a906425628273916cb14923becea7bbd2c6bd3bf273cdccfdb0fa0b0425094b6 | def raster_mode(self):
'Sets printer to raster mode\n\n Args:\n None\n\n Returns:\n None\n\n Raises:\n None\n '
self.send(((chr(27) + 'ia') + chr(1))) | Sets printer to raster mode
Args:
None
Returns:
None
Raises:
None | brotherprint/brotherprint.py | raster_mode | HSRNetwork/python-brotherprint | 0 | python | def raster_mode(self):
'Sets printer to raster mode\n\n Args:\n None\n\n Returns:\n None\n\n Raises:\n None\n '
self.send(((chr(27) + 'ia') + chr(1))) | def raster_mode(self):
'Sets printer to raster mode\n\n Args:\n None\n\n Returns:\n None\n\n Raises:\n None\n '
self.send(((chr(27) + 'ia') + chr(1)))<|docstring|>Sets printer to raster mode
Args:
None
Returns:
None
Raises:
None<|endoft... |
3216057f7fa764a5a868199de48f29e9ec30207e03462ad58cbe989ad9864774 | def template_mode(self):
'Sets printer to template mode\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.send((((chr(27) + 'i') + 'a') + '3')) | Sets printer to template mode
Args:
None
Returns:
None
Raises:
None | brotherprint/brotherprint.py | template_mode | HSRNetwork/python-brotherprint | 0 | python | def template_mode(self):
'Sets printer to template mode\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.send((((chr(27) + 'i') + 'a') + '3')) | def template_mode(self):
'Sets printer to template mode\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.send((((chr(27) + 'i') + 'a') + '3'))<|docstring|>Sets printer to template mode
Args:
None
Returns:
None
Raises:
None<|en... |
38e9b2a7a4d255a6f758a838e098ad4ba3b584e3525ff1e8c677dac6d406e50c | def command_mode(self):
'Calling this function sets the printer to ESC/P command mode.\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.send((((chr(27) + chr(105)) + chr(97)) + '0')) | Calling this function sets the printer to ESC/P command mode.
Args:
None
Returns:
None
Raises:
None | brotherprint/brotherprint.py | command_mode | HSRNetwork/python-brotherprint | 0 | python | def command_mode(self):
'Calling this function sets the printer to ESC/P command mode.\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.send((((chr(27) + chr(105)) + chr(97)) + '0')) | def command_mode(self):
'Calling this function sets the printer to ESC/P command mode.\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.send((((chr(27) + chr(105)) + chr(97)) + '0'))<|docstring|>Calling this function sets the printer to ES... |
5d26bd3f0baebee67aa229d71f4947e0e5cbc9abeb7a6a0be74c5501afa145ea | def initialize(self):
'Calling this function initializes the printer.\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.fonttype = self.font_types['bitmap']
self.send((chr(27) + chr(64))) | Calling this function initializes the printer.
Args:
None
Returns:
None
Raises:
None | brotherprint/brotherprint.py | initialize | HSRNetwork/python-brotherprint | 0 | python | def initialize(self):
'Calling this function initializes the printer.\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.fonttype = self.font_types['bitmap']
self.send((chr(27) + chr(64))) | def initialize(self):
'Calling this function initializes the printer.\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.fonttype = self.font_types['bitmap']
self.send((chr(27) + chr(64)))<|docstring|>Calling this function initializes th... |
2d4fc62ae47c6cdb3314efc06ec42e2b7bfc799ab753dc3e7a449faa9847e14c | def select_charset(self, charset):
'Select international character set and changes codes in code table accordingly\n\n Args:\n charset: String. The character set we want.\n Returns:\n None\n Raises:\n RuntimeError: Invalid charset.\n '
charsets = {'US... | Select international character set and changes codes in code table accordingly
Args:
charset: String. The character set we want.
Returns:
None
Raises:
RuntimeError: Invalid charset. | brotherprint/brotherprint.py | select_charset | HSRNetwork/python-brotherprint | 0 | python | def select_charset(self, charset):
'Select international character set and changes codes in code table accordingly\n\n Args:\n charset: String. The character set we want.\n Returns:\n None\n Raises:\n RuntimeError: Invalid charset.\n '
charsets = {'US... | def select_charset(self, charset):
'Select international character set and changes codes in code table accordingly\n\n Args:\n charset: String. The character set we want.\n Returns:\n None\n Raises:\n RuntimeError: Invalid charset.\n '
charsets = {'US... |
8c0848577c06fe83cae8c9787cc873567cdd2e56e72e1b8f2592bd9c3691dde1 | def select_char_code_table(self, table):
"Select character code table, from tree built in ones.\n\n Args:\n table: The desired character code table. Choose from 'standard', 'eastern european', 'western european', and 'spare'\n Returns:\n None\n Raises:\n Runtime... | Select character code table, from tree built in ones.
Args:
table: The desired character code table. Choose from 'standard', 'eastern european', 'western european', and 'spare'
Returns:
None
Raises:
RuntimeError: Invalid chartable. | brotherprint/brotherprint.py | select_char_code_table | HSRNetwork/python-brotherprint | 0 | python | def select_char_code_table(self, table):
"Select character code table, from tree built in ones.\n\n Args:\n table: The desired character code table. Choose from 'standard', 'eastern european', 'western european', and 'spare'\n Returns:\n None\n Raises:\n Runtime... | def select_char_code_table(self, table):
"Select character code table, from tree built in ones.\n\n Args:\n table: The desired character code table. Choose from 'standard', 'eastern european', 'western european', and 'spare'\n Returns:\n None\n Raises:\n Runtime... |
fca382f03fa92fcfb0bfbd9b76b52d89275a3f514eb25df93b14cd4c58fa7abe | def cut_setting(self, cut):
"Set cut setting for printer.\n\n Args:\n cut: The type of cut setting we want. Choices are 'full', 'half', 'chain', and 'special'.\n Returns:\n None\n Raises:\n RuntimeError: Invalid cut type.\n "
cut_settings = {'full': 1... | Set cut setting for printer.
Args:
cut: The type of cut setting we want. Choices are 'full', 'half', 'chain', and 'special'.
Returns:
None
Raises:
RuntimeError: Invalid cut type. | brotherprint/brotherprint.py | cut_setting | HSRNetwork/python-brotherprint | 0 | python | def cut_setting(self, cut):
"Set cut setting for printer.\n\n Args:\n cut: The type of cut setting we want. Choices are 'full', 'half', 'chain', and 'special'.\n Returns:\n None\n Raises:\n RuntimeError: Invalid cut type.\n "
cut_settings = {'full': 1... | def cut_setting(self, cut):
"Set cut setting for printer.\n\n Args:\n cut: The type of cut setting we want. Choices are 'full', 'half', 'chain', and 'special'.\n Returns:\n None\n Raises:\n RuntimeError: Invalid cut type.\n "
cut_settings = {'full': 1... |
91acd1484cbfca2a72d400b05757a11ecece649c052fcee7257d63fc0840e334 | def rotated_printing(self, action):
"Calling this function applies the desired action to the printing orientation\n of the printer.\n\n Args:\n action: The desired printing orientation. 'rotate' enables rotated printing. 'normal' disables rotated printing.\n Returns:\n Non... | Calling this function applies the desired action to the printing orientation
of the printer.
Args:
action: The desired printing orientation. 'rotate' enables rotated printing. 'normal' disables rotated printing.
Returns:
None
Raises:
RuntimeError: Invalid action. | brotherprint/brotherprint.py | rotated_printing | HSRNetwork/python-brotherprint | 0 | python | def rotated_printing(self, action):
"Calling this function applies the desired action to the printing orientation\n of the printer.\n\n Args:\n action: The desired printing orientation. 'rotate' enables rotated printing. 'normal' disables rotated printing.\n Returns:\n Non... | def rotated_printing(self, action):
"Calling this function applies the desired action to the printing orientation\n of the printer.\n\n Args:\n action: The desired printing orientation. 'rotate' enables rotated printing. 'normal' disables rotated printing.\n Returns:\n Non... |
4efbf19fb0a7cd893c62ef696d92780a8e436df496780e604db038bd29f00132 | def feed_amount(self, amount):
"Calling this function sets the form feed amount to the specified setting.\n\n Args:\n amount: the form feed setting you desire. Options are '1/8', '1/6', 'x/180', and 'x/60',\n with x being your own desired amount. X must be a minimum of 24 for 'x/180' an... | Calling this function sets the form feed amount to the specified setting.
Args:
amount: the form feed setting you desire. Options are '1/8', '1/6', 'x/180', and 'x/60',
with x being your own desired amount. X must be a minimum of 24 for 'x/180' and 8 for 'x/60'
Returns:
None
Raises:
None | brotherprint/brotherprint.py | feed_amount | HSRNetwork/python-brotherprint | 0 | python | def feed_amount(self, amount):
"Calling this function sets the form feed amount to the specified setting.\n\n Args:\n amount: the form feed setting you desire. Options are '1/8', '1/6', 'x/180', and 'x/60',\n with x being your own desired amount. X must be a minimum of 24 for 'x/180' an... | def feed_amount(self, amount):
"Calling this function sets the form feed amount to the specified setting.\n\n Args:\n amount: the form feed setting you desire. Options are '1/8', '1/6', 'x/180', and 'x/60',\n with x being your own desired amount. X must be a minimum of 24 for 'x/180' an... |
7e390eeb0c1f237932abfaa38c71218c93160d4afc44dfd9627569df05eab8ed | def page_length(self, length):
"Specifies page length. This command is only valid with continuous length labels.\n\n Args:\n length: The length of the page, in dots. Can't exceed 12000.\n Returns:\n None\n Raises:\n RuntimeError: Length must be less than 12000.\... | Specifies page length. This command is only valid with continuous length labels.
Args:
length: The length of the page, in dots. Can't exceed 12000.
Returns:
None
Raises:
RuntimeError: Length must be less than 12000. | brotherprint/brotherprint.py | page_length | HSRNetwork/python-brotherprint | 0 | python | def page_length(self, length):
"Specifies page length. This command is only valid with continuous length labels.\n\n Args:\n length: The length of the page, in dots. Can't exceed 12000.\n Returns:\n None\n Raises:\n RuntimeError: Length must be less than 12000.\... | def page_length(self, length):
"Specifies page length. This command is only valid with continuous length labels.\n\n Args:\n length: The length of the page, in dots. Can't exceed 12000.\n Returns:\n None\n Raises:\n RuntimeError: Length must be less than 12000.\... |
7495ef320bcdc4f5b90652129f17c5cbaff826bd3ecb27de8cbe073a0ed9b502 | def page_format(self, topmargin, bottommargin):
'Specify settings for top and bottom margins. Physically printable area depends on media.\n\n Args:\n topmargin: the top margin, in dots. The top margin must be less than the bottom margin.\n bottommargin: the bottom margin, in dots. The b... | Specify settings for top and bottom margins. Physically printable area depends on media.
Args:
topmargin: the top margin, in dots. The top margin must be less than the bottom margin.
bottommargin: the bottom margin, in dots. The bottom margin must be less than the top margin.
Returns:
None
Raises:
Runt... | brotherprint/brotherprint.py | page_format | HSRNetwork/python-brotherprint | 0 | python | def page_format(self, topmargin, bottommargin):
'Specify settings for top and bottom margins. Physically printable area depends on media.\n\n Args:\n topmargin: the top margin, in dots. The top margin must be less than the bottom margin.\n bottommargin: the bottom margin, in dots. The b... | def page_format(self, topmargin, bottommargin):
'Specify settings for top and bottom margins. Physically printable area depends on media.\n\n Args:\n topmargin: the top margin, in dots. The top margin must be less than the bottom margin.\n bottommargin: the bottom margin, in dots. The b... |
8a605a09666ae058d73745d149524f00c94972e4cc5fd35d6b074aa210291770 | def left_margin(self, margin):
"Specify the left margin.\n\n Args:\n margin: The left margin, in character width. Must be less than the media's width.\n Returns:\n None\n Raises:\n RuntimeError: Invalid margin parameter.\n "
if ((margin <= 255) and (m... | Specify the left margin.
Args:
margin: The left margin, in character width. Must be less than the media's width.
Returns:
None
Raises:
RuntimeError: Invalid margin parameter. | brotherprint/brotherprint.py | left_margin | HSRNetwork/python-brotherprint | 0 | python | def left_margin(self, margin):
"Specify the left margin.\n\n Args:\n margin: The left margin, in character width. Must be less than the media's width.\n Returns:\n None\n Raises:\n RuntimeError: Invalid margin parameter.\n "
if ((margin <= 255) and (m... | def left_margin(self, margin):
"Specify the left margin.\n\n Args:\n margin: The left margin, in character width. Must be less than the media's width.\n Returns:\n None\n Raises:\n RuntimeError: Invalid margin parameter.\n "
if ((margin <= 255) and (m... |
a297ed23710856b99d950fc577223d0aec9fad8e28ea2df7123bd02260a8cce5 | def right_margin(self, margin):
"Specify the right margin.\n\n Args:\n margin: The right margin, in character width, must be less than the media's width.\n Returns:\n None\n Raises:\n RuntimeError: Invalid margin parameter\n "
if ((margin >= 1) and (m... | Specify the right margin.
Args:
margin: The right margin, in character width, must be less than the media's width.
Returns:
None
Raises:
RuntimeError: Invalid margin parameter | brotherprint/brotherprint.py | right_margin | HSRNetwork/python-brotherprint | 0 | python | def right_margin(self, margin):
"Specify the right margin.\n\n Args:\n margin: The right margin, in character width, must be less than the media's width.\n Returns:\n None\n Raises:\n RuntimeError: Invalid margin parameter\n "
if ((margin >= 1) and (m... | def right_margin(self, margin):
"Specify the right margin.\n\n Args:\n margin: The right margin, in character width, must be less than the media's width.\n Returns:\n None\n Raises:\n RuntimeError: Invalid margin parameter\n "
if ((margin >= 1) and (m... |
ae6455687d3ec6afc3ace15ea2b94e0d6c4dbd8b63c78966f9e640a9f269f544 | def horz_tab_pos(self, positions):
"Sets tab positions, up to a maximum of 32 positions. Also can clear tab positions.\n\n Args:\n positions: either a list of tab positions (between 1 and 255), or 'clear'.\n Returns:\n None\n Raises:\n RuntimeError: Invalid posi... | Sets tab positions, up to a maximum of 32 positions. Also can clear tab positions.
Args:
positions: either a list of tab positions (between 1 and 255), or 'clear'.
Returns:
None
Raises:
RuntimeError: Invalid position parameter.
RuntimeError: Too many positions. | brotherprint/brotherprint.py | horz_tab_pos | HSRNetwork/python-brotherprint | 0 | python | def horz_tab_pos(self, positions):
"Sets tab positions, up to a maximum of 32 positions. Also can clear tab positions.\n\n Args:\n positions: either a list of tab positions (between 1 and 255), or 'clear'.\n Returns:\n None\n Raises:\n RuntimeError: Invalid posi... | def horz_tab_pos(self, positions):
"Sets tab positions, up to a maximum of 32 positions. Also can clear tab positions.\n\n Args:\n positions: either a list of tab positions (between 1 and 255), or 'clear'.\n Returns:\n None\n Raises:\n RuntimeError: Invalid posi... |
12a42fe8a51554e0a2456772a7e5b052399367bef55d876490cb1d84248fabe4 | def vert_tab_pos(self, positions):
"Sets tab positions, up to a maximum of 32 positions. Also can clear tab positions.\n\n Args:\n positions -- Either a list of tab positions (between 1 and 255), or 'clear'.\n Returns:\n None\n Raises:\n RuntimeError: Invalid po... | Sets tab positions, up to a maximum of 32 positions. Also can clear tab positions.
Args:
positions -- Either a list of tab positions (between 1 and 255), or 'clear'.
Returns:
None
Raises:
RuntimeError: Invalid position parameter.
RuntimeError: Too many positions. | brotherprint/brotherprint.py | vert_tab_pos | HSRNetwork/python-brotherprint | 0 | python | def vert_tab_pos(self, positions):
"Sets tab positions, up to a maximum of 32 positions. Also can clear tab positions.\n\n Args:\n positions -- Either a list of tab positions (between 1 and 255), or 'clear'.\n Returns:\n None\n Raises:\n RuntimeError: Invalid po... | def vert_tab_pos(self, positions):
"Sets tab positions, up to a maximum of 32 positions. Also can clear tab positions.\n\n Args:\n positions -- Either a list of tab positions (between 1 and 255), or 'clear'.\n Returns:\n None\n Raises:\n RuntimeError: Invalid po... |
2baeba1664d0419fa776815de219d8ca22e7cc085ba83de3e956755536d08c10 | def send(self, text):
'Sends text to printer\n \n Args:\n text: string to be printed\n Returns:\n None\n Raises:\n None'
if (self.interface_type == self.WIFI_INTERFACE):
if (not isinstance(text, six.binary_type)):
self.interface.se... | Sends text to printer
Args:
text: string to be printed
Returns:
None
Raises:
None | brotherprint/brotherprint.py | send | HSRNetwork/python-brotherprint | 0 | python | def send(self, text):
'Sends text to printer\n \n Args:\n text: string to be printed\n Returns:\n None\n Raises:\n None'
if (self.interface_type == self.WIFI_INTERFACE):
if (not isinstance(text, six.binary_type)):
self.interface.se... | def send(self, text):
'Sends text to printer\n \n Args:\n text: string to be printed\n Returns:\n None\n Raises:\n None'
if (self.interface_type == self.WIFI_INTERFACE):
if (not isinstance(text, six.binary_type)):
self.interface.se... |
1027da6d9d4c8adab2b12a2e56b04a177005a028200bd5a0c5f6b5716331fb25 | def forward_feed(self, amount):
'Calling this function finishes input of the current line, then moves the vertical\n print position forward by x/300 inch.\n\n Args:\n amount: how far foward you want the position moved. Actual movement is calculated as\n amount/300 inches.\n ... | Calling this function finishes input of the current line, then moves the vertical
print position forward by x/300 inch.
Args:
amount: how far foward you want the position moved. Actual movement is calculated as
amount/300 inches.
Returns:
None
Raises:
RuntimeError: Invalid foward feed. | brotherprint/brotherprint.py | forward_feed | HSRNetwork/python-brotherprint | 0 | python | def forward_feed(self, amount):
'Calling this function finishes input of the current line, then moves the vertical\n print position forward by x/300 inch.\n\n Args:\n amount: how far foward you want the position moved. Actual movement is calculated as\n amount/300 inches.\n ... | def forward_feed(self, amount):
'Calling this function finishes input of the current line, then moves the vertical\n print position forward by x/300 inch.\n\n Args:\n amount: how far foward you want the position moved. Actual movement is calculated as\n amount/300 inches.\n ... |
241c0dc3b1b1637471128302794af67d7e51d7bfbc6d404cc42b683d116b8512 | def abs_vert_pos(self, amount):
"Specify vertical print position from the top margin position.\n\n Args:\n amount: The distance from the top margin you'd like, from 0 to 32767\n Returns:\n None\n Raises:\n RuntimeError: Invalid vertical position.\n "
... | Specify vertical print position from the top margin position.
Args:
amount: The distance from the top margin you'd like, from 0 to 32767
Returns:
None
Raises:
RuntimeError: Invalid vertical position. | brotherprint/brotherprint.py | abs_vert_pos | HSRNetwork/python-brotherprint | 0 | python | def abs_vert_pos(self, amount):
"Specify vertical print position from the top margin position.\n\n Args:\n amount: The distance from the top margin you'd like, from 0 to 32767\n Returns:\n None\n Raises:\n RuntimeError: Invalid vertical position.\n "
... | def abs_vert_pos(self, amount):
"Specify vertical print position from the top margin position.\n\n Args:\n amount: The distance from the top margin you'd like, from 0 to 32767\n Returns:\n None\n Raises:\n RuntimeError: Invalid vertical position.\n "
... |
a560009eb0a3d807b7f4c51edfb44fd9cdc175b9df3e3c9e8ae0b6bbb2b5b915 | def abs_horz_pos(self, amount):
'Calling this function sets the absoulte print position for the next data, this is\n the position from the left margin.\n\n Args:\n amount: desired positioning. Can be a number from 0 to 2362. The actual positioning\n is calculated as (amount/60)in... | Calling this function sets the absoulte print position for the next data, this is
the position from the left margin.
Args:
amount: desired positioning. Can be a number from 0 to 2362. The actual positioning
is calculated as (amount/60)inches from the left margin.
Returns:
None
Raises:
None | brotherprint/brotherprint.py | abs_horz_pos | HSRNetwork/python-brotherprint | 0 | python | def abs_horz_pos(self, amount):
'Calling this function sets the absoulte print position for the next data, this is\n the position from the left margin.\n\n Args:\n amount: desired positioning. Can be a number from 0 to 2362. The actual positioning\n is calculated as (amount/60)in... | def abs_horz_pos(self, amount):
'Calling this function sets the absoulte print position for the next data, this is\n the position from the left margin.\n\n Args:\n amount: desired positioning. Can be a number from 0 to 2362. The actual positioning\n is calculated as (amount/60)in... |
a172f454579f8be22614d922a7a4a7bda1984cd037ccc4d0e0ec11d89d40dd66 | def rel_horz_pos(self, amount):
'Calling this function sets the relative horizontal position for the next data, this is\n the position from the current position. The next character will be printed (x/180)inches\n away from the current position. The relative position CANNOT be specified to the left.\n ... | Calling this function sets the relative horizontal position for the next data, this is
the position from the current position. The next character will be printed (x/180)inches
away from the current position. The relative position CANNOT be specified to the left.
This command is only valid with left alignment.
Args:
... | brotherprint/brotherprint.py | rel_horz_pos | HSRNetwork/python-brotherprint | 0 | python | def rel_horz_pos(self, amount):
'Calling this function sets the relative horizontal position for the next data, this is\n the position from the current position. The next character will be printed (x/180)inches\n away from the current position. The relative position CANNOT be specified to the left.\n ... | def rel_horz_pos(self, amount):
'Calling this function sets the relative horizontal position for the next data, this is\n the position from the current position. The next character will be printed (x/180)inches\n away from the current position. The relative position CANNOT be specified to the left.\n ... |
b8953469029002e490e5cedd302e007da679859b88898d6ed98082f311d74e4a | def alignment(self, align):
"Sets the alignment of the printer.\n\n Args:\n align: desired alignment. Options are 'left', 'center', 'right', and 'justified'. Anything else\n will throw an error.\n Returns:\n None\n Raises:\n RuntimeError: Invalid alig... | Sets the alignment of the printer.
Args:
align: desired alignment. Options are 'left', 'center', 'right', and 'justified'. Anything else
will throw an error.
Returns:
None
Raises:
RuntimeError: Invalid alignment. | brotherprint/brotherprint.py | alignment | HSRNetwork/python-brotherprint | 0 | python | def alignment(self, align):
"Sets the alignment of the printer.\n\n Args:\n align: desired alignment. Options are 'left', 'center', 'right', and 'justified'. Anything else\n will throw an error.\n Returns:\n None\n Raises:\n RuntimeError: Invalid alig... | def alignment(self, align):
"Sets the alignment of the printer.\n\n Args:\n align: desired alignment. Options are 'left', 'center', 'right', and 'justified'. Anything else\n will throw an error.\n Returns:\n None\n Raises:\n RuntimeError: Invalid alig... |
310da7b96f79e311f2ccac16594523f4e8c008bc7647eec71e1d4ce131b01542 | def carriage_return(self):
'Performs a line feed amount, sets next print position to the beginning of the next line,\n will ignore a subsequent line feed command.\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.send(chr(13)) | Performs a line feed amount, sets next print position to the beginning of the next line,
will ignore a subsequent line feed command.
Args:
None
Returns:
None
Raises:
None | brotherprint/brotherprint.py | carriage_return | HSRNetwork/python-brotherprint | 0 | python | def carriage_return(self):
'Performs a line feed amount, sets next print position to the beginning of the next line,\n will ignore a subsequent line feed command.\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.send(chr(13)) | def carriage_return(self):
'Performs a line feed amount, sets next print position to the beginning of the next line,\n will ignore a subsequent line feed command.\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.send(chr(13))<|docst... |
53f569e930cffedf56e51e986e0ff6e6a0acd51aee4b8d79972cdfaf047e2f52 | def line_feed(self):
'Performs line feed operation, any carriage return command subsequent to a lineFeed will\n be ignored.\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.send(chr(10)) | Performs line feed operation, any carriage return command subsequent to a lineFeed will
be ignored.
Args:
None
Returns:
None
Raises:
None | brotherprint/brotherprint.py | line_feed | HSRNetwork/python-brotherprint | 0 | python | def line_feed(self):
'Performs line feed operation, any carriage return command subsequent to a lineFeed will\n be ignored.\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.send(chr(10)) | def line_feed(self):
'Performs line feed operation, any carriage return command subsequent to a lineFeed will\n be ignored.\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.send(chr(10))<|docstring|>Performs line feed operation, any... |
be4917d8b5649a5a82142ca18ca6607d6b0965b61d3e2d4203bc974761964f15 | def page_feed(self):
'Page feed.\n\n Keyword arguments:\n None\n Returns:\n None\n Raises:\n None\n '
self.send(chr(12)) | Page feed.
Keyword arguments:
None
Returns:
None
Raises:
None | brotherprint/brotherprint.py | page_feed | HSRNetwork/python-brotherprint | 0 | python | def page_feed(self):
'Page feed.\n\n Keyword arguments:\n None\n Returns:\n None\n Raises:\n None\n '
self.send(chr(12)) | def page_feed(self):
'Page feed.\n\n Keyword arguments:\n None\n Returns:\n None\n Raises:\n None\n '
self.send(chr(12))<|docstring|>Page feed.
Keyword arguments:
None
Returns:
None
Raises:
None<|endoftext|> |
3cb9d1762d22b9a5f7acf8185717f312524550e0f106d638f79f8334bc26812a | def print_page(self, cut):
"End input, set cut setting, and pagefeed.\n\n Args:\n cut: cut setting, choose from 'full', 'half', 'special' and 'chain'\n Returns:\n None\n Raises:\n None\n "
self.cut_setting(cut)
self.page_feed() | End input, set cut setting, and pagefeed.
Args:
cut: cut setting, choose from 'full', 'half', 'special' and 'chain'
Returns:
None
Raises:
None | brotherprint/brotherprint.py | print_page | HSRNetwork/python-brotherprint | 0 | python | def print_page(self, cut):
"End input, set cut setting, and pagefeed.\n\n Args:\n cut: cut setting, choose from 'full', 'half', 'special' and 'chain'\n Returns:\n None\n Raises:\n None\n "
self.cut_setting(cut)
self.page_feed() | def print_page(self, cut):
"End input, set cut setting, and pagefeed.\n\n Args:\n cut: cut setting, choose from 'full', 'half', 'special' and 'chain'\n Returns:\n None\n Raises:\n None\n "
self.cut_setting(cut)
self.page_feed()<|docstring|>End inp... |
5d7741cbc1dce5a06390fd82a0c4033ea6f68fa3d946ba67d9824a491f55321a | def frame(self, action):
"Places/removes frame around text\n\n Args:\n action -- Enable or disable frame. Options are 'on' and 'off'\n Returns:\n None\n Raises:\n RuntimeError: Invalid action.\n "
choices = {'on': '1', 'off': '0'}
if (action in ch... | Places/removes frame around text
Args:
action -- Enable or disable frame. Options are 'on' and 'off'
Returns:
None
Raises:
RuntimeError: Invalid action. | brotherprint/brotherprint.py | frame | HSRNetwork/python-brotherprint | 0 | python | def frame(self, action):
"Places/removes frame around text\n\n Args:\n action -- Enable or disable frame. Options are 'on' and 'off'\n Returns:\n None\n Raises:\n RuntimeError: Invalid action.\n "
choices = {'on': '1', 'off': '0'}
if (action in ch... | def frame(self, action):
"Places/removes frame around text\n\n Args:\n action -- Enable or disable frame. Options are 'on' and 'off'\n Returns:\n None\n Raises:\n RuntimeError: Invalid action.\n "
choices = {'on': '1', 'off': '0'}
if (action in ch... |
5ae4a3ecc61b3b8f4603c26fbb42ce1671c99e33c090a65f49dc643ca91f20c0 | def horz_tab(self):
'Applies horizontal tab to nearest tab position\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.send(chr(9)) | Applies horizontal tab to nearest tab position
Args:
None
Returns:
None
Raises:
None | brotherprint/brotherprint.py | horz_tab | HSRNetwork/python-brotherprint | 0 | python | def horz_tab(self):
'Applies horizontal tab to nearest tab position\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.send(chr(9)) | def horz_tab(self):
'Applies horizontal tab to nearest tab position\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.send(chr(9))<|docstring|>Applies horizontal tab to nearest tab position
Args:
None
Returns:
None
Raises:
None... |
5606a23215ce94109f97a01e4421faf88f36f4c6b9073fbc4e39a2e9d01a3839 | def vert_tab(self):
'Applies vertical tab to nearest vertical tab position\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.send(chr(11)) | Applies vertical tab to nearest vertical tab position
Args:
None
Returns:
None
Raises:
None | brotherprint/brotherprint.py | vert_tab | HSRNetwork/python-brotherprint | 0 | python | def vert_tab(self):
'Applies vertical tab to nearest vertical tab position\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.send(chr(11)) | def vert_tab(self):
'Applies vertical tab to nearest vertical tab position\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.send(chr(11))<|docstring|>Applies vertical tab to nearest vertical tab position
Args:
None
Returns:
None
R... |
5b209015716ba0ae615f22aefbc1a6ecce702a39bded07a11228b128036f7223 | def bold(self, action):
"Enable/cancel bold printing\n\n Args:\n action: Enable or disable bold printing. Options are 'on' and 'off'\n Returns:\n None\n Raises:\n RuntimeError: Invalid action.\n "
if (action == 'on'):
action = 'E'
elif (ac... | Enable/cancel bold printing
Args:
action: Enable or disable bold printing. Options are 'on' and 'off'
Returns:
None
Raises:
RuntimeError: Invalid action. | brotherprint/brotherprint.py | bold | HSRNetwork/python-brotherprint | 0 | python | def bold(self, action):
"Enable/cancel bold printing\n\n Args:\n action: Enable or disable bold printing. Options are 'on' and 'off'\n Returns:\n None\n Raises:\n RuntimeError: Invalid action.\n "
if (action == 'on'):
action = 'E'
elif (ac... | def bold(self, action):
"Enable/cancel bold printing\n\n Args:\n action: Enable or disable bold printing. Options are 'on' and 'off'\n Returns:\n None\n Raises:\n RuntimeError: Invalid action.\n "
if (action == 'on'):
action = 'E'
elif (ac... |
6469273060bb155f18bc6f96d6c791d95b63b6c1374b83af787e59360339059f | def italic(self, action):
"Enable/cancel italic printing\n\n Args:\n action: Enable or disable italic printing. Options are 'on' and 'off'\n Returns:\n None\n Raises:\n RuntimeError: Invalid action.\n "
if (action == 'on'):
action = '4'
el... | Enable/cancel italic printing
Args:
action: Enable or disable italic printing. Options are 'on' and 'off'
Returns:
None
Raises:
RuntimeError: Invalid action. | brotherprint/brotherprint.py | italic | HSRNetwork/python-brotherprint | 0 | python | def italic(self, action):
"Enable/cancel italic printing\n\n Args:\n action: Enable or disable italic printing. Options are 'on' and 'off'\n Returns:\n None\n Raises:\n RuntimeError: Invalid action.\n "
if (action == 'on'):
action = '4'
el... | def italic(self, action):
"Enable/cancel italic printing\n\n Args:\n action: Enable or disable italic printing. Options are 'on' and 'off'\n Returns:\n None\n Raises:\n RuntimeError: Invalid action.\n "
if (action == 'on'):
action = '4'
el... |
08851bb6a8e94809b850ce18636d0ce75a10e0ec279ffa2f95a74ffa85e75421 | def double_strike(self, action):
"Enable/cancel doublestrike printing\n\n Args:\n action: Enable or disable doublestrike printing. Options are 'on' and 'off'\n Returns:\n None\n Raises:\n RuntimeError: Invalid action.\n "
if (action == 'on'):
... | Enable/cancel doublestrike printing
Args:
action: Enable or disable doublestrike printing. Options are 'on' and 'off'
Returns:
None
Raises:
RuntimeError: Invalid action. | brotherprint/brotherprint.py | double_strike | HSRNetwork/python-brotherprint | 0 | python | def double_strike(self, action):
"Enable/cancel doublestrike printing\n\n Args:\n action: Enable or disable doublestrike printing. Options are 'on' and 'off'\n Returns:\n None\n Raises:\n RuntimeError: Invalid action.\n "
if (action == 'on'):
... | def double_strike(self, action):
"Enable/cancel doublestrike printing\n\n Args:\n action: Enable or disable doublestrike printing. Options are 'on' and 'off'\n Returns:\n None\n Raises:\n RuntimeError: Invalid action.\n "
if (action == 'on'):
... |
72ba912317a4dff1081c9d6378ce7ee26761a3c40935a491309547c6126a6f75 | def double_width(self, action):
"Enable/cancel doublewidth printing\n\n Args:\n action: Enable or disable doublewidth printing. Options are 'on' and 'off'\n Returns:\n None\n Raises:\n RuntimeError: Invalid action.\n "
if (action == 'on'):
act... | Enable/cancel doublewidth printing
Args:
action: Enable or disable doublewidth printing. Options are 'on' and 'off'
Returns:
None
Raises:
RuntimeError: Invalid action. | brotherprint/brotherprint.py | double_width | HSRNetwork/python-brotherprint | 0 | python | def double_width(self, action):
"Enable/cancel doublewidth printing\n\n Args:\n action: Enable or disable doublewidth printing. Options are 'on' and 'off'\n Returns:\n None\n Raises:\n RuntimeError: Invalid action.\n "
if (action == 'on'):
act... | def double_width(self, action):
"Enable/cancel doublewidth printing\n\n Args:\n action: Enable or disable doublewidth printing. Options are 'on' and 'off'\n Returns:\n None\n Raises:\n RuntimeError: Invalid action.\n "
if (action == 'on'):
act... |
cb09981f06007120729d5b2c622fb0c3c003d46abb239bfeb53457ee1c355238 | def compressed_char(self, action):
"Enable/cancel compressed character printing\n\n Args:\n action: Enable or disable compressed character printing. Options are 'on' and 'off'\n Returns:\n None\n Raises:\n RuntimeError: Invalid action.\n "
if (action ... | Enable/cancel compressed character printing
Args:
action: Enable or disable compressed character printing. Options are 'on' and 'off'
Returns:
None
Raises:
RuntimeError: Invalid action. | brotherprint/brotherprint.py | compressed_char | HSRNetwork/python-brotherprint | 0 | python | def compressed_char(self, action):
"Enable/cancel compressed character printing\n\n Args:\n action: Enable or disable compressed character printing. Options are 'on' and 'off'\n Returns:\n None\n Raises:\n RuntimeError: Invalid action.\n "
if (action ... | def compressed_char(self, action):
"Enable/cancel compressed character printing\n\n Args:\n action: Enable or disable compressed character printing. Options are 'on' and 'off'\n Returns:\n None\n Raises:\n RuntimeError: Invalid action.\n "
if (action ... |
6a5c8c063edabaa9082971b199dfcf85e7b6772b511185dc107bed8c06c36693 | def underline(self, action):
"Enable/cancel underline printing\n\n Args:\n action -- Enable or disable underline printing. Options are '1' - '4' and 'cancel'\n Returns:\n None\n Raises:\n None\n "
if (action == 'off'):
action = '0'
sel... | Enable/cancel underline printing
Args:
action -- Enable or disable underline printing. Options are '1' - '4' and 'cancel'
Returns:
None
Raises:
None | brotherprint/brotherprint.py | underline | HSRNetwork/python-brotherprint | 0 | python | def underline(self, action):
"Enable/cancel underline printing\n\n Args:\n action -- Enable or disable underline printing. Options are '1' - '4' and 'cancel'\n Returns:\n None\n Raises:\n None\n "
if (action == 'off'):
action = '0'
sel... | def underline(self, action):
"Enable/cancel underline printing\n\n Args:\n action -- Enable or disable underline printing. Options are '1' - '4' and 'cancel'\n Returns:\n None\n Raises:\n None\n "
if (action == 'off'):
action = '0'
sel... |
55f5856ca123d9298f8c6c8e9e0da565cfac190b61223d3c5f0cd7aaff292caa | def char_size(self, size):
"Changes font size\n\n Args:\n size: change font size. Options are 24' '32' '48' for bitmap fonts\n 33, 38, 42, 46, 50, 58, 67, 75, 83, 92, 100, 117, 133, 150, 167, 200 233,\n 11, 44, 77, 111, 144 for outline fonts.\n Returns:\n No... | Changes font size
Args:
size: change font size. Options are 24' '32' '48' for bitmap fonts
33, 38, 42, 46, 50, 58, 67, 75, 83, 92, 100, 117, 133, 150, 167, 200 233,
11, 44, 77, 111, 144 for outline fonts.
Returns:
None
Raises:
RuntimeError: Invalid font size.
Warning: Your font is currently set... | brotherprint/brotherprint.py | char_size | HSRNetwork/python-brotherprint | 0 | python | def char_size(self, size):
"Changes font size\n\n Args:\n size: change font size. Options are 24' '32' '48' for bitmap fonts\n 33, 38, 42, 46, 50, 58, 67, 75, 83, 92, 100, 117, 133, 150, 167, 200 233,\n 11, 44, 77, 111, 144 for outline fonts.\n Returns:\n No... | def char_size(self, size):
"Changes font size\n\n Args:\n size: change font size. Options are 24' '32' '48' for bitmap fonts\n 33, 38, 42, 46, 50, 58, 67, 75, 83, 92, 100, 117, 133, 150, 167, 200 233,\n 11, 44, 77, 111, 144 for outline fonts.\n Returns:\n No... |
46f8a096c52a68dacffc5c50881bc1845e4782630428b7e1b2ba6615f2ff8dc5 | def select_font(self, font):
"Select font type\n\n Choices are:\n <Bit map fonts>\n 'brougham'\n 'lettergothicbold'\n 'brusselsbit'\n 'helsinkibit'\n 'sandiego'\n <Outline fonts>\n 'lettergothic'\n 'brusselsoutline'\n 'helsinkioutline'\n\n... | Select font type
Choices are:
<Bit map fonts>
'brougham'
'lettergothicbold'
'brusselsbit'
'helsinkibit'
'sandiego'
<Outline fonts>
'lettergothic'
'brusselsoutline'
'helsinkioutline'
Args:
font: font type
Returns:
None
Raises:
RuntimeError: Invalid font. | brotherprint/brotherprint.py | select_font | HSRNetwork/python-brotherprint | 0 | python | def select_font(self, font):
"Select font type\n\n Choices are:\n <Bit map fonts>\n 'brougham'\n 'lettergothicbold'\n 'brusselsbit'\n 'helsinkibit'\n 'sandiego'\n <Outline fonts>\n 'lettergothic'\n 'brusselsoutline'\n 'helsinkioutline'\n\n... | def select_font(self, font):
"Select font type\n\n Choices are:\n <Bit map fonts>\n 'brougham'\n 'lettergothicbold'\n 'brusselsbit'\n 'helsinkibit'\n 'sandiego'\n <Outline fonts>\n 'lettergothic'\n 'brusselsoutline'\n 'helsinkioutline'\n\n... |
c9d4bb46ad0310662271733643b49b23dd7997a35069af8c06d88fc069d259f2 | def char_style(self, style):
"Sets the character style.\n\n Args:\n style: The desired character style. Choose from 'normal', 'outline', 'shadow', and 'outlineshadow'\n Returns:\n None\n Raises:\n RuntimeError: Invalid character style\n "
styleset = {... | Sets the character style.
Args:
style: The desired character style. Choose from 'normal', 'outline', 'shadow', and 'outlineshadow'
Returns:
None
Raises:
RuntimeError: Invalid character style | brotherprint/brotherprint.py | char_style | HSRNetwork/python-brotherprint | 0 | python | def char_style(self, style):
"Sets the character style.\n\n Args:\n style: The desired character style. Choose from 'normal', 'outline', 'shadow', and 'outlineshadow'\n Returns:\n None\n Raises:\n RuntimeError: Invalid character style\n "
styleset = {... | def char_style(self, style):
"Sets the character style.\n\n Args:\n style: The desired character style. Choose from 'normal', 'outline', 'shadow', and 'outlineshadow'\n Returns:\n None\n Raises:\n RuntimeError: Invalid character style\n "
styleset = {... |
cc988fa3fd1d21101cca3df42c33c31a72d054dec9ca149dce2697cb5e779c06 | def pica_pitch(self):
'Print subsequent data with pica pitch (10 char/inch)\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.send((chr(27) + 'P')) | Print subsequent data with pica pitch (10 char/inch)
Args:
None
Returns:
None
Raises:
None | brotherprint/brotherprint.py | pica_pitch | HSRNetwork/python-brotherprint | 0 | python | def pica_pitch(self):
'Print subsequent data with pica pitch (10 char/inch)\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.send((chr(27) + 'P')) | def pica_pitch(self):
'Print subsequent data with pica pitch (10 char/inch)\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.send((chr(27) + 'P'))<|docstring|>Print subsequent data with pica pitch (10 char/inch)
Args:
None
Returns:
... |
e984b7ae5af5493c831a034db6724cb4f9656dfc462a361b169692e05538112b | def elite_pitch(self):
'Print subsequent data with elite pitch (12 char/inch)\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.send((chr(27) + 'M')) | Print subsequent data with elite pitch (12 char/inch)
Args:
None
Returns:
None
Raises:
None | brotherprint/brotherprint.py | elite_pitch | HSRNetwork/python-brotherprint | 0 | python | def elite_pitch(self):
'Print subsequent data with elite pitch (12 char/inch)\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.send((chr(27) + 'M')) | def elite_pitch(self):
'Print subsequent data with elite pitch (12 char/inch)\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.send((chr(27) + 'M'))<|docstring|>Print subsequent data with elite pitch (12 char/inch)
Args:
None
Returns:... |
f1230078c0bb055f02b37aba17dd72b819ba070668ad5c3d9c4939f3135d8b03 | def micron_pitch(self):
'Print subsequent data with micron pitch (15 char/inch)\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.send((chr(27) + 'g')) | Print subsequent data with micron pitch (15 char/inch)
Args:
None
Returns:
None
Raises:
None | brotherprint/brotherprint.py | micron_pitch | HSRNetwork/python-brotherprint | 0 | python | def micron_pitch(self):
'Print subsequent data with micron pitch (15 char/inch)\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.send((chr(27) + 'g')) | def micron_pitch(self):
'Print subsequent data with micron pitch (15 char/inch)\n\n Args:\n None\n Returns:\n None\n Raises:\n None\n '
self.send((chr(27) + 'g'))<|docstring|>Print subsequent data with micron pitch (15 char/inch)
Args:
None
Retur... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.