prompt large_stringlengths 72 9.34k | completion large_stringlengths 0 7.61k |
|---|---|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | if not value:
return []
if isinstance(value, list):
return value
return value.split(',') |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | return ','.join(value) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | defaults = {
'widget': forms.CheckboxSelectMultiple,
'choices': self.get_choices(include_blank=False),
'label': capfirst(self.verbose_name),
'required': not self.blank,
'help_text': self.help_text
}
if self.has_default():
if callable(self.default):
defaults['initial'] = self.default
defa... |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | invalid_values = []
for val in value:
try:
validate_slug(val)
except ValidationError:
invalid_values.append(val)
if invalid_values:
# should really make a custom message.
raise ValidationError(self.error_messages['invalid_choice'] % invalid_values) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | if isinstance(self._choices, RegistryIterator):
return self._choices.copy()
elif hasattr(self._choices, 'next'):
choices, self._choices = itertools.tee(self._choices)
return choices
else:
return self._choices |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | raise AttributeError # ? |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | json_string = getattr(instance, self.field.attname)
instance.__dict__[self.field.name] = json.loads(json_string) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | value = kwargs.pop(self.name)
# Hack to handle the xml serializer's handling of "null"
if value is None:
value = 'null'
kwargs[self.attname] = value |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | value = 'null' |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | return [] |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | return value |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | if callable(self.default):
defaults['initial'] = self.default
defaults['show_hidden_initial'] = True
else:
defaults['initial'] = self.get_default() |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | defaults['initial'] = self.default
defaults['show_hidden_initial'] = True |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | defaults['initial'] = self.get_default() |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | del kwargs[k] |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | raise ValidationError(self.error_messages['invalid_choice'] % invalid_values) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | return self._choices.copy() |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | choices, self._choices = itertools.tee(self._choices)
return choices |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | return self._choices |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | add_introspection_rules([], ["^philo\.models\.fields\.SlugMultipleChoiceField"])
add_introspection_rules([], ["^philo\.models\.fields\.TemplateField"])
add_introspection_rules([], ["^philo\.models\.fields\.JSONField"]) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | __init__ |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | __init__ |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | __get__ |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | __set__ |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | __delete__ |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | get_attname |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | contribute_to_class |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | fix_init_kwarg |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | formfield |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | get_internal_type |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | to_python |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | get_prep_value |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | formfield |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | validate |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_slug
from django.db import models
from django.utils import simplejson as json
from django.utils.text import capfirst
from django.utils.translation... | _get_choices |
<|file_name|>mail.py<|end_file_name|><|fim▁begin|># Copyright 2018 Google LLC. 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/LICEN... | # See the License for the specific language governing permissions and
# limitations under the License.
|
<|file_name|>mail.py<|end_file_name|><|fim▁begin|># Copyright 2018 Google LLC. 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/LICEN... | """Inability to send mail."""
pass |
<|file_name|>mail.py<|end_file_name|><|fim▁begin|># Copyright 2018 Google LLC. 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/LICEN... | """Send an email."""
sender = sender or app.config.get('MAIL_FROM')
sender_name = sender_name or app.config.get('MAIL_FROM_NAME') or ''
mail_provider = app.config.get('MAIL_PROVIDER')
if mail_provider is None:
app.logger.error('No MAIL_PROVIDER configured!')
raise MailFailure('No MAI... |
<|file_name|>mail.py<|end_file_name|><|fim▁begin|># Copyright 2018 Google LLC. 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/LICEN... | """SMTP implementation of sending email."""
host = app.config.get('MAIL_HOST')
if not host:
raise MailFailure('SMTP Server Not Configured')
try:
server = smtplib.SMTP(host)
except (smtplib.SMTPConnectError, socket.error) as ex:
app.logger.error('Unable to send mail: %s', st... |
<|file_name|>mail.py<|end_file_name|><|fim▁begin|># Copyright 2018 Google LLC. 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/LICEN... | """Mailjet implementation of sending email."""
api_key = app.config.get('MJ_APIKEY_PUBLIC')
api_secret = app.config.get('MJ_APIKEY_PRIVATE')
if not api_key or not api_secret:
app.logger.error('Missing MJ_APIKEY_PUBLIC/MJ_APIKEY_PRIVATE!')
return
# Note the data structures we use are ... |
<|file_name|>mail.py<|end_file_name|><|fim▁begin|># Copyright 2018 Google LLC. 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/LICEN... | app.logger.error('No MAIL_PROVIDER configured!')
raise MailFailure('No MAIL_PROVIDER configured!') |
<|file_name|>mail.py<|end_file_name|><|fim▁begin|># Copyright 2018 Google LLC. 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/LICEN... | _send_smtp(message, subject, to, to_name, sender, sender_name) |
<|file_name|>mail.py<|end_file_name|><|fim▁begin|># Copyright 2018 Google LLC. 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/LICEN... | _send_mailjet(message, subject, to, to_name, sender, sender_name) |
<|file_name|>mail.py<|end_file_name|><|fim▁begin|># Copyright 2018 Google LLC. 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/LICEN... | app.logger.error('Invalid MAIL_PROVIDER configured!')
raise MailFailure('Invalid MAIL_PROVIDER configured!') |
<|file_name|>mail.py<|end_file_name|><|fim▁begin|># Copyright 2018 Google LLC. 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/LICEN... | raise MailFailure('SMTP Server Not Configured') |
<|file_name|>mail.py<|end_file_name|><|fim▁begin|># Copyright 2018 Google LLC. 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/LICEN... | server.set_debuglevel(True) |
<|file_name|>mail.py<|end_file_name|><|fim▁begin|># Copyright 2018 Google LLC. 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/LICEN... | app.logger.error('Missing MJ_APIKEY_PUBLIC/MJ_APIKEY_PRIVATE!')
return |
<|file_name|>mail.py<|end_file_name|><|fim▁begin|># Copyright 2018 Google LLC. 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/LICEN... | from_obj["Name"] = sender_name |
<|file_name|>mail.py<|end_file_name|><|fim▁begin|># Copyright 2018 Google LLC. 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/LICEN... | to_obj[0]["Name"] = to_name |
<|file_name|>mail.py<|end_file_name|><|fim▁begin|># Copyright 2018 Google LLC. 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/LICEN... | app.logger.error(
'Error sending via mailjet: (%d) %r',
result.status_code, result.text)
raise MailFailure('Error sending via mailjet!') |
<|file_name|>mail.py<|end_file_name|><|fim▁begin|># Copyright 2018 Google LLC. 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/LICEN... | app.logger.error('Error sending via mailjet: %r', j)
raise MailFailure('Error sending via mailjet!') |
<|file_name|>mail.py<|end_file_name|><|fim▁begin|># Copyright 2018 Google LLC. 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/LICEN... | send |
<|file_name|>mail.py<|end_file_name|><|fim▁begin|># Copyright 2018 Google LLC. 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/LICEN... | _send_smtp |
<|file_name|>mail.py<|end_file_name|><|fim▁begin|># Copyright 2018 Google LLC. 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/LICEN... | _send_mailjet |
<|file_name|>add_vcf_to_project.py<|end_file_name|><|fim▁begin|>import os
from xbrowse_server import xbrowse_controls
from django.core.management.base import BaseCommand
from xbrowse_server.base.models import Project, Individual, VCFFile
from xbrowse_server import sample_management
class Command(BaseCommand):
... | parser.add_argument('args', nargs='*')
|
<|file_name|>add_vcf_to_project.py<|end_file_name|><|fim▁begin|>import os
from xbrowse_server import xbrowse_controls
from django.core.management.base import BaseCommand
from xbrowse_server.base.models import Project, Individual, VCFFile
from xbrowse_server import sample_management
class Command(BaseCommand):
... | def add_arguments(self, parser):
parser.add_argument('args', nargs='*')
parser.add_argument('--indiv-id')
parser.add_argument('--cohort-id')
parser.add_argument('--clear', action="store_true", help="Whether to clear any previously-added VCF paths before adding this one")
par... |
<|file_name|>add_vcf_to_project.py<|end_file_name|><|fim▁begin|>import os
from xbrowse_server import xbrowse_controls
from django.core.management.base import BaseCommand
from xbrowse_server.base.models import Project, Individual, VCFFile
from xbrowse_server import sample_management
class Command(BaseCommand):
... | parser.add_argument('args', nargs='*')
parser.add_argument('--indiv-id')
parser.add_argument('--cohort-id')
parser.add_argument('--clear', action="store_true", help="Whether to clear any previously-added VCF paths before adding this one")
parser.add_argument('--load', action="st... |
<|file_name|>add_vcf_to_project.py<|end_file_name|><|fim▁begin|>import os
from xbrowse_server import xbrowse_controls
from django.core.management.base import BaseCommand
from xbrowse_server.base.models import Project, Individual, VCFFile
from xbrowse_server import sample_management
class Command(BaseCommand):
... | project_id = args[0]
project = Project.objects.get(project_id=project_id)
vcf_file_path = os.path.abspath(args[1])
vcf_file = VCFFile.objects.get_or_create(file_path=vcf_file_path)[0]
if options.get('clear'):
for individual in project.individual_set.all():
... |
<|file_name|>add_vcf_to_project.py<|end_file_name|><|fim▁begin|>import os
from xbrowse_server import xbrowse_controls
from django.core.management.base import BaseCommand
from xbrowse_server.base.models import Project, Individual, VCFFile
from xbrowse_server import sample_management
class Command(BaseCommand):
... | for individual in project.individual_set.all():
individual.vcf_files.clear() |
<|file_name|>add_vcf_to_project.py<|end_file_name|><|fim▁begin|>import os
from xbrowse_server import xbrowse_controls
from django.core.management.base import BaseCommand
from xbrowse_server.base.models import Project, Individual, VCFFile
from xbrowse_server import sample_management
class Command(BaseCommand):
... | individual = Individual.objects.get(
project=project,
indiv_id=options.get('indiv_id')
)
sample_management.add_vcf_file_to_individual(individual, vcf_file) |
<|file_name|>add_vcf_to_project.py<|end_file_name|><|fim▁begin|>import os
from xbrowse_server import xbrowse_controls
from django.core.management.base import BaseCommand
from xbrowse_server.base.models import Project, Individual, VCFFile
from xbrowse_server import sample_management
class Command(BaseCommand):
... | sample_management.add_vcf_file_to_project(project, vcf_file) |
<|file_name|>add_vcf_to_project.py<|end_file_name|><|fim▁begin|>import os
from xbrowse_server import xbrowse_controls
from django.core.management.base import BaseCommand
from xbrowse_server.base.models import Project, Individual, VCFFile
from xbrowse_server import sample_management
class Command(BaseCommand):
... | print("Loading VCF into project store")
xbrowse_controls.load_project(project_id, vcf_files=[vcf_file_path])
print("Loading VCF datastore")
xbrowse_controls.load_project_datastore(project_id, vcf_files=[vcf_file_path]) |
<|file_name|>add_vcf_to_project.py<|end_file_name|><|fim▁begin|>import os
from xbrowse_server import xbrowse_controls
from django.core.management.base import BaseCommand
from xbrowse_server.base.models import Project, Individual, VCFFile
from xbrowse_server import sample_management
class Command(BaseCommand):
... | add_arguments |
<|file_name|>add_vcf_to_project.py<|end_file_name|><|fim▁begin|>import os
from xbrowse_server import xbrowse_controls
from django.core.management.base import BaseCommand
from xbrowse_server.base.models import Project, Individual, VCFFile
from xbrowse_server import sample_management
class Command(BaseCommand):
... | handle |
<|file_name|>types_bytes_subscrstep.py<|end_file_name|><|fim▁begin|>"""
categories: Types,bytes
description: Bytes subscr with step != 1 not implemented
cause: Unknown
workaround: Unknown<|fim▁hole|>print(b'123'[0:3:2])<|fim▁end|> | """ |
<|file_name|>gui.py<|end_file_name|><|fim▁begin|>"""Tkinker gui for pylint"""
from Tkinter import Tk, Frame, Listbox, Entry, Label, Button, Scrollbar
from Tkinter import TOP, LEFT, RIGHT, BOTTOM, END, X, Y, BOTH
import os
import sys
if sys.platform.startswith('win'):
PYLINT = 'pylint.bat'
else:
PYLINT = 'pyli... |
def quit(self, _=None):
"""quit the application"""
self.root.quit() |
<|file_name|>gui.py<|end_file_name|><|fim▁begin|>"""Tkinker gui for pylint"""
from Tkinter import Tk, Frame, Listbox, Entry, Label, Button, Scrollbar
from Tkinter import TOP, LEFT, RIGHT, BOTTOM, END, X, Y, BOTH
import os
import sys
if sys.platform.startswith('win'):
PYLINT = 'pylint.bat'
else:
PYLINT = 'pyli... | """Build and control a window to interact with pylint"""
def __init__(self, root=None):
self.root = root or Tk()
self.root.title('Pylint')
top_frame = Frame(self.root)
res_frame = Frame(self.root)
btn_frame = Frame(self.root)
top_frame.pack(side=TOP, fill=X)
... |
<|file_name|>gui.py<|end_file_name|><|fim▁begin|>"""Tkinker gui for pylint"""
from Tkinter import Tk, Frame, Listbox, Entry, Label, Button, Scrollbar
from Tkinter import TOP, LEFT, RIGHT, BOTTOM, END, X, Y, BOTH
import os
import sys
if sys.platform.startswith('win'):
PYLINT = 'pylint.bat'
else:
PYLINT = 'pyli... | self.root = root or Tk()
self.root.title('Pylint')
top_frame = Frame(self.root)
res_frame = Frame(self.root)
btn_frame = Frame(self.root)
top_frame.pack(side=TOP, fill=X)
res_frame.pack(side=TOP, fill=BOTH, expand=True)
btn_frame.pack(side=TOP, fill=X)
... |
<|file_name|>gui.py<|end_file_name|><|fim▁begin|>"""Tkinker gui for pylint"""
from Tkinter import Tk, Frame, Listbox, Entry, Label, Button, Scrollbar
from Tkinter import TOP, LEFT, RIGHT, BOTTOM, END, X, Y, BOTH
import os
import sys
if sys.platform.startswith('win'):
PYLINT = 'pylint.bat'
else:
PYLINT = 'pyli... | """launch the mainloop of the application"""
self.root.mainloop() |
<|file_name|>gui.py<|end_file_name|><|fim▁begin|>"""Tkinker gui for pylint"""
from Tkinter import Tk, Frame, Listbox, Entry, Label, Button, Scrollbar
from Tkinter import TOP, LEFT, RIGHT, BOTTOM, END, X, Y, BOTH
import os
import sys
if sys.platform.startswith('win'):
PYLINT = 'pylint.bat'
else:
PYLINT = 'pyli... | """quit the application"""
self.root.quit() |
<|file_name|>gui.py<|end_file_name|><|fim▁begin|>"""Tkinker gui for pylint"""
from Tkinter import Tk, Frame, Listbox, Entry, Label, Button, Scrollbar
from Tkinter import TOP, LEFT, RIGHT, BOTTOM, END, X, Y, BOTH
import os
import sys
if sys.platform.startswith('win'):
PYLINT = 'pylint.bat'
else:
PYLINT = 'pyli... | """launches pylint"""
colors = {'W:':'red1', 'E:': 'red4',
'W:': 'red3', '**': 'navy'}
self.root.configure(cursor='watch')
self.results.focus_set()
self.results.delete(0, END)
self.results.update()
module = self.txtModule.get()
p... |
<|file_name|>gui.py<|end_file_name|><|fim▁begin|>"""Tkinker gui for pylint"""
from Tkinter import Tk, Frame, Listbox, Entry, Label, Button, Scrollbar
from Tkinter import TOP, LEFT, RIGHT, BOTTOM, END, X, Y, BOTH
import os
import sys
if sys.platform.startswith('win'):
PYLINT = 'pylint.bat'
else:
PYLINT = 'pyli... | """launch pylint gui from args"""
if args:
print 'USAGE: pylint-gui\n launch a simple pylint gui using Tk'
return
gui = LintGui()
gui.mainloop() |
<|file_name|>gui.py<|end_file_name|><|fim▁begin|>"""Tkinker gui for pylint"""
from Tkinter import Tk, Frame, Listbox, Entry, Label, Button, Scrollbar
from Tkinter import TOP, LEFT, RIGHT, BOTTOM, END, X, Y, BOTH
import os
import sys
if sys.platform.startswith('win'):
<|fim_middle|>
else:
PYLINT = 'pylint... | PYLINT = 'pylint.bat' |
<|file_name|>gui.py<|end_file_name|><|fim▁begin|>"""Tkinker gui for pylint"""
from Tkinter import Tk, Frame, Listbox, Entry, Label, Button, Scrollbar
from Tkinter import TOP, LEFT, RIGHT, BOTTOM, END, X, Y, BOTH
import os
import sys
if sys.platform.startswith('win'):
PYLINT = 'pylint.bat'
else:
<|fim_midd... | PYLINT = 'pylint' |
<|file_name|>gui.py<|end_file_name|><|fim▁begin|>"""Tkinker gui for pylint"""
from Tkinter import Tk, Frame, Listbox, Entry, Label, Button, Scrollbar
from Tkinter import TOP, LEFT, RIGHT, BOTTOM, END, X, Y, BOTH
import os
import sys
if sys.platform.startswith('win'):
PYLINT = 'pylint.bat'
else:
PYLINT = 'pyli... | print 'USAGE: pylint-gui\n launch a simple pylint gui using Tk'
return |
<|file_name|>gui.py<|end_file_name|><|fim▁begin|>"""Tkinker gui for pylint"""
from Tkinter import Tk, Frame, Listbox, Entry, Label, Button, Scrollbar
from Tkinter import TOP, LEFT, RIGHT, BOTTOM, END, X, Y, BOTH
import os
import sys
if sys.platform.startswith('win'):
PYLINT = 'pylint.bat'
else:
PYLINT = 'pyli... | Run(sys.argv[1:]) |
<|file_name|>gui.py<|end_file_name|><|fim▁begin|>"""Tkinker gui for pylint"""
from Tkinter import Tk, Frame, Listbox, Entry, Label, Button, Scrollbar
from Tkinter import TOP, LEFT, RIGHT, BOTTOM, END, X, Y, BOTH
import os
import sys
if sys.platform.startswith('win'):
PYLINT = 'pylint.bat'
else:
PYLINT = 'pyli... | __init__ |
<|file_name|>gui.py<|end_file_name|><|fim▁begin|>"""Tkinker gui for pylint"""
from Tkinter import Tk, Frame, Listbox, Entry, Label, Button, Scrollbar
from Tkinter import TOP, LEFT, RIGHT, BOTTOM, END, X, Y, BOTH
import os
import sys
if sys.platform.startswith('win'):
PYLINT = 'pylint.bat'
else:
PYLINT = 'pyli... | mainloop |
<|file_name|>gui.py<|end_file_name|><|fim▁begin|>"""Tkinker gui for pylint"""
from Tkinter import Tk, Frame, Listbox, Entry, Label, Button, Scrollbar
from Tkinter import TOP, LEFT, RIGHT, BOTTOM, END, X, Y, BOTH
import os
import sys
if sys.platform.startswith('win'):
PYLINT = 'pylint.bat'
else:
PYLINT = 'pyli... | quit |
<|file_name|>gui.py<|end_file_name|><|fim▁begin|>"""Tkinker gui for pylint"""
from Tkinter import Tk, Frame, Listbox, Entry, Label, Button, Scrollbar
from Tkinter import TOP, LEFT, RIGHT, BOTTOM, END, X, Y, BOTH
import os
import sys
if sys.platform.startswith('win'):
PYLINT = 'pylint.bat'
else:
PYLINT = 'pyli... | run_lint |
<|file_name|>gui.py<|end_file_name|><|fim▁begin|>"""Tkinker gui for pylint"""
from Tkinter import Tk, Frame, Listbox, Entry, Label, Button, Scrollbar
from Tkinter import TOP, LEFT, RIGHT, BOTTOM, END, X, Y, BOTH
import os
import sys
if sys.platform.startswith('win'):
PYLINT = 'pylint.bat'
else:
PYLINT = 'pyli... | Run |
<|file_name|>test_first_seen_event.py<|end_file_name|><|fim▁begin|>from sentry.testutils.cases import RuleTestCase
from sentry.rules.conditions.first_seen_event import FirstSeenEventCondition
class FirstSeenEventConditionTest(RuleTestCase):
rule_cls = FirstSeenEventCondition
def test_applies_correctly(self):... | rule = self.get_rule() |
<|file_name|>test_first_seen_event.py<|end_file_name|><|fim▁begin|>from sentry.testutils.cases import RuleTestCase
from sentry.rules.conditions.first_seen_event import FirstSeenEventCondition
class FirstSeenEventConditionTest(RuleTestCase):
<|fim_middle|>
<|fim▁end|> | rule_cls = FirstSeenEventCondition
def test_applies_correctly(self):
rule = self.get_rule()
self.assertPasses(rule, self.event, is_new=True)
self.assertDoesNotPass(rule, self.event, is_new=False) |
<|file_name|>test_first_seen_event.py<|end_file_name|><|fim▁begin|>from sentry.testutils.cases import RuleTestCase
from sentry.rules.conditions.first_seen_event import FirstSeenEventCondition
class FirstSeenEventConditionTest(RuleTestCase):
rule_cls = FirstSeenEventCondition
def test_applies_correctly(self):... | rule = self.get_rule()
self.assertPasses(rule, self.event, is_new=True)
self.assertDoesNotPass(rule, self.event, is_new=False) |
<|file_name|>test_first_seen_event.py<|end_file_name|><|fim▁begin|>from sentry.testutils.cases import RuleTestCase
from sentry.rules.conditions.first_seen_event import FirstSeenEventCondition
class FirstSeenEventConditionTest(RuleTestCase):
rule_cls = FirstSeenEventCondition
def <|fim_middle|>(self):
... | test_applies_correctly |
<|file_name|>block_depth.py<|end_file_name|><|fim▁begin|>"""
Block Depth Transformer
"""
from __future__ import absolute_import
from openedx.core.djangoapps.content.block_structure.transformer import BlockStructureTransformer
class BlockDepthTransformer(BlockStructureTransformer):
"""
Keep track of the depth... |
def transform(self, usage_info, block_structure):
"""
Mutates block_structure based on the given usage_info. |
<|file_name|>block_depth.py<|end_file_name|><|fim▁begin|>"""
Block Depth Transformer
"""
from __future__ import absolute_import
from openedx.core.djangoapps.content.block_structure.transformer import BlockStructureTransformer
class BlockDepthTransformer(BlockStructureTransformer):
<|fim_middle|>
<|fim▁end|> | """
Keep track of the depth of each block within the block structure. In case
of multiple paths to a given node (in a DAG), use the shallowest depth.
"""
WRITE_VERSION = 1
READ_VERSION = 1
BLOCK_DEPTH = 'block_depth'
def __init__(self, requested_depth=None):
self.requested_dept... |
<|file_name|>block_depth.py<|end_file_name|><|fim▁begin|>"""
Block Depth Transformer
"""
from __future__ import absolute_import
from openedx.core.djangoapps.content.block_structure.transformer import BlockStructureTransformer
class BlockDepthTransformer(BlockStructureTransformer):
"""
Keep track of the depth... | self.requested_depth = requested_depth |
<|file_name|>block_depth.py<|end_file_name|><|fim▁begin|>"""
Block Depth Transformer
"""
from __future__ import absolute_import
from openedx.core.djangoapps.content.block_structure.transformer import BlockStructureTransformer
class BlockDepthTransformer(BlockStructureTransformer):
"""
Keep track of the depth... | return "blocks_api:block_depth" |
<|file_name|>block_depth.py<|end_file_name|><|fim▁begin|>"""
Block Depth Transformer
"""
from __future__ import absolute_import
from openedx.core.djangoapps.content.block_structure.transformer import BlockStructureTransformer
class BlockDepthTransformer(BlockStructureTransformer):
"""
Keep track of the depth... | """
Return the precalculated depth of a block within the block_structure:
Arguments:
block_structure: a BlockStructure instance
block_key: the key of the block whose depth we want to know
Returns:
int
"""
return block_structure.get_tr... |
<|file_name|>block_depth.py<|end_file_name|><|fim▁begin|>"""
Block Depth Transformer
"""
from __future__ import absolute_import
from openedx.core.djangoapps.content.block_structure.transformer import BlockStructureTransformer
class BlockDepthTransformer(BlockStructureTransformer):
"""
Keep track of the depth... | """
Mutates block_structure based on the given usage_info.
"""
for block_key in block_structure.topological_traversal():
parents = block_structure.get_parents(block_key)
if parents:
block_depth = min(
self.get_block_depth(block_... |
<|file_name|>block_depth.py<|end_file_name|><|fim▁begin|>"""
Block Depth Transformer
"""
from __future__ import absolute_import
from openedx.core.djangoapps.content.block_structure.transformer import BlockStructureTransformer
class BlockDepthTransformer(BlockStructureTransformer):
"""
Keep track of the depth... | block_depth = min(
self.get_block_depth(block_structure, parent_key)
for parent_key in parents
) + 1 |
<|file_name|>block_depth.py<|end_file_name|><|fim▁begin|>"""
Block Depth Transformer
"""
from __future__ import absolute_import
from openedx.core.djangoapps.content.block_structure.transformer import BlockStructureTransformer
class BlockDepthTransformer(BlockStructureTransformer):
"""
Keep track of the depth... | block_depth = 0 |
<|file_name|>block_depth.py<|end_file_name|><|fim▁begin|>"""
Block Depth Transformer
"""
from __future__ import absolute_import
from openedx.core.djangoapps.content.block_structure.transformer import BlockStructureTransformer
class BlockDepthTransformer(BlockStructureTransformer):
"""
Keep track of the depth... | block_structure.remove_block_traversal(
lambda block_key: self.get_block_depth(block_structure, block_key) > self.requested_depth
) |
<|file_name|>block_depth.py<|end_file_name|><|fim▁begin|>"""
Block Depth Transformer
"""
from __future__ import absolute_import
from openedx.core.djangoapps.content.block_structure.transformer import BlockStructureTransformer
class BlockDepthTransformer(BlockStructureTransformer):
"""
Keep track of the depth... | __init__ |
<|file_name|>block_depth.py<|end_file_name|><|fim▁begin|>"""
Block Depth Transformer
"""
from __future__ import absolute_import
from openedx.core.djangoapps.content.block_structure.transformer import BlockStructureTransformer
class BlockDepthTransformer(BlockStructureTransformer):
"""
Keep track of the depth... | name |
<|file_name|>block_depth.py<|end_file_name|><|fim▁begin|>"""
Block Depth Transformer
"""
from __future__ import absolute_import
from openedx.core.djangoapps.content.block_structure.transformer import BlockStructureTransformer
class BlockDepthTransformer(BlockStructureTransformer):
"""
Keep track of the depth... | get_block_depth |
<|file_name|>block_depth.py<|end_file_name|><|fim▁begin|>"""
Block Depth Transformer
"""
from __future__ import absolute_import
from openedx.core.djangoapps.content.block_structure.transformer import BlockStructureTransformer
class BlockDepthTransformer(BlockStructureTransformer):
"""
Keep track of the depth... | transform |
<|file_name|>suite.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
"""
``climactic.suite``
-------------------
.. autoclass:: ClimacticTestSuite
"""
import logging
import unittest
from pathlib import Path
from climactic.case import ClimacticTestCase
logger = logging.getLogger(__name__)
class ClimacticTestS... |
for target_path in target_paths:
for test in cls.collect_file( |
<|file_name|>suite.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
"""
``climactic.suite``
-------------------
.. autoclass:: ClimacticTestSuite
"""
import logging
import unittest
from pathlib import Path
from climactic.case import ClimacticTestCase
logger = logging.getLogger(__name__)
class ClimacticTestS... | """
A collection of tests.
"""
@classmethod
def from_targets(cls, *targets, **kwargs):
suite = cls()
tests = []
logger.trace("Processing target list {}", list(targets))
for target in targets:
logger.trace("Processing target '{}'", target)
try:... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.