rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
lambda self, selectors: self.assertEqual( selectors.test_run.attachments, {}), lambda self, selectors: self.assertEqual( selectors.test_run.sw_context, None), lambda self, selectors: self.assertEqual( selectors.test_run.hw_context, None), ] }), ('analyzer_assigned_uuid_is_parsed_as_uuid', { 'json_text': """ { "test_run... | def test_deserialize_clears_old_error_on_success(self): BundleDeserializationError.objects.create( bundle = self.bundle, error_message="not important").save() mock = self.mocker.patch(self.bundle) expect(mock._do_deserialize()) self.mocker.replay() self.bundle.deserialize() # note we cannot check for self.bundle.deseri... | 957b0eab837f40bbe8180ecadeffedaf82ab9311 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/957b0eab837f40bbe8180ecadeffedaf82ab9311/tests.py | |
] }), ('analyzer_assigned_date_is_parsed_as_datetime', { 'json_text': """ { "test_runs": [{ "analyzer_assigned_date": "2010-12-31T23:59:59Z" }] } """, 'selectors': { 'test_run': lambda bundle: bundle.test_runs[0] }, 'validators': [ lambda self, selectors: self.assertEqual( | lambda self, selectors: self.assertEqual( | def test_deserialize_clears_old_error_on_success(self): BundleDeserializationError.objects.create( bundle = self.bundle, error_message="not important").save() mock = self.mocker.patch(self.bundle) expect(mock._do_deserialize()) self.mocker.replay() self.bundle.deserialize() # note we cannot check for self.bundle.deseri... | 957b0eab837f40bbe8180ecadeffedaf82ab9311 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/957b0eab837f40bbe8180ecadeffedaf82ab9311/tests.py |
] | lambda self, selectors: self.assertEqual( selectors.test_run.time_check_performed, False), lambda self, selectors: self.assertEqual( selectors.test_run.attributes, {}), lambda self, selectors: self.assertEqual( selectors.test_run.attachments, {}), lambda self, selectors: self.assertEqual( selectors.test_run.sw_context,... | def test_deserialize_clears_old_error_on_success(self): BundleDeserializationError.objects.create( bundle = self.bundle, error_message="not important").save() mock = self.mocker.patch(self.bundle) expect(mock._do_deserialize()) self.mocker.replay() self.bundle.deserialize() # note we cannot check for self.bundle.deseri... | 957b0eab837f40bbe8180ecadeffedaf82ab9311 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/957b0eab837f40bbe8180ecadeffedaf82ab9311/tests.py |
('software_context_defaults', { | ('software_context_parsing', { | def test_deserialize_clears_old_error_on_success(self): BundleDeserializationError.objects.create( bundle = self.bundle, error_message="not important").save() mock = self.mocker.patch(self.bundle) expect(mock._do_deserialize()) self.mocker.replay() self.bundle.deserialize() # note we cannot check for self.bundle.deseri... | 957b0eab837f40bbe8180ecadeffedaf82ab9311 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/957b0eab837f40bbe8180ecadeffedaf82ab9311/tests.py |
"test_id": "some_test", | """ + _TEST_RUN_BOILERPLATE + """ | def test_deserialize_clears_old_error_on_success(self): BundleDeserializationError.objects.create( bundle = self.bundle, error_message="not important").save() mock = self.mocker.patch(self.bundle) expect(mock._do_deserialize()) self.mocker.replay() self.bundle.deserialize() # note we cannot check for self.bundle.deseri... | 957b0eab837f40bbe8180ecadeffedaf82ab9311 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/957b0eab837f40bbe8180ecadeffedaf82ab9311/tests.py |
"test_id": "some_test", | """ + _TEST_RUN_BOILERPLATE + """ | def test_deserialize_clears_old_error_on_success(self): BundleDeserializationError.objects.create( bundle = self.bundle, error_message="not important").save() mock = self.mocker.patch(self.bundle) expect(mock._do_deserialize()) self.mocker.replay() self.bundle.deserialize() # note we cannot check for self.bundle.deseri... | 957b0eab837f40bbe8180ecadeffedaf82ab9311 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/957b0eab837f40bbe8180ecadeffedaf82ab9311/tests.py |
def dispatch(self): args = self.parser.parse_args() | def dispatch(self, args=None): args = self.parser.parse_args(args) | def dispatch(self): args = self.parser.parse_args() command = args.command_cls(self.parser, args) command.invoke(args) | 220841f93939dc287a2b4bb3e47ee62529ae6841 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/220841f93939dc287a2b4bb3e47ee62529ae6841/dispatcher.py |
users = set() groups = set() | def created_bundle_streams(spec): """ Helper context manager that creates bundle streams according to specification spec is a list of dictionaries with the following keys: user: string indicating user name to create [optional] group: string indicating group name to create [optional] slug: slug-like name [optional] nam... | 1bf7e9c81a8c80c89f5085e57e6b33bd3c945f22 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/1bf7e9c81a8c80c89f5085e57e6b33bd3c945f22/fixtures.py | |
users.add(user) | def created_bundle_streams(spec): """ Helper context manager that creates bundle streams according to specification spec is a list of dictionaries with the following keys: user: string indicating user name to create [optional] group: string indicating group name to create [optional] slug: slug-like name [optional] nam... | 1bf7e9c81a8c80c89f5085e57e6b33bd3c945f22 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/1bf7e9c81a8c80c89f5085e57e6b33bd3c945f22/fixtures.py | |
groups.add(group) | def created_bundle_streams(spec): """ Helper context manager that creates bundle streams according to specification spec is a list of dictionaries with the following keys: user: string indicating user name to create [optional] group: string indicating group name to create [optional] slug: slug-like name [optional] nam... | 1bf7e9c81a8c80c89f5085e57e6b33bd3c945f22 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/1bf7e9c81a8c80c89f5085e57e6b33bd3c945f22/fixtures.py | |
for bundle_stream in bundle_streams: bundle_stream.delete() for user in users: user.delete() for group in groups: group.delete() | def created_bundle_streams(spec): """ Helper context manager that creates bundle streams according to specification spec is a list of dictionaries with the following keys: user: string indicating user name to create [optional] group: string indicating group name to create [optional] slug: slug-like name [optional] nam... | 1bf7e9c81a8c80c89f5085e57e6b33bd3c945f22 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/1bf7e9c81a8c80c89f5085e57e6b33bd3c945f22/fixtures.py | |
{'test_runs': [TestRuns]}) | {'test_runs': [TestRun]}) | def test_get_json_attr_types(self): self.assertEqual(DashboardBundle.get_json_attr_types(), {'test_runs': [TestRuns]}) | 70a9b009a7f3dcc48a315235c99fe73f28661897 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/70a9b009a7f3dcc48a315235c99fe73f28661897/test_dashboard_bundle_format_1_0.py |
netloc = "%s:%s@%s:%d" % ( | netloc = "%s:%s@%s" % ( | def __init__(self, parser, args): super(XMLRPCCommand, self).__init__(parser, args) parts = urlparse.urlsplit(args.dashboard_url) if args.username and args.password: netloc = "%s:%s@%s:%d" % ( args.username, args.password, parts.host, parts.port or 80) else: netloc = parts.netloc urltext = urlparse.urlunsplit((parts.sc... | 00c8102ce944cac7073ef110d09be4e395cbd9dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/00c8102ce944cac7073ef110d09be4e395cbd9dd/dashboard.py |
parts.host, parts.port or 80) | parts.netloc) | def __init__(self, parser, args): super(XMLRPCCommand, self).__init__(parser, args) parts = urlparse.urlsplit(args.dashboard_url) if args.username and args.password: netloc = "%s:%s@%s:%d" % ( args.username, args.password, parts.host, parts.port or 80) else: netloc = parts.netloc urltext = urlparse.urlunsplit((parts.sc... | 00c8102ce944cac7073ef110d09be4e395cbd9dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/00c8102ce944cac7073ef110d09be4e395cbd9dd/dashboard.py |
to_hide = set(self._hook.prohibited) | to_hide = set() | def mock_imports(self, reload_list=None): """ Make prohibit_importing() work by hiding and importing again all the modules that depended on an imported prohibited module. | 854aa352aa94714be03ae862468be5ade10e2279 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/854aa352aa94714be03ae862468be5ade10e2279/import_prohibitor.py |
print cleaned_data | def clean(self): cleaned_data = self.cleaned_data print cleaned_data if (cleaned_data.get('user', '') is not None and cleaned_data.get('group') is not None): raise forms.ValidationError('BundleStream cannot have both user ' 'and name set at the same time') return super(BundleStreamAdminForm, self).clean() | f7e475811b297ced783f48f128b2a940a894ba6d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/f7e475811b297ced783f48f128b2a940a894ba6d/admin.py | |
group.add_argument("--dashboard-url", required=True, | group.add_argument("--dashboard-url", required=True, | def register_arguments(cls, parser): group = parser.add_argument_group("Dashboard Server options") group.add_argument("--dashboard-url", required=True, metavar="URL", help="URL of your validation dashboard") group.add_argument("--verbose-xml-rpc", action="store_true", default=False, help="Show XML-RPC data") | 91706d3d61a8015f21b525218503e0a2797ec77b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/91706d3d61a8015f21b525218503e0a2797ec77b/dashboard.py |
this sample. The quantity describes a value of certain type. See the units property to know more. Measurement can be None on failed tests only. >>> sample = QuantitativeSample('test-id', None, ... test_result='fail') >>> sample.measurement is None True We expect to have some value if the test was carried out corr... | a test result. The quantity describes a value of certain type. See the units property to know more. Measurement must be a number. Either int, long, float or Decimal: >>> result = TestResult('some-test', 'unknown') >>> result.measurement = 10 >>> result.measurement = 10L >>> result.measurement = 10.0 >>> result.measure... | def _set_measurement(self, value): valid_types = (int, long, float, Decimal, NoneType) if not isinstance(value, valid_types): raise TypeError("Measurement must be an int, long, float, Decimal or None") self._measurement = value | 9b6bbb4a99f01adb7c31b0f16a5fedafbfa9f7c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/9b6bbb4a99f01adb7c31b0f16a5fedafbfa9f7c3/test_result.py |
>>> sample.measurement = "great" Traceback (most recent call last): ... TypeError: Measurement must be an int, long or float | >>> result.measurement = "great" Traceback (most recent call last): ... TypeError: Measurement must be an int, long, float, Decimal or None | def _set_measurement(self, value): valid_types = (int, long, float, Decimal, NoneType) if not isinstance(value, valid_types): raise TypeError("Measurement must be an int, long, float, Decimal or None") self._measurement = value | 9b6bbb4a99f01adb7c31b0f16a5fedafbfa9f7c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/9b6bbb4a99f01adb7c31b0f16a5fedafbfa9f7c3/test_result.py |
>>> sample = QualitativeSample('fail') | >>> sample = TestResult('some-test-case', 'fail') | def _set_duration(self, duration): if duration is not None and not isinstance(duration, timedelta): raise TypeError("Duration must be None or timedelta " "instance") if duration is not None and duration.days < 0: raise ValueError("Duration cannot be negative") self._duration = duration | 9b6bbb4a99f01adb7c31b0f16a5fedafbfa9f7c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/9b6bbb4a99f01adb7c31b0f16a5fedafbfa9f7c3/test_result.py |
def test_get_help_defaults_to_None(self): class mysterious(Command): pass self.assertEqual(mysterious.get_help(), None) | 76497e21cd31cd5aa5eb6c9f468d74a50f49917e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/76497e21cd31cd5aa5eb6c9f468d74a50f49917e/test_commands.py | ||
class BundleStreamDetailViewAuthenticatedTest(TestCase): | class BundleStreamDetailViewAuthorizedTest(BundleStreamDetailViewAnonymousTest): | def test_template_used(self): response = self.client.get("/streams" + self.bundle_stream.pathname) if self.bundle_stream.can_access(self.user): self.assertTemplateUsed(response, "dashboard_app/bundle_stream_detail.html") else: self.assertTemplateUsed(response, "403.html") | 4629496fb811f352fcd93b1a7fea39acfb2e7767 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/4629496fb811f352fcd93b1a7fea39acfb2e7767/tests.py |
specification | specification. | def created_bundle_streams(spec): """ Helper context manager that creates bundle streams according to specification spec is a list of dictionaries with the following keys: user: string indicating user name to create [optional] group: string indicating group name to create [optional] slug: slug-like name [optional] nam... | ece5425653c15633b07f0df486f6fdfe2bdbef33 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/ece5425653c15633b07f0df486f6fdfe2bdbef33/fixtures.py |
spec is a list of dictionaries with the following keys: user: string indicating user name to create [optional] group: string indicating group name to create [optional] slug: slug-like name [optional] name: name of the stream to create [optional] | `spec`: list of dictionaries List of values to make_bundle_stream() | def created_bundle_streams(spec): """ Helper context manager that creates bundle streams according to specification spec is a list of dictionaries with the following keys: user: string indicating user name to create [optional] group: string indicating group name to create [optional] slug: slug-like name [optional] nam... | ece5425653c15633b07f0df486f6fdfe2bdbef33 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/ece5425653c15633b07f0df486f6fdfe2bdbef33/fixtures.py |
yields: list of created bundle streams | yields: list of BundleStream List of created bundle stream objects | def created_bundle_streams(spec): """ Helper context manager that creates bundle streams according to specification spec is a list of dictionaries with the following keys: user: string indicating user name to create [optional] group: string indicating group name to create [optional] slug: slug-like name [optional] nam... | ece5425653c15633b07f0df486f6fdfe2bdbef33 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/ece5425653c15633b07f0df486f6fdfe2bdbef33/fixtures.py |
initargs = { 'user': None, 'group': None, 'slug': stream_args.get('slug', ''), 'name': stream_args.get('name', '')} username = stream_args.get('user') if username: user = User.objects.get_or_create(username=username)[0] initargs['user'] = user groupname = stream_args.get('group') if groupname: group = Group.objects.get... | bundle_streams.append(make_bundle_stream(stream_args)) | def created_bundle_streams(spec): """ Helper context manager that creates bundle streams according to specification spec is a list of dictionaries with the following keys: user: string indicating user name to create [optional] group: string indicating group name to create [optional] slug: slug-like name [optional] nam... | ece5425653c15633b07f0df486f6fdfe2bdbef33 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/ece5425653c15633b07f0df486f6fdfe2bdbef33/fixtures.py |
if self.deserialization_error.exists(): | if self.deserialization_error.count(): | def deserialize(self): """ Deserialize the contents of this bundle. | 0d264d0c952ecd84fdd28f5d41b54cc75dee1d8b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/0d264d0c952ecd84fdd28f5d41b54cc75dee1d8b/models.py |
... def _deserialize(cls, doc): | b0b93f243207431f5cbba46dce144b5f2515c30d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/b0b93f243207431f5cbba46dce144b5f2515c30d/utils_json.py | ||
def __eq__(self, other): return self.name == other.name and \ debian_version_compare(self.version, other.version) == 0 def __lt__(self, other): return self.name < other.name or ( self.name == other.name and debian_version_compare(self.version, other.version) < 0) | def __cmp__(self, other): result = cmp(self.name, other.name) if result != 0: return result return debian_version_compare(self.version, other.version) | def __eq__(self, other): return self.name == other.name and \ debian_version_compare(self.version, other.version) == 0 | 6ac5c044beb0e7086f20e7cfbd408b9b3fda2632 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/6ac5c044beb0e7086f20e7cfbd408b9b3fda2632/sw_profile.py |
self.args.BUNDLE_ID, filename) | self.args.SHA1, filename) | def invoke_remote(self): response = self.server.get(self.args.SHA1) if self.args.output is None: filename = response['content_filename'] if os.path.exists(filename) and not self.args.overwrite: print "File {filename!r} already exists".format( filename=filename) print "You may pass --overwrite to write over it" return s... | 1bdf6d97e4ffa0c93b962fc82b4a08377f417a27 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/1bdf6d97e4ffa0c93b962fc82b4a08377f417a27/dashboard.py |
QuantitativeSample Qualitative Sample class. Used to represent results for benchmarks. | Quantitative Sample class. Used to represent results for benchmarks. | def __init__(self, test_result, test_id=None, message=None, timestamp=None, duration=None): """ Initialize qualitative sample instance. | 05fb9c903ee64c235177b26789f632712a0aa717 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/05fb9c903ee64c235177b26789f632712a0aa717/sample.py |
self.prohibit_importing('debian.debian_support') self.mock_imports('launch_control.sw_profile') mocker = Mocker() obj = mocker.replace('debian_bundle.debian_support.version_compare') mocker.replay() import launch_control.sw_profile self.assertTrue(launch_control.sw_profile.debian_version_compare is obj) mocker.verify()... | try: import debian except ImportError: pass else: self.prohibit_importing('debian.debian_support') self.mock_imports('launch_control.sw_profile') mocker = Mocker() obj = mocker.replace('debian_bundle.debian_support.version_compare') mocker.replay() import launch_control.sw_profile self.assertTrue(launch_control.sw_prof... | def test_debian_import_failure(self): """ Make sure we import debian_bundle if debian is not available """ self.prohibit_importing('debian.debian_support') self.mock_imports('launch_control.sw_profile') mocker = Mocker() obj = mocker.replace('debian_bundle.debian_support.version_compare') mocker.replay() import launch_... | dca9f2f5f76d60bccbb7c30194b7d789cf436e20 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/dca9f2f5f76d60bccbb7c30194b7d789cf436e20/sw_profile.py |
""" Log file name. """) | "Log file name") | def _set_log_filename(self, log_filename): self._log_filename = log_filename | 217d12136ccc1d46d76fbe600da287bfa7ff002b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/217d12136ccc1d46d76fbe600da287bfa7ff002b/test_result.py |
""" Log file name. """) | "Log file line number") | def _set_log_lineno(self, log_lineno): self._log_lineno = log_lineno | 217d12136ccc1d46d76fbe600da287bfa7ff002b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/217d12136ccc1d46d76fbe600da287bfa7ff002b/test_result.py |
bundle.deserialization_error.error_message) | bundle.deserialization_error.get().error_message) | def deserialize(self, content_sha1): """ Name ---- `deserialize` (`content_sha1`) | c8c3b4e439633e01c00ee4757bfd775558afc861 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/c8c3b4e439633e01c00ee4757bfd775558afc861/xmlrpc.py |
analyzer_assigned_uuid = c_test_run.analyzer_assigned_uuid, | analyzer_assigned_uuid = str(c_test_run.analyzer_assigned_uuid), | def memory_model_to_db_model(self, c_bundle, s_bundle): """ Translate a memory model to database model """ from dashboard_app.models import ( Attachment, HardwareDevice, NamedAttribute, SoftwarePackage, Test, TestCase, TestResult, TestRun, ) # All variables prefixed with c_ refer to CLIENT SIDE models # All variables p... | 21eb09a469dc088b11a2bc7671443d3630353b58 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/21eb09a469dc088b11a2bc7671443d3630353b58/helpers.py |
retval = self.xml_rpc_call("ping") self.assertEqual(retval, "pong") | def test_echo(self): self.assertEqual(self.xml_rpc_call("echo", 1), 1) self.assertEqual(self.xml_rpc_call("echo", "string"), "string") self.assertEqual(self.xml_rpc_call("echo", 1.5), 1.5) retval = self.xml_rpc_call("ping") self.assertEqual(retval, "pong") | 1b3e4beef23fa8c3a21ea94ebece18bd499e0c09 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/1b3e4beef23fa8c3a21ea94ebece18bd499e0c09/tests.py | |
Returns value | Return value | def version(self): """ Name ---- `version` () | ff9ad429d643ac267d528521f3e30a1b0c97f5bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/ff9ad429d643ac267d528521f3e30a1b0c97f5bb/xmlrpc.py |
verbose_name = _(u"Description."), | verbose_name = _(u"Description"), | def __unicode__(self): return _(u"{name}: {value}").format( name = self.name, value = self.value) | 915b1e102fca41c9dd70c8ebc6140c71e2257d13 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/915b1e102fca41c9dd70c8ebc6140c71e2257d13/models.py |
def mock_imports(self, reload_list=None): """ Make prohibit_importing() work by hiding and importing again all the modules that depended on an imported prohibited module. | 63c7544cbd08c81807594f551d35b440c3301076 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/63c7544cbd08c81807594f551d35b440c3301076/import_prohibitor.py | ||
urls = 'dashboard_app.test_urls' | def test_test_result__unknown(self): obj = TestResult(result=TestResult.RESULT_UNKNOWN, id=1) self.assertEqual(unicode(obj), "#1 unknown") | 7362473c8efa9da5331b82251c0ea87009f105dc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/7362473c8efa9da5331b82251c0ea87009f105dc/tests.py | |
endpoint_path = reverse("dashboard_app.dashboard_xml_rpc_handler") | endpoint_path = reverse("xml-rpc") | def test_csrf_not_protecting_xml_rpc_views(self): """call version and check that we didn't get 403""" endpoint_path = reverse("dashboard_app.dashboard_xml_rpc_handler") request_body = xmlrpclib.dumps((), methodname="version") response = self.client.post(endpoint_path, request_body, "text/xml") self.assertContains(respo... | 7362473c8efa9da5331b82251c0ea87009f105dc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/7362473c8efa9da5331b82251c0ea87009f105dc/tests.py |
self.format = format or self.FORMAT self.test_runs = test_runs or [] | if format is None: format = self.FORMAT if test_runs is None: test_runs = [] self.format = format self.test_runs = test_runs | def __init__(self, format=None, test_runs=None): self.format = format or self.FORMAT self.test_runs = test_runs or [] | 18e5045be4f84bb096455ab4656b4661941da0cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/18e5045be4f84bb096455ab4656b4661941da0cc/bundle.py |
class CSRFExemptForXMLRPCAPITestCase(CSRFTestCase, DashboardAPITestCase): | def test_cross_site_login_fails(self): response = self.client.post(self.login_path, { 'user': 'user', 'pass': 'pass'}) self.assertEquals(response.status_code, 403) | 35e6b4b2dd937e66499079eb13fa5a959649d48b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/35e6b4b2dd937e66499079eb13fa5a959649d48b/tests.py | |
response = self.client.post( self.endpoint_path, request_body, "text/xml") | response = self.client.post(endpoint_path, request_body, "text/xml") | def test_csrf_not_protecting_xml_rpc_views(self): """call version and check that we didn't get 403""" request_body = xmlrpclib.dumps((), methodname="version") response = self.client.post( self.endpoint_path, request_body, "text/xml") self.assertContains(response, "<methodResponse>", status_code=200) | 35e6b4b2dd937e66499079eb13fa5a959649d48b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/35e6b4b2dd937e66499079eb13fa5a959649d48b/tests.py |
def parse(data): header = {} signals = {1:('0',0),2:('1',0),3:('Local',0)} modules = {} for token in data: objtype=token.get('ObjTp','') if objtype=='Hd': header['dealer']=token.get('DlrNm','n/a') header['programer']=token.get('PgmNm','n/a') header['file']=token.get('PrNm','n/a') header['hint']=token.get('CltNm','n/a'... | 92d449070c08914a89e0b20421f4ac4b4b3bf017 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/280/92d449070c08914a89e0b20421f4ac4b4b3bf017/smw2dot.py | ||
def nonum(name): return filter(lambda x: not x.isdigit(), name) | def make_head(header): return """// file: %s\n// dealer: %s\n// programmer: %s\n// hint: %s\n\ndigraph {"""%( header['file'],header['dealer'],header['programer'],header['hint']) def make_tail(): return "}" | def nonum(name): return filter(lambda x: not x.isdigit(), name) | 92d449070c08914a89e0b20421f4ac4b4b3bf017 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/280/92d449070c08914a89e0b20421f4ac4b4b3bf017/smw2dot.py |
head = """// file: %s\n// dealer: %s\n// programmer: %s\n// hint: %s\n\ndigraph {"""%( header['file'],header['dealer'],header['programer'],header['hint']) tail = """}""" dot_file = [head] | dot_file = [make_head(header)] | def make_dot(header, signals, modules): head = """// file: %s\n// dealer: %s\n// programmer: %s\n// hint: %s\n\ndigraph {"""%( header['file'],header['dealer'],header['programer'],header['hint']) tail = """}""" dot_file = [head] checkT = False checkF = False limit_mods = filter(lambda m: adv_len(modules[m]['ins']) or a... | 92d449070c08914a89e0b20421f4ac4b4b3bf017 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/280/92d449070c08914a89e0b20421f4ac4b4b3bf017/smw2dot.py |
dot_file.append(tail) | dot_file.append(make_tail()) | def make_dot(header, signals, modules): head = """// file: %s\n// dealer: %s\n// programmer: %s\n// hint: %s\n\ndigraph {"""%( header['file'],header['dealer'],header['programer'],header['hint']) tail = """}""" dot_file = [head] checkT = False checkF = False limit_mods = filter(lambda m: adv_len(modules[m]['ins']) or a... | 92d449070c08914a89e0b20421f4ac4b4b3bf017 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/280/92d449070c08914a89e0b20421f4ac4b4b3bf017/smw2dot.py |
head = """// file: %s\n// dealer: %s\n// programmer: %s\n// hint: %s\n\ndigraph {"""%( header['file'],header['dealer'],header['programer'],header['hint']) tail = """}""" dot_file = [head] | dot_file = [make_head(header)] | def make_dot_merged(header, signals, modules): head = """// file: %s\n// dealer: %s\n// programmer: %s\n// hint: %s\n\ndigraph {"""%( header['file'],header['dealer'],header['programer'],header['hint']) tail = """}""" dot_file = [head] limit_mods = filter(lambda m: adv_len(modules[m]['ins']) or adv_len(modules[m]['outs... | 92d449070c08914a89e0b20421f4ac4b4b3bf017 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/280/92d449070c08914a89e0b20421f4ac4b4b3bf017/smw2dot.py |
dot_file.append(make_direct_signal(stag, sname, stype)) | dot_file.append(make_signal(stag, sname, stype)) | def make_dot_merged(header, signals, modules): head = """// file: %s\n// dealer: %s\n// programmer: %s\n// hint: %s\n\ndigraph {"""%( header['file'],header['dealer'],header['programer'],header['hint']) tail = """}""" dot_file = [head] limit_mods = filter(lambda m: adv_len(modules[m]['ins']) or adv_len(modules[m]['outs... | 92d449070c08914a89e0b20421f4ac4b4b3bf017 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/280/92d449070c08914a89e0b20421f4ac4b4b3bf017/smw2dot.py |
dot_file.append(tail) | dot_file.append(make_tail()) | def make_dot_merged(header, signals, modules): head = """// file: %s\n// dealer: %s\n// programmer: %s\n// hint: %s\n\ndigraph {"""%( header['file'],header['dealer'],header['programer'],header['hint']) tail = """}""" dot_file = [head] limit_mods = filter(lambda m: adv_len(modules[m]['ins']) or adv_len(modules[m]['outs... | 92d449070c08914a89e0b20421f4ac4b4b3bf017 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/280/92d449070c08914a89e0b20421f4ac4b4b3bf017/smw2dot.py |
def make_dot_merged(header, signals, modules): head = """// file: %s\n// dealer: %s\n// programmer: %s\n// hint: %s\n\ndigraph {"""%( header['file'],header['dealer'],header['programer'],header['hint']) tail = """}""" dot_file = [head] limit_mods = filter(lambda m: adv_len(modules[m]['ins']) or adv_len(modules[m]['outs... | 92d449070c08914a89e0b20421f4ac4b4b3bf017 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/280/92d449070c08914a89e0b20421f4ac4b4b3bf017/smw2dot.py | ||
if len(sys.argv) != 2: print 'Please specify one filename on the command line.' sys.exit(1) text = open(sys.argv[1],"rt").read() | usage = "usage: %prog [options] inputfile\ninputfile of smw/umc/cmc Crestron's filetypes" parser = OptionParser(usage=usage) parser.add_option("-o","--output", dest="output", help="write result to FILE", metavar="FILE") parser.add_option("-m","--merged", dest="merge", action="store_true", help="make \"merged signals\... | def main(): if len(sys.argv) != 2: print 'Please specify one filename on the command line.' sys.exit(1) text = open(sys.argv[1],"rt").read() tree = tokenize(text) header,sigs,mods = parse(tree) print make_dot(header,sigs,mods) #print make_dot_merged(header,sigs,mods) | 92d449070c08914a89e0b20421f4ac4b4b3bf017 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/280/92d449070c08914a89e0b20421f4ac4b4b3bf017/smw2dot.py |
print make_dot(header,sigs,mods) | if options.merge: result = make_dot_merged(header,sigs,mods) else: result = make_dot(header,sigs,mods) if options.output is not None: open(options.output, "wt").write(result) else: print result | def main(): if len(sys.argv) != 2: print 'Please specify one filename on the command line.' sys.exit(1) text = open(sys.argv[1],"rt").read() tree = tokenize(text) header,sigs,mods = parse(tree) print make_dot(header,sigs,mods) #print make_dot_merged(header,sigs,mods) | 92d449070c08914a89e0b20421f4ac4b4b3bf017 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/280/92d449070c08914a89e0b20421f4ac4b4b3bf017/smw2dot.py |
check(isinstance(month, str)) dbapi.return_strs_as_unicode(True) | check(isinstance(month, str), "Value of str should be regular string") return_strs_as_unicode(True) | def checkEqual(var1, var2): check(var1 == var2, "Values not equal: '" + str(var1) + "' !='" + str(var2) + "'") | 56bc6b31d09d110f65f951817ff31ab21aed968a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/310/56bc6b31d09d110f65f951817ff31ab21aed968a/python_dbapi_test.py |
check(isinstance(month, unicode)) dbapi.return_strs_as_unicode(False) | check(isinstance(month, unicode), "Value of str should be unicode string") return_strs_as_unicode(False) | def checkEqual(var1, var2): check(var1 == var2, "Values not equal: '" + str(var1) + "' !='" + str(var2) + "'") | 56bc6b31d09d110f65f951817ff31ab21aed968a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/310/56bc6b31d09d110f65f951817ff31ab21aed968a/python_dbapi_test.py |
check(isinstance(month, str)) | check(isinstance(month, str), "Value of str should be regular string") | def checkEqual(var1, var2): check(var1 == var2, "Values not equal: '" + str(var1) + "' !='" + str(var2) + "'") | 56bc6b31d09d110f65f951817ff31ab21aed968a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/310/56bc6b31d09d110f65f951817ff31ab21aed968a/python_dbapi_test.py |
'ca_theorical': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Theorical Revenue', | 'ca_theorical': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Theoretical Revenue', | def _theorical_margin_calc(self, cr, uid, ids, name, arg, context=None): res = {} for account in self.browse(cr, uid, ids, context=context): res[account.id] = account.ca_theorical + account.total_cost for id in ids: res[id] = round(res.get(id, 0.0),2) return res | 3415b14d6137c1321c302ddbfce5d3abfacd8e15 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/3415b14d6137c1321c302ddbfce5d3abfacd8e15/account_analytic_analysis.py |
'theorical_margin': fields.function(_theorical_margin_calc, method=True, type='float', string='Theorical Margin', | 'theorical_margin': fields.function(_theorical_margin_calc, method=True, type='float', string='Theoretical Margin', | def _theorical_margin_calc(self, cr, uid, ids, name, arg, context=None): res = {} for account in self.browse(cr, uid, ids, context=context): res[account.id] = account.ca_theorical + account.total_cost for id in ids: res[id] = round(res.get(id, 0.0),2) return res | 3415b14d6137c1321c302ddbfce5d3abfacd8e15 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/3415b14d6137c1321c302ddbfce5d3abfacd8e15/account_analytic_analysis.py |
_description = "Hours summary by user" | _description = "Hours Summary by User" | def _user(self, cr, uid, ids, name, arg, context=None): res = {} cr.execute('SELECT MAX(id) FROM res_users') max_user = cr.fetchone()[0] for id in ids: ids2 = self.search(cr, uid, [('parent_id', 'child_of', [id])]) if ids2: cr.execute('SELECT DISTINCT("user") FROM account_analytic_analysis_summary_user ' \ 'WHERE accou... | b50118c07936d539bf5d8ed52bcba7bab70c5acc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/b50118c07936d539bf5d8ed52bcba7bab70c5acc/account_analytic_analysis.py |
def _read_flat(self, cr, user, ids, fields, context=None, load='_classic_read'): if context is None: context = {} if not ids: return [] | 81b996cdad05b6a314695f98a04ee77827852339 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/81b996cdad05b6a314695f98a04ee77827852339/account_analytic_analysis.py | ||
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)], context=context)) if parent_ids: cr.execute("SELECT account_analytic_line.account_id, COALESCE(SUM(amount_currency), 0.0) \ | res_final = {} child_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)], context=context)) for i in child_ids: res[i] = {} for n in [name]: res[i][n] = 0.0 if not child_ids: return res if child_ids: cr.execute("SELECT account_analytic_line.account_id, COALESCE(SUM(amount), 0.0) \ | def _ca_invoiced_calc(self, cr, uid, ids, name, arg, context=None): res = {} parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)], context=context)) if parent_ids: cr.execute("SELECT account_analytic_line.account_id, COALESCE(SUM(amount_currency), 0.0) \ FROM account_analytic_line \ JOIN account_ana... | 8642bc7e591b6165264e303c37dfb9055fd63362 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/8642bc7e591b6165264e303c37dfb9055fd63362/account_analytic_analysis.py |
GROUP BY account_analytic_line.account_id", (parent_ids,)) | GROUP BY account_analytic_line.account_id", (child_ids,)) | def _ca_invoiced_calc(self, cr, uid, ids, name, arg, context=None): res = {} parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)], context=context)) if parent_ids: cr.execute("SELECT account_analytic_line.account_id, COALESCE(SUM(amount_currency), 0.0) \ FROM account_analytic_line \ JOIN account_ana... | 8642bc7e591b6165264e303c37dfb9055fd63362 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/8642bc7e591b6165264e303c37dfb9055fd63362/account_analytic_analysis.py |
res[account_id] = round(sum,2) return self._compute_currency_for_level_tree(cr, uid, ids, parent_ids, res, context=context) | res[account_id][name] = round(sum,2) data = self._compute_level_tree(cr, uid, ids, child_ids, res, [name], context) for i in data: res_final[i] = data[i][name] return res_final | def _ca_invoiced_calc(self, cr, uid, ids, name, arg, context=None): res = {} parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)], context=context)) if parent_ids: cr.execute("SELECT account_analytic_line.account_id, COALESCE(SUM(amount_currency), 0.0) \ FROM account_analytic_line \ JOIN account_ana... | 8642bc7e591b6165264e303c37dfb9055fd63362 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/8642bc7e591b6165264e303c37dfb9055fd63362/account_analytic_analysis.py |
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)], context=context)) if parent_ids: cr.execute("""SELECT account_analytic_line.account_id, COALESCE(SUM(amount_currency), 0.0) \ | res_final = {} child_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)], context=context)) for i in child_ids: res[i] = {} for n in [name]: res[i][n] = 0.0 if not child_ids: return res if child_ids: cr.execute("""SELECT account_analytic_line.account_id, COALESCE(SUM(amount), 0.0) \ | def _total_cost_calc(self, cr, uid, ids, name, arg, context=None): res = {} parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)], context=context)) if parent_ids: cr.execute("""SELECT account_analytic_line.account_id, COALESCE(SUM(amount_currency), 0.0) \ FROM account_analytic_line \ JOIN account_an... | 8642bc7e591b6165264e303c37dfb9055fd63362 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/8642bc7e591b6165264e303c37dfb9055fd63362/account_analytic_analysis.py |
GROUP BY account_analytic_line.account_id""",(parent_ids,)) | GROUP BY account_analytic_line.account_id""",(child_ids,)) | def _total_cost_calc(self, cr, uid, ids, name, arg, context=None): res = {} parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)], context=context)) if parent_ids: cr.execute("""SELECT account_analytic_line.account_id, COALESCE(SUM(amount_currency), 0.0) \ FROM account_analytic_line \ JOIN account_an... | 8642bc7e591b6165264e303c37dfb9055fd63362 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/8642bc7e591b6165264e303c37dfb9055fd63362/account_analytic_analysis.py |
res[account_id] = round(sum,2) return self._compute_currency_for_level_tree(cr, uid, ids, parent_ids, res, context=context) | res[account_id][name] = round(sum,2) data = self._compute_level_tree(cr, uid, ids, child_ids, res, [name], context) for i in data: res_final[i] = data[i][name] return res_final | def _total_cost_calc(self, cr, uid, ids, name, arg, context=None): res = {} parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)], context=context)) if parent_ids: cr.execute("""SELECT account_analytic_line.account_id, COALESCE(SUM(amount_currency), 0.0) \ FROM account_analytic_line \ JOIN account_an... | 8642bc7e591b6165264e303c37dfb9055fd63362 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/8642bc7e591b6165264e303c37dfb9055fd63362/account_analytic_analysis.py |
for account_id, sum in cr.fetchall(): res[account_id] = sum | for account_id, lid in cr.fetchall(): res[account_id][f] = lid | def _analysis_all(self, cr, uid, ids, fields, arg, context=None): dp = 2 res = dict([(i, {}) for i in ids]) | 1a63e1c0446ff8a7681b88775ab2dc9fbd57a788 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/1a63e1c0446ff8a7681b88775ab2dc9fbd57a788/account_analytic_analysis.py |
for account_id, sum in cr.fetchall(): res[account_id][f] = sum | for account_id, lwd in cr.fetchall(): res[account_id][f] = lwd | def _analysis_all(self, cr, uid, ids, fields, arg, context=None): dp = 2 res = dict([(i, {}) for i in ids]) | 1a63e1c0446ff8a7681b88775ab2dc9fbd57a788 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/1a63e1c0446ff8a7681b88775ab2dc9fbd57a788/account_analytic_analysis.py |
for account_id, sum in cr.fetchall(): res[account_id][f] = round(sum, dp) | for account_id, sua in cr.fetchall(): res[account_id][f] = round(sua, dp) | def _analysis_all(self, cr, uid, ids, fields, arg, context=None): dp = 2 res = dict([(i, {}) for i in ids]) | 1a63e1c0446ff8a7681b88775ab2dc9fbd57a788 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/1a63e1c0446ff8a7681b88775ab2dc9fbd57a788/account_analytic_analysis.py |
for account_id, sum in ff: res[account_id][f] = round(sum, dp) | for account_id, hq in ff: res[account_id][f] = round(hq, dp) | def _analysis_all(self, cr, uid, ids, fields, arg, context=None): dp = 2 res = dict([(i, {}) for i in ids]) | 1a63e1c0446ff8a7681b88775ab2dc9fbd57a788 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/1a63e1c0446ff8a7681b88775ab2dc9fbd57a788/account_analytic_analysis.py |
def _ca_invoiced_calc(self, cr, uid, ids, name, arg, context=None): res = {} parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)])) if parent_ids: cr.execute("select account_analytic_line.account_id, COALESCE(sum(amount_currency),0.0) \ from account_analytic_line \ join account_analytic_journal \ on... | a0e414ad08d1b9ac704dc1cb18dc7a500bcf9123 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/a0e414ad08d1b9ac704dc1cb18dc7a500bcf9123/account_analytic_analysis.py | ||
def _total_cost_calc(self, cr, uid, ids, name, arg, context=None): res = {} parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)])) if parent_ids: cr.execute("""select account_analytic_line.account_id,COALESCE(sum(amount_currency),0.0) \ | a0e414ad08d1b9ac704dc1cb18dc7a500bcf9123 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/a0e414ad08d1b9ac704dc1cb18dc7a500bcf9123/account_analytic_analysis.py | ||
def _ca_theorical_calc(self, cr, uid, ids, name, arg, context=None): res = {} res2 = {} parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)])) # Warning # This computation doesn't take care of pricelist ! # Just consider list_price if parent_ids: cr.execute("""select account_analytic_line.account_id... | a0e414ad08d1b9ac704dc1cb18dc7a500bcf9123 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/a0e414ad08d1b9ac704dc1cb18dc7a500bcf9123/account_analytic_analysis.py | ||
def _ca_theorical_calc(self, cr, uid, ids, name, arg, context=None): res = {} res2 = {} parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)])) # Warning # This computation doesn't take care of pricelist ! # Just consider list_price if parent_ids: cr.execute("""select account_analytic_line.account_id... | a0e414ad08d1b9ac704dc1cb18dc7a500bcf9123 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/a0e414ad08d1b9ac704dc1cb18dc7a500bcf9123/account_analytic_analysis.py | ||
def _user(self, cr, uid, ids, name, arg, context=None): res = {} cr.execute('SELECT MAX(id) FROM res_users') max_user = cr.fetchone()[0] for id in ids: parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)])) if parent_ids: cr.execute('SELECT DISTINCT("user") FROM account_analytic_analysis_summary_use... | a0e414ad08d1b9ac704dc1cb18dc7a500bcf9123 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/a0e414ad08d1b9ac704dc1cb18dc7a500bcf9123/account_analytic_analysis.py | ||
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', account_ids)])) | parent_ids = tuple(account_obj.search(cr, uid, [('parent_id', 'child_of', account_ids)])) | def _unit_amount(self, cr, uid, ids, name, arg, context=None): res = {} account_obj = self.pool.get('account.analytic.account') cr.execute('SELECT MAX(id) FROM res_users') max_user = cr.fetchone()[0] account_ids = [int(str(x/max_user - (x%max_user == 0 and 1 or 0))) for x in ids] user_ids = [int(str(x-((x/max_user - (x... | a0e414ad08d1b9ac704dc1cb18dc7a500bcf9123 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/a0e414ad08d1b9ac704dc1cb18dc7a500bcf9123/account_analytic_analysis.py |
'AND "user" IN %s',(parent_ids, user_ids,)) | 'AND "user" IN %s',(parent_ids, tuple(user_ids),)) | def _unit_amount(self, cr, uid, ids, name, arg, context=None): res = {} account_obj = self.pool.get('account.analytic.account') cr.execute('SELECT MAX(id) FROM res_users') max_user = cr.fetchone()[0] account_ids = [int(str(x/max_user - (x%max_user == 0 and 1 or 0))) for x in ids] user_ids = [int(str(x-((x/max_user - (x... | a0e414ad08d1b9ac704dc1cb18dc7a500bcf9123 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/a0e414ad08d1b9ac704dc1cb18dc7a500bcf9123/account_analytic_analysis.py |
def _unit_amount(self, cr, uid, ids, name, arg, context=None): res = {} account_obj = self.pool.get('account.analytic.account') cr.execute('SELECT MAX(id) FROM res_users') max_user = cr.fetchone()[0] account_ids = [int(str(x/max_user - (x%max_user == 0 and 1 or 0))) for x in ids] user_ids = [int(str(x-((x/max_user - (x... | a0e414ad08d1b9ac704dc1cb18dc7a500bcf9123 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/a0e414ad08d1b9ac704dc1cb18dc7a500bcf9123/account_analytic_analysis.py | ||
d1, d2 = self.pool.get('ir.rule').domain_get(cr, user, self._name) | d1, d2, tables = self.pool.get('ir.rule').domain_get(cr, user, self._name, 'read', context=context) | def _read_flat(self, cr, user, ids, fields, context=None, load='_classic_read'): if not context: context={} if not ids: return [] | a0e414ad08d1b9ac704dc1cb18dc7a500bcf9123 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/a0e414ad08d1b9ac704dc1cb18dc7a500bcf9123/account_analytic_analysis.py |
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', account_ids)])) | parent_ids = tuple(account_obj.search(cr, uid, [('parent_id', 'child_of', account_ids)])) | def _unit_amount(self, cr, uid, ids, name, arg, context=None): res = {} account_obj = self.pool.get('account.analytic.account') account_ids = [int(str(int(x))[:-6]) for x in ids] month_ids = [int(str(int(x))[-6:]) for x in ids] parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', account_ids)])) if parent... | a0e414ad08d1b9ac704dc1cb18dc7a500bcf9123 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/a0e414ad08d1b9ac704dc1cb18dc7a500bcf9123/account_analytic_analysis.py |
'AND month_id IN %s ',(parent_ids, month_ids,)) | 'AND month_id IN %s ',(parent_ids, tuple(month_ids),)) | def _unit_amount(self, cr, uid, ids, name, arg, context=None): res = {} account_obj = self.pool.get('account.analytic.account') account_ids = [int(str(int(x))[:-6]) for x in ids] month_ids = [int(str(int(x))[-6:]) for x in ids] parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', account_ids)])) if parent... | a0e414ad08d1b9ac704dc1cb18dc7a500bcf9123 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/a0e414ad08d1b9ac704dc1cb18dc7a500bcf9123/account_analytic_analysis.py |
d1, d2 = self.pool.get('ir.rule').domain_get(cr, user, self._name) | d1, d2, tables = self.pool.get('ir.rule').domain_get(cr, user, self._name) | def _read_flat(self, cr, user, ids, fields, context=None, load='_classic_read'): if not context: context={} if not ids: return [] | a0e414ad08d1b9ac704dc1cb18dc7a500bcf9123 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/a0e414ad08d1b9ac704dc1cb18dc7a500bcf9123/account_analytic_analysis.py |
def _read_flat(self, cr, user, ids, fields, context=None, load='_classic_read'): if not context: context={} if not ids: return [] | a0e414ad08d1b9ac704dc1cb18dc7a500bcf9123 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/a0e414ad08d1b9ac704dc1cb18dc7a500bcf9123/account_analytic_analysis.py | ||
ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: acc_set = ",".join(map(str, ids2)) | parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)])) if parent_ids: | def _ca_invoiced_calc(self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: acc_set = ",".join(map(str, ids2)) cr.execute("select account_analytic_line.account_id, COALESCE(sum(amount_currency),0.0) \ from account_analytic_line \ join account_analyti... | 3c18c11c83e2549431192a3a0c1f46403db9d628 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/3c18c11c83e2549431192a3a0c1f46403db9d628/account_analytic_analysis.py |
where account_analytic_line.account_id =ANY(%s) \ | where account_analytic_line.account_id IN %s \ | def _ca_invoiced_calc(self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: acc_set = ",".join(map(str, ids2)) cr.execute("select account_analytic_line.account_id, COALESCE(sum(amount_currency),0.0) \ from account_analytic_line \ join account_analyti... | 3c18c11c83e2549431192a3a0c1f46403db9d628 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/3c18c11c83e2549431192a3a0c1f46403db9d628/account_analytic_analysis.py |
group by account_analytic_line.account_id" ,(ids2,)) | group by account_analytic_line.account_id" ,(parent_ids,)) | def _ca_invoiced_calc(self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: acc_set = ",".join(map(str, ids2)) cr.execute("select account_analytic_line.account_id, COALESCE(sum(amount_currency),0.0) \ from account_analytic_line \ join account_analyti... | 3c18c11c83e2549431192a3a0c1f46403db9d628 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/3c18c11c83e2549431192a3a0c1f46403db9d628/account_analytic_analysis.py |
return self._compute_currency_for_level_tree(cr, uid, ids, ids2, res, acc_set, context) | return self._compute_currency_for_level_tree(cr, uid, ids, parent_ids, res, context) | def _ca_invoiced_calc(self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: acc_set = ",".join(map(str, ids2)) cr.execute("select account_analytic_line.account_id, COALESCE(sum(amount_currency),0.0) \ from account_analytic_line \ join account_analyti... | 3c18c11c83e2549431192a3a0c1f46403db9d628 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/3c18c11c83e2549431192a3a0c1f46403db9d628/account_analytic_analysis.py |
ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: | parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)])) if parent_ids: | def _ca_to_invoice_calc(self, cr, uid, ids, name, arg, context={}): res = {} res2 = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: # Amount uninvoiced hours to invoice at sale price # Warning # This computation doesn't take care of pricelist ! # Just consider list_price acc_set = ",".join(map... | 3c18c11c83e2549431192a3a0c1f46403db9d628 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/3c18c11c83e2549431192a3a0c1f46403db9d628/account_analytic_analysis.py |
acc_set = ",".join(map(str, ids2)) | def _ca_to_invoice_calc(self, cr, uid, ids, name, arg, context={}): res = {} res2 = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: # Amount uninvoiced hours to invoice at sale price # Warning # This computation doesn't take care of pricelist ! # Just consider list_price acc_set = ",".join(map... | 3c18c11c83e2549431192a3a0c1f46403db9d628 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/3c18c11c83e2549431192a3a0c1f46403db9d628/account_analytic_analysis.py | |
WHERE account_analytic_account.id =ANY(%s) \ | WHERE account_analytic_account.id IN %s \ | def _ca_to_invoice_calc(self, cr, uid, ids, name, arg, context={}): res = {} res2 = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: # Amount uninvoiced hours to invoice at sale price # Warning # This computation doesn't take care of pricelist ! # Just consider list_price acc_set = ",".join(map... | 3c18c11c83e2549431192a3a0c1f46403db9d628 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/3c18c11c83e2549431192a3a0c1f46403db9d628/account_analytic_analysis.py |
GROUP BY account_analytic_account.id;""",(ids2,)) | GROUP BY account_analytic_account.id;""",(parent_ids,)) | def _ca_to_invoice_calc(self, cr, uid, ids, name, arg, context={}): res = {} res2 = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: # Amount uninvoiced hours to invoice at sale price # Warning # This computation doesn't take care of pricelist ! # Just consider list_price acc_set = ",".join(map... | 3c18c11c83e2549431192a3a0c1f46403db9d628 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/3c18c11c83e2549431192a3a0c1f46403db9d628/account_analytic_analysis.py |
ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: | parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)])) if parent_ids: | def _hours_qtt_non_invoiced_calc (self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: cr.execute("select account_analytic_line.account_id, COALESCE(sum(unit_amount),0.0) \ from account_analytic_line \ join account_analytic_journal \ on account_anal... | 3c18c11c83e2549431192a3a0c1f46403db9d628 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/3c18c11c83e2549431192a3a0c1f46403db9d628/account_analytic_analysis.py |
where account_analytic_line.account_id =ANY(%s) \ | where account_analytic_line.account_id IN %s \ | def _hours_qtt_non_invoiced_calc (self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: cr.execute("select account_analytic_line.account_id, COALESCE(sum(unit_amount),0.0) \ from account_analytic_line \ join account_analytic_journal \ on account_anal... | 3c18c11c83e2549431192a3a0c1f46403db9d628 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/3c18c11c83e2549431192a3a0c1f46403db9d628/account_analytic_analysis.py |
GROUP BY account_analytic_line.account_id;",(ids2,)) | GROUP BY account_analytic_line.account_id;",(parent_ids,)) | def _hours_qtt_non_invoiced_calc (self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: cr.execute("select account_analytic_line.account_id, COALESCE(sum(unit_amount),0.0) \ from account_analytic_line \ join account_analytic_journal \ on account_anal... | 3c18c11c83e2549431192a3a0c1f46403db9d628 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/3c18c11c83e2549431192a3a0c1f46403db9d628/account_analytic_analysis.py |
ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: | parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)])) if parent_ids: | def _hours_quantity_calc(self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: cr.execute("select account_analytic_line.account_id,COALESCE(SUM(unit_amount),0.0) \ from account_analytic_line \ join account_analytic_journal \ on account_analytic_line.... | 3c18c11c83e2549431192a3a0c1f46403db9d628 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/3c18c11c83e2549431192a3a0c1f46403db9d628/account_analytic_analysis.py |
where account_analytic_line.account_id =ANY(%s) \ | where account_analytic_line.account_id IN %s \ | def _hours_quantity_calc(self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: cr.execute("select account_analytic_line.account_id,COALESCE(SUM(unit_amount),0.0) \ from account_analytic_line \ join account_analytic_journal \ on account_analytic_line.... | 3c18c11c83e2549431192a3a0c1f46403db9d628 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/3c18c11c83e2549431192a3a0c1f46403db9d628/account_analytic_analysis.py |
GROUP BY account_analytic_line.account_id",(ids2,)) | GROUP BY account_analytic_line.account_id",(parent_ids,)) | def _hours_quantity_calc(self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: cr.execute("select account_analytic_line.account_id,COALESCE(SUM(unit_amount),0.0) \ from account_analytic_line \ join account_analytic_journal \ on account_analytic_line.... | 3c18c11c83e2549431192a3a0c1f46403db9d628 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/3c18c11c83e2549431192a3a0c1f46403db9d628/account_analytic_analysis.py |
ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: acc_set = ",".join(map(str, ids2)) | parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)])) if parent_ids: | def _total_cost_calc(self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: acc_set = ",".join(map(str, ids2)) cr.execute("""select account_analytic_line.account_id,COALESCE(sum(amount_currency),0.0) \ | 3c18c11c83e2549431192a3a0c1f46403db9d628 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/3c18c11c83e2549431192a3a0c1f46403db9d628/account_analytic_analysis.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.