prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>test_build_auxiliary_coordinate.py<|end_file_name|><|fim▁begin|># (C) British Crown Copyright 2014 - 2015, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Soft...
return var[keys]
<|file_name|>test_build_auxiliary_coordinate.py<|end_file_name|><|fim▁begin|># (C) British Crown Copyright 2014 - 2015, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Soft...
tests.main()
<|file_name|>test_build_auxiliary_coordinate.py<|end_file_name|><|fim▁begin|># (C) British Crown Copyright 2014 - 2015, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Soft...
setUp
<|file_name|>test_build_auxiliary_coordinate.py<|end_file_name|><|fim▁begin|># (C) British Crown Copyright 2014 - 2015, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Soft...
patched__getitem__
<|file_name|>test_build_auxiliary_coordinate.py<|end_file_name|><|fim▁begin|># (C) British Crown Copyright 2014 - 2015, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Soft...
test_slowest_varying_vertex_dim
<|file_name|>test_build_auxiliary_coordinate.py<|end_file_name|><|fim▁begin|># (C) British Crown Copyright 2014 - 2015, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Soft...
test_fastest_varying_vertex_dim
<|file_name|>test_build_auxiliary_coordinate.py<|end_file_name|><|fim▁begin|># (C) British Crown Copyright 2014 - 2015, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Soft...
test_fastest_with_different_dim_names
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>"""django_todo URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlp...
Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- #!/usr/bin/env python from setuptools import setup, find_packages setup( name = 'wechat-python-sdk', version = '0.5.7', keywords = ('wechat', 'sdk', 'wechat sdk'), description = u'微信公众平台Python开发包',<|fim▁hole|> license = 'BSD...
long_description = open("README.rst").read(),
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse from django.core.servers.basehttp import FileWrapper from django.contrib.auth.models import User from django.shortcuts import render_to_response, redirect, get_object_or_404 from requests import get from urllib import urlretrieve ...
def cgit_url(user_name, repo_name, method, path, query=None): url = 'http://localhost:8080/view'
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse from django.core.servers.basehttp import FileWrapper from django.contrib.auth.models import User from django.shortcuts import render_to_response, redirect, get_object_or_404 from requests import get from urllib import urlretrieve ...
url = 'http://localhost:8080/view' if method == 'summary': base = '%s/%s/%s' %(url, user_name, repo_name) else: base = '%s/%s/%s/%s' %(url, user_name, repo_name, method) if path is not None: base = '%s/%s' %(base, path) if query is not None and len(query)>1: base = ...
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse from django.core.servers.basehttp import FileWrapper from django.contrib.auth.models import User from django.shortcuts import render_to_response, redirect, get_object_or_404 from requests import get from urllib import urlretrieve ...
if path is None or len(path) == 0: return path c = [path[0]] for part in path[1:]: c.append('%s/%s'%(c[-1], part)) return c
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse from django.core.servers.basehttp import FileWrapper from django.contrib.auth.models import User from django.shortcuts import render_to_response, redirect, get_object_or_404 from requests import get from urllib import urlretrieve ...
return redirect('index')
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse from django.core.servers.basehttp import FileWrapper from django.contrib.auth.models import User from django.shortcuts import render_to_response, redirect, get_object_or_404 from requests import get from urllib import urlretrieve ...
return redirect('repo_list', user_name)
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse from django.core.servers.basehttp import FileWrapper from django.contrib.auth.models import User from django.shortcuts import render_to_response, redirect, get_object_or_404 from requests import get from urllib import urlretrieve ...
user = request.user owner = get_object_or_404(User, username=user_name) repo = get_object_or_404(Repository, owner=owner, name=repo_name) collaborators = repo.collaborators.all() access = repo.user_access(user) if access is None: return HttpResponse('Not authorized', status=401) q...
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse from django.core.servers.basehttp import FileWrapper from django.contrib.auth.models import User from django.shortcuts import render_to_response, redirect, get_object_or_404 from requests import get from urllib import urlretrieve ...
user = request.user owner = get_object_or_404(User, username=user_name) repo = get_object_or_404(Repository, owner=owner, name=repo_name) collaborators = repo.collaborators.all() access = repo.user_access(user) if access is None: return HttpResponse('Not authorized', status=401) ...
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse from django.core.servers.basehttp import FileWrapper from django.contrib.auth.models import User from django.shortcuts import render_to_response, redirect, get_object_or_404 from requests import get from urllib import urlretrieve ...
user = request.user owner = get_object_or_404(User, username=user_name) repo = get_object_or_404(Repository, owner=owner, name=repo_name) collaborators = repo.collaborators.all() access = repo.user_access(user) if access is None: return HttpResponse('Not authorized', status=401) ...
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse from django.core.servers.basehttp import FileWrapper from django.contrib.auth.models import User from django.shortcuts import render_to_response, redirect, get_object_or_404 from requests import get from urllib import urlretrieve ...
base = '%s/%s/%s' %(url, user_name, repo_name)
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse from django.core.servers.basehttp import FileWrapper from django.contrib.auth.models import User from django.shortcuts import render_to_response, redirect, get_object_or_404 from requests import get from urllib import urlretrieve ...
base = '%s/%s/%s/%s' %(url, user_name, repo_name, method)
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse from django.core.servers.basehttp import FileWrapper from django.contrib.auth.models import User from django.shortcuts import render_to_response, redirect, get_object_or_404 from requests import get from urllib import urlretrieve ...
base = '%s/%s' %(base, path)
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse from django.core.servers.basehttp import FileWrapper from django.contrib.auth.models import User from django.shortcuts import render_to_response, redirect, get_object_or_404 from requests import get from urllib import urlretrieve ...
base = "%s?%s" % (base, query)
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse from django.core.servers.basehttp import FileWrapper from django.contrib.auth.models import User from django.shortcuts import render_to_response, redirect, get_object_or_404 from requests import get from urllib import urlretrieve ...
return path
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse from django.core.servers.basehttp import FileWrapper from django.contrib.auth.models import User from django.shortcuts import render_to_response, redirect, get_object_or_404 from requests import get from urllib import urlretrieve ...
return HttpResponse('Not authorized', status=401)
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse from django.core.servers.basehttp import FileWrapper from django.contrib.auth.models import User from django.shortcuts import render_to_response, redirect, get_object_or_404 from requests import get from urllib import urlretrieve ...
return HttpResponse('Not authorized', status=401)
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse from django.core.servers.basehttp import FileWrapper from django.contrib.auth.models import User from django.shortcuts import render_to_response, redirect, get_object_or_404 from requests import get from urllib import urlretrieve ...
return HttpResponse('Not authorized', status=401)
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse from django.core.servers.basehttp import FileWrapper from django.contrib.auth.models import User from django.shortcuts import render_to_response, redirect, get_object_or_404 from requests import get from urllib import urlretrieve ...
file_path = path.split('/') path_parts = cumulative_path(file_path) file_path = zip(file_path, path_parts)
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse from django.core.servers.basehttp import FileWrapper from django.contrib.auth.models import User from django.shortcuts import render_to_response, redirect, get_object_or_404 from requests import get from urllib import urlretrieve ...
file_path = None
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse from django.core.servers.basehttp import FileWrapper from django.contrib.auth.models import User from django.shortcuts import render_to_response, redirect, get_object_or_404 from requests import get from urllib import urlretrieve ...
cgit_url
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse from django.core.servers.basehttp import FileWrapper from django.contrib.auth.models import User from django.shortcuts import render_to_response, redirect, get_object_or_404 from requests import get from urllib import urlretrieve ...
cumulative_path
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse from django.core.servers.basehttp import FileWrapper from django.contrib.auth.models import User from django.shortcuts import render_to_response, redirect, get_object_or_404 from requests import get from urllib import urlretrieve ...
view_index
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse from django.core.servers.basehttp import FileWrapper from django.contrib.auth.models import User from django.shortcuts import render_to_response, redirect, get_object_or_404 from requests import get from urllib import urlretrieve ...
user_index
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse from django.core.servers.basehttp import FileWrapper from django.contrib.auth.models import User from django.shortcuts import render_to_response, redirect, get_object_or_404 from requests import get from urllib import urlretrieve ...
repo_plain
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse from django.core.servers.basehttp import FileWrapper from django.contrib.auth.models import User from django.shortcuts import render_to_response, redirect, get_object_or_404 from requests import get from urllib import urlretrieve ...
repo_snapshot
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse from django.core.servers.basehttp import FileWrapper from django.contrib.auth.models import User from django.shortcuts import render_to_response, redirect, get_object_or_404 from requests import get from urllib import urlretrieve ...
repo_browse
<|file_name|>test_connection.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals import httpretty import json import sure from pyeqs import QuerySet, Filter from pyeqs.dsl import Term, Sort, ScriptScore from tests.helpers import homogeneous @httpretty.activate def test_cr...
body=json.dumps(good_response), content_type="application/json") # When I run a query
<|file_name|>test_connection.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals import httpretty import json import sure from pyeqs import QuerySet, Filter from pyeqs.dsl import Term, Sort, ScriptScore from tests.helpers import homogeneous @httpretty.activate def test_cr...
""" Create a queryset with a host given as a string """ # When create a queryset t = QuerySet("localhost", index="bar") # And I have records response = { "took": 1, "hits": { "total": 1, "max_score": 1, "hits": [ { "_i...
<|file_name|>test_connection.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals import httpretty import json import sure from pyeqs import QuerySet, Filter from pyeqs.dsl import Term, Sort, ScriptScore from tests.helpers import homogeneous @httpretty.activate def test_cr...
""" Create a queryset with a host given as a dict """ # When create a queryset connection_info = {"host": "localhost", "port": 8080} t = QuerySet(connection_info, index="bar") # And I have records good_response = { "took": 1, "hits": { "total": 1, "max_...
<|file_name|>test_connection.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals import httpretty import json import sure from pyeqs import QuerySet, Filter from pyeqs.dsl import Term, Sort, ScriptScore from tests.helpers import homogeneous @httpretty.activate def test_cr...
""" Create a queryset with a host given as a list """ # When create a queryset connection_info = [{"host": "localhost", "port": 8080}] t = QuerySet(connection_info, index="bar") # And I have records good_response = { "took": 1, "hits": { "total": 1, "ma...
<|file_name|>test_connection.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals import httpretty import json import sure from pyeqs import QuerySet, Filter from pyeqs.dsl import Term, Sort, ScriptScore from tests.helpers import homogeneous @httpretty.activate def <|fim_m...
test_create_queryset_with_host_string
<|file_name|>test_connection.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals import httpretty import json import sure from pyeqs import QuerySet, Filter from pyeqs.dsl import Term, Sort, ScriptScore from tests.helpers import homogeneous @httpretty.activate def test_cr...
test_create_queryset_with_host_dict
<|file_name|>test_connection.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals import httpretty import json import sure from pyeqs import QuerySet, Filter from pyeqs.dsl import Term, Sort, ScriptScore from tests.helpers import homogeneous @httpretty.activate def test_cr...
test_create_queryset_with_host_list
<|file_name|>nmcollector.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python from noisemapper.mapper import * #from collectors.lib import utils <|fim▁hole|> def main(): # utils.drop_privileges() mapper = NoiseMapper() mapper.run() if __name__ == "__main__": main()<|fim▁end|>
### Define the object mapper and start mapping
<|file_name|>nmcollector.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python from noisemapper.mapper import * #from collectors.lib import utils ### Define the object mapper and start mapping def main(): # utils.drop_privileges() <|fim_middle|> if __name__ == "__main__": main() <|fim▁end|>
mapper = NoiseMapper() mapper.run()
<|file_name|>nmcollector.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python from noisemapper.mapper import * #from collectors.lib import utils ### Define the object mapper and start mapping def main(): # utils.drop_privileges() mapper = NoiseMapper() mapper.run() if __name__ == "__main__": <|fim_m...
main()
<|file_name|>nmcollector.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python from noisemapper.mapper import * #from collectors.lib import utils ### Define the object mapper and start mapping def <|fim_middle|>(): # utils.drop_privileges() mapper = NoiseMapper() mapper.run() if __name__ == "__main__": m...
main
<|file_name|>ezmenu.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # I found this file inside Super Mario Bros python # written by HJ https://sourceforge.net/projects/supermariobrosp/ # the complete work is licensed under GPL3 although I can not determine# license of this file # maybe this is the original auth...
if ren.get_width() > self.width: self.width = ren.get_width() surface.blit(ren, ((self.x+self.width/2) - ren.get_width()/2, self.y + i*(self.font.get_height()+4)))
<|file_name|>ezmenu.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # I found this file inside Super Mario Bros python # written by HJ https://sourceforge.net/projects/supermariobrosp/ # the complete work is licensed under GPL3 although I can not determine# license of this file # maybe this is the original auth...
def __init__(self, *options): self.options = options self.x = 0 self.y = 0 self.font = pygame.font.Font(None, 32) self.option = 0 self.width = 1 self.color = [0, 0, 0] self.hcolor = [255, 0, 0] self.height = len(self.options)*self.font.get_hei...
<|file_name|>ezmenu.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # I found this file inside Super Mario Bros python # written by HJ https://sourceforge.net/projects/supermariobrosp/ # the complete work is licensed under GPL3 although I can not determine# license of this file # maybe this is the original auth...
self.options = options self.x = 0 self.y = 0 self.font = pygame.font.Font(None, 32) self.option = 0 self.width = 1 self.color = [0, 0, 0] self.hcolor = [255, 0, 0] self.height = len(self.options)*self.font.get_height() for o in self.options...
<|file_name|>ezmenu.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # I found this file inside Super Mario Bros python # written by HJ https://sourceforge.net/projects/supermariobrosp/ # the complete work is licensed under GPL3 although I can not determine# license of this file # maybe this is the original auth...
i=0 for o in self.options: if i==self.option: clr = self.hcolor else: clr = self.color text = o[0] ren = self.font.render(text, 2, clr) if ren.get_width() > self.width: self.width = ren.get_width(...
<|file_name|>ezmenu.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # I found this file inside Super Mario Bros python # written by HJ https://sourceforge.net/projects/supermariobrosp/ # the complete work is licensed under GPL3 although I can not determine# license of this file # maybe this is the original auth...
for e in events: if e.type == pygame.KEYDOWN: if e.key == pygame.K_DOWN: self.option += 1 if e.key == pygame.K_UP: self.option -= 1 if e.key == pygame.K_RETURN: self.options[self.option][1...
<|file_name|>ezmenu.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # I found this file inside Super Mario Bros python # written by HJ https://sourceforge.net/projects/supermariobrosp/ # the complete work is licensed under GPL3 although I can not determine# license of this file # maybe this is the original auth...
self.x = x self.y = y
<|file_name|>ezmenu.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # I found this file inside Super Mario Bros python # written by HJ https://sourceforge.net/projects/supermariobrosp/ # the complete work is licensed under GPL3 although I can not determine# license of this file # maybe this is the original auth...
self.font = font
<|file_name|>ezmenu.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # I found this file inside Super Mario Bros python # written by HJ https://sourceforge.net/projects/supermariobrosp/ # the complete work is licensed under GPL3 although I can not determine# license of this file # maybe this is the original auth...
self.hcolor = color
<|file_name|>ezmenu.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # I found this file inside Super Mario Bros python # written by HJ https://sourceforge.net/projects/supermariobrosp/ # the complete work is licensed under GPL3 although I can not determine# license of this file # maybe this is the original auth...
self.color = color
<|file_name|>ezmenu.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # I found this file inside Super Mario Bros python # written by HJ https://sourceforge.net/projects/supermariobrosp/ # the complete work is licensed under GPL3 although I can not determine# license of this file # maybe this is the original auth...
self.x = x-(self.width/2) self.y = y-(self.height/2)
<|file_name|>ezmenu.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # I found this file inside Super Mario Bros python # written by HJ https://sourceforge.net/projects/supermariobrosp/ # the complete work is licensed under GPL3 although I can not determine# license of this file # maybe this is the original auth...
self.width = ren.get_width()
<|file_name|>ezmenu.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # I found this file inside Super Mario Bros python # written by HJ https://sourceforge.net/projects/supermariobrosp/ # the complete work is licensed under GPL3 although I can not determine# license of this file # maybe this is the original auth...
clr = self.hcolor
<|file_name|>ezmenu.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # I found this file inside Super Mario Bros python # written by HJ https://sourceforge.net/projects/supermariobrosp/ # the complete work is licensed under GPL3 although I can not determine# license of this file # maybe this is the original auth...
clr = self.color
<|file_name|>ezmenu.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # I found this file inside Super Mario Bros python # written by HJ https://sourceforge.net/projects/supermariobrosp/ # the complete work is licensed under GPL3 although I can not determine# license of this file # maybe this is the original auth...
self.width = ren.get_width()
<|file_name|>ezmenu.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # I found this file inside Super Mario Bros python # written by HJ https://sourceforge.net/projects/supermariobrosp/ # the complete work is licensed under GPL3 although I can not determine# license of this file # maybe this is the original auth...
if e.key == pygame.K_DOWN: self.option += 1 if e.key == pygame.K_UP: self.option -= 1 if e.key == pygame.K_RETURN: self.options[self.option][1]()
<|file_name|>ezmenu.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # I found this file inside Super Mario Bros python # written by HJ https://sourceforge.net/projects/supermariobrosp/ # the complete work is licensed under GPL3 although I can not determine# license of this file # maybe this is the original auth...
self.option += 1
<|file_name|>ezmenu.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # I found this file inside Super Mario Bros python # written by HJ https://sourceforge.net/projects/supermariobrosp/ # the complete work is licensed under GPL3 although I can not determine# license of this file # maybe this is the original auth...
self.option -= 1
<|file_name|>ezmenu.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # I found this file inside Super Mario Bros python # written by HJ https://sourceforge.net/projects/supermariobrosp/ # the complete work is licensed under GPL3 although I can not determine# license of this file # maybe this is the original auth...
self.options[self.option][1]()
<|file_name|>ezmenu.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # I found this file inside Super Mario Bros python # written by HJ https://sourceforge.net/projects/supermariobrosp/ # the complete work is licensed under GPL3 although I can not determine# license of this file # maybe this is the original auth...
self.option = 0
<|file_name|>ezmenu.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # I found this file inside Super Mario Bros python # written by HJ https://sourceforge.net/projects/supermariobrosp/ # the complete work is licensed under GPL3 although I can not determine# license of this file # maybe this is the original auth...
self.option = len(self.options)-1
<|file_name|>ezmenu.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # I found this file inside Super Mario Bros python # written by HJ https://sourceforge.net/projects/supermariobrosp/ # the complete work is licensed under GPL3 although I can not determine# license of this file # maybe this is the original auth...
__init__
<|file_name|>ezmenu.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # I found this file inside Super Mario Bros python # written by HJ https://sourceforge.net/projects/supermariobrosp/ # the complete work is licensed under GPL3 although I can not determine# license of this file # maybe this is the original auth...
draw
<|file_name|>ezmenu.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # I found this file inside Super Mario Bros python # written by HJ https://sourceforge.net/projects/supermariobrosp/ # the complete work is licensed under GPL3 although I can not determine# license of this file # maybe this is the original auth...
update
<|file_name|>ezmenu.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # I found this file inside Super Mario Bros python # written by HJ https://sourceforge.net/projects/supermariobrosp/ # the complete work is licensed under GPL3 although I can not determine# license of this file # maybe this is the original auth...
set_pos
<|file_name|>ezmenu.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # I found this file inside Super Mario Bros python # written by HJ https://sourceforge.net/projects/supermariobrosp/ # the complete work is licensed under GPL3 although I can not determine# license of this file # maybe this is the original auth...
set_font
<|file_name|>ezmenu.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # I found this file inside Super Mario Bros python # written by HJ https://sourceforge.net/projects/supermariobrosp/ # the complete work is licensed under GPL3 although I can not determine# license of this file # maybe this is the original auth...
set_highlight_color
<|file_name|>ezmenu.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # I found this file inside Super Mario Bros python # written by HJ https://sourceforge.net/projects/supermariobrosp/ # the complete work is licensed under GPL3 although I can not determine# license of this file # maybe this is the original auth...
set_normal_color
<|file_name|>ezmenu.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # I found this file inside Super Mario Bros python # written by HJ https://sourceforge.net/projects/supermariobrosp/ # the complete work is licensed under GPL3 although I can not determine# license of this file # maybe this is the original auth...
center_at
<|file_name|>test_models.py<|end_file_name|><|fim▁begin|># from test_plus.test import TestCase<|fim▁hole|># class TestUser(TestCase): # # def setUp(self): # self.user = self.make_user() # # def test__str__(self): # self.assertEqual( # self.user.__str__(), # 'testuser' # ...
# #
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import * import versioneer __author__ = 'Chia-Jung, Yang'<|fim▁hole|>__version__ = versioneer.g...
__email__ = 'jeroyang@gmail.com'
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- """ .. currentmodule:: __init__.py .. moduleauthor:: Pat Daburu <pat@daburu.net> <|fim▁hole|><|fim▁end|>
Provide a brief description of the module. """
<|file_name|>model_control_one_enabled_RelativeDifference_ConstantTrend_NoCycle_LSTM.py<|end_file_name|><|fim▁begin|>import tests.model_control.test_ozone_custom_models_enabled as testmod <|fim▁hole|>testmod.build_model( ['RelativeDifference'] , ['ConstantTrend'] , ['NoCycle'] , ['LSTM'] );<|fim▁end|>
<|file_name|>ex32.py<|end_file_name|><|fim▁begin|>the_count = [1, 2, 3, 4, 5] fruits = ['apple', 'oranges', 'pears', 'apricots',] change = [1, 'pennies', 2, 'dimes', 3, 'quarters',] #this first kind of for-loop goes through a list for number in the_count: print("This is count %d" % number) # same as above for fru...
# we can alse build lists, first start with an empty one
<|file_name|>std_pf_readonly.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals<|fim▁hole|>def execute(): """Make standard print formats readonly for system manager""" import webnotes.model.doc new_perms = [ { 'parent': 'Print Format', 'parentfield': 'permissions', 'parenttype': 'DocT...
<|file_name|>std_pf_readonly.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals def execute(): <|fim_middle|> <|fim▁end|>
"""Make standard print formats readonly for system manager""" import webnotes.model.doc new_perms = [ { 'parent': 'Print Format', 'parentfield': 'permissions', 'parenttype': 'DocType', 'role': 'System Manager', 'permlevel': 1, 'read': 1, }, { 'parent': 'Print Format', 'parentfield': ...
<|file_name|>std_pf_readonly.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals def <|fim_middle|>(): """Make standard print formats readonly for system manager""" import webnotes.model.doc new_perms = [ { 'parent': 'Print Format', 'parentfield': 'permissions', 'parenttype': 'DocType'...
execute
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot devices.""" from asyncio import Lock import switchbot # pylint: disable=import-error from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_SENSOR_TYPE, Platform from homeassistant.core import HomeAssist...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot devices.""" from asyncio import Lock import switchbot # pylint: disable=import-error from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_SENSOR_TYPE, Platform from homeassistant.core import HomeAssist...
"""Set up Switchbot from a config entry.""" hass.data.setdefault(DOMAIN, {}) if not entry.options: options = { CONF_TIME_BETWEEN_UPDATE_COMMAND: DEFAULT_TIME_BETWEEN_UPDATE_COMMAND, CONF_RETRY_COUNT: DEFAULT_RETRY_COUNT, CONF_RETRY_TIMEOUT: DEFAULT_RETRY_TIMEOUT,...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot devices.""" from asyncio import Lock import switchbot # pylint: disable=import-error from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_SENSOR_TYPE, Platform from homeassistant.core import HomeAssist...
"""Unload a config entry.""" sensor_type = entry.data[CONF_SENSOR_TYPE] unload_ok = await hass.config_entries.async_unload_platforms( entry, PLATFORMS_BY_TYPE[sensor_type] ) if unload_ok: hass.data[DOMAIN].pop(entry.entry_id) if len(hass.config_entries.async_entries(DOMAIN)...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot devices.""" from asyncio import Lock import switchbot # pylint: disable=import-error from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_SENSOR_TYPE, Platform from homeassistant.core import HomeAssist...
"""Handle options update.""" # Update entity options stored in hass. if {**entry.options} != hass.data[DOMAIN][COMMON_OPTIONS]: hass.data[DOMAIN][COMMON_OPTIONS] = {**entry.options} hass.data[DOMAIN].pop(DATA_COORDINATOR) await hass.config_entries.async_reload(entry.entry_id)
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot devices.""" from asyncio import Lock import switchbot # pylint: disable=import-error from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_SENSOR_TYPE, Platform from homeassistant.core import HomeAssist...
options = { CONF_TIME_BETWEEN_UPDATE_COMMAND: DEFAULT_TIME_BETWEEN_UPDATE_COMMAND, CONF_RETRY_COUNT: DEFAULT_RETRY_COUNT, CONF_RETRY_TIMEOUT: DEFAULT_RETRY_TIMEOUT, CONF_SCAN_TIMEOUT: DEFAULT_SCAN_TIMEOUT, } hass.config_entries.async_update_entry(...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot devices.""" from asyncio import Lock import switchbot # pylint: disable=import-error from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_SENSOR_TYPE, Platform from homeassistant.core import HomeAssist...
if BTLE_LOCK not in hass.data[DOMAIN]: hass.data[DOMAIN][BTLE_LOCK] = Lock() if COMMON_OPTIONS not in hass.data[DOMAIN]: hass.data[DOMAIN][COMMON_OPTIONS] = {**entry.options} switchbot.DEFAULT_RETRY_TIMEOUT = hass.data[DOMAIN][COMMON_OPTIONS][ CONF_RETRY_TIM...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot devices.""" from asyncio import Lock import switchbot # pylint: disable=import-error from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_SENSOR_TYPE, Platform from homeassistant.core import HomeAssist...
hass.data[DOMAIN][BTLE_LOCK] = Lock()
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot devices.""" from asyncio import Lock import switchbot # pylint: disable=import-error from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_SENSOR_TYPE, Platform from homeassistant.core import HomeAssist...
hass.data[DOMAIN][COMMON_OPTIONS] = {**entry.options}
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot devices.""" from asyncio import Lock import switchbot # pylint: disable=import-error from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_SENSOR_TYPE, Platform from homeassistant.core import HomeAssist...
coordinator = hass.data[DOMAIN][DATA_COORDINATOR]
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot devices.""" from asyncio import Lock import switchbot # pylint: disable=import-error from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_SENSOR_TYPE, Platform from homeassistant.core import HomeAssist...
raise ConfigEntryNotReady
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot devices.""" from asyncio import Lock import switchbot # pylint: disable=import-error from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_SENSOR_TYPE, Platform from homeassistant.core import HomeAssist...
hass.data[DOMAIN].pop(entry.entry_id) if len(hass.config_entries.async_entries(DOMAIN)) == 0: hass.data.pop(DOMAIN)
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot devices.""" from asyncio import Lock import switchbot # pylint: disable=import-error from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_SENSOR_TYPE, Platform from homeassistant.core import HomeAssist...
hass.data.pop(DOMAIN)
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot devices.""" from asyncio import Lock import switchbot # pylint: disable=import-error from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_SENSOR_TYPE, Platform from homeassistant.core import HomeAssist...
hass.data[DOMAIN][COMMON_OPTIONS] = {**entry.options} hass.data[DOMAIN].pop(DATA_COORDINATOR)
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot devices.""" from asyncio import Lock import switchbot # pylint: disable=import-error from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_SENSOR_TYPE, Platform from homeassistant.core import HomeAssist...
async_setup_entry
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot devices.""" from asyncio import Lock import switchbot # pylint: disable=import-error from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_SENSOR_TYPE, Platform from homeassistant.core import HomeAssist...
async_unload_entry
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot devices.""" from asyncio import Lock import switchbot # pylint: disable=import-error from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_SENSOR_TYPE, Platform from homeassistant.core import HomeAssist...
_async_update_listener
<|file_name|>fasta.py<|end_file_name|><|fim▁begin|>from Bio import SeqIO def get_proteins_for_db(fastafn, fastadelim, genefield): """Runs through fasta file and returns proteins accession nrs, sequences and evidence levels for storage in lookup DB. Duplicate accessions in fasta are accepted and removed by...
return '_{}'.format(mod)
<|file_name|>fasta.py<|end_file_name|><|fim▁begin|>from Bio import SeqIO def get_proteins_for_db(fastafn, fastadelim, genefield): <|fim_middle|> def parse_fasta(fn): with open(fn) as fp: for record in SeqIO.parse(fp, 'fasta'): yield record def get_record_type(record): dmod = get_d...
"""Runs through fasta file and returns proteins accession nrs, sequences and evidence levels for storage in lookup DB. Duplicate accessions in fasta are accepted and removed by keeping only the last one. """ records = {acc: (rec, get_record_type(rec)) for acc, rec in SeqIO.index(fastafn...
<|file_name|>fasta.py<|end_file_name|><|fim▁begin|>from Bio import SeqIO def get_proteins_for_db(fastafn, fastadelim, genefield): """Runs through fasta file and returns proteins accession nrs, sequences and evidence levels for storage in lookup DB. Duplicate accessions in fasta are accepted and removed by...
symbols = ((get_symbol(rec, rtype, fastadelim, genefield), acc) for acc, (rec, rtype) in records.items() if rtype) othergene = ((get_other_gene(rec, fastadelim, genefield), acc) for acc, (rec, rtype) in records.items() if not rtype and fastadelim and fastadelim in rec.de...