prompt large_stringlengths 72 9.34k | completion large_stringlengths 0 7.61k |
|---|---|
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|>from celery.task import Task
import requests
class StracksFlushTask(Task):
def <|fim_middle|>(self, url, data):
requests.post(url + "/", data=data)
<|fim▁end|> | run |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | If both default_project and project is provided, the default_project
will be used.
""" |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | """Represents an Identity user.
Attributes:
* id: a uuid that identifies the user
"""
pass |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | """Manager class for manipulating Identity users."""
resource_class = User
collection_key = 'users'
key = 'user'
def _require_user_and_group(self, user, group):
if not (user and group):
msg = _('Specify both a user and a group')
raise exceptions.ValidationError(msg)
... |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | if not (user and group):
msg = _('Specify both a user and a group')
raise exceptions.ValidationError(msg) |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | """Create a user.
.. warning::
The project argument is deprecated, use default_project instead.
If both default_project and project is provided, the default_project
will be used.
"""
if project:
LOG.warning(_LW("The project argument is deprecated,... |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | """List users.
If project, domain or group are provided, then filter
users with those attributes.
If ``**kwargs`` are provided, then filter users with
attributes matching ``**kwargs``.
.. warning::
The project argument is deprecated, use default_project inst... |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | return super(UserManager, self).get(
user_id=base.getid(user)) |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | """Update a user.
.. warning::
The project argument is deprecated, use default_project instead.
If both default_project and project is provided, the default_project
will be used.
"""
if project:
LOG.warning(_LW("The project argument is deprecated,... |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | """Update the password for the user the token belongs to."""
if not (old_password and new_password):
msg = _('Specify both the current password and a new password')
raise exceptions.ValidationError(msg)
if old_password == new_password:
msg = _('Old password a... |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | self._require_user_and_group(user, group)
base_url = '/groups/%s' % base.getid(group)
return super(UserManager, self).put(
base_url=base_url,
user_id=base.getid(user)) |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | self._require_user_and_group(user, group)
base_url = '/groups/%s' % base.getid(group)
return super(UserManager, self).head(
base_url=base_url,
user_id=base.getid(user)) |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | self._require_user_and_group(user, group)
base_url = '/groups/%s' % base.getid(group)
return super(UserManager, self).delete(
base_url=base_url,
user_id=base.getid(user)) |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | return super(UserManager, self).delete(
user_id=base.getid(user)) |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | msg = _('Specify both a user and a group')
raise exceptions.ValidationError(msg) |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | LOG.warning(_LW("The project argument is deprecated, "
"use default_project instead.")) |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | LOG.warning(_LW("The project argument is deprecated, "
"use default_project instead.")) |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | base_url = '/groups/%s' % base.getid(group) |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | base_url = None |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | LOG.warning(_LW("The project argument is deprecated, "
"use default_project instead.")) |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | msg = _('Specify both the current password and a new password')
raise exceptions.ValidationError(msg) |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | msg = _('Old password and new password must be different.')
raise exceptions.ValidationError(msg) |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | _require_user_and_group |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | create |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | list |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | get |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | update |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | update_password |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | add_to_group |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | check_in_group |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | remove_from_group |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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 Lic... | delete |
<|file_name|>infer.py<|end_file_name|><|fim▁begin|>import sys, os
import pickle
import nltk
import paths
from utils import *
def words_to_dict(words):
return dict(zip(words, range(0, len(words))))
nltk.data.path.append(paths.nltk_data_path)
use_wordnet = True
if use_wordnet:
stemmer = nltk.stem.wordnet.Wo... | words = os.path.join(mode,"vocab.dat")
docs = os.path.join(mode,"docs.dat")
pdf_file = args[0] |
<|file_name|>infer.py<|end_file_name|><|fim▁begin|>import sys, os
import pickle
import nltk
import paths
from utils import *
def words_to_dict(words):
<|fim_middle|>
nltk.data.path.append(paths.nltk_data_path)
use_wordnet = True
if use_wordnet:
stemmer = nltk.stem.wordnet.WordNetLemmatizer()
stem = s... | return dict(zip(words, range(0, len(words)))) |
<|file_name|>infer.py<|end_file_name|><|fim▁begin|>import sys, os
import pickle
import nltk
import paths
from utils import *
def words_to_dict(words):
return dict(zip(words, range(0, len(words))))
nltk.data.path.append(paths.nltk_data_path)
use_wordnet = True
if use_wordnet:
stemmer = nltk.stem.wordnet.Wo... | replacements = [("---"," "),
("--"," "),
("-", "")] # trying to capture multi-word keywords
for (src,tgt) in replacements:
text = text.replace(src,tgt)
return preprocess(text) |
<|file_name|>infer.py<|end_file_name|><|fim▁begin|>import sys, os
import pickle
import nltk
import paths
from utils import *
def words_to_dict(words):
return dict(zip(words, range(0, len(words))))
nltk.data.path.append(paths.nltk_data_path)
use_wordnet = True
if use_wordnet:
stemmer = nltk.stem.wordnet.Wo... | bow = {}
for word in doc:
if word in d:
wordid = d[word]
bow[wordid] = bow.get(wordid,0) + 1
# XXX we should notify something about non-stopwords that we couldn't parse
return bow |
<|file_name|>infer.py<|end_file_name|><|fim▁begin|>import sys, os
import pickle
import nltk
import paths
from utils import *
def words_to_dict(words):
return dict(zip(words, range(0, len(words))))
nltk.data.path.append(paths.nltk_data_path)
use_wordnet = True
if use_wordnet:
<|fim_middle|>
else:
... | stemmer = nltk.stem.wordnet.WordNetLemmatizer()
stem = stemmer.lemmatize |
<|file_name|>infer.py<|end_file_name|><|fim▁begin|>import sys, os
import pickle
import nltk
import paths
from utils import *
def words_to_dict(words):
return dict(zip(words, range(0, len(words))))
nltk.data.path.append(paths.nltk_data_path)
use_wordnet = True
if use_wordnet:
stemmer = nltk.stem.wordnet.Wo... | stemmer = nltk.stem.porter.PorterStemmer()
stem = stemmer.stem |
<|file_name|>infer.py<|end_file_name|><|fim▁begin|>import sys, os
import pickle
import nltk
import paths
from utils import *
def words_to_dict(words):
return dict(zip(words, range(0, len(words))))
nltk.data.path.append(paths.nltk_data_path)
use_wordnet = True
if use_wordnet:
stemmer = nltk.stem.wordnet.Wo... | wordid = d[word]
bow[wordid] = bow.get(wordid,0) + 1 |
<|file_name|>infer.py<|end_file_name|><|fim▁begin|>import sys, os
import pickle
import nltk
import paths
from utils import *
def words_to_dict(words):
return dict(zip(words, range(0, len(words))))
nltk.data.path.append(paths.nltk_data_path)
use_wordnet = True
if use_wordnet:
stemmer = nltk.stem.wordnet.Wo... | args = sys.argv[1:]
mode = modes[0]
k = ks[0]
dfun = dist[0]
num = 20
while len(args) > 1:
if args[0] == "-k":
if args[1] in ks:
k = args[1]
args = args[2:]
if args[0] in ["-m","--mode"]:
if args[1] in modes:
... |
<|file_name|>infer.py<|end_file_name|><|fim▁begin|>import sys, os
import pickle
import nltk
import paths
from utils import *
def words_to_dict(words):
return dict(zip(words, range(0, len(words))))
nltk.data.path.append(paths.nltk_data_path)
use_wordnet = True
if use_wordnet:
stemmer = nltk.stem.wordnet.Wo... | if args[1] in ks:
k = args[1]
args = args[2:] |
<|file_name|>infer.py<|end_file_name|><|fim▁begin|>import sys, os
import pickle
import nltk
import paths
from utils import *
def words_to_dict(words):
return dict(zip(words, range(0, len(words))))
nltk.data.path.append(paths.nltk_data_path)
use_wordnet = True
if use_wordnet:
stemmer = nltk.stem.wordnet.Wo... | k = args[1] |
<|file_name|>infer.py<|end_file_name|><|fim▁begin|>import sys, os
import pickle
import nltk
import paths
from utils import *
def words_to_dict(words):
return dict(zip(words, range(0, len(words))))
nltk.data.path.append(paths.nltk_data_path)
use_wordnet = True
if use_wordnet:
stemmer = nltk.stem.wordnet.Wo... | if args[1] in modes:
mode = args[1]
args = args[2:] |
<|file_name|>infer.py<|end_file_name|><|fim▁begin|>import sys, os
import pickle
import nltk
import paths
from utils import *
def words_to_dict(words):
return dict(zip(words, range(0, len(words))))
nltk.data.path.append(paths.nltk_data_path)
use_wordnet = True
if use_wordnet:
stemmer = nltk.stem.wordnet.Wo... | mode = args[1] |
<|file_name|>infer.py<|end_file_name|><|fim▁begin|>import sys, os
import pickle
import nltk
import paths
from utils import *
def words_to_dict(words):
return dict(zip(words, range(0, len(words))))
nltk.data.path.append(paths.nltk_data_path)
use_wordnet = True
if use_wordnet:
stemmer = nltk.stem.wordnet.Wo... | if int(args[1]) in range(1,50):
num = int(args[1])
args = args[2:] |
<|file_name|>infer.py<|end_file_name|><|fim▁begin|>import sys, os
import pickle
import nltk
import paths
from utils import *
def words_to_dict(words):
return dict(zip(words, range(0, len(words))))
nltk.data.path.append(paths.nltk_data_path)
use_wordnet = True
if use_wordnet:
stemmer = nltk.stem.wordnet.Wo... | num = int(args[1]) |
<|file_name|>infer.py<|end_file_name|><|fim▁begin|>import sys, os
import pickle
import nltk
import paths
from utils import *
def words_to_dict(words):
return dict(zip(words, range(0, len(words))))
nltk.data.path.append(paths.nltk_data_path)
use_wordnet = True
if use_wordnet:
stemmer = nltk.stem.wordnet.Wo... | if args[1] in dist:
dfun = args[1]
args = args[2:] |
<|file_name|>infer.py<|end_file_name|><|fim▁begin|>import sys, os
import pickle
import nltk
import paths
from utils import *
def words_to_dict(words):
return dict(zip(words, range(0, len(words))))
nltk.data.path.append(paths.nltk_data_path)
use_wordnet = True
if use_wordnet:
stemmer = nltk.stem.wordnet.Wo... | dfun = args[1] |
<|file_name|>infer.py<|end_file_name|><|fim▁begin|>import sys, os
import pickle
import nltk
import paths
from utils import *
def words_to_dict(words):
return dict(zip(words, range(0, len(words))))
nltk.data.path.append(paths.nltk_data_path)
use_wordnet = True
if use_wordnet:
stemmer = nltk.stem.wordnet.Wo... | metric = distance
fmt = '%d' |
<|file_name|>infer.py<|end_file_name|><|fim▁begin|>import sys, os
import pickle
import nltk
import paths
from utils import *
def words_to_dict(words):
return dict(zip(words, range(0, len(words))))
nltk.data.path.append(paths.nltk_data_path)
use_wordnet = True
if use_wordnet:
stemmer = nltk.stem.wordnet.Wo... | metric = kl_divergence
fmt = '%f' |
<|file_name|>infer.py<|end_file_name|><|fim▁begin|>import sys, os
import pickle
import nltk
import paths
from utils import *
def words_to_dict(words):
return dict(zip(words, range(0, len(words))))
nltk.data.path.append(paths.nltk_data_path)
use_wordnet = True
if use_wordnet:
stemmer = nltk.stem.wordnet.Wo... | metric = kl_divergence
fmt = '%f' |
<|file_name|>infer.py<|end_file_name|><|fim▁begin|>import sys, os
import pickle
import nltk
import paths
from utils import *
def <|fim_middle|>(words):
return dict(zip(words, range(0, len(words))))
nltk.data.path.append(paths.nltk_data_path)
use_wordnet = True
if use_wordnet:
stemmer = nltk.stem.wordnet.W... | words_to_dict |
<|file_name|>infer.py<|end_file_name|><|fim▁begin|>import sys, os
import pickle
import nltk
import paths
from utils import *
def words_to_dict(words):
return dict(zip(words, range(0, len(words))))
nltk.data.path.append(paths.nltk_data_path)
use_wordnet = True
if use_wordnet:
stemmer = nltk.stem.wordnet.Wo... | tokens |
<|file_name|>infer.py<|end_file_name|><|fim▁begin|>import sys, os
import pickle
import nltk
import paths
from utils import *
def words_to_dict(words):
return dict(zip(words, range(0, len(words))))
nltk.data.path.append(paths.nltk_data_path)
use_wordnet = True
if use_wordnet:
stemmer = nltk.stem.wordnet.Wo... | make_bow |
<|file_name|>restore.py<|end_file_name|><|fim▁begin|>import os
import shutil
from glob import glob
print 'Content-type:text/html\r\n\r\n'
print '<html>'
found_pages = glob('archive/*.py')
if found_pages:
path = "/cgi-bin/archive/"
moveto = "/cgi-bin/pages/"
files = os.listdir(path)
files.sort()<|fim▁... | |
<|file_name|>restore.py<|end_file_name|><|fim▁begin|>import os
import shutil
from glob import glob
print 'Content-type:text/html\r\n\r\n'
print '<html>'
found_pages = glob('archive/*.py')
if found_pages:
<|fim_middle|>
if not found_pages:
print 'Nothing to restore'
print '</html>'
# EOF
<|fim▁end|> | path = "/cgi-bin/archive/"
moveto = "/cgi-bin/pages/"
files = os.listdir(path)
files.sort()
for f in files:
src = path+f
dst = moveto+f
shutil.move(src, dst)
print 'All pages restored'
print '<meta http-equiv="refresh" content="1";>' |
<|file_name|>restore.py<|end_file_name|><|fim▁begin|>import os
import shutil
from glob import glob
print 'Content-type:text/html\r\n\r\n'
print '<html>'
found_pages = glob('archive/*.py')
if found_pages:
path = "/cgi-bin/archive/"
moveto = "/cgi-bin/pages/"
files = os.listdir(path)
files.sort()
f... | print 'Nothing to restore' |
<|file_name|>list.py<|end_file_name|><|fim▁begin|>a = [int(i) for i in input().split()]<|fim▁hole|><|fim▁end|> | print(sum(a)) |
<|file_name|>user.py<|end_file_name|><|fim▁begin|>from rest_framework import serializers
from django.contrib.auth.models import User
from dixit.account.models import UserProfile
<|fim▁hole|>class UserProfileSerializer(serializers.ModelSerializer):
class Meta:
model = UserProfile
fields = ('name', ... | |
<|file_name|>user.py<|end_file_name|><|fim▁begin|>
from rest_framework import serializers
from django.contrib.auth.models import User
from dixit.account.models import UserProfile
class UserProfileSerializer(serializers.ModelSerializer):
<|fim_middle|>
class UserSerializer(serializers.ModelSerializer):
""... | class Meta:
model = UserProfile
fields = ('name', ) |
<|file_name|>user.py<|end_file_name|><|fim▁begin|>
from rest_framework import serializers
from django.contrib.auth.models import User
from dixit.account.models import UserProfile
class UserProfileSerializer(serializers.ModelSerializer):
class Meta:
<|fim_middle|>
class UserSerializer(serializers.Mode... | model = UserProfile
fields = ('name', ) |
<|file_name|>user.py<|end_file_name|><|fim▁begin|>
from rest_framework import serializers
from django.contrib.auth.models import User
from dixit.account.models import UserProfile
class UserProfileSerializer(serializers.ModelSerializer):
class Meta:
model = UserProfile
fields = ('name', )
class... | """
Serializes User objects
"""
profile = UserProfileSerializer()
class Meta:
model = User
fields = ('id', 'username', 'email', 'profile', ) |
<|file_name|>user.py<|end_file_name|><|fim▁begin|>
from rest_framework import serializers
from django.contrib.auth.models import User
from dixit.account.models import UserProfile
class UserProfileSerializer(serializers.ModelSerializer):
class Meta:
model = UserProfile
fields = ('name', )
class... | model = User
fields = ('id', 'username', 'email', 'profile', ) |
<|file_name|>b__main_backu.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os,sys
folder = "/media/kentir1/Development/Linux_Program/Fundkeep/"
def makinGetYear():
return os.popen("date +'%Y'").read()[:-1]
def makinGetMonth():
return os.popen("date +'%m'").read()[:-1]
def makinGetDay():
return os.popen... | dapet = 0
while (dapet==0):
try: |
<|file_name|>b__main_backu.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os,sys
folder = "/media/kentir1/Development/Linux_Program/Fundkeep/"
def makinGetYear():
<|fim_middle|>
def makinGetMonth():
return os.popen("date +'%m'").read()[:-1]
def makinGetDay():
return os.popen("date +'%d'").read()[:-1]... | return os.popen("date +'%Y'").read()[:-1] |
<|file_name|>b__main_backu.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os,sys
folder = "/media/kentir1/Development/Linux_Program/Fundkeep/"
def makinGetYear():
return os.popen("date +'%Y'").read()[:-1]
def makinGetMonth():
<|fim_middle|>
def makinGetDay():
return os.popen("date +'%d'").read()[:-1]... | return os.popen("date +'%m'").read()[:-1] |
<|file_name|>b__main_backu.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os,sys
folder = "/media/kentir1/Development/Linux_Program/Fundkeep/"
def makinGetYear():
return os.popen("date +'%Y'").read()[:-1]
def makinGetMonth():
return os.popen("date +'%m'").read()[:-1]
def makinGetDay():
<|fim_middle|>
... | return os.popen("date +'%d'").read()[:-1] |
<|file_name|>b__main_backu.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os,sys
folder = "/media/kentir1/Development/Linux_Program/Fundkeep/"
def makinGetYear():
return os.popen("date +'%Y'").read()[:-1]
def makinGetMonth():
return os.popen("date +'%m'").read()[:-1]
def makinGetDay():
return os.popen... | return os.popen("date --date='"+str(daypassed)+" day ago' +'%Y'").read()[:-1] |
<|file_name|>b__main_backu.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os,sys
folder = "/media/kentir1/Development/Linux_Program/Fundkeep/"
def makinGetYear():
return os.popen("date +'%Y'").read()[:-1]
def makinGetMonth():
return os.popen("date +'%m'").read()[:-1]
def makinGetDay():
return os.popen... | return os.popen("date --date='"+str(daypassed)+" day ago' +'%m'").read()[:-1] |
<|file_name|>b__main_backu.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os,sys
folder = "/media/kentir1/Development/Linux_Program/Fundkeep/"
def makinGetYear():
return os.popen("date +'%Y'").read()[:-1]
def makinGetMonth():
return os.popen("date +'%m'").read()[:-1]
def makinGetDay():
return os.popen... | return os.popen("date --date='"+str(daypassed)+" day ago' +'%d'").read()[:-1] |
<|file_name|>b__main_backu.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os,sys
folder = "/media/kentir1/Development/Linux_Program/Fundkeep/"
def makinGetYear():
return os.popen("date +'%Y'").read()[:-1]
def makinGetMonth():
return os.popen("date +'%m'").read()[:-1]
def makinGetDay():
return os.popen... | t_bulan = 12
t_tahun = makinGetYear()-1 |
<|file_name|>b__main_backu.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os,sys
folder = "/media/kentir1/Development/Linux_Program/Fundkeep/"
def <|fim_middle|>():
return os.popen("date +'%Y'").read()[:-1]
def makinGetMonth():
return os.popen("date +'%m'").read()[:-1]
def makinGetDay():
return os.pop... | makinGetYear |
<|file_name|>b__main_backu.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os,sys
folder = "/media/kentir1/Development/Linux_Program/Fundkeep/"
def makinGetYear():
return os.popen("date +'%Y'").read()[:-1]
def <|fim_middle|>():
return os.popen("date +'%m'").read()[:-1]
def makinGetDay():
return os.pope... | makinGetMonth |
<|file_name|>b__main_backu.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os,sys
folder = "/media/kentir1/Development/Linux_Program/Fundkeep/"
def makinGetYear():
return os.popen("date +'%Y'").read()[:-1]
def makinGetMonth():
return os.popen("date +'%m'").read()[:-1]
def <|fim_middle|>():
return os.po... | makinGetDay |
<|file_name|>b__main_backu.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os,sys
folder = "/media/kentir1/Development/Linux_Program/Fundkeep/"
def makinGetYear():
return os.popen("date +'%Y'").read()[:-1]
def makinGetMonth():
return os.popen("date +'%m'").read()[:-1]
def makinGetDay():
return os.popen... | makinGetPrevYear |
<|file_name|>b__main_backu.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os,sys
folder = "/media/kentir1/Development/Linux_Program/Fundkeep/"
def makinGetYear():
return os.popen("date +'%Y'").read()[:-1]
def makinGetMonth():
return os.popen("date +'%m'").read()[:-1]
def makinGetDay():
return os.popen... | makinGetPrevMonth |
<|file_name|>b__main_backu.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os,sys
folder = "/media/kentir1/Development/Linux_Program/Fundkeep/"
def makinGetYear():
return os.popen("date +'%Y'").read()[:-1]
def makinGetMonth():
return os.popen("date +'%m'").read()[:-1]
def makinGetDay():
return os.popen... | makinGetPrevDay |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for Carkinos project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_ws... | application = get_wsgi_application() |
<|file_name|>0007_auto_20140805_2253.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('codecompetitions', '0006_auto_20140805_2234'),
]
operations = [... | field=models.CharField(blank=True, null=True, max_length=80),
preserve_default=True, |
<|file_name|>0007_auto_20140805_2253.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
<|fim_middle|>
<|fim▁end|> | dependencies = [
('codecompetitions', '0006_auto_20140805_2234'),
]
operations = [
migrations.AddField(
model_name='problem',
name='expected_output',
field=models.TextField(default=''),
preserve_default=False,
),
migrations.Add... |
<|file_name|>Rds20140815CheckAccountNameAvailableRequest.py<|end_file_name|><|fim▁begin|>'''
Created by auto_sdk on 2015.06.23<|fim▁hole|> RestApi.__init__(self,domain, port)
self.AccountName = None
self.DBInstanceId = None
self.resourceOwnerAccount = None
def getapiname(self):
return 'rds.aliyuncs.com.Check... | '''
from aliyun.api.base import RestApi
class Rds20140815CheckAccountNameAvailableRequest(RestApi):
def __init__(self,domain='rds.aliyuncs.com',port=80): |
<|file_name|>Rds20140815CheckAccountNameAvailableRequest.py<|end_file_name|><|fim▁begin|>'''
Created by auto_sdk on 2015.06.23
'''
from aliyun.api.base import RestApi
class Rds20140815CheckAccountNameAvailableRequest(RestApi):
<|fim_middle|>
<|fim▁end|> | def __init__(self,domain='rds.aliyuncs.com',port=80):
RestApi.__init__(self,domain, port)
self.AccountName = None
self.DBInstanceId = None
self.resourceOwnerAccount = None
def getapiname(self):
return 'rds.aliyuncs.com.CheckAccountNameAvailable.2014-08-15' |
<|file_name|>Rds20140815CheckAccountNameAvailableRequest.py<|end_file_name|><|fim▁begin|>'''
Created by auto_sdk on 2015.06.23
'''
from aliyun.api.base import RestApi
class Rds20140815CheckAccountNameAvailableRequest(RestApi):
def __init__(self,domain='rds.aliyuncs.com',port=80):
<|fim_middle|>
def getapiname(sel... | RestApi.__init__(self,domain, port)
self.AccountName = None
self.DBInstanceId = None
self.resourceOwnerAccount = None |
<|file_name|>Rds20140815CheckAccountNameAvailableRequest.py<|end_file_name|><|fim▁begin|>'''
Created by auto_sdk on 2015.06.23
'''
from aliyun.api.base import RestApi
class Rds20140815CheckAccountNameAvailableRequest(RestApi):
def __init__(self,domain='rds.aliyuncs.com',port=80):
RestApi.__init__(self,domain, port)
... | return 'rds.aliyuncs.com.CheckAccountNameAvailable.2014-08-15' |
<|file_name|>Rds20140815CheckAccountNameAvailableRequest.py<|end_file_name|><|fim▁begin|>'''
Created by auto_sdk on 2015.06.23
'''
from aliyun.api.base import RestApi
class Rds20140815CheckAccountNameAvailableRequest(RestApi):
def <|fim_middle|>(self,domain='rds.aliyuncs.com',port=80):
RestApi.__init__(self,domain, ... | __init__ |
<|file_name|>Rds20140815CheckAccountNameAvailableRequest.py<|end_file_name|><|fim▁begin|>'''
Created by auto_sdk on 2015.06.23
'''
from aliyun.api.base import RestApi
class Rds20140815CheckAccountNameAvailableRequest(RestApi):
def __init__(self,domain='rds.aliyuncs.com',port=80):
RestApi.__init__(self,domain, port)
... | getapiname |
<|file_name|>0051_auto_20190423_0803.py<|end_file_name|><|fim▁begin|># Generated by Django 2.1.7 on 2019-04-23 06:03
import diventi.accounts.models<|fim▁hole|>
class Migration(migrations.Migration):
dependencies = [
('accounts', '0050_auto_20190421_2252'),
]
operations = [
migrations.Alt... | from django.db import migrations |
<|file_name|>0051_auto_20190423_0803.py<|end_file_name|><|fim▁begin|># Generated by Django 2.1.7 on 2019-04-23 06:03
import diventi.accounts.models
from django.db import migrations
class Migration(migrations.Migration):
<|fim_middle|>
<|fim▁end|> | dependencies = [
('accounts', '0050_auto_20190421_2252'),
]
operations = [
migrations.AlterModelManagers(
name='diventiuser',
managers=[
('objects', diventi.accounts.models.DiventiUserManager()),
],
),
] |
<|file_name|>templatevm.py<|end_file_name|><|fim▁begin|>#
# The Qubes OS Project, http://www.qubes-os.org
#
# Copyright (C) 2014-2016 Wojtek Porczyk <woju@invisiblethingslab.com>
# Copyright (C) 2016 Marek Marczykowski <marmarek@invisiblethingslab.com>)
# Copyright (C) 2016 Bahtiar `kalkin-` Gadimov <bahti... | |
<|file_name|>templatevm.py<|end_file_name|><|fim▁begin|>#
# The Qubes OS Project, http://www.qubes-os.org
#
# Copyright (C) 2014-2016 Wojtek Porczyk <woju@invisiblethingslab.com>
# Copyright (C) 2016 Marek Marczykowski <marmarek@invisiblethingslab.com>)
# Copyright (C) 2016 Bahtiar `kalkin-` Gadimov <bahti... | '''Template for AppVM'''
dir_path_prefix = qubes.config.system_path['qubes_templates_dir']
@property
def appvms(self):
''' Returns a generator containing all domains based on the current
TemplateVM.
'''
for vm in self.app.domains:
if hasattr(vm, 'templat... |
<|file_name|>templatevm.py<|end_file_name|><|fim▁begin|>#
# The Qubes OS Project, http://www.qubes-os.org
#
# Copyright (C) 2014-2016 Wojtek Porczyk <woju@invisiblethingslab.com>
# Copyright (C) 2016 Marek Marczykowski <marmarek@invisiblethingslab.com>)
# Copyright (C) 2016 Bahtiar `kalkin-` Gadimov <bahti... | ''' Returns a generator containing all domains based on the current
TemplateVM.
'''
for vm in self.app.domains:
if hasattr(vm, 'template') and vm.template is self:
yield vm |
<|file_name|>templatevm.py<|end_file_name|><|fim▁begin|>#
# The Qubes OS Project, http://www.qubes-os.org
#
# Copyright (C) 2014-2016 Wojtek Porczyk <woju@invisiblethingslab.com>
# Copyright (C) 2016 Marek Marczykowski <marmarek@invisiblethingslab.com>)
# Copyright (C) 2016 Bahtiar `kalkin-` Gadimov <bahti... | assert 'template' not in kwargs, "A TemplateVM can not have a template"
self.volume_config = {
'root': {
'name': 'root',
'snap_on_start': False,
'save_on_stop': True,
'rw': True,
'source': None,
'... |
<|file_name|>templatevm.py<|end_file_name|><|fim▁begin|>#
# The Qubes OS Project, http://www.qubes-os.org
#
# Copyright (C) 2014-2016 Wojtek Porczyk <woju@invisiblethingslab.com>
# Copyright (C) 2016 Marek Marczykowski <marmarek@invisiblethingslab.com>)
# Copyright (C) 2016 Bahtiar `kalkin-` Gadimov <bahti... | """Send event about default value change to child VMs
(which use default inherited from the template).
This handler is supposed to be set for properties using
`_default_with_template()` function for the default value.
"""
if newvalue == oldvalue:
... |
<|file_name|>templatevm.py<|end_file_name|><|fim▁begin|>#
# The Qubes OS Project, http://www.qubes-os.org
#
# Copyright (C) 2014-2016 Wojtek Porczyk <woju@invisiblethingslab.com>
# Copyright (C) 2016 Marek Marczykowski <marmarek@invisiblethingslab.com>)
# Copyright (C) 2016 Bahtiar `kalkin-` Gadimov <bahti... | yield vm |
<|file_name|>templatevm.py<|end_file_name|><|fim▁begin|>#
# The Qubes OS Project, http://www.qubes-os.org
#
# Copyright (C) 2014-2016 Wojtek Porczyk <woju@invisiblethingslab.com>
# Copyright (C) 2016 Marek Marczykowski <marmarek@invisiblethingslab.com>)
# Copyright (C) 2016 Bahtiar `kalkin-` Gadimov <bahti... | return |
<|file_name|>templatevm.py<|end_file_name|><|fim▁begin|>#
# The Qubes OS Project, http://www.qubes-os.org
#
# Copyright (C) 2014-2016 Wojtek Porczyk <woju@invisiblethingslab.com>
# Copyright (C) 2016 Marek Marczykowski <marmarek@invisiblethingslab.com>)
# Copyright (C) 2016 Bahtiar `kalkin-` Gadimov <bahti... | continue |
<|file_name|>templatevm.py<|end_file_name|><|fim▁begin|>#
# The Qubes OS Project, http://www.qubes-os.org
#
# Copyright (C) 2014-2016 Wojtek Porczyk <woju@invisiblethingslab.com>
# Copyright (C) 2016 Marek Marczykowski <marmarek@invisiblethingslab.com>)
# Copyright (C) 2016 Bahtiar `kalkin-` Gadimov <bahti... | appvms |
<|file_name|>templatevm.py<|end_file_name|><|fim▁begin|>#
# The Qubes OS Project, http://www.qubes-os.org
#
# Copyright (C) 2014-2016 Wojtek Porczyk <woju@invisiblethingslab.com>
# Copyright (C) 2016 Marek Marczykowski <marmarek@invisiblethingslab.com>)
# Copyright (C) 2016 Bahtiar `kalkin-` Gadimov <bahti... | __init__ |
<|file_name|>templatevm.py<|end_file_name|><|fim▁begin|>#
# The Qubes OS Project, http://www.qubes-os.org
#
# Copyright (C) 2014-2016 Wojtek Porczyk <woju@invisiblethingslab.com>
# Copyright (C) 2016 Marek Marczykowski <marmarek@invisiblethingslab.com>)
# Copyright (C) 2016 Bahtiar `kalkin-` Gadimov <bahti... | on_property_set_child |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>"""
Django settings for djangoApp project.
Generated by 'django-admin startproject' using Django 1.10.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
<|fim▁hole|>https://docs.djangoproject.com/en/1.10/ref/settings/... | For the full list of settings and their values, see |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.