prompt large_stringlengths 72 9.34k | completion large_stringlengths 0 7.61k |
|---|---|
<|file_name|>generi_in_istituzioni.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from collections import OrderedDict
import locale
from optparse import make_option
from verify.management.commands import VerifyBaseCommand
from verify.models import *
from verify.politici_models import *
from django.db.models im... | """
Report delle statistiche di genere complessive, a livello nazionale,
per tutti gli organi di tutte le istituzioni.
Può limitarsi a una o più istituzioni, se si passa un elenco di institution_id
"""
args = '<institution_id institution_id ...>'
help = "Check that all locations have only ma... |
<|file_name|>generi_in_istituzioni.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from collections import OrderedDict
import locale
from optparse import make_option
from verify.management.commands import VerifyBaseCommand
from verify.models import *
from verify.politici_models import *
from django.db.models im... | lf.csv_headers = ["ISTITUZIONE", "INCARICO", "N_DONNE", "N_UOMINI", "N_TOTALI", "PERC_DONNE", "PERC_UOMINI"]
institutions = OpInstitution.objects.using('politici').all()
if args:
institutions = institutions.filter(id__in=args)
self.logger.info(
"Verificat... |
<|file_name|>generi_in_istituzioni.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from collections import OrderedDict
import locale
from optparse import make_option
from verify.management.commands import VerifyBaseCommand
from verify.models import *
from verify.politici_models import *
from django.db.models im... | stitutions = institutions.filter(id__in=args)
self.logger.info(
"Verification {0} launched with institutions limited to {1}".format(
self.__class__.__module__, ",".join(institutions.values_list('id', flat=True))
)
)
|
<|file_name|>generi_in_istituzioni.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from collections import OrderedDict
import locale
from optparse import make_option
from verify.management.commands import VerifyBaseCommand
from verify.models import *
from verify.politici_models import *
from django.db.models im... | lf.logger.info(
"Verification {0} launched for all institutions".format(
self.__class__.__module__
)
)
|
<|file_name|>generi_in_istituzioni.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from collections import OrderedDict
import locale
from optparse import make_option
from verify.management.commands import VerifyBaseCommand
from verify.models import *
from verify.politici_models import *
from django.db.models im... | ecute_verification(s |
<|file_name|>funcs.py<|end_file_name|><|fim▁begin|># emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
''' Processor functions for images '''
import numpy as np
def squeeze_image(img):
''' Return image, remove axes length 1 at end of image shape
Fo... | slen = len(shape)
if slen < 4:
return klass.from_image(img) |
<|file_name|>funcs.py<|end_file_name|><|fim▁begin|># emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
''' Processor functions for images '''
import numpy as np
def squeeze_image(img):
<|fim_middle|>
def concat_images(images):
''' Concatenate ima... | ''' Return image, remove axes length 1 at end of image shape
For example, an image may have shape (10,20,30,1,1). In this case
squeeze will result in an image with shape (10,20,30). See doctests
for further description of behavior.
Parameters
----------
img : ``SpatialImage``
Return... |
<|file_name|>funcs.py<|end_file_name|><|fim▁begin|># emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
''' Processor functions for images '''
import numpy as np
def squeeze_image(img):
''' Return image, remove axes length 1 at end of image shape
Fo... | ''' Concatenate images in list to single image, along last dimension '''
n_imgs = len(images)
img0 = images[0]
i0shape = img0.get_shape()
affine = img0.get_affine()
header = img0.get_header()
out_shape = (n_imgs, ) + i0shape
out_data = np.empty(out_shape)
for i, img in enumerate(imag... |
<|file_name|>funcs.py<|end_file_name|><|fim▁begin|># emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
''' Processor functions for images '''
import numpy as np
def squeeze_image(img):
''' Return image, remove axes length 1 at end of image shape
Fo... | return klass.from_image(img) |
<|file_name|>funcs.py<|end_file_name|><|fim▁begin|># emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
''' Processor functions for images '''
import numpy as np
def squeeze_image(img):
''' Return image, remove axes length 1 at end of image shape
Fo... | slen-=1 |
<|file_name|>funcs.py<|end_file_name|><|fim▁begin|># emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
''' Processor functions for images '''
import numpy as np
def squeeze_image(img):
''' Return image, remove axes length 1 at end of image shape
Fo... | break |
<|file_name|>funcs.py<|end_file_name|><|fim▁begin|># emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
''' Processor functions for images '''
import numpy as np
def squeeze_image(img):
''' Return image, remove axes length 1 at end of image shape
Fo... | return klass.from_image(img) |
<|file_name|>funcs.py<|end_file_name|><|fim▁begin|># emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
''' Processor functions for images '''
import numpy as np
def squeeze_image(img):
''' Return image, remove axes length 1 at end of image shape
Fo... | raise ValueError('Affines do not match') |
<|file_name|>funcs.py<|end_file_name|><|fim▁begin|># emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
''' Processor functions for images '''
import numpy as np
def <|fim_middle|>(img):
''' Return image, remove axes length 1 at end of image shape
F... | squeeze_image |
<|file_name|>funcs.py<|end_file_name|><|fim▁begin|># emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
''' Processor functions for images '''
import numpy as np
def squeeze_image(img):
''' Return image, remove axes length 1 at end of image shape
Fo... | concat_images |
<|file_name|>mt_system.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
DOCUMENTATION = '''
module: mt_system.py
author:
- "Valentin Gurmeza"
version_added: "2.4"
short_description: Manage mikrotik system endpoints
requirements:
- mt_api
description:
- manage mikrotik system parameters
options:
hostname:... | settings: |
<|file_name|>mt_system.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
DOCUMENTATION = '''
module: mt_system.py
author:
- "Valentin Gurmeza"
version_added: "2.4"
short_description: Manage mikrotik system endpoints
requirements:
- mt_api
description:
- manage mikrotik system parameters
options:
hostname:... | module = AnsibleModule(
argument_spec = dict(
hostname = dict(required=True),
username = dict(required=True),
password = dict(required=True, no_log=True),
settings = dict(required=False, type='dict'),
parameter = dict(
required = True,
choices = ['ntp_client', ... |
<|file_name|>mt_system.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
DOCUMENTATION = '''
module: mt_system.py
author:
- "Valentin Gurmeza"
version_added: "2.4"
short_description: Manage mikrotik system endpoints
requirements:
- mt_api
description:
- manage mikrotik system parameters
options:
hostname:... | params['parameter'] = 'routerboard/settings' |
<|file_name|>mt_system.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
DOCUMENTATION = '''
module: mt_system.py
author:
- "Valentin Gurmeza"
version_added: "2.4"
short_description: Manage mikrotik system endpoints
requirements:
- mt_api
description:
- manage mikrotik system parameters
options:
hostname:... | params['parameter'] = 'ntp/client' |
<|file_name|>mt_system.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
DOCUMENTATION = '''
module: mt_system.py
author:
- "Valentin Gurmeza"
version_added: "2.4"
short_description: Manage mikrotik system endpoints
requirements:
- mt_api
description:
- manage mikrotik system parameters
options:
hostname:... | module.fail_json(
msg = mt_obj.failed_msg
) |
<|file_name|>mt_system.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
DOCUMENTATION = '''
module: mt_system.py
author:
- "Valentin Gurmeza"
version_added: "2.4"
short_description: Manage mikrotik system endpoints
requirements:
- mt_api
description:
- manage mikrotik system parameters
options:
hostname:... | module.exit_json(
failed=False,
changed=True,
msg=mt_obj.changed_msg,
diff={ "prepared": {
"old": mt_obj.old_params,
"new": mt_obj.new_params,
}},
) |
<|file_name|>mt_system.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
DOCUMENTATION = '''
module: mt_system.py
author:
- "Valentin Gurmeza"
version_added: "2.4"
short_description: Manage mikrotik system endpoints
requirements:
- mt_api
description:
- manage mikrotik system parameters
options:
hostname:... | module.exit_json(
failed=False,
changed=False,
#msg='',
msg=params['settings'],
) |
<|file_name|>mt_system.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
DOCUMENTATION = '''
module: mt_system.py
author:
- "Valentin Gurmeza"
version_added: "2.4"
short_description: Manage mikrotik system endpoints
requirements:
- mt_api
description:
- manage mikrotik system parameters
options:
hostname:... | main() |
<|file_name|>mt_system.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
DOCUMENTATION = '''
module: mt_system.py
author:
- "Valentin Gurmeza"
version_added: "2.4"
short_description: Manage mikrotik system endpoints
requirements:
- mt_api
description:
- manage mikrotik system parameters
options:
hostname:... | main |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | for butt in self._lines:
if butt.sprite.rect.collidepoint(pos):
butt.sprite.touchDown() |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
<|fim_middle|>
class Line(Face):
def __init__(self, rect, color=(0,0,255), text=""):
pygame.spri... | def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
self.color = color
self.action = action
self.rect = pygame.Rect(rect)
self.baseImage = pygame.Surface((self.rect.width, self.rect.height))
self.image = self.baseImage
... |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
<|fim_middle|>
def update(self):... | pygame.sprite.Sprite.__init__(self)
self.color = color
self.action = action
self.rect = pygame.Rect(rect)
self.baseImage = pygame.Surface((self.rect.width, self.rect.height))
self.image = self.baseImage |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | rect = self.baseImage.get_rect()
pygame.draw.circle(self.baseImage, self.color, rect.center, rect.width/2, 1); |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | rect = self.baseImage.get_rect()
pygame.draw.circle(self.baseImage, self.color, rect.center, rect.width/2, 0); |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | rect = self.baseImage.get_rect()
self.image.fill(pygame.Color("black"))
pygame.draw.circle(self.baseImage, self.color, rect.center, rect.width/2, 1);
if self.action is not None:
self.action() |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | self.action = action |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | def __init__(self, rect, color=(0,0,255), text=""):
pygame.sprite.Sprite.__init__(self)
self._alarmList = {}
self.color = color
self.rect = pygame.Rect(rect)
self.text = text
self.baseImage = pygame.Surface((self.rect.width, self.rect.height))
self.image = sel... |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | pygame.sprite.Sprite.__init__(self)
self._alarmList = {}
self.color = color
self.rect = pygame.Rect(rect)
self.text = text
self.baseImage = pygame.Surface((self.rect.width, self.rect.height))
self.image = self.baseImage
self.faceSprite = pygame.sprite.Grou... |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | self.faceSprite.draw(self.baseImage) |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | def __init__(self, rect, alarm, color=(0,0,255)):
pygame.sprite.Sprite.__init__(self)
self._alarmList = {}
if isinstance(alarm, Alarm):
self._alarmObject = alarm
else:
raise Exception("Not an Alarm-class object")
self.color = color
self.rect = ... |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | pygame.sprite.Sprite.__init__(self)
self._alarmList = {}
if isinstance(alarm, Alarm):
self._alarmObject = alarm
else:
raise Exception("Not an Alarm-class object")
self.color = color
self.rect = pygame.Rect(rect)
self.requestingFace = False... |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | line = pygame.sprite.GroupSingle(Button(pygame.Rect((0, 0),(self.rect.height/5, self.rect.height/5))))
line.sprite.rect.topright = (self.rect.width, self.rect.height/4)
line.sprite.setAction(self.addAlarm)
self._lines.append(line) |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | for line in self._lines:
line.update()
# line.sprite.rect.midbottom = self.image.get_rect()
line.draw(self.baseImage) |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | pos = pygame.mouse.get_pos()
if event.type == pygame.MOUSEBUTTONDOWN:
for butt in self._lines:
if butt.sprite.rect.collidepoint(pos):
butt.sprite.touchDown()
if event.type == pygame.MOUSEBUTTONUP:
for butt in self._lines:
... |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | self.action() |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | self._alarmObject = alarm |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | raise Exception("Not an Alarm-class object") |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | for butt in self._lines:
if butt.sprite.rect.collidepoint(pos):
butt.sprite.touchDown() |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | butt.sprite.touchDown() |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | for butt in self._lines:
if butt.sprite.rect.collidepoint(pos):
butt.sprite.touchUp() |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | butt.sprite.touchUp() |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def <|fim_middle|>(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
... | __init__ |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | update |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | touchDown |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | touchUp |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | setAction |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | __init__ |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | update |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | __init__ |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | addAlarm |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | update |
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face
import pygame
from utils.message import Message
from utils.alarm import Alarm
class Button(pygame.sprite.Sprite):
def __init__(self, rect, color=(0,0,255), action=None):
pygame.sprite.Sprite.__init__(self)
se... | handleEvent |
<|file_name|>edit.py<|end_file_name|><|fim▁begin|>import os
import inspect
from lib import BaseTest
def changesRemove(_, s):
return s.replace(os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "changes"), "")
class EditRepo1Test(BaseTest):
"""
edit repo: change comment
"""
fixtureCmd... | |
<|file_name|>edit.py<|end_file_name|><|fim▁begin|>import os
import inspect
from lib import BaseTest
def changesRemove(_, s):
<|fim_middle|>
class EditRepo1Test(BaseTest):
"""
edit repo: change comment
"""
fixtureCmds = [
"aptly repo create repo1",
]
runCmd = "aptly repo edit -co... | return s.replace(os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "changes"), "") |
<|file_name|>edit.py<|end_file_name|><|fim▁begin|>import os
import inspect
from lib import BaseTest
def changesRemove(_, s):
return s.replace(os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "changes"), "")
class EditRepo1Test(BaseTest):
<|fim_middle|>
class EditRepo2Test(BaseTest):
"""... | """
edit repo: change comment
"""
fixtureCmds = [
"aptly repo create repo1",
]
runCmd = "aptly repo edit -comment=Lala repo1"
def check(self):
self.check_output()
self.check_cmd_output("aptly repo show repo1", "repo-show") |
<|file_name|>edit.py<|end_file_name|><|fim▁begin|>import os
import inspect
from lib import BaseTest
def changesRemove(_, s):
return s.replace(os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "changes"), "")
class EditRepo1Test(BaseTest):
"""
edit repo: change comment
"""
fixtureCmd... | self.check_output()
self.check_cmd_output("aptly repo show repo1", "repo-show") |
<|file_name|>edit.py<|end_file_name|><|fim▁begin|>import os
import inspect
from lib import BaseTest
def changesRemove(_, s):
return s.replace(os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "changes"), "")
class EditRepo1Test(BaseTest):
"""
edit repo: change comment
"""
fixtureCmd... | """
edit repo: change distribution & component
"""
fixtureCmds = [
"aptly repo create -comment=Lala -component=non-free repo2",
]
runCmd = "aptly repo edit -distribution=wheezy -component=contrib repo2"
def check(self):
self.check_output()
self.check_cmd_output("aptl... |
<|file_name|>edit.py<|end_file_name|><|fim▁begin|>import os
import inspect
from lib import BaseTest
def changesRemove(_, s):
return s.replace(os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "changes"), "")
class EditRepo1Test(BaseTest):
"""
edit repo: change comment
"""
fixtureCmd... | self.check_output()
self.check_cmd_output("aptly repo show repo2", "repo-show") |
<|file_name|>edit.py<|end_file_name|><|fim▁begin|>import os
import inspect
from lib import BaseTest
def changesRemove(_, s):
return s.replace(os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "changes"), "")
class EditRepo1Test(BaseTest):
"""
edit repo: change comment
"""
fixtureCmd... | """
edit repo: no such repo
"""
runCmd = "aptly repo edit repo3"
expectedCode = 1 |
<|file_name|>edit.py<|end_file_name|><|fim▁begin|>import os
import inspect
from lib import BaseTest
def changesRemove(_, s):
return s.replace(os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "changes"), "")
class EditRepo1Test(BaseTest):
"""
edit repo: change comment
"""
fixtureCmd... | """
edit repo: add uploaders.json
"""
fixtureCmds = [
"aptly repo create repo4",
]
runCmd = "aptly repo edit -uploaders-file=${changes}/uploaders2.json repo4"
def check(self):
self.check_output()
self.check_cmd_output("aptly repo show repo4", "repo_show") |
<|file_name|>edit.py<|end_file_name|><|fim▁begin|>import os
import inspect
from lib import BaseTest
def changesRemove(_, s):
return s.replace(os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "changes"), "")
class EditRepo1Test(BaseTest):
"""
edit repo: change comment
"""
fixtureCmd... | self.check_output()
self.check_cmd_output("aptly repo show repo4", "repo_show") |
<|file_name|>edit.py<|end_file_name|><|fim▁begin|>import os
import inspect
from lib import BaseTest
def changesRemove(_, s):
return s.replace(os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "changes"), "")
class EditRepo1Test(BaseTest):
"""
edit repo: change comment
"""
fixtureCmd... | """
edit repo: with broken uploaders.json
"""
fixtureCmds = [
"aptly repo create repo5",
]
runCmd = "aptly repo edit -uploaders-file=${changes}/uploaders3.json repo5"
expectedCode = 1 |
<|file_name|>edit.py<|end_file_name|><|fim▁begin|>import os
import inspect
from lib import BaseTest
def changesRemove(_, s):
return s.replace(os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "changes"), "")
class EditRepo1Test(BaseTest):
"""
edit repo: change comment
"""
fixtureCmd... | """
edit local repo: with missing uploaders.json
"""
fixtureCmds = [
"aptly repo create repo6",
]
runCmd = "aptly repo edit -uploaders-file=${changes}/uploaders-not-found.json repo6"
expectedCode = 1
outputMatchPrepare = changesRemove |
<|file_name|>edit.py<|end_file_name|><|fim▁begin|>import os
import inspect
from lib import BaseTest
def changesRemove(_, s):
return s.replace(os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "changes"), "")
class EditRepo1Test(BaseTest):
"""
edit repo: change comment
"""
fixtureCmd... | """
edit local repo: remove uploaders.json
"""
fixtureCmds = [
"aptly repo create -uploaders-file=${changes}/uploaders2.json repo7",
]
runCmd = "aptly repo edit -uploaders-file= repo7"
def check(self):
self.check_output()
self.check_cmd_output("aptly repo show repo7"... |
<|file_name|>edit.py<|end_file_name|><|fim▁begin|>import os
import inspect
from lib import BaseTest
def changesRemove(_, s):
return s.replace(os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "changes"), "")
class EditRepo1Test(BaseTest):
"""
edit repo: change comment
"""
fixtureCmd... | self.check_output()
self.check_cmd_output("aptly repo show repo7", "repo_show") |
<|file_name|>edit.py<|end_file_name|><|fim▁begin|>import os
import inspect
from lib import BaseTest
def <|fim_middle|>(_, s):
return s.replace(os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "changes"), "")
class EditRepo1Test(BaseTest):
"""
edit repo: change comment
"""
fixtureCm... | changesRemove |
<|file_name|>edit.py<|end_file_name|><|fim▁begin|>import os
import inspect
from lib import BaseTest
def changesRemove(_, s):
return s.replace(os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "changes"), "")
class EditRepo1Test(BaseTest):
"""
edit repo: change comment
"""
fixtureCmd... | check |
<|file_name|>edit.py<|end_file_name|><|fim▁begin|>import os
import inspect
from lib import BaseTest
def changesRemove(_, s):
return s.replace(os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "changes"), "")
class EditRepo1Test(BaseTest):
"""
edit repo: change comment
"""
fixtureCmd... | check |
<|file_name|>edit.py<|end_file_name|><|fim▁begin|>import os
import inspect
from lib import BaseTest
def changesRemove(_, s):
return s.replace(os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "changes"), "")
class EditRepo1Test(BaseTest):
"""
edit repo: change comment
"""
fixtureCmd... | check |
<|file_name|>edit.py<|end_file_name|><|fim▁begin|>import os
import inspect
from lib import BaseTest
def changesRemove(_, s):
return s.replace(os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "changes"), "")
class EditRepo1Test(BaseTest):
"""
edit repo: change comment
"""
fixtureCmd... | check |
<|file_name|>laogong21.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#coding=utf-8
'''
@author: sheng
@license:
'''
SPELL=u'láogōng'<|fim▁hole|>CHANNEL='pericardium'
CHANNEL_FULLNAME='PericardiumChannelofHand-Jueyin'
SEQ='PC8'
if __name__ == '__main__':
pass<|fim▁end|> | CN=u'劳宫'
NAME=u'laogong21' |
<|file_name|>laogong21.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#coding=utf-8
'''
@author: sheng
@license:
'''
SPELL=u'láogōng'
CN=u'劳宫'
NAME=u'laogong21'
CHANNEL='pericardium'
CHANNEL_FULLNAME='PericardiumChannelofHand-Jueyin'
SEQ='PC8'
if __name__ == '__main__':
pass
<|fim_middle|>
<|fim▁end|> | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import absolute_import<|fim▁hole|>from .production import Production # noqa
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celery import app as celery_app<|... |
from .local import Local # noqa |
<|file_name|>toc.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2014 René Samselnig
#
# This file is part of Database Navigator.
#
# Database Navigator is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publish... |
filename = sys.argv[1] |
<|file_name|>toc.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2014 René Samselnig
#
# This file is part of Database Navigator.
#
# Database Navigator is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publish... | turn re.sub(r'#+ ', '', s)
d |
<|file_name|>toc.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2014 René Samselnig
#
# This file is part of Database Navigator.
#
# Database Navigator is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publish... | turn '#' + re.sub(r'[^a-z-]', '', re.sub(r'#+ ', '', s).replace(' ', '-').lower())
d |
<|file_name|>toc.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2014 René Samselnig
#
# This file is part of Database Navigator.
#
# Database Navigator is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publish... | turn len(re.match(r'(#*)', s).group(0))
|
<|file_name|>toc.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2014 René Samselnig
#
# This file is part of Database Navigator.
#
# Database Navigator is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publish... | c.append('{}- [{}]({}-{})'.format('\t'*(d-2), t, f, c[f]))
|
<|file_name|>toc.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2014 René Samselnig
#
# This file is part of Database Navigator.
#
# Database Navigator is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publish... | c.append('{}- [{}]({})'.format('\t'*(d-2), t, f))
|
<|file_name|>toc.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2014 René Samselnig
#
# This file is part of Database Navigator.
#
# Database Navigator is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publish... | tle(s |
<|file_name|>toc.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2014 René Samselnig
#
# This file is part of Database Navigator.
#
# Database Navigator is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publish... | agment(s |
<|file_name|>toc.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2014 René Samselnig
#
# This file is part of Database Navigator.
#
# Database Navigator is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publish... | pth(s |
<|file_name|>Class_LabExperimBased.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Class_LabExperimBased provides functionalities for data handling of data obtained in lab experiments in the field of (waste)water treatment.
Copyright (C) 2016 Chaim De Mulder
This program is free software: you can redistrib... | ----------
column_name : str
column with values
x : int |
<|file_name|>Class_LabExperimBased.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Class_LabExperimBased provides functionalities for data handling of data obtained in lab experiments in the field of (waste)water treatment.
Copyright (C) 2016 Chaim De Mulder
This program is free software: you can redistrib... | """
Superclass for a HydroData object, expanding the functionalities with
specific functions for data gathered is lab experiments.
Attributes
----------
timedata_column : str
name of the column containing the time data
data_type : str
type of the data provided
experiment... |
<|file_name|>Class_LabExperimBased.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Class_LabExperimBased provides functionalities for data handling of data obtained in lab experiments in the field of (waste)water treatment.
Copyright (C) 2016 Chaim De Mulder
This program is free software: you can redistrib... | """
initialisation of a LabExperimBased object, based on a previously defined
HydroData object.
"""
HydroData.__init__(self,data,timedata_column=timedata_column,data_type=data_type,
experiment_tag=experiment_tag,time_unit=time_unit) |
<|file_name|>Class_LabExperimBased.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Class_LabExperimBased provides functionalities for data handling of data obtained in lab experiments in the field of (waste)water treatment.
Copyright (C) 2016 Chaim De Mulder
This program is free software: you can redistrib... | """
calculates the hours from the relative values
Parameters
----------
time_column : string
column containing the relative time values; default to index
"""
if time_column == 'index':
self.data['index']=self.time.values
self.d... |
<|file_name|>Class_LabExperimBased.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Class_LabExperimBased provides functionalities for data handling of data obtained in lab experiments in the field of (waste)water treatment.
Copyright (C) 2016 Chaim De Mulder
This program is free software: you can redistrib... | """
calculates the concentration values of the given column and adds them as
a new column to the DataFrame.
Parameters
----------
column_name : str
column with values
x : int
...
y : int
...
new_name : str
... |
<|file_name|>Class_LabExperimBased.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Class_LabExperimBased provides functionalities for data handling of data obtained in lab experiments in the field of (waste)water treatment.
Copyright (C) 2016 Chaim De Mulder
This program is free software: you can redistrib... | """
gives the maximal change in pH
Parameters
----------
ph_column : str
column with pH-values, default to 'pH'
threshold : int
threshold value for warning, default to '0.4'
"""
dph = self.data[ph_column].max()-self.data[ph_column]... |
<|file_name|>Class_LabExperimBased.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Class_LabExperimBased provides functionalities for data handling of data obtained in lab experiments in the field of (waste)water treatment.
Copyright (C) 2016 Chaim De Mulder
This program is free software: you can redistrib... | """
(start_values-end_values)
Parameters
----------
columns : array of strings
"""
inv=0
outv=0
indexes= self.time.values
for column in columns:
inv += self.data[column][indexes[0]]
for column in columns:
ou... |
<|file_name|>Class_LabExperimBased.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Class_LabExperimBased provides functionalities for data handling of data obtained in lab experiments in the field of (waste)water treatment.
Copyright (C) 2016 Chaim De Mulder
This program is free software: you can redistrib... | """
total removal of nitrogen
(1-(end_values/start_values))
Parameters
----------
columns : array of strings
"""
inv=0
outv=0
indexes= self.time.values
for column in columns:
inv += self.data[column][indexes[0]]
... |
<|file_name|>Class_LabExperimBased.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Class_LabExperimBased provides functionalities for data handling of data obtained in lab experiments in the field of (waste)water treatment.
Copyright (C) 2016 Chaim De Mulder
This program is free software: you can redistrib... | """
calculates the slope of the selected columns
Parameters
----------
columns : array of strings
columns to calculate the slope for
time_column : str
time used for calculation; default to 'h'
"""
for column in columns:
... |
<|file_name|>Class_LabExperimBased.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Class_LabExperimBased provides functionalities for data handling of data obtained in lab experiments in the field of (waste)water treatment.
Copyright (C) 2016 Chaim De Mulder
This program is free software: you can redistrib... | """
calculates the slope of the selected columns
Parameters
----------
columns : array of strings
columns to plot
time_column : str
time used for calculation; default to 'h'
"""
fig = plt.figure(figsize=(10,6))
ax = fig.add... |
<|file_name|>Class_LabExperimBased.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Class_LabExperimBased provides functionalities for data handling of data obtained in lab experiments in the field of (waste)water treatment.
Copyright (C) 2016 Chaim De Mulder
This program is free software: you can redistrib... | """
function printing the output of functions that remove datapoints.
Parameters
----------
original : int
original length of the dataset
new : int
length of the new dataset
type_ : str
'removed' or 'dropped'
"""
print('Original dataset:',original,'datapoint... |
<|file_name|>Class_LabExperimBased.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Class_LabExperimBased provides functionalities for data handling of data obtained in lab experiments in the field of (waste)water treatment.
Copyright (C) 2016 Chaim De Mulder
This program is free software: you can redistrib... | """
function writing the output of functions that remove datapoints to a log file.
Parameters
----------
log_file : str
string containing the directory to the log file to be written out
original : int
original length of the dataset
new : int
length of the new dataset... |
<|file_name|>Class_LabExperimBased.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Class_LabExperimBased provides functionalities for data handling of data obtained in lab experiments in the field of (waste)water treatment.
Copyright (C) 2016 Chaim De Mulder
This program is free software: you can redistrib... | self.data['index']=self.time.values
self.data['h']= (self.data['indexes'])*24 + self.data['indexes'].shift(1)
self.data['h'].fillna(0,inplace=True)
self.data.drop('index', axis=1, inplace=True) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.