prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>p2p-feefilter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_f...
__init__
<|file_name|>p2p-feefilter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_f...
setup_network
<|file_name|>p2p-feefilter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_f...
run_test
<|file_name|>checks.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """A flow to run checks for a host.""" from grr.lib import aff4 from grr.lib import flow<|fim▁hole|>from grr.proto import flows_pb2 class CheckFlowArgs(rdfvalue.RDFProtoStruct): protobuf = flows_pb2.CheckFlowArgs class CheckRunner(flow.GRRF...
from grr.lib import rdfvalue from grr.lib.checks import checks
<|file_name|>checks.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """A flow to run checks for a host.""" from grr.lib import aff4 from grr.lib import flow from grr.lib import rdfvalue from grr.lib.checks import checks from grr.proto import flows_pb2 class CheckFlowArgs(rdfvalue.RDFProtoStruct): <|fim_middle...
protobuf = flows_pb2.CheckFlowArgs
<|file_name|>checks.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """A flow to run checks for a host.""" from grr.lib import aff4 from grr.lib import flow from grr.lib import rdfvalue from grr.lib.checks import checks from grr.proto import flows_pb2 class CheckFlowArgs(rdfvalue.RDFProtoStruct): protobuf = f...
"""This flow runs checks on a host. CheckRunner: - Identifies what checks should be run for a host. - Identifies the artifacts that need to be collected to perform those checks. - Orchestrates collection of the host data. - Routes host data to the relevant checks. - Returns check data ready for reporting...
<|file_name|>checks.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """A flow to run checks for a host.""" from grr.lib import aff4 from grr.lib import flow from grr.lib import rdfvalue from grr.lib.checks import checks from grr.proto import flows_pb2 class CheckFlowArgs(rdfvalue.RDFProtoStruct): protobuf = f...
""".""" client = aff4.FACTORY.Open(self.client_id, token=self.token) self.state.Register("knowledge_base", client.Get(client.Schema.KNOWLEDGE_BASE)) self.state.Register("labels", client.GetLabels()) self.state.Register("artifacts_wanted", set()) self.state.Register("artif...
<|file_name|>checks.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """A flow to run checks for a host.""" from grr.lib import aff4 from grr.lib import flow from grr.lib import rdfvalue from grr.lib.checks import checks from grr.proto import flows_pb2 class CheckFlowArgs(rdfvalue.RDFProtoStruct): protobuf = f...
"""Get processed data, mapped to artifacts.""" self.state.artifacts_wanted = checks.CheckRegistry.SelectArtifacts( os=self.state.knowledge_base.os) # Fetch Artifacts and map results to the artifacts that generated them. # This is an inefficient collection, but necessary because results need to ...
<|file_name|>checks.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """A flow to run checks for a host.""" from grr.lib import aff4 from grr.lib import flow from grr.lib import rdfvalue from grr.lib.checks import checks from grr.proto import flows_pb2 class CheckFlowArgs(rdfvalue.RDFProtoStruct): protobuf = f...
artifact_id = responses.request_data["artifact_id"] # TODO(user): Check whether artifact collection succeeded. self.state.host_data[artifact_id] = list(responses)
<|file_name|>checks.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """A flow to run checks for a host.""" from grr.lib import aff4 from grr.lib import flow from grr.lib import rdfvalue from grr.lib.checks import checks from grr.proto import flows_pb2 class CheckFlowArgs(rdfvalue.RDFProtoStruct): protobuf = f...
if not responses.success: raise RuntimeError("Checks did not run successfully.") # Hand host data across to checks. Do this after all data has been collected # in case some checks require multiple artifacts/results. for finding in checks.CheckHost(self.state.host_data, ...
<|file_name|>checks.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """A flow to run checks for a host.""" from grr.lib import aff4 from grr.lib import flow from grr.lib import rdfvalue from grr.lib.checks import checks from grr.proto import flows_pb2 class CheckFlowArgs(rdfvalue.RDFProtoStruct): protobuf = f...
raise RuntimeError("Checks did not run successfully.")
<|file_name|>checks.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """A flow to run checks for a host.""" from grr.lib import aff4 from grr.lib import flow from grr.lib import rdfvalue from grr.lib.checks import checks from grr.proto import flows_pb2 class CheckFlowArgs(rdfvalue.RDFProtoStruct): protobuf = f...
self.state.checks_with_findings.append(finding.check_id)
<|file_name|>checks.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """A flow to run checks for a host.""" from grr.lib import aff4 from grr.lib import flow from grr.lib import rdfvalue from grr.lib.checks import checks from grr.proto import flows_pb2 class CheckFlowArgs(rdfvalue.RDFProtoStruct): protobuf = f...
Start
<|file_name|>checks.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """A flow to run checks for a host.""" from grr.lib import aff4 from grr.lib import flow from grr.lib import rdfvalue from grr.lib.checks import checks from grr.proto import flows_pb2 class CheckFlowArgs(rdfvalue.RDFProtoStruct): protobuf = f...
MapArtifactData
<|file_name|>checks.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """A flow to run checks for a host.""" from grr.lib import aff4 from grr.lib import flow from grr.lib import rdfvalue from grr.lib.checks import checks from grr.proto import flows_pb2 class CheckFlowArgs(rdfvalue.RDFProtoStruct): protobuf = f...
AddResponses
<|file_name|>checks.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """A flow to run checks for a host.""" from grr.lib import aff4 from grr.lib import flow from grr.lib import rdfvalue from grr.lib.checks import checks from grr.proto import flows_pb2 class CheckFlowArgs(rdfvalue.RDFProtoStruct): protobuf = f...
RunChecks
<|file_name|>helper.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals<|fim▁hole|>import pytest import allure_commons from allure_pytest.utils import ALLURE_LABEL_PREFIX, ALLURE_LINK_PREFIX class AllureTestHelper(object): def __init__(self, config): self.confi...
<|file_name|>helper.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals import pytest import allure_commons from allure_pytest.utils import ALLURE_LABEL_PREFIX, ALLURE_LINK_PREFIX class AllureTestHelper(object): <|fim_middle|> <|fim▁end|>
def __init__(self, config): self.config = config @allure_commons.hookimpl def decorate_as_label(self, label_type, labels): allure_label_marker = '{prefix}.{label_type}'.format(prefix=ALLURE_LABEL_PREFIX, label_type=label_type) allure_label = getattr(pytest.mark, allure_label_marker)...
<|file_name|>helper.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals import pytest import allure_commons from allure_pytest.utils import ALLURE_LABEL_PREFIX, ALLURE_LINK_PREFIX class AllureTestHelper(object): def __init__(self, config): <|fim_middle|> ...
self.config = config
<|file_name|>helper.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals import pytest import allure_commons from allure_pytest.utils import ALLURE_LABEL_PREFIX, ALLURE_LINK_PREFIX class AllureTestHelper(object): def __init__(self, config): self.config = config...
allure_label_marker = '{prefix}.{label_type}'.format(prefix=ALLURE_LABEL_PREFIX, label_type=label_type) allure_label = getattr(pytest.mark, allure_label_marker) return allure_label(*labels, label_type=label_type)
<|file_name|>helper.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals import pytest import allure_commons from allure_pytest.utils import ALLURE_LABEL_PREFIX, ALLURE_LINK_PREFIX class AllureTestHelper(object): def __init__(self, config): self.config = config...
allure_link_marker = '{prefix}.{link_type}'.format(prefix=ALLURE_LINK_PREFIX, link_type=link_type) pattern = dict(self.config.option.allure_link_pattern).get(link_type, u'{}') url = pattern.format(url) allure_link = getattr(pytest.mark, allure_link_marker) return allure_link(url,...
<|file_name|>helper.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals import pytest import allure_commons from allure_pytest.utils import ALLURE_LABEL_PREFIX, ALLURE_LINK_PREFIX class AllureTestHelper(object): def <|fim_middle|>(self, config): self.config = ...
__init__
<|file_name|>helper.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals import pytest import allure_commons from allure_pytest.utils import ALLURE_LABEL_PREFIX, ALLURE_LINK_PREFIX class AllureTestHelper(object): def __init__(self, config): self.config = config...
decorate_as_label
<|file_name|>helper.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals import pytest import allure_commons from allure_pytest.utils import ALLURE_LABEL_PREFIX, ALLURE_LINK_PREFIX class AllureTestHelper(object): def __init__(self, config): self.config = config...
decorate_as_link
<|file_name|>models.py<|end_file_name|><|fim▁begin|>""" Example ------- class SystemSetting(KVModel): pass setting = SystemSetting.create(key='foo', value=100) loaded_setting = SystemSetting.get_by_key('foo') """ from django.db import models from .fields import SerializableField class KVModel(models.Model): ...
key -- Unique CharField of max_length 255 value -- SerializableField by default could be used to store bool, int,
<|file_name|>models.py<|end_file_name|><|fim▁begin|>""" Example ------- class SystemSetting(KVModel): pass setting = SystemSetting.create(key='foo', value=100) loaded_setting = SystemSetting.get_by_key('foo') """ from django.db import models from .fields import SerializableField class KVModel(models.Model): ...
""" An Abstract model that has key and value fields key -- Unique CharField of max_length 255 value -- SerializableField by default could be used to store bool, int, float, str, list, dict and date """ key = models.CharField(max_length=255, unique=True) value = SerializableF...
<|file_name|>models.py<|end_file_name|><|fim▁begin|>""" Example ------- class SystemSetting(KVModel): pass setting = SystemSetting.create(key='foo', value=100) loaded_setting = SystemSetting.get_by_key('foo') """ from django.db import models from .fields import SerializableField class KVModel(models.Model): ...
return 'KVModel instance: ' + self.key + ' = ' + unicode(self.value)
<|file_name|>models.py<|end_file_name|><|fim▁begin|>""" Example ------- class SystemSetting(KVModel): pass setting = SystemSetting.create(key='foo', value=100) loaded_setting = SystemSetting.get_by_key('foo') """ from django.db import models from .fields import SerializableField class KVModel(models.Model): ...
""" A static method that returns a KVModel instance. key -- unique key that is used for the search. this method will throw a DoesNotExist exception if an object with the key provided is not found. """ return cls.objects.get(key=key)
<|file_name|>models.py<|end_file_name|><|fim▁begin|>""" Example ------- class SystemSetting(KVModel): pass setting = SystemSetting.create(key='foo', value=100) loaded_setting = SystemSetting.get_by_key('foo') """ from django.db import models from .fields import SerializableField class KVModel(models.Model): ...
abstract = True
<|file_name|>models.py<|end_file_name|><|fim▁begin|>""" Example ------- class SystemSetting(KVModel): pass setting = SystemSetting.create(key='foo', value=100) loaded_setting = SystemSetting.get_by_key('foo') """ from django.db import models from .fields import SerializableField class KVModel(models.Model): ...
__unicode__
<|file_name|>models.py<|end_file_name|><|fim▁begin|>""" Example ------- class SystemSetting(KVModel): pass setting = SystemSetting.create(key='foo', value=100) loaded_setting = SystemSetting.get_by_key('foo') """ from django.db import models from .fields import SerializableField class KVModel(models.Model): ...
get_by_key
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
"""Return values from ``iterable`` two at a time. Recipe from https://docs.python.org/3/library/itertools.html#itertools-recipes. """ a, b = tee(iterable) next(b, None) return zip(a, b)
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
"""Day of talks.""" __tablename__ = 'days' id = db.Column(db.Integer, primary_key=True) date = db.Column(db.Date) event_id = db.Column( db.Integer, db.ForeignKey('events.id'), nullable=False) event = db.relationship( 'Event', backref=db.backref('days', lazy='dynamic')) def...
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
"""Return a printable representation.""" return self.date.strftime('%B %d, %Y')
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
"""Return the rooms for the day.""" return Room.query.join(rooms_slots, Slot).filter( Slot.day == self).order_by(Room.order).all()
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
"""Iterate over the schedule for the day.""" if not self.rooms: raise StopIteration def rowspan(start, end): """Find the rowspan for an entry in the schedule table. This uses a binary search for the given end time from a sorted list of start time...
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
"""Find the rowspan for an entry in the schedule table. This uses a binary search for the given end time from a sorted list of start times in order to find the index of the first start time that occurs after the given end time. This method is used to prevent ...
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
"""Room of talks.""" __tablename__ = 'rooms' id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(255), nullable=False) order = db.Column(db.Integer, nullable=False) def __str__(self): """Return a printable representation.""" return self.name
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
"""Return a printable representation.""" return self.name
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
"""Time slot.""" __tablename__ = 'slots' id = db.Column(db.Integer, primary_key=True) kind = db.Column( db.Enum( 'break', 'meal', 'keynote', 'talk', 'tutorial', name='slotkind'), nullable=False, ) content_override = db.Column(db.Text) start = db.Column(db.Time, ...
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
"""Return a printable representation.""" start = self.start.strftime('%I:%M %p') end = self.end.strftime('%I:%M %p') rooms = ', '.join(map(str, self.rooms)) return '{} - {} on {}, {}'.format(start, end, self.day, rooms)
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
"""Return the duration as a :class:`~datetime.timedelta`.""" return self.end - self.start
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
"""Presentation of a talk.""" __tablename__ = 'presentations' id = db.Column(db.Integer, primary_key=True) slot_id = db.Column(db.Integer, db.ForeignKey('slots.id'), nullable=False) slot = db.relationship( 'Slot', backref=db.backref('presentation', uselist=False)) talk_id = db.Column...
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
"""Return a printable representation.""" return str(self.talk)
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
"""Return whether the instance is in all rooms.""" return self.slot.number_of_rooms == 4
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
"""Return the number of rooms for the instance.""" return len(self.slot.rooms)
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
raise StopIteration
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
slot.rowspan = rowspan(slot.start, slot.end) slot.colspan = slot.room_count if not slot.content_override: slot.presentation = Presentation.query.filter( Presentation.slot_id == slot.id).first() ...
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
slot.presentation = Presentation.query.filter( Presentation.slot_id == slot.id).first()
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
yield row
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
pairwise
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
__str__
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
rooms
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
__iter__
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
rowspan
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
__str__
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
__str__
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
duration
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
__str__
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
is_in_all_rooms
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Schedule models. Much of this module is derived from the work of Eldarion on the `Symposion <https://github.com/pinax/symposion>`_ project. Copyright (c) 2010-2014, Eldarion, Inc. and contributors All rights reserved. Redistribution and use in source and binary ...
number_of_rooms
<|file_name|>context_managers.py<|end_file_name|><|fim▁begin|>"""useful context managers""" from contextlib import suppress with suppress(ModuleNotFoundError): from lag import * import os import contextlib def clog(*args, condition=True, log_func=print, **kwargs): if condition: return log_func(*args...
# _clog("Called before cd", Path().absolute()) # with cd(Path.home()): # if verbose: print("Called under cd", Path().absolute())
<|file_name|>context_managers.py<|end_file_name|><|fim▁begin|>"""useful context managers""" from contextlib import suppress with suppress(ModuleNotFoundError): from lag import * import os import contextlib def clog(*args, condition=True, log_func=print, **kwargs): <|fim_middle|> @contextlib.contextmanage...
if condition: return log_func(*args, **kwargs)
<|file_name|>context_managers.py<|end_file_name|><|fim▁begin|>"""useful context managers""" from contextlib import suppress with suppress(ModuleNotFoundError): from lag import * import os import contextlib def clog(*args, condition=True, log_func=print, **kwargs): if condition: return log_func(*args...
"""Change your working directory, do stuff, and change back to the original""" _clog = partial(clog, condition=verbose, log_func=print) prevdir = os.getcwd() os.chdir(os.path.expanduser(newdir)) try: _clog(f'cd {newdir}') yield finally: _clog(f'cd {prevdir}') os.c...
<|file_name|>context_managers.py<|end_file_name|><|fim▁begin|>"""useful context managers""" from contextlib import suppress with suppress(ModuleNotFoundError): from lag import * import os import contextlib def clog(*args, condition=True, log_func=print, **kwargs): if condition: <|fim_middle|...
return log_func(*args, **kwargs)
<|file_name|>context_managers.py<|end_file_name|><|fim▁begin|>"""useful context managers""" from contextlib import suppress with suppress(ModuleNotFoundError): from lag import * import os import contextlib def <|fim_middle|>(*args, condition=True, log_func=print, **kwargs): if condition: return log_...
clog
<|file_name|>context_managers.py<|end_file_name|><|fim▁begin|>"""useful context managers""" from contextlib import suppress with suppress(ModuleNotFoundError): from lag import * import os import contextlib def clog(*args, condition=True, log_func=print, **kwargs): if condition: return log_func(*args...
cd
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*- """ Verion: 1.0 Author: zhangjian Site: http://iliangqunru.com File: __init__.py.py Time: 2017/7/22 2:19<|fim▁hole|><|fim▁end|>
"""
<|file_name|>device_tracker.py<|end_file_name|><|fim▁begin|>"""Device tracker for Synology SRM routers.""" from __future__ import annotations import logging import synology_srm import voluptuous as vol from homeassistant.components.device_tracker import ( DOMAIN, PLATFORM_SCHEMA as DEVICE_TRACKER_PLATFORM_SC...
self.devices = self.client.core.get_network_nsm_device({"is_online": True}) except synology_srm.http.SynologyException as ex: _LOGGER.error("Error with the Synology SRM: %s", ex)
<|file_name|>device_tracker.py<|end_file_name|><|fim▁begin|>"""Device tracker for Synology SRM routers.""" from __future__ import annotations import logging import synology_srm import voluptuous as vol from homeassistant.components.device_tracker import ( DOMAIN, PLATFORM_SCHEMA as DEVICE_TRACKER_PLATFORM_SC...
"""Validate the configuration and return Synology SRM scanner.""" scanner = SynologySrmDeviceScanner(config[DOMAIN]) return scanner if scanner.success_init else None
<|file_name|>device_tracker.py<|end_file_name|><|fim▁begin|>"""Device tracker for Synology SRM routers.""" from __future__ import annotations import logging import synology_srm import voluptuous as vol from homeassistant.components.device_tracker import ( DOMAIN, PLATFORM_SCHEMA as DEVICE_TRACKER_PLATFORM_SC...
"""This class scans for devices connected to a Synology SRM router.""" def __init__(self, config): """Initialize the scanner.""" self.client = synology_srm.Client( host=config[CONF_HOST], port=config[CONF_PORT], username=config[CONF_USERNAME], pa...
<|file_name|>device_tracker.py<|end_file_name|><|fim▁begin|>"""Device tracker for Synology SRM routers.""" from __future__ import annotations import logging import synology_srm import voluptuous as vol from homeassistant.components.device_tracker import ( DOMAIN, PLATFORM_SCHEMA as DEVICE_TRACKER_PLATFORM_SC...
"""Initialize the scanner.""" self.client = synology_srm.Client( host=config[CONF_HOST], port=config[CONF_PORT], username=config[CONF_USERNAME], password=config[CONF_PASSWORD], https=config[CONF_SSL], ) if not config[CONF_VERI...
<|file_name|>device_tracker.py<|end_file_name|><|fim▁begin|>"""Device tracker for Synology SRM routers.""" from __future__ import annotations import logging import synology_srm import voluptuous as vol from homeassistant.components.device_tracker import ( DOMAIN, PLATFORM_SCHEMA as DEVICE_TRACKER_PLATFORM_SC...
"""Scan for new devices and return a list with found device IDs.""" self._update_info() return [device["mac"] for device in self.devices]
<|file_name|>device_tracker.py<|end_file_name|><|fim▁begin|>"""Device tracker for Synology SRM routers.""" from __future__ import annotations import logging import synology_srm import voluptuous as vol from homeassistant.components.device_tracker import ( DOMAIN, PLATFORM_SCHEMA as DEVICE_TRACKER_PLATFORM_SC...
"""Get the extra attributes of a device.""" device = next( (result for result in self.devices if result["mac"] == device), None ) filtered_attributes: dict[str, str] = {} if not device: return filtered_attributes for attribute, alias in ATTRIBUTE_A...
<|file_name|>device_tracker.py<|end_file_name|><|fim▁begin|>"""Device tracker for Synology SRM routers.""" from __future__ import annotations import logging import synology_srm import voluptuous as vol from homeassistant.components.device_tracker import ( DOMAIN, PLATFORM_SCHEMA as DEVICE_TRACKER_PLATFORM_SC...
"""Return the name of the given device or None if we don't know.""" filter_named = [ result["hostname"] for result in self.devices if result["mac"] == device ] if filter_named: return filter_named[0] return None
<|file_name|>device_tracker.py<|end_file_name|><|fim▁begin|>"""Device tracker for Synology SRM routers.""" from __future__ import annotations import logging import synology_srm import voluptuous as vol from homeassistant.components.device_tracker import ( DOMAIN, PLATFORM_SCHEMA as DEVICE_TRACKER_PLATFORM_SC...
"""Check the router for connected devices.""" _LOGGER.debug("Scanning for connected devices") try: self.devices = self.client.core.get_network_nsm_device({"is_online": True}) except synology_srm.http.SynologyException as ex: _LOGGER.error("Error with the Synology...
<|file_name|>device_tracker.py<|end_file_name|><|fim▁begin|>"""Device tracker for Synology SRM routers.""" from __future__ import annotations import logging import synology_srm import voluptuous as vol from homeassistant.components.device_tracker import ( DOMAIN, PLATFORM_SCHEMA as DEVICE_TRACKER_PLATFORM_SC...
self.client.http.disable_https_verify()
<|file_name|>device_tracker.py<|end_file_name|><|fim▁begin|>"""Device tracker for Synology SRM routers.""" from __future__ import annotations import logging import synology_srm import voluptuous as vol from homeassistant.components.device_tracker import ( DOMAIN, PLATFORM_SCHEMA as DEVICE_TRACKER_PLATFORM_SC...
return filtered_attributes
<|file_name|>device_tracker.py<|end_file_name|><|fim▁begin|>"""Device tracker for Synology SRM routers.""" from __future__ import annotations import logging import synology_srm import voluptuous as vol from homeassistant.components.device_tracker import ( DOMAIN, PLATFORM_SCHEMA as DEVICE_TRACKER_PLATFORM_SC...
continue
<|file_name|>device_tracker.py<|end_file_name|><|fim▁begin|>"""Device tracker for Synology SRM routers.""" from __future__ import annotations import logging import synology_srm import voluptuous as vol from homeassistant.components.device_tracker import ( DOMAIN, PLATFORM_SCHEMA as DEVICE_TRACKER_PLATFORM_SC...
return filter_named[0]
<|file_name|>device_tracker.py<|end_file_name|><|fim▁begin|>"""Device tracker for Synology SRM routers.""" from __future__ import annotations import logging import synology_srm import voluptuous as vol from homeassistant.components.device_tracker import ( DOMAIN, PLATFORM_SCHEMA as DEVICE_TRACKER_PLATFORM_SC...
get_scanner
<|file_name|>device_tracker.py<|end_file_name|><|fim▁begin|>"""Device tracker for Synology SRM routers.""" from __future__ import annotations import logging import synology_srm import voluptuous as vol from homeassistant.components.device_tracker import ( DOMAIN, PLATFORM_SCHEMA as DEVICE_TRACKER_PLATFORM_SC...
__init__
<|file_name|>device_tracker.py<|end_file_name|><|fim▁begin|>"""Device tracker for Synology SRM routers.""" from __future__ import annotations import logging import synology_srm import voluptuous as vol from homeassistant.components.device_tracker import ( DOMAIN, PLATFORM_SCHEMA as DEVICE_TRACKER_PLATFORM_SC...
scan_devices
<|file_name|>device_tracker.py<|end_file_name|><|fim▁begin|>"""Device tracker for Synology SRM routers.""" from __future__ import annotations import logging import synology_srm import voluptuous as vol from homeassistant.components.device_tracker import ( DOMAIN, PLATFORM_SCHEMA as DEVICE_TRACKER_PLATFORM_SC...
get_extra_attributes
<|file_name|>device_tracker.py<|end_file_name|><|fim▁begin|>"""Device tracker for Synology SRM routers.""" from __future__ import annotations import logging import synology_srm import voluptuous as vol from homeassistant.components.device_tracker import ( DOMAIN, PLATFORM_SCHEMA as DEVICE_TRACKER_PLATFORM_SC...
get_device_name
<|file_name|>device_tracker.py<|end_file_name|><|fim▁begin|>"""Device tracker for Synology SRM routers.""" from __future__ import annotations import logging import synology_srm import voluptuous as vol from homeassistant.components.device_tracker import ( DOMAIN, PLATFORM_SCHEMA as DEVICE_TRACKER_PLATFORM_SC...
_update_info
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import sys<|fim▁hole|> if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "wellspring.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)<|fim...
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import sys if __name__ == "__main__": <|fim_middle|> <|fim▁end|>
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "wellspring.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
<|file_name|>CapForce.py<|end_file_name|><|fim▁begin|># Copyright (C) 2012,2013 # Max Planck Institute for Polymer Research # Copyright (C) 2008,2009,2010,2011 # Max-Planck-Institute for Polymer Research & Fraunhofer SCAI # # This file is part of ESPResSo++. #<|fim▁hole|># (at your option) any later versi...
# ESPResSo++ 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 3 of the License, or
<|file_name|>CapForce.py<|end_file_name|><|fim▁begin|># Copyright (C) 2012,2013 # Max Planck Institute for Polymer Research # Copyright (C) 2008,2009,2010,2011 # Max-Planck-Institute for Polymer Research & Fraunhofer SCAI # # This file is part of ESPResSo++. # # ESPResSo++ is free software: you can redist...
def __init__(self, system, capForce, particleGroup = None): if not (pmi._PMIComm and pmi._PMIComm.isActive()) or pmi._MPIcomm.rank in pmi._PMIComm.getMPIcpugroup(): if (particleGroup == None) or (particleGroup.size() == 0): cxxinit(self, integrator_CapForce, system, capForce) ...
<|file_name|>CapForce.py<|end_file_name|><|fim▁begin|># Copyright (C) 2012,2013 # Max Planck Institute for Polymer Research # Copyright (C) 2008,2009,2010,2011 # Max-Planck-Institute for Polymer Research & Fraunhofer SCAI # # This file is part of ESPResSo++. # # ESPResSo++ is free software: you can redist...
if not (pmi._PMIComm and pmi._PMIComm.isActive()) or pmi._MPIcomm.rank in pmi._PMIComm.getMPIcpugroup(): if (particleGroup == None) or (particleGroup.size() == 0): cxxinit(self, integrator_CapForce, system, capForce) else: cxxinit(self, integrator_CapForce...
<|file_name|>CapForce.py<|end_file_name|><|fim▁begin|># Copyright (C) 2012,2013 # Max Planck Institute for Polymer Research # Copyright (C) 2008,2009,2010,2011 # Max-Planck-Institute for Polymer Research & Fraunhofer SCAI # # This file is part of ESPResSo++. # # ESPResSo++ is free software: you can redist...
pmiproxydefs = dict( cls = 'espressopp.integrator.CapForceLocal', pmicall = ['setCapForce', 'setAbsCapForce', 'getCapForce', 'getAbsCapForce'], pmiproperty = [ 'particleGroup', 'adress' ] )
<|file_name|>CapForce.py<|end_file_name|><|fim▁begin|># Copyright (C) 2012,2013 # Max Planck Institute for Polymer Research # Copyright (C) 2008,2009,2010,2011 # Max-Planck-Institute for Polymer Research & Fraunhofer SCAI # # This file is part of ESPResSo++. # # ESPResSo++ is free software: you can redist...
if (particleGroup == None) or (particleGroup.size() == 0): cxxinit(self, integrator_CapForce, system, capForce) else: cxxinit(self, integrator_CapForce, system, capForce, particleGroup)
<|file_name|>CapForce.py<|end_file_name|><|fim▁begin|># Copyright (C) 2012,2013 # Max Planck Institute for Polymer Research # Copyright (C) 2008,2009,2010,2011 # Max-Planck-Institute for Polymer Research & Fraunhofer SCAI # # This file is part of ESPResSo++. # # ESPResSo++ is free software: you can redist...
cxxinit(self, integrator_CapForce, system, capForce)
<|file_name|>CapForce.py<|end_file_name|><|fim▁begin|># Copyright (C) 2012,2013 # Max Planck Institute for Polymer Research # Copyright (C) 2008,2009,2010,2011 # Max-Planck-Institute for Polymer Research & Fraunhofer SCAI # # This file is part of ESPResSo++. # # ESPResSo++ is free software: you can redist...
cxxinit(self, integrator_CapForce, system, capForce, particleGroup)
<|file_name|>CapForce.py<|end_file_name|><|fim▁begin|># Copyright (C) 2012,2013 # Max Planck Institute for Polymer Research # Copyright (C) 2008,2009,2010,2011 # Max-Planck-Institute for Polymer Research & Fraunhofer SCAI # # This file is part of ESPResSo++. # # ESPResSo++ is free software: you can redist...
class CapForce(Extension, metaclass=pmi.Proxy): pmiproxydefs = dict( cls = 'espressopp.integrator.CapForceLocal', pmicall = ['setCapForce', 'setAbsCapForce', 'getCapForce', 'getAbsCapForce'], pmiproperty = [ 'particleGroup', 'adress' ] )
<|file_name|>CapForce.py<|end_file_name|><|fim▁begin|># Copyright (C) 2012,2013 # Max Planck Institute for Polymer Research # Copyright (C) 2008,2009,2010,2011 # Max-Planck-Institute for Polymer Research & Fraunhofer SCAI # # This file is part of ESPResSo++. # # ESPResSo++ is free software: you can redist...
__init__
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import sys <|fim▁hole|> from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)<|fim▁end|>
if __name__ == '__main__': os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings.prod')
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import sys if __name__ == '__main__': <|fim_middle|> <|fim▁end|>
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings.prod') from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)