function
stringlengths
11
56k
repo_name
stringlengths
5
60
features
list
def _on_size_spin_button_value_changed(self, size_spin_button): if self._locker.is_unlocked("emit_size_spin_button_value_changed"): self._locker.lock("update_spin_button")
khalim19/gimp-plugin-export-layers
[ 522, 38, 522, 29, 1403878280 ]
def _on_item_button_remove_clicked(self, button, item): self._locker.lock("emit_size_spin_button_value_changed")
khalim19/gimp-plugin-export-layers
[ 522, 38, 522, 29, 1403878280 ]
def _on_item_widget_size_allocate(self, item_widget, allocation, item): if item in self._items_allocations: self._update_width(allocation.width - self._items_allocations[item].width) self._update_height(allocation.height - self._items_allocations[item].height) else: self._update_width(allocati...
khalim19/gimp-plugin-export-layers
[ 522, 38, 522, 29, 1403878280 ]
def _update_width(self, width_diff): if self._items_total_width is None: self._items_total_width = self.get_allocation().width
khalim19/gimp-plugin-export-layers
[ 522, 38, 522, 29, 1403878280 ]
def _update_height(self, height_diff): if self._items_total_height is None: self._items_total_height = self.get_allocation().height
khalim19/gimp-plugin-export-layers
[ 522, 38, 522, 29, 1403878280 ]
def _update_dimension( self, size_diff, total_size, max_visible_size, dimension_request_property): if max_visible_size is None: is_max_visible_size_unlimited = True else: is_max_visible_size_unlimited = max_visible_size <= 0
khalim19/gimp-plugin-export-layers
[ 522, 38, 522, 29, 1403878280 ]
def _rename_item_names(self, start_index): for index, item in enumerate(self._items[start_index:]): item.label.set_label(self._get_item_name(index + 1 + start_index))
khalim19/gimp-plugin-export-layers
[ 522, 38, 522, 29, 1403878280 ]
def _get_item_name(index): return _("Element") + " " + str(index)
khalim19/gimp-plugin-export-layers
[ 522, 38, 522, 29, 1403878280 ]
def __init__(self, item_widget): super().__init__(item_widget)
khalim19/gimp-plugin-export-layers
[ 522, 38, 522, 29, 1403878280 ]
def label(self): return self._label
khalim19/gimp-plugin-export-layers
[ 522, 38, 522, 29, 1403878280 ]
def __init__(self): self._tokens = collections.defaultdict(int)
khalim19/gimp-plugin-export-layers
[ 522, 38, 522, 29, 1403878280 ]
def lock_temp(self, key): self.lock(key) try: yield finally: self.unlock(key)
khalim19/gimp-plugin-export-layers
[ 522, 38, 522, 29, 1403878280 ]
def lock(self, key): self._tokens[key] += 1
khalim19/gimp-plugin-export-layers
[ 522, 38, 522, 29, 1403878280 ]
def unlock(self, key): if self._tokens[key] > 0: self._tokens[key] -= 1
khalim19/gimp-plugin-export-layers
[ 522, 38, 522, 29, 1403878280 ]
def is_locked(self, key): return self._tokens[key] > 0
khalim19/gimp-plugin-export-layers
[ 522, 38, 522, 29, 1403878280 ]
def is_unlocked(self, key): return self._tokens[key] == 0
khalim19/gimp-plugin-export-layers
[ 522, 38, 522, 29, 1403878280 ]
def filter_ring(points, center, rminmax): """Filter points to be in a certain radial distance range from center. Parameters ---------- points : np.ndarray Candidate points. center : np.ndarray or tuple Center position. rminmax : tuple Tuple of min...
ercius/openNCEM
[ 44, 23, 44, 2, 1479513928 ]
def points_topolar(points, center): """Convert points to polar coordinate system. Can be either in pixel or real dim, but should be the same for points and center. Parameters ---------- points : np.ndarray Positions as two column array. center : np.ndarray or tuple ...
ercius/openNCEM
[ 44, 23, 44, 2, 1479513928 ]
def residuals_center( param, data): """Residual function for minimizing the deviations from the mean radial distance. Parameters ---------- param : np.ndarray The center to optimize. data : np.ndarray The points in x,y coordinates of the original image. Returns ...
ercius/openNCEM
[ 44, 23, 44, 2, 1479513928 ]
def optimize_center(points, center, maxfev=1000, verbose=None): """Optimize the center by minimizing the sum of square deviations from the mean radial distance. Parameters ---------- points : np.ndarray The points to which the optimization is done (x,y coords in org image). cent...
ercius/openNCEM
[ 44, 23, 44, 2, 1479513928 ]
def rad_dis(theta, alpha, beta, order=2): """Radial distortion due to ellipticity or higher order distortion. Relative distortion, to be multiplied with radial distance. Parameters ---------- theta : np.ndarray Angles at which to evaluate. Must be float. alpha : float ...
ercius/openNCEM
[ 44, 23, 44, 2, 1479513928 ]
def residuals_dis(param, points, ns): """Residual function for distortions. Parameters ---------- param : np.ndarray Parameters for distortion. points : np.ndarray Points to fit to. ns : tuple List of orders to account for. Returns ------...
ercius/openNCEM
[ 44, 23, 44, 2, 1479513928 ]
def optimize_distortion(points, ns, maxfev=1000, verbose=False): """Optimize distortions. The orders in the list ns are first fitted subsequently and the result is refined in a final fit simultaneously fitting all orders. Parameters ---------- points : np.ndarray Points to optimize...
ercius/openNCEM
[ 44, 23, 44, 2, 1479513928 ]
def home_view(request): topics = [] organized_topics = defaultdict(list) for tag in Tag.tags.public().top_level(): child_tags = tag.children.values_list('id') resource_count = Resource.objects.filter(status=Resource.APPROVED).filter( Q(resourcetag__tag__pk__in=child_tags) | Q(res...
mPowering/django-orb
[ 2, 10, 2, 81, 1420822795 ]
def tag_view(request, tag_slug): """ Renders a tag detail page. Allows the user to paginate resultes and sort by preselected options. Args: request: HttpRequest tag_slug: the identifier for the tag Returns: Rendered response with a tag's resource list """ tag = ge...
mPowering/django-orb
[ 2, 10, 2, 81, 1420822795 ]
def resource_permalink_view(request, id): resource = get_object_or_404(Resource, pk=id) return resource_view(request, resource.slug)
mPowering/django-orb
[ 2, 10, 2, 81, 1420822795 ]
def resource_create_step1_view(request): if request.user.is_anonymous(): return render(request, 'orb/login_required.html', { 'message': _(u'You need to be logged in to add a resource.'), }) if request.method == 'POST': form = ResourceStep1Form(request.POST, request.FILES, re...
mPowering/django-orb
[ 2, 10, 2, 81, 1420822795 ]
def resource_create_file_delete_view(request, id, file_id): # check ownership resource = get_object_or_404(Resource, pk=id) if not resource_can_edit(resource, request.user): raise Http404() try: ResourceFile.objects.get(resource=resource, pk=file_id).delete() except ResourceFile.Doe...
mPowering/django-orb
[ 2, 10, 2, 81, 1420822795 ]
def resource_edit_file_delete_view(request, id, file_id): # check ownership resource = get_object_or_404(Resource, pk=id) if not resource_can_edit(resource, request.user): raise Http404() try: ResourceFile.objects.get(resource=resource, pk=file_id).delete() except ResourceFile.DoesN...
mPowering/django-orb
[ 2, 10, 2, 81, 1420822795 ]
def resource_create_thanks_view(request, id): resource = get_object_or_404(Resource, pk=id) if not resource_can_edit(resource, request.user): raise Http404() return render(request, 'orb/resource/create_thanks.html', {'resource': resource})
mPowering/django-orb
[ 2, 10, 2, 81, 1420822795 ]
def resource_approve_view(request, id): if not request.user.is_staff: return HttpResponse(status=401, content="Not Authorized") resource = Resource.objects.get(pk=id) resource.status = Resource.APPROVED resource.save() resource_workflow.send(sender=resource, resource=resource, ...
mPowering/django-orb
[ 2, 10, 2, 81, 1420822795 ]
def resource_reject_sent_view(request, id): if not request.user.is_staff: return HttpResponse(status=401, content="Not Authorized") resource = Resource.objects.get(pk=id) return render(request, 'orb/resource/status_updated.html', {'resource': resource, })
mPowering/django-orb
[ 2, 10, 2, 81, 1420822795 ]
def resource_edit_view(request, resource_id): resource = get_object_or_404(Resource, pk=resource_id) if not resource_can_edit(resource, request.user): raise Http404() if request.method == 'POST': form = ResourceStep1Form(data=request.POST, files=request.FILES) resource_form_set_choi...
mPowering/django-orb
[ 2, 10, 2, 81, 1420822795 ]
def resource_edit_thanks_view(request, id): resource = get_object_or_404(Resource, pk=id) if not resource_can_edit(resource, request.user): raise Http404() return render(request, 'orb/resource/edit_thanks.html', {'resource': resource})
mPowering/django-orb
[ 2, 10, 2, 81, 1420822795 ]
def search_advanced_view(request, tag_id=None): if request.method == 'POST': form = AdvancedSearchForm(request.POST) if form.is_valid(): urlparams = request.POST.copy() # delete these from params as not required del urlparams['csrfmiddlewaretoken'] de...
mPowering/django-orb
[ 2, 10, 2, 81, 1420822795 ]
def collection_view(request, collection_slug): collection = get_object_or_404(Collection, slug=collection_slug, visibility=Collection.PUBLIC) data = Resource.objects.filter(collectionresource__collection=collection, status=Resource.APPROVED).order_by('collectionresour...
mPowering/django-orb
[ 2, 10, 2, 81, 1420822795 ]
def resource_form_set_choices(form): form.fields['health_topic'].choices = [(t.id, t.name) for t in Tag.objects.filter( category__top_level=True).order_by('order_by', 'name')] form.fields['resource_type'].choices = [(t.id, t.name) for t in Tag.objects.filter( category__slug='type').order_by('ord...
mPowering/django-orb
[ 2, 10, 2, 81, 1420822795 ]
def resource_can_edit(resource, user): if user.is_staff or user == resource.create_user or user == resource.update_user: return True else: return TagOwner.objects.filter(user__pk=user.id, tag__resourcetag__resource=resource).exists()
mPowering/django-orb
[ 2, 10, 2, 81, 1420822795 ]
def giudizio_positivo(self, autore): """ Registra un giudizio positivo :param autore: Autore del giudizio """ self._giudizio(autore, True)
CroceRossaItaliana/jorvik
[ 29, 20, 29, 131, 1424890427 ]
def _giudizio(self, autore, positivo): """ Registra un giudizio :param autore: Autore del giudizio :param positivo: Vero se positivo, falso se negativo """ g = self.giudizio_cerca(autore) if g: # Se gia' esiste un giudizio, modifico il tipo g.positivo...
CroceRossaItaliana/jorvik
[ 29, 20, 29, 131, 1424890427 ]
def giudizi_positivi(self): """ Restituisce il numero di giudizi positivi associati all'oggetto. """ return self._giudizi(self, True)
CroceRossaItaliana/jorvik
[ 29, 20, 29, 131, 1424890427 ]
def giudizi_negativi(self): """ Restituisce il numero di giudizi negativi associati all'oggetto. """ return self._giudizi(self, False)
CroceRossaItaliana/jorvik
[ 29, 20, 29, 131, 1424890427 ]
def giudizio_cerca(self, autore): """ Cerca il giudizio di un autore sull'oggetto. Se non presente, ritorna None. """ g = self.giudizi.filter(autore=autore)[:1] if g: return g return None
CroceRossaItaliana/jorvik
[ 29, 20, 29, 131, 1424890427 ]
def isFolder (idx=currentItemPos()): if DETVIDEXT and isVidExt(getTitle(idx)) : return False return True if getLi('Property(IsPlayable)',idx) in ('false', Empty) and not getFname(idx) else False
Taifxx/xxtrep
[ 9, 6, 9, 4, 1460037342 ]
def isVidExt(name): for itm in TAG_PAR_VIDEOSEXT: if name.endswith(itm) : return True return False
Taifxx/xxtrep
[ 9, 6, 9, 4, 1460037342 ]
def getJsp(dirPath, srcName): _itmList = eval(xbmc.executeJSONRPC(_listdircmd % (dirPath)))['result']['files'] _jsp = struct()
Taifxx/xxtrep
[ 9, 6, 9, 4, 1460037342 ]
def jsp_isFolder(jsp, idx): if jsp.itmList[idx]['filetype'] != 'folder' : return False return True
Taifxx/xxtrep
[ 9, 6, 9, 4, 1460037342 ]
def __init__(self, dirPath=Empty, srcName=Empty): if not dirPath : self.norm_init() else : self.jsp_init (dirPath, srcName)
Taifxx/xxtrep
[ 9, 6, 9, 4, 1460037342 ]
def jsp_init(self, dirPath, srcName):
Taifxx/xxtrep
[ 9, 6, 9, 4, 1460037342 ]
def norm_init(self):
Taifxx/xxtrep
[ 9, 6, 9, 4, 1460037342 ]
def setmanually(self, manlist): self.vidListItems = [itm for idx, itm in enumerate(self.vidListItemsRaw) if idx in manlist]
Taifxx/xxtrep
[ 9, 6, 9, 4, 1460037342 ]
def reverse(self): self.vidListItems.reverse() self.vidListItemsRaw.reverse()
Taifxx/xxtrep
[ 9, 6, 9, 4, 1460037342 ]
def getOnlyNexts(self): nexts = False retList = [] for itm in self.vidListItems: if itm[0] == self.vidCurr : nexts = True; continue if not nexts : continue retList.append(itm[1])
Taifxx/xxtrep
[ 9, 6, 9, 4, 1460037342 ]
def __init__(self, api_object: ApiCaller, action_name: str): self.api_object = api_object self.action_name = action_name self.help_description = self.help_description.format(self.api_object.endpoint_url)
PayloadSecurity/VxAPI
[ 193, 55, 193, 3, 1489176142 ]
def build_argument_builder(self, child_parser): return DefaultCliArguments(child_parser)
PayloadSecurity/VxAPI
[ 193, 55, 193, 3, 1489176142 ]
def attach_args(self, args): self.given_args = args.copy() args_to_send = args.copy() for arg_to_remove in self.args_to_prevent_from_being_send: if arg_to_remove in args_to_send: del args_to_send[arg_to_remove] if 'output' in args: self.cli_output...
PayloadSecurity/VxAPI
[ 193, 55, 193, 3, 1489176142 ]
def get_colored_response_status_code(self): response_code = self.api_object.get_response_status_code() return Color.success(response_code) if self.api_object.if_request_success() is True else Color.error(response_code)
PayloadSecurity/VxAPI
[ 193, 55, 193, 3, 1489176142 ]
def get_result_msg(self): if self.api_object.api_response.headers['Content-Type'] == 'text/html': raise ResponseTextContentTypeError('Can\'t print result, since it\'s \'text/html\' instead of expected content type with \'{}\' on board.'.format(self.api_object.api_expected_data_type)) if sel...
PayloadSecurity/VxAPI
[ 193, 55, 193, 3, 1489176142 ]
def get_result_msg_for_files(self): return self.result_msg_for_files.format(self.get_processed_output_path())
PayloadSecurity/VxAPI
[ 193, 55, 193, 3, 1489176142 ]
def get_date_string(self): now = datetime.datetime.now() return '{}_{}_{}_{}_{}_{}'.format(now.year, now.month, now.day, now.hour, now.minute, now.second)
PayloadSecurity/VxAPI
[ 193, 55, 193, 3, 1489176142 ]
def get_es_client(silent=False): """ Returns the elasticsearch client which uses the configuration file """ es_client = Elasticsearch([settings.ELASTIC_SEARCH_HOST], scheme='http', port=9200, http_compress=True) ...
fako/datascope
[ 5, 6, 5, 13, 1382612206 ]
def setup(self): self.set_name('DummySnuffling')
pyrocko/pyrocko
[ 164, 75, 164, 52, 1268295595 ]
def setUpClass(cls): ''' Create a reusable snuffler instance for all tests cases. ''' super(GUITest, cls).setUpClass() if no_gui: # nosetests runs this even when class is has @skip return from pyrocko.gui import snuffler as sm cls.snuffler = sm.get_...
pyrocko/pyrocko
[ 164, 75, 164, 52, 1268295595 ]
def tearDownClass(cls): ''' Quit snuffler. ''' if no_gui: # nosetests runs this even when class is has @skip return QTest.keyPress(cls.pile_viewer, 'q')
pyrocko/pyrocko
[ 164, 75, 164, 52, 1268295595 ]
def tearDown(self): self.clear_all_markers() for tempfn in self.tempfiles: os.remove(tempfn) self.viewer.set_time_range(*self.initial_trange)
pyrocko/pyrocko
[ 164, 75, 164, 52, 1268295595 ]
def write_to_input_line(self, text): '''emulate writing to inputline and press return''' pv = self.pile_viewer il = pv.inputline QTest.keyPress(pv, ':') QTest.keyClicks(il, text) QTest.keyPress(il, Qt.Key_Return)
pyrocko/pyrocko
[ 164, 75, 164, 52, 1268295595 ]
def trigger_menu_item(self, qmenu, action_text, dialog=False): ''' trigger a QMenu QAction with action_text. ''' for iaction, action in enumerate(qmenu.actions()): if action.text() == action_text: if dialog: def closeDialog(): dlg...
pyrocko/pyrocko
[ 164, 75, 164, 52, 1268295595 ]
def drag_slider(self, slider): ''' Click *slider*, drag from one side to the other, release mouse button repeat to restore inital state''' position = self.get_slider_position(slider) QTest.mouseMove(slider, pos=position.topLeft()) QTest.mousePress(slider, Qt.LeftButton) Q...
pyrocko/pyrocko
[ 164, 75, 164, 52, 1268295595 ]
def test_main_control_sliders(self): self.drag_slider(self.pile_viewer.highpass_control.slider) self.drag_slider(self.pile_viewer.lowpass_control.slider) self.drag_slider(self.pile_viewer.gain_control.slider) self.drag_slider(self.pile_viewer.rot_control.slider)
pyrocko/pyrocko
[ 164, 75, 164, 52, 1268295595 ]
def test_drawing_optimization(self): n = 505 lats = num.random.uniform(-90., 90., n) lons = num.random.uniform(-180., 180., n) events = [] for i, (lat, lon) in enumerate(zip(lats, lons)): events.append( model.Event(time=i, lat=lat, lon=lon, name='XXXX%...
pyrocko/pyrocko
[ 164, 75, 164, 52, 1268295595 ]
def test_save_image(self): tempfn_svg = self.get_tempfile() + '.svg' self.viewer.savesvg(fn=tempfn_svg) tempfn_png = self.get_tempfile() + '.png' self.viewer.savesvg(fn=tempfn_png)
pyrocko/pyrocko
[ 164, 75, 164, 52, 1268295595 ]
def test_add_remove_stations(self): n = 10 lats = num.random.uniform(-90., 90., n) lons = num.random.uniform(-180., 180., n) stations = [ model.station.Station(network=str(i), station=str(i), lat=lat, lon=lon) for i, (lat, lon) in ...
pyrocko/pyrocko
[ 164, 75, 164, 52, 1268295595 ]
def test_load_waveforms(self): self.viewer.load('data', regex=r'\w+.mseed') self.assertFalse(self.viewer.get_pile().is_empty())
pyrocko/pyrocko
[ 164, 75, 164, 52, 1268295595 ]
def test_event_marker(self): pv = self.pile_viewer self.add_one_pick() # select all markers QTest.keyPress(pv, 'a', Qt.ShiftModifier, 100) # convert to EventMarker QTest.keyPress(pv, 'e') QTest.keyPress(pv, 'd') for m in pv.viewer.get_markers(): ...
pyrocko/pyrocko
[ 164, 75, 164, 52, 1268295595 ]
def test_actions(self): # Click through many menu option combinations that do not require # further interaction. Activate options in pairs of two. pv = self.pile_viewer tinit = pv.viewer.tmin tinitlen = pv.viewer.tmax - pv.viewer.tmin non_dialog_actions = [ ...
pyrocko/pyrocko
[ 164, 75, 164, 52, 1268295595 ]
def test_frames(self): frame_snuffling = DummySnuffling() self.viewer.add_snuffling(frame_snuffling) frame_snuffling.call() # close three opened frames QTest.keyPress(self.pile_viewer, 'd') QTest.keyPress(self.pile_viewer, 'd') QTest.keyPress(self.pile_viewer, '...
pyrocko/pyrocko
[ 164, 75, 164, 52, 1268295595 ]
def __init__(self,age): self.age = age
tuxfux-hlp-notes/python-batches
[ 5, 15, 5, 2, 1481601578 ]
def __init__(self, in_queue, out_queue, name, description = None): super(APModule, self).__init__() signal.signal(signal.SIGINT, self.exit_gracefully) signal.signal(signal.SIGTERM, self.exit_gracefully) self.daemon = True self.config_list= [] # overwrite this list self.co...
SamuelDudley/APSyncWeb
[ 1, 3, 1, 4, 1494949233 ]
def update_config(self, config_list = []): if len(config_list): self.config_list = config_list for (var_name, var_default) in self.config_list: self.set_config(var_name, var_default)
SamuelDudley/APSyncWeb
[ 1, 3, 1, 4, 1494949233 ]
def send_ping(self): self.out_queue.put_nowait(ping(self.name, self.pid))
SamuelDudley/APSyncWeb
[ 1, 3, 1, 4, 1494949233 ]
def exit_gracefully(self, signum, frame): self.unload()
SamuelDudley/APSyncWeb
[ 1, 3, 1, 4, 1494949233 ]
def unload(self): print self.name, 'called unload' self.unload_callback() self.needs_unloading.set()
SamuelDudley/APSyncWeb
[ 1, 3, 1, 4, 1494949233 ]
def unload_callback(self): ''' overload to perform any module specific cleanup''' pass
SamuelDudley/APSyncWeb
[ 1, 3, 1, 4, 1494949233 ]
def run(self): if self.in_queue_thread is not None: self.in_queue_thread.start() while not self.needs_unloading.is_set(): try: self.main() except: print ("FATAL: module ({0}) exited while multiprocessing".format(self.name)) ...
SamuelDudley/APSyncWeb
[ 1, 3, 1, 4, 1494949233 ]
def main(self): pass
SamuelDudley/APSyncWeb
[ 1, 3, 1, 4, 1494949233 ]
def in_queue_handling(self, lock=None): while not self.needs_unloading.is_set(): (inputready,outputready,exceptready) = select.select([self.in_queue._reader],[],[],0.1) for s in inputready: while not self.in_queue.empty(): # drain the queue ...
SamuelDudley/APSyncWeb
[ 1, 3, 1, 4, 1494949233 ]
def process_in_queue_data(self, data): pass
SamuelDudley/APSyncWeb
[ 1, 3, 1, 4, 1494949233 ]
def log(self, message, level = 'INFO'):
SamuelDudley/APSyncWeb
[ 1, 3, 1, 4, 1494949233 ]
def set_config(self, var_name, var_default): new_val = self.config.get(var_name, var_default) try: cur_val = self.config[var_name] if new_val != cur_val: self.config_changed = True except: self.config_changed = True
SamuelDudley/APSyncWeb
[ 1, 3, 1, 4, 1494949233 ]
def __init__(self, name): self.ack = False
SamuelDudley/APSyncWeb
[ 1, 3, 1, 4, 1494949233 ]
def __init__(self, integration_widget, dioptas_model): """ :param integration_widget: Reference to an IntegrationWidget :param dioptas_model: reference to DioptasModel object :type integration_widget: IntegrationWidget :type dioptas_model: DioptasModel """ self.m...
Dioptas/Dioptas
[ 44, 25, 44, 14, 1421345772 ]
def get_phase_position_and_intensities(self, ind, clip=True): """ Obtains the positions and intensities for lines of a phase with an index ind within the cake view. No clipping is used for the first call to add the CakePhasePlot to the ImgWidget. Subsequent calls are used with clipping....
Dioptas/Dioptas
[ 44, 25, 44, 14, 1421345772 ]
def update_phase_lines(self, ind): cake_line_positions, cake_line_intensities = self.get_phase_position_and_intensities(ind) self.cake_view_widget.update_phase_intensities(ind, cake_line_positions, cake_line_intensities)
Dioptas/Dioptas
[ 44, 25, 44, 14, 1421345772 ]
def update_phase_visible(self, ind): if self.phase_model.phase_visible[ind] and self.integration_widget.img_mode == 'Cake' and \ self.integration_widget.img_phases_btn.isChecked(): self.cake_view_widget.show_cake_phase(ind) else: self.cake_view_widget.hide_cake_ph...
Dioptas/Dioptas
[ 44, 25, 44, 14, 1421345772 ]
def make_book_to_index(bible): btoi = {} for i, book in enumerate(bible): btoi[book['name'].lower()] = i return btoi
sentriz/steely
[ 21, 14, 21, 6, 1498783471 ]
def plugin_setup(): global bible, book_to_index try: bible = json.loads(open(BIBLE_FILE, encoding='utf-8-sig').read()) book_to_index = make_book_to_index(bible) return except BaseException as e: pass # We've tried nothing and we're all out of ideas, download a new bible. ...
sentriz/steely
[ 21, 14, 21, 6, 1498783471 ]
def help_command(bot, message: SteelyMessage, **kwargs): bot.sendMessage( HELP_STR, thread_id=message.thread_id, thread_type=message.thread_type)
sentriz/steely
[ 21, 14, 21, 6, 1498783471 ]
def get_quote(book, chapter, verse): return "{}\n - {} {}:{}".format( bible[book]["chapters"][chapter][verse], bible[book]["name"], chapter + 1, verse + 1)
sentriz/steely
[ 21, 14, 21, 6, 1498783471 ]
def __init__(self, tb): _threading.Thread.__init__(self) self.setDaemon(1) self.tb = tb self.done = False self.start()
bistromath/gr-smartnet
[ 44, 22, 44, 4, 1301549389 ]
def __init__(self, options, queue): gr.top_block.__init__(self) if options.filename is not None: self.fs = gr.file_source(gr.sizeof_gr_complex, options.filename) self.rate = options.rate else: self.u = uhd.usrp_source(options.addr, io_type=uhd.io_type.COMPLEX_FLOAT32, num_channels=1...
bistromath/gr-smartnet
[ 44, 22, 44, 4, 1301549389 ]