当前位置: 首页>>代码示例>>Python>>正文


Python Clock.pump方法代码示例

本文整理汇总了Python中twisted.internet.task.Clock.pump方法的典型用法代码示例。如果您正苦于以下问题:Python Clock.pump方法的具体用法?Python Clock.pump怎么用?Python Clock.pump使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在twisted.internet.task.Clock的用法示例。


在下文中一共展示了Clock.pump方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_glass_from_sand_on_wood_multiple

# 需要导入模块: from twisted.internet.task import Clock [as 别名]
# 或者: from twisted.internet.task.Clock import pump [as 别名]
    def test_glass_from_sand_on_wood_multiple(self):
        """
        Crafting two glass, from two sand, using ten saplings, should take
        20s and only use four saplings.
        """

        # Patch the clock.
        clock = Clock()
        self.tile.burning.clock = clock

        self.tile.inventory.fuel[0] = Slot(blocks['sapling'].slot, 0, 10)
        self.tile.inventory.crafting[0] = Slot(blocks['sand'].slot, 0, 2)
        self.tile.changed(self.factory, coords)

        # Pump the clock. Burn time is 20s.
        clock.pump([0.5] * 40)

        self.assertEqual(self.factory.world.chunk.states[0],
                         blocks["burning-furnace"].slot) # it was started...
        self.assertEqual(self.factory.world.chunk.states[1],
                         blocks["furnace"].slot) # ...and stopped at the end
        # 2 sands take 20s to smelt, only 4 saplings needed
        self.assertEqual(self.tile.inventory.fuel[0], (blocks['sapling'].slot, 0, 6))
        self.assertEqual(self.tile.inventory.crafting[0], None)
        self.assertEqual(self.tile.inventory.crafted[0], (blocks['glass'].slot, 0, 2))
开发者ID:dkkline,项目名称:bravo,代码行数:27,代码来源:test_furnace.py

示例2: test_read_request_load_succeeds

# 需要导入模块: from twisted.internet.task import Clock [as 别名]
# 或者: from twisted.internet.task.Clock import pump [as 别名]
    def test_read_request_load_succeeds(self):
        """
        ReadRequestLoadScenario starts and stops without collapsing.
        """
        c = Clock()

        node1 = Node(uuid=uuid4(), public_address=IPAddress('10.0.0.1'))
        node2 = Node(uuid=uuid4(), public_address=IPAddress('10.0.0.2'))
        cluster = BenchmarkCluster(
            node1.public_address,
            lambda reactor: FakeFlockerClient([node1, node2]),
            {node1.public_address, node2.public_address},
            default_volume_size=DEFAULT_VOLUME_SIZE
        )

        sample_size = 5
        s = ReadRequestLoadScenario(c, cluster, sample_size=sample_size)

        d = s.start()

        # Request rate samples are recorded every second and we need to
        # collect enough samples to establish the rate which is defined
        # by `sample_size`. Therefore, advance the clock by
        # `sample_size` seconds to obtain enough samples.
        c.pump(repeat(1, sample_size))
        s.maintained().addBoth(lambda x: self.fail())
        d.addCallback(lambda ignored: s.stop())
        self.successResultOf(d)
开发者ID:wangbinxiang,项目名称:flocker,代码行数:30,代码来源:test_read_request_load.py

示例3: test_scenario_throws_exception_when_rate_drops

# 需要导入模块: from twisted.internet.task import Clock [as 别名]
# 或者: from twisted.internet.task.Clock import pump [as 别名]
    def test_scenario_throws_exception_when_rate_drops(self, _logger):
        """
        ``read_request_load_scenario`` raises ``RequestRateTooLow`` if rate
        drops below the requested rate.

        Establish the requested rate by having the ``FakeFlockerClient``
        respond to all requests, then lower the rate by dropping
        alternate requests. This should result in ``RequestRateTooLow``
        being raised.
        """
        c = Clock()

        cluster = self.make_cluster(self.get_error_response_client_instance(c))
        sample_size = 5
        cluster.get_control_service(c).delay = 0
        s = write_request_load_scenario(c, cluster, sample_size=sample_size,
                                        tolerance_percentage=0.0)
        s.start()

        # Advance the clock by `sample_size` seconds to establish the
        # requested rate.
        c.pump(repeat(1, sample_size))

        cluster.get_control_service(c).fail_requests = True

        # Advance the clock by 2 seconds so that a request is dropped
        # and a new rate which is below the target can be established.
        time_to_advance = s.tolerated_errors / sample_size
        c.pump(repeat(1, time_to_advance))

        failure = self.failureResultOf(s.maintained())

        _logger.flushTracebacks(FakeNetworkError)

        self.assertIsInstance(failure.value, RequestRateTooLow)
开发者ID:332054781,项目名称:flocker,代码行数:37,代码来源:test_write_request_load.py

示例4: test_scenario_throws_exception_when_rate_drops

# 需要导入模块: from twisted.internet.task import Clock [as 别名]
# 或者: from twisted.internet.task.Clock import pump [as 别名]
    def test_scenario_throws_exception_when_rate_drops(self):
        """
        ReadRequestLoadScenario raises RequestRateTooLow if rate
        drops below the requested rate.

        Establish the requested rate by having the FakeFlockerClient
        respond to all requests, then lower the rate by dropping
        alternate requests. This should result in RequestRateTooLow
        being raised.
        """
        c = Clock()

        cluster = self.make_cluster(RequestDroppingFakeFlockerClient)
        sample_size = 5
        s = ReadRequestLoadScenario(c, cluster, sample_size=sample_size)

        s.start()

        # Advance the clock by `sample_size` seconds to establish the
        # requested rate.
        c.pump(repeat(1, sample_size))

        cluster.get_control_service(c).drop_requests = True

        # Advance the clock by 2 seconds so that a request is dropped
        # and a new rate which is below the target can be established.
        c.advance(2)

        failure = self.failureResultOf(s.maintained())
        self.assertIsInstance(failure.value, RequestRateTooLow)
开发者ID:wangbinxiang,项目名称:flocker,代码行数:32,代码来源:test_read_request_load.py

示例5: assert_mutate_function_retries_until_timeout

# 需要导入模块: from twisted.internet.task import Clock [as 别名]
# 或者: from twisted.internet.task.Clock import pump [as 别名]
    def assert_mutate_function_retries_until_timeout(
            self, mutate_callable, expected_args, timeout=60):
        """
        Assert that some CLB function that mutates the CLB will retry on
        pending update until the function times out.

        :param mutate_callable: a callable which takes a clb argument and
            a clock argument - this callable should call the CLB's mutate
            function with the required arguments and return the function's
            return value.  For example:
            ``lambda clb, clk: clb.update_node(..., clock=clk)``
        :param expected_args: What are the expected treq arguments?  This
            should be an array of
            [method, url, (expected args, expected kwargs)]
        :param int timeout: When does your function time out retrying?
        """
        clock = Clock()
        clb = self.get_clb(*(expected_args + pending_update_response))

        d = mutate_callable(clb, clock)
        self.assertNoResult(d)

        for _ in range((timeout - 1) / 3):
            clock.pump([3])
            self.assertNoResult(d)

        clock.pump([3])
        self.failureResultOf(d, TimedOutError)
开发者ID:stanzikratel,项目名称:otter,代码行数:30,代码来源:test_cloud_load_balancer.py

示例6: test_scenario_succeeds_when_rate_has_tolerated_drop

# 需要导入模块: from twisted.internet.task import Clock [as 别名]
# 或者: from twisted.internet.task.Clock import pump [as 别名]
    def test_scenario_succeeds_when_rate_has_tolerated_drop(self, _logger):
        """
        ``write_request_load_scenario`` succeeds even if the rate drops,
        if it is within the tolerance percentage.

        Establish the requested rate by having the ``FakeFlockerClient``
        respond to all requests, then lower the rate by dropping
        alternate requests.
        """
        c = Clock()

        control_service = self.get_dropping_flocker_client_instance()
        cluster = self.make_cluster(control_service)
        sample_size = 5
        s = write_request_load_scenario(c, cluster, sample_size=sample_size,
                                        tolerance_percentage=0.6)
        cluster.get_control_service(c).drop_requests = True
        d = s.start()

        s.maintained().addBoth(lambda x: self.fail())
        d.addCallback(lambda ignored: s.stop())
        # Generate enough samples to finish the scenario
        c.pump(repeat(1, sample_size*s.request_rate))

        self.successResultOf(d)
开发者ID:332054781,项目名称:flocker,代码行数:27,代码来源:test_write_request_load.py

示例7: test_write_request_load_succeeds

# 需要导入模块: from twisted.internet.task import Clock [as 别名]
# 或者: from twisted.internet.task.Clock import pump [as 别名]
    def test_write_request_load_succeeds(self, _logger):
        """
        ``write_request_load_scenario`` starts and stops without collapsing.
        """
        c = Clock()
        cluster = self.make_cluster(self.get_fake_flocker_client_instance())
        sample_size = 5
        s = write_request_load_scenario(c, cluster, sample_size=sample_size)

        d = s.start()

        # Request rate samples are recorded every second and we need to
        # collect enough samples to establish the rate which is defined
        # by `sample_size`. Therefore, advance the clock by
        # `sample_size` seconds to obtain enough samples.
        c.pump(repeat(1, sample_size))
        s.maintained().addBoth(lambda x: self.fail())
        d.addCallback(lambda ignored: s.stop())

        def verify_scenario_returns_metrics(result):
            self.assertIsInstance(result, dict)

        d.addCallback(verify_scenario_returns_metrics)

        self.successResultOf(d)
开发者ID:332054781,项目名称:flocker,代码行数:27,代码来源:test_write_request_load.py

示例8: assert_mutate_function_retries_until_success

# 需要导入模块: from twisted.internet.task import Clock [as 别名]
# 或者: from twisted.internet.task.Clock import pump [as 别名]
    def assert_mutate_function_retries_until_success(
            self, mutate_callable, expected_args, success_response,
            expected_result):
        """
        Assert that some CLB function that mutates the CLB will retry on
        pending update until the function succeeds.

        :param mutate_callable: a callable which takes a clb argument and
            a clock argument - this callable should call the CLB's mutate
            function with the required arguments and return the function's
            return value.  For example:
            ``lambda clb, clk: clb.update_node(..., clock=clk)``
        :param expected_args: What are the expected treq arguments?  This
            should be an array of
            [method, url, (expected args, expected kwargs)]
        :param success_response: a tuple of (Response, string response body)
            which should be the successful response back from the API
        :param expected_result: What is the expected successful result of the
            function that is called by ``mutate_callable``
        """
        clock = Clock()
        clb = self.get_clb(*(expected_args + pending_update_response))

        d = mutate_callable(clb, clock)

        self.assertNoResult(d)
        clock.pump([3])
        self.assertNoResult(d)

        clb.treq = get_fake_treq(
            *([self] + expected_args + [success_response]))

        clock.pump([3])
        self.assertEqual(self.successResultOf(d), expected_result)
开发者ID:stanzikratel,项目名称:otter,代码行数:36,代码来源:test_cloud_load_balancer.py

示例9: RemoteOriginReadOptionNegotiation

# 需要导入模块: from twisted.internet.task import Clock [as 别名]
# 或者: from twisted.internet.task.Clock import pump [as 别名]
class RemoteOriginReadOptionNegotiation(unittest.TestCase):
    test_data = """line1
line2
anotherline"""
    port = 65466

    def setUp(self):
        self.clock = Clock()
        self.tmp_dir_path = tempfile.mkdtemp()
        self.target = FilePath(self.tmp_dir_path).child('foo')
        with self.target.open('wb') as temp_fd:
            temp_fd.write(self.test_data)
        self.reader = DelayedReader(self.target, _clock=self.clock, delay=2)
        self.transport = FakeTransport(hostAddress=('127.0.0.1', self.port))
        self.rs = RemoteOriginReadSession(('127.0.0.1', 65465), self.reader,
                                          options={'blksize':'9'}, _clock=self.clock)
        self.rs.transport = self.transport

    def test_option_normal(self):
        self.rs.startProtocol()
        self.clock.advance(0.1)
        oack_datagram = OACKDatagram({'blksize':'9'}).to_wire()
        self.assertEqual(self.transport.value(), oack_datagram)
        self.clock.advance(3)
        self.assertEqual(self.transport.value(), oack_datagram * 2)

        self.transport.clear()
        self.rs.datagramReceived(ACKDatagram(0).to_wire(), ('127.0.0.1', 65465))
        self.clock.pump((1,)*3)
        self.assertEqual(self.transport.value(), DATADatagram(1, self.test_data[:9]).to_wire())

        self.addCleanup(self.rs.cancel)

    def test_option_timeout(self):
        self.rs.startProtocol()
        self.clock.advance(0.1)
        oack_datagram = OACKDatagram({'blksize':'9'}).to_wire()
        self.assertEqual(self.transport.value(), oack_datagram)
        self.failIf(self.transport.disconnecting)

        self.clock.advance(3)
        self.assertEqual(self.transport.value(), oack_datagram * 2)
        self.failIf(self.transport.disconnecting)

        self.clock.advance(2)
        self.assertEqual(self.transport.value(), oack_datagram * 3)
        self.failIf(self.transport.disconnecting)

        self.clock.advance(2)
        self.assertEqual(self.transport.value(), oack_datagram * 3)
        self.failUnless(self.transport.disconnecting)

    def tearDown(self):
        shutil.rmtree(self.tmp_dir_path)
开发者ID:rvbad,项目名称:python-tx-tftp,代码行数:56,代码来源:test_bootstrap.py

示例10: RetryingAuthenticatorTests

# 需要导入模块: from twisted.internet.task import Clock [as 别名]
# 或者: from twisted.internet.task.Clock import pump [as 别名]
class RetryingAuthenticatorTests(TestCase):
    """
    Tests for `RetryingAuthenticator`
    """

    def setUp(self):
        """
        Create RetryingAuthenticator
        """
        self.clock = Clock()
        self.mock_auth = iMock(IAuthenticator)
        self.authenticator = RetryingAuthenticator(
            self.clock, self.mock_auth, max_retries=3, retry_interval=4)

    def test_delegates(self):
        """
        `RetryingAuthenticator` calls internal authenticator and returns its result
        """
        self.mock_auth.authenticate_tenant.return_value = succeed('result')
        d = self.authenticator.authenticate_tenant(23)
        self.assertEqual(self.successResultOf(d), 'result')
        self.mock_auth.authenticate_tenant.assert_called_once_with(23, log=None)

    def test_retries(self):
        """
        `RetryingAuthenticator` retries internal authenticator if it fails
        """
        self.mock_auth.authenticate_tenant.side_effect = lambda *a, **kw: fail(APIError(500, '2'))
        d = self.authenticator.authenticate_tenant(23)
        # mock_auth is called and there is no result
        self.assertNoResult(d)
        self.mock_auth.authenticate_tenant.assert_called_once_with(23, log=None)
        # Advance clock and mock_auth is called again
        self.clock.advance(4)
        self.assertEqual(self.mock_auth.authenticate_tenant.call_count, 2)
        self.assertNoResult(d)
        # advance clock and mock_auth's success return is propogated
        self.mock_auth.authenticate_tenant.side_effect = lambda *a, **kw: succeed('result')
        self.clock.advance(4)
        self.assertEqual(self.successResultOf(d), 'result')

    def test_retries_times_out(self):
        """
        `RetryingAuthenticator` retries internal authenticator and times out if it
        keeps failing for certain period of time
        """
        self.mock_auth.authenticate_tenant.side_effect = lambda *a, **kw: fail(APIError(500, '2'))
        d = self.authenticator.authenticate_tenant(23)
        self.assertNoResult(d)
        self.clock.pump([4] * 4)
        f = self.failureResultOf(d, APIError)
        self.assertEqual(f.value.code, 500)
开发者ID:MariaAbrahms,项目名称:otter,代码行数:54,代码来源:test_auth.py

示例11: test_scenario_throws_exception_when_already_started

# 需要导入模块: from twisted.internet.task import Clock [as 别名]
# 或者: from twisted.internet.task.Clock import pump [as 别名]
 def test_scenario_throws_exception_when_already_started(self, _logger):
     """
     start method in the ``RequestLoadScenario`` throws a
     ``RequestScenarioAlreadyStarted`` if the scenario is already started.
     """
     c = Clock()
     cluster = self.make_cluster(self.get_fake_flocker_client_instance())
     sample_size = 5
     s = write_request_load_scenario(c, cluster, sample_size=sample_size)
     # Start and stop
     s.start()
     c.pump(repeat(1, sample_size))
     self.assertRaises(RequestScenarioAlreadyStarted, s.start)
开发者ID:332054781,项目名称:flocker,代码行数:15,代码来源:test_write_request_load.py

示例12: test_setup_timeout_when_datasat_not_created

# 需要导入模块: from twisted.internet.task import Clock [as 别名]
# 或者: from twisted.internet.task.Clock import pump [as 别名]
    def test_setup_timeout_when_datasat_not_created(self):
        """
        `WriteRequestLoadScenario` should timeout if the setup the dataset
        creation does not complete within the given time.
        """
        c = Clock()
        cluster = self.make_cluster(
            self.get_unresponsive_flocker_client_instance())
        s = WriteRequestLoadScenario(c, cluster, 5, sample_size=3)

        d = s.start()
        c.pump(repeat(1, s.timeout+1))

        failure = self.failureResultOf(d)
        self.assertIsInstance(failure.value, DatasetCreationTimeout)
开发者ID:wangbinxiang,项目名称:flocker,代码行数:17,代码来源:test_write_request_load.py

示例13: BootstrapRemoteOriginRead

# 需要导入模块: from twisted.internet.task import Clock [as 别名]
# 或者: from twisted.internet.task.Clock import pump [as 别名]
class BootstrapRemoteOriginRead(unittest.TestCase):
    test_data = """line1
line2
anotherline"""
    port = 65466

    def setUp(self):
        self.clock = Clock()
        self.tmp_dir_path = tempfile.mkdtemp()
        self.target = FilePath(self.tmp_dir_path).child('foo')
        with self.target.open('wb') as temp_fd:
            temp_fd.write(self.test_data)
        self.reader = DelayedReader(self.target, _clock=self.clock, delay=2)
        self.transport = FakeTransport(hostAddress=('127.0.0.1', self.port))
        self.rs = RemoteOriginReadSession(('127.0.0.1', 65465), self.reader, _clock=self.clock)
        self.rs.transport = self.transport

    @inlineCallbacks
    def test_invalid_tid(self):
        self.rs.startProtocol()
        data_datagram = DATADatagram(1, 'foobar')
        yield self.rs.datagramReceived(data_datagram, ('127.0.0.1', 11111))
        err_dgram = TFTPDatagramFactory(*split_opcode(self.transport.value()))
        self.assertEqual(err_dgram.errorcode, ERR_TID_UNKNOWN)
        self.addCleanup(self.rs.cancel)

    def test_remote_origin_read_bootstrap(self):
        # First datagram
        self.rs.session.block_size = 5
        self.rs.startProtocol()
        self.clock.pump((1,)*3)

        data_datagram_1 = DATADatagram(1, self.test_data[:5])

        self.assertEqual(self.transport.value(), data_datagram_1.to_wire())
        self.failIf(self.transport.disconnecting)

        # Normal exchange continues
        self.transport.clear()
        self.rs.datagramReceived(ACKDatagram(1).to_wire(), ('127.0.0.1', 65465))
        self.clock.pump((1,)*3)
        data_datagram_2 = DATADatagram(2, self.test_data[5:10])
        self.assertEqual(self.transport.value(), data_datagram_2.to_wire())
        self.failIf(self.transport.disconnecting)
        self.addCleanup(self.rs.cancel)

    def tearDown(self):
        shutil.rmtree(self.tmp_dir_path)
开发者ID:deepakhajare,项目名称:maas,代码行数:50,代码来源:test_bootstrap.py

示例14: BootstrapLocalOriginWrite

# 需要导入模块: from twisted.internet.task import Clock [as 别名]
# 或者: from twisted.internet.task.Clock import pump [as 别名]
class BootstrapLocalOriginWrite(unittest.TestCase):

    port = 65466

    def setUp(self):
        self.clock = Clock()
        self.tmp_dir_path = tempfile.mkdtemp()
        self.target = FilePath(self.tmp_dir_path).child("foo")
        self.writer = DelayedWriter(self.target, _clock=self.clock, delay=2)
        self.transport = FakeTransport(hostAddress=("127.0.0.1", self.port))
        self.ws = LocalOriginWriteSession(("127.0.0.1", 65465), self.writer, _clock=self.clock)
        self.wd = MockHandshakeWatchdog(4, self.ws.timedOut, _clock=self.clock)
        self.ws.timeout_watchdog = self.wd
        self.ws.transport = self.transport

    def test_invalid_tid(self):
        self.ws.startProtocol()
        bad_tid_dgram = ACKDatagram(123)
        self.ws.datagramReceived(bad_tid_dgram.to_wire(), ("127.0.0.1", 1111))

        err_dgram = TFTPDatagramFactory(*split_opcode(self.transport.value()))
        self.assertEqual(err_dgram.errorcode, ERR_TID_UNKNOWN)
        self.addCleanup(self.ws.cancel)

    # test_invalid_tid.skip = 'Will go to another test case'

    def test_local_origin_write_session_handshake_timeout(self):
        self.ws.startProtocol()
        self.clock.advance(5)
        self.failIf(self.transport.value())
        self.failUnless(self.transport.disconnecting)

    def test_local_origin_write_session_handshake_success(self):
        self.ws.session.block_size = 6
        self.ws.startProtocol()
        self.clock.advance(1)
        data_datagram = DATADatagram(1, "foobar")
        self.ws.datagramReceived(data_datagram.to_wire(), ("127.0.0.1", 65465))
        self.clock.pump((1,) * 3)
        self.assertEqual(self.transport.value(), ACKDatagram(1).to_wire())
        self.failIf(self.transport.disconnecting)
        self.failIf(self.wd.active())
        self.addCleanup(self.ws.cancel)

    def tearDown(self):
        shutil.rmtree(self.tmp_dir_path)
开发者ID:chronidev,项目名称:python-tx-tftp,代码行数:48,代码来源:test_bootstrap.py

示例15: LocalOriginReadOptionNegotiation

# 需要导入模块: from twisted.internet.task import Clock [as 别名]
# 或者: from twisted.internet.task.Clock import pump [as 别名]
class LocalOriginReadOptionNegotiation(unittest.TestCase):
    test_data = """line1
line2
anotherline"""
    port = 65466

    def setUp(self):
        self.clock = Clock()
        self.tmp_dir_path = tempfile.mkdtemp()
        self.target = FilePath(self.tmp_dir_path).child('foo')
        with self.target.open('wb') as temp_fd:
            temp_fd.write(self.test_data)
        self.reader = DelayedReader(self.target, _clock=self.clock, delay=2)
        self.transport = FakeTransport(hostAddress=('127.0.0.1', self.port))
        self.rs = LocalOriginReadSession(('127.0.0.1', 65465), self.reader, _clock=self.clock)
        self.wd = MockHandshakeWatchdog(4, self.rs.timedOut, _clock=self.clock)
        self.rs.timeout_watchdog = self.wd
        self.rs.transport = self.transport

    def test_option_normal(self):
        self.rs.startProtocol()
        self.rs.datagramReceived(OACKDatagram({'blksize':'9'}).to_wire(), ('127.0.0.1', 65465))
        self.clock.advance(0.1)
        self.assertEqual(self.rs.session.block_size, 9)
        self.clock.pump((1,)*3)
        self.assertEqual(self.transport.value(), DATADatagram(1, self.test_data[:9]).to_wire())

        self.rs.datagramReceived(OACKDatagram({'blksize':'12'}).to_wire(), ('127.0.0.1', 65465))
        self.clock.advance(0.1)
        self.assertEqual(self.rs.session.block_size, 9)

        self.transport.clear()
        self.rs.datagramReceived(ACKDatagram(1).to_wire(), ('127.0.0.1', 65465))
        self.clock.pump((1,)*3)
        self.assertEqual(self.transport.value(), DATADatagram(2, self.test_data[9:18]).to_wire())

        self.addCleanup(self.rs.cancel)

    def test_local_origin_read_option_timeout(self):
        self.rs.startProtocol()
        self.clock.advance(5)
        self.failUnless(self.transport.disconnecting)

    def tearDown(self):
        shutil.rmtree(self.tmp_dir_path)
开发者ID:deepakhajare,项目名称:maas,代码行数:47,代码来源:test_bootstrap.py


注:本文中的twisted.internet.task.Clock.pump方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。