prompt large_stringlengths 72 9.34k | completion large_stringlengths 0 7.61k |
|---|---|
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
from django.utils.translation import ugettext, ugettext_lazy as _
from ella.positions.models import Position
from ella.utils import timezone
class PositionOptions(admin.ModelAdmin):
def show_title(self, obj):
if not obj.t... | return u'%s [%s]' % (obj.target.title, ugettext(obj.target_ct.name),) |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
from django.utils.translation import ugettext, ugettext_lazy as _
from ella.positions.models import Position
from ella.utils import timezone
class PositionOptions(admin.ModelAdmin):
def show_title(self, obj):
if not obj.t... | return True |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
from django.utils.translation import ugettext, ugettext_lazy as _
from ella.positions.models import Position
from ella.utils import timezone
class PositionOptions(admin.ModelAdmin):
def show_title(self, obj):
if not obj.t... | return False |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
from django.utils.translation import ugettext, ugettext_lazy as _
from ella.positions.models import Position
from ella.utils import timezone
class PositionOptions(admin.ModelAdmin):
def show_title(self, obj):
if not obj.t... | return False |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
from django.utils.translation import ugettext, ugettext_lazy as _
from ella.positions.models import Position
from ella.utils import timezone
class PositionOptions(admin.ModelAdmin):
def <|fim_middle|>(self, obj):
if not o... | show_title |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
from django.utils.translation import ugettext, ugettext_lazy as _
from ella.positions.models import Position
from ella.utils import timezone
class PositionOptions(admin.ModelAdmin):
def show_title(self, obj):
if not obj.t... | is_filled |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
from django.utils.translation import ugettext, ugettext_lazy as _
from ella.positions.models import Position
from ella.utils import timezone
class PositionOptions(admin.ModelAdmin):
def show_title(self, obj):
if not obj.t... | is_active |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-09-21 12:06
from __future__ import unicode_literals
<|fim▁hole|>from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.M... | |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-09-21 12:06
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
... | initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Group',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name=... |
<|file_name|>ref.py<|end_file_name|><|fim▁begin|>energies = dict()
energies[81] = -3.17 # Ammoniadimer.xyz
energies[82] = -5.02 # Waterdimer.xyz
energies[83] = -1.50 # BenzeneMethanecomplex.xyz
energies[84] = -18.61 # Formicaciddimer.xyz
energies[85] = -15.96 # Formamidedimer.xyz
energies[86] =... | names[85] = "Formamidedimer.xyz"
names[86] = "Uracildimerhbonded.xyz"
names[87] = "2pyridoxine2aminopyridinecomplex.xyz"
names[88] = "AdeninethymineWatsonCrickcomplex.xyz" |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | "The private key content seems to be incorrect as it doesn't end with -----END PRIVATE KEY-----")
if '-----BEGIN CERTIFICATE-----' not in demisto.params()['cert_file']:
return_error("The client certificates content seem to be " |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | TRUST_LEVEL = {
'NOT_SET': '0',
'KNOWN_MALICIOUS': '1',
'MOST_LIKELY_MALICIOUS': '15',
'MIGHT_BE_MALICIOUS': '30',
'UNKNOWN': '50',
'MIGHT_BE_TRUSTED': '70',
'MOST_LIKELY_TRUSTED': '85',
'KNOWN_TRUSTED': '99',
'KNOWN_TRUSTED_INSTALLER': '100'
... |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | with open(self.broker_ca_bundle, "w") as text_file:
text_file.write(params['broker_ca_bundle'])
with open(self.cert_file, "w") as text_file:
text_file.write(params['cert_file'])
with open(self.private_key, "w") as text_file:
text_file.write(params['private_key... |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | self.client.disconnect() |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | if not is_ip_valid(ip):
raise ValueError(f'argument ip {ip} is not a valid IP')
trust_level_key = self.TRUST_LEVEL[trust_level]
if topic:
self.push_ip_topic = topic
self.send_event(self.push_ip_topic, f'ip:{ip};trust_level:{trust_level_key}')
return f'Su... |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | trust_level_key = self.TRUST_LEVEL[trust_level]
if topic:
self.push_url_topic = topic
self.send_event(self.push_url_topic, f'url:{url};trust_level:{trust_level_key}')
return f'Successfully pushed url {url} with trust level {trust_level}' |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | trust_level_key = self.TRUST_LEVEL[trust_level]
if topic:
self.push_domain_topic = topic
self.send_event(self.push_domain_topic, f'domain:{domain};trust_level:{trust_level_key}')
return f'Successfully pushed domain {domain} with trust level {trust_level}' |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | trust_level_key = self.TRUST_LEVEL[trust_level]
if topic:
self.push_ip_topic = topic
self.send_event(self.push_hash_topic, f'hash:{hash_obj};trust_level:{trust_level_key}')
return f'Successfully pushed hash {hash_obj} with trust level {trust_level}' |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | config = DxlClientConfig(
broker_ca_bundle=self.broker_ca_bundle,
cert_file=self.cert_file,
private_key=self.private_key,
brokers=[Broker.parse(url) for url in self.broker_urls]
)
config.connect_retries = CONNECT_RETRIES
config.reconnect_de... |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | if not topic:
raise Exception(f'Error in {demisto.command()} topic field is required')
event = Event(topic)
event.payload = str(payload).encode()
self.client.send_event(event) |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | self.send_event(topic, payload)
return 'Successfully sent event' |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | if '-----BEGIN PRIVATE KEY-----' not in demisto.params()['private_key']:
return_error(
"The private key content seems to be incorrect as it doesn't start with -----BEGIN PRIVATE KEY-----")
if '-----END PRIVATE KEY-----' not in demisto.params()['private_key']:
return_error(
... |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | args = demisto.args()
command = demisto.command()
try:
event_sender = EventSender(demisto.params())
result = ''
if command == 'test-module':
event_sender.send_event('TEST', 'test')
result = 'ok'
elif command == 'dxl-send-event':
result = ev... |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | self.broker_urls = params['broker_urls'].split(',') |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | raise ValueError(f'argument ip {ip} is not a valid IP') |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | self.push_ip_topic = topic |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | self.push_url_topic = topic |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | self.push_domain_topic = topic |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | self.push_ip_topic = topic |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | raise Exception(f'Error in {demisto.command()} topic field is required') |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | return_error(
"The private key content seems to be incorrect as it doesn't start with -----BEGIN PRIVATE KEY-----") |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | return_error(
"The private key content seems to be incorrect as it doesn't end with -----END PRIVATE KEY-----") |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | return_error("The client certificates content seem to be "
"incorrect as they don't start with '-----BEGIN CERTIFICATE-----'") |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | return_error(
"The client certificates content seem to be incorrect as it doesn't end with -----END CERTIFICATE-----") |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | return_error(
"The broker certificate seem to be incorrect as they don't start with '-----BEGIN CERTIFICATE-----'") |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | return_error(
"The broker certificate seem to be incorrect as they don't end with '-----END CERTIFICATE-----'") |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | event_sender.send_event('TEST', 'test')
result = 'ok' |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | result = event_sender.send_event_wrapper(args.get('topic'), args.get('payload')) |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | result = event_sender.push_ip(args.get('ip'),
args.get('trust_level'),
args.get('topic')) |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | result = event_sender.push_url(args.get('url'),
args.get('trust_level'),
args.get('topic')) |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | result = event_sender.push_domain(args.get('domain'),
args.get('trust_level'),
args.get('topic')) |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | result = event_sender.push_hash(args.get('hash'),
args.get('trust_level'),
args.get('topic')) |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | raise Exception(f'{demisto.command()} is not a command') |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | main() |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | __init__ |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | __del__ |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | push_ip |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | push_url |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | push_domain |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | push_hash |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | get_client_config |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | send_event |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | send_event_wrapper |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | validate_certificates_format |
<|file_name|>McAfee_DXL.py<|end_file_name|><|fim▁begin|>from typing import Dict
import tempfile
from dxlclient.client_config import DxlClientConfig
from dxlclient.client import DxlClient
from dxlclient.broker import Broker
from dxlclient.message import Event
import demistomock as demisto
from CommonServerPython import ... | main |
<|file_name|>search_yt.py<|end_file_name|><|fim▁begin|>import urllib
import urllib2
from bs4 import BeautifulSoup
textToSearch = 'gorillaz'
query = urllib.quote(textToSearch)
url = "https://www.youtube.com/results?search_query=" + query
response = urllib2.urlopen(url)
html = response.read()
soup = BeautifulSoup(html)
... | print 'https://www.youtube.com' + vid['href'] |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by<|fim▁hole|> the Free Software Foundation, either version 3 of t... | |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | return addon.getAddonInfo('path').decode('utf-8') |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | return addon.getAddonInfo('profile').decode('utf-8') |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | return xbmc.translatePath(path).decode('utf-8') |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | if not isinstance(value, basestring): value = str(value)
addon.setSetting(id, value) |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | return addon.getAddonInfo('version') |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | return addon.getAddonInfo('id') |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | return addon.getAddonInfo('name') |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | try:
query = urllib.urlencode(queries)
except UnicodeEncodeError:
for k in queries:
if isinstance(queries[k], unicode):
queries[k] = queries[k].encode('utf-8')
query = urllib.urlencode(queries)
return sys.argv[0] + '?' + query |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | xbmcplugin.endOfDirectory(int(sys.argv[1]), cacheToDisc=cache_to_disc) |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | xbmcplugin.setContent(int(sys.argv[1]), content) |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | list_item = xbmcgui.ListItem(label, iconImage=thumb, thumbnailImage=thumb)
add_item(queries, list_item, fanart, is_folder, is_playable, total_items, menu_items, replace_menu) |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | if menu_items is None: menu_items = []
if is_folder is None:
is_folder = False if is_playable else True
if is_playable is None:
playable = 'false' if is_folder else 'true'
else:
playable = 'true' if is_playable else 'false'
liz_url = get_plugin_url(queries)
if fanart: l... |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | q = {'mode': 'main'}
if query.startswith('?'): query = query[1:]
queries = urlparse.parse_qs(query)
for key in queries:
if len(queries[key]) == 1:
q[key] = queries[key][0]
else:
q[key] = queries[key]
return q |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | if header is None: header = get_name()
if sound is None: sound = get_setting('mute_notifications') == 'false'
icon_path = os.path.join(get_path(), 'icon.png')
try:
xbmcgui.Dialog().notification(header, msg, icon_path, duration, sound)
except:
builtin = "XBMC.Notification(%s,%s, %s, %... |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | skinPath = translate_path('special://skin/')
xml = os.path.join(skinPath, 'addon.xml')
f = xbmcvfs.File(xml)
read = f.read()
f.close()
try: src = re.search('defaultresolution="([^"]+)', read, re.DOTALL).group(1)
except: src = re.search('<res.+?folder="([^"]+)', read, re.DOTALL).group(1)
... |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | value = str(value) |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | queries[k] = queries[k].encode('utf-8') |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | menu_items = [] |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | is_folder = False if is_playable else True |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | playable = 'false' if is_folder else 'true' |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | playable = 'true' if is_playable else 'false' |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | list_item.setProperty('fanart_image', fanart) |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | query = query[1:] |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | q[key] = queries[key][0] |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | q[key] = queries[key] |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | header = get_name() |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | sound = get_setting('mute_notifications') == 'false' |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | views = match.group(1)
for view in views.split(','):
if xbmc.getInfoLabel('Control.GetLabel(%s)' % (view)): return view |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | return view |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | get_path |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | get_profile |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | translate_path |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | set_setting |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | get_version |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | get_id |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | get_name |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | get_plugin_url |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | end_of_directory |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | set_content |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | create_item |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | add_item |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | parse_query |
<|file_name|>kodi.py<|end_file_name|><|fim▁begin|>"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
This program 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 3 of the License,... | notify |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.