prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models from constituencies.models import Constituency from uk_political_parties.models import Party from elections.models import Election class Person(models.Model): name = models.CharField(blank=False, max_length=255) remote_id = mod...
return self.constituencies.filter( personconstituencies__election=self.current_election)[0]
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models from constituencies.models import Constituency from uk_political_parties.models import Party from elections.models import Election class Person(models.Model): name = models.CharField(blank=False, max_length=255) remote_id = mod...
return "%s (%s)" % (self.name, self.remote_id)
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models from constituencies.models import Constituency from uk_political_parties.models import Party from elections.models import Election class Person(models.Model): name = models.CharField(blank=False, max_length=255) remote_id = mod...
person = models.ForeignKey(Person) party = models.ForeignKey(Party) membership_start = models.DateField() membership_end = models.DateField(null=True)
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models from constituencies.models import Constituency from uk_political_parties.models import Party from elections.models import Election class Person(models.Model): name = models.CharField(blank=False, max_length=255) remote_id = mod...
person = models.ForeignKey(Person) constituency = models.ForeignKey(Constituency) election = models.ForeignKey(Election)
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models from constituencies.models import Constituency from uk_political_parties.models import Party from elections.models import Election class Person(models.Model): name = models.CharField(blank=False, max_length=255) remote_id = mod...
return parties[0]
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models from constituencies.models import Constituency from uk_political_parties.models import Party from elections.models import Election class Person(models.Model): name = models.CharField(blank=False, max_length=255) remote_id = mod...
current_party
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models from constituencies.models import Constituency from uk_political_parties.models import Party from elections.models import Election class Person(models.Model): name = models.CharField(blank=False, max_length=255) remote_id = mod...
current_election
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models from constituencies.models import Constituency from uk_political_parties.models import Party from elections.models import Election class Person(models.Model): name = models.CharField(blank=False, max_length=255) remote_id = mod...
current_constituency
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models from constituencies.models import Constituency from uk_political_parties.models import Party from elections.models import Election class Person(models.Model): name = models.CharField(blank=False, max_length=255) remote_id = mod...
__unicode__
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|>import unittest import os import os.path import json # The folder holding the test data data_path = os.path.dirname(__file__) # Set the temporal config for testing os.environ['TIMEVIS_CONFIG'] = os.path.join(data_path, 'config.py') import timevis class TestExper...
resp = self.app.get(self.url) self.assertIsNotNone(resp.data)
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|>import unittest import os import os.path import json # The folder holding the test data data_path = os.path.dirname(__file__) # Set the temporal config for testing os.environ['TIMEVIS_CONFIG'] = os.path.join(data_path, 'config.py') import timevis class TestExper...
def setUp(self): self.app = timevis.app.test_client() self.url = '/api/v2/experiment' def test_post(self): name = os.path.join(data_path, 'post_exp.json') with open(name) as file: obj = json.load(file) resp = self.app.post(self.url, data=json.dumps(obj), ...
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|>import unittest import os import os.path import json # The folder holding the test data data_path = os.path.dirname(__file__) # Set the temporal config for testing os.environ['TIMEVIS_CONFIG'] = os.path.join(data_path, 'config.py') import timevis class TestExper...
self.app = timevis.app.test_client() self.url = '/api/v2/experiment'
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|>import unittest import os import os.path import json # The folder holding the test data data_path = os.path.dirname(__file__) # Set the temporal config for testing os.environ['TIMEVIS_CONFIG'] = os.path.join(data_path, 'config.py') import timevis class TestExper...
name = os.path.join(data_path, 'post_exp.json') with open(name) as file: obj = json.load(file) resp = self.app.post(self.url, data=json.dumps(obj), content_type='application/json') self.assertIsNotNone(resp.data)
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|>import unittest import os import os.path import json # The folder holding the test data data_path = os.path.dirname(__file__) # Set the temporal config for testing os.environ['TIMEVIS_CONFIG'] = os.path.join(data_path, 'config.py') import timevis class TestExper...
resp = self.app.get(self.url) self.assertIsNotNone(resp.data)
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|>import unittest import os import os.path import json # The folder holding the test data data_path = os.path.dirname(__file__) # Set the temporal config for testing os.environ['TIMEVIS_CONFIG'] = os.path.join(data_path, 'config.py') import timevis class TestExper...
name = os.path.join(data_path, 'put_exp.json') with open(name) as file: obj = json.load(file) resp = self.app.put(self.url, data=json.dumps(obj), content_type='application/json') self.assertIsNotNone(resp.data)
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|>import unittest import os import os.path import json # The folder holding the test data data_path = os.path.dirname(__file__) # Set the temporal config for testing os.environ['TIMEVIS_CONFIG'] = os.path.join(data_path, 'config.py') import timevis class TestExper...
unittest.main()
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|>import unittest import os import os.path import json # The folder holding the test data data_path = os.path.dirname(__file__) # Set the temporal config for testing os.environ['TIMEVIS_CONFIG'] = os.path.join(data_path, 'config.py') import timevis class TestExper...
setUp
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|>import unittest import os import os.path import json # The folder holding the test data data_path = os.path.dirname(__file__) # Set the temporal config for testing os.environ['TIMEVIS_CONFIG'] = os.path.join(data_path, 'config.py') import timevis class TestExper...
test_post
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|>import unittest import os import os.path import json # The folder holding the test data data_path = os.path.dirname(__file__) # Set the temporal config for testing os.environ['TIMEVIS_CONFIG'] = os.path.join(data_path, 'config.py') import timevis class TestExper...
test_get
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|>import unittest import os import os.path import json # The folder holding the test data data_path = os.path.dirname(__file__) # Set the temporal config for testing os.environ['TIMEVIS_CONFIG'] = os.path.join(data_path, 'config.py') import timevis class TestExper...
test_put
<|file_name|>conf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # # grmpy documentation build configuration file, created by # sphinx-quickstart on Fri Aug 18 13:05:32 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values ...
# -- Options for manual page output ---------------------------------------
<|file_name|>conf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # # grmpy documentation build configuration file, created by # sphinx-quickstart on Fri Aug 18 13:05:32 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values ...
todo_include_todos = False
<|file_name|>conf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # # grmpy documentation build configuration file, created by # sphinx-quickstart on Fri Aug 18 13:05:32 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values ...
todo_include_todos = True
<|file_name|>common.py<|end_file_name|><|fim▁begin|>team_mapping = { "SY": "Sydney", "WB": "Western Bulldogs", "WC": "West Coast", "HW": "Hawthorn", "GE": "Geelong", "FR": "Fremantle", "RI": "Richmond", "CW": "Collingwood", "CA": "Carlton", "GW": "Greater Western Sydney", "AD...
} def get_match_urls(response):
<|file_name|>common.py<|end_file_name|><|fim▁begin|>team_mapping = { "SY": "Sydney", "WB": "Western Bulldogs", "WC": "West Coast", "HW": "Hawthorn", "GE": "Geelong", "FR": "Fremantle", "RI": "Richmond", "CW": "Collingwood", "CA": "Carlton", "GW": "Greater Western Sydney", "AD...
return team_mapping[code]
<|file_name|>common.py<|end_file_name|><|fim▁begin|>team_mapping = { "SY": "Sydney", "WB": "Western Bulldogs", "WC": "West Coast", "HW": "Hawthorn", "GE": "Geelong", "FR": "Fremantle", "RI": "Richmond", "CW": "Collingwood", "CA": "Carlton", "GW": "Greater Western Sydney", "AD...
for code, name in team_mapping.items(): if name == full_name: return code return full_name
<|file_name|>common.py<|end_file_name|><|fim▁begin|>team_mapping = { "SY": "Sydney", "WB": "Western Bulldogs", "WC": "West Coast", "HW": "Hawthorn", "GE": "Geelong", "FR": "Fremantle", "RI": "Richmond", "CW": "Collingwood", "CA": "Carlton", "GW": "Greater Western Sydney", "AD...
match_container = response.xpath("//td[@colspan = '5' and @align = 'center']")[0] match_details = match_container.xpath(".//text()").extract() return { "round": match_details[1], "venue": match_details[3], "date": match_details[6], "attendance": match_details[8], "hom...
<|file_name|>common.py<|end_file_name|><|fim▁begin|>team_mapping = { "SY": "Sydney", "WB": "Western Bulldogs", "WC": "West Coast", "HW": "Hawthorn", "GE": "Geelong", "FR": "Fremantle", "RI": "Richmond", "CW": "Collingwood", "CA": "Carlton", "GW": "Greater Western Sydney", "AD...
for match in response.xpath("//a[contains(@href, 'stats/games/')]/@href").extract(): yield response.urljoin(match)
<|file_name|>common.py<|end_file_name|><|fim▁begin|>team_mapping = { "SY": "Sydney", "WB": "Western Bulldogs", "WC": "West Coast", "HW": "Hawthorn", "GE": "Geelong", "FR": "Fremantle", "RI": "Richmond", "CW": "Collingwood", "CA": "Carlton", "GW": "Greater Western Sydney", "AD...
return code
<|file_name|>common.py<|end_file_name|><|fim▁begin|>team_mapping = { "SY": "Sydney", "WB": "Western Bulldogs", "WC": "West Coast", "HW": "Hawthorn", "GE": "Geelong", "FR": "Fremantle", "RI": "Richmond", "CW": "Collingwood", "CA": "Carlton", "GW": "Greater Western Sydney", "AD...
get_team_name
<|file_name|>common.py<|end_file_name|><|fim▁begin|>team_mapping = { "SY": "Sydney", "WB": "Western Bulldogs", "WC": "West Coast", "HW": "Hawthorn", "GE": "Geelong", "FR": "Fremantle", "RI": "Richmond", "CW": "Collingwood", "CA": "Carlton", "GW": "Greater Western Sydney", "AD...
get_team_code
<|file_name|>common.py<|end_file_name|><|fim▁begin|>team_mapping = { "SY": "Sydney", "WB": "Western Bulldogs", "WC": "West Coast", "HW": "Hawthorn", "GE": "Geelong", "FR": "Fremantle", "RI": "Richmond", "CW": "Collingwood", "CA": "Carlton", "GW": "Greater Western Sydney", "AD...
get_match_description
<|file_name|>common.py<|end_file_name|><|fim▁begin|>team_mapping = { "SY": "Sydney", "WB": "Western Bulldogs", "WC": "West Coast", "HW": "Hawthorn", "GE": "Geelong", "FR": "Fremantle", "RI": "Richmond", "CW": "Collingwood", "CA": "Carlton", "GW": "Greater Western Sydney", "AD...
get_match_urls
<|file_name|>test_engines.py<|end_file_name|><|fim▁begin|>import pytest import salt.engines from tests.support.mock import MagicMock, patch def test_engine_module_name(): engine = salt.engines.Engine({}, "foobar.start", {}, {}, {}, {}, name="foobar") assert engine.name == "foobar" def test_engine_title_set(...
<|file_name|>test_engines.py<|end_file_name|><|fim▁begin|>import pytest import salt.engines from tests.support.mock import MagicMock, patch def test_engine_module_name(): <|fim_middle|> def test_engine_title_set(): engine = salt.engines.Engine({}, "foobar.start", {}, {}, {}, {}, name="foobar") with pat...
engine = salt.engines.Engine({}, "foobar.start", {}, {}, {}, {}, name="foobar") assert engine.name == "foobar"
<|file_name|>test_engines.py<|end_file_name|><|fim▁begin|>import pytest import salt.engines from tests.support.mock import MagicMock, patch def test_engine_module_name(): engine = salt.engines.Engine({}, "foobar.start", {}, {}, {}, {}, name="foobar") assert engine.name == "foobar" def test_engine_title_set(...
engine = salt.engines.Engine({}, "foobar.start", {}, {}, {}, {}, name="foobar") with patch("salt.utils.process.appendproctitle", MagicMock()) as mm: with pytest.raises(KeyError): # The method does not exist so a KeyError will be raised. engine.run() mm.assert_called_with(...
<|file_name|>test_engines.py<|end_file_name|><|fim▁begin|>import pytest import salt.engines from tests.support.mock import MagicMock, patch def <|fim_middle|>(): engine = salt.engines.Engine({}, "foobar.start", {}, {}, {}, {}, name="foobar") assert engine.name == "foobar" def test_engine_title_set(): en...
test_engine_module_name
<|file_name|>test_engines.py<|end_file_name|><|fim▁begin|>import pytest import salt.engines from tests.support.mock import MagicMock, patch def test_engine_module_name(): engine = salt.engines.Engine({}, "foobar.start", {}, {}, {}, {}, name="foobar") assert engine.name == "foobar" def <|fim_middle|>(): ...
test_engine_title_set
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>from unittest import TestCase import pkg_resources from mock import patch from click import UsageError from click.testing import CliRunner class TestCli(TestCase): @patch('molo.core.cookiecutter.cookiecutter') def test_scaffold(self, mock_cookiecutter):...
package = pkg_resources.get_distribution('molo.core')
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>from unittest import TestCase import pkg_resources from mock import patch from click import UsageError from click.testing import CliRunner class TestCli(TestCase): <|fim_middle|> <|fim▁end|>
@patch('molo.core.cookiecutter.cookiecutter') def test_scaffold(self, mock_cookiecutter): from molo.core.scripts import cli package = pkg_resources.get_distribution('molo.core') runner = CliRunner() runner.invoke(cli.scaffold, ['foo']) [call] = mock_cookiecutter.call_arg...
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>from unittest import TestCase import pkg_resources from mock import patch from click import UsageError from click.testing import CliRunner class TestCli(TestCase): @patch('molo.core.cookiecutter.cookiecutter') def test_scaffold(self, mock_cookiecutter):...
from molo.core.scripts import cli package = pkg_resources.get_distribution('molo.core') runner = CliRunner() runner.invoke(cli.scaffold, ['foo']) [call] = mock_cookiecutter.call_args_list args, kwargs = call self.assertTrue(kwargs['extra_context'].pop('secret_key...
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>from unittest import TestCase import pkg_resources from mock import patch from click import UsageError from click.testing import CliRunner class TestCli(TestCase): @patch('molo.core.cookiecutter.cookiecutter') def test_scaffold(self, mock_cookiecutter):...
from molo.core.scripts import cli package = pkg_resources.get_distribution('molo.core') runner = CliRunner() runner.invoke(cli.scaffold, ['foo', 'bar']) [call] = mock_cookiecutter.call_args_list args, kwargs = call self.assertTrue(kwargs['extra_context'].pop('sec...
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>from unittest import TestCase import pkg_resources from mock import patch from click import UsageError from click.testing import CliRunner class TestCli(TestCase): @patch('molo.core.cookiecutter.cookiecutter') def test_scaffold(self, mock_cookiecutter):...
from molo.core.scripts import cli package = pkg_resources.get_distribution('molo.core') runner = CliRunner() runner.invoke(cli.scaffold, ['foo', '--require', 'bar']) [call] = mock_cookiecutter.call_args_list args, kwargs = call self.assertTrue(kwargs['extra_conte...
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>from unittest import TestCase import pkg_resources from mock import patch from click import UsageError from click.testing import CliRunner class TestCli(TestCase): @patch('molo.core.cookiecutter.cookiecutter') def test_scaffold(self, mock_cookiecutter):...
from molo.core.scripts import cli package = pkg_resources.get_distribution('molo.core') runner = CliRunner() runner.invoke(cli.scaffold, ['foo', '--include', 'bar', 'baz']) [call] = mock_cookiecutter.call_args_list args, kwargs = call self.assertTrue(kwargs['extr...
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>from unittest import TestCase import pkg_resources from mock import patch from click import UsageError from click.testing import CliRunner class TestCli(TestCase): @patch('molo.core.cookiecutter.cookiecutter') def test_scaffold(self, mock_cookiecutter):...
package = pkg_resources.get_distribution('molo.core') mock_get_package.return_value = package mock_get_template_dirs.return_value = ['foo'] mock_copytree.return_value = True from molo.core.scripts import cli runner = CliRunner() runner.invoke(cli.unpack_templates...
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>from unittest import TestCase import pkg_resources from mock import patch from click import UsageError from click.testing import CliRunner class TestCli(TestCase): @patch('molo.core.cookiecutter.cookiecutter') def test_scaffold(self, mock_cookiecutter):...
from molo.core.scripts.cli import get_package self.assertRaisesRegexp( UsageError, 'molo.foo is not installed.', get_package, 'molo.foo')
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>from unittest import TestCase import pkg_resources from mock import patch from click import UsageError from click.testing import CliRunner class TestCli(TestCase): @patch('molo.core.cookiecutter.cookiecutter') def <|fim_middle|>(self, mock_cookiecutter)...
test_scaffold
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>from unittest import TestCase import pkg_resources from mock import patch from click import UsageError from click.testing import CliRunner class TestCli(TestCase): @patch('molo.core.cookiecutter.cookiecutter') def test_scaffold(self, mock_cookiecutter):...
test_scaffold_with_custom_dir
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>from unittest import TestCase import pkg_resources from mock import patch from click import UsageError from click.testing import CliRunner class TestCli(TestCase): @patch('molo.core.cookiecutter.cookiecutter') def test_scaffold(self, mock_cookiecutter):...
test_scaffold_with_requirements
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>from unittest import TestCase import pkg_resources from mock import patch from click import UsageError from click.testing import CliRunner class TestCli(TestCase): @patch('molo.core.cookiecutter.cookiecutter') def test_scaffold(self, mock_cookiecutter):...
test_scaffold_with_includes
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>from unittest import TestCase import pkg_resources from mock import patch from click import UsageError from click.testing import CliRunner class TestCli(TestCase): @patch('molo.core.cookiecutter.cookiecutter') def test_scaffold(self, mock_cookiecutter):...
test_unpack
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>from unittest import TestCase import pkg_resources from mock import patch from click import UsageError from click.testing import CliRunner class TestCli(TestCase): @patch('molo.core.cookiecutter.cookiecutter') def test_scaffold(self, mock_cookiecutter):...
test_get_package
<|file_name|>possible_browser.py<|end_file_name|><|fim▁begin|># Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.internal.app import possible_app class PossibleBrowser(possible_app.PossibleAp...
"""A browser that can be controlled.
<|file_name|>possible_browser.py<|end_file_name|><|fim▁begin|># Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.internal.app import possible_app class PossibleBrowser(possible_app.PossibleAp...
"""A browser that can be controlled. Call Create() to launch the browser and begin manipulating it.. """ def __init__(self, browser_type, target_os, supports_tab_control): super(PossibleBrowser, self).__init__(app_type=browser_type, target_os=target_os) self._...
<|file_name|>possible_browser.py<|end_file_name|><|fim▁begin|># Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.internal.app import possible_app class PossibleBrowser(possible_app.PossibleAp...
super(PossibleBrowser, self).__init__(app_type=browser_type, target_os=target_os) self._supports_tab_control = supports_tab_control self._credentials_path = None
<|file_name|>possible_browser.py<|end_file_name|><|fim▁begin|># Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.internal.app import possible_app class PossibleBrowser(possible_app.PossibleAp...
return 'PossibleBrowser(app_type=%s)' % self.app_type
<|file_name|>possible_browser.py<|end_file_name|><|fim▁begin|># Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.internal.app import possible_app class PossibleBrowser(possible_app.PossibleAp...
return self.app_type
<|file_name|>possible_browser.py<|end_file_name|><|fim▁begin|># Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.internal.app import possible_app class PossibleBrowser(possible_app.PossibleAp...
return self._supports_tab_control
<|file_name|>possible_browser.py<|end_file_name|><|fim▁begin|># Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.internal.app import possible_app class PossibleBrowser(possible_app.PossibleAp...
raise NotImplementedError()
<|file_name|>possible_browser.py<|end_file_name|><|fim▁begin|># Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.internal.app import possible_app class PossibleBrowser(possible_app.PossibleAp...
raise NotImplementedError()
<|file_name|>possible_browser.py<|end_file_name|><|fim▁begin|># Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.internal.app import possible_app class PossibleBrowser(possible_app.PossibleAp...
"""Tests for extension support.""" raise NotImplementedError()
<|file_name|>possible_browser.py<|end_file_name|><|fim▁begin|># Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.internal.app import possible_app class PossibleBrowser(possible_app.PossibleAp...
return False
<|file_name|>possible_browser.py<|end_file_name|><|fim▁begin|># Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.internal.app import possible_app class PossibleBrowser(possible_app.PossibleAp...
pass
<|file_name|>possible_browser.py<|end_file_name|><|fim▁begin|># Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.internal.app import possible_app class PossibleBrowser(possible_app.PossibleAp...
pass
<|file_name|>possible_browser.py<|end_file_name|><|fim▁begin|># Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.internal.app import possible_app class PossibleBrowser(possible_app.PossibleAp...
return -1
<|file_name|>possible_browser.py<|end_file_name|><|fim▁begin|># Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.internal.app import possible_app class PossibleBrowser(possible_app.PossibleAp...
self._credentials_path = credentials_path
<|file_name|>possible_browser.py<|end_file_name|><|fim▁begin|># Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.internal.app import possible_app class PossibleBrowser(possible_app.PossibleAp...
__init__
<|file_name|>possible_browser.py<|end_file_name|><|fim▁begin|># Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.internal.app import possible_app class PossibleBrowser(possible_app.PossibleAp...
__repr__
<|file_name|>possible_browser.py<|end_file_name|><|fim▁begin|># Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.internal.app import possible_app class PossibleBrowser(possible_app.PossibleAp...
browser_type
<|file_name|>possible_browser.py<|end_file_name|><|fim▁begin|># Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.internal.app import possible_app class PossibleBrowser(possible_app.PossibleAp...
supports_tab_control
<|file_name|>possible_browser.py<|end_file_name|><|fim▁begin|># Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.internal.app import possible_app class PossibleBrowser(possible_app.PossibleAp...
_InitPlatformIfNeeded
<|file_name|>possible_browser.py<|end_file_name|><|fim▁begin|># Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.internal.app import possible_app class PossibleBrowser(possible_app.PossibleAp...
Create
<|file_name|>possible_browser.py<|end_file_name|><|fim▁begin|># Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.internal.app import possible_app class PossibleBrowser(possible_app.PossibleAp...
SupportsOptions
<|file_name|>possible_browser.py<|end_file_name|><|fim▁begin|># Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.internal.app import possible_app class PossibleBrowser(possible_app.PossibleAp...
IsRemote
<|file_name|>possible_browser.py<|end_file_name|><|fim▁begin|># Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.internal.app import possible_app class PossibleBrowser(possible_app.PossibleAp...
RunRemote
<|file_name|>possible_browser.py<|end_file_name|><|fim▁begin|># Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.internal.app import possible_app class PossibleBrowser(possible_app.PossibleAp...
UpdateExecutableIfNeeded
<|file_name|>possible_browser.py<|end_file_name|><|fim▁begin|># Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.internal.app import possible_app class PossibleBrowser(possible_app.PossibleAp...
last_modification_time
<|file_name|>possible_browser.py<|end_file_name|><|fim▁begin|># Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.internal.app import possible_app class PossibleBrowser(possible_app.PossibleAp...
SetCredentialsPath
<|file_name|>class_diagrams.py<|end_file_name|><|fim▁begin|>r""" Create MapServer class diagrams Requires https://graphviz.gitlab.io/_pages/Download/Download_windows.html https://stackoverflow.com/questions/1494492/graphviz-how-to-go-from-dot-to-a-graph For DOT languge see http://www.graphviz.org/doc/info/attrs.html ...
'METADATA': {},
<|file_name|>class_diagrams.py<|end_file_name|><|fim▁begin|>r""" Create MapServer class diagrams Requires https://graphviz.gitlab.io/_pages/Download/Download_windows.html https://stackoverflow.com/questions/1494492/graphviz-how-to-go-from-dot-to-a-graph For DOT languge see http://www.graphviz.org/doc/info/attrs.html ...
os.environ['PATH'] = gviz_path + ";" + os.environ['PATH']
<|file_name|>class_diagrams.py<|end_file_name|><|fim▁begin|>r""" Create MapServer class diagrams Requires https://graphviz.gitlab.io/_pages/Download/Download_windows.html https://stackoverflow.com/questions/1494492/graphviz-how-to-go-from-dot-to-a-graph For DOT languge see http://www.graphviz.org/doc/info/attrs.html ...
""" http://www.graphviz.org/doc/info/shapes.html#polygon """ node = pydot.Node(child_id, style="filled", fillcolor=colour, label=child_label, shape="polygon", fontname=FONT) graph.add_node(node) graph.add_edge(pydot.Edge(parent_id, node))
<|file_name|>class_diagrams.py<|end_file_name|><|fim▁begin|>r""" Create MapServer class diagrams Requires https://graphviz.gitlab.io/_pages/Download/Download_windows.html https://stackoverflow.com/questions/1494492/graphviz-how-to-go-from-dot-to-a-graph For DOT languge see http://www.graphviz.org/doc/info/attrs.html ...
blue = "#6b6bd1" white = "#fdfefd" green = "#33a333" colours = [blue, white, green] * 3 for class_, children in d.items(): colour = colours[level] child_label = class_ child_id = parent_id + "_" + class_ add_child(graph, child_id, child_label, parent_id, colour) ...
<|file_name|>class_diagrams.py<|end_file_name|><|fim▁begin|>r""" Create MapServer class diagrams Requires https://graphviz.gitlab.io/_pages/Download/Download_windows.html https://stackoverflow.com/questions/1494492/graphviz-how-to-go-from-dot-to-a-graph For DOT languge see http://www.graphviz.org/doc/info/attrs.html ...
filename = "%s.png" % fn graph.write_png(filename) graph.write("%s.dot" % fn) os.startfile(filename)
<|file_name|>class_diagrams.py<|end_file_name|><|fim▁begin|>r""" Create MapServer class diagrams Requires https://graphviz.gitlab.io/_pages/Download/Download_windows.html https://stackoverflow.com/questions/1494492/graphviz-how-to-go-from-dot-to-a-graph For DOT languge see http://www.graphviz.org/doc/info/attrs.html ...
graphviz_setup(gviz_path) graph = pydot.Dot(graph_type='digraph', rankdir="TB") layer_children = { 'CLASS': { 'LABEL': {'STYLE': {}}, 'CONNECTIONOPTIONS': {}, 'LEADER': {'STYLE': {}}, 'STYLE': {}, 'VALIDATION': {} ...
<|file_name|>class_diagrams.py<|end_file_name|><|fim▁begin|>r""" Create MapServer class diagrams Requires https://graphviz.gitlab.io/_pages/Download/Download_windows.html https://stackoverflow.com/questions/1494492/graphviz-how-to-go-from-dot-to-a-graph For DOT languge see http://www.graphviz.org/doc/info/attrs.html ...
root = "LAYER" classes = classes["MAP"] fn = "layer_classes"
<|file_name|>class_diagrams.py<|end_file_name|><|fim▁begin|>r""" Create MapServer class diagrams Requires https://graphviz.gitlab.io/_pages/Download/Download_windows.html https://stackoverflow.com/questions/1494492/graphviz-how-to-go-from-dot-to-a-graph For DOT languge see http://www.graphviz.org/doc/info/attrs.html ...
fn = "map_classes" root, = classes.keys()
<|file_name|>class_diagrams.py<|end_file_name|><|fim▁begin|>r""" Create MapServer class diagrams Requires https://graphviz.gitlab.io/_pages/Download/Download_windows.html https://stackoverflow.com/questions/1494492/graphviz-how-to-go-from-dot-to-a-graph For DOT languge see http://www.graphviz.org/doc/info/attrs.html ...
gviz_path = r"C:\Program Files (x86)\Graphviz2.38\bin" main(gviz_path, True) main(gviz_path, False) print("Done!")
<|file_name|>class_diagrams.py<|end_file_name|><|fim▁begin|>r""" Create MapServer class diagrams Requires https://graphviz.gitlab.io/_pages/Download/Download_windows.html https://stackoverflow.com/questions/1494492/graphviz-how-to-go-from-dot-to-a-graph For DOT languge see http://www.graphviz.org/doc/info/attrs.html ...
graphviz_setup
<|file_name|>class_diagrams.py<|end_file_name|><|fim▁begin|>r""" Create MapServer class diagrams Requires https://graphviz.gitlab.io/_pages/Download/Download_windows.html https://stackoverflow.com/questions/1494492/graphviz-how-to-go-from-dot-to-a-graph For DOT languge see http://www.graphviz.org/doc/info/attrs.html ...
add_child
<|file_name|>class_diagrams.py<|end_file_name|><|fim▁begin|>r""" Create MapServer class diagrams Requires https://graphviz.gitlab.io/_pages/Download/Download_windows.html https://stackoverflow.com/questions/1494492/graphviz-how-to-go-from-dot-to-a-graph For DOT languge see http://www.graphviz.org/doc/info/attrs.html ...
add_children
<|file_name|>class_diagrams.py<|end_file_name|><|fim▁begin|>r""" Create MapServer class diagrams Requires https://graphviz.gitlab.io/_pages/Download/Download_windows.html https://stackoverflow.com/questions/1494492/graphviz-how-to-go-from-dot-to-a-graph For DOT languge see http://www.graphviz.org/doc/info/attrs.html ...
save_file
<|file_name|>class_diagrams.py<|end_file_name|><|fim▁begin|>r""" Create MapServer class diagrams Requires https://graphviz.gitlab.io/_pages/Download/Download_windows.html https://stackoverflow.com/questions/1494492/graphviz-how-to-go-from-dot-to-a-graph For DOT languge see http://www.graphviz.org/doc/info/attrs.html ...
main
<|file_name|>validator.py<|end_file_name|><|fim▁begin|>import socket import re from xii import error, util # sample validator # keys = Dict( # [ # RequiredKey("foo", String(), desc="A string to manipulate something"), # Key("bar", String(), desc="something usefull") # ], # desc="Implement...
def structure(self, accessor): return [self.schema.structure(accessor)]
<|file_name|>validator.py<|end_file_name|><|fim▁begin|>import socket import re from xii import error, util # sample validator # keys = Dict( # [ # RequiredKey("foo", String(), desc="A string to manipulate something"), # Key("bar", String(), desc="something usefull") # ], # desc="Implement...
def __init__(self, example=None, description=None): self._description = description self._example = example def structure(self, accessor): if accessor == "example": return self._example return self._description
<|file_name|>validator.py<|end_file_name|><|fim▁begin|>import socket import re from xii import error, util # sample validator # keys = Dict( # [ # RequiredKey("foo", String(), desc="A string to manipulate something"), # Key("bar", String(), desc="something usefull") # ], # desc="Implement...
self._description = description self._example = example
<|file_name|>validator.py<|end_file_name|><|fim▁begin|>import socket import re from xii import error, util # sample validator # keys = Dict( # [ # RequiredKey("foo", String(), desc="A string to manipulate something"), # Key("bar", String(), desc="something usefull") # ], # desc="Implement...
if accessor == "example": return self._example return self._description
<|file_name|>validator.py<|end_file_name|><|fim▁begin|>import socket import re from xii import error, util # sample validator # keys = Dict( # [ # RequiredKey("foo", String(), desc="A string to manipulate something"), # Key("bar", String(), desc="something usefull") # ], # desc="Implement...
want_type = None want = "none" def __init__(self, example, desc=None): if desc is None: desc = self.want Validator.__init__(self, example, desc) def validate(self, pre, structure): if isinstance(structure, self.want_type): return True raise error...
<|file_name|>validator.py<|end_file_name|><|fim▁begin|>import socket import re from xii import error, util # sample validator # keys = Dict( # [ # RequiredKey("foo", String(), desc="A string to manipulate something"), # Key("bar", String(), desc="something usefull") # ], # desc="Implement...
if desc is None: desc = self.want Validator.__init__(self, example, desc)
<|file_name|>validator.py<|end_file_name|><|fim▁begin|>import socket import re from xii import error, util # sample validator # keys = Dict( # [ # RequiredKey("foo", String(), desc="A string to manipulate something"), # Key("bar", String(), desc="something usefull") # ], # desc="Implement...
if isinstance(structure, self.want_type): return True raise error.ValidatorError("{} needs to be {}".format(pre, self.want)) return False
<|file_name|>validator.py<|end_file_name|><|fim▁begin|>import socket import re from xii import error, util # sample validator # keys = Dict( # [ # RequiredKey("foo", String(), desc="A string to manipulate something"), # Key("bar", String(), desc="something usefull") # ], # desc="Implement...
want = "int" want_type = int