prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>hamming_distance.py<|end_file_name|><|fim▁begin|>def hamming(s,t): dist = 0 for x in range(len(s)): if s[x]!=t[x]: <|fim_middle|> return dist <|fim▁end|>
dist+=1
<|file_name|>hamming_distance.py<|end_file_name|><|fim▁begin|>def <|fim_middle|>(s,t): dist = 0 for x in range(len(s)): if s[x]!=t[x]: dist+=1 return dist <|fim▁end|>
hamming
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """digitalocean API to manage droplets""" __version__ = "1.16.0" __author__ = "Lorenzo Setale ( http://who.is.lorenzo.setale.me/? )" __author_email__ = "lorenzo@setale.me" __license__ = "LGPL v3" __copyright__ = "Copyright (c) 2012-2020 Lore...
from .FloatingIP import FloatingIP from .Volume import Volume from .baseapi import Error, EndPointError, TokenError, DataReadError, NotFoundError from .Tag import Tag
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django import forms from miniURL.models import Redirection <|fim▁hole|>#Pour faire un formulaire depuis un modèle. (/!\ héritage différent) class RedirectionForm(forms.ModelForm): class Meta: model = Redirection fields = ('real_url', 'pseudo')...
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django import forms from miniURL.models import Redirection #Pour faire un formulaire depuis un modèle. (/!\ héritage différent) class RedirectionForm(forms.ModelForm): cla<|fim_middle|> Pour récupérer des données cel apeut ce faire avec un POST # ou directe...
ss Meta: model = Redirection fields = ('real_url', 'pseudo') #
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django import forms from miniURL.models import Redirection #Pour faire un formulaire depuis un modèle. (/!\ héritage différent) class RedirectionForm(forms.ModelForm): class Meta: mod<|fim_middle|> Pour récupérer des données cel apeut ce faire avec ...
el = Redirection fields = ('real_url', 'pseudo') #
<|file_name|>tag_ports_during_bulk_creation.py<|end_file_name|><|fim▁begin|># Copyright (c) 2019 Verizon Media # All Rights Reserved. # # 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 ...
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License.
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Page', ...
('slug', models.SlugField(unique=True, max_length=150)), ('posted', models.DateTimeField(auto_now_add=True, db_index=True)), ], options={
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): <|fim_middle|> <|fim▁end|>
dependencies = [ ] operations = [ migrations.CreateModel( name='Page', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('title', models.CharField(unique=True, max_length=150)), ...
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
import ConfigParser import HnTool.modules.util from HnTool.modules.rule import Rule as MasterRule
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
def __init__(self, options): MasterRule.__init__(self, options) self.short_name="php" self.long_name="Checks security problems on php config file" self.type="config" self.required_files = ['/etc/php5/apache2/php.ini', '/etc/php5/cli/php.ini', '/etc/php.ini'] def requires...
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
MasterRule.__init__(self, options) self.short_name="php" self.long_name="Checks security problems on php config file" self.type="config" self.required_files = ['/etc/php5/apache2/php.ini', '/etc/php5/cli/php.ini', '/etc/php.ini']
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
return self.required_files
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
check_results = self.check_results conf_files = self.required_files for php_conf in conf_files: if os.path.isfile(php_conf): config = ConfigParser.ConfigParser() try: config.read(php_conf) except ConfigParser.Pars...
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
config = ConfigParser.ConfigParser() try: config.read(php_conf) except ConfigParser.ParsingError, (errno, strerror): check_results['info'].append('Could not parse %s: %s' % (php_conf, strerror)) continue ...
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
check_results['info'].append('%s is not a PHP config file' % (php_conf)) continue
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
rg = config.get('PHP', 'register_globals').lower() if rg == 'on': check_results['medium'].append('Register globals is on (%s)' % (php_conf)) elif rg == 'off': check_results['ok'].append('Register globals is off (...
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
check_results['medium'].append('Register globals is on (%s)' % (php_conf))
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
check_results['ok'].append('Register globals is off (%s)' % (php_conf))
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
check_results['info'].append('Unknown value for register globals (%s)' % (php_conf))
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
check_results['info'].append('Register globals not found (%s)' % (php_conf))
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
sm = config.get('PHP', 'safe_mode').lower() if sm == 'on': check_results['low'].append('Safe mode is on (fake security) (%s)' % (php_conf)) elif sm == 'off': check_results['info'].append('Safe mode is off (%s)' %...
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
check_results['low'].append('Safe mode is on (fake security) (%s)' % (php_conf))
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
check_results['info'].append('Safe mode is off (%s)' % (php_conf))
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
check_results['info'].append('Unknown value for safe mode (%s)' % (php_conf))
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
check_results['info'].append('Safe mode not found (%s)' % (php_conf))
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
de = config.get('PHP', 'display_errors').lower() if de == 'on': check_results['medium'].append('Display errors is on (stdout) (%s)' % (php_conf)) elif de == 'off': check_results['ok'].append('Display errors is of...
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
check_results['medium'].append('Display errors is on (stdout) (%s)' % (php_conf))
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
check_results['ok'].append('Display errors is off (%s)' % (php_conf))
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
check_results['info'].append('Display errors set to stderr (%s)' % (php_conf))
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
check_results['info'].append('Unknown value for display errors (%s)' % (php_conf))
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
check_results['info'].append('Display errors not found (%s)' % (php_conf))
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
ep = config.get('PHP', 'expose_php').lower() if ep == 'on': check_results['low'].append('Expose PHP is on (%s)' % (php_conf)) elif ep == 'off': check_results['ok'].append('Expose PHP is off (%s)' % (php_conf)) ...
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
check_results['low'].append('Expose PHP is on (%s)' % (php_conf))
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
check_results['ok'].append('Expose PHP is off (%s)' % (php_conf))
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
check_results['info'].append('Unknown value for expose PHP (%s)' % (php_conf))
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
check_results['info'].append('Expose PHP not found (%s)' % (php_conf))
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
__init__
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
requires
<|file_name|>php.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # HnTool rules - php # Copyright (C) 2009-2010 Candido Vieira <cvieira.br@gmail.com> # # This program 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...
analyze
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># Copyright 2017 Google Inc. All rights reserved. # # 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/licenses/LICENSE-2...
# Unless required by applicable law or agreed to in writing, software distributed under the License
<|file_name|>index.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #coding:utf-8 import cyclone.auth import cyclone.escape import cyclone.web import datetime import time import os from beaker.cache import cache_managers from toughradius.manage.base import BaseHandler from toughlib.permit import permit from toughr...
class HomeHandler(BaseHandler): @cyclone.web.authenticated def get(self): # cpuuse = psutil.cpu_percent(interval=None, percpu=True)
<|file_name|>index.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #coding:utf-8 import cyclone.auth import cyclone.escape import cyclone.web import datetime import time import os from beaker.cache import cache_managers from toughradius.manage.base import BaseHandler from toughlib.permit import permit from toughr...
@cyclone.web.authenticated def get(self): # cpuuse = psutil.cpu_percent(interval=None, percpu=True) # memuse = psutil.virtual_memory() # online_count = self.db.query(models.TrOnline.id).count() # user_total = self.db.query(models.TrAccount.account_number).filter_by(status=1).coun...
<|file_name|>index.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #coding:utf-8 import cyclone.auth import cyclone.escape import cyclone.web import datetime import time import os from beaker.cache import cache_managers from toughradius.manage.base import BaseHandler from toughlib.permit import permit from toughr...
self.redirect("/admin/dashboard")
<|file_name|>index.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #coding:utf-8 import cyclone.auth import cyclone.escape import cyclone.web import datetime import time import os from beaker.cache import cache_managers from toughradius.manage.base import BaseHandler from toughlib.permit import permit from toughr...
@cyclone.web.authenticated def get(self): self.redirect("/admin/dashboard")
<|file_name|>index.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #coding:utf-8 import cyclone.auth import cyclone.escape import cyclone.web import datetime import time import os from beaker.cache import cache_managers from toughradius.manage.base import BaseHandler from toughlib.permit import permit from toughr...
self.redirect("/admin/dashboard")
<|file_name|>index.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #coding:utf-8 import cyclone.auth import cyclone.escape import cyclone.web import datetime import time import os from beaker.cache import cache_managers from toughradius.manage.base import BaseHandler from toughlib.permit import permit from toughr...
@cyclone.web.authenticated def get(self): self.render("about.html")
<|file_name|>index.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #coding:utf-8 import cyclone.auth import cyclone.escape import cyclone.web import datetime import time import os from beaker.cache import cache_managers from toughradius.manage.base import BaseHandler from toughlib.permit import permit from toughr...
self.render("about.html")
<|file_name|>index.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #coding:utf-8 import cyclone.auth import cyclone.escape import cyclone.web import datetime import time import os from beaker.cache import cache_managers from toughradius.manage.base import BaseHandler from toughlib.permit import permit from toughr...
def get_toughcloud_url(self): if os.environ.get("TR_DEV"): return 'http://127.0.0.1:9079/customer/license/request?sid=%s'%tools.get_sys_uuid() else: return 'https://www.toughcloud.net/customer/license/request?sid=%s'%tools.get_sys_uuid() @cyclone.web.authenticated de...
<|file_name|>index.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #coding:utf-8 import cyclone.auth import cyclone.escape import cyclone.web import datetime import time import os from beaker.cache import cache_managers from toughradius.manage.base import BaseHandler from toughlib.permit import permit from toughr...
if os.environ.get("TR_DEV"): return 'http://127.0.0.1:9079/customer/license/request?sid=%s'%tools.get_sys_uuid() else: return 'https://www.toughcloud.net/customer/license/request?sid=%s'%tools.get_sys_uuid()
<|file_name|>index.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #coding:utf-8 import cyclone.auth import cyclone.escape import cyclone.web import datetime import time import os from beaker.cache import cache_managers from toughradius.manage.base import BaseHandler from toughlib.permit import permit from toughr...
self.redirect(self.get_toughcloud_url())
<|file_name|>index.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #coding:utf-8 import cyclone.auth import cyclone.escape import cyclone.web import datetime import time import os from beaker.cache import cache_managers from toughradius.manage.base import BaseHandler from toughlib.permit import permit from toughr...
return 'http://127.0.0.1:9079/customer/license/request?sid=%s'%tools.get_sys_uuid()
<|file_name|>index.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #coding:utf-8 import cyclone.auth import cyclone.escape import cyclone.web import datetime import time import os from beaker.cache import cache_managers from toughradius.manage.base import BaseHandler from toughlib.permit import permit from toughr...
return 'https://www.toughcloud.net/customer/license/request?sid=%s'%tools.get_sys_uuid()
<|file_name|>index.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #coding:utf-8 import cyclone.auth import cyclone.escape import cyclone.web import datetime import time import os from beaker.cache import cache_managers from toughradius.manage.base import BaseHandler from toughlib.permit import permit from toughr...
get
<|file_name|>index.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #coding:utf-8 import cyclone.auth import cyclone.escape import cyclone.web import datetime import time import os from beaker.cache import cache_managers from toughradius.manage.base import BaseHandler from toughlib.permit import permit from toughr...
get
<|file_name|>index.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #coding:utf-8 import cyclone.auth import cyclone.escape import cyclone.web import datetime import time import os from beaker.cache import cache_managers from toughradius.manage.base import BaseHandler from toughlib.permit import permit from toughr...
get
<|file_name|>index.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #coding:utf-8 import cyclone.auth import cyclone.escape import cyclone.web import datetime import time import os from beaker.cache import cache_managers from toughradius.manage.base import BaseHandler from toughlib.permit import permit from toughr...
get_toughcloud_url
<|file_name|>index.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #coding:utf-8 import cyclone.auth import cyclone.escape import cyclone.web import datetime import time import os from beaker.cache import cache_managers from toughradius.manage.base import BaseHandler from toughlib.permit import permit from toughr...
get
<|file_name|>HeadsetTester.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from Headset import Headset import logging import time puerto = 'COM3' headset = Headset(logging.INFO) try: headset.connect(puerto, 115200) except Exception, e: raise e <|fim▁hole|>headset.stopReading() headset.closePort() pri...
print "Is conected? " + str(headset.isConnected()) print "-----------------------------------------" headset.startReading(persist_data=True) time.sleep(5)
<|file_name|>_hasidof.py<|end_file_name|><|fim▁begin|># # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2002-2006 Donald N. Allingham # # This program 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 Fou...
#
<|file_name|>_hasidof.py<|end_file_name|><|fim▁begin|># # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2002-2006 Donald N. Allingham # # This program 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 Fou...
"""Rule that checks for a person with a specific GRAMPS ID""" name = _('Person with <Id>') description = _("Matches person with a specified Gramps ID")
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import json import bottle from pyrouted.util import make_spec def route(method, path): def decorator(f): f.http_route = path f.http_method = method return f return decorator class APIv1(object): prefix = '/v1' def __init__(se...
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import json import bottle from pyrouted.util import make_spec def route(method, path): <|fim_middle|> class APIv1(object): prefix = '/v1' def __init__(self, ndb, config): self.ndb = ndb self.config = config @route('GET', '/sources'...
def decorator(f): f.http_route = path f.http_method = method return f return decorator
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import json import bottle from pyrouted.util import make_spec def route(method, path): def decorator(f): <|fim_middle|> return decorator class APIv1(object): prefix = '/v1' def __init__(self, ndb, config): self.ndb = ndb sel...
f.http_route = path f.http_method = method return f
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import json import bottle from pyrouted.util import make_spec def route(method, path): def decorator(f): f.http_route = path f.http_method = method return f return decorator class APIv1(object): <|fim_middle|> <|fim▁end|>
prefix = '/v1' def __init__(self, ndb, config): self.ndb = ndb self.config = config @route('GET', '/sources') def sources_list(self, mode='short'): ret = {} mode = bottle.request.query.mode or mode for name, spec in self.ndb.sources.items(): ret[name...
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import json import bottle from pyrouted.util import make_spec def route(method, path): def decorator(f): f.http_route = path f.http_method = method return f return decorator class APIv1(object): prefix = '/v1' def __init__(se...
self.ndb = ndb self.config = config
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import json import bottle from pyrouted.util import make_spec def route(method, path): def decorator(f): f.http_route = path f.http_method = method return f return decorator class APIv1(object): prefix = '/v1' def __init__(se...
ret = {} mode = bottle.request.query.mode or mode for name, spec in self.ndb.sources.items(): ret[name] = {'class': spec.nl.__class__.__name__, 'status': spec.status} if mode == 'full': ret[name]['config'] = spec.nl_kwarg r...
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import json import bottle from pyrouted.util import make_spec def route(method, path): def decorator(f): f.http_route = path f.http_method = method return f return decorator class APIv1(object): prefix = '/v1' def __init__(se...
node = bottle.request.body.getvalue().decode('utf-8') self.ndb.sources[node].start()
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import json import bottle from pyrouted.util import make_spec def route(method, path): def decorator(f): f.http_route = path f.http_method = method return f return decorator class APIv1(object): prefix = '/v1' def __init__(se...
data = bottle.request.body.getvalue().decode('utf-8') node, spec = make_spec(data, self.config) self.config['sources'].append(node) self.ndb.connect_source(node, spec)
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import json import bottle from pyrouted.util import make_spec def route(method, path): def decorator(f): f.http_route = path f.http_method = method return f return decorator class APIv1(object): prefix = '/v1' def __init__(se...
node = bottle.request.body.getvalue().decode('utf-8') self.config['sources'].remove(node) self.ndb.disconnect_source(node)
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import json import bottle from pyrouted.util import make_spec def route(method, path): def decorator(f): f.http_route = path f.http_method = method return f return decorator class APIv1(object): prefix = '/v1' def __init__(se...
return bottle.template('{{!ret}}', ret=json.dumps(self.config))
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import json import bottle from pyrouted.util import make_spec def route(method, path): def decorator(f): f.http_route = path f.http_method = method return f return decorator class APIv1(object): prefix = '/v1' def __init__(se...
path = bottle.request.body.getvalue().decode('utf-8') self.config.dump(path)
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import json import bottle from pyrouted.util import make_spec def route(method, path): def decorator(f): f.http_route = path f.http_method = method return f return decorator class APIv1(object): prefix = '/v1' def __init__(se...
ret = [] obj = getattr(self.ndb, name) for line in obj.dump(): ret.append(line) return bottle.template('{{!ret}}', ret=json.dumps(ret))
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import json import bottle from pyrouted.util import make_spec def route(method, path): def decorator(f): f.http_route = path f.http_method = method return f return decorator class APIv1(object): prefix = '/v1' def __init__(se...
ret = [] obj = getattr(self.ndb.query, name) for line in obj(): ret.append(line) return bottle.template('{{!ret}}', ret=json.dumps(ret))
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import json import bottle from pyrouted.util import make_spec def route(method, path): def decorator(f): f.http_route = path f.http_method = method return f return decorator class APIv1(object): prefix = '/v1' def __init__(se...
ret[name]['config'] = spec.nl_kwarg
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import json import bottle from pyrouted.util import make_spec def <|fim_middle|>(method, path): def decorator(f): f.http_route = path f.http_method = method return f return decorator class APIv1(object): prefix = '/v1' def __...
route
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import json import bottle from pyrouted.util import make_spec def route(method, path): def <|fim_middle|>(f): f.http_route = path f.http_method = method return f return decorator class APIv1(object): prefix = '/v1' def __init...
decorator
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import json import bottle from pyrouted.util import make_spec def route(method, path): def decorator(f): f.http_route = path f.http_method = method return f return decorator class APIv1(object): prefix = '/v1' def <|fim_middl...
__init__
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import json import bottle from pyrouted.util import make_spec def route(method, path): def decorator(f): f.http_route = path f.http_method = method return f return decorator class APIv1(object): prefix = '/v1' def __init__(se...
sources_list
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import json import bottle from pyrouted.util import make_spec def route(method, path): def decorator(f): f.http_route = path f.http_method = method return f return decorator class APIv1(object): prefix = '/v1' def __init__(se...
sources_restart
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import json import bottle from pyrouted.util import make_spec def route(method, path): def decorator(f): f.http_route = path f.http_method = method return f return decorator class APIv1(object): prefix = '/v1' def __init__(se...
sources_add
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import json import bottle from pyrouted.util import make_spec def route(method, path): def decorator(f): f.http_route = path f.http_method = method return f return decorator class APIv1(object): prefix = '/v1' def __init__(se...
sources_del
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import json import bottle from pyrouted.util import make_spec def route(method, path): def decorator(f): f.http_route = path f.http_method = method return f return decorator class APIv1(object): prefix = '/v1' def __init__(se...
config_get
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import json import bottle from pyrouted.util import make_spec def route(method, path): def decorator(f): f.http_route = path f.http_method = method return f return decorator class APIv1(object): prefix = '/v1' def __init__(se...
config_dump
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import json import bottle from pyrouted.util import make_spec def route(method, path): def decorator(f): f.http_route = path f.http_method = method return f return decorator class APIv1(object): prefix = '/v1' def __init__(se...
view
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import json import bottle from pyrouted.util import make_spec def route(method, path): def decorator(f): f.http_route = path f.http_method = method return f return decorator class APIv1(object): prefix = '/v1' def __init__(se...
query
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>''' utils.py: helper functions for DLP api Copyright (c) 2017 Vanessa Sochat 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 restriction...
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
<|file_name|>utils.py<|end_file_name|><|fim▁begin|> ''' utils.py: helper functions for DLP api Copyright (c) 2017 Vanessa Sochat 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 restrictio...
'''paginate_items will return a list of lists, each of a particular max size ''' groups = [] for idx in range(0, len(items), size): group = items[idx:idx+size] groups.append(group) return groups
<|file_name|>utils.py<|end_file_name|><|fim▁begin|> ''' utils.py: helper functions for DLP api Copyright (c) 2017 Vanessa Sochat 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 restrictio...
'''clean_text will remove phi findings from a text object :param text: the original text sent to the content.inspect DLP endpoint :param findings: the full response for the text. ''' if 'findings' in findings: for finding in findings['findings']: label = "**%s**" %finding['infoTy...
<|file_name|>utils.py<|end_file_name|><|fim▁begin|> ''' utils.py: helper functions for DLP api Copyright (c) 2017 Vanessa Sochat 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 restrictio...
for finding in findings['findings']: label = "**%s**" %finding['infoType']['name'] # Note sure if this is best strategy, we can start with it text = text.replace(finding['quote'],label)
<|file_name|>utils.py<|end_file_name|><|fim▁begin|> ''' utils.py: helper functions for DLP api Copyright (c) 2017 Vanessa Sochat 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 restrictio...
paginate_items
<|file_name|>utils.py<|end_file_name|><|fim▁begin|> ''' utils.py: helper functions for DLP api Copyright (c) 2017 Vanessa Sochat 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 restrictio...
clean_text
<|file_name|>sblim_sfcb.py<|end_file_name|><|fim▁begin|>#!/bin/python import os, subprocess import logging from autotest.client import test from autotest.client.shared import error, software_manager sm = software_manager.SoftwareManager() class sblim_sfcb(test.test): """ Autotest module for testing basic fun...
if ret_val.returncode != 0: self.nfail += 1
<|file_name|>sblim_sfcb.py<|end_file_name|><|fim▁begin|>#!/bin/python import os, subprocess import logging from autotest.client import test from autotest.client.shared import error, software_manager sm = software_manager.SoftwareManager() class sblim_sfcb(test.test): <|fim_middle|> <|fim▁end|>
""" Autotest module for testing basic functionality of sblim_sfcb @author Wang Tao <wangttao@cn.ibm.com> """ version = 1 nfail = 0 path = '' def initialize(self, test_path=''): """ Sets the overall failure counter for the test. """ self.nfail = 0 ...
<|file_name|>sblim_sfcb.py<|end_file_name|><|fim▁begin|>#!/bin/python import os, subprocess import logging from autotest.client import test from autotest.client.shared import error, software_manager sm = software_manager.SoftwareManager() class sblim_sfcb(test.test): """ Autotest module for testing basic fun...
""" Sets the overall failure counter for the test. """ self.nfail = 0 if not sm.check_installed('gcc'): logging.debug("gcc missing - trying to install") sm.install('gcc') ret_val = subprocess.Popen(['make', 'all'], cwd="%s/sblim_sfcb" %(test_path))...
<|file_name|>sblim_sfcb.py<|end_file_name|><|fim▁begin|>#!/bin/python import os, subprocess import logging from autotest.client import test from autotest.client.shared import error, software_manager sm = software_manager.SoftwareManager() class sblim_sfcb(test.test): """ Autotest module for testing basic fun...
""" Trigger test run """ try: os.environ["LTPBIN"] = "%s/shared" %(test_path) ret_val = subprocess.Popen(['./sblim-sfcb-test.sh'], cwd="%s/sblim_sfcb" %(test_path)) ret_val.communicate() if ret_val.returncode != 0: self.nfai...
<|file_name|>sblim_sfcb.py<|end_file_name|><|fim▁begin|>#!/bin/python import os, subprocess import logging from autotest.client import test from autotest.client.shared import error, software_manager sm = software_manager.SoftwareManager() class sblim_sfcb(test.test): """ Autotest module for testing basic fun...
if self.nfail != 0: logging.info('\n nfails is non-zero') raise error.TestError('\nTest failed') else: logging.info('\n Test completed successfully ')
<|file_name|>sblim_sfcb.py<|end_file_name|><|fim▁begin|>#!/bin/python import os, subprocess import logging from autotest.client import test from autotest.client.shared import error, software_manager sm = software_manager.SoftwareManager() class sblim_sfcb(test.test): """ Autotest module for testing basic fun...
logging.debug("gcc missing - trying to install") sm.install('gcc')
<|file_name|>sblim_sfcb.py<|end_file_name|><|fim▁begin|>#!/bin/python import os, subprocess import logging from autotest.client import test from autotest.client.shared import error, software_manager sm = software_manager.SoftwareManager() class sblim_sfcb(test.test): """ Autotest module for testing basic fun...
self.nfail += 1
<|file_name|>sblim_sfcb.py<|end_file_name|><|fim▁begin|>#!/bin/python import os, subprocess import logging from autotest.client import test from autotest.client.shared import error, software_manager sm = software_manager.SoftwareManager() class sblim_sfcb(test.test): """ Autotest module for testing basic fun...
self.nfail += 1