function stringlengths 11 56k | repo_name stringlengths 5 60 | features list |
|---|---|---|
def RemoveTransaction(self, transaction):
return self.RemoveTransactions([transaction]) | mrooney/wxbanker | [
17,
9,
17,
7,
1337971002
] |
def Purge(self):
"""
Call this when the account is being deleted and should purge itself.
This will delete all transactions but NOT any linked transactions in other accounts,
because when you close a bank account it doesn't erase the historical transfers in other accounts.
"""
... | mrooney/wxbanker | [
17,
9,
17,
7,
1337971002
] |
def MoveTransactions(self, transactions, destAccount):
Publisher.sendMessage("batch.start")
sources = self.RemoveTransactions(transactions)
destAccount.AddTransactions(transactions, sources)
Publisher.sendMessage("batch.end") | mrooney/wxbanker | [
17,
9,
17,
7,
1337971002
] |
def GetMintId(self):
return self._MintId | mrooney/wxbanker | [
17,
9,
17,
7,
1337971002
] |
def SetMintId(self, mintId):
if mintId:
mintId = int(mintId)
self._MintId = mintId | mrooney/wxbanker | [
17,
9,
17,
7,
1337971002
] |
def IsMintEnabled(self):
return self.MintId is not None | mrooney/wxbanker | [
17,
9,
17,
7,
1337971002
] |
def IsOutOfSync(self):
"""Returns true only if explicitly out of sync: set to sync and able to get a balance, and balance is different."""
if self.IsMintEnabled():
if Mint.IsLoggedIn():
return not self.IsInSync()
return False | mrooney/wxbanker | [
17,
9,
17,
7,
1337971002
] |
def IsInSync(self):
if self.MintId is None:
raise bankexceptions.MintIntegrationException("This account has no MintId.") | mrooney/wxbanker | [
17,
9,
17,
7,
1337971002
] |
def GetSyncString(self):
if self.MintId is None:
raise bankexceptions.MintIntegrationException("This account has no MintId.") | mrooney/wxbanker | [
17,
9,
17,
7,
1337971002
] |
def onTransactionAmountChanged(self, message):
transaction = message.data
if transaction.Parent == self:
debug.debug("Updating balance because I am %s: %s" % (self.Name, transaction))
self.Balance = sum((t.Amount for t in self.Transactions))
else:
debug.debug(... | mrooney/wxbanker | [
17,
9,
17,
7,
1337971002
] |
def __cmp__(self, other):
return cmp(self.Name, other.Name) | mrooney/wxbanker | [
17,
9,
17,
7,
1337971002
] |
def get_event_times(event, n_procs):
result = [s[event][j]["time"] for j in range(n_procs)]
max = np.max(result)
min = np.min(result)
if max > 0:
return max, min, min / max
else:
return max, min, 0.0 | pism/pism | [
82,
34,
82,
29,
1320433417
] |
def get_data(event_list):
"Get event data from the time-stepping loop stage."
return {e: get_event_times(e, n_procs) for e in event_list if e in list(s.keys())} | pism/pism | [
82,
34,
82,
29,
1320433417
] |
def plot(data, total, grand_total):
events = [(e, data[e][0]) for e in data]
events.sort(key=lambda x: x[1])
def better_name(n):
if n in list(better_names.keys()):
return better_names[n]
else:
return n
names = [e[0] for e in events]
times = [e[1] for e in e... | pism/pism | [
82,
34,
82,
29,
1320433417
] |
def __init__(self):
self.session = None | Microvellum/Fluid-Designer | [
69,
30,
69,
37,
1461884765
] |
def update(self, data, scene):
if not self.session:
if self.is_preview:
cscene = bpy.context.scene.cycles
use_osl = cscene.shading_system and cscene.device == 'CPU'
engine.create(self, data, scene,
None, None, None, use_o... | Microvellum/Fluid-Designer | [
69,
30,
69,
37,
1461884765
] |
def bake(self, scene, obj, pass_type, pass_filter, object_id, pixel_array, num_pixels, depth, result):
engine.bake(self, obj, pass_type, pass_filter, object_id, pixel_array, num_pixels, depth, result) | Microvellum/Fluid-Designer | [
69,
30,
69,
37,
1461884765
] |
def view_update(self, context):
if not self.session:
engine.create(self, context.blend_data, context.scene,
context.region, context.space_data, context.region_data)
engine.update(self, context.blend_data, context.scene) | Microvellum/Fluid-Designer | [
69,
30,
69,
37,
1461884765
] |
def update_script_node(self, node):
if engine.with_osl():
from . import osl
osl.update_script_node(node, self.report)
else:
self.report({'ERROR'}, "OSL support disabled in this build.") | Microvellum/Fluid-Designer | [
69,
30,
69,
37,
1461884765
] |
def register():
from . import ui
from . import properties
from . import presets
import atexit
# Make sure we only registered the callback once.
atexit.unregister(engine_exit)
atexit.register(engine_exit)
engine.init()
properties.register()
ui.register()
presets.register()
... | Microvellum/Fluid-Designer | [
69,
30,
69,
37,
1461884765
] |
def main(arguments=None):
"""
The main function used when ``yaml_to_database.py`` when installed as a cl tool
"""
# setup the command-line util settings
su = tools(
arguments=arguments,
docString=__doc__,
logLevel="WARNING",
options_first=False,
projectName=F... | thespacedoctor/fundamentals | [
3,
3,
3,
3,
1456484053
] |
def __init__(
self,
log,
pathToSqlite,
tablePrefix="",
settings=False,
dbConn=False | thespacedoctor/fundamentals | [
3,
3,
3,
3,
1456484053
] |
def convert_sqlite_to_mysql(
self):
"""*copy the contents of the sqlite database into the mysql database*
See class docstring for usage
"""
from fundamentals.renderer import list_of_dictionaries
from fundamentals.mysql import directory_script_runner
self.log.... | thespacedoctor/fundamentals | [
3,
3,
3,
3,
1456484053
] |
def _iter_filename_over_mountpoints(self, filename):
'''iterate absolute filename over self.mountpoints and self.root'''
for mountpoint in self.mountpoints + [self.root]:
_drivename, _filename = os.path.splitdrive(filename)
_filename = _filename.lstrip(os.path.sep)
yield os.path.join(_dr... | RedHatQE/python-moncov | [
1,
2,
1,
4,
1358171954
] |
def raw_data(self, arg_ignored):
'''moncov patched raw data method to fetch stats from moncov data store'''
import moncov
db = moncov.conf.get_db(dbhost=dbhost, dbport=dbport, dbname=dbname)
if hasattr(self, '_moncov_data_cache'):
return self._moncov_data_cache
data ... | RedHatQE/python-moncov | [
1,
2,
1,
4,
1358171954
] |
def _execute(self, unitOfWork):
raise NotImplementedError("Override this function in a subclass") | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __init__(self, itemId):
self.__itemId = itemId | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def _execute(self, uow):
self._session = uow.session
sql = '''select tags.id, tags.name, tags.synonym_code
from tags left join items_tags on tags.id = items_tags.tag_id
where items_tags.item_id is NULL
'''
hangingTags = self._session.query(db.Tag).from_statement(sql).all(... | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def _execute(self, uow):
self._session = uow.session
sql = '''select fields.id, fields.name
from fields left join items_fields on fields.id = items_fields.field_id
where items_fields.item_id is NULL
'''
hangingFields = self._session.query(db.Field).from_statement(sql).all... | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __init__(self, data_ref_id, thumbnail):
self.__dataRefId = data_ref_id
self.__thumbnail = thumbnail | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __init__(self, limit=0, page=1, order_by=""):
self.__limit = limit
self.__page = page
self.__orderBy = order_by | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __getUntaggedItems(self, limit, page, order_by):
order_by_1 = ""
order_by_2 = ""
for col, direction in order_by:
if order_by_1:
order_by_1 += ", "
if order_by_2:
order_by_2 += ", "
order_by_2 += col + " " + direction + " "
... | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __init__(self, query_tree, limit=0, page=1, order_by=[]):
self.__queryTree = query_tree
self.__limit = limit
self.__page = page
self.__orderBy = order_by | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __queryItemsByParseTree(self, query_tree, limit, page, order_by):
order_by_1 = ""
order_by_2 = ""
for col, direction in order_by:
if order_by_1:
order_by_1 += ", "
if order_by_2:
order_by_2 += ", "
order_by_2 += col + " " + ... | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __init__(self, path, objType=None, status=None):
assert not hlp.is_none_or_empty(path)
assert objType is not None or status is not None
#remove trailing slashes in the path
while path.endswith(os.sep):
path = path[0:-1]
self.path = path
self.status = sta... | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def fileBaseName(self):
return os.path.basename(self.path) | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def isDir(self):
return self.type == FileInfo.DIR | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __init__(self, relPath):
self.__relPath = relPath | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __getFileInfo(self, path):
try:
data_ref = self._session.query(db.DataRef)\
.filter(db.DataRef.url_raw==hlp.to_db_format(path))\
.options(joinedload_all("items"))\
.options(joinedload_all("items.item_tags.tag"))\
.options(joinedload... | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __init__(self, login, password):
self.__login = login
self.__password = password | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __loginUser(self, login, password):
if hlp.is_none_or_empty(login):
raise err.LoginError("User login cannot be empty.")
user = self._session.query(db.User).get(login)
if user is None:
raise err.LoginError("User {} doesn't exist.".format(login))
if user.passwor... | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __init__(self, userLogin, newPasswordHash):
self.__userLogin = userLogin
self.__newPasswordHash = newPasswordHash | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __init__(self, user):
self.__user = user | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __saveNewUser(self, user):
#TODO: have to do some basic check of user object validity
self._session.add(user)
self._session.commit()
self._session.refresh(user)
self._session.expunge(user) | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def _execute(self, uow):
self._session = uow.session
return self.__getNamesOfAllTagsAndFields() | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __init__(self, dirRelPath):
self._dirRelPath = dirRelPath | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __init__(self, tag_names=[], user_logins=[], limit=0):
self.__tag_names = tag_names
self.__user_logins = user_logins
self.__limit = limit | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __getRelatedTags(self, tag_names, user_logins, limit):
#TODO user_logins is not used yet..
if len(tag_names) == 0:
#TODO The more items in the repository, the slower this query is performed.
#I think, I should store in database some statistics information, such as number of i... | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __init__(self, item_id, user_login, delete_physical_file=True):
self.__itemId = item_id
self.__userLogin = user_login
self.__deletePhysicalFile = delete_physical_file | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __deleteItem(self, item_id, user_login, delete_physical_file=True):
# We should not delete Item objects from database, because
# we do not want hanging references in HistoryRec table.
# So we just mark Items as deleted.
# DataRef objects are deleted from database, if there are no re... | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __init__(self, item, srcAbsPath=None, dstRelPath=None):
self.__item = item
self.__srcAbsPath = srcAbsPath
self.__dstRelPath = dstRelPath | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __saveNewItem(self, item, srcAbsPath=None, dstRelPath=None):
#We do not need any info, that can be in item.data_ref object at this point.
#But if it is not None, it may break the creation of tags/fields.
#Don't worry, item.data_ref will be assigned a new DataRef instance later (if required).... | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __init__(self, item, newSrcAbsPath, newDstRelPath, userLogin):
'''
Modifies Item and returns detached updated item or raises an exception, if something goes wrong.
item --- is a detached object, representing a new state for stored item with id == item.id. | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def _execute(self, uow):
self._session = uow.session
self._repoBasePath = uow._repo_base_path
self.__updateExistingItem(self.__item, self.__newSrcAbsPath, self.__newDstRelPath, self.__userLogin) | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __updateDataRefAndFilesystem(self, item, persistentItem, newSrcAbsPath, newDstRelPath, userLogin):
origSrcAbsPath = None if persistentItem.data_ref is None \
else os.path.join(self._repoBasePath, persistentItem.data_ref.url)
assert origSrcAbsPath is None or len(origSrcA... | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __updatePlainDataMembers(self, item, persistentItem):
#Here we update simple data members of the item
persistentItem.title = item.title
persistentItem.user_login = item.user_login
self._session.flush() | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __updateFields(self, item, persistentItem, user_login):
newFieldNames = set(map(lambda ifield: ifield.field.name,
[ifield for ifield in item.item_fields]))
oldFieldNames = set(map(lambda ifield: ifield.field.name,
[ifield for ifield in ... | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __init__(self, fileAbsPath):
super(DeleteFileCommand, self).__init__()
self._fileAbsPath = fileAbsPath | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __init__(self, srcFileAbsPath, dstFileAbsPath):
super(MoveFileCommand, self).__init__()
self._srcFileAbsPath = srcFileAbsPath
self._dstFileAbsPath = dstFileAbsPath | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __init__(self, fileAbsPath, newFilename):
dstFileAbsPath = os.path.join(os.path.dirname(fileAbsPath), newFilename)
super(RenameFileCommand, self).__init__(fileAbsPath, dstFileAbsPath) | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __init__(self, dirAbsPath, newDirName):
super(RenameDirectoryCommand, self).__init__()
self._dirAbsPath = dirAbsPath.rstrip(os.sep)
self._newDirName = newDirName.strip(os.sep)
if '/' in self._newDirName or '\\' in self._newDirName:
raise ValueError("OS pathname separator ... | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def __init__(self, item, repoBasePath):
super(CheckItemIntegrityCommand, self).__init__()
self.__item = item
self.__repoBasePath = repoBasePath | vlkv/reggata | [
28,
3,
28,
90,
1289021990
] |
def write_config(config):
"""Writes the config to a file"""
with open(CONFIG_FILE, 'wb') as conf:
config.write(conf) | callowayproject/django-app-skeleton | [
76,
17,
76,
1,
1282242043
] |
def set_config_value(sec, opt, value):
"""Set a config value.
Only sets the value if the value is not founc of empty.
"""
config = ConfigParser.RawConfigParser()
config.read(CONFIG_FILE)
if not config.has_option(sec, opt):
config.set(sec, opt, value)
elif config.get(sec, opt) == '... | callowayproject/django-app-skeleton | [
76,
17,
76,
1,
1282242043
] |
def ensure_venv():
"""Ensure virtualenv and virtuelenv wrapper is installed"""
has_venv = bool(subprocess.Popen(
['which', 'virtualenv'],
stdout=subprocess.PIPE).communicate()[0])
if not has_venv:
print 'virtualenv is required to run this script. Please install it ' \
... | callowayproject/django-app-skeleton | [
76,
17,
76,
1,
1282242043
] |
def replace(opts, text):
"""Replace certain strings will the supplied text
`opts` is a dictionary of variables that will be replaced. Similar to
django, it will look for {{..}} and replace it with the variable value
Since we want to maintance compatibility with django's `startapp` command
we need ... | callowayproject/django-app-skeleton | [
76,
17,
76,
1,
1282242043
] |
def main(options):
config = get_config()
cur_user = ''
if IS_WINDOWS and win32api:
cur_user = win32api.GetUserName()
elif not IS_WINDOWS:
cur_user = os.getlogin()
# Default options
opts = {
'APP_NAME': None,
'PKG_NAME': None,
'PKG_AUTHOR': None,
... | callowayproject/django-app-skeleton | [
76,
17,
76,
1,
1282242043
] |
def _main():
for s in ["NA.TO", "XBB.TO", "NOU.V", "AP-UN.TO", "BRK-A", "AAPL"]:
print("=============================================")
print("s: {}".format(s))
print("get_name: {}".format(ysq.get_name(s)))
print("get_price: {}".format(ysq.get_price(s)))
print("get_volume: ... | mathieugouin/tradesim | [
5,
2,
5,
2,
1488071799
] |
def create_base():
base = RigidFragment()
base.add_atom("O", np.array([-0.4, 0., 0.]), 1.)
base.add_atom("H", np.array([0.4, 0., 0.]), 1.)
base.finalize_setup(shift_com=False) | js850/PyGMIN | [
6,
2,
6,
18,
1333032365
] |
def setup_aatopology(self):
GMIN.initialize()
pot = GMINPotential(GMIN)
coords = pot.getCoords()
nrigid = coords.size / 6
print "I have %d water molecules in the system"%nrigid
print "The initial energy is", pot.getEnergy(coords)
water = create_base() | js850/PyGMIN | [
6,
2,
6,
18,
1333032365
] |
def get_potential(self):
return self.potential | js850/PyGMIN | [
6,
2,
6,
18,
1333032365
] |
def PRIMARYLANGID(lgid): return ((lgid) & 1023) | calexil/FightstickDisplay | [
32,
2,
32,
5,
1489193659
] |
def IMAGE_SNAP_BY_ORDINAL(Ordinal): return ((Ordinal & IMAGE_ORDINAL_FLAG) != 0) | calexil/FightstickDisplay | [
32,
2,
32,
5,
1489193659
] |
def PALETTEINDEX(i): return ((16777216 | (i))) | calexil/FightstickDisplay | [
32,
2,
32,
5,
1489193659
] |
def GetRValue(rgb): return rgb & 0xff | calexil/FightstickDisplay | [
32,
2,
32,
5,
1489193659
] |
def GetBValue(rgb): return (rgb >> 16) & 0xff | calexil/FightstickDisplay | [
32,
2,
32,
5,
1489193659
] |
def b(x):
return x | sircuri/GoodWeUSBLogger | [
9,
6,
9,
4,
1504533143
] |
def b(x):
return codecs.latin_1_encode(x)[0] | sircuri/GoodWeUSBLogger | [
9,
6,
9,
4,
1504533143
] |
def __init__(self, device):
"""
device (file, fileno)
A file object or a fileno of an open hidraw device node.
"""
self._device = device | sircuri/GoodWeUSBLogger | [
9,
6,
9,
4,
1504533143
] |
def getRawReportDescriptor(self):
"""
Return a binary string containing the raw HID report descriptor.
"""
descriptor = _hidraw_report_descriptor()
size = ctypes.c_uint()
self._ioctl(_HIDIOCGRDESCSIZE, size, True)
descriptor.size = size
self._ioctl(_HIDIOC... | sircuri/GoodWeUSBLogger | [
9,
6,
9,
4,
1504533143
] |
def getInfo(self):
"""
Returns a DevInfo instance, a named tuple with the following items:
- bustype: one of BUS_USB, BUS_HIL, BUS_BLUETOOTH or BUS_VIRTUAL
- vendor: device's vendor number
- product: device's product number
"""
devinfo = _hidraw_devinfo()
... | sircuri/GoodWeUSBLogger | [
9,
6,
9,
4,
1504533143
] |
def getPhysicalAddress(self, length=512):
"""
Returns device physical address as a string.
See hidraw documentation for value signification, as it depends on
device's bus type.
"""
name = ctypes.create_string_buffer(length)
self._ioctl(_HIDIOCGRAWPHYS(length), nam... | sircuri/GoodWeUSBLogger | [
9,
6,
9,
4,
1504533143
] |
def sendFeatureReport(self, report, report_num=0):
"""
Send a feature report.
"""
length = len(report) + 1
buf = ctypes.create_string_buffer(b(struct.pack("B", report_num) + report), length)
self._ioctl(_HIDIOCSFEATURE(length), buf, True)
print(_HIDIOCSFEATURE(len... | sircuri/GoodWeUSBLogger | [
9,
6,
9,
4,
1504533143
] |
def run(self):
DistUtilsExtra.auto.install_auto.run(self)
# after DistUtilsExtra automatically copied data/org.soundconverter.gschema.xml
# to /usr/share/glib-2.0/schemas/ it doesn't seem to compile them.
glib_schema_path = os.path.join(self.install_data, 'share/glib-2.0/schemas/')
... | kassoulet/soundconverter | [
195,
48,
195,
2,
1207081526
] |
def setup_class(self, monkeypatch):
monkeypatch.setattr(__builtin__, 'open', lambda x, y: DummyFileHandler()) | satanas/libturpial | [
27,
18,
27,
30,
1300121942
] |
def test_new_image(self, monkeypatch):
media = Media.new_image('foo', 'binary', path='/path/to/ble', info='lorem ipsum')
assert isinstance(media, Media) | satanas/libturpial | [
27,
18,
27,
30,
1300121942
] |
def raise_ex():
raise KeyError | satanas/libturpial | [
27,
18,
27,
30,
1300121942
] |
def setUp(self):
self.config_complete = create_config_from_yaml(TEST_YAML_CONTENT_OK) | pytroll/pytroll-aapp-runner | [
1,
6,
1,
8,
1478765185
] |
def test_check_if_scene_is_unique_return_value(self, config):
"""Test checking if the current scene is unique or if it has been processed earlier."""
config.return_value = self.config_complete
myfilename = "/tmp/mytestfile"
aapp_run_config = AappRunnerConfig(myfilename, 'norrkoping', 'xl... | pytroll/pytroll-aapp-runner | [
1,
6,
1,
8,
1478765185
] |
def main():
import sys
infile = sys.argv[1]
attempts = int(sys.argv[2])
outfile = sys.argv[3]
with open(infile, "r", encoding="utf-8") as f:
templates = read_opdata_file(f)
buf = []
for template in templates:
for _ in range(attempts):
buf.append(template.create_e... | CensoredUsername/dynasm-rs | [
586,
43,
586,
11,
1467672562
] |
def __init__(self, template, constraints):
self.template = template
self.gas_template = FIX_GAS_RE.sub(lambda m: ".{}{}".format(m.group(2), m.group(1)), template)
self.constraints = constraints
self.args = parse_template(template) | CensoredUsername/dynasm-rs | [
586,
43,
586,
11,
1467672562
] |
def reformat_reglist(m):
start = int(m.group(1))
format = m.group(2)
amount = int(m.group(3))
items = []
for i in range(amount):
items.append("v{}{}".format((start + i) % 32, format))
return "{{{}}}".format(", ".join(items)) | CensoredUsername/dynasm-rs | [
586,
43,
586,
11,
1467672562
] |
def __init__(self):
self.values = []
self.emitted = []
self.gas = [] | CensoredUsername/dynasm-rs | [
586,
43,
586,
11,
1467672562
] |
def parse_template(template):
matches = []
for argty, argidx in SUBSTITUTION_RE.findall(template):
if argty == "Imm":
arg = Immediate()
elif argty == "Ident":
arg = Ident()
elif argty == "Mod":
arg = Modifier()
elif argty == "Off":
... | CensoredUsername/dynasm-rs | [
586,
43,
586,
11,
1467672562
] |
def __init__(self):
pass | CensoredUsername/dynasm-rs | [
586,
43,
586,
11,
1467672562
] |
def __init__(self, *args):
self.options = args | CensoredUsername/dynasm-rs | [
586,
43,
586,
11,
1467672562
] |
def create_value(self, history):
prev = history.emitted[-1]
if prev.startswith("X") or prev.startswith("x"):
return random.choice(("LSL", "SXTX"))
else:
return random.choice(("UXTW", "SXTW")) | CensoredUsername/dynasm-rs | [
586,
43,
586,
11,
1467672562
] |
def __init__(self, min, max, scale):
self.min = min
self.max = max
self.scale = scale | CensoredUsername/dynasm-rs | [
586,
43,
586,
11,
1467672562
] |
def create_value(self, history):
prev = history.values[-1]
return random.randrange(1, self.max - prev, self.scale) | CensoredUsername/dynasm-rs | [
586,
43,
586,
11,
1467672562
] |
def __init__(self, count, scale=1):
self.count = count
self.scale = scale | CensoredUsername/dynasm-rs | [
586,
43,
586,
11,
1467672562
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.