prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>TutorialTVScenes.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.tutorial.TutorialTVScenes from panda3d.core import Camera from direct.task.Task import Task from otp.avatar import Emote from toontown.television.TVScenes import * from toontown.televis...
startTask
<|file_name|>TutorialTVScenes.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.tutorial.TutorialTVScenes from panda3d.core import Camera from direct.task.Task import Task from otp.avatar import Emote from toontown.television.TVScenes import * from toontown.televis...
stopTask
<|file_name|>TutorialTVScenes.py<|end_file_name|><|fim▁begin|># Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.tutorial.TutorialTVScenes from panda3d.core import Camera from direct.task.Task import Task from otp.avatar import Emote from toontown.television.TVScenes import * from toontown.televis...
doRandomEmote
<|file_name|>app_config.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """ Project-wide application configuration. DO NOT STORE SECRETS, PASSWORDS, ETC. IN THIS FILE. They will be exposed to users. Use environment variables instead. See get_secrets() below for a fast way to access them. """ import os """ NAM...
REPOSITORY_ALT_URL = None # 'git@bitbucket.org:nprapps/%s.git' % REPOSITORY_NAME' # The name to be used in paths on the server PROJECT_FILENAME = 'quotable'
<|file_name|>logging.py<|end_file_name|><|fim▁begin|>import logging.handlers import os _pabotlog = logging.getLogger('PABot') _pabotlog.setLevel(logging.DEBUG) _logPath = os.path.abspath("./logging/pabot.log") _formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(name)s - %(message)s') _consoleStreamHand...
<|file_name|>logging.py<|end_file_name|><|fim▁begin|>import logging.handlers import os _pabotlog = logging.getLogger('PABot') _pabotlog.setLevel(logging.DEBUG) _logPath = os.path.abspath("./logging/pabot.log") _formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(name)s - %(message)s') _consoleStreamHand...
_pabotlog.info(message)
<|file_name|>logging.py<|end_file_name|><|fim▁begin|>import logging.handlers import os _pabotlog = logging.getLogger('PABot') _pabotlog.setLevel(logging.DEBUG) _logPath = os.path.abspath("./logging/pabot.log") _formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(name)s - %(message)s') _consoleStreamHand...
_pabotlog.error(message)
<|file_name|>logging.py<|end_file_name|><|fim▁begin|>import logging.handlers import os _pabotlog = logging.getLogger('PABot') _pabotlog.setLevel(logging.DEBUG) _logPath = os.path.abspath("./logging/pabot.log") _formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(name)s - %(message)s') _consoleStreamHand...
LogPABotMessage
<|file_name|>logging.py<|end_file_name|><|fim▁begin|>import logging.handlers import os _pabotlog = logging.getLogger('PABot') _pabotlog.setLevel(logging.DEBUG) _logPath = os.path.abspath("./logging/pabot.log") _formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(name)s - %(message)s') _consoleStreamHand...
LogPABotError
<|file_name|>separator.py<|end_file_name|><|fim▁begin|>from __future__ import division from __future__ import print_function from __future__ import absolute_import <|fim▁hole|>class Separator(wx.StaticLine): def __init__(self, parent): wx.StaticLine.__init__(self, parent.get_container(), -1, ...
import wx from .common import update_class
<|file_name|>separator.py<|end_file_name|><|fim▁begin|>from __future__ import division from __future__ import print_function from __future__ import absolute_import import wx from .common import update_class class Separator(wx.StaticLine): <|fim_middle|> update_class(Separator) <|fim▁end|>
def __init__(self, parent): wx.StaticLine.__init__(self, parent.get_container(), -1, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
<|file_name|>separator.py<|end_file_name|><|fim▁begin|>from __future__ import division from __future__ import print_function from __future__ import absolute_import import wx from .common import update_class class Separator(wx.StaticLine): def __init__(self, parent): <|fim_middle|> update_c...
wx.StaticLine.__init__(self, parent.get_container(), -1, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
<|file_name|>separator.py<|end_file_name|><|fim▁begin|>from __future__ import division from __future__ import print_function from __future__ import absolute_import import wx from .common import update_class class Separator(wx.StaticLine): def <|fim_middle|>(self, parent): wx.StaticLine.__init_...
__init__
<|file_name|>database_type.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ############################################################################## # # Infrastructure # Copyright (C) 2014 Ingenieria ADHOC # No email # # This program is free software: you can redistribute it and/or modify # ...
<|file_name|>database_type.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ############################################################################## # # Infrastructure # Copyright (C) 2014 Ingenieria ADHOC # No email # # This program is free software: you can redistribute it and/or modify # ...
"""""" _name = 'infrastructure.database_type' _description = 'database_type' _columns = { 'name': fields.char(string='Name', required=True), 'prefix': fields.char(string='Prefix', required=True, size=4), 'url_prefix': fields.char(string='URL Prefix'), 'automatic_dro...
<|file_name|>test_property_delete.py<|end_file_name|><|fim▁begin|>""" Unit tests to ensure that we can call reset_traits/delete on a property trait (regression tests for Github issue #67). """ from traits import _py2to3 from traits.api import Any, HasTraits, Int, Property, TraitError from traits.testing.unittest_tool...
e = E() unresetable = e.reset_traits() _py2to3.assertCountEqual(self, unresetable, ['a', 'b'])
<|file_name|>test_property_delete.py<|end_file_name|><|fim▁begin|>""" Unit tests to ensure that we can call reset_traits/delete on a property trait (regression tests for Github issue #67). """ from traits import _py2to3 from traits.api import Any, HasTraits, Int, Property, TraitError from traits.testing.unittest_tool...
a = Property(Any) b = Property(Int)
<|file_name|>test_property_delete.py<|end_file_name|><|fim▁begin|>""" Unit tests to ensure that we can call reset_traits/delete on a property trait (regression tests for Github issue #67). """ from traits import _py2to3 from traits.api import Any, HasTraits, Int, Property, TraitError from traits.testing.unittest_tool...
def test_property_delete(self): e = E() with self.assertRaises(TraitError): del e.a with self.assertRaises(TraitError): del e.b def test_property_reset_traits(self): e = E() unresetable = e.reset_traits() _py2to3.assertCountEqual(self, unr...
<|file_name|>test_property_delete.py<|end_file_name|><|fim▁begin|>""" Unit tests to ensure that we can call reset_traits/delete on a property trait (regression tests for Github issue #67). """ from traits import _py2to3 from traits.api import Any, HasTraits, Int, Property, TraitError from traits.testing.unittest_tool...
e = E() with self.assertRaises(TraitError): del e.a with self.assertRaises(TraitError): del e.b
<|file_name|>test_property_delete.py<|end_file_name|><|fim▁begin|>""" Unit tests to ensure that we can call reset_traits/delete on a property trait (regression tests for Github issue #67). """ from traits import _py2to3 from traits.api import Any, HasTraits, Int, Property, TraitError from traits.testing.unittest_tool...
e = E() unresetable = e.reset_traits() _py2to3.assertCountEqual(self, unresetable, ['a', 'b'])
<|file_name|>test_property_delete.py<|end_file_name|><|fim▁begin|>""" Unit tests to ensure that we can call reset_traits/delete on a property trait (regression tests for Github issue #67). """ from traits import _py2to3 from traits.api import Any, HasTraits, Int, Property, TraitError from traits.testing.unittest_tool...
test_property_delete
<|file_name|>test_property_delete.py<|end_file_name|><|fim▁begin|>""" Unit tests to ensure that we can call reset_traits/delete on a property trait (regression tests for Github issue #67). """ from traits import _py2to3 from traits.api import Any, HasTraits, Int, Property, TraitError from traits.testing.unittest_tool...
test_property_reset_traits
<|file_name|>shuffelz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''# shufflez.py ''' # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
except SearchError, e:
<|file_name|>shuffelz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''# shufflez.py ''' # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
def __init__(self): self.word_list = 'lists/wordlist.txt' self.websites = 'lists/websites.txt' self.user_agent = 'lists/user_agent.txt' def together(self, *functions): process = [] for function in functions: s = Process(target=function) s.start() process.append(s) for s in process: s.join() ...
<|file_name|>shuffelz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''# shufflez.py ''' # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
self.word_list = 'lists/wordlist.txt' self.websites = 'lists/websites.txt' self.user_agent = 'lists/user_agent.txt'
<|file_name|>shuffelz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''# shufflez.py ''' # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
process = [] for function in functions: s = Process(target=function) s.start() process.append(s) for s in process: s.join()
<|file_name|>shuffelz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''# shufflez.py ''' # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
'''Return Random List r (range): int typ : word | site | user-agent ''' lst = [] if typ == 'word': list_to_parse = self.word_list elif typ == 'site': list_to_parse = self.websites elif typ == 'user-agent': list_to_parse = self.user_agent a = open(list_to_parse, 'r') ...
<|file_name|>shuffelz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''# shufflez.py ''' # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
if typ == 'word': l = self.word_list elif typ == 'link': l = self.websites li = open(l, 'a') for i in lst: li.write(i+'\n') li.close()
<|file_name|>shuffelz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''# shufflez.py ''' # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
try: header = { 'User-Agent' : str(user_agent) } req = urllib2.Request(url, headers=header) response = urllib2.urlopen(req) print 'STATUS', response.getcode() except: pass
<|file_name|>shuffelz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''# shufflez.py ''' # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
links_from_google = [] words_from_google = [] try: gs = GoogleSearch(term) gs.results_per_page = 10 results = gs.get_results() for res in results: words_from_google.append(res.title.encode('utf8')) print '\033[92mGot new words from Google...appending to list\n\033[0m' self.append_to_list('...
<|file_name|>shuffelz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''# shufflez.py ''' # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
count = random.randint(1,15) for i, e, in zip(mask.randomize(10, 'site'), mask.randomize(10, 'user-agent')): if count == random.randint(1,15): break else: sleep_time = str(random.randint(1,5)) +'.'+ str(random.randint(1,9)) print 'VISITING', '\033[92m', i , '\033[0m', 'USING', '\033[94m', e, '\033[0m', '...
<|file_name|>shuffelz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''# shufflez.py ''' # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
count = random.randint(1,15) for i in mask.randomize(10, 'word'): if count == random.randint(1,15): break else: sleep_time = str(random.randint(1,5)) +'.'+ str(random.randint(1,9)) print 'SEARCHING FOR', '\033[92m', i ,'\033[0m', 'SLEEPING FOR', '\033[95m', sleep_time, 'SECONDS', '\033[0m', '\n' time....
<|file_name|>shuffelz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''# shufflez.py ''' # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
list_to_parse = self.word_list
<|file_name|>shuffelz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''# shufflez.py ''' # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
list_to_parse = self.websites
<|file_name|>shuffelz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''# shufflez.py ''' # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
list_to_parse = self.user_agent
<|file_name|>shuffelz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''# shufflez.py ''' # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
return map(lambda x:x if 'http://' in x else 'http://' +x, lst)[0:int(r)]
<|file_name|>shuffelz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''# shufflez.py ''' # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
return lst[0:int(r)]
<|file_name|>shuffelz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''# shufflez.py ''' # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
l = self.word_list
<|file_name|>shuffelz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''# shufflez.py ''' # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
l = self.websites
<|file_name|>shuffelz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''# shufflez.py ''' # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
break
<|file_name|>shuffelz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''# shufflez.py ''' # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
sleep_time = str(random.randint(1,5)) +'.'+ str(random.randint(1,9)) print 'VISITING', '\033[92m', i , '\033[0m', 'USING', '\033[94m', e, '\033[0m', 'SLEEPING FOR', '\033[95m', sleep_time, 'SECONDS', '\033[0m' time.sleep(float(sleep_time)) mask.open_url(i, e) print '\n'
<|file_name|>shuffelz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''# shufflez.py ''' # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
break
<|file_name|>shuffelz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''# shufflez.py ''' # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
sleep_time = str(random.randint(1,5)) +'.'+ str(random.randint(1,9)) print 'SEARCHING FOR', '\033[92m', i ,'\033[0m', 'SLEEPING FOR', '\033[95m', sleep_time, 'SECONDS', '\033[0m', '\n' time.sleep(float(sleep_time)) mask.google(i)
<|file_name|>shuffelz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''# shufflez.py ''' # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
__init__
<|file_name|>shuffelz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''# shufflez.py ''' # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
together
<|file_name|>shuffelz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''# shufflez.py ''' # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
randomize
<|file_name|>shuffelz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''# shufflez.py ''' # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
append_to_list
<|file_name|>shuffelz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''# shufflez.py ''' # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
open_url
<|file_name|>shuffelz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''# shufflez.py ''' # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
google
<|file_name|>shuffelz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''# shufflez.py ''' # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
random_websites
<|file_name|>shuffelz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''# shufflez.py ''' # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # ...
random_google
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py def lcm(a, b): return a * b / gcd(a, b) def gcd(a, b): while b != 0: (a, b) = (b, a % b) return a # Returns two integers x, y such that gcd(a, b) = ax + by def egcd(a, b): if a == 0: return (0, 1) el...
if gcd(a, m) == 1: return x % m # Reduces linear congruence to form x = b(mod m)
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py def lcm(a, b): <|fim_middle|> def gcd(a, b): while b != 0: (a, b) = (b, a % b) return a # Returns two integers x, y such that gcd(a, b) = ax + by def egcd(a, b): if a == 0: return (0, 1) else: ...
return a * b / gcd(a, b)
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py def lcm(a, b): return a * b / gcd(a, b) def gcd(a, b): <|fim_middle|> # Returns two integers x, y such that gcd(a, b) = ax + by def egcd(a, b): if a == 0: return (0, 1) else: y, x = egcd(b % a, a) ...
while b != 0: (a, b) = (b, a % b) return a
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py def lcm(a, b): return a * b / gcd(a, b) def gcd(a, b): while b != 0: (a, b) = (b, a % b) return a # Returns two integers x, y such that gcd(a, b) = ax + by def egcd(a, b): <|fim_middle|> # Returns an integer x...
if a == 0: return (0, 1) else: y, x = egcd(b % a, a) return (x - (b // a) * y, y)
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py def lcm(a, b): return a * b / gcd(a, b) def gcd(a, b): while b != 0: (a, b) = (b, a % b) return a # Returns two integers x, y such that gcd(a, b) = ax + by def egcd(a, b): if a == 0: return (0, 1) el...
x, y = egcd(a, m) if gcd(a, m) == 1: return x % m
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py def lcm(a, b): return a * b / gcd(a, b) def gcd(a, b): while b != 0: (a, b) = (b, a % b) return a # Returns two integers x, y such that gcd(a, b) = ax + by def egcd(a, b): if a == 0: return (0, 1) el...
gcdAB = gcd(a, b) a /= gcdAB b /= gcdAB m /= gcd(gcdAB, m) modinv = modInverse(a, m) b *= modinv return (1, b, m)
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py def lcm(a, b): return a * b / gcd(a, b) def gcd(a, b): while b != 0: (a, b) = (b, a % b) return a # Returns two integers x, y such that gcd(a, b) = ax + by def egcd(a, b): if a == 0: return (0, 1) el...
solutions = set() if (b % gcd(a, m) == 0): numSols = gcd(a, m) sol = (b * egcd(a, m)[0] / numSols) % m for i in xrange(0, numSols): solutions.add((sol + m * i / numSols) % m) return solutions
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py def lcm(a, b): return a * b / gcd(a, b) def gcd(a, b): while b != 0: (a, b) = (b, a % b) return a # Returns two integers x, y such that gcd(a, b) = ax + by def egcd(a, b): if a == 0: return (0, 1) el...
x = 0 M = 1 for i in xrange(len(congruences)): M *= congruences[i][2] congruences[i] = reduceCongr(congruences[i][0], congruences[i][1], congruences[i][2]) for j in xrange(len(congruences)): m = congruences[j][2] if gcd(m, ...
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py def lcm(a, b): return a * b / gcd(a, b) def gcd(a, b): while b != 0: (a, b) = (b, a % b) return a # Returns two integers x, y such that gcd(a, b) = ax + by def egcd(a, b): if a == 0: return (0, 1) el...
newCongruences = [] for i in xrange(len(congruences)): congruences[i] = reduceCongr(congruences[i][0], congruences[i][1], congruences[i][2]) # Tests to see whether the system is solvable for j in xrange(len(congruences)): ...
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py def lcm(a, b): return a * b / gcd(a, b) def gcd(a, b): while b != 0: (a, b) = (b, a % b) return a # Returns two integers x, y such that gcd(a, b) = ax + by def egcd(a, b): if a == 0: return (0, 1) el...
solutions = [] for i in xrange(m): value = 0 for degree in xrange(len(coefficients)): value += coefficients[degree] * (i ** (len(coefficients) - degree - 1)) if value % m == 0: solutions.append(i) re...
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py def lcm(a, b): return a * b / gcd(a, b) def gcd(a, b): while b != 0: (a, b) = (b, a % b) return a # Returns two integers x, y such that gcd(a, b) = ax + by def egcd(a, b): if a == 0: <|fim_middle...
return (0, 1)
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py def lcm(a, b): return a * b / gcd(a, b) def gcd(a, b): while b != 0: (a, b) = (b, a % b) return a # Returns two integers x, y such that gcd(a, b) = ax + by def egcd(a, b): if a == 0: return (0, 1) el...
y, x = egcd(b % a, a) return (x - (b // a) * y, y)
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py def lcm(a, b): return a * b / gcd(a, b) def gcd(a, b): while b != 0: (a, b) = (b, a % b) return a # Returns two integers x, y such that gcd(a, b) = ax + by def egcd(a, b): if a == 0: return (0, 1) el...
return x % m
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py def lcm(a, b): return a * b / gcd(a, b) def gcd(a, b): while b != 0: (a, b) = (b, a % b) return a # Returns two integers x, y such that gcd(a, b) = ax + by def egcd(a, b): if a == 0: return (0, 1) el...
numSols = gcd(a, m) sol = (b * egcd(a, m)[0] / numSols) % m for i in xrange(0, numSols): solutions.add((sol + m * i / numSols) % m)
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py def lcm(a, b): return a * b / gcd(a, b) def gcd(a, b): while b != 0: (a, b) = (b, a % b) return a # Returns two integers x, y such that gcd(a, b) = ax + by def egcd(a, b): if a == 0: return (0, 1) el...
return None
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py def lcm(a, b): return a * b / gcd(a, b) def gcd(a, b): while b != 0: (a, b) = (b, a % b) return a # Returns two integers x, y such that gcd(a, b) = ax + by def egcd(a, b): if a == 0: return (0, 1) el...
if (congruences[i][1] - congruences[j][1]) % gcd(congruences[i][2], congruences[j][2]) != 0: return None
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py def lcm(a, b): return a * b / gcd(a, b) def gcd(a, b): while b != 0: (a, b) = (b, a % b) return a # Returns two integers x, y such that gcd(a, b) = ax + by def egcd(a, b): if a == 0: return (0, 1) el...
return None
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py def lcm(a, b): return a * b / gcd(a, b) def gcd(a, b): while b != 0: (a, b) = (b, a % b) return a # Returns two integers x, y such that gcd(a, b) = ax + by def egcd(a, b): if a == 0: return (0, 1) el...
isRedundant = True
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py def lcm(a, b): return a * b / gcd(a, b) def gcd(a, b): while b != 0: (a, b) = (b, a % b) return a # Returns two integers x, y such that gcd(a, b) = ax + by def egcd(a, b): if a == 0: return (0, 1) el...
finalCongruences.append(newCongruences[k])
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py def lcm(a, b): return a * b / gcd(a, b) def gcd(a, b): while b != 0: (a, b) = (b, a % b) return a # Returns two integers x, y such that gcd(a, b) = ax + by def egcd(a, b): if a == 0: return (0, 1) el...
solutions.append(i)
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py def <|fim_middle|>(a, b): return a * b / gcd(a, b) def gcd(a, b): while b != 0: (a, b) = (b, a % b) return a # Returns two integers x, y such that gcd(a, b) = ax + by def egcd(a, b): if a == 0: return (0...
lcm
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py def lcm(a, b): return a * b / gcd(a, b) def <|fim_middle|>(a, b): while b != 0: (a, b) = (b, a % b) return a # Returns two integers x, y such that gcd(a, b) = ax + by def egcd(a, b): if a == 0: return (0...
gcd
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py def lcm(a, b): return a * b / gcd(a, b) def gcd(a, b): while b != 0: (a, b) = (b, a % b) return a # Returns two integers x, y such that gcd(a, b) = ax + by def <|fim_middle|>(a, b): if a == 0: return (0,...
egcd
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py def lcm(a, b): return a * b / gcd(a, b) def gcd(a, b): while b != 0: (a, b) = (b, a % b) return a # Returns two integers x, y such that gcd(a, b) = ax + by def egcd(a, b): if a == 0: return (0, 1) el...
modInverse
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py def lcm(a, b): return a * b / gcd(a, b) def gcd(a, b): while b != 0: (a, b) = (b, a % b) return a # Returns two integers x, y such that gcd(a, b) = ax + by def egcd(a, b): if a == 0: return (0, 1) el...
reduceCongr
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py def lcm(a, b): return a * b / gcd(a, b) def gcd(a, b): while b != 0: (a, b) = (b, a % b) return a # Returns two integers x, y such that gcd(a, b) = ax + by def egcd(a, b): if a == 0: return (0, 1) el...
linCongr
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py def lcm(a, b): return a * b / gcd(a, b) def gcd(a, b): while b != 0: (a, b) = (b, a % b) return a # Returns two integers x, y such that gcd(a, b) = ax + by def egcd(a, b): if a == 0: return (0, 1) el...
crt
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py def lcm(a, b): return a * b / gcd(a, b) def gcd(a, b): while b != 0: (a, b) = (b, a % b) return a # Returns two integers x, y such that gcd(a, b) = ax + by def egcd(a, b): if a == 0: return (0, 1) el...
linCongrSystem
<|file_name|>congruences.py<|end_file_name|><|fim▁begin|>import primes as py def lcm(a, b): return a * b / gcd(a, b) def gcd(a, b): while b != 0: (a, b) = (b, a % b) return a # Returns two integers x, y such that gcd(a, b) = ax + by def egcd(a, b): if a == 0: return (0, 1) el...
polyCongr
<|file_name|>account_test_classes.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from odoo.tests.common import HttpCase from odoo.exceptions import ValidationError class AccountingTestCase(HttpCase): """ This class extends the base TransactionCase, in order to test the accounting with localization set...
else: raise ValidationError('Unexpected journal item. (label: %s, debit: %s, credit: %s)' % (aml.name, round(aml.debit, 2), round(aml.credit, 2))) if theorical_lines: raise ValidationError('Remaining theorical line (not found). %s)' % ([(aml[0], aml[1], aml[2]) for aml in...
<|file_name|>account_test_classes.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from odoo.tests.common import HttpCase from odoo.exceptions import ValidationError class AccountingTestCase(HttpCase): <|fim_middle|> <|fim▁end|>
""" This class extends the base TransactionCase, in order to test the accounting with localization setups. It is configured to run the tests after the installation of all modules, and will SKIP TESTS ifit cannot find an already configured accounting (which means no localization module has been installe...
<|file_name|>account_test_classes.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from odoo.tests.common import HttpCase from odoo.exceptions import ValidationError class AccountingTestCase(HttpCase): """ This class extends the base TransactionCase, in order to test the accounting with localization set...
super(AccountingTestCase, self).setUp() domain = [('company_id', '=', self.env.ref('base.main_company').id)] if not self.env['account.account'].search_count(domain): self.skipTest("No Chart of account found")
<|file_name|>account_test_classes.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from odoo.tests.common import HttpCase from odoo.exceptions import ValidationError class AccountingTestCase(HttpCase): """ This class extends the base TransactionCase, in order to test the accounting with localization set...
for aml in move.line_ids: line = (aml.name, round(aml.debit, 2), round(aml.credit, 2)) if line in theorical_lines: theorical_lines.remove(line) else: raise ValidationError('Unexpected journal item. (label: %s, debit: %s, credit: %s)' % (aml.nam...
<|file_name|>account_test_classes.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from odoo.tests.common import HttpCase from odoo.exceptions import ValidationError class AccountingTestCase(HttpCase): """ This class extends the base TransactionCase, in order to test the accounting with localization set...
'''Ensure the ir.property targetting an account.account passed as parameter exists. In case it's not: create it with a random account. This is useful when testing with partially defined localization (missing stock properties for example) :param property_name: The name of the property. ...
<|file_name|>account_test_classes.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from odoo.tests.common import HttpCase from odoo.exceptions import ValidationError class AccountingTestCase(HttpCase): """ This class extends the base TransactionCase, in order to test the accounting with localization set...
self.skipTest("No Chart of account found")
<|file_name|>account_test_classes.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from odoo.tests.common import HttpCase from odoo.exceptions import ValidationError class AccountingTestCase(HttpCase): """ This class extends the base TransactionCase, in order to test the accounting with localization set...
theorical_lines.remove(line)
<|file_name|>account_test_classes.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from odoo.tests.common import HttpCase from odoo.exceptions import ValidationError class AccountingTestCase(HttpCase): """ This class extends the base TransactionCase, in order to test the accounting with localization set...
raise ValidationError('Unexpected journal item. (label: %s, debit: %s, credit: %s)' % (aml.name, round(aml.debit, 2), round(aml.credit, 2)))
<|file_name|>account_test_classes.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from odoo.tests.common import HttpCase from odoo.exceptions import ValidationError class AccountingTestCase(HttpCase): """ This class extends the base TransactionCase, in order to test the accounting with localization set...
raise ValidationError('Remaining theorical line (not found). %s)' % ([(aml[0], aml[1], aml[2]) for aml in theorical_lines]))
<|file_name|>account_test_classes.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from odoo.tests.common import HttpCase from odoo.exceptions import ValidationError class AccountingTestCase(HttpCase): """ This class extends the base TransactionCase, in order to test the accounting with localization set...
property_id.value_reference = value_reference
<|file_name|>account_test_classes.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from odoo.tests.common import HttpCase from odoo.exceptions import ValidationError class AccountingTestCase(HttpCase): """ This class extends the base TransactionCase, in order to test the accounting with localization set...
self.env['ir.property'].create({ 'name': property_name, 'company_id': company_id.id, 'fields_id': field_id.id, 'value_reference': value_reference, })
<|file_name|>account_test_classes.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from odoo.tests.common import HttpCase from odoo.exceptions import ValidationError class AccountingTestCase(HttpCase): """ This class extends the base TransactionCase, in order to test the accounting with localization set...
setUp
<|file_name|>account_test_classes.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from odoo.tests.common import HttpCase from odoo.exceptions import ValidationError class AccountingTestCase(HttpCase): """ This class extends the base TransactionCase, in order to test the accounting with localization set...
check_complete_move
<|file_name|>account_test_classes.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from odoo.tests.common import HttpCase from odoo.exceptions import ValidationError class AccountingTestCase(HttpCase): """ This class extends the base TransactionCase, in order to test the accounting with localization set...
ensure_account_property
<|file_name|>SubusersGetRequest.py<|end_file_name|><|fim▁begin|>''' Created by auto_sdk on 2014-12-17 17:22:51 ''' from top.api.base import RestApi class SubusersGetRequest(RestApi): def __init__(self,domain='gw.api.taobao.com',port=80): RestApi.__init__(self,domain, port) self.user_nick = None <|fim▁hole...
def getapiname(self):
<|file_name|>SubusersGetRequest.py<|end_file_name|><|fim▁begin|>''' Created by auto_sdk on 2014-12-17 17:22:51 ''' from top.api.base import RestApi class SubusersGetRequest(RestApi): <|fim_middle|> <|fim▁end|>
def __init__(self,domain='gw.api.taobao.com',port=80): RestApi.__init__(self,domain, port) self.user_nick = None def getapiname(self): return 'taobao.subusers.get'
<|file_name|>SubusersGetRequest.py<|end_file_name|><|fim▁begin|>''' Created by auto_sdk on 2014-12-17 17:22:51 ''' from top.api.base import RestApi class SubusersGetRequest(RestApi): def __init__(self,domain='gw.api.taobao.com',port=80): <|fim_middle|> def getapiname(self): return 'taobao.subusers.get'...
RestApi.__init__(self,domain, port) self.user_nick = None
<|file_name|>SubusersGetRequest.py<|end_file_name|><|fim▁begin|>''' Created by auto_sdk on 2014-12-17 17:22:51 ''' from top.api.base import RestApi class SubusersGetRequest(RestApi): def __init__(self,domain='gw.api.taobao.com',port=80): RestApi.__init__(self,domain, port) self.user_nick = None def geta...
return 'taobao.subusers.get'
<|file_name|>SubusersGetRequest.py<|end_file_name|><|fim▁begin|>''' Created by auto_sdk on 2014-12-17 17:22:51 ''' from top.api.base import RestApi class SubusersGetRequest(RestApi): def <|fim_middle|>(self,domain='gw.api.taobao.com',port=80): RestApi.__init__(self,domain, port) self.user_nick = None de...
__init__
<|file_name|>SubusersGetRequest.py<|end_file_name|><|fim▁begin|>''' Created by auto_sdk on 2014-12-17 17:22:51 ''' from top.api.base import RestApi class SubusersGetRequest(RestApi): def __init__(self,domain='gw.api.taobao.com',port=80): RestApi.__init__(self,domain, port) self.user_nick = None def <|fi...
getapiname