function stringlengths 11 56k | repo_name stringlengths 5 60 | features list |
|---|---|---|
def main():
print("Storage Name: %s" % (storage_name))
print("Block Count: %s" % (block_count))
print("Block Size: %s" % (MemorySize(block_size)))
print("Total Memory: %s"
% (MemorySize(block_size*block_count)))
print("Actual Storage Required: %s"
% (MemorySize(
En... | ghackebeil/PyORAM | [
25,
1,
25,
1,
1457916027
] |
def test_defaults_to_pythonanywhere_dot_com_if_no_environment_variables(self):
assert get_api_endpoint() == "https://www.pythonanywhere.com/api/v0/user/{username}/{flavor}/" | pythonanywhere/helper_scripts | [
31,
11,
31,
11,
1484133551
] |
def test_gets_domain_from_pythonanywhere_domain_and_adds_on_www_if_set_but_no_pythonanywhere_site(
self, monkeypatch | pythonanywhere/helper_scripts | [
31,
11,
31,
11,
1484133551
] |
def test_raises_on_401(self, api_token, api_responses):
url = "https://foo.com/"
api_responses.add(responses.POST, url, status=401, body="nope")
with pytest.raises(AuthenticationError) as e:
call_api(url, "post")
assert str(e.value) == "Authentication error 401 calling API: n... | pythonanywhere/helper_scripts | [
31,
11,
31,
11,
1484133551
] |
def __init__(self, notification_service: NotificationService, download_service: AbstractDownloadService,
repository_url: str, repo_path: Path, patch_file: Path):
self._notification_service = notification_service
self._download_service = download_service
self._url = repository_ur... | Brutus5000/BiReUS | [
1,
1,
1,
4,
1481245107
] |
def get_factory(cls, protocol: int):
if cls._patch_tasks is None:
cls._patch_tasks = dict()
for patch_task_version in PatchTask.__subclasses__():
cls._patch_tasks[patch_task_version.get_version()] = patch_task_version.create
if protocol in cls._patch_tasks:
... | Brutus5000/BiReUS | [
1,
1,
1,
4,
1481245107
] |
def get_version(cls) -> int:
pass | Brutus5000/BiReUS | [
1,
1,
1,
4,
1481245107
] |
def create(cls, notification_service: NotificationService, download_service: AbstractDownloadService, repository_url: str, repo_path: Path,
patch_file: Path) -> 'PatchTask':
"""
Abstract factory function for dynamic patcher initialization
same params as in constructor!
"""... | Brutus5000/BiReUS | [
1,
1,
1,
4,
1481245107
] |
def random_path():
return tempfile.mkdtemp() | richo/groundstation | [
57,
12,
57,
10,
1356253789
] |
def setUp(self):
self.path = random_path()
self.repo = self.storeClass(self.path) | richo/groundstation | [
57,
12,
57,
10,
1356253789
] |
def create_update_object(self, parents, data):
return UpdateObject(parents, data) | richo/groundstation | [
57,
12,
57,
10,
1356253789
] |
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def begin_delete(
self,
resource_group_name, # type: str
service_endpoint_policy_name, # type: str
service_endpoint_policy_definition_name, # type: str
**kwargs # type: Any | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {}) | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def get(
self,
resource_group_name, # type: str
service_endpoint_policy_name, # type: str
service_endpoint_policy_definition_name, # type: str
**kwargs # type: Any | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def _create_or_update_initial(
self,
resource_group_name, # type: str
service_endpoint_policy_name, # type: str
service_endpoint_policy_definition_name, # type: str
service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition"
**kwargs # type... | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def begin_create_or_update(
self,
resource_group_name, # type: str
service_endpoint_policy_name, # type: str
service_endpoint_policy_definition_name, # type: str
service_endpoint_policy_definitions, # type: "_models.ServiceEndpointPolicyDefinition"
**kwargs # type: A... | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def get_long_running_output(pipeline_response):
deserialized = self._deserialize('ServiceEndpointPolicyDefinition', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def list_by_resource_group(
self,
resource_group_name, # type: str
service_endpoint_policy_name, # type: str
**kwargs # type: Any | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def prepare_request(next_link=None):
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
if not next_link:
# Construct URL
url = self.list_by_reso... | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=resp... | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def isInterleave(self, s1, s2, s3):
"""
dfs
dp | algorhythms/LeetCode | [
823,
267,
823,
3,
1403872362
] |
def isInterleave_TLE(self, s1, s2, s3):
"""
dfs
Time Limit Exceeded
:param s1:
:param s2:
:param s3:
:return: boolean
"""
if not s3:
return True
letter = s3[0]
if s1 and s1[0] == letter:
if self.... | algorhythms/LeetCode | [
823,
267,
823,
3,
1403872362
] |
def __init__(self, caption, label=None, headings=None, rows=None, footnotes=None, **kwargs):
super(Table, self).__init__(caption=caption, label=label, **kwargs)
self.headings = headings if headings is not None else [] # list(list(Cell))
self.rows = rows if rows is not None else [] # list(list(... | mcs07/ChemDataExtractor | [
238,
100,
238,
21,
1475452201
] |
def document(self):
return self._document | mcs07/ChemDataExtractor | [
238,
100,
238,
21,
1475452201
] |
def document(self, document):
self._document = document
self.caption.document = document
for row in self.headings:
for cell in row:
cell.document = document
for row in self.rows:
for cell in row:
cell.document = document | mcs07/ChemDataExtractor | [
238,
100,
238,
21,
1475452201
] |
def _repr_html_(self):
html_lines = ['<table class="table">']
html_lines.append(self.caption._repr_html_ ())
html_lines.append('<thead>')
for hrow in self.headings:
html_lines.append('<tr>')
for cell in hrow:
html_lines.append('<th>' + cell.text +... | mcs07/ChemDataExtractor | [
238,
100,
238,
21,
1475452201
] |
def records(self):
"""Chemical records that have been parsed from the table."""
caption_records = self.caption.records
# Parse headers to extract contextual data and determine value parser for the column
value_parsers = {}
header_compounds = defaultdict(list)
table_record... | mcs07/ChemDataExtractor | [
238,
100,
238,
21,
1475452201
] |
def abbreviation_definitions(self):
"""Empty list. Abbreviation detection is disabled within table cells."""
return [] | mcs07/ChemDataExtractor | [
238,
100,
238,
21,
1475452201
] |
def dpn92(num_classes=1000):
return DPN(num_init_features=64, k_R=96, G=32, k_sec=(3,4,20,3), inc_sec=(16,32,24,128), num_classes=num_classes) | oyam/pytorch-DPNs | [
91,
30,
91,
1,
1499940247
] |
def dpn131(num_classes=1000):
return DPN(num_init_features=128, k_R=160, G=40, k_sec=(4,8,28,3), inc_sec=(16,32,32,128), num_classes=num_classes) | oyam/pytorch-DPNs | [
91,
30,
91,
1,
1499940247
] |
def __init__(self, in_chs, num_1x1_a, num_3x3_b, num_1x1_c, inc, G, _type='normal'):
super(DualPathBlock, self).__init__()
self.num_1x1_c = num_1x1_c
if _type is 'proj':
key_stride = 1
self.has_proj = True
if _type is 'down':
key_stride = 2
... | oyam/pytorch-DPNs | [
91,
30,
91,
1,
1499940247
] |
def forward(self, x):
data_in = torch.cat(x, dim=1) if isinstance(x, list) else x
if self.has_proj:
data_o = self.c1x1_w(data_in)
data_o1 = data_o[:,:self.num_1x1_c,:,:]
data_o2 = data_o[:,self.num_1x1_c:,:,:]
else:
data_o1 = x[0]
data_... | oyam/pytorch-DPNs | [
91,
30,
91,
1,
1499940247
] |
def __init__(self, num_init_features=64, k_R=96, G=32,
k_sec=(3, 4, 20, 3), inc_sec=(16,32,24,128), num_classes=1000):
super(DPN, self).__init__()
blocks = OrderedDict()
# conv1
blocks['conv1'] = nn.Sequential(
nn.Conv2d(3, num_init_features, kernel_size=7,... | oyam/pytorch-DPNs | [
91,
30,
91,
1,
1499940247
] |
def _find_contpix_given_cuts(f_cut, sig_cut, wl, fluxes, ivars):
""" Find and return continuum pixels given the flux and sigma cut
Parameters
----------
f_cut: float
the upper limit imposed on the quantity (fbar-1)
sig_cut: float
the upper limit imposed on the quantity (f_sig)
w... | annayqho/TheCannon | [
33,
14,
33,
15,
1411721658
] |
def parseArgs():
parser = argparse.ArgumentParser()
parser.add_argument("cg1", help="This is the first .CGX (CommonGraph) file")
parser.add_argument("cg2", help="This is the second .CGX (CommonGraph) file")
parser.add_argument("ds", help="This is the output filename of a .DSX (DiffSet) file")
return... | oderby/VVD | [
20,
5,
20,
1,
1443293871
] |
def build_list_request(
subscription_id: str,
resource_group_name: str,
resource_name: str,
**kwargs: Any | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def build_get_request(
subscription_id: str,
resource_group_name: str,
resource_name: str,
private_endpoint_connection_name: str,
**kwargs: Any | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def build_update_request(
subscription_id: str,
resource_group_name: str,
resource_name: str,
private_endpoint_connection_name: str,
*,
json: JSONType = None,
content: Any = None,
**kwargs: Any | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def build_delete_request_initial(
subscription_id: str,
resource_group_name: str,
resource_name: str,
private_endpoint_connection_name: str,
**kwargs: Any | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def list(
self,
resource_group_name: str,
resource_name: str,
**kwargs: Any | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def get(
self,
resource_group_name: str,
resource_name: str,
private_endpoint_connection_name: str,
**kwargs: Any | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def update(
self,
resource_group_name: str,
resource_name: str,
private_endpoint_connection_name: str,
parameters: "_models.PrivateEndpointConnection",
**kwargs: Any | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def _delete_initial(
self,
resource_group_name: str,
resource_name: str,
private_endpoint_connection_name: str,
**kwargs: Any | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def begin_delete(
self,
resource_group_name: str,
resource_name: str,
private_endpoint_connection_name: str,
**kwargs: Any | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {}) | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def test_handle_errors(self):
l1 = verifier.send_to_retry
verifier.handle_errors()
l2 = verifier.send_to_retry
self.assertGreater(len(l1), len(l2))
self.assertEqual(len(l2), len(l1) + len(run_info['error_list'])) | zamattiac/ROSIEBot | [
1,
3,
1,
5,
1464891428
] |
def test_generate_page_dictionary(self):
d1 = v.generate_page_dictionary('wiki/')
self.assertGreater(len(d1), 0) | zamattiac/ROSIEBot | [
1,
3,
1,
5,
1464891428
] |
def __init__(self, msg_center):
super(FacialEventTranslator, self).__init__(msg_center)
# instance vars
self.touching_forehead = False
self.last_clench_streak = 0
self.clench_start_time = None
self.clench_last_one = False
self.blink_in_progress = False
se... | prydom/MuseIC-EventServer | [
1,
1,
1,
1,
1411803305
] |
def subscribe(self, key):
super(FacialEventTranslator, self).subscribe(key) | prydom/MuseIC-EventServer | [
1,
1,
1,
1,
1411803305
] |
def clenchEndEvent(self, event_time):
clench_time = abs( event_time - self.clench_start_time )
print("EVENT: Clench for " + str(clench_time) + " seconds")
self.publish('clench_end', clench_time)
if clench_time > 1:
rounded_int = int(round(clench_time * self.seek_multiplyer))
... | prydom/MuseIC-EventServer | [
1,
1,
1,
1,
1411803305
] |
def blinkPeriodEnd(self):
self.publish('blink_period_end', None)
if self.num_of_blinks_in_row > 1:
self.blinksInARowEvent(self.num_of_blinks_in_row)
self.num_of_blinks_in_row = 0
self.first_blink = None
self.blink_timer = None | prydom/MuseIC-EventServer | [
1,
1,
1,
1,
1411803305
] |
def setUp(self):
self.patcher = mock.patch('luigi_slack.api.SlackAPI')
self.mock_SlackAPI = self.patcher.start()
self.token = 'dummy-token'
self.channels = ['channel1', 'channel2']
self.bot = SlackBot(self.token, channels=self.channels) | bonzanini/luigi-slack | [
46,
13,
46,
3,
1446892260
] |
def test_send_notification(self):
"""Test SlackAPI is called by send_notification()"""
self.bot.send_notification() | bonzanini/luigi-slack | [
46,
13,
46,
3,
1446892260
] |
def test_set_handlers_valid(self):
"""Test set_handlers() for valid events"""
bot = SlackBot(self.token, events=[SUCCESS, FAILURE])
bot.set_handlers() | bonzanini/luigi-slack | [
46,
13,
46,
3,
1446892260
] |
def test_event_label(self):
"""Test event labels for output"""
fixtures = {
'SUCCESS': 'Success',
'FAILURE': 'Failure',
'MISSING': 'Missing',
}
for event, expected in fixtures.items():
self.assertEqual(event_label(event), expected) | bonzanini/luigi-slack | [
46,
13,
46,
3,
1446892260
] |
def setUp(self):
self.patcher = mock.patch('luigi_slack.api.SlackAPI')
self.mock_SlackAPI = self.patcher.start()
self.token = 'dummy-token'
self.channels = ['channel1'] | bonzanini/luigi-slack | [
46,
13,
46,
3,
1446892260
] |
def test_success(self):
"""Test successful task if queued"""
bot = SlackBot(self.token, events=[SUCCESS], channels=self.channels)
bot.set_handlers()
task = luigi.Task()
self.assertEqual(len(bot.event_queue.get(SUCCESS, [])), 0)
task.trigger_event(luigi.event.Event.SUCCESS... | bonzanini/luigi-slack | [
46,
13,
46,
3,
1446892260
] |
def test_different_task_doesnt_empty_queue(self):
"""Test a successful task doesn't empty queue with different task"""
class CustomTask(luigi.Task):
pass
bot = SlackBot(self.token, events=[SUCCESS, FAILURE], channels=self.channels)
bot.set_handlers()
task1 = luigi.Tas... | bonzanini/luigi-slack | [
46,
13,
46,
3,
1446892260
] |
def test_failure(self):
"""Test failure event adds task in queue"""
bot = SlackBot(self.token, events=[FAILURE], channels=self.channels)
bot.set_handlers()
task = luigi.Task()
self.assertEqual(len(bot.event_queue.get(FAILURE, [])), 0)
task.trigger_event(luigi.event.Event.... | bonzanini/luigi-slack | [
46,
13,
46,
3,
1446892260
] |
def test_event_not_implemented(self):
"""Test processing time event is not implemented yet"""
bot = SlackBot(self.token, events=[PROCESSING_TIME], channels=self.channels)
bot.set_handlers()
task = luigi.Task()
self.assertRaises(NotImplementedError, task.trigger_event(luigi.event.... | bonzanini/luigi-slack | [
46,
13,
46,
3,
1446892260
] |
def set_handlers(self):
return True | bonzanini/luigi-slack | [
46,
13,
46,
3,
1446892260
] |
def test():
"""
A simple test routine to draw the quadcopter model
""" | guiccbr/autonomous-fuzzy-quadcopter | [
10,
8,
10,
5,
1426022747
] |
def __init__(
self,
plotly_name="showticklabels",
parent_name="sunburst.marker.colorbar",
**kwargs | plotly/python-api | [
13052,
2308,
13052,
1319,
1385013188
] |
def __init__(
self,
plotly_name="typesrc",
parent_name="scatterternary.marker.gradient",
**kwargs | plotly/plotly.py | [
13052,
2308,
13052,
1319,
1385013188
] |
def set_override_tba_test(monkeypatch: MonkeyPatch) -> None:
monkeypatch.setenv("TBA_UNIT_TEST", "false") | the-blue-alliance/the-blue-alliance | [
334,
153,
334,
422,
1283632451
] |
def set_dev(monkeypatch: MonkeyPatch) -> None:
monkeypatch.setenv("GAE_ENV", "localdev") | the-blue-alliance/the-blue-alliance | [
334,
153,
334,
422,
1283632451
] |
def set_prod(monkeypatch: MonkeyPatch) -> None:
monkeypatch.setenv("GAE_ENV", "standard") | the-blue-alliance/the-blue-alliance | [
334,
153,
334,
422,
1283632451
] |
def set_project(monkeypatch: MonkeyPatch) -> None:
monkeypatch.setenv("GOOGLE_CLOUD_PROJECT", "tbatv-prod-hrd") | the-blue-alliance/the-blue-alliance | [
334,
153,
334,
422,
1283632451
] |
def set_storage_mode_remote(monkeypatch: MonkeyPatch) -> None:
monkeypatch.setenv("STORAGE_MODE", "remote") | the-blue-alliance/the-blue-alliance | [
334,
153,
334,
422,
1283632451
] |
def set_storage_path(monkeypatch: MonkeyPatch) -> None:
monkeypatch.setenv("STORAGE_PATH", "some/fake/path") | the-blue-alliance/the-blue-alliance | [
334,
153,
334,
422,
1283632451
] |
def test_client_for_env_unit_test_remote(set_storage_mode_remote):
client = storage._client_for_env()
assert type(client) is InMemoryClient | the-blue-alliance/the-blue-alliance | [
334,
153,
334,
422,
1283632451
] |
def test_client_for_env_dev_path(set_override_tba_test, set_dev, set_storage_path):
client = storage._client_for_env()
assert type(client) is LocalStorageClient
assert client.base_path == Path("some/fake/path") | the-blue-alliance/the-blue-alliance | [
334,
153,
334,
422,
1283632451
] |
def test_client_for_env_dev_remote(
set_override_tba_test, set_dev, set_storage_mode_remote, set_project | the-blue-alliance/the-blue-alliance | [
334,
153,
334,
422,
1283632451
] |
def test_client_for_env_production_no_project(set_override_tba_test, set_prod):
with pytest.raises(
Exception,
match=re.escape(
"Environment.project (GOOGLE_CLOUD_PROJECT) unset - should be set in production."
),
):
storage._client_for_env() | the-blue-alliance/the-blue-alliance | [
334,
153,
334,
422,
1283632451
] |
def test_write():
file_name = "some_file.json"
content = "some_content"
client = Mock()
with patch.object(storage, "_client_for_env", return_value=client):
storage.write(file_name, content)
client.write.assert_called_with(file_name, content) | the-blue-alliance/the-blue-alliance | [
334,
153,
334,
422,
1283632451
] |
def extra_downloader_converter(value):
"""Parses extra_{downloader,converter} arguments.
Parameters
----------
value : iterable or str
If the value is a string, it is split into a list using spaces
as delimiters. Otherwise, it is returned as is.
"""
if isinstance(value, six.str... | mila-udem/fuel | [
851,
262,
851,
90,
1423773764
] |
def __init__(self):
self.config = {} | mila-udem/fuel | [
851,
262,
851,
90,
1423773764
] |
def __getattr__(self, key):
if key == 'config' or key not in self.config:
raise AttributeError
config_setting = self.config[key]
if 'value' in config_setting:
value = config_setting['value']
elif ('env_var' in config_setting and
config_setting['env_v... | mila-udem/fuel | [
851,
262,
851,
90,
1423773764
] |
def add_config(self, key, type_, default=NOT_SET, env_var=None):
"""Add a configuration setting.
Parameters
----------
key : str
The name of the configuration setting. This must be a valid
Python attribute name i.e. alphanumeric with underscores.
type : f... | mila-udem/fuel | [
851,
262,
851,
90,
1423773764
] |
def make_cookie_file(user_referrer):
cookie_file = '{}:{}'.format(user_referrer.campaign.key, user_referrer.key)
return cookie_file | moneypark/whydjango | [
1,
7,
1,
48,
1507605161
] |
def setUp(self):
campaign = CampaignFactory(
bonus_policy={
'click': 1,
'registration': 6,
}
)
self.user_referrer = UserReferrerFactory(
campaign=campaign
)
self.user = UserFactory() | moneypark/whydjango | [
1,
7,
1,
48,
1507605161
] |
def test_unreferred_user_registered(self):
request = HttpRequest()
models.associate_registered_user_with_referral("", user=self.user, request=request)
# new user is in the database
user_in_db = User.objects.get(username=self.user.username)
self.assertEqual(user_in_db.username, s... | moneypark/whydjango | [
1,
7,
1,
48,
1507605161
] |
def test_login(self):
leaf = Leaf(USERNAME, PASSWORD)
assert leaf.VIN == "vin123"
assert leaf.custom_sessionid == "csessid" | nricklin/leafpy | [
16,
7,
16,
53,
1493055618
] |
def test_exeption_raised_when_bad_credentials_passed(self):
with self.assertRaises(Exception) as w:
leaf = Leaf('bad_email@domain.com','invalidpassword') | nricklin/leafpy | [
16,
7,
16,
53,
1493055618
] |
def test_exception_raised_when_bad_vin_and_customsessionid_used(self):
leaf = Leaf(VIN='vin345',custom_sessionid='csid123')
with self.assertRaises(Exception) as w:
leaf.BatteryStatusRecordsRequest() | nricklin/leafpy | [
16,
7,
16,
53,
1493055618
] |
def test_login_with_only_VIN_raises_exception(self):
with self.assertRaises(Exception):
leaf = Leaf(VIN='vin123') | nricklin/leafpy | [
16,
7,
16,
53,
1493055618
] |
def test_login_with_no_args_raises_exception(self):
with self.assertRaises(Exception):
leaf = Leaf() | nricklin/leafpy | [
16,
7,
16,
53,
1493055618
] |
def read_region(config, *args, **kwargs):
"""Snip-out target regions from nc4 file
Quick and dirty hax to reduce the size of data read in from netCDF files.
Keeps a memory leak in the module from blowing up the script. Not
the best way to handle this.
Parameters
----------
config : dict
... | jrising/prospectus-tools | [
2,
7,
2,
2,
1448042602
] |
def iterate_regions(filepath, column, config={}):
global deltamethod_vcv
do_deltamethod = False if configs.is_parallel_deltamethod(config) else config.get('deltamethod', None)
if column is not None or 'costs' not in filepath:
years, regions, data = read_region(config, filepath, column if column is ... | jrising/prospectus-tools | [
2,
7,
2,
2,
1448042602
] |
def main():
"""Main function"""
img = Image.open("test.jpeg")
# Print the image's EXIF metadata dictionary indexed by EXIF numeric tags
exif_data_num_dict = img._getexif()
print exif_data_num_dict
# Print the image's EXIF metadata dictionary indexed by EXIF tag name strings
exif_data_str_... | jeremiedecock/snippets | [
20,
6,
20,
1,
1433499549
] |
def __init__(self, directory_id, private_key, url=LAUNCHKEY_PRODUCTION,
testing=False, transport=None):
"""
:param directory_id: UUID for the requesting directory
:param private_key: PEM formatted private key string
:param url: URL for the LaunchKey API
:param te... | LaunchKey/launchkey-python | [
20,
7,
20,
5,
1372713315
] |
def _genCommentHeader(comment):
lines = []
lines.append('/*********************************************************************************************************************')
lines.append('* %s'%comment)
lines.append('***********************************************************************************... | cogu/autosar | [
233,
130,
233,
19,
1469005526
] |
def _genCommentHeader2(comment):
"""
Same as _genCommentHeader but returns a C sequence instead of raw strings
"""
code = C.sequence()
code.append(C.line('/*********************************************************************************************************************'))
code.append(C.line(... | cogu/autosar | [
233,
130,
233,
19,
1469005526
] |
def __init__(self, partition, useDefaultTypes=True):
self.partition = partition
self.defaultTypes = {}
if useDefaultTypes:
self._initDefaultType() | cogu/autosar | [
233,
130,
233,
19,
1469005526
] |
def generate(self, dest_dir = '.', file_name='Rte_Type.h'):
"""
Generates Rte_Type.h
Note: The last argument has been deprecated and is no longer in use
"""
if self.partition.isFinalized == False:
self.partition.finalize()
file_path = os.path.join(dest_dir, file_name)... | cogu/autosar | [
233,
130,
233,
19,
1469005526
] |
def _initDefaultType(self):
self.defaultTypes['Boolean']=C.sequence().extend([C.statement(C.typedef('boolean', 'Boolean'))])
self.defaultTypes['UInt8']=C.sequence().extend([C.statement(C.typedef('uint8', 'UInt8')), C.define('UInt8_LowerLimit', '((UInt8)0u)'), C.define('UInt8_UpperLimit', '((UInt8)255u)')]... | cogu/autosar | [
233,
130,
233,
19,
1469005526
] |
def _findUnusedDefaultTypes(self, ws, typerefs):
defaultTypeNames = set(self.defaultTypes.keys())
usedTypeNames = set() | cogu/autosar | [
233,
130,
233,
19,
1469005526
] |
def _typename(bitcount,minval):
if bitcount <=8:
return 'uint8' if minval >= 0 else 'sint8'
elif bitcount <=16:
return 'uint16' if minval >= 0 else 'sint16'
elif bitcount <=32:
return 'uint32' if minval >= 0 else 'sint32'
elif bitcount <=64:
return 'ui... | cogu/autosar | [
233,
130,
233,
19,
1469005526
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.