prompt large_stringlengths 72 9.34k | completion large_stringlengths 0 7.61k |
|---|---|
<|file_name|>test_different_outputs.py<|end_file_name|><|fim▁begin|>import unittest
from polycircles import polycircles
from nose.tools import assert_equal, assert_almost_equal
class TestDifferentOutputs(unittest.TestCase):
"""Tests the various output methods: KML style, WKT, lat-lon and lon-lat."""
def setU... | """Asserts that the vertices in the lat-lon output are in the
right order (lat before long)."""
for vertex in self.polycircle.to_lon_lat():
assert_almost_equal(vertex[0], self.longitude, places=2)
assert_almost_equal(vertex[1], self.latitude, places=2) |
<|file_name|>test_different_outputs.py<|end_file_name|><|fim▁begin|>import unittest
from polycircles import polycircles
from nose.tools import assert_equal, assert_almost_equal
class TestDifferentOutputs(unittest.TestCase):
"""Tests the various output methods: KML style, WKT, lat-lon and lon-lat."""
def setU... | """Asserts that the "vertices" property is identical to the return
value of to_lat_lon()."""
assert_equal(self.polycircle.vertices, self.polycircle.to_lat_lon()) |
<|file_name|>test_different_outputs.py<|end_file_name|><|fim▁begin|>import unittest
from polycircles import polycircles
from nose.tools import assert_equal, assert_almost_equal
class TestDifferentOutputs(unittest.TestCase):
"""Tests the various output methods: KML style, WKT, lat-lon and lon-lat."""
def setU... | """Asserts that the return value of to_kml() property is identical to
the return value of to_lon_lat()."""
assert_equal(self.polycircle.to_kml(), self.polycircle.to_lon_lat()) |
<|file_name|>test_different_outputs.py<|end_file_name|><|fim▁begin|>import unittest
from polycircles import polycircles
from nose.tools import assert_equal, assert_almost_equal
class TestDifferentOutputs(unittest.TestCase):
"""Tests the various output methods: KML style, WKT, lat-lon and lon-lat."""
def setU... | unittest.main() |
<|file_name|>test_different_outputs.py<|end_file_name|><|fim▁begin|>import unittest
from polycircles import polycircles
from nose.tools import assert_equal, assert_almost_equal
class TestDifferentOutputs(unittest.TestCase):
"""Tests the various output methods: KML style, WKT, lat-lon and lon-lat."""
def <|fi... | setUp |
<|file_name|>test_different_outputs.py<|end_file_name|><|fim▁begin|>import unittest
from polycircles import polycircles
from nose.tools import assert_equal, assert_almost_equal
class TestDifferentOutputs(unittest.TestCase):
"""Tests the various output methods: KML style, WKT, lat-lon and lon-lat."""
def setU... | test_lat_lon_output |
<|file_name|>test_different_outputs.py<|end_file_name|><|fim▁begin|>import unittest
from polycircles import polycircles
from nose.tools import assert_equal, assert_almost_equal
class TestDifferentOutputs(unittest.TestCase):
"""Tests the various output methods: KML style, WKT, lat-lon and lon-lat."""
def setU... | test_lon_lat_output |
<|file_name|>test_different_outputs.py<|end_file_name|><|fim▁begin|>import unittest
from polycircles import polycircles
from nose.tools import assert_equal, assert_almost_equal
class TestDifferentOutputs(unittest.TestCase):
"""Tests the various output methods: KML style, WKT, lat-lon and lon-lat."""
def setU... | test_vertices_equals_lat_lon |
<|file_name|>test_different_outputs.py<|end_file_name|><|fim▁begin|>import unittest
from polycircles import polycircles
from nose.tools import assert_equal, assert_almost_equal
class TestDifferentOutputs(unittest.TestCase):
"""Tests the various output methods: KML style, WKT, lat-lon and lon-lat."""
def setU... | test_kml_equals_lon_lat |
<|file_name|>test_documentbylineviewlet.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from imio.history.config import HISTORY_COMMENT_NOT_VIEWABLE
from imio.history.interfaces import IImioHistory
from imio.history.testing import IntegrationTestCase
from plone import api
from plone.memoize.instance import Mem... | adapter = getAdapter(self.portal.doc, IImioHistory, 'workflow')
# not highlighted because '' is an ignored comment
history = adapter.getHistory() |
<|file_name|>test_documentbylineviewlet.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from imio.history.config import HISTORY_COMMENT_NOT_VIEWABLE
from imio.history.interfaces import IImioHistory
from imio.history.testing import IntegrationTestCase
from plone import api
from plone.memoize.instance import Mem... | def setUp(self):
super(TestDocumentByLineViewlet, self).setUp()
# get the viewlet
doc = api.content.create(type='Document',
id='doc',
container=self.portal)
view = BrowserView(doc, self.portal.REQUEST)
manager ... |
<|file_name|>test_documentbylineviewlet.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from imio.history.config import HISTORY_COMMENT_NOT_VIEWABLE
from imio.history.interfaces import IImioHistory
from imio.history.testing import IntegrationTestCase
from plone import api
from plone.memoize.instance import Mem... | super(TestDocumentByLineViewlet, self).setUp()
# get the viewlet
doc = api.content.create(type='Document',
id='doc',
container=self.portal)
view = BrowserView(doc, self.portal.REQUEST)
manager = getMultiAdapter(
... |
<|file_name|>test_documentbylineviewlet.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from imio.history.config import HISTORY_COMMENT_NOT_VIEWABLE
from imio.history.interfaces import IImioHistory
from imio.history.testing import IntegrationTestCase
from plone import api
from plone.memoize.instance import Mem... | """Test the show_history method.
The history is shown in every case except if 'ajax_load' is found in the REQUEST."""
self.assertTrue(self.viewlet.show_history())
# show_history is False if displayed in a popup, aka 'ajax_load' in the REQUEST
self.portal.REQUEST.set('ajax_load... |
<|file_name|>test_documentbylineviewlet.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from imio.history.config import HISTORY_COMMENT_NOT_VIEWABLE
from imio.history.interfaces import IImioHistory
from imio.history.testing import IntegrationTestCase
from plone import api
from plone.memoize.instance import Mem... | """Test the highlight_history_link method.
History link will be highlighted if last event had a comment and
if that comment is not an ignorable comment."""
adapter = getAdapter(self.portal.doc, IImioHistory, 'workflow')
# not highlighted because '' is an ignored comment
... |
<|file_name|>test_documentbylineviewlet.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from imio.history.config import HISTORY_COMMENT_NOT_VIEWABLE
from imio.history.interfaces import IImioHistory
from imio.history.testing import IntegrationTestCase
from plone import api
from plone.memoize.instance import Mem... | setUp |
<|file_name|>test_documentbylineviewlet.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from imio.history.config import HISTORY_COMMENT_NOT_VIEWABLE
from imio.history.interfaces import IImioHistory
from imio.history.testing import IntegrationTestCase
from plone import api
from plone.memoize.instance import Mem... | test_show_history |
<|file_name|>test_documentbylineviewlet.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from imio.history.config import HISTORY_COMMENT_NOT_VIEWABLE
from imio.history.interfaces import IImioHistory
from imio.history.testing import IntegrationTestCase
from plone import api
from plone.memoize.instance import Mem... | test_highlight_history_link |
<|file_name|>res_users.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2014 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the ... | required=True),
} |
<|file_name|>res_users.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2014 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the ... | _inherit = "res.users"
_columns = {
'xis_user_external_id': fields.integer('XIS external user',
required=True),
} |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
<|fim_middle|>
<|fim▁end|> | ''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlsplit
It exposes the following attributes:
scheme
schemes -- if your scheme has +'s in it, then this will contain a list ... |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | ''' Parse a dsn to parts similar to urlparse.
This is a nuts function that can serve as a good basis to parsing a custom dsn
:param dsn: the dsn to parse
:type dsn: str
:param defaults: any values you want to have defaults for if they aren't in the dsn
:type defaults: di... |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | for f in self.FIELDS:
yield getattr(self, f, '') |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | return len(iter(self)) |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | return getattr(self, field, None) |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | setattr(self, field, value) |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | delattr(self, field) |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | '''the scheme, split by plus signs'''
return self.scheme.split('+') |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | '''return username:password@hostname:port'''
s = ''
prefix = ''
if self.username:
s += self.username
prefix = '@'
if self.password:
s += ":{}".format(self.password)
prefix = '@'
s += "{}{}".format(prefix, self.hostloc)
... |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | '''the path attribute split by /'''
return filter(None, self.path.split('/')) |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | '''the hostname, but I like host better'''
return self.hostname |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | '''return host:port'''
hostloc = self.hostname
if self.port:
hostloc = '{}:{}'.format(hostloc, self.port)
return hostloc |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | ''' Set a default value for key.
This is different than dict's setdefault because it will set default either
if the key doesn't exist, or if the value at the key evaluates to False, so
an empty string or a None will value will be updated.
:param key: the item to update
... |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | '''return the dsn back into url form'''
return urlparse.urlunparse((
self.scheme,
self.netloc,
self.path,
self.params,
self.query_str,
self.fragment,
)) |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | return DSN(self.get_url()) |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | return self.get_url() |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | for k, kv in urlparse.parse_qs(url.query, True, True).iteritems():
if len(kv) > 1:
options[k] = kv
else:
options[k] = kv[0] |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | options[k] = kv |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | options[k] = kv[0] |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | s += self.username
prefix = '@' |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | s += ":{}".format(self.password)
prefix = '@' |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | hostloc = '{}:{}'.format(hostloc, self.port) |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | setattr(self, key, value) |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | __init__ |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | __iter__ |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | __len__ |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | __getitem__ |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | __setitem__ |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | __delitem__ |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | schemes |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | netloc |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | paths |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | host |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | hostloc |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | set_default |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | get_url |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | copy |
<|file_name|>dsntool.py<|end_file_name|><|fim▁begin|>import collections
import re
import urlparse
class DSN(collections.MutableMapping):
''' Hold the results of a parsed dsn.
This is very similar to urlparse.ParseResult tuple.
http://docs.python.org/2/library/urlparse.html#results-of-urlparse-and-urlspli... | __str__ |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-06-06 02:47
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
... | ), |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-06-06 02:47
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
... | initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Car',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('car_model', models.CharField(max_length=20)... |
<|file_name|>Nikon_DX.py<|end_file_name|><|fim▁begin|>import bpy<|fim▁hole|>camera = bpy.context.edit_movieclip.tracking.camera
camera.sensor_width = 23.6
camera.units = 'MILLIMETERS'
camera.pixel_aspect = 1
camera.k1 = 0.0
camera.k2 = 0.0
camera.k3 = 0.0<|fim▁end|> | |
<|file_name|>realview-switcheroo-atomic.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectua... | |
<|file_name|>lexer_rules.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
tokens = [
'LPAREN',
'RPAREN',
'LBRACE',
'RBRACE',
'EQUAL',
'DOUBLE_EQUAL',
'NUMBER',
'COMMA',
'VAR_DEFINITION',
'IF',
'ELSE',
'END',
'ID',
'PRINT'
]
t_LPAREN = r"\("
t_RPAREN = r"\)... | token.lexer.lineno += len(token.value)
|
<|file_name|>lexer_rules.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
tokens = [
'LPAREN',
'RPAREN',
'LBRACE',
'RBRACE',
'EQUAL',
'DOUBLE_EQUAL',
'NUMBER',
'COMMA',
'VAR_DEFINITION',
'IF',
'ELSE',
'END',
'ID',
'PRINT'
]
t_LPAREN = r"\("
t_RPAREN = r"\)... | r"[0-9]+"
token.value = int(token.value)
return token |
<|file_name|>lexer_rules.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
tokens = [
'LPAREN',
'RPAREN',
'LBRACE',
'RBRACE',
'EQUAL',
'DOUBLE_EQUAL',
'NUMBER',
'COMMA',
'VAR_DEFINITION',
'IF',
'ELSE',
'END',
'ID',
'PRINT'
]
t_LPAREN = r"\("
t_RPAREN = r"\)... | r",\sFirst\sof\s(his|her)\sName"
return token |
<|file_name|>lexer_rules.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
tokens = [
'LPAREN',
'RPAREN',
'LBRACE',
'RBRACE',
'EQUAL',
'DOUBLE_EQUAL',
'NUMBER',
'COMMA',
'VAR_DEFINITION',
'IF',
'ELSE',
'END',
'ID',
'PRINT'
]
t_LPAREN = r"\("
t_RPAREN = r"\)... | r"I\spromise"
return token |
<|file_name|>lexer_rules.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
tokens = [
'LPAREN',
'RPAREN',
'LBRACE',
'RBRACE',
'EQUAL',
'DOUBLE_EQUAL',
'NUMBER',
'COMMA',
'VAR_DEFINITION',
'IF',
'ELSE',
'END',
'ID',
'PRINT'
]
t_LPAREN = r"\("
t_RPAREN = r"\)... | r"Mayhaps"
return token |
<|file_name|>lexer_rules.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
tokens = [
'LPAREN',
'RPAREN',
'LBRACE',
'RBRACE',
'EQUAL',
'DOUBLE_EQUAL',
'NUMBER',
'COMMA',
'VAR_DEFINITION',
'IF',
'ELSE',
'END',
'ID',
'PRINT'
]
t_LPAREN = r"\("
t_RPAREN = r"\)... | r"Hodor"
return token |
<|file_name|>lexer_rules.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
tokens = [
'LPAREN',
'RPAREN',
'LBRACE',
'RBRACE',
'EQUAL',
'DOUBLE_EQUAL',
'NUMBER',
'COMMA',
'VAR_DEFINITION',
'IF',
'ELSE',
'END',
'ID',
'PRINT'
]
t_LPAREN = r"\("
t_RPAREN = r"\)... | r"And\snow\shis\swatch\sis\sended"
return token |
<|file_name|>lexer_rules.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
tokens = [
'LPAREN',
'RPAREN',
'LBRACE',
'RBRACE',
'EQUAL',
'DOUBLE_EQUAL',
'NUMBER',
'COMMA',
'VAR_DEFINITION',
'IF',
'ELSE',
'END',
'ID',
'PRINT'
]
t_LPAREN = r"\("
t_RPAREN = r"\)... | r"[a-zA-Z][_a-zA-Z0-9]*"
return token |
<|file_name|>lexer_rules.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
tokens = [
'LPAREN',
'RPAREN',
'LBRACE',
'RBRACE',
'EQUAL',
'DOUBLE_EQUAL',
'NUMBER',
'COMMA',
'VAR_DEFINITION',
'IF',
'ELSE',
'END',
'ID',
'PRINT'
]
t_LPAREN = r"\("
t_RPAREN = r"\)... | r"\n+"
token.lexer.lineno += len(token.value) |
<|file_name|>lexer_rules.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
tokens = [
'LPAREN',
'RPAREN',
'LBRACE',
'RBRACE',
'EQUAL',
'DOUBLE_EQUAL',
'NUMBER',
'COMMA',
'VAR_DEFINITION',
'IF',
'ELSE',
'END',
'ID',
'PRINT'
]
t_LPAREN = r"\("
t_RPAREN = r"\)... | r"//(.*)\n"
token.lexer.lineno += 1 |
<|file_name|>lexer_rules.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
tokens = [
'LPAREN',
'RPAREN',
'LBRACE',
'RBRACE',
'EQUAL',
'DOUBLE_EQUAL',
'NUMBER',
'COMMA',
'VAR_DEFINITION',
'IF',
'ELSE',
'END',
'ID',
'PRINT'
]
t_LPAREN = r"\("
t_RPAREN = r"\)... | raise Exception("Sintax error: Unknown token on line {0}. \"{1}\"".format(token.lineno, token.value.partition("\n")[0])) |
<|file_name|>lexer_rules.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
tokens = [
'LPAREN',
'RPAREN',
'LBRACE',
'RBRACE',
'EQUAL',
'DOUBLE_EQUAL',
'NUMBER',
'COMMA',
'VAR_DEFINITION',
'IF',
'ELSE',
'END',
'ID',
'PRINT'
]
t_LPAREN = r"\("
t_RPAREN = r"\)... | t_NUMBER |
<|file_name|>lexer_rules.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
tokens = [
'LPAREN',
'RPAREN',
'LBRACE',
'RBRACE',
'EQUAL',
'DOUBLE_EQUAL',
'NUMBER',
'COMMA',
'VAR_DEFINITION',
'IF',
'ELSE',
'END',
'ID',
'PRINT'
]
t_LPAREN = r"\("
t_RPAREN = r"\)... | t_VAR_DEFINITION |
<|file_name|>lexer_rules.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
tokens = [
'LPAREN',
'RPAREN',
'LBRACE',
'RBRACE',
'EQUAL',
'DOUBLE_EQUAL',
'NUMBER',
'COMMA',
'VAR_DEFINITION',
'IF',
'ELSE',
'END',
'ID',
'PRINT'
]
t_LPAREN = r"\("
t_RPAREN = r"\)... | t_IF |
<|file_name|>lexer_rules.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
tokens = [
'LPAREN',
'RPAREN',
'LBRACE',
'RBRACE',
'EQUAL',
'DOUBLE_EQUAL',
'NUMBER',
'COMMA',
'VAR_DEFINITION',
'IF',
'ELSE',
'END',
'ID',
'PRINT'
]
t_LPAREN = r"\("
t_RPAREN = r"\)... | t_ELSE |
<|file_name|>lexer_rules.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
tokens = [
'LPAREN',
'RPAREN',
'LBRACE',
'RBRACE',
'EQUAL',
'DOUBLE_EQUAL',
'NUMBER',
'COMMA',
'VAR_DEFINITION',
'IF',
'ELSE',
'END',
'ID',
'PRINT'
]
t_LPAREN = r"\("
t_RPAREN = r"\)... | t_PRINT |
<|file_name|>lexer_rules.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
tokens = [
'LPAREN',
'RPAREN',
'LBRACE',
'RBRACE',
'EQUAL',
'DOUBLE_EQUAL',
'NUMBER',
'COMMA',
'VAR_DEFINITION',
'IF',
'ELSE',
'END',
'ID',
'PRINT'
]
t_LPAREN = r"\("
t_RPAREN = r"\)... | t_END |
<|file_name|>lexer_rules.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
tokens = [
'LPAREN',
'RPAREN',
'LBRACE',
'RBRACE',
'EQUAL',
'DOUBLE_EQUAL',
'NUMBER',
'COMMA',
'VAR_DEFINITION',
'IF',
'ELSE',
'END',
'ID',
'PRINT'
]
t_LPAREN = r"\("
t_RPAREN = r"\)... | t_ID |
<|file_name|>lexer_rules.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
tokens = [
'LPAREN',
'RPAREN',
'LBRACE',
'RBRACE',
'EQUAL',
'DOUBLE_EQUAL',
'NUMBER',
'COMMA',
'VAR_DEFINITION',
'IF',
'ELSE',
'END',
'ID',
'PRINT'
]
t_LPAREN = r"\("
t_RPAREN = r"\)... | t_NEWLINE |
<|file_name|>lexer_rules.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
tokens = [
'LPAREN',
'RPAREN',
'LBRACE',
'RBRACE',
'EQUAL',
'DOUBLE_EQUAL',
'NUMBER',
'COMMA',
'VAR_DEFINITION',
'IF',
'ELSE',
'END',
'ID',
'PRINT'
]
t_LPAREN = r"\("
t_RPAREN = r"\)... | t_IGNORE_COMMENTS |
<|file_name|>lexer_rules.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
tokens = [
'LPAREN',
'RPAREN',
'LBRACE',
'RBRACE',
'EQUAL',
'DOUBLE_EQUAL',
'NUMBER',
'COMMA',
'VAR_DEFINITION',
'IF',
'ELSE',
'END',
'ID',
'PRINT'
]
t_LPAREN = r"\("
t_RPAREN = r"\)... | t_error |
<|file_name|>basic.py<|end_file_name|><|fim▁begin|>a = a # e 4
a = 1 # 0 int
l = [a] # 0 [int]
d = {a:l} # 0 {int:[int]}
s = "abc"
c = ord(s[2].lower()[0]) # 0 int # 4 (str) -> int
l2 = [range(i) for i in d] # 0 [[int]]
y = [(a,b) for a,b in {1:'2'}.iteritems()] # 0 [(int,str)]
b = 1 # 0 int
if 0:
b ... | else:
b = str(b) # 4 str # 12 int
r = 0 # 0 int |
<|file_name|>basic.py<|end_file_name|><|fim▁begin|>a = a # e 4
a = 1 # 0 int
l = [a] # 0 [int]
d = {a:l} # 0 {int:[int]}
s = "abc"
c = ord(s[2].lower()[0]) # 0 int # 4 (str) -> int
l2 = [range(i) for i in d] # 0 [[int]]
y = [(a,b) for a,b in {1:'2'}.iteritems()] # 0 [(int,str)]
b = 1 # 0 int
if 0:
b ... | x = `1` # 4 str |
<|file_name|>basic.py<|end_file_name|><|fim▁begin|>a = a # e 4
a = 1 # 0 int
l = [a] # 0 [int]
d = {a:l} # 0 {int:[int]}
s = "abc"
c = ord(s[2].lower()[0]) # 0 int # 4 (str) -> int
l2 = [range(i) for i in d] # 0 [[int]]
y = [(a,b) for a,b in {1:'2'}.iteritems()] # 0 [(int,str)]
b = 1 # 0 int
if 0:
... | b = '' # 4 str |
<|file_name|>basic.py<|end_file_name|><|fim▁begin|>a = a # e 4
a = 1 # 0 int
l = [a] # 0 [int]
d = {a:l} # 0 {int:[int]}
s = "abc"
c = ord(s[2].lower()[0]) # 0 int # 4 (str) -> int
l2 = [range(i) for i in d] # 0 [[int]]
y = [(a,b) for a,b in {1:'2'}.iteritems()] # 0 [(int,str)]
b = 1 # 0 int
if 0:
b ... | b = str(b) # 4 str # 12 int |
<|file_name|>basic.py<|end_file_name|><|fim▁begin|>a = a # e 4
a = 1 # 0 int
l = [a] # 0 [int]
d = {a:l} # 0 {int:[int]}
s = "abc"
c = ord(s[2].lower()[0]) # 0 int # 4 (str) -> int
l2 = [range(i) for i in d] # 0 [[int]]
y = [(a,b) for a,b in {1:'2'}.iteritems()] # 0 [(int,str)]
b = 1 # 0 int
if 0:
b ... | r = str(r) # 4 str # 12 int |
<|file_name|>basic.py<|end_file_name|><|fim▁begin|>a = a # e 4
a = 1 # 0 int
l = [a] # 0 [int]
d = {a:l} # 0 {int:[int]}
s = "abc"
c = ord(s[2].lower()[0]) # 0 int # 4 (str) -> int
l2 = [range(i) for i in d] # 0 [[int]]
y = [(a,b) for a,b in {1:'2'}.iteritems()] # 0 [(int,str)]
b = 1 # 0 int
if 0:
b ... | f |
<|file_name|>here-now.py<|end_file_name|><|fim▁begin|>## www.pubnub.com - PubNub Real-time push service in the cloud.
# coding=utf8
## PubNub Real-time Push APIs and Notifications Framework
## Copyright (c) 2010 Stephen Blum
## http://www.pubnub.com/<|fim▁hole|>from pubnub import PubnubTornado as Pubnub
publish_key =... |
import sys |
<|file_name|>here-now.py<|end_file_name|><|fim▁begin|>## www.pubnub.com - PubNub Real-time push service in the cloud.
# coding=utf8
## PubNub Real-time Push APIs and Notifications Framework
## Copyright (c) 2010 Stephen Blum
## http://www.pubnub.com/
import sys
from pubnub import PubnubTornado as Pubnub
publish_key... | print(message) |
<|file_name|>here-now.py<|end_file_name|><|fim▁begin|>## www.pubnub.com - PubNub Real-time push service in the cloud.
# coding=utf8
## PubNub Real-time Push APIs and Notifications Framework
## Copyright (c) 2010 Stephen Blum
## http://www.pubnub.com/
import sys
from pubnub import PubnubTornado as Pubnub
publish_key... | callback |
<|file_name|>MercurialHasRevisionRule.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2014 Will Thames <will@thames.id.au>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restr... | # THE SOFTWARE.
|
<|file_name|>MercurialHasRevisionRule.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2014 Will Thames <will@thames.id.au>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restr... | id = 'hg-latest'
shortdesc = 'Mercurial checkouts must contain explicit revision'
description = (
'All version control checkouts must point to '
'an explicit commit or tag, not just ``latest``'
)
severity = 'MEDIUM'
tags = ['idempotency']
version_added = 'historic'
def m... |
<|file_name|>MercurialHasRevisionRule.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2014 Will Thames <will@thames.id.au>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restr... | return bool(
task['action']['__ansible_module__'] == 'hg'
and task['action'].get('revision', 'default') == 'default'
) |
<|file_name|>MercurialHasRevisionRule.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2014 Will Thames <will@thames.id.au>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restr... | from typing import Optional
from ansiblelint.file_utils import Lintable |
<|file_name|>MercurialHasRevisionRule.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2014 Will Thames <will@thames.id.au>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restr... | matchtask |
<|file_name|>F57.py<|end_file_name|><|fim▁begin|>import fechbase
class Records(fechbase.RecordsBase):
def __init__(self):
fechbase.RecordsBase.__init__(self)
self.fields = [
{'name': 'FORM TYPE', 'number': '1'},
{'name': 'FILER FEC CMTE ID', 'number': '2'},
{'name... | {'name': 'CONDUIT ZIP', 'number': '30'}, |
<|file_name|>F57.py<|end_file_name|><|fim▁begin|>import fechbase
class Records(fechbase.RecordsBase):
<|fim_middle|>
<|fim▁end|> | def __init__(self):
fechbase.RecordsBase.__init__(self)
self.fields = [
{'name': 'FORM TYPE', 'number': '1'},
{'name': 'FILER FEC CMTE ID', 'number': '2'},
{'name': 'ENTITY TYPE', 'number': '3'},
{'name': 'NAME (Payee)', 'number': '4'},
{'n... |
<|file_name|>F57.py<|end_file_name|><|fim▁begin|>import fechbase
class Records(fechbase.RecordsBase):
def __init__(self):
<|fim_middle|>
<|fim▁end|> | fechbase.RecordsBase.__init__(self)
self.fields = [
{'name': 'FORM TYPE', 'number': '1'},
{'name': 'FILER FEC CMTE ID', 'number': '2'},
{'name': 'ENTITY TYPE', 'number': '3'},
{'name': 'NAME (Payee)', 'number': '4'},
{'name': 'STREET 1', 'numbe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.