prompt large_stringlengths 72 9.34k | completion large_stringlengths 0 7.61k |
|---|---|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your o... | for bl_id in old_bl_idnames:
register_old(bl_id)
nodes = [n for n in ng.nodes if n.bl_idname == bl_id]
if nodes:
for node in nodes:
mark_old(node)
not_reged_nodes = list(n for n in ng.nodes if not n.is_registered_node_type()... |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your o... | for node in nodes:
mark_old(node)
not_reged_nodes = list(n for n in ng.nodes if not n.is_registered_node_type())
node_count = len(not_reged_nodes)
print("Loaded {}. {} nodes are left unregisted.".format(bl_id, node_count))
... |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your o... | return |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your o... | unregister_old(bl_id) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your o... | mod = importlib.import_module(".{}".format(old_bl_idnames[bl_id]), __name__)
res = inspect.getmembers(mod)
for name, cls in res:
if inspect.isclass(cls):
if issubclass(cls, bpy.types.Node) and cls.bl_idname == bl_id:
if bl_id not in imported_mods:
... |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your o... | if issubclass(cls, bpy.types.Node) and cls.bl_idname == bl_id:
if bl_id not in imported_mods:
try:
mod.register()
except:
traceback.print_exc()
imported_mod... |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your o... | if bl_id not in imported_mods:
try:
mod.register()
except:
traceback.print_exc()
imported_mods[bl_id] = mod
return mod |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your o... | try:
mod.register()
except:
traceback.print_exc()
imported_mods[bl_id] = mod
return mod |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your o... | mod.unregister()
del imported_mods[bl_id] |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your o... | is_old |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your o... | scan_for_old |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your o... | mark_old |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your o... | reload_old |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your o... | load_old |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your o... | register_old |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your o... | unregister_old |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your o... | unregister |
<|file_name|>test_sqlstore.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
import os
from misura.canon import option
from misura.canon.option import get_typed_cols, get_insert_cmd, base_col_def, print_tree
import sqlite3
from misura.canon.tests import testdir
db = testdir + 's... | print(get_typed_cols(go('String')))
print(get_typed_cols(go('Point')))
print(get_typed_cols(go('Role')))
print(get_typed_cols(go('RoleIO'))) |
<|file_name|>test_sqlstore.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
import os
from misura.canon import option
from misura.canon.option import get_typed_cols, get_insert_cmd, base_col_def, print_tree
import sqlite3
from misura.canon.tests import testdir
db = testdir + 's... | o = option.Option(**{'handle': t, 'type': t})
o.validate()
return o |
<|file_name|>test_sqlstore.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
import os
from misura.canon import option
from misura.canon.option import get_typed_cols, get_insert_cmd, base_col_def, print_tree
import sqlite3
from misura.canon.tests import testdir
db = testdir + 's... | @classmethod
def setUpClass(cls):
if os.path.exists(db):
os.remove(db)
cls.conn = sqlite3.connect(db, detect_types=sqlite3.PARSE_DECLTYPES)
st0 = option.CsvStore(kid='/base/')
st0.merge_file(c1)
st0.validate()
cls.desc = st0.desc
def test_get_type... |
<|file_name|>test_sqlstore.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
import os
from misura.canon import option
from misura.canon.option import get_typed_cols, get_insert_cmd, base_col_def, print_tree
import sqlite3
from misura.canon.tests import testdir
db = testdir + 's... | if os.path.exists(db):
os.remove(db)
cls.conn = sqlite3.connect(db, detect_types=sqlite3.PARSE_DECLTYPES)
st0 = option.CsvStore(kid='/base/')
st0.merge_file(c1)
st0.validate()
cls.desc = st0.desc |
<|file_name|>test_sqlstore.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
import os
from misura.canon import option
from misura.canon.option import get_typed_cols, get_insert_cmd, base_col_def, print_tree
import sqlite3
from misura.canon.tests import testdir
db = testdir + 's... | print(get_typed_cols(go('Integer')))
print(get_typed_cols(go('String')))
print(get_typed_cols(go('Point')))
print(get_typed_cols(go('Role')))
print(get_typed_cols(go('RoleIO')))
print(get_typed_cols(go('Log')))
print(get_typed_cols(go('Meta'))) |
<|file_name|>test_sqlstore.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
import os
from misura.canon import option
from misura.canon.option import get_typed_cols, get_insert_cmd, base_col_def, print_tree
import sqlite3
from misura.canon.tests import testdir
db = testdir + 's... | print(get_insert_cmd(go('Integer'), base_col_def))
print(get_insert_cmd(go('String'), base_col_def))
print(get_insert_cmd(go('Point'), base_col_def))
print(get_insert_cmd(go('Role'), base_col_def))
print(get_insert_cmd(go('RoleIO'), base_col_def))
print(get_insert_cmd(go(... |
<|file_name|>test_sqlstore.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
import os
from misura.canon import option
from misura.canon.option import get_typed_cols, get_insert_cmd, base_col_def, print_tree
import sqlite3
from misura.canon.tests import testdir
db = testdir + 's... | s = option.SqlStore()
print(s.column_definition(go('Integer'))[1])
print(s.column_definition(go('String'))[1])
print(s.column_definition(go('Point'))[1])
print(s.column_definition(go('Role'))[1])
print(s.column_definition(go('RoleIO'))[1])
print(s.column_definitio... |
<|file_name|>test_sqlstore.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
import os
from misura.canon import option
from misura.canon.option import get_typed_cols, get_insert_cmd, base_col_def, print_tree
import sqlite3
from misura.canon.tests import testdir
db = testdir + 's... | s = option.SqlStore()
s.cursor = self.conn.cursor()
s.write_desc(self.desc)
print('READING')
r = s.read_tree()
print(r)
print('print(tree\n', print_tree(r))
print('WRITING AGAIN')
s.write_tree(r)
print("READING AGAIN")
r = s.read_tr... |
<|file_name|>test_sqlstore.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
import os
from misura.canon import option
from misura.canon.option import get_typed_cols, get_insert_cmd, base_col_def, print_tree
import sqlite3
from misura.canon.tests import testdir
db = testdir + 's... | st0 = option.CsvStore(kid='ciao')
st0.merge_file(c1)
st = option.SqlStore(kid='ciao')
st.desc = st0.desc
k0 = set(st.desc.keys())
cursor = self.conn.cursor()
st.write_table(cursor, 'conf1')
self.conn.commit()
cursor.execute('select handle from conf... |
<|file_name|>test_sqlstore.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
import os
from misura.canon import option
from misura.canon.option import get_typed_cols, get_insert_cmd, base_col_def, print_tree
import sqlite3
from misura.canon.tests import testdir
db = testdir + 's... | os.remove(db) |
<|file_name|>test_sqlstore.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
import os
from misura.canon import option
from misura.canon.option import get_typed_cols, get_insert_cmd, base_col_def, print_tree
import sqlite3
from misura.canon.tests import testdir
db = testdir + 's... | unittest.main() |
<|file_name|>test_sqlstore.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
import os
from misura.canon import option
from misura.canon.option import get_typed_cols, get_insert_cmd, base_col_def, print_tree
import sqlite3
from misura.canon.tests import testdir
db = testdir + 's... | go |
<|file_name|>test_sqlstore.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
import os
from misura.canon import option
from misura.canon.option import get_typed_cols, get_insert_cmd, base_col_def, print_tree
import sqlite3
from misura.canon.tests import testdir
db = testdir + 's... | setUpClass |
<|file_name|>test_sqlstore.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
import os
from misura.canon import option
from misura.canon.option import get_typed_cols, get_insert_cmd, base_col_def, print_tree
import sqlite3
from misura.canon.tests import testdir
db = testdir + 's... | test_get_typed_cols |
<|file_name|>test_sqlstore.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
import os
from misura.canon import option
from misura.canon.option import get_typed_cols, get_insert_cmd, base_col_def, print_tree
import sqlite3
from misura.canon.tests import testdir
db = testdir + 's... | test_get_insert_cmd |
<|file_name|>test_sqlstore.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
import os
from misura.canon import option
from misura.canon.option import get_typed_cols, get_insert_cmd, base_col_def, print_tree
import sqlite3
from misura.canon.tests import testdir
db = testdir + 's... | test_column_definition |
<|file_name|>test_sqlstore.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
import os
from misura.canon import option
from misura.canon.option import get_typed_cols, get_insert_cmd, base_col_def, print_tree
import sqlite3
from misura.canon.tests import testdir
db = testdir + 's... | test_write_desc |
<|file_name|>test_sqlstore.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
import os
from misura.canon import option
from misura.canon.option import get_typed_cols, get_insert_cmd, base_col_def, print_tree
import sqlite3
from misura.canon.tests import testdir
db = testdir + 's... | test_tables |
<|file_name|>test_containers_smartstate_analysis.py<|end_file_name|><|fim▁begin|>import random
from collections import namedtuple
import dateparser
import pytest
from cfme import test_requirements
from cfme.containers.image import Image
from cfme.containers.provider import ContainersProvider
from cfme.containers.prov... |
task = provider.appliance.collections.tasks.instantiate(
name=f"Container Image Analysis: '{random_image_instance.name}'", tab='AllTasks')
|
<|file_name|>test_containers_smartstate_analysis.py<|end_file_name|><|fim▁begin|>import random
from collections import namedtuple
import dateparser
import pytest
from cfme import test_requirements
from cfme.containers.image import Image
from cfme.containers.provider import ContainersProvider
from cfme.containers.prov... | col = appliance.collections.tasks.filter({'tab': 'AllTasks'})
col.delete_all() |
<|file_name|>test_containers_smartstate_analysis.py<|end_file_name|><|fim▁begin|>import random
from collections import namedtuple
import dateparser
import pytest
from cfme import test_requirements
from cfme.containers.image import Image
from cfme.containers.provider import ContainersProvider
from cfme.containers.prov... | collection = appliance.collections.container_images
# add filter for select only active(not archived) images from redHat registry
filter_image_collection = collection.filter({'active': True, 'redhat_registry': True})
return random.sample(filter_image_collection.all(), NUM_SELECTED_IMAGES).pop() |
<|file_name|>test_containers_smartstate_analysis.py<|end_file_name|><|fim▁begin|>import random
from collections import namedtuple
import dateparser
import pytest
from cfme import test_requirements
from cfme.containers.image import Image
from cfme.containers.provider import ContainersProvider
from cfme.containers.prov... | """
Polarion:
assignee: juwatts
caseimportance: high
casecomponent: Containers
initialEstimate: 1/6h
"""
random_image_instance.assign_policy_profiles('OpenSCAP profile') |
<|file_name|>test_containers_smartstate_analysis.py<|end_file_name|><|fim▁begin|>import random
from collections import namedtuple
import dateparser
import pytest
from cfme import test_requirements
from cfme.containers.image import Image
from cfme.containers.provider import ContainersProvider
from cfme.containers.prov... | """
Polarion:
assignee: juwatts
caseimportance: high
casecomponent: Containers
initialEstimate: 1/6h
"""
random_image_instance.assign_policy_profiles('OpenSCAP profile')
random_image_instance.check_compliance() |
<|file_name|>test_containers_smartstate_analysis.py<|end_file_name|><|fim▁begin|>import random
from collections import namedtuple
import dateparser
import pytest
from cfme import test_requirements
from cfme.containers.image import Image
from cfme.containers.provider import ContainersProvider
from cfme.containers.prov... | view = navigate_to(instance, 'Details', force=True)
table = getattr(view.entities, table_name, None)
if table:
return table.read().get(attr) |
<|file_name|>test_containers_smartstate_analysis.py<|end_file_name|><|fim▁begin|>import random
from collections import namedtuple
import dateparser
import pytest
from cfme import test_requirements
from cfme.containers.image import Image
from cfme.containers.provider import ContainersProvider
from cfme.containers.prov... | """
Polarion:
assignee: juwatts
caseimportance: high
casecomponent: Containers
initialEstimate: 1/6h
"""
if test_item.is_openscap:
random_image_instance.assign_policy_profiles('OpenSCAP profile')
else:
random_image_instance.unassign_policy_profiles('Op... |
<|file_name|>test_containers_smartstate_analysis.py<|end_file_name|><|fim▁begin|>import random
from collections import namedtuple
import dateparser
import pytest
from cfme import test_requirements
from cfme.containers.image import Image
from cfme.containers.provider import ContainersProvider
from cfme.containers.prov... | """
Test initiating a SmartState Analysis scan via the CFME API through the ManageIQ API Client
entity class.
RFE: BZ 1486362
Polarion:
assignee: juwatts
caseimportance: high
casecomponent: Containers
initialEstimate: 1/6h
"""
if test_item.is_opens... |
<|file_name|>test_containers_smartstate_analysis.py<|end_file_name|><|fim▁begin|>import random
from collections import namedtuple
import dateparser
import pytest
from cfme import test_requirements
from cfme.containers.image import Image
from cfme.containers.provider import ContainersProvider
from cfme.containers.prov... | return table.read().get(attr) |
<|file_name|>test_containers_smartstate_analysis.py<|end_file_name|><|fim▁begin|>import random
from collections import namedtuple
import dateparser
import pytest
from cfme import test_requirements
from cfme.containers.image import Image
from cfme.containers.provider import ContainersProvider
from cfme.containers.prov... | random_image_instance.assign_policy_profiles('OpenSCAP profile') |
<|file_name|>test_containers_smartstate_analysis.py<|end_file_name|><|fim▁begin|>import random
from collections import namedtuple
import dateparser
import pytest
from cfme import test_requirements
from cfme.containers.image import Image
from cfme.containers.provider import ContainersProvider
from cfme.containers.prov... | random_image_instance.unassign_policy_profiles('OpenSCAP profile') |
<|file_name|>test_containers_smartstate_analysis.py<|end_file_name|><|fim▁begin|>import random
from collections import namedtuple
import dateparser
import pytest
from cfme import test_requirements
from cfme.containers.image import Image
from cfme.containers.provider import ContainersProvider
from cfme.containers.prov... | continue |
<|file_name|>test_containers_smartstate_analysis.py<|end_file_name|><|fim▁begin|>import random
from collections import namedtuple
import dateparser
import pytest
from cfme import test_requirements
from cfme.containers.image import Image
from cfme.containers.provider import ContainersProvider
from cfme.containers.prov... | soft_assert(False, 'Could not get attribute "{}" for "{}" table.'
.format(attr, tbl))
continue |
<|file_name|>test_containers_smartstate_analysis.py<|end_file_name|><|fim▁begin|>import random
from collections import namedtuple
import dateparser
import pytest
from cfme import test_requirements
from cfme.containers.image import Image
from cfme.containers.provider import ContainersProvider
from cfme.containers.prov... | random_image_instance.assign_policy_profiles('OpenSCAP profile') |
<|file_name|>test_containers_smartstate_analysis.py<|end_file_name|><|fim▁begin|>import random
from collections import namedtuple
import dateparser
import pytest
from cfme import test_requirements
from cfme.containers.image import Image
from cfme.containers.provider import ContainersProvider
from cfme.containers.prov... | random_image_instance.unassign_policy_profiles('OpenSCAP profile') |
<|file_name|>test_containers_smartstate_analysis.py<|end_file_name|><|fim▁begin|>import random
from collections import namedtuple
import dateparser
import pytest
from cfme import test_requirements
from cfme.containers.image import Image
from cfme.containers.provider import ContainersProvider
from cfme.containers.prov... | delete_all_container_tasks |
<|file_name|>test_containers_smartstate_analysis.py<|end_file_name|><|fim▁begin|>import random
from collections import namedtuple
import dateparser
import pytest
from cfme import test_requirements
from cfme.containers.image import Image
from cfme.containers.provider import ContainersProvider
from cfme.containers.prov... | random_image_instance |
<|file_name|>test_containers_smartstate_analysis.py<|end_file_name|><|fim▁begin|>import random
from collections import namedtuple
import dateparser
import pytest
from cfme import test_requirements
from cfme.containers.image import Image
from cfme.containers.provider import ContainersProvider
from cfme.containers.prov... | test_manage_policies_navigation |
<|file_name|>test_containers_smartstate_analysis.py<|end_file_name|><|fim▁begin|>import random
from collections import namedtuple
import dateparser
import pytest
from cfme import test_requirements
from cfme.containers.image import Image
from cfme.containers.provider import ContainersProvider
from cfme.containers.prov... | test_check_compliance |
<|file_name|>test_containers_smartstate_analysis.py<|end_file_name|><|fim▁begin|>import random
from collections import namedtuple
import dateparser
import pytest
from cfme import test_requirements
from cfme.containers.image import Image
from cfme.containers.provider import ContainersProvider
from cfme.containers.prov... | get_table_attr |
<|file_name|>test_containers_smartstate_analysis.py<|end_file_name|><|fim▁begin|>import random
from collections import namedtuple
import dateparser
import pytest
from cfme import test_requirements
from cfme.containers.image import Image
from cfme.containers.provider import ContainersProvider
from cfme.containers.prov... | test_containers_smartstate_analysis |
<|file_name|>test_containers_smartstate_analysis.py<|end_file_name|><|fim▁begin|>import random
from collections import namedtuple
import dateparser
import pytest
from cfme import test_requirements
from cfme.containers.image import Image
from cfme.containers.provider import ContainersProvider
from cfme.containers.prov... | test_containers_smartstate_analysis_api |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls.defaults import *
"""
Also used in cms.tests.ApphooksTestCase
"""
urlpatterns = patterns('cms.test_utils.project.sampleapp.views',
url(r'^$', 'sample_view', {'message': 'sample root page',}, name='sample-root'),
url(r'^settings/$', 'sampl... | url(r'^extra_1/$', 'extra_view', {'message': 'test urlconf'}, name='extra_first'),
url(r'^', include('cms.test_utils.project.sampleapp.urls_extra')),
) |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.md')) as f:
README = f.read()
with open(os.path.join(here, 'CHANGES.md')) as f:
CHANGES = f.read()
requires = [
'... | description='guestbook',
long_description=README + '\n\n' + CHANGES,
classifiers=[ |
<|file_name|>factory.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
destination.factory
'''
from destination.zeus import ZeusDestination
from destination.aws import AwsDestination
from exceptions import AutocertError
from config import CFG
from app import app<|fim▁hole|>class Destin... | |
<|file_name|>factory.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
destination.factory
'''
from destination.zeus import ZeusDestination
from destination.aws import AwsDestination
from exceptions import AutocertError
from config import CFG
from app import app
class DestinationFacto... | def __init__(self, destination):
msg = f'destination factory error with {destination}'
super(DestinationFactoryError, self).__init__(msg) |
<|file_name|>factory.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
destination.factory
'''
from destination.zeus import ZeusDestination
from destination.aws import AwsDestination
from exceptions import AutocertError
from config import CFG
from app import app
class DestinationFacto... | msg = f'destination factory error with {destination}'
super(DestinationFactoryError, self).__init__(msg) |
<|file_name|>factory.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
destination.factory
'''
from destination.zeus import ZeusDestination
from destination.aws import AwsDestination
from exceptions import AutocertError
from config import CFG
from app import app
class DestinationFacto... | d = None
if destination == 'aws':
d = AwsDestination(ar, cfg, verbosity)
elif destination == 'zeus':
d = ZeusDestination(ar, cfg, verbosity)
else:
raise DestinationFactoryError(destination)
dests = list(CFG.destinations.zeus.keys())
if d.has_connectivity(timeout, dests):
... |
<|file_name|>factory.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
destination.factory
'''
from destination.zeus import ZeusDestination
from destination.aws import AwsDestination
from exceptions import AutocertError
from config import CFG
from app import app
class DestinationFacto... | d = AwsDestination(ar, cfg, verbosity) |
<|file_name|>factory.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
destination.factory
'''
from destination.zeus import ZeusDestination
from destination.aws import AwsDestination
from exceptions import AutocertError
from config import CFG
from app import app
class DestinationFacto... | d = ZeusDestination(ar, cfg, verbosity) |
<|file_name|>factory.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
destination.factory
'''
from destination.zeus import ZeusDestination
from destination.aws import AwsDestination
from exceptions import AutocertError
from config import CFG
from app import app
class DestinationFacto... | raise DestinationFactoryError(destination) |
<|file_name|>factory.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
destination.factory
'''
from destination.zeus import ZeusDestination
from destination.aws import AwsDestination
from exceptions import AutocertError
from config import CFG
from app import app
class DestinationFacto... | return d |
<|file_name|>factory.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
destination.factory
'''
from destination.zeus import ZeusDestination
from destination.aws import AwsDestination
from exceptions import AutocertError
from config import CFG
from app import app
class DestinationFacto... | __init__ |
<|file_name|>factory.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
destination.factory
'''
from destination.zeus import ZeusDestination
from destination.aws import AwsDestination
from exceptions import AutocertError
from config import CFG
from app import app
class DestinationFacto... | create_destination |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.shortcuts import render
def about(request):<|fim▁hole|> return render(request, "about.html", {})
def location(request):
return render(request, "location.html", {})
def failure(request):
return render(request, "failure.html", {})<|fim▁end|> | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.shortcuts import render
def about(request):
<|fim_middle|>
def location(request):
return render(request, "location.html", {})
def failure(request):
return render(request, "failure.html", {})
<|fim▁end|> | return render(request, "about.html", {}) |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.shortcuts import render
def about(request):
return render(request, "about.html", {})
def location(request):
<|fim_middle|>
def failure(request):
return render(request, "failure.html", {})
<|fim▁end|> | return render(request, "location.html", {}) |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.shortcuts import render
def about(request):
return render(request, "about.html", {})
def location(request):
return render(request, "location.html", {})
def failure(request):
<|fim_middle|>
<|fim▁end|> | return render(request, "failure.html", {}) |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.shortcuts import render
def <|fim_middle|>(request):
return render(request, "about.html", {})
def location(request):
return render(request, "location.html", {})
def failure(request):
return render(request, "failure.html", {})
<|fim▁end|> | about |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.shortcuts import render
def about(request):
return render(request, "about.html", {})
def <|fim_middle|>(request):
return render(request, "location.html", {})
def failure(request):
return render(request, "failure.html", {})
<|fim▁end|> | location |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.shortcuts import render
def about(request):
return render(request, "about.html", {})
def location(request):
return render(request, "location.html", {})
def <|fim_middle|>(request):
return render(request, "failure.html", {})
<|fim▁end|> | failure |
<|file_name|>download.py<|end_file_name|><|fim▁begin|>"""
Downloads the following:
- Korean Wikipedia texts
- Korean
"""
from sqlparse import parsestream
from sqlparse.sql import Parenthesis
for statement in parsestream(open('data/test.sql')):
texts = [str(token.tokens[1].tokens[-1]).decode('string_escape') for... | print texts
texts = [text for text in texts if text[0] != '#']
if texts:
print "\n===\n".join(texts) |
<|file_name|>download.py<|end_file_name|><|fim▁begin|>"""
Downloads the following:
- Korean Wikipedia texts
- Korean
"""
from sqlparse import parsestream
from sqlparse.sql import Parenthesis
for statement in parsestream(open('data/test.sql')):
texts = [str(token.tokens[1].tokens[-1]).decode('string_escape') for... | print "\n===\n".join(texts) |
<|file_name|>static_images.py<|end_file_name|><|fim▁begin|>import json
import requests
import key
API_key = key.getAPIkey()
#load all champion pictures
def load_champion_pictures(champion_json):
print len(champion_json['data'])
version = champion_json['version']
print "version: " + version
for champion in champi... | r = requests.get('http://ddragon.leagueoflegends.com/cdn/' + version + '/img/champion/' + champion + '.png') |
<|file_name|>static_images.py<|end_file_name|><|fim▁begin|>import json
import requests
import key
API_key = key.getAPIkey()
#load all champion pictures
def load_champion_pictures(champion_json):
<|fim_middle|>
#load champion json
#converts to python dict using json() and json.dump() for error checking
def load_ch... | print len(champion_json['data'])
version = champion_json['version']
print "version: " + version
for champion in champion_json['data']:
print champion
r = requests.get('http://ddragon.leagueoflegends.com/cdn/' + version + '/img/champion/' + champion + '.png')
if r.status_code == 200:
img = r.content
with... |
<|file_name|>static_images.py<|end_file_name|><|fim▁begin|>import json
import requests
import key
API_key = key.getAPIkey()
#load all champion pictures
def load_champion_pictures(champion_json):
print len(champion_json['data'])
version = champion_json['version']
print "version: " + version
for champion in champi... | try:
r = requests.get('https://global.api.pvp.net/api/lol/static-data/na/v1.2/champion?&api_key=' + API_key)
champion_json = r.json()
if 'status' in champion_json:
print champion_json['status']['message']
return
load_champion_pictures(champion_json)
# quick fix to change MonkeyKing to Wukong so that so... |
<|file_name|>static_images.py<|end_file_name|><|fim▁begin|>import json
import requests
import key
API_key = key.getAPIkey()
#load all champion pictures
def load_champion_pictures(champion_json):
print len(champion_json['data'])
version = champion_json['version']
print "version: " + version
for champion in champi... | img = r.content
with open('static/images/champions/' + champion_json['data'][champion]['name'] + '.png', 'w') as f:
f.write(img)
print "img created" |
<|file_name|>static_images.py<|end_file_name|><|fim▁begin|>import json
import requests
import key
API_key = key.getAPIkey()
#load all champion pictures
def load_champion_pictures(champion_json):
print len(champion_json['data'])
version = champion_json['version']
print "version: " + version
for champion in champi... | print "pictures: something went wrong" |
<|file_name|>static_images.py<|end_file_name|><|fim▁begin|>import json
import requests
import key
API_key = key.getAPIkey()
#load all champion pictures
def load_champion_pictures(champion_json):
print len(champion_json['data'])
version = champion_json['version']
print "version: " + version
for champion in champi... | print champion_json['status']['message']
return |
<|file_name|>static_images.py<|end_file_name|><|fim▁begin|>import json
import requests
import key
API_key = key.getAPIkey()
#load all champion pictures
def <|fim_middle|>(champion_json):
print len(champion_json['data'])
version = champion_json['version']
print "version: " + version
for champion in champion_json[... | load_champion_pictures |
<|file_name|>static_images.py<|end_file_name|><|fim▁begin|>import json
import requests
import key
API_key = key.getAPIkey()
#load all champion pictures
def load_champion_pictures(champion_json):
print len(champion_json['data'])
version = champion_json['version']
print "version: " + version
for champion in champi... | load_champion_json |
<|file_name|>v_univar.py<|end_file_name|><|fim▁begin|><|fim▁hole|>***************************************************************************
v_univar.py
---------------------
Date : December 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail... | # -*- coding: utf-8 -*-
""" |
<|file_name|>v_univar.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
***************************************************************************
v_univar.py
---------------------
Date : December 2012
Copyright : (C) 2012 by Victor Olaya
Email :... | htmlFile = alg.getOutputFromName('html').value
found = False
f = open(htmlFile, "w")
f.write("<h2>v.univar</h2>\n")
for line in alg.consoleOutput:
if found and not line.strip().endswith('exit'):
f.write(line + "<br>\n")
if 'v.univar' in line:
... |
<|file_name|>v_univar.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
***************************************************************************
v_univar.py
---------------------
Date : December 2012
Copyright : (C) 2012 by Victor Olaya
Email :... | f.write(line + "<br>\n") |
<|file_name|>v_univar.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
***************************************************************************
v_univar.py
---------------------
Date : December 2012
Copyright : (C) 2012 by Victor Olaya
Email :... | found = True |
<|file_name|>v_univar.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
***************************************************************************
v_univar.py
---------------------
Date : December 2012
Copyright : (C) 2012 by Victor Olaya
Email :... | postProcessResults |
<|file_name|>ipc_perftest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
# @begin:license
#
# Copyright (c) 2015-2019, Benjamin Niemann <pink@odahoda.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Softwa... | |
<|file_name|>ipc_perftest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
# @begin:license
#
# Copyright (c) 2015-2019, Benjamin Niemann <pink@odahoda.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Softwa... | async def test_small_messages(self):
request = ipc_test_pb2.TestRequest()
request.t.add(numerator=random.randint(0, 4), denominator=random.randint(1, 2))
await self.run_test(request, 5000)
async def test_large_messages(self):
request = ipc_test_pb2.TestRequest()
for _ in... |
<|file_name|>ipc_perftest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
# @begin:license
#
# Copyright (c) 2015-2019, Benjamin Niemann <pink@odahoda.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Softwa... | request = ipc_test_pb2.TestRequest()
request.t.add(numerator=random.randint(0, 4), denominator=random.randint(1, 2))
await self.run_test(request, 5000) |
<|file_name|>ipc_perftest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
# @begin:license
#
# Copyright (c) 2015-2019, Benjamin Niemann <pink@odahoda.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Softwa... | request = ipc_test_pb2.TestRequest()
for _ in range(10000):
request.t.add(numerator=random.randint(0, 4), denominator=random.randint(1, 2))
await self.run_test(request, 100) |
<|file_name|>ipc_perftest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
# @begin:license
#
# Copyright (c) 2015-2019, Benjamin Niemann <pink@odahoda.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Softwa... | test_small_messages |
<|file_name|>ipc_perftest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
# @begin:license
#
# Copyright (c) 2015-2019, Benjamin Niemann <pink@odahoda.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Softwa... | test_large_messages |
<|file_name|>addons.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, print_function, division
from mitmproxy import exceptions
import pprint
def _get_name(itm):
return getattr(itm, "name", itm.__class__.__name__)
class Addons(object):
def __init__(self, master):
sel... | func(*args, **kwargs)
|
<|file_name|>addons.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, print_function, division
from mitmproxy import exceptions
import pprint
def _get_name(itm):
<|fim_middle|>
class Addons(object):
def __init__(self, master):
self.chain = []
self.master = ... | return getattr(itm, "name", itm.__class__.__name__) |
<|file_name|>addons.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, print_function, division
from mitmproxy import exceptions
import pprint
def _get_name(itm):
return getattr(itm, "name", itm.__class__.__name__)
class Addons(object):
<|fim_middle|>
<|fim▁end|> | def __init__(self, master):
self.chain = []
self.master = master
master.options.changed.connect(self.options_update)
def options_update(self, options, updated):
for i in self.chain:
with self.master.handlecontext():
i.configure(options, update... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.