prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>_isyclimate.py<|end_file_name|><|fim▁begin|>""" This is a subfile for IsyClass.py These funtions are accessable via the Isy class opj """ __author__ = 'Peter Shipley <peter.shipley@gmail.com>' __copyright__ = "Copyright (C) 2013 Peter Shipley" __license__ = "BSD" import time ## ## Climate funtions ## ...
self.load_clim()
<|file_name|>_isyclimate.py<|end_file_name|><|fim▁begin|>""" This is a subfile for IsyClass.py These funtions are accessable via the Isy class opj """ __author__ = 'Peter Shipley <peter.shipley@gmail.com>' __copyright__ = "Copyright (C) 2013 Peter Shipley" __license__ = "BSD" import time ## ## Climate funtions ## ...
self.load_clim()
<|file_name|>_isyclimate.py<|end_file_name|><|fim▁begin|>""" This is a subfile for IsyClass.py These funtions are accessable via the Isy class opj """ __author__ = 'Peter Shipley <peter.shipley@gmail.com>' __copyright__ = "Copyright (C) 2013 Peter Shipley" __license__ = "BSD" import time ## ## Climate funtions ## ...
import __main__ print(__main__.__file__) print("syntax ok") exit(0)
<|file_name|>_isyclimate.py<|end_file_name|><|fim▁begin|>""" This is a subfile for IsyClass.py These funtions are accessable via the Isy class opj """ __author__ = 'Peter Shipley <peter.shipley@gmail.com>' __copyright__ = "Copyright (C) 2013 Peter Shipley" __license__ = "BSD" import time ## ## Climate funtions ## ...
load_clim
<|file_name|>_isyclimate.py<|end_file_name|><|fim▁begin|>""" This is a subfile for IsyClass.py These funtions are accessable via the Isy class opj """ __author__ = 'Peter Shipley <peter.shipley@gmail.com>' __copyright__ = "Copyright (C) 2013 Peter Shipley" __license__ = "BSD" import time ## ## Climate funtions ## ...
clim_get_val
<|file_name|>_isyclimate.py<|end_file_name|><|fim▁begin|>""" This is a subfile for IsyClass.py These funtions are accessable via the Isy class opj """ __author__ = 'Peter Shipley <peter.shipley@gmail.com>' __copyright__ = "Copyright (C) 2013 Peter Shipley" __license__ = "BSD" import time ## ## Climate funtions ## ...
clim_query
<|file_name|>_isyclimate.py<|end_file_name|><|fim▁begin|>""" This is a subfile for IsyClass.py These funtions are accessable via the Isy class opj """ __author__ = 'Peter Shipley <peter.shipley@gmail.com>' __copyright__ = "Copyright (C) 2013 Peter Shipley" __license__ = "BSD" import time ## ## Climate funtions ## ...
clim_iter
<|file_name|>leetcode.125.valid-palindrome.py<|end_file_name|><|fim▁begin|><|fim▁hole|> :type s: str :rtype: bool """ if not s: return True start = 0 end = len(s)-1 s = s.lower() while start < end: while start < end and not ...
class Solution(object): def isPalindrome(self, s): """
<|file_name|>leetcode.125.valid-palindrome.py<|end_file_name|><|fim▁begin|>class Solution(object): <|fim_middle|> <|fim▁end|>
def isPalindrome(self, s): """ :type s: str :rtype: bool """ if not s: return True start = 0 end = len(s)-1 s = s.lower() while start < end: while start < end and not s[start].isalnum(): start +=...
<|file_name|>leetcode.125.valid-palindrome.py<|end_file_name|><|fim▁begin|>class Solution(object): def isPalindrome(self, s): <|fim_middle|> <|fim▁end|>
""" :type s: str :rtype: bool """ if not s: return True start = 0 end = len(s)-1 s = s.lower() while start < end: while start < end and not s[start].isalnum(): start += 1 while start < en...
<|file_name|>leetcode.125.valid-palindrome.py<|end_file_name|><|fim▁begin|>class Solution(object): def isPalindrome(self, s): """ :type s: str :rtype: bool """ if not s: <|fim_middle|> start = 0 end = len(s)-1 s = s.lo...
return True
<|file_name|>leetcode.125.valid-palindrome.py<|end_file_name|><|fim▁begin|>class Solution(object): def isPalindrome(self, s): """ :type s: str :rtype: bool """ if not s: return True start = 0 end = len(s)-1 s = s.lower() wh...
start += 1 end -= 1
<|file_name|>leetcode.125.valid-palindrome.py<|end_file_name|><|fim▁begin|>class Solution(object): def isPalindrome(self, s): """ :type s: str :rtype: bool """ if not s: return True start = 0 end = len(s)-1 s = s.lower() wh...
return False
<|file_name|>leetcode.125.valid-palindrome.py<|end_file_name|><|fim▁begin|>class Solution(object): def <|fim_middle|>(self, s): """ :type s: str :rtype: bool """ if not s: return True start = 0 end = len(s)-1 s = s.lower() ...
isPalindrome
<|file_name|>gen_test2111b.py<|end_file_name|><|fim▁begin|>mcinif='mcini_gen2' runname='gen_test2111b' mcpick='gen_test2b.pickle' pathdir='/beegfs/work/ka_oj4748/echoRD' wdir='/beegfs/work/ka_oj4748/gen_tests' update_prec=0.04 update_mf=False update_part=500 import sys<|fim▁hole|>import run_echoRD as rE rE.echoRD_job(...
sys.path.append(pathdir)
<|file_name|>hello_text.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import pygame pygame.display.init() pygame.font.init() modes_list = pygame.display.list_modes() #screen = pygame.display.set_mode(modes_list[0], pygame.FULLSCREEN) # the highest resolution with fullscreen screen = pygame.display.set_mode...
pygame.display.flip() # display the image
<|file_name|>hello_text.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import pygame pygame.display.init() pygame.font.init() modes_list = pygame.display.list_modes() #screen = pygame.display.set_mode(modes_list[0], pygame.FULLSCREEN) # the highest resolution with fullscreen screen = pygame.display.set_mode...
break
<|file_name|>plotf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import sys<|fim▁hole|> def plot(files, fac=1.0): for f in files: if f.split('.')[-1] == 'xy': td = np.loadtxt(f) plt.plot(td[:, 0], np.log(1. / td[:, 1]) * fac, label=f) elif f.split('.')[-1] == 'spc'...
import numpy as np from spc import SPC import matplotlib.pyplot as plt
<|file_name|>plotf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import sys import numpy as np from spc import SPC import matplotlib.pyplot as plt def plot(files, fac=1.0): <|fim_middle|> if __name__ == '__main__': files = sys.argv[2:] fac = float(sys.argv[1]) plot(files, fac) <|fim▁end|>
for f in files: if f.split('.')[-1] == 'xy': td = np.loadtxt(f) plt.plot(td[:, 0], np.log(1. / td[:, 1]) * fac, label=f) elif f.split('.')[-1] == 'spc': td = SPC(f) plt.plot(td.xdata, np.log(1. / np.array(td.ydata)), label=f) plt.legend() plt.s...
<|file_name|>plotf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import sys import numpy as np from spc import SPC import matplotlib.pyplot as plt def plot(files, fac=1.0): for f in files: if f.split('.')[-1] == 'xy': <|fim_middle|> elif f.split('.')[-1] == 'spc'...
td = np.loadtxt(f) plt.plot(td[:, 0], np.log(1. / td[:, 1]) * fac, label=f)
<|file_name|>plotf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import sys import numpy as np from spc import SPC import matplotlib.pyplot as plt def plot(files, fac=1.0): for f in files: if f.split('.')[-1] == 'xy': td = np.loadtxt(f) plt.plot(td[:, 0], np.log(1. / td[:...
td = SPC(f) plt.plot(td.xdata, np.log(1. / np.array(td.ydata)), label=f)
<|file_name|>plotf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import sys import numpy as np from spc import SPC import matplotlib.pyplot as plt def plot(files, fac=1.0): for f in files: if f.split('.')[-1] == 'xy': td = np.loadtxt(f) plt.plot(td[:, 0], np.log(1. / td[:...
files = sys.argv[2:] fac = float(sys.argv[1]) plot(files, fac)
<|file_name|>plotf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import sys import numpy as np from spc import SPC import matplotlib.pyplot as plt def <|fim_middle|>(files, fac=1.0): for f in files: if f.split('.')[-1] == 'xy': td = np.loadtxt(f) plt.plot(td[:, 0], np.log...
plot
<|file_name|>test_memcached.py<|end_file_name|><|fim▁begin|>import time import pymemcache.client import pytest from limits import RateLimitItemPerMinute, RateLimitItemPerSecond from limits.storage import MemcachedStorage, storage_from_string from limits.strategies import ( FixedWindowElasticExpiryRateLimiter, ...
time.sleep(1) assert not limiter.test(per_sec) time.sleep(1)
<|file_name|>test_memcached.py<|end_file_name|><|fim▁begin|>import time import pymemcache.client import pytest from limits import RateLimitItemPerMinute, RateLimitItemPerSecond from limits.storage import MemcachedStorage, storage_from_string from limits.strategies import ( FixedWindowElasticExpiryRateLimiter, ...
@pytest.fixture(autouse=True) def setup(self, memcached, memcached_cluster): self.storage_url = "memcached://localhost:22122" def test_init_options(self, mocker): constructor = mocker.spy(pymemcache.client, "PooledClient") assert storage_from_string(self.storage_url, connect_timeout...
<|file_name|>test_memcached.py<|end_file_name|><|fim▁begin|>import time import pymemcache.client import pytest from limits import RateLimitItemPerMinute, RateLimitItemPerSecond from limits.storage import MemcachedStorage, storage_from_string from limits.strategies import ( FixedWindowElasticExpiryRateLimiter, ...
self.storage_url = "memcached://localhost:22122"
<|file_name|>test_memcached.py<|end_file_name|><|fim▁begin|>import time import pymemcache.client import pytest from limits import RateLimitItemPerMinute, RateLimitItemPerSecond from limits.storage import MemcachedStorage, storage_from_string from limits.strategies import ( FixedWindowElasticExpiryRateLimiter, ...
constructor = mocker.spy(pymemcache.client, "PooledClient") assert storage_from_string(self.storage_url, connect_timeout=1).check() assert constructor.call_args[1]["connect_timeout"] == 1
<|file_name|>test_memcached.py<|end_file_name|><|fim▁begin|>import time import pymemcache.client import pytest from limits import RateLimitItemPerMinute, RateLimitItemPerSecond from limits.storage import MemcachedStorage, storage_from_string from limits.strategies import ( FixedWindowElasticExpiryRateLimiter, ...
storage = MemcachedStorage("memcached://localhost:22122") limiter = FixedWindowRateLimiter(storage) per_min = RateLimitItemPerSecond(10) start = time.time() count = 0 while time.time() - start < 0.5 and count < 10: assert limiter.hit(per_min) coun...
<|file_name|>test_memcached.py<|end_file_name|><|fim▁begin|>import time import pymemcache.client import pytest from limits import RateLimitItemPerMinute, RateLimitItemPerSecond from limits.storage import MemcachedStorage, storage_from_string from limits.strategies import ( FixedWindowElasticExpiryRateLimiter, ...
storage = MemcachedStorage("memcached://localhost:22122,localhost:22123") limiter = FixedWindowRateLimiter(storage) per_min = RateLimitItemPerSecond(10) start = time.time() count = 0 while time.time() - start < 0.5 and count < 10: assert limiter.hit(per_min) ...
<|file_name|>test_memcached.py<|end_file_name|><|fim▁begin|>import time import pymemcache.client import pytest from limits import RateLimitItemPerMinute, RateLimitItemPerSecond from limits.storage import MemcachedStorage, storage_from_string from limits.strategies import ( FixedWindowElasticExpiryRateLimiter, ...
storage = MemcachedStorage("memcached://localhost:22122") limiter = FixedWindowElasticExpiryRateLimiter(storage) per_sec = RateLimitItemPerSecond(2, 2) assert limiter.hit(per_sec) time.sleep(1) assert limiter.hit(per_sec) assert not limiter.test(per_sec) ...
<|file_name|>test_memcached.py<|end_file_name|><|fim▁begin|>import time import pymemcache.client import pytest from limits import RateLimitItemPerMinute, RateLimitItemPerSecond from limits.storage import MemcachedStorage, storage_from_string from limits.strategies import ( FixedWindowElasticExpiryRateLimiter, ...
storage = MemcachedStorage("memcached://localhost:22122,localhost:22123") limiter = FixedWindowElasticExpiryRateLimiter(storage) per_sec = RateLimitItemPerSecond(2, 2) assert limiter.hit(per_sec) time.sleep(1) assert limiter.hit(per_sec) assert not limiter.test(p...
<|file_name|>test_memcached.py<|end_file_name|><|fim▁begin|>import time import pymemcache.client import pytest from limits import RateLimitItemPerMinute, RateLimitItemPerSecond from limits.storage import MemcachedStorage, storage_from_string from limits.strategies import ( FixedWindowElasticExpiryRateLimiter, ...
storage = MemcachedStorage("memcached://localhost:22122") limiter = FixedWindowRateLimiter(storage) per_min = RateLimitItemPerMinute(1) limiter.hit(per_min) assert not limiter.hit(per_min) limiter.clear(per_min) assert limiter.hit(per_min)
<|file_name|>test_memcached.py<|end_file_name|><|fim▁begin|>import time import pymemcache.client import pytest from limits import RateLimitItemPerMinute, RateLimitItemPerSecond from limits.storage import MemcachedStorage, storage_from_string from limits.strategies import ( FixedWindowElasticExpiryRateLimiter, ...
setup
<|file_name|>test_memcached.py<|end_file_name|><|fim▁begin|>import time import pymemcache.client import pytest from limits import RateLimitItemPerMinute, RateLimitItemPerSecond from limits.storage import MemcachedStorage, storage_from_string from limits.strategies import ( FixedWindowElasticExpiryRateLimiter, ...
test_init_options
<|file_name|>test_memcached.py<|end_file_name|><|fim▁begin|>import time import pymemcache.client import pytest from limits import RateLimitItemPerMinute, RateLimitItemPerSecond from limits.storage import MemcachedStorage, storage_from_string from limits.strategies import ( FixedWindowElasticExpiryRateLimiter, ...
test_fixed_window
<|file_name|>test_memcached.py<|end_file_name|><|fim▁begin|>import time import pymemcache.client import pytest from limits import RateLimitItemPerMinute, RateLimitItemPerSecond from limits.storage import MemcachedStorage, storage_from_string from limits.strategies import ( FixedWindowElasticExpiryRateLimiter, ...
test_fixed_window_cluster
<|file_name|>test_memcached.py<|end_file_name|><|fim▁begin|>import time import pymemcache.client import pytest from limits import RateLimitItemPerMinute, RateLimitItemPerSecond from limits.storage import MemcachedStorage, storage_from_string from limits.strategies import ( FixedWindowElasticExpiryRateLimiter, ...
test_fixed_window_with_elastic_expiry
<|file_name|>test_memcached.py<|end_file_name|><|fim▁begin|>import time import pymemcache.client import pytest from limits import RateLimitItemPerMinute, RateLimitItemPerSecond from limits.storage import MemcachedStorage, storage_from_string from limits.strategies import ( FixedWindowElasticExpiryRateLimiter, ...
test_fixed_window_with_elastic_expiry_cluster
<|file_name|>test_memcached.py<|end_file_name|><|fim▁begin|>import time import pymemcache.client import pytest from limits import RateLimitItemPerMinute, RateLimitItemPerSecond from limits.storage import MemcachedStorage, storage_from_string from limits.strategies import ( FixedWindowElasticExpiryRateLimiter, ...
test_clear
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>""" WSGI config for GoodDog 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.10/howto/deployment/wsgi/ """ import os<|fim▁hole|>from django.core.wsgi imp...
<|file_name|>check-quadrant.py<|end_file_name|><|fim▁begin|># Brandon Michael # cis142 # checkForQuadrant.py # Goal: This program will keep asking for input values to check for the quadrant postion, # origin, x-axis and y axis postions # Notes: I used a while loop to make testing values easier and I used the input x,y ...
print("###################################################") # Setup the x and y variables xValue = None
<|file_name|>check-quadrant.py<|end_file_name|><|fim▁begin|># Brandon Michael # cis142 # checkForQuadrant.py # Goal: This program will keep asking for input values to check for the quadrant postion, # origin, x-axis and y axis postions # Notes: I used a while loop to make testing values easier and I used the input x,y ...
break # stops the loop
<|file_name|>check-quadrant.py<|end_file_name|><|fim▁begin|># Brandon Michael # cis142 # checkForQuadrant.py # Goal: This program will keep asking for input values to check for the quadrant postion, # origin, x-axis and y axis postions # Notes: I used a while loop to make testing values easier and I used the input x,y ...
for coordinate in inputCoordinates.strip().split(','): # This checks to see if we have set a value for x # If it is still set to None then the first value is going to be xValue if xValue is None: xValue = int(coordinate) # Since we are checking the...
<|file_name|>check-quadrant.py<|end_file_name|><|fim▁begin|># Brandon Michael # cis142 # checkForQuadrant.py # Goal: This program will keep asking for input values to check for the quadrant postion, # origin, x-axis and y axis postions # Notes: I used a while loop to make testing values easier and I used the input x,y ...
xValue = int(coordinate)
<|file_name|>check-quadrant.py<|end_file_name|><|fim▁begin|># Brandon Michael # cis142 # checkForQuadrant.py # Goal: This program will keep asking for input values to check for the quadrant postion, # origin, x-axis and y axis postions # Notes: I used a while loop to make testing values easier and I used the input x,y ...
yValue = int(coordinate)
<|file_name|>check-quadrant.py<|end_file_name|><|fim▁begin|># Brandon Michael # cis142 # checkForQuadrant.py # Goal: This program will keep asking for input values to check for the quadrant postion, # origin, x-axis and y axis postions # Notes: I used a while loop to make testing values easier and I used the input x,y ...
print("Origin")
<|file_name|>check-quadrant.py<|end_file_name|><|fim▁begin|># Brandon Michael # cis142 # checkForQuadrant.py # Goal: This program will keep asking for input values to check for the quadrant postion, # origin, x-axis and y axis postions # Notes: I used a while loop to make testing values easier and I used the input x,y ...
if xValue == 0 and (yValue < 0 or yValue > 0): print("Y - Axis") # If x is greater or less than 0 and y = 0 its on the X axis elif (xValue < 0 or xValue > 0) and yValue == 0: print("X - Axis") # Anything else and we need to check for quadra...
<|file_name|>check-quadrant.py<|end_file_name|><|fim▁begin|># Brandon Michael # cis142 # checkForQuadrant.py # Goal: This program will keep asking for input values to check for the quadrant postion, # origin, x-axis and y axis postions # Notes: I used a while loop to make testing values easier and I used the input x,y ...
print("Y - Axis")
<|file_name|>check-quadrant.py<|end_file_name|><|fim▁begin|># Brandon Michael # cis142 # checkForQuadrant.py # Goal: This program will keep asking for input values to check for the quadrant postion, # origin, x-axis and y axis postions # Notes: I used a while loop to make testing values easier and I used the input x,y ...
print("X - Axis")
<|file_name|>check-quadrant.py<|end_file_name|><|fim▁begin|># Brandon Michael # cis142 # checkForQuadrant.py # Goal: This program will keep asking for input values to check for the quadrant postion, # origin, x-axis and y axis postions # Notes: I used a while loop to make testing values easier and I used the input x,y ...
if xValue > 0 and yValue > 0: print("Quadrant I") # If x is a negative number and y is a positive number then its in Quadrant 2 elif xValue < 0 and yValue > 0: print("Quadrant II") # If x is a negative number and y i...
<|file_name|>check-quadrant.py<|end_file_name|><|fim▁begin|># Brandon Michael # cis142 # checkForQuadrant.py # Goal: This program will keep asking for input values to check for the quadrant postion, # origin, x-axis and y axis postions # Notes: I used a while loop to make testing values easier and I used the input x,y ...
print("Quadrant I")
<|file_name|>check-quadrant.py<|end_file_name|><|fim▁begin|># Brandon Michael # cis142 # checkForQuadrant.py # Goal: This program will keep asking for input values to check for the quadrant postion, # origin, x-axis and y axis postions # Notes: I used a while loop to make testing values easier and I used the input x,y ...
print("Quadrant II")
<|file_name|>check-quadrant.py<|end_file_name|><|fim▁begin|># Brandon Michael # cis142 # checkForQuadrant.py # Goal: This program will keep asking for input values to check for the quadrant postion, # origin, x-axis and y axis postions # Notes: I used a while loop to make testing values easier and I used the input x,y ...
print("Quadrant III")
<|file_name|>check-quadrant.py<|end_file_name|><|fim▁begin|># Brandon Michael # cis142 # checkForQuadrant.py # Goal: This program will keep asking for input values to check for the quadrant postion, # origin, x-axis and y axis postions # Notes: I used a while loop to make testing values easier and I used the input x,y ...
print("Quadrant IV")
<|file_name|>check-quadrant.py<|end_file_name|><|fim▁begin|># Brandon Michael # cis142 # checkForQuadrant.py # Goal: This program will keep asking for input values to check for the quadrant postion, # origin, x-axis and y axis postions # Notes: I used a while loop to make testing values easier and I used the input x,y ...
print("Please type the input value as x,y") print("Example: 1,-9")
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|>{ 'name' : 'Signature templates for user emails', 'version' : '1.0.0', 'author' : 'IT-Projects LLC, Ivan Yelizariev',<|fim▁hole|> 'depends' : ['base'], 'data':[ 'res_users_signature_views.xml', 'security/res_users_signature_secu...
'license': 'LGPL-3', 'category' : 'Social Network', 'website' : 'https://yelizariev.github.io',
<|file_name|>admin.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ pythoner.net Copyright (C) 2013 PYTHONER.ORG This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of...
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
<|file_name|>admin.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ pythoner.net Copyright (C) 2013 PYTHONER.ORG This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of...
list_display = ('screen_name','city','introduction')
<|file_name|>processor.py<|end_file_name|><|fim▁begin|>import csv import decimal import os import datetime from stocker.common.events import EventStreamNew, EventStockOpen, EventStockClose from stocker.common.orders import OrderBuy, OrderSell from stocker.common.utils import Stream class CompanyProcessor(object): ...
<|file_name|>processor.py<|end_file_name|><|fim▁begin|>import csv import decimal import os import datetime from stocker.common.events import EventStreamNew, EventStockOpen, EventStockClose from stocker.common.orders import OrderBuy, OrderSell from stocker.common.utils import Stream class CompanyProcessor(object): ...
def __init__(self, dirname, company_id): self.dirname = os.path.join(dirname, company_id) self.company_id = company_id def get_dates(self): files = [os.path.splitext(fi)[0] for fi in os.walk(self.dirname).next()[2]] return files def get_row(self, date): filename = o...
<|file_name|>processor.py<|end_file_name|><|fim▁begin|>import csv import decimal import os import datetime from stocker.common.events import EventStreamNew, EventStockOpen, EventStockClose from stocker.common.orders import OrderBuy, OrderSell from stocker.common.utils import Stream class CompanyProcessor(object): ...
self.dirname = os.path.join(dirname, company_id) self.company_id = company_id
<|file_name|>processor.py<|end_file_name|><|fim▁begin|>import csv import decimal import os import datetime from stocker.common.events import EventStreamNew, EventStockOpen, EventStockClose from stocker.common.orders import OrderBuy, OrderSell from stocker.common.utils import Stream class CompanyProcessor(object): ...
files = [os.path.splitext(fi)[0] for fi in os.walk(self.dirname).next()[2]] return files
<|file_name|>processor.py<|end_file_name|><|fim▁begin|>import csv import decimal import os import datetime from stocker.common.events import EventStreamNew, EventStockOpen, EventStockClose from stocker.common.orders import OrderBuy, OrderSell from stocker.common.utils import Stream class CompanyProcessor(object): ...
filename = os.path.join(self.dirname, date) + ".csv" try: with open(filename, 'r') as f: for row in reversed(list(csv.reader(f, delimiter=';'))): try: desc = row[5] if desc.startswith('TRANSAKCJA'): ...
<|file_name|>processor.py<|end_file_name|><|fim▁begin|>import csv import decimal import os import datetime from stocker.common.events import EventStreamNew, EventStockOpen, EventStockClose from stocker.common.orders import OrderBuy, OrderSell from stocker.common.utils import Stream class CompanyProcessor(object): ...
def build_stream(self, dirname_in, filename_out): self.stream = Stream() self.stream.begin(filename_out) self.__process_companies(dirname_in) self.stream.end() def __process_companies(self, dirname): companies = [] for company in os.walk(dirname).next()[1]: ...
<|file_name|>processor.py<|end_file_name|><|fim▁begin|>import csv import decimal import os import datetime from stocker.common.events import EventStreamNew, EventStockOpen, EventStockClose from stocker.common.orders import OrderBuy, OrderSell from stocker.common.utils import Stream class CompanyProcessor(object): ...
self.stream = Stream() self.stream.begin(filename_out) self.__process_companies(dirname_in) self.stream.end()
<|file_name|>processor.py<|end_file_name|><|fim▁begin|>import csv import decimal import os import datetime from stocker.common.events import EventStreamNew, EventStockOpen, EventStockClose from stocker.common.orders import OrderBuy, OrderSell from stocker.common.utils import Stream class CompanyProcessor(object): ...
companies = [] for company in os.walk(dirname).next()[1]: companies.append(CompanyProcessor(dirname, company)) dates_set = set() for company in companies: dates_set.update(company.get_dates()) dates_ordered = sorted(dates_set, key=lambda date: datetime.d...
<|file_name|>processor.py<|end_file_name|><|fim▁begin|>import csv import decimal import os import datetime from stocker.common.events import EventStreamNew, EventStockOpen, EventStockClose from stocker.common.orders import OrderBuy, OrderSell from stocker.common.utils import Stream class CompanyProcessor(object): ...
rows = [] correct_generators = [] correct_day = False generators = [company.get_row(date) for company in companies] for generator in generators: try: row, company_id = generator.next() row = (company_id, row, generator) ...
<|file_name|>processor.py<|end_file_name|><|fim▁begin|>import csv import decimal import os import datetime from stocker.common.events import EventStreamNew, EventStockOpen, EventStockClose from stocker.common.orders import OrderBuy, OrderSell from stocker.common.utils import Stream class CompanyProcessor(object): ...
amount = int(row[3]) limit_price = decimal.Decimal(row[1].replace(',', '.')) timestamp = datetime.datetime.strptime("%s %s" % (date, row[0]), "%Y-%m-%d %H:%M:%S") expiration_date = timestamp + datetime.timedelta(days=1) self.stream.add_event( EventStreamNew(timestamp,...
<|file_name|>processor.py<|end_file_name|><|fim▁begin|>import csv import decimal import os import datetime from stocker.common.events import EventStreamNew, EventStockOpen, EventStockClose from stocker.common.orders import OrderBuy, OrderSell from stocker.common.utils import Stream class CompanyProcessor(object): ...
yield (row, self.company_id)
<|file_name|>processor.py<|end_file_name|><|fim▁begin|>import csv import decimal import os import datetime from stocker.common.events import EventStreamNew, EventStockOpen, EventStockClose from stocker.common.orders import OrderBuy, OrderSell from stocker.common.utils import Stream class CompanyProcessor(object): ...
correct_day = True
<|file_name|>processor.py<|end_file_name|><|fim▁begin|>import csv import decimal import os import datetime from stocker.common.events import EventStreamNew, EventStockOpen, EventStockClose from stocker.common.orders import OrderBuy, OrderSell from stocker.common.utils import Stream class CompanyProcessor(object): ...
self.stream.add_event(EventStockOpen( datetime.datetime.combine(datetime.datetime.strptime(date, "%Y-%m-%d"), datetime.time(9, 0))))
<|file_name|>processor.py<|end_file_name|><|fim▁begin|>import csv import decimal import os import datetime from stocker.common.events import EventStreamNew, EventStockOpen, EventStockClose from stocker.common.orders import OrderBuy, OrderSell from stocker.common.utils import Stream class CompanyProcessor(object): ...
self.stream.add_event(EventStockClose( datetime.datetime.combine(datetime.datetime.strptime(date, "%Y-%m-%d"), datetime.time(18, 0))))
<|file_name|>processor.py<|end_file_name|><|fim▁begin|>import csv import decimal import os import datetime from stocker.common.events import EventStreamNew, EventStockOpen, EventStockClose from stocker.common.orders import OrderBuy, OrderSell from stocker.common.utils import Stream class CompanyProcessor(object): ...
__init__
<|file_name|>processor.py<|end_file_name|><|fim▁begin|>import csv import decimal import os import datetime from stocker.common.events import EventStreamNew, EventStockOpen, EventStockClose from stocker.common.orders import OrderBuy, OrderSell from stocker.common.utils import Stream class CompanyProcessor(object): ...
get_dates
<|file_name|>processor.py<|end_file_name|><|fim▁begin|>import csv import decimal import os import datetime from stocker.common.events import EventStreamNew, EventStockOpen, EventStockClose from stocker.common.orders import OrderBuy, OrderSell from stocker.common.utils import Stream class CompanyProcessor(object): ...
get_row
<|file_name|>processor.py<|end_file_name|><|fim▁begin|>import csv import decimal import os import datetime from stocker.common.events import EventStreamNew, EventStockOpen, EventStockClose from stocker.common.orders import OrderBuy, OrderSell from stocker.common.utils import Stream class CompanyProcessor(object): ...
build_stream
<|file_name|>processor.py<|end_file_name|><|fim▁begin|>import csv import decimal import os import datetime from stocker.common.events import EventStreamNew, EventStockOpen, EventStockClose from stocker.common.orders import OrderBuy, OrderSell from stocker.common.utils import Stream class CompanyProcessor(object): ...
__process_companies
<|file_name|>processor.py<|end_file_name|><|fim▁begin|>import csv import decimal import os import datetime from stocker.common.events import EventStreamNew, EventStockOpen, EventStockClose from stocker.common.orders import OrderBuy, OrderSell from stocker.common.utils import Stream class CompanyProcessor(object): ...
__process_date
<|file_name|>processor.py<|end_file_name|><|fim▁begin|>import csv import decimal import os import datetime from stocker.common.events import EventStreamNew, EventStockOpen, EventStockClose from stocker.common.orders import OrderBuy, OrderSell from stocker.common.utils import Stream class CompanyProcessor(object): ...
__process_row
<|file_name|>_defines.py<|end_file_name|><|fim▁begin|>__author__ = 'sei'<|fim▁hole|> DEFAULT_SERIAL = '/dev/ttyUSB0' DEFAULT_BAUDRATE = 57600<|fim▁end|>
<|file_name|>tastiapp.py<|end_file_name|><|fim▁begin|>from bottle import route, template, error, request, static_file, get, post from index import get_index from bmarks import get_bmarks from tags import get_tags from add import add_tags from bmarklet import get_bmarklet from account import get_account from edit_tags i...
@route('/tags') def bmarks(): return_data = get_tags() return return_data
<|file_name|>tastiapp.py<|end_file_name|><|fim▁begin|>from bottle import route, template, error, request, static_file, get, post from index import get_index from bmarks import get_bmarks from tags import get_tags from add import add_tags from bmarklet import get_bmarklet from account import get_account from edit_tags i...
return_data = get_index() return return_data
<|file_name|>tastiapp.py<|end_file_name|><|fim▁begin|>from bottle import route, template, error, request, static_file, get, post from index import get_index from bmarks import get_bmarks from tags import get_tags from add import add_tags from bmarklet import get_bmarklet from account import get_account from edit_tags i...
return_data = get_bmarklet() return return_data
<|file_name|>tastiapp.py<|end_file_name|><|fim▁begin|>from bottle import route, template, error, request, static_file, get, post from index import get_index from bmarks import get_bmarks from tags import get_tags from add import add_tags from bmarklet import get_bmarklet from account import get_account from edit_tags i...
return_data = add_tags() return return_data
<|file_name|>tastiapp.py<|end_file_name|><|fim▁begin|>from bottle import route, template, error, request, static_file, get, post from index import get_index from bmarks import get_bmarks from tags import get_tags from add import add_tags from bmarklet import get_bmarklet from account import get_account from edit_tags i...
return_data = get_bmarklet() return return_data
<|file_name|>tastiapp.py<|end_file_name|><|fim▁begin|>from bottle import route, template, error, request, static_file, get, post from index import get_index from bmarks import get_bmarks from tags import get_tags from add import add_tags from bmarklet import get_bmarklet from account import get_account from edit_tags i...
return_data = get_bmarks() return return_data
<|file_name|>tastiapp.py<|end_file_name|><|fim▁begin|>from bottle import route, template, error, request, static_file, get, post from index import get_index from bmarks import get_bmarks from tags import get_tags from add import add_tags from bmarklet import get_bmarklet from account import get_account from edit_tags i...
return_data = do_edit() return return_data
<|file_name|>tastiapp.py<|end_file_name|><|fim▁begin|>from bottle import route, template, error, request, static_file, get, post from index import get_index from bmarks import get_bmarks from tags import get_tags from add import add_tags from bmarklet import get_bmarklet from account import get_account from edit_tags i...
return_data = get_edit_tags() return return_data
<|file_name|>tastiapp.py<|end_file_name|><|fim▁begin|>from bottle import route, template, error, request, static_file, get, post from index import get_index from bmarks import get_bmarks from tags import get_tags from add import add_tags from bmarklet import get_bmarklet from account import get_account from edit_tags i...
return_data = get_import_bm() return return_data
<|file_name|>tastiapp.py<|end_file_name|><|fim▁begin|>from bottle import route, template, error, request, static_file, get, post from index import get_index from bmarks import get_bmarks from tags import get_tags from add import add_tags from bmarklet import get_bmarklet from account import get_account from edit_tags i...
return_data = do_login() return return_data
<|file_name|>tastiapp.py<|end_file_name|><|fim▁begin|>from bottle import route, template, error, request, static_file, get, post from index import get_index from bmarks import get_bmarks from tags import get_tags from add import add_tags from bmarklet import get_bmarklet from account import get_account from edit_tags i...
return_data = do_register() return return_data
<|file_name|>tastiapp.py<|end_file_name|><|fim▁begin|>from bottle import route, template, error, request, static_file, get, post from index import get_index from bmarks import get_bmarks from tags import get_tags from add import add_tags from bmarklet import get_bmarklet from account import get_account from edit_tags i...
return_data = get_tags() return return_data
<|file_name|>tastiapp.py<|end_file_name|><|fim▁begin|>from bottle import route, template, error, request, static_file, get, post from index import get_index from bmarks import get_bmarks from tags import get_tags from add import add_tags from bmarklet import get_bmarklet from account import get_account from edit_tags i...
return static_file(filename, root='css')
<|file_name|>tastiapp.py<|end_file_name|><|fim▁begin|>from bottle import route, template, error, request, static_file, get, post from index import get_index from bmarks import get_bmarks from tags import get_tags from add import add_tags from bmarklet import get_bmarklet from account import get_account from edit_tags i...
return static_file(filename, root='js')
<|file_name|>tastiapp.py<|end_file_name|><|fim▁begin|>from bottle import route, template, error, request, static_file, get, post from index import get_index from bmarks import get_bmarks from tags import get_tags from add import add_tags from bmarklet import get_bmarklet from account import get_account from edit_tags i...
return static_file(filename, root='images')
<|file_name|>tastiapp.py<|end_file_name|><|fim▁begin|>from bottle import route, template, error, request, static_file, get, post from index import get_index from bmarks import get_bmarks from tags import get_tags from add import add_tags from bmarklet import get_bmarklet from account import get_account from edit_tags i...
return static_file(filename, root='fonts')
<|file_name|>tastiapp.py<|end_file_name|><|fim▁begin|>from bottle import route, template, error, request, static_file, get, post from index import get_index from bmarks import get_bmarks from tags import get_tags from add import add_tags from bmarklet import get_bmarklet from account import get_account from edit_tags i...
return '<H1>Ooops, its not here<BR>'
<|file_name|>tastiapp.py<|end_file_name|><|fim▁begin|>from bottle import route, template, error, request, static_file, get, post from index import get_index from bmarks import get_bmarks from tags import get_tags from add import add_tags from bmarklet import get_bmarklet from account import get_account from edit_tags i...
return '<H1>Oops, its broken:&nbsp;{}<BR>'.format(error)
<|file_name|>tastiapp.py<|end_file_name|><|fim▁begin|>from bottle import route, template, error, request, static_file, get, post from index import get_index from bmarks import get_bmarks from tags import get_tags from add import add_tags from bmarklet import get_bmarklet from account import get_account from edit_tags i...
myroot
<|file_name|>tastiapp.py<|end_file_name|><|fim▁begin|>from bottle import route, template, error, request, static_file, get, post from index import get_index from bmarks import get_bmarks from tags import get_tags from add import add_tags from bmarklet import get_bmarklet from account import get_account from edit_tags i...
bmarks