prompt large_stringlengths 72 9.34k | completion large_stringlengths 0 7.61k |
|---|---|
<|file_name|>line_plot.py<|end_file_name|><|fim▁begin|>#
# Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com)
#
# Jockey is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (a... | q_plus = pair[self.y_qerror_plus_col or self.y_qerror_minus_col]
q_minus = pair[self.y_qerror_minus_col or self.y_qerror_plus_col]
if None not in (minus,plus,q_minus,q_plus):
self.error_bar.draw(can, (x_pos, y_pos),
... |
<|file_name|>line_plot.py<|end_file_name|><|fim▁begin|>#
# Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com)
#
# Jockey is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (a... | self.error_bar.draw(can, (x_pos, y_pos),
ar.y_pos(y - minus),
ar.y_pos(y + plus),
ar.y_pos(y - q_minus),
ar.y_pos(y + q_... |
<|file_name|>line_plot.py<|end_file_name|><|fim▁begin|>#
# Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com)
#
# Jockey is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (a... | if None not in (minus,plus): #PDS
self.error_bar.draw(can, (x_pos, y_pos),
ar.y_pos(y - minus),
ar.y_pos(y + plus)) |
<|file_name|>line_plot.py<|end_file_name|><|fim▁begin|>#
# Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com)
#
# Jockey is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (a... | self.error_bar.draw(can, (x_pos, y_pos),
ar.y_pos(y - minus),
ar.y_pos(y + plus)) |
<|file_name|>line_plot.py<|end_file_name|><|fim▁begin|>#
# Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com)
#
# Jockey is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (a... | self.tick_mark.draw(can, x_pos, y_pos) |
<|file_name|>line_plot.py<|end_file_name|><|fim▁begin|>#
# Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com)
#
# Jockey is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (a... | can.show(x_pos + self.data_label_offset[0],
y_pos + self.data_label_offset[1],
'/hC' + pychart_util.apply_format(self.data_label_format, (x, y), 1)) |
<|file_name|>line_plot.py<|end_file_name|><|fim▁begin|>#
# Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com)
#
# Jockey is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (a... | check_integrity |
<|file_name|>line_plot.py<|end_file_name|><|fim▁begin|>#
# Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com)
#
# Jockey is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (a... | get_data_range |
<|file_name|>line_plot.py<|end_file_name|><|fim▁begin|>#
# Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com)
#
# Jockey is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (a... | get_legend_entry |
<|file_name|>line_plot.py<|end_file_name|><|fim▁begin|>#
# Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com)
#
# Jockey is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (a... | draw |
<|file_name|>line_plot.py<|end_file_name|><|fim▁begin|>#
# Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com)
#
# Jockey is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (a... | init |
<|file_name|>shared_cll_8_binary_load_lifter_advanced.py<|end_file_name|><|fim▁begin|>#### NOTICE: THIS FILE IS AUTOGENERATED<|fim▁hole|>
def create(kernel):
result = Creature()
result.template = "object/creature/npc/droid/crafted/shared_cll_8_binary_load_lifter_advanced.iff"
result.attribute_template_id = 3
resul... | #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import * |
<|file_name|>shared_cll_8_binary_load_lifter_advanced.py<|end_file_name|><|fim▁begin|>#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
<|fim_middle|>
<|fim▁end|> | result = Creature()
result.template = "object/creature/npc/droid/crafted/shared_cll_8_binary_load_lifter_advanced.iff"
result.attribute_template_id = 3
result.stfName("droid_name","cll_8_binary_load_lifter_crafted_advanced")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result |
<|file_name|>shared_cll_8_binary_load_lifter_advanced.py<|end_file_name|><|fim▁begin|>#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def <|fim_middle|>(kernel):
result = Creature()
result.te... | create |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>import sys
class Encoding(object):
@staticmethod
def normalize(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_inf... | else:
processed_value = value
return processed_value |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>
import sys
class Encoding(object):
<|fim_middle|>
<|fim▁end|> | @staticmethod
def normalize(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_info < (3, 0):
return Encoding.to_ascii(value)
else:
return Enc... |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>
import sys
class Encoding(object):
@staticmethod
def normalize(value):
<|fim_middle|>
@staticmethod
def to_ascii(value):
"""
To ascii
:param value: The value
:return: The processed value
... | """
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_info < (3, 0):
return Encoding.to_ascii(value)
else:
return Encoding.to_unicode(value) |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>
import sys
class Encoding(object):
@staticmethod
def normalize(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_in... | """
To ascii
:param value: The value
:return: The processed value
"""
# Dict
if isinstance(value, dict):
processed_value = {}
for key in value:
if Encoding._is_unicode(key):
processed_key = key.... |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>
import sys
class Encoding(object):
@staticmethod
def normalize(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_in... | """
To unicode
:param value: The value
:return: The processed value
"""
# Dict
if isinstance(value, dict):
processed_value = {}
for key in value:
if Encoding._is_ascii(key):
processed_key = key.... |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>
import sys
class Encoding(object):
@staticmethod
def normalize(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_in... | """
Check if ascii
:param value: The value
:return: Ascii or not
"""
# Python 2 vs Python 3
if sys.version_info < (3, 0):
return isinstance(value, str)
else:
return isinstance(value, bytes) |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>
import sys
class Encoding(object):
@staticmethod
def normalize(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_in... | """
Check if unicode
:param value: The value
:return: Ascii or not
"""
# Python 2 vs Python 3
if sys.version_info < (3, 0):
return isinstance(value, unicode)
else:
return isinstance(value, str) |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>
import sys
class Encoding(object):
@staticmethod
def normalize(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_in... | return Encoding.to_ascii(value) |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>
import sys
class Encoding(object):
@staticmethod
def normalize(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_in... | return Encoding.to_unicode(value) |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>
import sys
class Encoding(object):
@staticmethod
def normalize(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_in... | processed_value = {}
for key in value:
if Encoding._is_unicode(key):
processed_key = key.encode('ascii')
else:
processed_key = key
processed_value[processed_key] = Encoding.to_ascii(value[key]) |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>
import sys
class Encoding(object):
@staticmethod
def normalize(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_in... | processed_key = key.encode('ascii') |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>
import sys
class Encoding(object):
@staticmethod
def normalize(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_in... | processed_key = key |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>
import sys
class Encoding(object):
@staticmethod
def normalize(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_in... | processed_value = []
for value in value:
processed_value.append(Encoding.to_ascii(value)) |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>
import sys
class Encoding(object):
@staticmethod
def normalize(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_in... | processed_value = value.encode('ascii') |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>
import sys
class Encoding(object):
@staticmethod
def normalize(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_in... | processed_value = value |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>
import sys
class Encoding(object):
@staticmethod
def normalize(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_in... | processed_value = {}
for key in value:
if Encoding._is_ascii(key):
processed_key = key.decode('utf-8')
else:
processed_key = key
processed_value[processed_key] = Encoding.to_unicode(value[key]) |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>
import sys
class Encoding(object):
@staticmethod
def normalize(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_in... | processed_key = key.decode('utf-8') |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>
import sys
class Encoding(object):
@staticmethod
def normalize(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_in... | processed_key = key |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>
import sys
class Encoding(object):
@staticmethod
def normalize(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_in... | processed_value = []
for value in value:
processed_value.append(Encoding.to_unicode(value)) |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>
import sys
class Encoding(object):
@staticmethod
def normalize(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_in... | processed_value = value.decode('utf-8') |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>
import sys
class Encoding(object):
@staticmethod
def normalize(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_in... | processed_value = value |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>
import sys
class Encoding(object):
@staticmethod
def normalize(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_in... | return isinstance(value, str) |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>
import sys
class Encoding(object):
@staticmethod
def normalize(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_in... | return isinstance(value, bytes) |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>
import sys
class Encoding(object):
@staticmethod
def normalize(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_in... | return isinstance(value, unicode) |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>
import sys
class Encoding(object):
@staticmethod
def normalize(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_in... | return isinstance(value, str) |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>
import sys
class Encoding(object):
@staticmethod
def <|fim_middle|>(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.versi... | normalize |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>
import sys
class Encoding(object):
@staticmethod
def normalize(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_in... | to_ascii |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>
import sys
class Encoding(object):
@staticmethod
def normalize(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_in... | to_unicode |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>
import sys
class Encoding(object):
@staticmethod
def normalize(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_in... | _is_ascii |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>
import sys
class Encoding(object):
@staticmethod
def normalize(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_in... | _is_unicode |
<|file_name|>workbook_definition.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright 2013 - Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | @expose(content_type="text/plain")
def put(self, workbook_name):
text = request.text
|
<|file_name|>workbook_definition.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright 2013 - Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | @expose()
def get(self, workbook_name):
LOG.debug("Fetch workbook definition [workbook_name=%s]" %
workbook_name)
return db_api.workbook_definition_get(workbook_name)
@expose(content_type="text/plain")
def put(self, workbook_name):
text = request.text
... |
<|file_name|>workbook_definition.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright 2013 - Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | LOG.debug("Fetch workbook definition [workbook_name=%s]" %
workbook_name)
return db_api.workbook_definition_get(workbook_name) |
<|file_name|>workbook_definition.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright 2013 - Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | text = request.text
LOG.debug("Update workbook definition [workbook_name=%s, text=%s]" %
(workbook_name, text))
wb = db_api.workbook_definition_put(workbook_name, text)
scheduler.create_associated_triggers(wb)
return wb['definition'] |
<|file_name|>workbook_definition.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright 2013 - Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | get |
<|file_name|>workbook_definition.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright 2013 - Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | put |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>"""
Django settings for ross project.
Generated by 'django-admin startproject' using Django 1.10.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.dja... | 'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
], |
<|file_name|>0012_auto_20160212_1210.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('characters', '0011_auto_20160212_1144'),
]
operations = [
... | name='name',
field=models.CharField(default='Magins namn', max_length=256, verbose_name='Namn'), |
<|file_name|>0012_auto_20160212_1210.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
<|fim_middle|>
<|fim▁end|> | dependencies = [
('characters', '0011_auto_20160212_1144'),
]
operations = [
migrations.CreateModel(
name='CharacterSpells',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('... |
<|file_name|>alertshandler.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
#
# Copyright (c) 2022 Roberto Riggio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apach... | """
|
<|file_name|>alertshandler.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
#
# Copyright (c) 2022 Roberto Riggio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apach... | """Alerts handler"""
URLS = [r"/api/v1/alerts/?",
r"/api/v1/alerts/([a-zA-Z0-9-]*)/?"]
@apimanager.validate(min_args=0, max_args=1)
def get(self, *args, **kwargs):
"""Lists all the alerts.
Args:
[0], the alert id (optional)
Example URLs:
... |
<|file_name|>alertshandler.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
#
# Copyright (c) 2022 Roberto Riggio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apach... | """Lists all the alerts.
Args:
[0], the alert id (optional)
Example URLs:
GET /api/v1/alerts
GET /api/v1/alerts/52313ecb-9d00-4b7d-b873-b55d3d9ada26
"""
return self.service.alerts \
if not args else self.service.alerts[uuid.UUI... |
<|file_name|>alertshandler.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
#
# Copyright (c) 2022 Roberto Riggio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apach... | """Create a new alert.
Args:
[0], the alert id (optional)
Request:
version: protocol version (1.0)
alert: the alert
"""
alert_id = uuid.UUID(args[0]) if args else uuid.uuid4()
if 'alert' in kwargs:
alert = self.service... |
<|file_name|>alertshandler.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
#
# Copyright (c) 2022 Roberto Riggio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apach... | """Delete one or all alerts.
Args:
[0], the alert id (optional)
Example URLs:
DELETE /api/v1/alerts
DELETE /api/v1/alerts/52313ecb-9d00-4b7d-b873-b55d3d9ada26
"""
if args:
self.service.remove(uuid.UUID(args[0]))
else:
... |
<|file_name|>alertshandler.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
#
# Copyright (c) 2022 Roberto Riggio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apach... | alert = self.service.create(uuid=alert_id, alert=kwargs['alert']) |
<|file_name|>alertshandler.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
#
# Copyright (c) 2022 Roberto Riggio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apach... | alert = self.service.create(uuid=alert_id) |
<|file_name|>alertshandler.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
#
# Copyright (c) 2022 Roberto Riggio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apach... | self.service.remove(uuid.UUID(args[0])) |
<|file_name|>alertshandler.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
#
# Copyright (c) 2022 Roberto Riggio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apach... | self.service.remove_all() |
<|file_name|>alertshandler.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
#
# Copyright (c) 2022 Roberto Riggio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apach... | get |
<|file_name|>alertshandler.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
#
# Copyright (c) 2022 Roberto Riggio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apach... | post |
<|file_name|>alertshandler.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
#
# Copyright (c) 2022 Roberto Riggio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apach... | delete |
<|file_name|>create_proposals.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | 'billingSource': 'DFP_VOLUME'
}
# Add proposals. |
<|file_name|>create_proposals.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | proposal_service = client.GetService('ProposalService', version='v201811')
network_service = client.GetService('NetworkService', version='v201811')
# Create proposal objects.
proposal = {
'name': 'Proposal #%s' % uuid.uuid4(),
'advertiser': {
'companyId': advertiser_id,
'type': ... |
<|file_name|>create_proposals.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage()
main(ad_manager_client, ADVERTISER_ID, PRIMARY_SALESPERSON_ID,
SECONDARY_SALESPERSON_ID, PRIMARY_TRAFFICKER_ID) |
<|file_name|>create_proposals.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | main |
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | def sweeper( cls ):
""" move cached request to the central request manager
|
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | """ init RequestProxy handler
:param serviceInfo: whatever
"""
gLogger.info( "Initalizing ReqProxyHandler" )
gThreadScheduler.addPeriodicTask( 120, ReqProxyHandler.sweeper )
return S_OK() |
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | """
.. class:: ReqProxyHandler
:param RPCCLient requestManager: a RPCClient to RequestManager
:param str cacheDir: os.path.join( workDir, "requestCache" )
"""
__requestManager = None
__cacheDir = None
def initialize( self ):
""" service initialization
:param self: self reference
"""
g... |
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | """ service initialization
:param self: self reference
"""
gLogger.notice( "CacheDirectory: %s" % self.cacheDir() )
return S_OK() |
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | """ get request manager """
if not cls.__requestManager:
cls.__requestManager = RPCClient( "RequestManagement/ReqManager" )
return cls.__requestManager |
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | """ get cache dir """
if not cls.__cacheDir:
cls.__cacheDir = os.path.abspath( "requestCache" )
if not os.path.exists( cls.__cacheDir ):
os.mkdir( cls.__cacheDir )
return cls.__cacheDir |
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | """ move cached request to the central request manager
:param self: self reference
"""
cacheDir = cls.cacheDir()
# # cache dir empty?
if not os.listdir( cacheDir ):
gLogger.always( "sweeper: CacheDir %s is empty, nothing to do" % cacheDir )
return S_OK()
else:
# # read 10 ... |
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | """ save request string to the working dir cache
:param self: self reference
:param str requestName: request name
:param str requestJSON: request serialized to JSON format
"""
try:
requestFile = os.path.join( self.cacheDir(), md5( str( requestJSON ) ).hexdigest() )
request = open( ... |
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | """ get number of requests in cache """
try:
cachedRequests = len( os.listdir( self.cacheDir() ) )
except OSError, error:
err = "getStatus: unable to list cache dir contents: %s" % str( error )
gLogger.exception( err )
return S_ERROR( err )
return S_OK( cachedRequests ) |
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | """ forward request from local RequestDB to central RequestManager
:param self: self reference
:param str requestType: request type
"""
requestName = requestJSON.get( "RequestName", "***UNKNOWN***" )
gLogger.info( "setRequest: got request '%s'" % requestName )
forwardable = self.__forwarda... |
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | """ check if request if forwardable
The sub-request of type transfer:putAndRegister, removal:physicalRemoval and removal:reTransfer are
definitely not, they should be executed locally, as they are using local fs.
:param str requestJSON: serialized request
"""
operations = requestJSON.get( "Ope... |
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | cls.__requestManager = RPCClient( "RequestManagement/ReqManager" ) |
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | cls.__cacheDir = os.path.abspath( "requestCache" )
if not os.path.exists( cls.__cacheDir ):
os.mkdir( cls.__cacheDir ) |
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | os.mkdir( cls.__cacheDir ) |
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | gLogger.always( "sweeper: CacheDir %s is empty, nothing to do" % cacheDir )
return S_OK() |
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | cachedRequests = [ os.path.abspath( requestFile ) for requestFile in
sorted( filter( os.path.isfile,
[ os.path.join( cacheDir, requestName )
for requestName in os.listdir( cacheDir ) ] ),
... |
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | gLogger.error( "sweeper: unable to set request %s @ ReqManager: %s" % ( cachedName,
setRequest["Message"] ) )
continue |
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | gLogger.warn( "setRequest: %s" % forwardable["Message"] ) |
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | gLogger.error( "setReqeuest: unable to set request '%s' @ RequestManager: %s" % ( requestName,
setRequest["Message"] ) )
# # put request to the request file cache
save = self.__saveRequest( requestName, requestJSON... |
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | gLogger.error( "setRequest: unable to save request to the cache: %s" % save["Message"] )
return save |
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | return S_ERROR( "found operation '%s' that cannot be forwarded" % operationDict.get( "Type", "" ) ) |
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | initializeReqProxyHandler |
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | initialize |
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | requestManager |
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | cacheDir |
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | sweeper |
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | __saveRequest |
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | export_getStatus |
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | export_putRequest |
<|file_name|>ReqProxyHandler.py<|end_file_name|><|fim▁begin|>########################################################################
# $HeadURL$
# File: ReqProxyHandler.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/06/04 13:18:41
########################################################################
"""
... | __forwardable |
<|file_name|>rule_008.py<|end_file_name|><|fim▁begin|>from vsg.rules import token_prefix
from vsg import token
lTokens = []<|fim▁hole|>class rule_008(token_prefix):
'''
This rule checks for valid prefixes on signal identifiers.
Default signal prefix is *s\_*.
|configuring_prefix_and_suffix_rules_link... | lTokens.append(token.signal_declaration.identifier)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.