prompt large_stringlengths 72 9.34k | completion large_stringlengths 0 7.61k |
|---|---|
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>"""
Windows Process Control
winprocess.run launches a child process and returns the exit code.
Optionally, it can:
redirect stdin, stdout & stderr to files
run the command as another user
limit the process's running time
control the process window (locati... | wait |
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>"""
Windows Process Control
winprocess.run launches a child process and returns the exit code.
Optionally, it can:
redirect stdin, stdout & stderr to files
run the command as another user
limit the process's running time
control the process window (locati... | kill |
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>"""
Windows Process Control
winprocess.run launches a child process and returns the exit code.
Optionally, it can:
redirect stdin, stdout & stderr to files
run the command as another user
limit the process's running time
control the process window (locati... | __close__ |
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>"""
Windows Process Control
winprocess.run launches a child process and returns the exit code.
Optionally, it can:
redirect stdin, stdout & stderr to files
run the command as another user
limit the process's running time
control the process window (locati... | exitCode |
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|>"""
Windows Process Control
winprocess.run launches a child process and returns the exit code.
Optionally, it can:
redirect stdin, stdout & stderr to files
run the command as another user
limit the process's running time
control the process window (locati... | run |
<|file_name|>hash_util.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*-
"""
Desc: django util.
Note:
---------------------------------------
# 2016/04/30 kangtian created
"""
from hashlib import md5
def gen_md5(content_str):<|fim▁hole|><|fim▁end|> | m = md5()
m.update(content_str)
return m.hexdigest() |
<|file_name|>hash_util.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*-
"""
Desc: django util.
Note:
---------------------------------------
# 2016/04/30 kangtian created
"""
from hashlib import md5
def gen_md5(content_str):
<|fim_middle|>
<|fim▁end|> | m = md5()
m.update(content_str)
return m.hexdigest() |
<|file_name|>hash_util.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*-
"""
Desc: django util.
Note:
---------------------------------------
# 2016/04/30 kangtian created
"""
from hashlib import md5
def <|fim_middle|>(content_str):
m = md5()
m.update(content_str)
return m.hexdigest()
<... | gen_md5 |
<|file_name|>label.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012 Tuukka Turto
#
# This file is part of satin-python.
#
# pyherc is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by<|fim▁ho... | # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. |
<|file_name|>label.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012 Tuukka Turto
#
# This file is part of satin-python.
#
# pyherc is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the... | """
Check if Widget has label with given text
"""
def __init__(self, text):
"""
Default constructor
"""
super(LabelMatcher, self).__init__()
if hasattr(text, 'matches'):
self.text = text
else:
self.text = wrap_matcher(text)
d... |
<|file_name|>label.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012 Tuukka Turto
#
# This file is part of satin-python.
#
# pyherc is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the... | """
Default constructor
"""
super(LabelMatcher, self).__init__()
if hasattr(text, 'matches'):
self.text = text
else:
self.text = wrap_matcher(text) |
<|file_name|>label.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012 Tuukka Turto
#
# This file is part of satin-python.
#
# pyherc is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the... | """
Check if matcher matches item
:param item: object to match against
:returns: True if matching, otherwise False
:rtype: Boolean
"""
widgets = all_widgets(item)
for widget in widgets:
if hasattr(widget, 'text') and self.text.matches(widget.... |
<|file_name|>label.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012 Tuukka Turto
#
# This file is part of satin-python.
#
# pyherc is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the... | """
Describe this matcher
"""
description.append('Control with label {0}'.format(self.text)) |
<|file_name|>label.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012 Tuukka Turto
#
# This file is part of satin-python.
#
# pyherc is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the... | """
Describe this mismatch
"""
mismatch_description.append(
'QLabel with text {0} was not found'.format(self.text)) |
<|file_name|>label.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012 Tuukka Turto
#
# This file is part of satin-python.
#
# pyherc is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the... | """
Check if Widget has label with given text
"""
return LabelMatcher(text) |
<|file_name|>label.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012 Tuukka Turto
#
# This file is part of satin-python.
#
# pyherc is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the... | self.text = text |
<|file_name|>label.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012 Tuukka Turto
#
# This file is part of satin-python.
#
# pyherc is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the... | self.text = wrap_matcher(text) |
<|file_name|>label.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012 Tuukka Turto
#
# This file is part of satin-python.
#
# pyherc is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the... | return True |
<|file_name|>label.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012 Tuukka Turto
#
# This file is part of satin-python.
#
# pyherc is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the... | __init__ |
<|file_name|>label.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012 Tuukka Turto
#
# This file is part of satin-python.
#
# pyherc is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the... | _matches |
<|file_name|>label.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012 Tuukka Turto
#
# This file is part of satin-python.
#
# pyherc is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the... | describe_to |
<|file_name|>label.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012 Tuukka Turto
#
# This file is part of satin-python.
#
# pyherc is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the... | describe_mismatch |
<|file_name|>label.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012 Tuukka Turto
#
# This file is part of satin-python.
#
# pyherc is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the... | has_label |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar><|fim▁hole|># it under the terms of the GNU General Public License version 3
# as published by the Free Software Foundation.
#
# lai-client is distributed in the hope that it will be useful,
# but W... | #
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | def __init__(self, name, host='127.0.0.1', port=27017):
self.name = name
self.host = host
self.port = port
def connect(self):
try:
self.connection = pymongo.Connection(self.host, self.port)
self.db = self.connection[self.name]
except AutoReconnec... |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | self.name = name
self.host = host
self.port = port |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | try:
self.connection = pymongo.Connection(self.host, self.port)
self.db = self.connection[self.name]
except AutoReconnect:
raise DatabaseException("It's not possible connect to the database") |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | try:
query = {'_id': 'last_id'}
update = {'$inc': {'id': 1}}
fn = self.db.internal.find_and_modify
row = fn(query, update, upsert=True, new=True)
except Exception as e:
raise DatabaseException(e)
return row['id'] |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | try:
spec = {'$or': [{'data.content' : {'$regex': regex, '$options': 'im'}},
{'data.description': {'$regex': regex, '$options': 'im'}}]}
fields = {'_id': 0}
cur = self.db.docs.find(spec, fields)
except Exception as e:
raise D... |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | try:
if pk == 'id':
id = int(id)
if deleted:
spec = {pk: id}
else:
spec = {pk: id, 'data': {'$exists': 1}}
fields = {'_id': 0}
row = self.db.docs.find_one(spec, fields)
except Exception as e:
... |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | try:
spec = {'data': {'$exists': 1}}
fields = {'_id': 0}
sort = [('tid', 1)]
cur = self.db.docs.find(spec, fields, sort=sort)
except Exception as e:
raise DatabaseException(e)
return [Document(**row) for row in cur] |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | if doc.id:
return self.update(doc)
else:
return self.insert(doc) |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | doc.id = self.get_next_id()
doc.synced = synced
try:
self.db.docs.insert(doc)
except Exception as e:
raise DatabaseException(e)
return doc |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | if process is None:
pk = 'id'
id = doc.id
doc.synced = False
set = doc
elif process == UPDATE_PROCESS:
if self.db.docs.find({'sid': doc.sid}).count() == 0:
return self.insert(doc, synced=True)
pk = 'sid'
... |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | if doc.id is None:
raise DatabaseException('Document does not have id')
if doc.sid is None:
try:
rs = self.db.docs.remove({'id': doc.id}, safe=True)
assert rs['n'] == 1
except Exception as e:
raise DatabaseException(e)
... |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | try:
spec = {'_id': 'last_sync'}
document = {'$set': {process: ids}}
self.db.internal.update(spec, document, upsert=True)
except Exception as e:
raise DatabaseException(e) |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | try:
spec = {'synced': False}
fields = {'_id': 0}
cur = self.db.docs.find(spec, fields)
except Exception as e:
raise DatabaseException(e)
return list(cur) |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | try:
spec = {'tid': {'$gt': 0}}
sort = [('tid', -1)]
row = self.db.docs.find_one(spec, sort=sort)
except Exception as e:
raise DatabaseException(e)
if row:
return row['tid']
return 0 |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | docs = {'updated' : [],
'committed': [],
'to_commit': []}
row = self.db.internal.find_one({'_id': 'last_sync'})
if row and 'update' in row:
for id in row['update']:
docs['updated'].append(self.get(id, deleted=True))
if row a... |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | return "%s://%s:%s/%s" % ('mongo', self.host, self.port, self.name) |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | id = int(id) |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | spec = {pk: id} |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | spec = {pk: id, 'data': {'$exists': 1}} |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | return Document(**row) |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | return self.update(doc) |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | return self.insert(doc) |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | pk = 'id'
id = doc.id
doc.synced = False
set = doc |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | if self.db.docs.find({'sid': doc.sid}).count() == 0:
return self.insert(doc, synced=True)
pk = 'sid'
id = doc.sid
doc.synced = not doc.merged() # must be commited if was merged
doc.merged(False)
set = {'tid': doc.tid, 'data': doc.da... |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | return self.insert(doc, synced=True) |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | pk = 'id'
id = doc.id
doc.synced = True
set = {'sid': doc.sid, 'tid': doc.tid, 'synced': doc.synced} |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | raise DatabaseException('Incorrect update process') |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | raise DatabaseException('Document does not have id') |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | try:
rs = self.db.docs.remove({'id': doc.id}, safe=True)
assert rs['n'] == 1
except Exception as e:
raise DatabaseException(e)
return None |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | return row['tid'] |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | for id in row['update']:
docs['updated'].append(self.get(id, deleted=True)) |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | for id in row['commit']:
docs['committed'].append(self.get(id, deleted=True)) |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | __init__ |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | connect |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | get_next_id |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | search |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | get |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | getall |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | save |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | insert |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | update |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | delete |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | save_last_sync |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | get_docs_to_commit |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | get_last_tid |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | status |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | __str__ |
<|file_name|>clock_offset_corrector.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Clock offset corrector
# Author: Piotr Krysik
# Generated: Wed Nov 19 08:38:40 2014
##################################################
from ... | return self.fc
|
<|file_name|>clock_offset_corrector.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Clock offset corrector
# Author: Piotr Krysik
# Generated: Wed Nov 19 08:38:40 2014
##################################################
from ... | def __init__(self, fc=936.6e6, ppm=0, samp_rate_in=1625000.0/6.0*4.0):
gr.hier_block2.__init__(
self, "Clock offset corrector",
gr.io_signature(1, 1, gr.sizeof_gr_complex*1),
gr.io_signature(1, 1, gr.sizeof_gr_complex*1),
)
###############################... |
<|file_name|>clock_offset_corrector.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Clock offset corrector
# Author: Piotr Krysik
# Generated: Wed Nov 19 08:38:40 2014
##################################################
from ... | gr.hier_block2.__init__(
self, "Clock offset corrector",
gr.io_signature(1, 1, gr.sizeof_gr_complex*1),
gr.io_signature(1, 1, gr.sizeof_gr_complex*1),
)
##################################################
# Parameters
##########################... |
<|file_name|>clock_offset_corrector.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Clock offset corrector
# Author: Piotr Krysik
# Generated: Wed Nov 19 08:38:40 2014
##################################################
from ... | return self.fc |
<|file_name|>clock_offset_corrector.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Clock offset corrector
# Author: Piotr Krysik
# Generated: Wed Nov 19 08:38:40 2014
##################################################
from ... | self.fc = fc
self.blocks_multiply_const_vxx_0.set_k((self.fc/self.samp_rate_out*(2*math.pi)/1e6, )) |
<|file_name|>clock_offset_corrector.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Clock offset corrector
# Author: Piotr Krysik
# Generated: Wed Nov 19 08:38:40 2014
##################################################
from ... | return self.ppm |
<|file_name|>clock_offset_corrector.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Clock offset corrector
# Author: Piotr Krysik
# Generated: Wed Nov 19 08:38:40 2014
##################################################
from ... | self.ppm = ppm
self.gsm_controlled_const_source_f_0.set_constant(self.ppm) |
<|file_name|>clock_offset_corrector.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Clock offset corrector
# Author: Piotr Krysik
# Generated: Wed Nov 19 08:38:40 2014
##################################################
from ... | return self.samp_rate_in |
<|file_name|>clock_offset_corrector.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Clock offset corrector
# Author: Piotr Krysik
# Generated: Wed Nov 19 08:38:40 2014
##################################################
from ... | self.samp_rate_in = samp_rate_in
self.set_samp_rate_out(self.samp_rate_in)
self.fractional_resampler_xx_0.set_resamp_ratio(self.samp_rate_in/self.samp_rate_out)
self.blocks_multiply_const_vxx_0_0.set_k((1.0e-6*self.samp_rate_in/self.samp_rate_out, ))
self.blocks_add_const_vxx_0.s... |
<|file_name|>clock_offset_corrector.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Clock offset corrector
# Author: Piotr Krysik
# Generated: Wed Nov 19 08:38:40 2014
##################################################
from ... | return self.samp_rate_out |
<|file_name|>clock_offset_corrector.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Clock offset corrector
# Author: Piotr Krysik
# Generated: Wed Nov 19 08:38:40 2014
##################################################
from ... | self.samp_rate_out = samp_rate_out
self.blocks_multiply_const_vxx_0.set_k((self.fc/self.samp_rate_out*(2*math.pi)/1e6, ))
self.fractional_resampler_xx_0.set_resamp_ratio(self.samp_rate_in/self.samp_rate_out)
self.blocks_multiply_const_vxx_0_0.set_k((1.0e-6*self.samp_rate_in/self.samp_rat... |
<|file_name|>clock_offset_corrector.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Clock offset corrector
# Author: Piotr Krysik
# Generated: Wed Nov 19 08:38:40 2014
##################################################
from ... | __init__ |
<|file_name|>clock_offset_corrector.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Clock offset corrector
# Author: Piotr Krysik
# Generated: Wed Nov 19 08:38:40 2014
##################################################
from ... | get_fc |
<|file_name|>clock_offset_corrector.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Clock offset corrector
# Author: Piotr Krysik
# Generated: Wed Nov 19 08:38:40 2014
##################################################
from ... | set_fc |
<|file_name|>clock_offset_corrector.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Clock offset corrector
# Author: Piotr Krysik
# Generated: Wed Nov 19 08:38:40 2014
##################################################
from ... | get_ppm |
<|file_name|>clock_offset_corrector.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Clock offset corrector
# Author: Piotr Krysik
# Generated: Wed Nov 19 08:38:40 2014
##################################################
from ... | set_ppm |
<|file_name|>clock_offset_corrector.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Clock offset corrector
# Author: Piotr Krysik
# Generated: Wed Nov 19 08:38:40 2014
##################################################
from ... | get_samp_rate_in |
<|file_name|>clock_offset_corrector.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Clock offset corrector
# Author: Piotr Krysik
# Generated: Wed Nov 19 08:38:40 2014
##################################################
from ... | set_samp_rate_in |
<|file_name|>clock_offset_corrector.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Clock offset corrector
# Author: Piotr Krysik
# Generated: Wed Nov 19 08:38:40 2014
##################################################
from ... | get_samp_rate_out |
<|file_name|>clock_offset_corrector.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Clock offset corrector
# Author: Piotr Krysik
# Generated: Wed Nov 19 08:38:40 2014
##################################################
from ... | set_samp_rate_out |
<|file_name|>shared_ith_shirt_s09.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):
result = Tangible()
result.template = "object/tangible/we... | result.attribute_template_id = 11 |
<|file_name|>shared_ith_shirt_s09.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 = Tangible()
result.template = "object/tangible/wearables/ithorian/shared_ith_shirt_s09.iff"
result.attribute_template_id = 11
result.stfName("wearables_name","ith_shirt_s09")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result |
<|file_name|>shared_ith_shirt_s09.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 = Tangible()
result.template = "object/tan... | create |
<|file_name|>malware_bazaar_search.py<|end_file_name|><|fim▁begin|>#python imports
import sys
import os
import time
import datetime
import subprocess
import json
import requests
from termcolor import colored
#third-party imports
#No third-party imports
#programmer generated imports
from logger import logger
from file... |
return 0 |
<|file_name|>malware_bazaar_search.py<|end_file_name|><|fim▁begin|>#python imports
import sys
import os
import time
import datetime
import subprocess
import json
import requests
from termcolor import colored
#third-party imports
#No third-party imports
#programmer generated imports
from logger import logger
from file... | if (POE.logging == True):
LOG = logger()
newlogentry = ''
reputation_dump = ''
reputation_output_data = ''
malwarebazaar = ''
if (POE.logging == True):
newlogentry = 'Module: malware_bazaar_search'
LOG.WriteStrongLog(POE.logdir, POE.targetfilename, newlogent... |
<|file_name|>malware_bazaar_search.py<|end_file_name|><|fim▁begin|>#python imports
import sys
import os
import time
import datetime
import subprocess
import json
import requests
from termcolor import colored
#third-party imports
#No third-party imports
#programmer generated imports
from logger import logger
from file... | LOG = logger() |
<|file_name|>malware_bazaar_search.py<|end_file_name|><|fim▁begin|>#python imports
import sys
import os
import time
import datetime
import subprocess
import json
import requests
from termcolor import colored
#third-party imports
#No third-party imports
#programmer generated imports
from logger import logger
from file... | newlogentry = 'Module: malware_bazaar_search'
LOG.WriteStrongLog(POE.logdir, POE.targetfilename, newlogentry) |
<|file_name|>malware_bazaar_search.py<|end_file_name|><|fim▁begin|>#python imports
import sys
import os
import time
import datetime
import subprocess
import json
import requests
from termcolor import colored
#third-party imports
#No third-party imports
#programmer generated imports
from logger import logger
from file... | print (colored('\r\n[x] Unable to execute Malware Bazaar Search - hash value must be SHA256.', 'red', attrs=['bold']))
newlogentry = 'Unable to execute Malware Bazaar Search - hash value must be SHA256'
LOG.WriteStrongSubLog(POE.logdir, POE.targetfilename, newlogentry)
return -1 |
<|file_name|>malware_bazaar_search.py<|end_file_name|><|fim▁begin|>#python imports
import sys
import os
import time
import datetime
import subprocess
import json
import requests
from termcolor import colored
#third-party imports
#No third-party imports
#programmer generated imports
from logger import logger
from file... | print (response_dump) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.