prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>slack.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # # Copyright (c) 2017 Nick Douma # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including wi...
iso8601_to_unix_timestamp
<|file_name|>slack.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # # Copyright (c) 2017 Nick Douma # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including wi...
hex_value
<|file_name|>test_utils.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from django_nose.tools import assert_false, assert_true from pontoon.base.tests import TestCase from pontoon.base.utils import extension_in class UtilsTests(TestCase): def test_extension_in(self): assert_true(extension_in('filename.txt',...
<|file_name|>test_utils.py<|end_file_name|><|fim▁begin|>from django_nose.tools import assert_false, assert_true from pontoon.base.tests import TestCase from pontoon.base.utils import extension_in class UtilsTests(TestCase): <|fim_middle|> <|fim▁end|>
def test_extension_in(self): assert_true(extension_in('filename.txt', ['bat', 'txt'])) assert_true(extension_in('filename.biff', ['biff'])) assert_true(extension_in('filename.tar.gz', ['gz'])) assert_false(extension_in('filename.txt', ['png', 'jpg'])) assert_false(extension_...
<|file_name|>test_utils.py<|end_file_name|><|fim▁begin|>from django_nose.tools import assert_false, assert_true from pontoon.base.tests import TestCase from pontoon.base.utils import extension_in class UtilsTests(TestCase): def test_extension_in(self): <|fim_middle|> <|fim▁end|>
assert_true(extension_in('filename.txt', ['bat', 'txt'])) assert_true(extension_in('filename.biff', ['biff'])) assert_true(extension_in('filename.tar.gz', ['gz'])) assert_false(extension_in('filename.txt', ['png', 'jpg'])) assert_false(extension_in('.dotfile', ['bat', 'txt'])) ...
<|file_name|>test_utils.py<|end_file_name|><|fim▁begin|>from django_nose.tools import assert_false, assert_true from pontoon.base.tests import TestCase from pontoon.base.utils import extension_in class UtilsTests(TestCase): def <|fim_middle|>(self): assert_true(extension_in('filename.txt', ['bat', 'txt']...
test_extension_in
<|file_name|>call_invocation_tester.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig...
<|file_name|>call_invocation_tester.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig...
def __init__(self, *args ): unittest.TestCase.__init__( self, *args ) def __test_split_impl(self, decl_string, name, args): self.failUnless( ( name, args ) == declarations.call_invocation.split( decl_string ) ) def __test_split_recursive_impl(self, decl_string, control_seq): ...
<|file_name|>call_invocation_tester.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig...
unittest.TestCase.__init__( self, *args )
<|file_name|>call_invocation_tester.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig...
self.failUnless( ( name, args ) == declarations.call_invocation.split( decl_string ) )
<|file_name|>call_invocation_tester.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig...
self.failUnless( control_seq == declarations.call_invocation.split_recursive( decl_string ) )
<|file_name|>call_invocation_tester.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig...
self.failUnless( declarations.call_invocation.is_call_invocation( decl_string ) )
<|file_name|>call_invocation_tester.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig...
self.__test_is_call_invocation_impl( "vector(int,std::allocator(int) )" ) self.__test_split_impl( "vector(int,std::allocator(int) )" , "vector" , [ "int", "std::allocator(int)" ] ) self.__test_split_recursive_impl( "vector(i...
<|file_name|>call_invocation_tester.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig...
self.__test_is_call_invocation_impl( "basic_string(char,std::char_traits(char),std::allocator(char) )" ) self.__test_split_impl( "basic_string(char,std::char_traits(char),std::allocator(char) )" , "basic_string" , [ "char", "std::char_...
<|file_name|>call_invocation_tester.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig...
self.__test_is_call_invocation_impl( "map(long int,std::vector(int, std::allocator(int) ),std::less(long int),std::allocator(std::pair(const long int, std::vector(int, std::allocator(int) ) ) ) )" ) self.__test_split_impl( "map(long int,std::vector(int, std::allocator(int) ),std::less(long int),std::...
<|file_name|>call_invocation_tester.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig...
self.failUnless( "vector( int, std::allocator(int) )" == declarations.call_invocation.join("vector", ( "int", "std::allocator(int)" ) ) )
<|file_name|>call_invocation_tester.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig...
temp = 'x()()' found = declarations.call_invocation.find_args( temp ) self.failUnless( (1,2) == found ) found = declarations.call_invocation.find_args( temp, found[1]+1 ) self.failUnless( (3, 4) == found ) temp = 'x(int,int)(1,2)' found = declarations.call_i...
<|file_name|>call_invocation_tester.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig...
src = 'AlternativeName((&string("")), (&string("")), (&string("")))' self.__test_split_impl( src , 'AlternativeName' , ['(&string(""))', '(&string(""))', '(&string(""))'] )
<|file_name|>call_invocation_tester.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig...
suite = unittest.TestSuite() suite.addTest( unittest.makeSuite(tester_t)) return suite
<|file_name|>call_invocation_tester.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig...
unittest.TextTestRunner(verbosity=2).run( create_suite() )
<|file_name|>call_invocation_tester.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig...
run_suite()
<|file_name|>call_invocation_tester.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig...
__init__
<|file_name|>call_invocation_tester.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig...
__test_split_impl
<|file_name|>call_invocation_tester.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig...
__test_split_recursive_impl
<|file_name|>call_invocation_tester.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig...
__test_is_call_invocation_impl
<|file_name|>call_invocation_tester.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig...
test_split_on_vector
<|file_name|>call_invocation_tester.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig...
test_split_on_string
<|file_name|>call_invocation_tester.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig...
test_split_on_map
<|file_name|>call_invocation_tester.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig...
test_join_on_vector
<|file_name|>call_invocation_tester.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig...
test_find_args
<|file_name|>call_invocation_tester.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig...
test_bug_unmatched_brace
<|file_name|>call_invocation_tester.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig...
create_suite
<|file_name|>call_invocation_tester.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig...
run_suite
<|file_name|>data_api.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from colab.plugins.utils.proxy_data_api import ProxyDataAPI class JenkinsDataAPI(ProxyDataAPI): def fetch_data(self): pass<|fim▁end|>
<|file_name|>data_api.py<|end_file_name|><|fim▁begin|>from colab.plugins.utils.proxy_data_api import ProxyDataAPI class JenkinsDataAPI(ProxyDataAPI): <|fim_middle|> <|fim▁end|>
def fetch_data(self): pass
<|file_name|>data_api.py<|end_file_name|><|fim▁begin|>from colab.plugins.utils.proxy_data_api import ProxyDataAPI class JenkinsDataAPI(ProxyDataAPI): def fetch_data(self): <|fim_middle|> <|fim▁end|>
pass
<|file_name|>data_api.py<|end_file_name|><|fim▁begin|>from colab.plugins.utils.proxy_data_api import ProxyDataAPI class JenkinsDataAPI(ProxyDataAPI): def <|fim_middle|>(self): pass <|fim▁end|>
fetch_data
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>import base64 try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.3, 2.4 fallback. from django import http, template from django.conf import settings from django.contrib.auth.models import User from d...
if '@' in username: # Mistakenly entered e-mail address instead of username? Look it up.
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>import base64 try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.3, 2.4 fallback. from django import http, template from django.conf import settings from django.contrib.auth.models import User from d...
request.session.set_test_cookie() return render_to_response('admin/login.html', { 'title': _('Log in'), 'app_path': request.get_full_path(), 'error_message': error_message }, context_instance=template.RequestContext(request))
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>import base64 try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.3, 2.4 fallback. from django import http, template from django.conf import settings from django.contrib.auth.models import User from d...
""" Decorator for views that checks that the user is logged in and is a staff member, displaying the login page if necessary. """ def _checklogin(request, *args, **kwargs): if request.user.is_authenticated() and request.user.is_staff: # The user is valid. Continue to the admin pa...
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>import base64 try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.3, 2.4 fallback. from django import http, template from django.conf import settings from django.contrib.auth.models import User from d...
if request.user.is_authenticated() and request.user.is_staff: # The user is valid. Continue to the admin page. return view_func(request, *args, **kwargs) assert hasattr(request, 'session'), "The Django admin requires session middleware to be installed. Edit your MIDDLEWARE_CLASS...
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>import base64 try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.3, 2.4 fallback. from django import http, template from django.conf import settings from django.contrib.auth.models import User from d...
return view_func(request, *args, **kwargs)
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>import base64 try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.3, 2.4 fallback. from django import http, template from django.conf import settings from django.contrib.auth.models import User from d...
if request.POST: message = _("Please log in again, because your session has expired.") else: message = "" return _display_login_form(request, message)
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>import base64 try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.3, 2.4 fallback. from django import http, template from django.conf import settings from django.contrib.auth.models import User from d...
message = _("Please log in again, because your session has expired.")
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>import base64 try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.3, 2.4 fallback. from django import http, template from django.conf import settings from django.contrib.auth.models import User from d...
message = ""
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>import base64 try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.3, 2.4 fallback. from django import http, template from django.conf import settings from django.contrib.auth.models import User from d...
message = _("Looks like your browser isn't configured to accept cookies. Please enable cookies, reload this page, and try again.") return _display_login_form(request, message)
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>import base64 try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.3, 2.4 fallback. from django import http, template from django.conf import settings from django.contrib.auth.models import User from d...
request.session.delete_test_cookie()
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>import base64 try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.3, 2.4 fallback. from django import http, template from django.conf import settings from django.contrib.auth.models import User from d...
message = ERROR_MESSAGE if '@' in username: # Mistakenly entered e-mail address instead of username? Look it up. users = list(User.all().filter('email =', username)) if len(users) == 1 and users[0].check_password(password): mess...
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>import base64 try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.3, 2.4 fallback. from django import http, template from django.conf import settings from django.contrib.auth.models import User from d...
users = list(User.all().filter('email =', username)) if len(users) == 1 and users[0].check_password(password): message = _("Your e-mail address is not your username. Try '%s' instead.") % users[0].username else: # Either we cannot f...
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>import base64 try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.3, 2.4 fallback. from django import http, template from django.conf import settings from django.contrib.auth.models import User from d...
message = _("Your e-mail address is not your username. Try '%s' instead.") % users[0].username
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>import base64 try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.3, 2.4 fallback. from django import http, template from django.conf import settings from django.contrib.auth.models import User from d...
message = _("Usernames cannot contain the '@' character.")
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>import base64 try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.3, 2.4 fallback. from django import http, template from django.conf import settings from django.contrib.auth.models import User from d...
if user.is_active and user.is_staff: login(request, user) return http.HttpResponseRedirect(request.get_full_path()) else: return _display_login_form(request, ERROR_MESSAGE)
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>import base64 try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.3, 2.4 fallback. from django import http, template from django.conf import settings from django.contrib.auth.models import User from d...
login(request, user) return http.HttpResponseRedirect(request.get_full_path())
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>import base64 try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.3, 2.4 fallback. from django import http, template from django.conf import settings from django.contrib.auth.models import User from d...
return _display_login_form(request, ERROR_MESSAGE)
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>import base64 try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.3, 2.4 fallback. from django import http, template from django.conf import settings from django.contrib.auth.models import User from d...
_display_login_form
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>import base64 try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.3, 2.4 fallback. from django import http, template from django.conf import settings from django.contrib.auth.models import User from d...
staff_member_required
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>import base64 try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.3, 2.4 fallback. from django import http, template from django.conf import settings from django.contrib.auth.models import User from d...
_checklogin
<|file_name|>run.py<|end_file_name|><|fim▁begin|>from mainapp import create_app app = create_app() if __name__ == '__main__':<|fim▁hole|> app.run(host='0.0.0.0')<|fim▁end|>
<|file_name|>run.py<|end_file_name|><|fim▁begin|>from mainapp import create_app app = create_app() if __name__ == '__main__': <|fim_middle|> <|fim▁end|>
app.run(host='0.0.0.0')
<|file_name|>Shendrones.py<|end_file_name|><|fim▁begin|>import scrapy from scrapy import log from scrapy.spiders import CrawlSpider, Rule from scrapy.linkextractors import LinkExtractor from rcbi.items import Part import copy import json import re VARIANT_JSON_REGEX = re.compile("product: ({.*}),") class ShendronesS...
rules = ( Rule(LinkExtractor(restrict_css=[".grid-item"]), callback='parse_item'), )
<|file_name|>Shendrones.py<|end_file_name|><|fim▁begin|>import scrapy from scrapy import log from scrapy.spiders import CrawlSpider, Rule from scrapy.linkextractors import LinkExtractor from rcbi.items import Part import copy import json import re VARIANT_JSON_REGEX = re.compile("product: ({.*}),") class ShendronesS...
name = "shendrones" allowed_domains = ["shendrones.myshopify.com"] start_urls = ["http://shendrones.myshopify.com/collections/all"] rules = ( Rule(LinkExtractor(restrict_css=[".grid-item"]), callback='parse_item'), ) def parse_item(self, response): item = Part() item["site"] = self.name v...
<|file_name|>Shendrones.py<|end_file_name|><|fim▁begin|>import scrapy from scrapy import log from scrapy.spiders import CrawlSpider, Rule from scrapy.linkextractors import LinkExtractor from rcbi.items import Part import copy import json import re VARIANT_JSON_REGEX = re.compile("product: ({.*}),") class ShendronesS...
item = Part() item["site"] = self.name variant = {} item["variants"] = [variant] base_url = response.url item["manufacturer"] = "Shendrones" # Find the json info for variants. body = response.body_as_unicode() m = VARIANT_JSON_REGEX.search(body) if m: shopify_info = jso...
<|file_name|>Shendrones.py<|end_file_name|><|fim▁begin|>import scrapy from scrapy import log from scrapy.spiders import CrawlSpider, Rule from scrapy.linkextractors import LinkExtractor from rcbi.items import Part import copy import json import re VARIANT_JSON_REGEX = re.compile("product: ({.*}),") class ShendronesS...
shopify_info = json.loads(m.group(1)) global_title = shopify_info["title"] preorder = False if global_title.endswith("Pre Order"): global_title = global_title[:-len("Pre Order")].strip() variant["stock_state"] = "backordered" preorder = True for v in shopify_info["v...
<|file_name|>Shendrones.py<|end_file_name|><|fim▁begin|>import scrapy from scrapy import log from scrapy.spiders import CrawlSpider, Rule from scrapy.linkextractors import LinkExtractor from rcbi.items import Part import copy import json import re VARIANT_JSON_REGEX = re.compile("product: ({.*}),") class ShendronesS...
global_title = global_title[:-len("Pre Order")].strip() variant["stock_state"] = "backordered" preorder = True
<|file_name|>Shendrones.py<|end_file_name|><|fim▁begin|>import scrapy from scrapy import log from scrapy.spiders import CrawlSpider, Rule from scrapy.linkextractors import LinkExtractor from rcbi.items import Part import copy import json import re VARIANT_JSON_REGEX = re.compile("product: ({.*}),") class ShendronesS...
item["name"] = global_title + " " + v["title"] variant["url"] = base_url + "?variant=" + str(v["id"])
<|file_name|>Shendrones.py<|end_file_name|><|fim▁begin|>import scrapy from scrapy import log from scrapy.spiders import CrawlSpider, Rule from scrapy.linkextractors import LinkExtractor from rcbi.items import Part import copy import json import re VARIANT_JSON_REGEX = re.compile("product: ({.*}),") class ShendronesS...
item["name"] = global_title variant["url"] = base_url
<|file_name|>Shendrones.py<|end_file_name|><|fim▁begin|>import scrapy from scrapy import log from scrapy.spiders import CrawlSpider, Rule from scrapy.linkextractors import LinkExtractor from rcbi.items import Part import copy import json import re VARIANT_JSON_REGEX = re.compile("product: ({.*}),") class ShendronesS...
if v["inventory_quantity"] <= 0: if v["inventory_policy"] == "deny": variant["stock_state"] = "out_of_stock" else: variant["stock_state"] = "backordered" elif v["inventory_quantity"] < 3: variant["stock_state"] = "low_stock" ...
<|file_name|>Shendrones.py<|end_file_name|><|fim▁begin|>import scrapy from scrapy import log from scrapy.spiders import CrawlSpider, Rule from scrapy.linkextractors import LinkExtractor from rcbi.items import Part import copy import json import re VARIANT_JSON_REGEX = re.compile("product: ({.*}),") class ShendronesS...
if v["inventory_policy"] == "deny": variant["stock_state"] = "out_of_stock" else: variant["stock_state"] = "backordered"
<|file_name|>Shendrones.py<|end_file_name|><|fim▁begin|>import scrapy from scrapy import log from scrapy.spiders import CrawlSpider, Rule from scrapy.linkextractors import LinkExtractor from rcbi.items import Part import copy import json import re VARIANT_JSON_REGEX = re.compile("product: ({.*}),") class ShendronesS...
variant["stock_state"] = "out_of_stock"
<|file_name|>Shendrones.py<|end_file_name|><|fim▁begin|>import scrapy from scrapy import log from scrapy.spiders import CrawlSpider, Rule from scrapy.linkextractors import LinkExtractor from rcbi.items import Part import copy import json import re VARIANT_JSON_REGEX = re.compile("product: ({.*}),") class ShendronesS...
variant["stock_state"] = "backordered"
<|file_name|>Shendrones.py<|end_file_name|><|fim▁begin|>import scrapy from scrapy import log from scrapy.spiders import CrawlSpider, Rule from scrapy.linkextractors import LinkExtractor from rcbi.items import Part import copy import json import re VARIANT_JSON_REGEX = re.compile("product: ({.*}),") class ShendronesS...
variant["stock_state"] = "low_stock" variant["stock_text"] = "Only " + str(v["inventory_quantity"]) + " left!"
<|file_name|>Shendrones.py<|end_file_name|><|fim▁begin|>import scrapy from scrapy import log from scrapy.spiders import CrawlSpider, Rule from scrapy.linkextractors import LinkExtractor from rcbi.items import Part import copy import json import re VARIANT_JSON_REGEX = re.compile("product: ({.*}),") class ShendronesS...
variant["stock_state"] = "in_stock"
<|file_name|>Shendrones.py<|end_file_name|><|fim▁begin|>import scrapy from scrapy import log from scrapy.spiders import CrawlSpider, Rule from scrapy.linkextractors import LinkExtractor from rcbi.items import Part import copy import json import re VARIANT_JSON_REGEX = re.compile("product: ({.*}),") class ShendronesS...
parse_item
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*- # vi: set ft=python sts=4 ts=4 sw=4 noet : # This file is part of Fail2Ban. # # Fail2Ban is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public L...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*- # vi: set ft=python sts=4 ts=4 sw=4 noet : # This file is part of Fail2Ban. # # Fail2Ban is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public L...
""" Log 'msg % args' with severity 'NOTICE'. To pass exception information, use the keyword argument exc_info with a true value, e.g. logger.notice("Houston, we have a %s", "major disaster", exc_info=1) """ if self.isEnabledFor(logging.NOTICE): self._log(logging.NOTICE, msg, args, **kwargs)
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*- # vi: set ft=python sts=4 ts=4 sw=4 noet : # This file is part of Fail2Ban. # # Fail2Ban is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public L...
""" Log a message with severity 'NOTICE' on the root logger. """ if len(logging.root.handlers) == 0: logging.basicConfig() logging.root.notice(msg, *args, **kwargs)
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*- # vi: set ft=python sts=4 ts=4 sw=4 noet : # This file is part of Fail2Ban. # # Fail2Ban is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public L...
for i in range(50): if logging.getLevelName(i).startswith('Level'): logging.addLevelName(i, '#%02d-Lev.' % i)
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*- # vi: set ft=python sts=4 ts=4 sw=4 noet : # This file is part of Fail2Ban. # # Fail2Ban is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public L...
self._log(logging.NOTICE, msg, args, **kwargs)
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*- # vi: set ft=python sts=4 ts=4 sw=4 noet : # This file is part of Fail2Ban. # # Fail2Ban is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public L...
logging.basicConfig()
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*- # vi: set ft=python sts=4 ts=4 sw=4 noet : # This file is part of Fail2Ban. # # Fail2Ban is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public L...
logging.addLevelName(i, '#%02d-Lev.' % i)
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*- # vi: set ft=python sts=4 ts=4 sw=4 noet : # This file is part of Fail2Ban. # # Fail2Ban is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public L...
_Logger_notice
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*- # vi: set ft=python sts=4 ts=4 sw=4 noet : # This file is part of Fail2Ban. # # Fail2Ban is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public L...
_root_notice
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*- # vi: set ft=python sts=4 ts=4 sw=4 noet : # This file is part of Fail2Ban. # # Fail2Ban is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public L...
_init
<|file_name|>gcccuda.py<|end_file_name|><|fim▁begin|>## # Copyright 2013-2020 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https:...
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
<|file_name|>gcccuda.py<|end_file_name|><|fim▁begin|>## # Copyright 2013-2020 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https:...
"""Compiler toolchain with GCC and CUDA.""" NAME = 'gcccuda' COMPILER_MODULE_NAME = ['GCC', 'CUDA'] SUBTOOLCHAIN = GccToolchain.NAME
<|file_name|>add_rack_bunker.py<|end_file_name|><|fim▁begin|># -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4:<|fim▁hole|># Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obta...
# # Copyright (C) 2008,2009,2010,2011,2012,2013,2014,2018 Contributor #
<|file_name|>add_rack_bunker.py<|end_file_name|><|fim▁begin|># -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2011,2012,2013,2014,2018 Contributor # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use t...
required_parameters = ["bunker", "row", "column"]
<|file_name|>divsum_analysis.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python<|fim▁hole|>import sys print "divsum_analysis.py DivsumFile NumberOfNucleotides" try: file = sys.argv[1] except: file = raw_input("Introduce RepeatMasker's Divsum file: ") try: nucs = sys.argv[2] except: nucs = raw_input("I...
<|file_name|>test_nondet.py<|end_file_name|><|fim▁begin|>import numpy as np from numba import cuda, float32 from numba.cuda.testing import unittest, CUDATestCase def generate_input(n): A = np.array(np.arange(n * n).reshape(n, n), dtype=np.float32) B = np.array(np.arange(n) + 0, dtype=A.dtype) return A, B ...
<|file_name|>test_nondet.py<|end_file_name|><|fim▁begin|>import numpy as np from numba import cuda, float32 from numba.cuda.testing import unittest, CUDATestCase def generate_input(n): <|fim_middle|> class TestCudaNonDet(CUDATestCase): def test_for_pre(self): """Test issue with loop not running due...
A = np.array(np.arange(n * n).reshape(n, n), dtype=np.float32) B = np.array(np.arange(n) + 0, dtype=A.dtype) return A, B
<|file_name|>test_nondet.py<|end_file_name|><|fim▁begin|>import numpy as np from numba import cuda, float32 from numba.cuda.testing import unittest, CUDATestCase def generate_input(n): A = np.array(np.arange(n * n).reshape(n, n), dtype=np.float32) B = np.array(np.arange(n) + 0, dtype=A.dtype) return A, B ...
def test_for_pre(self): """Test issue with loop not running due to bad sign-extension at the for loop precondition. """ @cuda.jit(argtypes=[float32[:, :], float32[:, :], float32[:]]) def diagproduct(c, a, b): startX, startY = cuda.grid(2) gridX = cuda...
<|file_name|>test_nondet.py<|end_file_name|><|fim▁begin|>import numpy as np from numba import cuda, float32 from numba.cuda.testing import unittest, CUDATestCase def generate_input(n): A = np.array(np.arange(n * n).reshape(n, n), dtype=np.float32) B = np.array(np.arange(n) + 0, dtype=A.dtype) return A, B ...
"""Test issue with loop not running due to bad sign-extension at the for loop precondition. """ @cuda.jit(argtypes=[float32[:, :], float32[:, :], float32[:]]) def diagproduct(c, a, b): startX, startY = cuda.grid(2) gridX = cuda.gridDim.x * cuda.blockDim.x...
<|file_name|>test_nondet.py<|end_file_name|><|fim▁begin|>import numpy as np from numba import cuda, float32 from numba.cuda.testing import unittest, CUDATestCase def generate_input(n): A = np.array(np.arange(n * n).reshape(n, n), dtype=np.float32) B = np.array(np.arange(n) + 0, dtype=A.dtype) return A, B ...
startX, startY = cuda.grid(2) gridX = cuda.gridDim.x * cuda.blockDim.x gridY = cuda.gridDim.y * cuda.blockDim.y height = c.shape[0] width = c.shape[1] for x in range(startX, width, (gridX)): for y in range(startY, height, (gridY)):...
<|file_name|>test_nondet.py<|end_file_name|><|fim▁begin|>import numpy as np from numba import cuda, float32 from numba.cuda.testing import unittest, CUDATestCase def generate_input(n): A = np.array(np.arange(n * n).reshape(n, n), dtype=np.float32) B = np.array(np.arange(n) + 0, dtype=A.dtype) return A, B ...
unittest.main()
<|file_name|>test_nondet.py<|end_file_name|><|fim▁begin|>import numpy as np from numba import cuda, float32 from numba.cuda.testing import unittest, CUDATestCase def <|fim_middle|>(n): A = np.array(np.arange(n * n).reshape(n, n), dtype=np.float32) B = np.array(np.arange(n) + 0, dtype=A.dtype) return A, B ...
generate_input
<|file_name|>test_nondet.py<|end_file_name|><|fim▁begin|>import numpy as np from numba import cuda, float32 from numba.cuda.testing import unittest, CUDATestCase def generate_input(n): A = np.array(np.arange(n * n).reshape(n, n), dtype=np.float32) B = np.array(np.arange(n) + 0, dtype=A.dtype) return A, B ...
test_for_pre
<|file_name|>test_nondet.py<|end_file_name|><|fim▁begin|>import numpy as np from numba import cuda, float32 from numba.cuda.testing import unittest, CUDATestCase def generate_input(n): A = np.array(np.arange(n * n).reshape(n, n), dtype=np.float32) B = np.array(np.arange(n) + 0, dtype=A.dtype) return A, B ...
diagproduct
<|file_name|>stack.py<|end_file_name|><|fim▁begin|># Stack implementation class Stack (object): def __init__ (self):<|fim▁hole|> self.stack.append(data) def peek (self): if self.isEmpty(): return None return self.stack[-1] def pop (self): if self.isEmpty(): return None return self.stack.pop() de...
self.stack = [] def push (self, data):
<|file_name|>stack.py<|end_file_name|><|fim▁begin|># Stack implementation class Stack (object): <|fim_middle|> <|fim▁end|>
def __init__ (self): self.stack = [] def push (self, data): self.stack.append(data) def peek (self): if self.isEmpty(): return None return self.stack[-1] def pop (self): if self.isEmpty(): return None return self.stack.pop() def isEmpty (self): return len(self.stack) == 0 def __str__ (se...
<|file_name|>stack.py<|end_file_name|><|fim▁begin|># Stack implementation class Stack (object): def __init__ (self): <|fim_middle|> def push (self, data): self.stack.append(data) def peek (self): if self.isEmpty(): return None return self.stack[-1] def pop (self): if self.isEmpty(): return None...
self.stack = []