prompt large_stringlengths 72 9.34k | completion large_stringlengths 0 7.61k |
|---|---|
<|file_name|>regex_matcherator_naturectr.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
patterns = [r'^.*?/bc_jpg_makerDrop/(crop_fullsize_pad_center)/?.*?/(\d{9}(.*?))\.(.*?)$',
r'^.*?/bc_jpg_makerDrop/(crop_fullsize_pad_anchor)/?.*?/(\d{9}(.*?))\.(.*?)$',
r'^.*?/... | matches_pattern |
<|file_name|>regex_matcherator_naturectr.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
patterns = [r'^.*?/bc_jpg_makerDrop/(crop_fullsize_pad_center)/?.*?/(\d{9}(.*?))\.(.*?)$',
r'^.*?/bc_jpg_makerDrop/(crop_fullsize_pad_anchor)/?.*?/(\d{9}(.*?))\.(.*?)$',
r'^.*?/... | regex_matcherator |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Phaser Editor documentation build configuration file, created by
# sphinx-quickstart on Thu May 25 08:35:14 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuratio... |
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
# |
<|file_name|>sysvipc.py<|end_file_name|><|fim▁begin|>## Copyright (C) 2007-2012 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com>
### 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 ... | "/proc/sysvipc/sem",
"/proc/sysvipc/shm" |
<|file_name|>sysvipc.py<|end_file_name|><|fim▁begin|>## Copyright (C) 2007-2012 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com>
### 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 ... | """SysV IPC related information
"""
plugin_name = "sysvipc"
def setup(self):
self.add_copy_specs([
"/proc/sysvipc/msg",
"/proc/sysvipc/sem",
"/proc/sysvipc/shm"
])
self.add_cmd_output("ipcs") |
<|file_name|>sysvipc.py<|end_file_name|><|fim▁begin|>## Copyright (C) 2007-2012 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com>
### 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 ... | self.add_copy_specs([
"/proc/sysvipc/msg",
"/proc/sysvipc/sem",
"/proc/sysvipc/shm"
])
self.add_cmd_output("ipcs") |
<|file_name|>sysvipc.py<|end_file_name|><|fim▁begin|>## Copyright (C) 2007-2012 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com>
### 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 ... | setup |
<|file_name|>homepage.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe.model.document import Document
from frappe.website.utils import delete_page_cache
class Homepage(Document):
def vali... | self.append('products', dict(item_code=d.name,
item_name=d.item_name, description=d.description, image=d.image)) |
<|file_name|>homepage.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe.model.document import Document
from frappe.website.utils import delete_page_cache
class Homepage(Document):
<|fim_mi... | def validate(self):
if not self.description:
self.description = frappe._("This is an example website auto-generated from ERPNext")
delete_page_cache('home')
def setup_items(self):
for d in frappe.get_all('Item', fields=['name', 'item_name', 'description', 'image'],
filters={'show_in_website': 1}, limit=3... |
<|file_name|>homepage.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe.model.document import Document
from frappe.website.utils import delete_page_cache
class Homepage(Document):
def vali... | if not self.description:
self.description = frappe._("This is an example website auto-generated from ERPNext")
delete_page_cache('home') |
<|file_name|>homepage.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe.model.document import Document
from frappe.website.utils import delete_page_cache
class Homepage(Document):
def vali... | for d in frappe.get_all('Item', fields=['name', 'item_name', 'description', 'image'],
filters={'show_in_website': 1}, limit=3):
doc = frappe.get_doc('Item', d.name)
if not doc.route:
# set missing route
doc.save()
self.append('products', dict(item_code=d.name,
item_name=d.item_name, descripti... |
<|file_name|>homepage.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe.model.document import Document
from frappe.website.utils import delete_page_cache
class Homepage(Document):
def vali... | self.description = frappe._("This is an example website auto-generated from ERPNext") |
<|file_name|>homepage.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe.model.document import Document
from frappe.website.utils import delete_page_cache
class Homepage(Document):
def vali... | doc.save() |
<|file_name|>homepage.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe.model.document import Document
from frappe.website.utils import delete_page_cache
class Homepage(Document):
def <|fi... | validate |
<|file_name|>homepage.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe.model.document import Document
from frappe.website.utils import delete_page_cache
class Homepage(Document):
def vali... | setup_items |
<|file_name|>cifar10_train.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | if self._step % 10 == 0:
num_examples_per_step = FLAGS.batch_size |
<|file_name|>cifar10_train.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | """Train CIFAR-10 for a number of steps."""
with tf.Graph().as_default():
global_step = tf.contrib.framework.get_or_create_global_step()
# Get images and labels for CIFAR-10.
images, labels = cifar10.distorted_inputs()
# Build a Graph that computes the logits predictions from the
# inference m... |
<|file_name|>cifar10_train.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | """Logs loss and runtime."""
def begin(self):
self._step = -1
def before_run(self, run_context):
self._step += 1
self._start_time = time.time()
return tf.train.SessionRunArgs(loss) # Asks for loss value.
def after_run(self, run_context, run_values):
du... |
<|file_name|>cifar10_train.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | self._step = -1 |
<|file_name|>cifar10_train.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | self._step += 1
self._start_time = time.time()
return tf.train.SessionRunArgs(loss) # Asks for loss value. |
<|file_name|>cifar10_train.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | duration = time.time() - self._start_time
loss_value = run_values.results
if self._step % 10 == 0:
num_examples_per_step = FLAGS.batch_size
examples_per_sec = num_examples_per_step / duration
sec_per_batch = float(duration)
format_str = ('%s: step %d, los... |
<|file_name|>cifar10_train.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | cifar10.maybe_download_and_extract()
if tf.gfile.Exists(FLAGS.train_dir):
tf.gfile.DeleteRecursively(FLAGS.train_dir)
tf.gfile.MakeDirs(FLAGS.train_dir)
train() |
<|file_name|>cifar10_train.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | train |
<|file_name|>cifar10_train.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | begin |
<|file_name|>cifar10_train.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | before_run |
<|file_name|>cifar10_train.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | after_run |
<|file_name|>cifar10_train.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | main |
<|file_name|>cifar10_train.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | num_examples_per_step = FLAGS.batch_size
examples_per_sec = num_examples_per_step / duration
sec_per_batch = float(duration)
format_str = ('%s: step %d, loss = %.2f (%.1f examples/sec; %.3f '
'sec/batch)')
print (format_str % (datetime.now(), se... |
<|file_name|>cifar10_train.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | tf.gfile.DeleteRecursively(FLAGS.train_dir) |
<|file_name|>cifar10_train.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | tf.app.run() |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>"""heroku_blog URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlp... | 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) |
<|file_name|>linear_search.py<|end_file_name|><|fim▁begin|>def linear_search(lst,size,value):
i = 0<|fim▁hole|> return -1
def main():
lst = [-31, 0, 1, 2, 2, 4, 65, 83, 99, 782]
size = len(lst)
original_list = ""
value = int(input("\nInput a value to search for: "))
print("\nOriginal Array... | while i < size:
if lst[i] == value:
return i
i = i + 1 |
<|file_name|>linear_search.py<|end_file_name|><|fim▁begin|>
def linear_search(lst,size,value):
<|fim_middle|>
def main():
lst = [-31, 0, 1, 2, 2, 4, 65, 83, 99, 782]
size = len(lst)
original_list = ""
value = int(input("\nInput a value to search for: "))
print("\nOriginal Array: ")
for ... | i = 0
while i < size:
if lst[i] == value:
return i
i = i + 1
return -1 |
<|file_name|>linear_search.py<|end_file_name|><|fim▁begin|>
def linear_search(lst,size,value):
i = 0
while i < size:
if lst[i] == value:
return i
i = i + 1
return -1
def main():
<|fim_middle|>
if __name__ == '__main__':
main()
<|fim▁end|> | lst = [-31, 0, 1, 2, 2, 4, 65, 83, 99, 782]
size = len(lst)
original_list = ""
value = int(input("\nInput a value to search for: "))
print("\nOriginal Array: ")
for i in lst:
original_list += str(i) + " "
print(original_list)
print("\nLinear Search Big O Notation:\n--> Best Cas... |
<|file_name|>linear_search.py<|end_file_name|><|fim▁begin|>
def linear_search(lst,size,value):
i = 0
while i < size:
if lst[i] == value:
<|fim_middle|>
i = i + 1
return -1
def main():
lst = [-31, 0, 1, 2, 2, 4, 65, 83, 99, 782]
size = len(lst)
original_... | return i |
<|file_name|>linear_search.py<|end_file_name|><|fim▁begin|>
def linear_search(lst,size,value):
i = 0
while i < size:
if lst[i] == value:
return i
i = i + 1
return -1
def main():
lst = [-31, 0, 1, 2, 2, 4, 65, 83, 99, 782]
size = len(lst)
original_list = ""
valu... | print(str(value) + " was not found in that array\n") |
<|file_name|>linear_search.py<|end_file_name|><|fim▁begin|>
def linear_search(lst,size,value):
i = 0
while i < size:
if lst[i] == value:
return i
i = i + 1
return -1
def main():
lst = [-31, 0, 1, 2, 2, 4, 65, 83, 99, 782]
size = len(lst)
original_list = ""
valu... | print(str(value) + " was found at index " + str(index)) |
<|file_name|>linear_search.py<|end_file_name|><|fim▁begin|>
def linear_search(lst,size,value):
i = 0
while i < size:
if lst[i] == value:
return i
i = i + 1
return -1
def main():
lst = [-31, 0, 1, 2, 2, 4, 65, 83, 99, 782]
size = len(lst)
original_list = ""
valu... | main() |
<|file_name|>linear_search.py<|end_file_name|><|fim▁begin|>
def <|fim_middle|>(lst,size,value):
i = 0
while i < size:
if lst[i] == value:
return i
i = i + 1
return -1
def main():
lst = [-31, 0, 1, 2, 2, 4, 65, 83, 99, 782]
size = len(lst)
original_list = ""
val... | linear_search |
<|file_name|>linear_search.py<|end_file_name|><|fim▁begin|>
def linear_search(lst,size,value):
i = 0
while i < size:
if lst[i] == value:
return i
i = i + 1
return -1
def <|fim_middle|>():
lst = [-31, 0, 1, 2, 2, 4, 65, 83, 99, 782]
size = len(lst)
original_list = ""... | main |
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright© 2016 ICTSTUDIO <http://www.ictstudio.eu>
# Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': "MIS Builder Cost Center Filter",
'version': '... | 'account_cost_center'
],
'data': [ |
<|file_name|>constants.py<|end_file_name|><|fim▁begin|># Copyright 2022 The Magenta Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... |
# Velocity-related constants.
MIN_MIDI_VELOCITY = 1 # Inclusive.
MAX_MIDI_VELOCITY = 127 # Inclusive. |
<|file_name|>script.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
将json文件中的数据存到数据库中
"""
import requests
import json
import os
from word.models import (Word, EnDefinition, CnDefinition, Audio, Pronunciation, Example, Note)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
prin... | return filepath
return None |
<|file_name|>script.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
将json文件中的数据存到数据库中
"""
import requests
import json
import os
from word.models import (Word, EnDefinition, CnDefinition, Audio, Pronunciation, Example, Note)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
prin... | ws']
print('len', len(data))
for item in data:
content = item['content']
print('uk_audio', item['uk_audio'])
print('us_audio', item['us_audio'])
obj = Word.objects.create(content=content)
if item['uk_audio']:
uk_audio_filepath = save_files('uk', item['cont... |
<|file_name|>script.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
将json文件中的数据存到数据库中
"""
import requests
import json
import os
from word.models import (Word, EnDefinition, CnDefinition, Audio, Pronunciation, Example, Note)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
prin... | /%stp/%s.mp3' % (BASE_DIR, tp, word)
with open(BASE_DIR + '/media/audio/'+ tp +'/'+word+'.mp3', 'wb') as handle:
response = requests.get(url, stream=True)
if response.ok:
# Something went wrong
for block in response.iter_content(1024):
handle.write(block)... |
<|file_name|>script.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
将json文件中的数据存到数据库中
"""
import requests
import json
import os
from word.models import (Word, EnDefinition, CnDefinition, Audio, Pronunciation, Example, Note)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
prin... | file_name, 'r') as f:
data = json.loads(f.read())
process_data(data)
# data = requests.get('' |
<|file_name|>script.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
将json文件中的数据存到数据库中
"""
import requests
import json
import os
from word.models import (Word, EnDefinition, CnDefinition, Audio, Pronunciation, Example, Note)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
prin... | iles('uk', item['content'], item['uk_audio'])
if item['us_audi |
<|file_name|>script.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
将json文件中的数据存到数据库中
"""
import requests
import json
import os
from word.models import (Word, EnDefinition, CnDefinition, Audio, Pronunciation, Example, Note)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
prin... | iles('us', item['content'], item['us_audio'])
if filepath is not None:
pass
Audio.objects.cre |
<|file_name|>script.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
将json文件中的数据存到数据库中
"""
import requests
import json
import os
from word.models import (Word, EnDefinition, CnDefinition, Audio, Pronunciation, Example, Note)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
prin... | .cre |
<|file_name|>script.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
将json文件中的数据存到数据库中
"""
import requests
import json
import os
from word.models import (Word, EnDefinition, CnDefinition, Audio, Pronunciation, Example, Note)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
prin... | _content(1024):
handle.write(block)
return filepath
return None
def seri |
<|file_name|>script.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
将json文件中的数据存到数据库中
"""
import requests
import json
import os
from word.models import (Word, EnDefinition, CnDefinition, Audio, Pronunciation, Example, Note)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
prin... | ") |
<|file_name|>script.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
将json文件中的数据存到数据库中
"""
import requests
import json
import os
from word.models import (Word, EnDefinition, CnDefinition, Audio, Pronunciation, Example, Note)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
prin... | ta = data['d |
<|file_name|>script.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
将json文件中的数据存到数据库中
"""
import requests
import json
import os
from word.models import (Word, EnDefinition, CnDefinition, Audio, Pronunciation, Example, Note)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
prin... |
filep |
<|file_name|>script.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
将json文件中的数据存到数据库中
"""
import requests
import json
import os
from word.models import (Word, EnDefinition, CnDefinition, Audio, Pronunciation, Example, Note)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
prin... |
"""
" |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>"""Tests for Airly."""<|fim▁end|> | |
<|file_name|>production.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
'''
Production Configurations
- Use djangosecure
- Use mailgun to send emails
- Use redis
'''
from __future__ import absolute_import, unicode_literals
from django.utils import six
from .common import * # noqa
# SECRET CONFIGURATION
# -... |
# django-secure
# ------------------------------------------------------------------------------ |
<|file_name|>rst2xml.py<|end_file_name|><|fim▁begin|>#!/var/www/horizon/.venv/bin/python
# $Id: rst2xml.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
A minimal front end to the Docutils Publisher, producing Docuti... | pass
from docutils.core import publish_cmdline, default_description |
<|file_name|>openrc.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import os
# With the addition of Keystone, to use an openstack cloud you should
# authenticate against keystone, which returns a **Token** and **Service
# Catalog**. The catalog contains the endpoint for all services the
# user/tenant has access t... | os.environ['OS_PASSWORD'] = "????????????????????" |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# pkpgcounter : a generic Page Description Language parser
#
# (c) 2003-2009 Jerome Alet <alet@librelogiciel.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gen... |
data_files = []
mofiles = glob.glob(os.sep.join(["po", "*", "*.mo"])) |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# pkpgcounter : a generic Page Description Language parser
#
# (c) 2003-2009 Jerome Alet <alet@librelogiciel.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gen... | data_files.append((docdir, ["ChangeLog"])) |
<|file_name|>get_software_catalogue.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2014 Telefonica Investigación y Desarrollo, S.A.U
#
# This file is part of FI-WARE project.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except... | print(data)
status = utils.processProductInstanceStatus(data) |
<|file_name|>cookie_jar.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import time
from datetime import timedelta
class CookieJar:
def __init__(self, pluginname, account=None):
self.cookies = {}
self.plugin = pluginname
self.account = account
def add_cookies(self, clist):
... | ] = f".{domain}\tTRUE\t{path}\tFALSE\t{exp}\t{name}\t{value}"
|
<|file_name|>cookie_jar.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import time
from datetime import timedelta
class CookieJar:
<|fim_middle|>
<|fim▁end|> | def __init__(self, pluginname, account=None):
self.cookies = {}
self.plugin = pluginname
self.account = account
def add_cookies(self, clist):
for c in clist:
name = c.split("\t")[5]
self.cookies[name] = c
def get_cookies(self):
return list(se... |
<|file_name|>cookie_jar.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import time
from datetime import timedelta
class CookieJar:
def __init__(self, pluginname, account=None):
<|fim_middle|>
def add_cookies(self, clist):
for c in clist:
name = c.split("\t")[5]
... | self.cookies = {}
self.plugin = pluginname
self.account = account |
<|file_name|>cookie_jar.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import time
from datetime import timedelta
class CookieJar:
def __init__(self, pluginname, account=None):
self.cookies = {}
self.plugin = pluginname
self.account = account
def add_cookies(self, clist):
... | for c in clist:
name = c.split("\t")[5]
self.cookies[name] = c |
<|file_name|>cookie_jar.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import time
from datetime import timedelta
class CookieJar:
def __init__(self, pluginname, account=None):
self.cookies = {}
self.plugin = pluginname
self.account = account
def add_cookies(self, clist):
... | return list(self.cookies.values()) |
<|file_name|>cookie_jar.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import time
from datetime import timedelta
class CookieJar:
def __init__(self, pluginname, account=None):
self.cookies = {}
self.plugin = pluginname
self.account = account
def add_cookies(self, clist):
... | if name in self.cookies:
return self.cookies[name].split("\t")[6]
else:
return None |
<|file_name|>cookie_jar.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import time
from datetime import timedelta
class CookieJar:
def __init__(self, pluginname, account=None):
self.cookies = {}
self.plugin = pluginname
self.account = account
def add_cookies(self, clist):
... | return self.parse_cookie(name) |
<|file_name|>cookie_jar.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import time
from datetime import timedelta
class CookieJar:
def __init__(self, pluginname, account=None):
self.cookies = {}
self.plugin = pluginname
self.account = account
def add_cookies(self, clist):
... | self.cookies[
name
] = f".{domain}\tTRUE\t{path}\tFALSE\t{exp}\t{name}\t{value}" |
<|file_name|>cookie_jar.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import time
from datetime import timedelta
class CookieJar:
def __init__(self, pluginname, account=None):
self.cookies = {}
self.plugin = pluginname
self.account = account
def add_cookies(self, clist):
... | self.cookies = {} |
<|file_name|>cookie_jar.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import time
from datetime import timedelta
class CookieJar:
def __init__(self, pluginname, account=None):
self.cookies = {}
self.plugin = pluginname
self.account = account
def add_cookies(self, clist):
... | return self.cookies[name].split("\t")[6] |
<|file_name|>cookie_jar.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import time
from datetime import timedelta
class CookieJar:
def __init__(self, pluginname, account=None):
self.cookies = {}
self.plugin = pluginname
self.account = account
def add_cookies(self, clist):
... | return None |
<|file_name|>cookie_jar.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import time
from datetime import timedelta
class CookieJar:
def <|fim_middle|>(self, pluginname, account=None):
self.cookies = {}
self.plugin = pluginname
self.account = account
def add_cookies(self, clis... | __init__ |
<|file_name|>cookie_jar.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import time
from datetime import timedelta
class CookieJar:
def __init__(self, pluginname, account=None):
self.cookies = {}
self.plugin = pluginname
self.account = account
def <|fim_middle|>(self, clist):... | add_cookies |
<|file_name|>cookie_jar.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import time
from datetime import timedelta
class CookieJar:
def __init__(self, pluginname, account=None):
self.cookies = {}
self.plugin = pluginname
self.account = account
def add_cookies(self, clist):
... | get_cookies |
<|file_name|>cookie_jar.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import time
from datetime import timedelta
class CookieJar:
def __init__(self, pluginname, account=None):
self.cookies = {}
self.plugin = pluginname
self.account = account
def add_cookies(self, clist):
... | parse_cookie |
<|file_name|>cookie_jar.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import time
from datetime import timedelta
class CookieJar:
def __init__(self, pluginname, account=None):
self.cookies = {}
self.plugin = pluginname
self.account = account
def add_cookies(self, clist):
... | get_cookie |
<|file_name|>cookie_jar.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import time
from datetime import timedelta
class CookieJar:
def __init__(self, pluginname, account=None):
self.cookies = {}
self.plugin = pluginname
self.account = account
def add_cookies(self, clist):
... | set_cookie |
<|file_name|>cookie_jar.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import time
from datetime import timedelta
class CookieJar:
def __init__(self, pluginname, account=None):
self.cookies = {}
self.plugin = pluginname
self.account = account
def add_cookies(self, clist):
... | clear |
<|file_name|>test_file.py<|end_file_name|><|fim▁begin|>from runtests.mpi import MPITest
from nbodykit.lab import *
from nbodykit import setup_logging
from numpy.testing import assert_allclose
import tempfile
import os
@MPITest([1])
def test_hdf(comm):
import h5py
# fake structured array
dset = numpy.empt... | data = numpy.random.random(size=(100,5)) |
<|file_name|>test_file.py<|end_file_name|><|fim▁begin|>from runtests.mpi import MPITest
from nbodykit.lab import *
from nbodykit import setup_logging
from numpy.testing import assert_allclose
import tempfile
import os
@MPITest([1])
def test_hdf(comm):
<|fim_middle|>
@MPITest([1, 4])
def test_query_range(comm):
... | import h5py
# fake structured array
dset = numpy.empty(1024, dtype=[('Position', ('f8', 3)), ('Mass', 'f8')])
dset['Position'] = numpy.random.random(size=(1024, 3))
dset['Mass'] = numpy.random.random(size=1024)
tmpfile = tempfile.mkstemp()[1]
with h5py.File(tmpfile , 'w') as ff:
d... |
<|file_name|>test_file.py<|end_file_name|><|fim▁begin|>from runtests.mpi import MPITest
from nbodykit.lab import *
from nbodykit import setup_logging
from numpy.testing import assert_allclose
import tempfile
import os
@MPITest([1])
def test_hdf(comm):
import h5py
# fake structured array
dset = numpy.empt... | import h5py
# fake structured array
dset = numpy.empty(1024, dtype=[('Position', ('f8', 3)), ('Mass', 'f8'), ('Index', 'i8')])
dset['Index'] = numpy.arange(1024)
dset['Position'] = numpy.random.random(size=(1024, 3))
dset['Mass'] = numpy.random.random(size=1024)
if comm.rank == 0:
... |
<|file_name|>test_file.py<|end_file_name|><|fim▁begin|>from runtests.mpi import MPITest
from nbodykit.lab import *
from nbodykit import setup_logging
from numpy.testing import assert_allclose
import tempfile
import os
@MPITest([1])
def test_hdf(comm):
import h5py
# fake structured array
dset = numpy.empt... | with tempfile.NamedTemporaryFile() as ff:
# generate data
data = numpy.random.random(size=(100,5))
numpy.savetxt(ff, data, fmt='%.7e'); ff.seek(0)
# read nrows
names =['a', 'b', 'c', 'd', 'e']
f = CSVCatalog(ff.name, names, blocksize=100, comm=comm)
# make ... |
<|file_name|>test_file.py<|end_file_name|><|fim▁begin|>from runtests.mpi import MPITest
from nbodykit.lab import *
from nbodykit import setup_logging
from numpy.testing import assert_allclose
import tempfile
import os
@MPITest([1])
def test_hdf(comm):
import h5py
# fake structured array
dset = numpy.empt... | tmpfile1 = 'test-glob-1.dat'
tmpfile2 = 'test-glob-2.dat'
# generate data
data = numpy.random.random(size=(100,5))
numpy.savetxt(tmpfile1, data, fmt='%.7e')
numpy.savetxt(tmpfile2, data, fmt='%.7e')
# read using a glob
names =['a', 'b', 'c', 'd', 'e']
f = CSVCatalog('test-glob-*', ... |
<|file_name|>test_file.py<|end_file_name|><|fim▁begin|>from runtests.mpi import MPITest
from nbodykit.lab import *
from nbodykit import setup_logging
from numpy.testing import assert_allclose
import tempfile
import os
@MPITest([1])
def test_hdf(comm):
import h5py
# fake structured array
dset = numpy.empt... | tmpfile1 = 'test-list-1.dat'
tmpfile2 = 'test-list-2.dat'
# generate data
data = numpy.random.random(size=(100,5))
numpy.savetxt(tmpfile1, data, fmt='%.7e')
numpy.savetxt(tmpfile2, data, fmt='%.7e')
# read using a glob
names =['a', 'b', 'c', 'd', 'e']
f = CSVCatalog(['test-list-1.d... |
<|file_name|>test_file.py<|end_file_name|><|fim▁begin|>from runtests.mpi import MPITest
from nbodykit.lab import *
from nbodykit import setup_logging
from numpy.testing import assert_allclose
import tempfile
import os
@MPITest([1])
def test_hdf(comm):
import h5py
# fake structured array
dset = numpy.empt... | tmpfile = tempfile.mkstemp()[1]
with h5py.File(tmpfile , 'w') as ff:
ds = ff.create_dataset('X', data=dset) # store structured array as dataset
ds.attrs['BoxSize'] = 1.0
tmpfile = comm.bcast(tmpfile) |
<|file_name|>test_file.py<|end_file_name|><|fim▁begin|>from runtests.mpi import MPITest
from nbodykit.lab import *
from nbodykit import setup_logging
from numpy.testing import assert_allclose
import tempfile
import os
@MPITest([1])
def test_hdf(comm):
import h5py
# fake structured array
dset = numpy.empt... | tmpfile = comm.bcast(None) |
<|file_name|>test_file.py<|end_file_name|><|fim▁begin|>from runtests.mpi import MPITest
from nbodykit.lab import *
from nbodykit import setup_logging
from numpy.testing import assert_allclose
import tempfile
import os
@MPITest([1])
def test_hdf(comm):
import h5py
# fake structured array
dset = numpy.empt... | os.unlink(tmpfile) |
<|file_name|>test_file.py<|end_file_name|><|fim▁begin|>from runtests.mpi import MPITest
from nbodykit.lab import *
from nbodykit import setup_logging
from numpy.testing import assert_allclose
import tempfile
import os
@MPITest([1])
def <|fim_middle|>(comm):
import h5py
# fake structured array
dset = nump... | test_hdf |
<|file_name|>test_file.py<|end_file_name|><|fim▁begin|>from runtests.mpi import MPITest
from nbodykit.lab import *
from nbodykit import setup_logging
from numpy.testing import assert_allclose
import tempfile
import os
@MPITest([1])
def test_hdf(comm):
import h5py
# fake structured array
dset = numpy.empt... | test_query_range |
<|file_name|>test_file.py<|end_file_name|><|fim▁begin|>from runtests.mpi import MPITest
from nbodykit.lab import *
from nbodykit import setup_logging
from numpy.testing import assert_allclose
import tempfile
import os
@MPITest([1])
def test_hdf(comm):
import h5py
# fake structured array
dset = numpy.empt... | test_csv |
<|file_name|>test_file.py<|end_file_name|><|fim▁begin|>from runtests.mpi import MPITest
from nbodykit.lab import *
from nbodykit import setup_logging
from numpy.testing import assert_allclose
import tempfile
import os
@MPITest([1])
def test_hdf(comm):
import h5py
# fake structured array
dset = numpy.empt... | test_stack_glob |
<|file_name|>test_file.py<|end_file_name|><|fim▁begin|>from runtests.mpi import MPITest
from nbodykit.lab import *
from nbodykit import setup_logging
from numpy.testing import assert_allclose
import tempfile
import os
@MPITest([1])
def test_hdf(comm):
import h5py
# fake structured array
dset = numpy.empt... | test_stack_list |
<|file_name|>setting.py<|end_file_name|><|fim▁begin|>#-*- coding: utf-8 -*-
from flask import current_app, flash, url_for, request
from flask_admin import expose, BaseView
from logpot.admin.base import AuthenticateView, flash_errors
from logpot.admin.forms import SettingForm
from logpot.utils import ImageUtil, getDir... | form.enable_profile_img.data = data['enable_profile_img']
form.ogp_app_id.data = data["ogp_app_id"]
form.ga_tracking_id.data = data["ga_tracking_id"] |
<|file_name|>setting.py<|end_file_name|><|fim▁begin|>#-*- coding: utf-8 -*-
from flask import current_app, flash, url_for, request
from flask_admin import expose, BaseView
from logpot.admin.base import AuthenticateView, flash_errors
from logpot.admin.forms import SettingForm
from logpot.utils import ImageUtil, getDir... | def saveProfileImage(self, filestorage):
buffer = filestorage.stream
buffer.seek(0)
image = Image.open(buffer)
image = ImageUtil.crop_image(image, 64)
current_app.logger.info(image)
dirpath = getDirectoryPath(current_app, '_settings')
filepath = os.path.join(d... |
<|file_name|>setting.py<|end_file_name|><|fim▁begin|>#-*- coding: utf-8 -*-
from flask import current_app, flash, url_for, request
from flask_admin import expose, BaseView
from logpot.admin.base import AuthenticateView, flash_errors
from logpot.admin.forms import SettingForm
from logpot.utils import ImageUtil, getDir... | buffer = filestorage.stream
buffer.seek(0)
image = Image.open(buffer)
image = ImageUtil.crop_image(image, 64)
current_app.logger.info(image)
dirpath = getDirectoryPath(current_app, '_settings')
filepath = os.path.join(dirpath, "profile.png")
image.save(fil... |
<|file_name|>setting.py<|end_file_name|><|fim▁begin|>#-*- coding: utf-8 -*-
from flask import current_app, flash, url_for, request
from flask_admin import expose, BaseView
from logpot.admin.base import AuthenticateView, flash_errors
from logpot.admin.forms import SettingForm
from logpot.utils import ImageUtil, getDir... | form = SettingForm()
if form.validate_on_submit():
if form.profile_img.data:
file = form.profile_img.data
self.saveProfileImage(file)
data = {}
data['site_title'] = form.title.data
data['site_subtitle'] = fo... |
<|file_name|>setting.py<|end_file_name|><|fim▁begin|>#-*- coding: utf-8 -*-
from flask import current_app, flash, url_for, request
from flask_admin import expose, BaseView
from logpot.admin.base import AuthenticateView, flash_errors
from logpot.admin.forms import SettingForm
from logpot.utils import ImageUtil, getDir... | if form.profile_img.data:
file = form.profile_img.data
self.saveProfileImage(file)
data = {}
data['site_title'] = form.title.data
data['site_subtitle'] = form.subtitle.data
data['site_author'] = form.auth... |
<|file_name|>setting.py<|end_file_name|><|fim▁begin|>#-*- coding: utf-8 -*-
from flask import current_app, flash, url_for, request
from flask_admin import expose, BaseView
from logpot.admin.base import AuthenticateView, flash_errors
from logpot.admin.forms import SettingForm
from logpot.utils import ImageUtil, getDir... | file = form.profile_img.data
self.saveProfileImage(file) |
<|file_name|>setting.py<|end_file_name|><|fim▁begin|>#-*- coding: utf-8 -*-
from flask import current_app, flash, url_for, request
from flask_admin import expose, BaseView
from logpot.admin.base import AuthenticateView, flash_errors
from logpot.admin.forms import SettingForm
from logpot.utils import ImageUtil, getDir... | flash('Successfully saved.') |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.