prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>constants.py<|end_file_name|><|fim▁begin|>"""Let's Encrypt constants.""" import logging from acme import challenges SETUPTOOLS_PLUGINS_ENTRY_POINT = "letsencrypt.plugins" """Setuptools entry point group name for plugins.""" CLI_DEFAULTS = dict( config_files=["/etc/letsencrypt/cli.ini"], verbos...
<|file_name|>model_control_one_enabled_Difference_LinearTrend_Seasonal_Hour_NoAR.py<|end_file_name|><|fim▁begin|>import tests.model_control.test_ozone_custom_models_enabled as testmod<|fim▁hole|>testmod.build_model( ['Difference'] , ['LinearTrend'] , ['Seasonal_Hour'] , ['NoAR'] );<|fim▁end|>
<|file_name|>test_points.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 Software Foundation, eit...
class TestStringCoordPlot(TestGraphicStringCoord): def test_yaxis_labels(self): qplt.points(self.cube, coords=('bar', 'str_coord'))
<|file_name|>test_points.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 Software Foundation, eit...
def test_yaxis_labels(self): qplt.points(self.cube, coords=('bar', 'str_coord')) self.assertBoundsTickLabels('yaxis') def test_xaxis_labels(self): qplt.points(self.cube, coords=('str_coord', 'bar')) self.assertBoundsTickLabels('xaxis')
<|file_name|>test_points.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 Software Foundation, eit...
qplt.points(self.cube, coords=('bar', 'str_coord')) self.assertBoundsTickLabels('yaxis')
<|file_name|>test_points.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 Software Foundation, eit...
qplt.points(self.cube, coords=('str_coord', 'bar')) self.assertBoundsTickLabels('xaxis')
<|file_name|>test_points.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 Software Foundation, eit...
import iris.quickplot as qplt
<|file_name|>test_points.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 Software Foundation, eit...
tests.main()
<|file_name|>test_points.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 Software Foundation, eit...
test_yaxis_labels
<|file_name|>test_points.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 Software Foundation, eit...
test_xaxis_labels
<|file_name|>physical_function.py<|end_file_name|><|fim▁begin|># Copyright 2018 Huawei Technologies Co.,LTD. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # ...
<|file_name|>physical_function.py<|end_file_name|><|fim▁begin|># Copyright 2018 Huawei Technologies Co.,LTD. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # ...
VERSION = '1.0' virtual_function_list = [] def create(self, context): # To ensure the creating type is PF if self.type != 'pf': raise exception.InvalidDeployType() super(PhysicalFunction, self).create(context) def save(self, context): """In addition to save ...
<|file_name|>physical_function.py<|end_file_name|><|fim▁begin|># Copyright 2018 Huawei Technologies Co.,LTD. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # ...
if self.type != 'pf': raise exception.InvalidDeployType() super(PhysicalFunction, self).create(context)
<|file_name|>physical_function.py<|end_file_name|><|fim▁begin|># Copyright 2018 Huawei Technologies Co.,LTD. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # ...
"""In addition to save the pf, it should also save the vfs associated with this pf """ # To ensure the saving type is PF if self.type != 'pf': raise exception.InvalidDeployType() for exist_vf in self.virtual_function_list: exist_vf.save(context) ...
<|file_name|>physical_function.py<|end_file_name|><|fim▁begin|># Copyright 2018 Huawei Technologies Co.,LTD. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # ...
"""add a vf object to the virtual_function_list. If the vf already exists, it will ignore, otherwise, the vf will be appended to the list """ if not isinstance(vf, VirtualFunction) or vf.type != 'vf': raise exception.InvalidDeployType() for exist_vf in self.vi...
<|file_name|>physical_function.py<|end_file_name|><|fim▁begin|># Copyright 2018 Huawei Technologies Co.,LTD. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # ...
"""remove a vf from the virtual_function_list if the vf does not exist, ignore it """ for idx, exist_vf in self.virtual_function_list: if base.obj_equal_prims(vf, exist_vf): removed_vf = self.virtual_function_list.pop(idx) removed_vf.destroy(co...
<|file_name|>physical_function.py<|end_file_name|><|fim▁begin|># Copyright 2018 Huawei Technologies Co.,LTD. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # ...
"""Delete a the pf from the DB.""" del self.virtual_function_list[:] super(PhysicalFunction, self).destroy(context)
<|file_name|>physical_function.py<|end_file_name|><|fim▁begin|># Copyright 2018 Huawei Technologies Co.,LTD. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # ...
"""Find a DB Physical Function and return an Obj Physical Function. In addition, it will also finds all the Virtual Functions associated with this Physical Function and place them in virtual_function_list """ db_pf = cls.dbapi.deployable_get(context, uuid) obj_pf = cls._f...
<|file_name|>physical_function.py<|end_file_name|><|fim▁begin|># Copyright 2018 Huawei Technologies Co.,LTD. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # ...
obj_dpl_list = [] filters['type'] = 'pf' db_dpl_list = cls.dbapi.deployable_get_by_filters(context, filters, sort_key=sort_key, sort_dir=sort_dir, ...
<|file_name|>physical_function.py<|end_file_name|><|fim▁begin|># Copyright 2018 Huawei Technologies Co.,LTD. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # ...
"""Converts a physical function to a formal object. :param obj: An object of the class. :param db_obj: A DB model of the object :return: The object of the class with the database entity added """ obj = Deployable._from_db_object(obj, db_obj) if cls is PhysicalFun...
<|file_name|>physical_function.py<|end_file_name|><|fim▁begin|># Copyright 2018 Huawei Technologies Co.,LTD. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # ...
raise exception.InvalidDeployType()
<|file_name|>physical_function.py<|end_file_name|><|fim▁begin|># Copyright 2018 Huawei Technologies Co.,LTD. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # ...
raise exception.InvalidDeployType()
<|file_name|>physical_function.py<|end_file_name|><|fim▁begin|># Copyright 2018 Huawei Technologies Co.,LTD. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # ...
raise exception.InvalidDeployType()
<|file_name|>physical_function.py<|end_file_name|><|fim▁begin|># Copyright 2018 Huawei Technologies Co.,LTD. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # ...
LOG.warning("The vf already exists") return None
<|file_name|>physical_function.py<|end_file_name|><|fim▁begin|># Copyright 2018 Huawei Technologies Co.,LTD. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # ...
removed_vf = self.virtual_function_list.pop(idx) removed_vf.destroy(context) return
<|file_name|>physical_function.py<|end_file_name|><|fim▁begin|># Copyright 2018 Huawei Technologies Co.,LTD. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # ...
obj.virtual_function_list = []
<|file_name|>physical_function.py<|end_file_name|><|fim▁begin|># Copyright 2018 Huawei Technologies Co.,LTD. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # ...
create
<|file_name|>physical_function.py<|end_file_name|><|fim▁begin|># Copyright 2018 Huawei Technologies Co.,LTD. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # ...
save
<|file_name|>physical_function.py<|end_file_name|><|fim▁begin|># Copyright 2018 Huawei Technologies Co.,LTD. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # ...
add_vf
<|file_name|>physical_function.py<|end_file_name|><|fim▁begin|># Copyright 2018 Huawei Technologies Co.,LTD. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # ...
delete_vf
<|file_name|>physical_function.py<|end_file_name|><|fim▁begin|># Copyright 2018 Huawei Technologies Co.,LTD. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # ...
destroy
<|file_name|>physical_function.py<|end_file_name|><|fim▁begin|># Copyright 2018 Huawei Technologies Co.,LTD. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # ...
get
<|file_name|>physical_function.py<|end_file_name|><|fim▁begin|># Copyright 2018 Huawei Technologies Co.,LTD. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # ...
get_by_filter
<|file_name|>physical_function.py<|end_file_name|><|fim▁begin|># Copyright 2018 Huawei Technologies Co.,LTD. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # ...
_from_db_object
<|file_name|>scd.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
# extension imports from _NetworKit import PageRankNibble, GCE
<|file_name|>validate.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import absolute_import from math import isinf, isnan from warnings import warn NOT_MASS_BALANCED_TERMS = {"SBO:0000627", # EXCHANGE "SBO:0000628", # DEMAND "SBO:000062...
<|file_name|>validate.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import absolute_import from math import isinf, isnan from warnings import warn NOT_MASS_BALANCED_TERMS = {"SBO:0000627", # EXCHANGE "SBO:0000628", # DEMAND "SBO:000062...
unbalanced = {} for reaction in model.reactions: if reaction.annotation.get("SBO") not in NOT_MASS_BALANCED_TERMS: balance = reaction.check_mass_balance() if balance: unbalanced[reaction] = balance return unbalanced
<|file_name|>validate.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import absolute_import from math import isinf, isnan from warnings import warn NOT_MASS_BALANCED_TERMS = {"SBO:0000627", # EXCHANGE "SBO:0000628", # DEMAND "SBO:000062...
warn("no longer necessary, done by optlang solver interfaces", DeprecationWarning) errors = [] for reaction in model.reactions: if reaction.lower_bound > reaction.upper_bound: errors.append("Reaction '%s' has lower bound > upper bound" % reaction.id) ...
<|file_name|>validate.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import absolute_import from math import isinf, isnan from warnings import warn NOT_MASS_BALANCED_TERMS = {"SBO:0000627", # EXCHANGE "SBO:0000628", # DEMAND "SBO:000062...
errors = [] for met in model.metabolites: if met.formula is not None and len(met.formula) > 0: if not met.formula.isalnum(): errors.append("Metabolite '%s' formula '%s' not alphanumeric" % (met.id, met.formula)) return errors
<|file_name|>validate.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import absolute_import from math import isinf, isnan from warnings import warn NOT_MASS_BALANCED_TERMS = {"SBO:0000627", # EXCHANGE "SBO:0000628", # DEMAND "SBO:000062...
balance = reaction.check_mass_balance() if balance: unbalanced[reaction] = balance
<|file_name|>validate.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import absolute_import from math import isinf, isnan from warnings import warn NOT_MASS_BALANCED_TERMS = {"SBO:0000627", # EXCHANGE "SBO:0000628", # DEMAND "SBO:000062...
unbalanced[reaction] = balance
<|file_name|>validate.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import absolute_import from math import isinf, isnan from warnings import warn NOT_MASS_BALANCED_TERMS = {"SBO:0000627", # EXCHANGE "SBO:0000628", # DEMAND "SBO:000062...
errors.append("Reaction '%s' has lower bound > upper bound" % reaction.id)
<|file_name|>validate.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import absolute_import from math import isinf, isnan from warnings import warn NOT_MASS_BALANCED_TERMS = {"SBO:0000627", # EXCHANGE "SBO:0000628", # DEMAND "SBO:000062...
errors.append("Reaction '%s' has infinite lower_bound" % reaction.id)
<|file_name|>validate.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import absolute_import from math import isinf, isnan from warnings import warn NOT_MASS_BALANCED_TERMS = {"SBO:0000627", # EXCHANGE "SBO:0000628", # DEMAND "SBO:000062...
errors.append("Reaction '%s' has NaN for lower_bound" % reaction.id)
<|file_name|>validate.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import absolute_import from math import isinf, isnan from warnings import warn NOT_MASS_BALANCED_TERMS = {"SBO:0000627", # EXCHANGE "SBO:0000628", # DEMAND "SBO:000062...
errors.append("Reaction '%s' has infinite upper_bound" % reaction.id)
<|file_name|>validate.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import absolute_import from math import isinf, isnan from warnings import warn NOT_MASS_BALANCED_TERMS = {"SBO:0000627", # EXCHANGE "SBO:0000628", # DEMAND "SBO:000062...
errors.append("Reaction '%s' has NaN for upper_bound" % reaction.id)
<|file_name|>validate.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import absolute_import from math import isinf, isnan from warnings import warn NOT_MASS_BALANCED_TERMS = {"SBO:0000627", # EXCHANGE "SBO:0000628", # DEMAND "SBO:000062...
if not met.formula.isalnum(): errors.append("Metabolite '%s' formula '%s' not alphanumeric" % (met.id, met.formula))
<|file_name|>validate.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import absolute_import from math import isinf, isnan from warnings import warn NOT_MASS_BALANCED_TERMS = {"SBO:0000627", # EXCHANGE "SBO:0000628", # DEMAND "SBO:000062...
errors.append("Metabolite '%s' formula '%s' not alphanumeric" % (met.id, met.formula))
<|file_name|>validate.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import absolute_import from math import isinf, isnan from warnings import warn NOT_MASS_BALANCED_TERMS = {"SBO:0000627", # EXCHANGE "SBO:0000628", # DEMAND "SBO:000062...
check_mass_balance
<|file_name|>validate.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import absolute_import from math import isinf, isnan from warnings import warn NOT_MASS_BALANCED_TERMS = {"SBO:0000627", # EXCHANGE "SBO:0000628", # DEMAND "SBO:000062...
check_reaction_bounds
<|file_name|>validate.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import absolute_import from math import isinf, isnan from warnings import warn NOT_MASS_BALANCED_TERMS = {"SBO:0000627", # EXCHANGE "SBO:0000628", # DEMAND "SBO:000062...
check_metabolite_compartment_formula
<|file_name|>fabfile.py<|end_file_name|><|fim▁begin|>from fabric.api import local def html():<|fim▁hole|> local('hovercraft -t ./sixfeetup_hovercraft formation_flask.rst ./build/')<|fim▁end|>
<|file_name|>fabfile.py<|end_file_name|><|fim▁begin|>from fabric.api import local def html(): <|fim_middle|> <|fim▁end|>
local('hovercraft -t ./sixfeetup_hovercraft formation_flask.rst ./build/')
<|file_name|>fabfile.py<|end_file_name|><|fim▁begin|>from fabric.api import local def <|fim_middle|>(): local('hovercraft -t ./sixfeetup_hovercraft formation_flask.rst ./build/') <|fim▁end|>
html
<|file_name|>0020_auto__add_field_question_order.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Question.order' ...
u'survey.response': { 'Meta': {'object_name': 'Response'}, 'answer': ('django.db.models.fields.TextField', [], {}),
<|file_name|>0020_auto__add_field_question_order.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): <|fim_middle|> <|fim▁end|>
def forwards(self, orm): # Adding field 'Question.order' db.add_column(u'survey_question', 'order', self.gf('django.db.models.fields.IntegerField')(default=0), keep_default=False) def backwards(self, orm): # Deleting field 'Question.order' ...
<|file_name|>0020_auto__add_field_question_order.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Question.order' ...
db.add_column(u'survey_question', 'order', self.gf('django.db.models.fields.IntegerField')(default=0), keep_default=False)
<|file_name|>0020_auto__add_field_question_order.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Question.order' ...
db.delete_column(u'survey_question', 'order')
<|file_name|>0020_auto__add_field_question_order.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def <|fim_middle|>(self, orm): # Adding field 'Question.orde...
forwards
<|file_name|>0020_auto__add_field_question_order.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Question.order' ...
backwards
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url from django.contrib import admin from api import views admin.autodiscover() from rest_framework.routers import DefaultRouter router = DefaultRouter() router.register(r'headings', views.HeadingViewSet) router.register...
)
<|file_name|>package.py<|end_file_name|><|fim▁begin|># Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyIlmbase(AutotoolsPackage): """The P...
return args
<|file_name|>package.py<|end_file_name|><|fim▁begin|># Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyIlmbase(AutotoolsPackage): <|fim_mi...
"""The PyIlmBase libraries provides python bindings for the IlmBase libraries.""" homepage = "https://github.com/AcademySoftwareFoundation/openexr/tree/v2.3.0/PyIlmBase" url = "https://github.com/AcademySoftwareFoundation/openexr/releases/download/v2.3.0/pyilmbase-2.3.0.tar.gz" version('2.3.0', s...
<|file_name|>package.py<|end_file_name|><|fim▁begin|># Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyIlmbase(AutotoolsPackage): """The P...
spec = self.spec args = [ '--with-boost-python-libname=boost_python{0}'.format( spec['python'].version.up_to(2).joined) ] return args
<|file_name|>package.py<|end_file_name|><|fim▁begin|># Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyIlmbase(AutotoolsPackage): """The P...
configure_args
<|file_name|>network_info.py<|end_file_name|><|fim▁begin|>from JumpScale import j descr = """ This jumpscript returns network info """ category = "monitoring" organization = "jumpscale" author = "kristof@incubaid.com" license = "bsd" version = "1.0"<|fim▁hole|>def action(): return j.sal.nettools.getNetworkInfo() ...
roles = []
<|file_name|>network_info.py<|end_file_name|><|fim▁begin|>from JumpScale import j descr = """ This jumpscript returns network info """ category = "monitoring" organization = "jumpscale" author = "kristof@incubaid.com" license = "bsd" version = "1.0" roles = [] def action(): <|fim_middle|> if __name__ == "__ma...
return j.sal.nettools.getNetworkInfo()
<|file_name|>network_info.py<|end_file_name|><|fim▁begin|>from JumpScale import j descr = """ This jumpscript returns network info """ category = "monitoring" organization = "jumpscale" author = "kristof@incubaid.com" license = "bsd" version = "1.0" roles = [] def action(): return j.sal.nettools.getNetworkInfo(...
print(action())
<|file_name|>network_info.py<|end_file_name|><|fim▁begin|>from JumpScale import j descr = """ This jumpscript returns network info """ category = "monitoring" organization = "jumpscale" author = "kristof@incubaid.com" license = "bsd" version = "1.0" roles = [] def <|fim_middle|>(): return j.sal.nettools.getNetw...
action
<|file_name|>descriptionreponamelstm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from Models.FeatureProcessing import * from keras.models import Sequential from keras.layers import Activation, Dense, LSTM from keras.optimizers import Adam, SGD import numpy as np import abc from Classif...
"""Return the probability the module assignes each label"""
<|file_name|>descriptionreponamelstm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from Models.FeatureProcessing import * from keras.models import Sequential from keras.layers import Activation, Dense, LSTM from keras.optimizers import Adam, SGD import numpy as np import abc from Classif...
"""A basic lstm neural network""" def __init__(self, num_hidden_layers=3): ClassificationModule.__init__(self, "Description and reponame LSTM", "A LSTM reading the description and reponame character by character") hidden_size = 300 self.maxlen = 300 # Set output_size ...
<|file_name|>descriptionreponamelstm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from Models.FeatureProcessing import * from keras.models import Sequential from keras.layers import Activation, Dense, LSTM from keras.optimizers import Adam, SGD import numpy as np import abc from Classif...
ClassificationModule.__init__(self, "Description and reponame LSTM", "A LSTM reading the description and reponame character by character") hidden_size = 300 self.maxlen = 300 # Set output_size self.output_size = 7 # Hardcoded for 7 classes model = Sequential() ...
<|file_name|>descriptionreponamelstm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from Models.FeatureProcessing import * from keras.models import Sequential from keras.layers import Activation, Dense, LSTM from keras.optimizers import Adam, SGD import numpy as np import abc from Classif...
"""Reset classification module to status before training""" resetWeights(self.model)
<|file_name|>descriptionreponamelstm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from Models.FeatureProcessing import * from keras.models import Sequential from keras.layers import Activation, Dense, LSTM from keras.optimizers import Adam, SGD import numpy as np import abc from Classif...
"""Trainiere (inkrementell) mit Sample. Evtl zusätzlich mit best. Menge alter Daten, damit overfitten auf neue Daten verhindert wird.""" readme_vec = self.formatInputData(sample) label_index = getLabelIndex(sample) label_one_hot = np.expand_dims(oneHot(label_index), axis=0) # [1, 0, 0, ....
<|file_name|>descriptionreponamelstm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from Models.FeatureProcessing import * from keras.models import Sequential from keras.layers import Activation, Dense, LSTM from keras.optimizers import Adam, SGD import numpy as np import abc from Classif...
""Trainiere mit Liste von Daten. Evtl weitere Paramter nötig (nb_epoch, learning_rate, ...)""" train_samples = [] train_lables = [] for sample in samples: formatted_sample = self.formatInputData(sample)[0].tolist() train_samples.append(formatted_sample) ...
<|file_name|>descriptionreponamelstm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from Models.FeatureProcessing import * from keras.models import Sequential from keras.layers import Activation, Dense, LSTM from keras.optimizers import Adam, SGD import numpy as np import abc from Classif...
"Gibt zurück, wie der Klassifikator ein gegebenes Sample klassifizieren würde""" if not self.isTrained: return 0 sample = self.formatInputData(sample) return np.argmax(self.model.predict(sample))
<|file_name|>descriptionreponamelstm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from Models.FeatureProcessing import * from keras.models import Sequential from keras.layers import Activation, Dense, LSTM from keras.optimizers import Adam, SGD import numpy as np import abc from Classif...
eturn the probability the module assignes each label""" if not self.isTrained: return [0, 0, 0, 0, 0, 0, 0, 0] sample = self.formatInputData(sample) prediction = self.model.predict(sample)[0] return [np.argmax(prediction)] + list(prediction) # [0] So 1-D array is retu...
<|file_name|>descriptionreponamelstm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from Models.FeatureProcessing import * from keras.models import Sequential from keras.layers import Activation, Dense, LSTM from keras.optimizers import Adam, SGD import numpy as np import abc from Classif...
xtract description and transform to vector""" sd = getDescription(sample) sd += getName(sample) # Returns numpy array which contains 1 array with features return np.expand_dims(lstmEncode(sd, maxlen=self.maxlen), axis=0)
<|file_name|>descriptionreponamelstm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from Models.FeatureProcessing import * from keras.models import Sequential from keras.layers import Activation, Dense, LSTM from keras.optimizers import Adam, SGD import numpy as np import abc from Classif...
rn 0
<|file_name|>descriptionreponamelstm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from Models.FeatureProcessing import * from keras.models import Sequential from keras.layers import Activation, Dense, LSTM from keras.optimizers import Adam, SGD import numpy as np import abc from Classif...
rn [0, 0, 0, 0, 0, 0, 0, 0]
<|file_name|>descriptionreponamelstm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from Models.FeatureProcessing import * from keras.models import Sequential from keras.layers import Activation, Dense, LSTM from keras.optimizers import Adam, SGD import numpy as np import abc from Classif...
__init__
<|file_name|>descriptionreponamelstm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from Models.FeatureProcessing import * from keras.models import Sequential from keras.layers import Activation, Dense, LSTM from keras.optimizers import Adam, SGD import numpy as np import abc from Classif...
resetAllTraining
<|file_name|>descriptionreponamelstm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from Models.FeatureProcessing import * from keras.models import Sequential from keras.layers import Activation, Dense, LSTM from keras.optimizers import Adam, SGD import numpy as np import abc from Classif...
trainOnSample
<|file_name|>descriptionreponamelstm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from Models.FeatureProcessing import * from keras.models import Sequential from keras.layers import Activation, Dense, LSTM from keras.optimizers import Adam, SGD import numpy as np import abc from Classif...
rain(
<|file_name|>descriptionreponamelstm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from Models.FeatureProcessing import * from keras.models import Sequential from keras.layers import Activation, Dense, LSTM from keras.optimizers import Adam, SGD import numpy as np import abc from Classif...
edictLabel(s
<|file_name|>descriptionreponamelstm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from Models.FeatureProcessing import * from keras.models import Sequential from keras.layers import Activation, Dense, LSTM from keras.optimizers import Adam, SGD import numpy as np import abc from Classif...
ictLabelAndProbability(sel
<|file_name|>descriptionreponamelstm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from Models.FeatureProcessing import * from keras.models import Sequential from keras.layers import Activation, Dense, LSTM from keras.optimizers import Adam, SGD import numpy as np import abc from Classif...
atInputData(sel
<|file_name|>instance.py<|end_file_name|><|fim▁begin|># Copyright 2016 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/...
# # Unless required by applicable law or agreed to in writing, software
<|file_name|>instance.py<|end_file_name|><|fim▁begin|># Copyright 2016 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/...
return ''.join([COMPUTE_URL_BASE, 'projects/', project, '/global/', collection, '/', name])
<|file_name|>instance.py<|end_file_name|><|fim▁begin|># Copyright 2016 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/...
return ''.join([COMPUTE_URL_BASE, 'projects/', project, '/zones/', zone, '/', collection, '/', name])
<|file_name|>instance.py<|end_file_name|><|fim▁begin|># Copyright 2016 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/...
"""Generate configuration.""" base_name = context.properties['instanceName'] items = [] for key, value in context.properties['metadata'].iteritems(): items.append({ 'key': key, 'value': value }) metadata = {'items': items} # Properties for the container-based instance. insta...
<|file_name|>instance.py<|end_file_name|><|fim▁begin|># Copyright 2016 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/...
GlobalComputeUrl
<|file_name|>instance.py<|end_file_name|><|fim▁begin|># Copyright 2016 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/...
ZonalComputeUrl
<|file_name|>instance.py<|end_file_name|><|fim▁begin|># Copyright 2016 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/...
GenerateConfig
<|file_name|>configtest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Config file test app (together with test.cfg file) # import os, sys sys.path.append("..") import configfile cfg = configfile.ConfigFile("test.cfg") cfg.setCfgValue("name1", "value1") cfg.setCfgValue("name2", "value2") cfg.selectSection(...
<|file_name|>mainHandler.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # @author victor li nianchaoli@msn.cn # @date 2015/10/07<|fim▁hole|>import baseHandler class MainHandler(baseHandler.RequestHandler): def get(self): self.redirect('/posts/last')<|fim▁end|>
<|file_name|>mainHandler.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # @author victor li nianchaoli@msn.cn # @date 2015/10/07 import baseHandler class MainHandler(baseHandler.RequestHandler): <|fim_middle|> <|fim▁end|>
def get(self): self.redirect('/posts/last')
<|file_name|>mainHandler.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # @author victor li nianchaoli@msn.cn # @date 2015/10/07 import baseHandler class MainHandler(baseHandler.RequestHandler): def get(self): <|fim_middle|> <|fim▁end|>
self.redirect('/posts/last')
<|file_name|>mainHandler.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # @author victor li nianchaoli@msn.cn # @date 2015/10/07 import baseHandler class MainHandler(baseHandler.RequestHandler): def <|fim_middle|>(self): self.redirect('/posts/last') <|fim▁end|>
get
<|file_name|>step6.py<|end_file_name|><|fim▁begin|>import json f = open('text-stripped-3.json') out = open('text-lines.json', 'w') start_obj = json.load(f) end_obj = {'data': []} characters_on_stage = [] currently_speaking = None last_scene = '1.1' for i in range(len(start_obj['data'])): obj = start_obj['data'][i...