prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (C) 2011-2015 Patrick Totzke <patricktotzke@gmail.com> # This file is released under the GNU GPL, version 3 or a later revision. # For further details see the COPYING file from __future__ import absolute_import import re import abc class AddressbookE...
lookup
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/license...
<|file_name|>object_fca.py<|end_file_name|><|fim▁begin|>class Object: def __init__(self, name):<|fim▁hole|> @property def name(self): return self._name<|fim▁end|>
self._name = name
<|file_name|>object_fca.py<|end_file_name|><|fim▁begin|>class Object: <|fim_middle|> <|fim▁end|>
def __init__(self, name): self._name = name @property def name(self): return self._name
<|file_name|>object_fca.py<|end_file_name|><|fim▁begin|>class Object: def __init__(self, name): <|fim_middle|> @property def name(self): return self._name <|fim▁end|>
self._name = name
<|file_name|>object_fca.py<|end_file_name|><|fim▁begin|>class Object: def __init__(self, name): self._name = name @property def name(self): <|fim_middle|> <|fim▁end|>
return self._name
<|file_name|>object_fca.py<|end_file_name|><|fim▁begin|>class Object: def <|fim_middle|>(self, name): self._name = name @property def name(self): return self._name <|fim▁end|>
__init__
<|file_name|>object_fca.py<|end_file_name|><|fim▁begin|>class Object: def __init__(self, name): self._name = name @property def <|fim_middle|>(self): return self._name <|fim▁end|>
name
<|file_name|>Execute.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # # Copyright (c) 2001 - 2016 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restric...
assert v == 0, v v = env.Execute(Action(r'%(_python_)s $COPY f.in f.out'))
<|file_name|>Execute.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # # Copyright (c) 2001 - 2016 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restric...
expect = r"""scons: \*\*\* Error 1 scons: \*\*\* Error 2 scons: \*\*\* nonexistent.in/\*\.\*: (The system cannot find the path specified|Das System kann den angegebenen Pfad nicht finden)"""
<|file_name|>Execute.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # # Copyright (c) 2001 - 2016 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restric...
expect = r"""scons: \*\*\* Error 1 scons: \*\*\* Error 2 scons: \*\*\* nonexistent\.in: No such file or directory"""
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .DiscreteFactor import State, DiscreteFactor from .CPD import TabularCPD from .JointProbabilityDistribution import JointProbabilityDistribution<|fim▁hole|> 'DiscreteFactor', 'State' ]<|fim▁end|>
__all__ = ['TabularCPD',
<|file_name|>server.py<|end_file_name|><|fim▁begin|># DO NOT EDIT THIS FILE. This file will be overwritten when re-running go-raml. from app import app import gevent from gevent.pywsgi import WSGIServer from gevent.pool import Pool from gevent import monkey import signal monkey.patch_all() server = WSGIServer((''...
def stop():
<|file_name|>server.py<|end_file_name|><|fim▁begin|># DO NOT EDIT THIS FILE. This file will be overwritten when re-running go-raml. from app import app import gevent from gevent.pywsgi import WSGIServer from gevent.pool import Pool from gevent import monkey import signal monkey.patch_all() server = WSGIServer((''...
server.stop()
<|file_name|>server.py<|end_file_name|><|fim▁begin|># DO NOT EDIT THIS FILE. This file will be overwritten when re-running go-raml. from app import app import gevent from gevent.pywsgi import WSGIServer from gevent.pool import Pool from gevent import monkey import signal monkey.patch_all() server = WSGIServer((''...
server.serve_forever()
<|file_name|>server.py<|end_file_name|><|fim▁begin|># DO NOT EDIT THIS FILE. This file will be overwritten when re-running go-raml. from app import app import gevent from gevent.pywsgi import WSGIServer from gevent.pool import Pool from gevent import monkey import signal monkey.patch_all() server = WSGIServer((''...
stop
<|file_name|>test_twelve_tone.py<|end_file_name|><|fim▁begin|>from click.testing import CliRunner<|fim▁hole|>from twelve_tone.cli import main def test_main(): runner = CliRunner() result = runner.invoke(main, []) assert result.exit_code == 0<|fim▁end|>
<|file_name|>test_twelve_tone.py<|end_file_name|><|fim▁begin|> from click.testing import CliRunner from twelve_tone.cli import main def test_main(): <|fim_middle|> <|fim▁end|>
runner = CliRunner() result = runner.invoke(main, []) assert result.exit_code == 0
<|file_name|>test_twelve_tone.py<|end_file_name|><|fim▁begin|> from click.testing import CliRunner from twelve_tone.cli import main def <|fim_middle|>(): runner = CliRunner() result = runner.invoke(main, []) assert result.exit_code == 0 <|fim▁end|>
test_main
<|file_name|>flow_management.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from flask import render_template, redirect, url_for, flash, abort from purchasing.decorators import requires_roles from purchasing.data.stages import Stage from purchasing.data.flows import Flow from purchasing.conductor.forms impor...
flash('Flow successfully updated', 'alert-success') return redirect(url_for('conductor.flow_detail', flow_id=flow.id))
<|file_name|>flow_management.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from flask import render_template, redirect, url_for, flash, abort from purchasing.decorators import requires_roles from purchasing.data.stages import Stage from purchasing.data.flows import Flow from purchasing.conductor.forms impor...
'''Create a new flow :status 200: Render the new flow template :status 302: Try to create a new flow using the :py:class:`~purchasing.conductor.forms.NewFlowForm`, redirect to the flows list view if successful ''' stages = Stage.choices_factory() form = NewFlowForm(stages=stages...
<|file_name|>flow_management.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from flask import render_template, redirect, url_for, flash, abort from purchasing.decorators import requires_roles from purchasing.data.stages import Stage from purchasing.data.flows import Flow from purchasing.conductor.forms impor...
'''List all flows :status 200: Render the all flows list template ''' flows = Flow.query.order_by(Flow.flow_name).all() active, archived = [], [] for flow in flows: if flow.is_archived: archived.append(flow) else: active.append(flow) return render_tem...
<|file_name|>flow_management.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from flask import render_template, redirect, url_for, flash, abort from purchasing.decorators import requires_roles from purchasing.data.stages import Stage from purchasing.data.flows import Flow from purchasing.conductor.forms impor...
'''View/edit a flow's details :status 200: Render the flow edit template :status 302: Post changes to the a flow using the submitted :py:class:`~purchasing.conductor.forms.FlowForm`, redirect back to the current flow's detail page if successful ''' flow = Flow.query.get(flow_id) ...
<|file_name|>flow_management.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from flask import render_template, redirect, url_for, flash, abort from purchasing.decorators import requires_roles from purchasing.data.stages import Stage from purchasing.data.flows import Flow from purchasing.conductor.forms impor...
stage_order = [] for entry in form.stage_order.entries: # try to evaluate the return value as an ID try: stage_id = int(entry.data) # otherwise it's a new stage except ValueError: new_stage = Stage.create(name=entry.data) ...
<|file_name|>flow_management.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from flask import render_template, redirect, url_for, flash, abort from purchasing.decorators import requires_roles from purchasing.data.stages import Stage from purchasing.data.flows import Flow from purchasing.conductor.forms impor...
archived.append(flow)
<|file_name|>flow_management.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from flask import render_template, redirect, url_for, flash, abort from purchasing.decorators import requires_roles from purchasing.data.stages import Stage from purchasing.data.flows import Flow from purchasing.conductor.forms impor...
active.append(flow)
<|file_name|>flow_management.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from flask import render_template, redirect, url_for, flash, abort from purchasing.decorators import requires_roles from purchasing.data.stages import Stage from purchasing.data.flows import Flow from purchasing.conductor.forms impor...
form = FlowForm(obj=flow) if form.validate_on_submit(): flow.update( flow_name=form.data['flow_name'], is_archived=form.data['is_archived'] ) flash('Flow successfully updated', 'alert-success') return redirect(url_for('cond...
<|file_name|>flow_management.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from flask import render_template, redirect, url_for, flash, abort from purchasing.decorators import requires_roles from purchasing.data.stages import Stage from purchasing.data.flows import Flow from purchasing.conductor.forms impor...
flow.update( flow_name=form.data['flow_name'], is_archived=form.data['is_archived'] ) flash('Flow successfully updated', 'alert-success') return redirect(url_for('conductor.flow_detail', flow_id=flow.id))
<|file_name|>flow_management.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from flask import render_template, redirect, url_for, flash, abort from purchasing.decorators import requires_roles from purchasing.data.stages import Stage from purchasing.data.flows import Flow from purchasing.conductor.forms impor...
new_flow
<|file_name|>flow_management.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from flask import render_template, redirect, url_for, flash, abort from purchasing.decorators import requires_roles from purchasing.data.stages import Stage from purchasing.data.flows import Flow from purchasing.conductor.forms impor...
flows_list
<|file_name|>flow_management.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from flask import render_template, redirect, url_for, flash, abort from purchasing.decorators import requires_roles from purchasing.data.stages import Stage from purchasing.data.flows import Flow from purchasing.conductor.forms impor...
flow_detail
<|file_name|>test_compressed_int_list.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2017 GIG Technology NV # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http:/...
print 'Expected: %r' % expected
<|file_name|>test_compressed_int_list.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2017 GIG Technology NV # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http:/...
l = [1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1] def setUp(self, datastore_hr_probability=0): mc_unittest.TestCase.setUp(self, datastore_hr_probability=datastore_hr_probability) class MyModel(db.Expando): pass m = MyModel(key_name='test') m.test = TestCase.l m.p...
<|file_name|>test_compressed_int_list.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2017 GIG Technology NV # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http:/...
mc_unittest.TestCase.setUp(self, datastore_hr_probability=datastore_hr_probability) class MyModel(db.Expando): pass m = MyModel(key_name='test') m.test = TestCase.l m.put()
<|file_name|>test_compressed_int_list.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2017 GIG Technology NV # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http:/...
pass
<|file_name|>test_compressed_int_list.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2017 GIG Technology NV # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http:/...
class MyModel(CompressedIntegerListExpando): _attribute_prefix = 'test' m = MyModel.get_by_key_name('test') self.assertListEqual(TestCase.l, m.test) dict_repr = db.to_dict(m) self.assertTrue(isinstance(dict_repr['test'], basestring))
<|file_name|>test_compressed_int_list.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2017 GIG Technology NV # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http:/...
_attribute_prefix = 'test'
<|file_name|>test_compressed_int_list.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2017 GIG Technology NV # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http:/...
class MyModel(CompressedIntegerListExpando): _attribute_prefix = 'test' m = MyModel.get_by_key_name('test') m.test.append(5) m.put() m = MyModel.get_by_key_name('test') self.assertListEqual(TestCase.l + [5], m.test)
<|file_name|>test_compressed_int_list.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2017 GIG Technology NV # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http:/...
_attribute_prefix = 'test'
<|file_name|>test_compressed_int_list.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2017 GIG Technology NV # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http:/...
class MyModel(CompressedIntegerListExpando): _attribute_prefix = 'test' m = MyModel.get_by_key_name('test') print 'Before: %r' % m.test m.test.ljust(5, 0, 10) # will append 5 zeroes, and limit the number of entries to 10 print 'After: %r' % m.test expected =...
<|file_name|>test_compressed_int_list.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2017 GIG Technology NV # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http:/...
_attribute_prefix = 'test'
<|file_name|>test_compressed_int_list.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2017 GIG Technology NV # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http:/...
setUp
<|file_name|>test_compressed_int_list.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2017 GIG Technology NV # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http:/...
test_get_custom_prop
<|file_name|>test_compressed_int_list.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2017 GIG Technology NV # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http:/...
test_append
<|file_name|>test_compressed_int_list.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2017 GIG Technology NV # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http:/...
test_ljust
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
chunkStart = (chunkStart[0], chunkStart[1], 0) chunk = textCut(self.input, (0, 0, 2), nextChunk[1]) self.output.options['modifiable'] = True
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: <|fim_middle|> <|fim▁end|>
""" Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the accepted chunks, or the editing statement) """ def __init__(self, plugin, buffers): self.windowsManager = plugin.windowsManager self.coqManager = p...
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
self.windowsManager = plugin.windowsManager self.coqManager = plugin.coqManager self.input = buffers[0] self.output = buffers[1] # Each chunk is describe by the following tuple : (startPos, endPos, newLine), where startPos and endPos are coords tuple self.chunks = [] # The whole file content self.code =...
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
""" Init the newline-cursor in the Compiled buffer. """ self.output.options['modifiable'] = True del self.output[:] self.drawNewlineCursor(False) self.output.options['modifiable'] = False self.editNewLine = False # We backtrack every chunks self.chunks = self.chunks[:- self.coqManager.rewind(len(self.ch...
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
if newLine: self.windowsManager.commands('__Compiled__', ["normal G$a Dt"]) else: self.windowsManager.commands('__Compiled__', ["normal G$a PR"])
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
nextChunk = self.windowsManager.input.getChunk(self.input, (0, 0)) if nextChunk : if self.coqManager.sendChunk(nextChunk[0]): if self.editNewLine: chunkStart = (0, textCursorPos(self.output)[1] + 1, 2) else: chunkStart = textCursorPos(self.output, diffX = 3) # diffX=2 to ignore the newline-curs...
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
""" Backtrack of one chunk """ if len(self.chunks) <= 0: print("No chunk to backtrack !") return None actualRewind = self.coqManager.rewind(1) if actualRewind == 1: self.output.options['modifiable'] = True # Remove the last newline-cursor self.windowsManager.commands('__Compiled__', ["normal G$a...
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
try: file = open(filename, 'w') # We write the compiled buffer, and then the edit buffer for i in xrange(len(self.output) - 1): file.write(self.output[i] + "\n") interline = self.output[-1][:-4] # We don't take the newline-cursor if not self.editNewLine: interline += self.input[0] file.write...
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
self.initOutputCursor() del self.chunks[:] del self.input[:] try: file = open(filename, 'r') # We simply add every lines in the Edit buffer firstLine = True for line in file: if firstLine: # We don't want to skip the first line self.input[0] = line firstLine = False else: self.inpu...
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
self.windowsManager.commands('__Compiled__', ["normal G$a Dt"])
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
self.windowsManager.commands('__Compiled__', ["normal G$a PR"])
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
if self.coqManager.sendChunk(nextChunk[0]): if self.editNewLine: chunkStart = (0, textCursorPos(self.output)[1] + 1, 2) else: chunkStart = textCursorPos(self.output, diffX = 3) # diffX=2 to ignore the newline-cursor chunkStart = (chunkStart[0], chunkStart[1], 0) chunk = textCut(self.input,...
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
if self.editNewLine: chunkStart = (0, textCursorPos(self.output)[1] + 1, 2) else: chunkStart = textCursorPos(self.output, diffX = 3) # diffX=2 to ignore the newline-cursor chunkStart = (chunkStart[0], chunkStart[1], 0) chunk = textCut(self.input, (0, 0, 2), nextChunk[1]) self.output.optio...
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
chunkStart = (0, textCursorPos(self.output)[1] + 1, 2)
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
chunkStart = textCursorPos(self.output, diffX = 3) # diffX=2 to ignore the newline-cursor chunkStart = (chunkStart[0], chunkStart[1], 0)
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
self.drawNewlineCursor(True) chunkEnd = (chunkEnd[0] + 1, chunkEnd[1], 1)
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
self.drawNewlineCursor(False) chunkEnd = (chunkEnd[0] + 1, chunkEnd[1], 0)
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
print("No chunk to backtrack !") return None
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
self.output.options['modifiable'] = True # Remove the last newline-cursor self.windowsManager.commands('__Compiled__', ["normal G$a"]) lastChunk = self.chunks[-1] chunk = textCut(self.output, lastChunk[0], lastChunk[1]) textPrepend(self.input, chunk, lastChunk[2]) self.chunks.pop() if len(self...
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
self.editNewLine = False
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
self.editNewLine = self.chunks[-1][2]
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
interline += self.input[0]
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
self.input[0] = line firstLine = False
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
self.input.append(line)
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
__init__
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
initOutputCursor
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
drawNewlineCursor
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
next
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
prev
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
write
<|file_name|>file.py<|end_file_name|><|fim▁begin|>from utils import textAppend, textPrepend, textCut, textEditLastChar, error, textCursorPos class File: """ Represents a file (A separated class allow to open several files at a time. The class also holds the whole file content. (The vim buffers only store either the ...
open
<|file_name|>Process58TestElement.py<|end_file_name|><|fim▁begin|># Copyright 2016 Casey Jaymes # This file is part of PySCAP. # # PySCAP is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of th...
<|file_name|>Process58TestElement.py<|end_file_name|><|fim▁begin|># Copyright 2016 Casey Jaymes # This file is part of PySCAP. # # PySCAP is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of th...
MODEL_MAP = { 'tag_name': 'process58_test', }
<|file_name|>test_form.py<|end_file_name|><|fim▁begin|>from constance.admin import ConstanceForm from django.forms import fields from django.test import TestCase class TestForm(TestCase): def test_form_field_types(self): f = ConstanceForm({}) self.assertIsInstance(f.fields['INT_VALUE'], fields....
<|file_name|>test_form.py<|end_file_name|><|fim▁begin|>from constance.admin import ConstanceForm from django.forms import fields from django.test import TestCase class TestForm(TestCase): <|fim_middle|> <|fim▁end|>
def test_form_field_types(self): f = ConstanceForm({}) self.assertIsInstance(f.fields['INT_VALUE'], fields.IntegerField) self.assertIsInstance(f.fields['BOOL_VALUE'], fields.BooleanField) self.assertIsInstance(f.fields['STRING_VALUE'], fields.CharField) self.assertIsInstanc...
<|file_name|>test_form.py<|end_file_name|><|fim▁begin|>from constance.admin import ConstanceForm from django.forms import fields from django.test import TestCase class TestForm(TestCase): def test_form_field_types(self): <|fim_middle|> <|fim▁end|>
f = ConstanceForm({}) self.assertIsInstance(f.fields['INT_VALUE'], fields.IntegerField) self.assertIsInstance(f.fields['BOOL_VALUE'], fields.BooleanField) self.assertIsInstance(f.fields['STRING_VALUE'], fields.CharField) self.assertIsInstance(f.fields['DECIMAL_VALUE'], fields.De...
<|file_name|>test_form.py<|end_file_name|><|fim▁begin|>from constance.admin import ConstanceForm from django.forms import fields from django.test import TestCase class TestForm(TestCase): def <|fim_middle|>(self): f = ConstanceForm({}) self.assertIsInstance(f.fields['INT_VALUE'], fields.Integer...
test_form_field_types
<|file_name|>plot_weighted_samples.py<|end_file_name|><|fim▁begin|>""" ===================== SVM: Weighted samples ===================== Plot decision function of a weighted dataset, where the size of points is proportional to its weight. """ print __doc__ import numpy as np import pylab as pl from sklearn import svm...
X = np.r_[np.random.randn(10, 2) + [1, 1], np.random.randn(10, 2)] Y = [1] * 10 + [-1] * 10 sample_weight = 100 * np.abs(np.random.randn(20))
<|file_name|>grove_slide_potentiometer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # # GrovePi Example for using the Grove Slide Potentiometer (http://www.seeedstudio.com/wiki/Grove_-_Slide_Potentiometer) # # The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: htt...
in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
<|file_name|>grove_slide_potentiometer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # # GrovePi Example for using the Grove Slide Potentiometer (http://www.seeedstudio.com/wiki/Grove_-_Slide_Potentiometer) # # The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: htt...
grovepi.digitalWrite(led,1)
<|file_name|>grove_slide_potentiometer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # # GrovePi Example for using the Grove Slide Potentiometer (http://www.seeedstudio.com/wiki/Grove_-_Slide_Potentiometer) # # The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: htt...
grovepi.digitalWrite(led,0)
<|file_name|>tests_iso_14443_a_card_1_hydranfc_v2.py<|end_file_name|><|fim▁begin|>import time from pynfcreader.sessions.iso14443.iso14443a import Iso14443ASession def test_iso_14443_a_card_1_generic(hydranfc_connection): hn = Iso14443ASession(drv=hydranfc_connection, block_size=120) hn.connect() hn.fiel...
hn.field_on()
<|file_name|>tests_iso_14443_a_card_1_hydranfc_v2.py<|end_file_name|><|fim▁begin|>import time from pynfcreader.sessions.iso14443.iso14443a import Iso14443ASession def test_iso_14443_a_card_1_generic(hydranfc_connection): <|fim_middle|> <|fim▁end|>
hn = Iso14443ASession(drv=hydranfc_connection, block_size=120) hn.connect() hn.field_off() time.sleep(0.1) hn.field_on() hn.polling() r = hn.send_apdu("00 a4 04 00 0E 32 50 41 59 2E 53 59 53 2E 44 44 46 30 31 00") assert b'oW\x84\x0e2PAY.S.DDF01\xa5E\xbf\x0cBO\x07\xa0\x00\x00\x00...
<|file_name|>tests_iso_14443_a_card_1_hydranfc_v2.py<|end_file_name|><|fim▁begin|>import time from pynfcreader.sessions.iso14443.iso14443a import Iso14443ASession def <|fim_middle|>(hydranfc_connection): hn = Iso14443ASession(drv=hydranfc_connection, block_size=120) hn.connect() hn.field_off() time....
test_iso_14443_a_card_1_generic
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|># TODO When raising an exception pass a lambda function, the function being the module/path/name thing ERROR = {'default': "Unknown engine error ({0})", 400: "Bad request sent to search API ({0})", 401: "Incorrect API Key ({0})", 403: "...
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|># TODO When raising an exception pass a lambda function, the function being the module/path/name thing ERROR = {'default': "Unknown engine error ({0})", 400: "Bad request sent to search API ({0})", 401: "Incorrect API Key ({0})", 403: "...
""" Abstract class representing an ifind search exception. """ def __init__(self, module, message): """ SearchException constructor. Args: module (str): name of module/class that's raising exception message (str): exception message to be displayed ...
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|># TODO When raising an exception pass a lambda function, the function being the module/path/name thing ERROR = {'default': "Unknown engine error ({0})", 400: "Bad request sent to search API ({0})", 401: "Incorrect API Key ({0})", 403: "...
""" SearchException constructor. Args: module (str): name of module/class that's raising exception message (str): exception message to be displayed Usage: raise SearchException("Test", "this is an error") """ message = "{0} - {1}".fo...
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|># TODO When raising an exception pass a lambda function, the function being the module/path/name thing ERROR = {'default': "Unknown engine error ({0})", 400: "Bad request sent to search API ({0})", 401: "Incorrect API Key ({0})", 403: "...
""" Thrown when an Engine connectivity error occurs. Returns specific response message if status code specified. """ def __init__(self, engine, message, code=None): """ EngineException constructor. Args: engine (str): name of engine that's raising exception ...
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|># TODO When raising an exception pass a lambda function, the function being the module/path/name thing ERROR = {'default': "Unknown engine error ({0})", 400: "Bad request sent to search API ({0})", 401: "Incorrect API Key ({0})", 403: "...
""" EngineException constructor. Args: engine (str): name of engine that's raising exception message (str): exception message to be displayed (ignored usually here) Kwargs: code (int): response status code of issued request Usage: ...
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|># TODO When raising an exception pass a lambda function, the function being the module/path/name thing ERROR = {'default': "Unknown engine error ({0})", 400: "Bad request sent to search API ({0})", 401: "Incorrect API Key ({0})", 403: "...
""" Thrown when an Engine can't be dynamically loaded. """ pass
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|># TODO When raising an exception pass a lambda function, the function being the module/path/name thing ERROR = {'default': "Unknown engine error ({0})", 400: "Bad request sent to search API ({0})", 401: "Incorrect API Key ({0})", 403: "...
""" Thrown when an Engine's API key hasn't been provided. """ pass
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|># TODO When raising an exception pass a lambda function, the function being the module/path/name thing ERROR = {'default': "Unknown engine error ({0})", 400: "Bad request sent to search API ({0})", 401: "Incorrect API Key ({0})", 403: "...
""" Thrown when a query parameters incompatible or missing. """ pass
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|># TODO When raising an exception pass a lambda function, the function being the module/path/name thing ERROR = {'default': "Unknown engine error ({0})", 400: "Bad request sent to search API ({0})", 401: "Incorrect API Key ({0})", 403: "...
""" Thrown when cache connectivity error occurs. """ pass
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|># TODO When raising an exception pass a lambda function, the function being the module/path/name thing ERROR = {'default': "Unknown engine error ({0})", 400: "Bad request sent to search API ({0})", 401: "Incorrect API Key ({0})", 403: "...
""" Thrown when an invalid query is passed to engine's search method. """ pass
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|># TODO When raising an exception pass a lambda function, the function being the module/path/name thing ERROR = {'default': "Unknown engine error ({0})", 400: "Bad request sent to search API ({0})", 401: "Incorrect API Key ({0})", 403: "...
""" Thrown when an engine's request rate limit has been exceeded. """ pass