body_hash stringlengths 64 64 | body stringlengths 23 109k | docstring stringlengths 1 57k | path stringlengths 4 198 | name stringlengths 1 115 | repository_name stringlengths 7 111 | repository_stars float64 0 191k | lang stringclasses 1
value | body_without_docstring stringlengths 14 108k | unified stringlengths 45 133k |
|---|---|---|---|---|---|---|---|---|---|
e99a9199d4bdf27d78c7bbfbefa9bbe4e6de40021dc14f38226e655daad6151d | def dlg_confirm(title, message):
'Ask the user to confirm an operation'
return xbmcgui.Dialog().yesno(title, message) | Ask the user to confirm an operation | resources/lib/helpers/kodi_ops.py | dlg_confirm | lukrus1/plugin.autoupdatekodi | 1 | python | def dlg_confirm(title, message):
return xbmcgui.Dialog().yesno(title, message) | def dlg_confirm(title, message):
return xbmcgui.Dialog().yesno(title, message)<|docstring|>Ask the user to confirm an operation<|endoftext|> |
7fd42530af8f367c2e034318891fa585546946730bc896a45714c23fd30d49b0 | @contextmanager
def show_busy_dialog():
'Context to show the busy dialog on the screen'
xbmc.executebuiltin('ActivateWindow(busydialognocancel)')
try:
(yield)
finally:
xbmc.executebuiltin('Dialog.Close(busydialognocancel)') | Context to show the busy dialog on the screen | resources/lib/helpers/kodi_ops.py | show_busy_dialog | lukrus1/plugin.autoupdatekodi | 1 | python | @contextmanager
def show_busy_dialog():
xbmc.executebuiltin('ActivateWindow(busydialognocancel)')
try:
(yield)
finally:
xbmc.executebuiltin('Dialog.Close(busydialognocancel)') | @contextmanager
def show_busy_dialog():
xbmc.executebuiltin('ActivateWindow(busydialognocancel)')
try:
(yield)
finally:
xbmc.executebuiltin('Dialog.Close(busydialognocancel)')<|docstring|>Context to show the busy dialog on the screen<|endoftext|> |
0b2db664113e54cc63c9917995ceb99650bc621df9d26324605d6f4a0fe6e82a | def show_busy_dialog_decorator(func):
'Decorator to show the busy dialog on the screen'
@wraps(func)
def busy_dialog_wrapper(*args, **kwargs):
with show_busy_dialog():
return func(*args, **kwargs)
return busy_dialog_wrapper | Decorator to show the busy dialog on the screen | resources/lib/helpers/kodi_ops.py | show_busy_dialog_decorator | lukrus1/plugin.autoupdatekodi | 1 | python | def show_busy_dialog_decorator(func):
@wraps(func)
def busy_dialog_wrapper(*args, **kwargs):
with show_busy_dialog():
return func(*args, **kwargs)
return busy_dialog_wrapper | def show_busy_dialog_decorator(func):
@wraps(func)
def busy_dialog_wrapper(*args, **kwargs):
with show_busy_dialog():
return func(*args, **kwargs)
return busy_dialog_wrapper<|docstring|>Decorator to show the busy dialog on the screen<|endoftext|> |
933397d6a2d9bcf6f159f2d82e026d10ef51a2e4bc450ae8156a70a2de371a51 | def run_plugin_action(path, block=False):
'Create an action that can be run with xbmc.executebuiltin in order to run a Kodi plugin specified by path.\n If block is True (default=False), the execution of code will block until the called plugin has finished running.'
return 'RunPlugin({}, {})'.format(path, blo... | Create an action that can be run with xbmc.executebuiltin in order to run a Kodi plugin specified by path.
If block is True (default=False), the execution of code will block until the called plugin has finished running. | resources/lib/helpers/kodi_ops.py | run_plugin_action | lukrus1/plugin.autoupdatekodi | 1 | python | def run_plugin_action(path, block=False):
'Create an action that can be run with xbmc.executebuiltin in order to run a Kodi plugin specified by path.\n If block is True (default=False), the execution of code will block until the called plugin has finished running.'
return 'RunPlugin({}, {})'.format(path, blo... | def run_plugin_action(path, block=False):
'Create an action that can be run with xbmc.executebuiltin in order to run a Kodi plugin specified by path.\n If block is True (default=False), the execution of code will block until the called plugin has finished running.'
return 'RunPlugin({}, {})'.format(path, blo... |
f13d391e6589d8368a4b6fa3548d667acdf2c4a295283f4a533d85dd455f2d53 | def __init__(self, name, base, quote, volume_min=0, volume_max=0, volume_step=0, ticksize=0, digits=0, digits_volume=0, slippage=0, spread=800000000, price=0, bid=0, ask=0, ticket=0, mrg=0):
'\n Constructor\n '
self.name = name
self.base = base
self.quote = quote
self.volume_min = volu... | Constructor | arbitrage.py | __init__ | terencebeauj/arbitrage_scanner | 0 | python | def __init__(self, name, base, quote, volume_min=0, volume_max=0, volume_step=0, ticksize=0, digits=0, digits_volume=0, slippage=0, spread=800000000, price=0, bid=0, ask=0, ticket=0, mrg=0):
'\n \n '
self.name = name
self.base = base
self.quote = quote
self.volume_min = volume_min
... | def __init__(self, name, base, quote, volume_min=0, volume_max=0, volume_step=0, ticksize=0, digits=0, digits_volume=0, slippage=0, spread=800000000, price=0, bid=0, ask=0, ticket=0, mrg=0):
'\n \n '
self.name = name
self.base = base
self.quote = quote
self.volume_min = volume_min
... |
3370367e70dae0e7be5b10f3e3db0383188cae5675893647ed45e10ca92dfd5a | def calc_volume_and_tick_size(self, binance_public_key, binance_secret_key, binance_client):
'\n Fill the attributes\n Args : public key for binance, secret key for binance et le instantiated client\n void function\n '
try:
infos = binance_client.get_symbol_info(self.name)
... | Fill the attributes
Args : public key for binance, secret key for binance et le instantiated client
void function | arbitrage.py | calc_volume_and_tick_size | terencebeauj/arbitrage_scanner | 0 | python | def calc_volume_and_tick_size(self, binance_public_key, binance_secret_key, binance_client):
'\n Fill the attributes\n Args : public key for binance, secret key for binance et le instantiated client\n void function\n '
try:
infos = binance_client.get_symbol_info(self.name)
... | def calc_volume_and_tick_size(self, binance_public_key, binance_secret_key, binance_client):
'\n Fill the attributes\n Args : public key for binance, secret key for binance et le instantiated client\n void function\n '
try:
infos = binance_client.get_symbol_info(self.name)
... |
8b16902be2212cc78b2f4a6ac9477321373a1ec1a8d146053fe2b8289ac9e333 | def calc_bid_and_ask(self, shrimpy_public_key, shrimpy_secret_key, client, exchange):
'\n Get the bid and ask for this symbol\n Takes in input the public and secret keys for shrimpy and the shrimpy client\n Fill the bid and ask attributes\n '
try:
orderbook = client.get_order... | Get the bid and ask for this symbol
Takes in input the public and secret keys for shrimpy and the shrimpy client
Fill the bid and ask attributes | arbitrage.py | calc_bid_and_ask | terencebeauj/arbitrage_scanner | 0 | python | def calc_bid_and_ask(self, shrimpy_public_key, shrimpy_secret_key, client, exchange):
'\n Get the bid and ask for this symbol\n Takes in input the public and secret keys for shrimpy and the shrimpy client\n Fill the bid and ask attributes\n '
try:
orderbook = client.get_order... | def calc_bid_and_ask(self, shrimpy_public_key, shrimpy_secret_key, client, exchange):
'\n Get the bid and ask for this symbol\n Takes in input the public and secret keys for shrimpy and the shrimpy client\n Fill the bid and ask attributes\n '
try:
orderbook = client.get_order... |
5772de0eb847e997e006a9076d96d6345029203a914f7257b1cfe5750d6f3a79 | def __init__(self, symbol1='', symbol2='', symbol3='', volume_min=0, volume_max=0, magic=None, status=0, pl=0, PLBuy=0, PLSell=0, spread=800000000):
'\n Constructor\n '
self.symbol1 = symbol1
self.symbol2 = symbol2
self.symbol3 = symbol3
self.volume_min = volume_min
self.volume_max... | Constructor | arbitrage.py | __init__ | terencebeauj/arbitrage_scanner | 0 | python | def __init__(self, symbol1=, symbol2=, symbol3=, volume_min=0, volume_max=0, magic=None, status=0, pl=0, PLBuy=0, PLSell=0, spread=800000000):
'\n \n '
self.symbol1 = symbol1
self.symbol2 = symbol2
self.symbol3 = symbol3
self.volume_min = volume_min
self.volume_max = volume_max
... | def __init__(self, symbol1=, symbol2=, symbol3=, volume_min=0, volume_max=0, magic=None, status=0, pl=0, PLBuy=0, PLSell=0, spread=800000000):
'\n \n '
self.symbol1 = symbol1
self.symbol2 = symbol2
self.symbol3 = symbol3
self.volume_min = volume_min
self.volume_max = volume_max
... |
706ccc94f871e49541f1350da510a7e343247ab494907646c999637af5bd7725 | def form_triangles(self, exchange, shrimpy_public_key, shrimpy_secret_key, shrimpy_client):
'\n This function builds all the possible triangles per exchanges\n Takes the public kry, secret key and shrimpy client\n return an array of dictionaries with symbol, base and quote\n '
try:
... | This function builds all the possible triangles per exchanges
Takes the public kry, secret key and shrimpy client
return an array of dictionaries with symbol, base and quote | arbitrage.py | form_triangles | terencebeauj/arbitrage_scanner | 0 | python | def form_triangles(self, exchange, shrimpy_public_key, shrimpy_secret_key, shrimpy_client):
'\n This function builds all the possible triangles per exchanges\n Takes the public kry, secret key and shrimpy client\n return an array of dictionaries with symbol, base and quote\n '
try:
... | def form_triangles(self, exchange, shrimpy_public_key, shrimpy_secret_key, shrimpy_client):
'\n This function builds all the possible triangles per exchanges\n Takes the public kry, secret key and shrimpy client\n return an array of dictionaries with symbol, base and quote\n '
try:
... |
509cfc6c27e771bf933c226b30f426cc8c169f8a1ad1e37a8753a25a3de39c64 | def set_volume_min(self, volume_array):
'\n Fill the minimum volume attribute the triangle can trade\n '
self.volume_min = max(volume_array) | Fill the minimum volume attribute the triangle can trade | arbitrage.py | set_volume_min | terencebeauj/arbitrage_scanner | 0 | python | def set_volume_min(self, volume_array):
'\n \n '
self.volume_min = max(volume_array) | def set_volume_min(self, volume_array):
'\n \n '
self.volume_min = max(volume_array)<|docstring|>Fill the minimum volume attribute the triangle can trade<|endoftext|> |
cd044f928461bd738a2c71fad192ef2b2e93dd7e001f77adf7404c791009e576 | def set_volume_max(self, volume_array):
'\n Fill the maximum volume attribute the triangle can trade\n '
self.volume_max = min(volume_array) | Fill the maximum volume attribute the triangle can trade | arbitrage.py | set_volume_max | terencebeauj/arbitrage_scanner | 0 | python | def set_volume_max(self, volume_array):
'\n \n '
self.volume_max = min(volume_array) | def set_volume_max(self, volume_array):
'\n \n '
self.volume_max = min(volume_array)<|docstring|>Fill the maximum volume attribute the triangle can trade<|endoftext|> |
6fb08216c76856aa60265acef1e129e750a601a433483e7b6f6bef340e51636e | def set_fees(self, shrimpy_public_key, shrimpy_secret_key, shrimpy_client, exchange):
'\n Get the fees for the exchange passed as argument\n '
exchanges = shrimpy_client.get_supported_exchanges()
for i in range((len(exchanges) - 1)):
if (exchange == exchanges[i]['exchange']):
... | Get the fees for the exchange passed as argument | arbitrage.py | set_fees | terencebeauj/arbitrage_scanner | 0 | python | def set_fees(self, shrimpy_public_key, shrimpy_secret_key, shrimpy_client, exchange):
'\n \n '
exchanges = shrimpy_client.get_supported_exchanges()
for i in range((len(exchanges) - 1)):
if (exchange == exchanges[i]['exchange']):
self.fees = round((float((exchanges[i]['worst... | def set_fees(self, shrimpy_public_key, shrimpy_secret_key, shrimpy_client, exchange):
'\n \n '
exchanges = shrimpy_client.get_supported_exchanges()
for i in range((len(exchanges) - 1)):
if (exchange == exchanges[i]['exchange']):
self.fees = round((float((exchanges[i]['worst... |
c046be7021eba544e415a566d4734218188ee9c04054a6e018e3faf1adf76542 | def order_triangle(self):
'\n This function attributes the good positions for each symbols inside the triangle;\n When we created the triangle, the symbol were placed randomly, but they need a specific place for calculations\n '
if (self.symbol1.base != self.symbol2.base):
if (self.... | This function attributes the good positions for each symbols inside the triangle;
When we created the triangle, the symbol were placed randomly, but they need a specific place for calculations | arbitrage.py | order_triangle | terencebeauj/arbitrage_scanner | 0 | python | def order_triangle(self):
'\n This function attributes the good positions for each symbols inside the triangle;\n When we created the triangle, the symbol were placed randomly, but they need a specific place for calculations\n '
if (self.symbol1.base != self.symbol2.base):
if (self.... | def order_triangle(self):
'\n This function attributes the good positions for each symbols inside the triangle;\n When we created the triangle, the symbol were placed randomly, but they need a specific place for calculations\n '
if (self.symbol1.base != self.symbol2.base):
if (self.... |
50e8162161b4bf8bfce581b727fa7098237485a285b9cb2b0bd54d8e492dd815 | def calculate_delta_long(self):
'\n Calculate the mathematical expectation of gain for long positions\n '
if (self.symbol1.ask < (self.symbol2.bid * self.symbol3.bid)):
gain = round(abs((((self.symbol1.ask - (self.symbol2.bid * self.symbol3.bid)) / (self.symbol2.bid * self.symbol3.bid)) * ... | Calculate the mathematical expectation of gain for long positions | arbitrage.py | calculate_delta_long | terencebeauj/arbitrage_scanner | 0 | python | def calculate_delta_long(self):
'\n \n '
if (self.symbol1.ask < (self.symbol2.bid * self.symbol3.bid)):
gain = round(abs((((self.symbol1.ask - (self.symbol2.bid * self.symbol3.bid)) / (self.symbol2.bid * self.symbol3.bid)) * 100)), 2)
self.PLBuy = gain
else:
self.PLBuy ... | def calculate_delta_long(self):
'\n \n '
if (self.symbol1.ask < (self.symbol2.bid * self.symbol3.bid)):
gain = round(abs((((self.symbol1.ask - (self.symbol2.bid * self.symbol3.bid)) / (self.symbol2.bid * self.symbol3.bid)) * 100)), 2)
self.PLBuy = gain
else:
self.PLBuy ... |
b6c6a89429c48e85eb0163a44793e6f4734ce1038a382c0eb42d622cfc9a6689 | def calculate_delta_short(self):
'\n Calculate the mathematical expectation of gain for short positions\n '
if (self.symbol1.bid > (self.symbol2.ask * self.symbol3.ask)):
gain = round(abs((((self.symbol1.bid - (self.symbol2.ask * self.symbol3.ask)) / (self.symbol2.ask * self.symbol3.ask)) ... | Calculate the mathematical expectation of gain for short positions | arbitrage.py | calculate_delta_short | terencebeauj/arbitrage_scanner | 0 | python | def calculate_delta_short(self):
'\n \n '
if (self.symbol1.bid > (self.symbol2.ask * self.symbol3.ask)):
gain = round(abs((((self.symbol1.bid - (self.symbol2.ask * self.symbol3.ask)) / (self.symbol2.ask * self.symbol3.ask)) * 100)), 2)
self.PLSell = gain
else:
self.PLSe... | def calculate_delta_short(self):
'\n \n '
if (self.symbol1.bid > (self.symbol2.ask * self.symbol3.ask)):
gain = round(abs((((self.symbol1.bid - (self.symbol2.ask * self.symbol3.ask)) / (self.symbol2.ask * self.symbol3.ask)) * 100)), 2)
self.PLSell = gain
else:
self.PLSe... |
77affb617250f98443674648ead26406f183847dd05ad1822529a70f45819d7e | def save_triangle(self, path, gain, _type):
'\n Save the triangle if there is an arbitrage opportunity (long or short)\n '
sentence = '\nTriangle: {} {} {}, Gains : {} percent, Type: {}.'
sentence = sentence.format(self.symbol1.name, self.symbol2.name, self.symbol3.name, gain, _type)
with ... | Save the triangle if there is an arbitrage opportunity (long or short) | arbitrage.py | save_triangle | terencebeauj/arbitrage_scanner | 0 | python | def save_triangle(self, path, gain, _type):
'\n \n '
sentence = '\nTriangle: {} {} {}, Gains : {} percent, Type: {}.'
sentence = sentence.format(self.symbol1.name, self.symbol2.name, self.symbol3.name, gain, _type)
with open(path, 'a') as file:
file.write(sentence) | def save_triangle(self, path, gain, _type):
'\n \n '
sentence = '\nTriangle: {} {} {}, Gains : {} percent, Type: {}.'
sentence = sentence.format(self.symbol1.name, self.symbol2.name, self.symbol3.name, gain, _type)
with open(path, 'a') as file:
file.write(sentence)<|docstring|>Save... |
c75663be7d91f2cffdd891d06f2ad05523d7ea48c746d83ff6dbee0f6f17efeb | def optimization(self):
'\n Perform portfolio optimization\n '
pass | Perform portfolio optimization | arbitrage.py | optimization | terencebeauj/arbitrage_scanner | 0 | python | def optimization(self):
'\n \n '
pass | def optimization(self):
'\n \n '
pass<|docstring|>Perform portfolio optimization<|endoftext|> |
caf295cd23a105ee7d668064c490968f93d926b9fda0a325ec328a4f8fcb86b8 | @staticmethod
def info():
'Get basic information of algorithm.\n\n Returns:\n str: Basic information.\n\n '
return 'Kaipa, Krishnanand N., and Debasish Ghose. Glowworm swarm optimization: theory, algorithms, and applications. Vol. 698. Springer, 2017.' | Get basic information of algorithm.
Returns:
str: Basic information. | niapy/algorithms/basic/gso.py | info | carlosal1015/NiaPy | 202 | python | @staticmethod
def info():
'Get basic information of algorithm.\n\n Returns:\n str: Basic information.\n\n '
return 'Kaipa, Krishnanand N., and Debasish Ghose. Glowworm swarm optimization: theory, algorithms, and applications. Vol. 698. Springer, 2017.' | @staticmethod
def info():
'Get basic information of algorithm.\n\n Returns:\n str: Basic information.\n\n '
return 'Kaipa, Krishnanand N., and Debasish Ghose. Glowworm swarm optimization: theory, algorithms, and applications. Vol. 698. Springer, 2017.'<|docstring|>Get basic information ... |
e23eb071f172ba9752a9972d5c196c76f204070dcc190e56fa479c20a23ef56a | def __init__(self, population_size=25, l0=5, nt=5, rho=0.4, gamma=0.6, beta=0.08, s=0.03, distance=euclidean, *args, **kwargs):
'Initialize GlowwormSwarmOptimization.\n\n Args:\n population_size (Optional[int]): Number of glowworms in population.\n l0 (Optional[float]): Initial luciferi... | Initialize GlowwormSwarmOptimization.
Args:
population_size (Optional[int]): Number of glowworms in population.
l0 (Optional[float]): Initial luciferin quantity for each glowworm.
nt (Optional[int]): Number of neighbors.
rho (Optional[float]): Luciferin decay constant.
gamma (Optional[float]): Luci... | niapy/algorithms/basic/gso.py | __init__ | carlosal1015/NiaPy | 202 | python | def __init__(self, population_size=25, l0=5, nt=5, rho=0.4, gamma=0.6, beta=0.08, s=0.03, distance=euclidean, *args, **kwargs):
'Initialize GlowwormSwarmOptimization.\n\n Args:\n population_size (Optional[int]): Number of glowworms in population.\n l0 (Optional[float]): Initial luciferi... | def __init__(self, population_size=25, l0=5, nt=5, rho=0.4, gamma=0.6, beta=0.08, s=0.03, distance=euclidean, *args, **kwargs):
'Initialize GlowwormSwarmOptimization.\n\n Args:\n population_size (Optional[int]): Number of glowworms in population.\n l0 (Optional[float]): Initial luciferi... |
3849338b6f31ed90b73377380f1e40a5c6a91723637df47ec76c829654c8a2b0 | def set_parameters(self, population_size=25, l0=5, nt=5, rho=0.4, gamma=0.6, beta=0.08, s=0.03, distance=euclidean, **kwargs):
'Set the arguments of an algorithm.\n\n Args:\n population_size (Optional[int]): Number of glowworms in population.\n l0 (Optional[float]): Initial luciferin qu... | Set the arguments of an algorithm.
Args:
population_size (Optional[int]): Number of glowworms in population.
l0 (Optional[float]): Initial luciferin quantity for each glowworm.
nt (Optional[int]): Number of neighbors.
rho (Optional[float]): Luciferin decay constant.
gamma (Optional[float]): Lucifer... | niapy/algorithms/basic/gso.py | set_parameters | carlosal1015/NiaPy | 202 | python | def set_parameters(self, population_size=25, l0=5, nt=5, rho=0.4, gamma=0.6, beta=0.08, s=0.03, distance=euclidean, **kwargs):
'Set the arguments of an algorithm.\n\n Args:\n population_size (Optional[int]): Number of glowworms in population.\n l0 (Optional[float]): Initial luciferin qu... | def set_parameters(self, population_size=25, l0=5, nt=5, rho=0.4, gamma=0.6, beta=0.08, s=0.03, distance=euclidean, **kwargs):
'Set the arguments of an algorithm.\n\n Args:\n population_size (Optional[int]): Number of glowworms in population.\n l0 (Optional[float]): Initial luciferin qu... |
75472b81efa5103bf00df3dcc91dfd3f495f884a37f8fe2b60b418e4b8fb7989 | def get_parameters(self):
'Get algorithms parameters values.\n\n Returns:\n Dict[str, Any]: Algorithm parameters.\n\n '
d = super().get_parameters()
d.update({'l0': self.l0, 'nt': self.nt, 'rho': self.rho, 'gamma': self.gamma, 'beta': self.beta, 's': self.s, 'distance': self.distanc... | Get algorithms parameters values.
Returns:
Dict[str, Any]: Algorithm parameters. | niapy/algorithms/basic/gso.py | get_parameters | carlosal1015/NiaPy | 202 | python | def get_parameters(self):
'Get algorithms parameters values.\n\n Returns:\n Dict[str, Any]: Algorithm parameters.\n\n '
d = super().get_parameters()
d.update({'l0': self.l0, 'nt': self.nt, 'rho': self.rho, 'gamma': self.gamma, 'beta': self.beta, 's': self.s, 'distance': self.distanc... | def get_parameters(self):
'Get algorithms parameters values.\n\n Returns:\n Dict[str, Any]: Algorithm parameters.\n\n '
d = super().get_parameters()
d.update({'l0': self.l0, 'nt': self.nt, 'rho': self.rho, 'gamma': self.gamma, 'beta': self.beta, 's': self.s, 'distance': self.distanc... |
82070cdce50b677f0f5f0e97728462372d2cabc18bb9f9e4aa75f3669df2e7d0 | def get_neighbors(self, i, r, glowworms, luciferin):
'Get neighbours of glowworm.\n\n Args:\n i (int): Index of glowworm.\n r (float): Neighborhood distance.\n glowworms (numpy.ndarray):\n luciferin (numpy.ndarray[float]): Luciferin value of glowworm.\n\n Re... | Get neighbours of glowworm.
Args:
i (int): Index of glowworm.
r (float): Neighborhood distance.
glowworms (numpy.ndarray):
luciferin (numpy.ndarray[float]): Luciferin value of glowworm.
Returns:
numpy.ndarray[int]: Indexes of neighborhood glowworms. | niapy/algorithms/basic/gso.py | get_neighbors | carlosal1015/NiaPy | 202 | python | def get_neighbors(self, i, r, glowworms, luciferin):
'Get neighbours of glowworm.\n\n Args:\n i (int): Index of glowworm.\n r (float): Neighborhood distance.\n glowworms (numpy.ndarray):\n luciferin (numpy.ndarray[float]): Luciferin value of glowworm.\n\n Re... | def get_neighbors(self, i, r, glowworms, luciferin):
'Get neighbours of glowworm.\n\n Args:\n i (int): Index of glowworm.\n r (float): Neighborhood distance.\n glowworms (numpy.ndarray):\n luciferin (numpy.ndarray[float]): Luciferin value of glowworm.\n\n Re... |
866dba2c00f4dba513f86c61ea05d12656a694a781316d40a62301e060ee6e0f | def probabilities(self, i, neighbors, luciferin):
'Calculate probabilities for glowworm to movement.\n\n Args:\n i (int): Index of glowworm to search for probable movement.\n neighbors (numpy.ndarray[float]):\n luciferin (numpy.ndarray[float]):\n\n Returns:\n ... | Calculate probabilities for glowworm to movement.
Args:
i (int): Index of glowworm to search for probable movement.
neighbors (numpy.ndarray[float]):
luciferin (numpy.ndarray[float]):
Returns:
numpy.ndarray[float]: Probabilities for each glowworm in swarm. | niapy/algorithms/basic/gso.py | probabilities | carlosal1015/NiaPy | 202 | python | def probabilities(self, i, neighbors, luciferin):
'Calculate probabilities for glowworm to movement.\n\n Args:\n i (int): Index of glowworm to search for probable movement.\n neighbors (numpy.ndarray[float]):\n luciferin (numpy.ndarray[float]):\n\n Returns:\n ... | def probabilities(self, i, neighbors, luciferin):
'Calculate probabilities for glowworm to movement.\n\n Args:\n i (int): Index of glowworm to search for probable movement.\n neighbors (numpy.ndarray[float]):\n luciferin (numpy.ndarray[float]):\n\n Returns:\n ... |
387951617ee6369e4e0b551e9b9ab69c36ada5e126b3e91cf79212abb7efad23 | def move_select(self, pb, i):
'Get move index for the i-th glowworm.\n\n Args:\n pb (numpy.ndarray): Probabilities.\n i (int): Index of the glowworm.\n\n Returns:\n int: Index i-th glowworm will move towards.\n\n '
(r, b_l, b_u) = (self.random(), 0, 0)
f... | Get move index for the i-th glowworm.
Args:
pb (numpy.ndarray): Probabilities.
i (int): Index of the glowworm.
Returns:
int: Index i-th glowworm will move towards. | niapy/algorithms/basic/gso.py | move_select | carlosal1015/NiaPy | 202 | python | def move_select(self, pb, i):
'Get move index for the i-th glowworm.\n\n Args:\n pb (numpy.ndarray): Probabilities.\n i (int): Index of the glowworm.\n\n Returns:\n int: Index i-th glowworm will move towards.\n\n '
(r, b_l, b_u) = (self.random(), 0, 0)
f... | def move_select(self, pb, i):
'Get move index for the i-th glowworm.\n\n Args:\n pb (numpy.ndarray): Probabilities.\n i (int): Index of the glowworm.\n\n Returns:\n int: Index i-th glowworm will move towards.\n\n '
(r, b_l, b_u) = (self.random(), 0, 0)
f... |
22ebb0bc1d3a7e6a72efde719bf28cf6c917ed253e044339ba7bd751362c75c7 | def range_update(self, range_, neighbors, sensing_range):
'Update range.'
return (range_ + (self.beta * (self.nt - np.sum(neighbors)))) | Update range. | niapy/algorithms/basic/gso.py | range_update | carlosal1015/NiaPy | 202 | python | def range_update(self, range_, neighbors, sensing_range):
return (range_ + (self.beta * (self.nt - np.sum(neighbors)))) | def range_update(self, range_, neighbors, sensing_range):
return (range_ + (self.beta * (self.nt - np.sum(neighbors))))<|docstring|>Update range.<|endoftext|> |
1c5be9165ce81570bdad318198ca39096187e53d8fa584fd718baa03355a6720 | def init_population(self, task):
'Initialize population.\n\n Args:\n task (Task): Optimization task.\n\n Returns:\n Tuple[numpy.ndarray, numpy.ndarray[float], Dict[str, Any]]:\n 1. Initialized population of glowworms.\n 2. Initialized populations fun... | Initialize population.
Args:
task (Task): Optimization task.
Returns:
Tuple[numpy.ndarray, numpy.ndarray[float], Dict[str, Any]]:
1. Initialized population of glowworms.
2. Initialized populations function/fitness values.
3. Additional arguments:
* luciferin (numpy.ndarray)... | niapy/algorithms/basic/gso.py | init_population | carlosal1015/NiaPy | 202 | python | def init_population(self, task):
'Initialize population.\n\n Args:\n task (Task): Optimization task.\n\n Returns:\n Tuple[numpy.ndarray, numpy.ndarray[float], Dict[str, Any]]:\n 1. Initialized population of glowworms.\n 2. Initialized populations fun... | def init_population(self, task):
'Initialize population.\n\n Args:\n task (Task): Optimization task.\n\n Returns:\n Tuple[numpy.ndarray, numpy.ndarray[float], Dict[str, Any]]:\n 1. Initialized population of glowworms.\n 2. Initialized populations fun... |
f67156010729372d3a7226ef4dd0c219fd92393afbab6551b1a72f9154b4ff7c | def run_iteration(self, task, population, population_fitness, best_x, best_fitness, **params):
'Core function of GlowwormSwarmOptimization algorithm.\n\n Args:\n task (Task): Optimization task.\n population (numpy.ndarray): Current population.\n population_fitness (numpy.ndar... | Core function of GlowwormSwarmOptimization algorithm.
Args:
task (Task): Optimization task.
population (numpy.ndarray): Current population.
population_fitness (numpy.ndarray): Current populations fitness/function values.
best_x (numpy.ndarray): Global best individual.
best_fitness (float): Global b... | niapy/algorithms/basic/gso.py | run_iteration | carlosal1015/NiaPy | 202 | python | def run_iteration(self, task, population, population_fitness, best_x, best_fitness, **params):
'Core function of GlowwormSwarmOptimization algorithm.\n\n Args:\n task (Task): Optimization task.\n population (numpy.ndarray): Current population.\n population_fitness (numpy.ndar... | def run_iteration(self, task, population, population_fitness, best_x, best_fitness, **params):
'Core function of GlowwormSwarmOptimization algorithm.\n\n Args:\n task (Task): Optimization task.\n population (numpy.ndarray): Current population.\n population_fitness (numpy.ndar... |
caf295cd23a105ee7d668064c490968f93d926b9fda0a325ec328a4f8fcb86b8 | @staticmethod
def info():
'Get basic information of algorithm.\n\n Returns:\n str: Basic information.\n\n '
return 'Kaipa, Krishnanand N., and Debasish Ghose. Glowworm swarm optimization: theory, algorithms, and applications. Vol. 698. Springer, 2017.' | Get basic information of algorithm.
Returns:
str: Basic information. | niapy/algorithms/basic/gso.py | info | carlosal1015/NiaPy | 202 | python | @staticmethod
def info():
'Get basic information of algorithm.\n\n Returns:\n str: Basic information.\n\n '
return 'Kaipa, Krishnanand N., and Debasish Ghose. Glowworm swarm optimization: theory, algorithms, and applications. Vol. 698. Springer, 2017.' | @staticmethod
def info():
'Get basic information of algorithm.\n\n Returns:\n str: Basic information.\n\n '
return 'Kaipa, Krishnanand N., and Debasish Ghose. Glowworm swarm optimization: theory, algorithms, and applications. Vol. 698. Springer, 2017.'<|docstring|>Get basic information ... |
dd4c35ece978ccc2dfbf1a63b8eee2860889f048a63c345335d228fdd2c71c30 | def range_update(self, range_, neighbors, sensing_range):
'Update range.'
return (sensing_range / (1 + (self.beta * (np.sum(neighbors) / (np.pi * (sensing_range ** 2)))))) | Update range. | niapy/algorithms/basic/gso.py | range_update | carlosal1015/NiaPy | 202 | python | def range_update(self, range_, neighbors, sensing_range):
return (sensing_range / (1 + (self.beta * (np.sum(neighbors) / (np.pi * (sensing_range ** 2)))))) | def range_update(self, range_, neighbors, sensing_range):
return (sensing_range / (1 + (self.beta * (np.sum(neighbors) / (np.pi * (sensing_range ** 2))))))<|docstring|>Update range.<|endoftext|> |
caf295cd23a105ee7d668064c490968f93d926b9fda0a325ec328a4f8fcb86b8 | @staticmethod
def info():
'Get basic information of algorithm.\n\n Returns:\n str: Basic information.\n\n '
return 'Kaipa, Krishnanand N., and Debasish Ghose. Glowworm swarm optimization: theory, algorithms, and applications. Vol. 698. Springer, 2017.' | Get basic information of algorithm.
Returns:
str: Basic information. | niapy/algorithms/basic/gso.py | info | carlosal1015/NiaPy | 202 | python | @staticmethod
def info():
'Get basic information of algorithm.\n\n Returns:\n str: Basic information.\n\n '
return 'Kaipa, Krishnanand N., and Debasish Ghose. Glowworm swarm optimization: theory, algorithms, and applications. Vol. 698. Springer, 2017.' | @staticmethod
def info():
'Get basic information of algorithm.\n\n Returns:\n str: Basic information.\n\n '
return 'Kaipa, Krishnanand N., and Debasish Ghose. Glowworm swarm optimization: theory, algorithms, and applications. Vol. 698. Springer, 2017.'<|docstring|>Get basic information ... |
c2053fa64fdb9b873cfb7eab6216a7d17b4458a2400f5b27b87588204d0e0814 | def __init__(self, alpha=0.2, *args, **kwargs):
'Initialize GlowwormSwarmOptimizationV2.\n\n Args:\n alpha (Optional[float]): Alpha parameter.\n\n '
super().__init__(*args, **kwargs)
self.alpha = alpha | Initialize GlowwormSwarmOptimizationV2.
Args:
alpha (Optional[float]): Alpha parameter. | niapy/algorithms/basic/gso.py | __init__ | carlosal1015/NiaPy | 202 | python | def __init__(self, alpha=0.2, *args, **kwargs):
'Initialize GlowwormSwarmOptimizationV2.\n\n Args:\n alpha (Optional[float]): Alpha parameter.\n\n '
super().__init__(*args, **kwargs)
self.alpha = alpha | def __init__(self, alpha=0.2, *args, **kwargs):
'Initialize GlowwormSwarmOptimizationV2.\n\n Args:\n alpha (Optional[float]): Alpha parameter.\n\n '
super().__init__(*args, **kwargs)
self.alpha = alpha<|docstring|>Initialize GlowwormSwarmOptimizationV2.
Args:
alpha (Optional[fl... |
ca4fe95a9ad810d3bcc4751c0d4e95eb9c701dffd4fc57ecc440558cb6b62128 | def set_parameters(self, alpha=0.2, **kwargs):
'Set core parameters for GlowwormSwarmOptimizationV2 algorithm.\n\n Args:\n alpha (Optional[float]): Alpha parameter.\n\n See Also:\n * :func:`NiaPy.algorithms.basic.GlowwormSwarmOptimization.set_parameters`\n\n '
super().... | Set core parameters for GlowwormSwarmOptimizationV2 algorithm.
Args:
alpha (Optional[float]): Alpha parameter.
See Also:
* :func:`NiaPy.algorithms.basic.GlowwormSwarmOptimization.set_parameters` | niapy/algorithms/basic/gso.py | set_parameters | carlosal1015/NiaPy | 202 | python | def set_parameters(self, alpha=0.2, **kwargs):
'Set core parameters for GlowwormSwarmOptimizationV2 algorithm.\n\n Args:\n alpha (Optional[float]): Alpha parameter.\n\n See Also:\n * :func:`NiaPy.algorithms.basic.GlowwormSwarmOptimization.set_parameters`\n\n '
super().... | def set_parameters(self, alpha=0.2, **kwargs):
'Set core parameters for GlowwormSwarmOptimizationV2 algorithm.\n\n Args:\n alpha (Optional[float]): Alpha parameter.\n\n See Also:\n * :func:`NiaPy.algorithms.basic.GlowwormSwarmOptimization.set_parameters`\n\n '
super().... |
dda07ebc0af577be677955befdef8dbdcaf903d63001380de9868d31d3c371af | def range_update(self, range_, neighbors, sensing_range):
'Update range.'
return (self.alpha + ((sensing_range - self.alpha) / (1 + (self.beta * np.sum(neighbors))))) | Update range. | niapy/algorithms/basic/gso.py | range_update | carlosal1015/NiaPy | 202 | python | def range_update(self, range_, neighbors, sensing_range):
return (self.alpha + ((sensing_range - self.alpha) / (1 + (self.beta * np.sum(neighbors))))) | def range_update(self, range_, neighbors, sensing_range):
return (self.alpha + ((sensing_range - self.alpha) / (1 + (self.beta * np.sum(neighbors)))))<|docstring|>Update range.<|endoftext|> |
caf295cd23a105ee7d668064c490968f93d926b9fda0a325ec328a4f8fcb86b8 | @staticmethod
def info():
'Get basic information of algorithm.\n\n Returns:\n str: Basic information.\n\n '
return 'Kaipa, Krishnanand N., and Debasish Ghose. Glowworm swarm optimization: theory, algorithms, and applications. Vol. 698. Springer, 2017.' | Get basic information of algorithm.
Returns:
str: Basic information. | niapy/algorithms/basic/gso.py | info | carlosal1015/NiaPy | 202 | python | @staticmethod
def info():
'Get basic information of algorithm.\n\n Returns:\n str: Basic information.\n\n '
return 'Kaipa, Krishnanand N., and Debasish Ghose. Glowworm swarm optimization: theory, algorithms, and applications. Vol. 698. Springer, 2017.' | @staticmethod
def info():
'Get basic information of algorithm.\n\n Returns:\n str: Basic information.\n\n '
return 'Kaipa, Krishnanand N., and Debasish Ghose. Glowworm swarm optimization: theory, algorithms, and applications. Vol. 698. Springer, 2017.'<|docstring|>Get basic information ... |
9f9920d24f6badcdf04049d0e7800a94b892e09d53debac49d121a923549e55f | def __init__(self, beta1=0.2, *args, **kwargs):
'Initialize GlowwormSwarmOptimizationV3.\n\n Args:\n beta1 (Optional[float]): Beta1 parameter.\n\n '
super().__init__(*args, **kwargs)
self.beta1 = beta1 | Initialize GlowwormSwarmOptimizationV3.
Args:
beta1 (Optional[float]): Beta1 parameter. | niapy/algorithms/basic/gso.py | __init__ | carlosal1015/NiaPy | 202 | python | def __init__(self, beta1=0.2, *args, **kwargs):
'Initialize GlowwormSwarmOptimizationV3.\n\n Args:\n beta1 (Optional[float]): Beta1 parameter.\n\n '
super().__init__(*args, **kwargs)
self.beta1 = beta1 | def __init__(self, beta1=0.2, *args, **kwargs):
'Initialize GlowwormSwarmOptimizationV3.\n\n Args:\n beta1 (Optional[float]): Beta1 parameter.\n\n '
super().__init__(*args, **kwargs)
self.beta1 = beta1<|docstring|>Initialize GlowwormSwarmOptimizationV3.
Args:
beta1 (Optional[fl... |
f359a115ed10f857d9976c02d7ca42bf2daf9f93892bb3c0c69ae83bc7d999b3 | def set_parameters(self, beta1=0.2, **kwargs):
'Set core parameters for GlowwormSwarmOptimizationV3 algorithm.\n\n Args:\n beta1 (Optional[float]): Beta1 parameter.\n\n See Also:\n * :func:`NiaPy.algorithms.basic.GlowwormSwarmOptimization.set_parameters`\n\n '
super().... | Set core parameters for GlowwormSwarmOptimizationV3 algorithm.
Args:
beta1 (Optional[float]): Beta1 parameter.
See Also:
* :func:`NiaPy.algorithms.basic.GlowwormSwarmOptimization.set_parameters` | niapy/algorithms/basic/gso.py | set_parameters | carlosal1015/NiaPy | 202 | python | def set_parameters(self, beta1=0.2, **kwargs):
'Set core parameters for GlowwormSwarmOptimizationV3 algorithm.\n\n Args:\n beta1 (Optional[float]): Beta1 parameter.\n\n See Also:\n * :func:`NiaPy.algorithms.basic.GlowwormSwarmOptimization.set_parameters`\n\n '
super().... | def set_parameters(self, beta1=0.2, **kwargs):
'Set core parameters for GlowwormSwarmOptimizationV3 algorithm.\n\n Args:\n beta1 (Optional[float]): Beta1 parameter.\n\n See Also:\n * :func:`NiaPy.algorithms.basic.GlowwormSwarmOptimization.set_parameters`\n\n '
super().... |
0238944444e925ecf210386c5399590b849a2c7db1acfacc5ec29c0d446dd4ce | def range_update(self, range_, neighbors, sensing_range):
'Update range.'
return ((range_ + (self.beta * np.sum(neighbors))) if (np.sum(neighbors) < self.nt) else ((- self.beta1) * np.sum(neighbors))) | Update range. | niapy/algorithms/basic/gso.py | range_update | carlosal1015/NiaPy | 202 | python | def range_update(self, range_, neighbors, sensing_range):
return ((range_ + (self.beta * np.sum(neighbors))) if (np.sum(neighbors) < self.nt) else ((- self.beta1) * np.sum(neighbors))) | def range_update(self, range_, neighbors, sensing_range):
return ((range_ + (self.beta * np.sum(neighbors))) if (np.sum(neighbors) < self.nt) else ((- self.beta1) * np.sum(neighbors)))<|docstring|>Update range.<|endoftext|> |
a041d5810c383c15db4a928080a87d6641f71ca6be3ec71db4ecd9ee27110964 | def solver_function(L1: list, L2: list, C1: list, C2: list, C_max: int) -> QuantumCircuit:
"[{'L1': [7, 4, 5, 3, 2, 4, 3, 7, 4, 2, 7],\n 'L2': [9, 6, 6, 6, 6, 9, 5, 9, 9, 8, 9],\n 'C1': [2, 3, 2, 3, 2, 3, 2, 3, 2, 2, 3],\n 'C2': [3, 4, 4, 5, 3, 4, 4, 4, 5, 5, 4],\n 'C_max': 36},\n {'L1': [5, 4, 3, 3,... | [{'L1': [7, 4, 5, 3, 2, 4, 3, 7, 4, 2, 7],
'L2': [9, 6, 6, 6, 6, 9, 5, 9, 9, 8, 9],
'C1': [2, 3, 2, 3, 2, 3, 2, 3, 2, 2, 3],
'C2': [3, 4, 4, 5, 3, 4, 4, 4, 5, 5, 4],
'C_max': 36},
{'L1': [5, 4, 3, 3, 3, 7, 6, 4, 3, 5, 3],
'L2': [9, 7, 5, 5, 7, 8, 8, 7, 5, 7, 9],
'C1': [2, 2, 4, 2, 3, 4, 2, 2, 2, 2, 2],
'C2': [3, 4, 5, ... | content/challenge-4/yusheng_best_score.py | solver_function | exAClior/ibm-quantum-challenge-fall-2021 | 0 | python | def solver_function(L1: list, L2: list, C1: list, C2: list, C_max: int) -> QuantumCircuit:
"[{'L1': [7, 4, 5, 3, 2, 4, 3, 7, 4, 2, 7],\n 'L2': [9, 6, 6, 6, 6, 9, 5, 9, 9, 8, 9],\n 'C1': [2, 3, 2, 3, 2, 3, 2, 3, 2, 2, 3],\n 'C2': [3, 4, 4, 5, 3, 4, 4, 4, 5, 5, 4],\n 'C_max': 36},\n {'L1': [5, 4, 3, 3,... | def solver_function(L1: list, L2: list, C1: list, C2: list, C_max: int) -> QuantumCircuit:
"[{'L1': [7, 4, 5, 3, 2, 4, 3, 7, 4, 2, 7],\n 'L2': [9, 6, 6, 6, 6, 9, 5, 9, 9, 8, 9],\n 'C1': [2, 3, 2, 3, 2, 3, 2, 3, 2, 2, 3],\n 'C2': [3, 4, 4, 5, 3, 4, 4, 4, 5, 5, 4],\n 'C_max': 36},\n {'L1': [5, 4, 3, 3,... |
a122ebf696659ad4d2ee138002bb0ba5e1c8c2bda8662c8c235bd70f36ba3110 | def __init__(self, exp_id, exp_version, num_starts_v1, num_starts_v2, num_actual_starts_v1, num_actual_starts_v2, num_completions_v1, num_completions_v2, state_stats_mapping):
'Constructs an ExplorationStats domain object.\n\n Args:\n exp_id: str. ID of the exploration.\n exp_version: i... | Constructs an ExplorationStats domain object.
Args:
exp_id: str. ID of the exploration.
exp_version: int. Version of the exploration.
num_starts_v1: int. Number of learners who started the exploration.
num_starts_v2: int. As above, but for events with version 2.
num_actual_starts_v1: int. Number of... | core/domain/stats_domain.py | __init__ | yashdusing/oppia | 3 | python | def __init__(self, exp_id, exp_version, num_starts_v1, num_starts_v2, num_actual_starts_v1, num_actual_starts_v2, num_completions_v1, num_completions_v2, state_stats_mapping):
'Constructs an ExplorationStats domain object.\n\n Args:\n exp_id: str. ID of the exploration.\n exp_version: i... | def __init__(self, exp_id, exp_version, num_starts_v1, num_starts_v2, num_actual_starts_v1, num_actual_starts_v2, num_completions_v1, num_completions_v2, state_stats_mapping):
'Constructs an ExplorationStats domain object.\n\n Args:\n exp_id: str. ID of the exploration.\n exp_version: i... |
ee3eff58da4cb40c40b14946e9674afbd085201d226d7a4d775d05ede9c58e59 | @property
def num_starts(self):
'Returns the number of learners who started the exploration.\n\n Returns:\n int. The number of learners who started the exploration.\n '
return (self.num_starts_v1 + self.num_starts_v2) | Returns the number of learners who started the exploration.
Returns:
int. The number of learners who started the exploration. | core/domain/stats_domain.py | num_starts | yashdusing/oppia | 3 | python | @property
def num_starts(self):
'Returns the number of learners who started the exploration.\n\n Returns:\n int. The number of learners who started the exploration.\n '
return (self.num_starts_v1 + self.num_starts_v2) | @property
def num_starts(self):
'Returns the number of learners who started the exploration.\n\n Returns:\n int. The number of learners who started the exploration.\n '
return (self.num_starts_v1 + self.num_starts_v2)<|docstring|>Returns the number of learners who started the exploratio... |
6779597e2dda59fc70ab24b314900ae73c3331ccac17032780eecb46a1af23f4 | @property
def num_actual_starts(self):
'Returns the number of learners who actually attempted the\n exploration. These are the learners who have completed the initial\n state of the exploration and traversed to the next state.\n\n Returns:\n int. The number of learners who actually a... | Returns the number of learners who actually attempted the
exploration. These are the learners who have completed the initial
state of the exploration and traversed to the next state.
Returns:
int. The number of learners who actually attempted
the exploration. | core/domain/stats_domain.py | num_actual_starts | yashdusing/oppia | 3 | python | @property
def num_actual_starts(self):
'Returns the number of learners who actually attempted the\n exploration. These are the learners who have completed the initial\n state of the exploration and traversed to the next state.\n\n Returns:\n int. The number of learners who actually a... | @property
def num_actual_starts(self):
'Returns the number of learners who actually attempted the\n exploration. These are the learners who have completed the initial\n state of the exploration and traversed to the next state.\n\n Returns:\n int. The number of learners who actually a... |
79a631be5bac2e0087982a157c2f5a435fd110d2d1b6ba7ddc8457e822c4b5a8 | @property
def num_completions(self):
'Returns the number of learners who completed the exploration.\n\n Returns:\n int. The number of learners who completed the exploration.\n '
return (self.num_completions_v1 + self.num_completions_v2) | Returns the number of learners who completed the exploration.
Returns:
int. The number of learners who completed the exploration. | core/domain/stats_domain.py | num_completions | yashdusing/oppia | 3 | python | @property
def num_completions(self):
'Returns the number of learners who completed the exploration.\n\n Returns:\n int. The number of learners who completed the exploration.\n '
return (self.num_completions_v1 + self.num_completions_v2) | @property
def num_completions(self):
'Returns the number of learners who completed the exploration.\n\n Returns:\n int. The number of learners who completed the exploration.\n '
return (self.num_completions_v1 + self.num_completions_v2)<|docstring|>Returns the number of learners who com... |
fa6d60c2dd6ac5bbb754e364b6595eee807898e13c6202dbed276a28e092e0cd | def to_dict(self):
'Returns a dict representation of the domain object.'
state_stats_mapping_dict = {}
for state_name in self.state_stats_mapping:
state_stats_mapping_dict[state_name] = self.state_stats_mapping[state_name].to_dict()
exploration_stats_dict = {'exp_id': self.exp_id, 'exp_version':... | Returns a dict representation of the domain object. | core/domain/stats_domain.py | to_dict | yashdusing/oppia | 3 | python | def to_dict(self):
state_stats_mapping_dict = {}
for state_name in self.state_stats_mapping:
state_stats_mapping_dict[state_name] = self.state_stats_mapping[state_name].to_dict()
exploration_stats_dict = {'exp_id': self.exp_id, 'exp_version': self.exp_version, 'num_starts_v1': self.num_starts_v... | def to_dict(self):
state_stats_mapping_dict = {}
for state_name in self.state_stats_mapping:
state_stats_mapping_dict[state_name] = self.state_stats_mapping[state_name].to_dict()
exploration_stats_dict = {'exp_id': self.exp_id, 'exp_version': self.exp_version, 'num_starts_v1': self.num_starts_v... |
fb6056569d8481ac6bd7fc31441c70d2e753461a0df83e90a2314335a8fd0eef | def to_frontend_dict(self):
'Returns a dict representation of the domain object for use in the\n frontend.\n '
state_stats_mapping_dict = {}
for state_name in self.state_stats_mapping:
state_stats_mapping_dict[state_name] = self.state_stats_mapping[state_name].to_frontend_dict()
ex... | Returns a dict representation of the domain object for use in the
frontend. | core/domain/stats_domain.py | to_frontend_dict | yashdusing/oppia | 3 | python | def to_frontend_dict(self):
'Returns a dict representation of the domain object for use in the\n frontend.\n '
state_stats_mapping_dict = {}
for state_name in self.state_stats_mapping:
state_stats_mapping_dict[state_name] = self.state_stats_mapping[state_name].to_frontend_dict()
ex... | def to_frontend_dict(self):
'Returns a dict representation of the domain object for use in the\n frontend.\n '
state_stats_mapping_dict = {}
for state_name in self.state_stats_mapping:
state_stats_mapping_dict[state_name] = self.state_stats_mapping[state_name].to_frontend_dict()
ex... |
51a86a6527e17f3fd32cf673065cc31f3b5bb674e360e3b90b7752129199f907 | @classmethod
def create_default(cls, exp_id, exp_version, state_stats_mapping):
'Creates a ExplorationStats domain object and sets all properties to\n 0.\n\n Args:\n exp_id: str. ID of the exploration.\n exp_version: int. Version of the exploration.\n state_stats_mappi... | Creates a ExplorationStats domain object and sets all properties to
0.
Args:
exp_id: str. ID of the exploration.
exp_version: int. Version of the exploration.
state_stats_mapping: dict. A dict mapping state names to their
corresponding StateStats.
Returns:
ExplorationStats. The exploration sta... | core/domain/stats_domain.py | create_default | yashdusing/oppia | 3 | python | @classmethod
def create_default(cls, exp_id, exp_version, state_stats_mapping):
'Creates a ExplorationStats domain object and sets all properties to\n 0.\n\n Args:\n exp_id: str. ID of the exploration.\n exp_version: int. Version of the exploration.\n state_stats_mappi... | @classmethod
def create_default(cls, exp_id, exp_version, state_stats_mapping):
'Creates a ExplorationStats domain object and sets all properties to\n 0.\n\n Args:\n exp_id: str. ID of the exploration.\n exp_version: int. Version of the exploration.\n state_stats_mappi... |
8d57dd9d301f96aa4166e80c9b184f48eb9c1721293cca23d87ee081ff7d0239 | def get_sum_of_first_hit_counts(self):
'Compute the sum of first hit counts for the exploration stats.\n\n Returns:\n int. Sum of first hit counts.\n '
sum_first_hits = 0
for state_name in self.state_stats_mapping:
state_stats = self.state_stats_mapping[state_name]
s... | Compute the sum of first hit counts for the exploration stats.
Returns:
int. Sum of first hit counts. | core/domain/stats_domain.py | get_sum_of_first_hit_counts | yashdusing/oppia | 3 | python | def get_sum_of_first_hit_counts(self):
'Compute the sum of first hit counts for the exploration stats.\n\n Returns:\n int. Sum of first hit counts.\n '
sum_first_hits = 0
for state_name in self.state_stats_mapping:
state_stats = self.state_stats_mapping[state_name]
s... | def get_sum_of_first_hit_counts(self):
'Compute the sum of first hit counts for the exploration stats.\n\n Returns:\n int. Sum of first hit counts.\n '
sum_first_hits = 0
for state_name in self.state_stats_mapping:
state_stats = self.state_stats_mapping[state_name]
s... |
82c92cc2aae61d7b6e34777993cbc325175dcb8c8f85817e4daeed6ca5bc9532 | def validate(self):
'Validates the ExplorationStats domain object.'
exploration_stats_properties = ['num_starts_v1', 'num_starts_v2', 'num_actual_starts_v1', 'num_actual_starts_v2', 'num_completions_v1', 'num_completions_v2']
if (not isinstance(self.exp_id, basestring)):
raise utils.ValidationError(... | Validates the ExplorationStats domain object. | core/domain/stats_domain.py | validate | yashdusing/oppia | 3 | python | def validate(self):
exploration_stats_properties = ['num_starts_v1', 'num_starts_v2', 'num_actual_starts_v1', 'num_actual_starts_v2', 'num_completions_v1', 'num_completions_v2']
if (not isinstance(self.exp_id, basestring)):
raise utils.ValidationError(('Expected exp_id to be a string, received %s' ... | def validate(self):
exploration_stats_properties = ['num_starts_v1', 'num_starts_v2', 'num_actual_starts_v1', 'num_actual_starts_v2', 'num_completions_v1', 'num_completions_v2']
if (not isinstance(self.exp_id, basestring)):
raise utils.ValidationError(('Expected exp_id to be a string, received %s' ... |
5390eb4e75df351b5263aecd3987683028d9d40df8ce3d644ad034026f17cd92 | def __init__(self, total_answers_count_v1, total_answers_count_v2, useful_feedback_count_v1, useful_feedback_count_v2, total_hit_count_v1, total_hit_count_v2, first_hit_count_v1, first_hit_count_v2, num_times_solution_viewed_v2, num_completions_v1, num_completions_v2):
'Constructs a StateStats domain object.\n\n ... | Constructs a StateStats domain object.
Args:
total_answers_count_v1: int. Total number of answers submitted to
this state.
total_answers_count_v2: int. As above, but for events with version
2.
useful_feedback_count_v1: int. Total number of answers that received
useful feedback.
... | core/domain/stats_domain.py | __init__ | yashdusing/oppia | 3 | python | def __init__(self, total_answers_count_v1, total_answers_count_v2, useful_feedback_count_v1, useful_feedback_count_v2, total_hit_count_v1, total_hit_count_v2, first_hit_count_v1, first_hit_count_v2, num_times_solution_viewed_v2, num_completions_v1, num_completions_v2):
'Constructs a StateStats domain object.\n\n ... | def __init__(self, total_answers_count_v1, total_answers_count_v2, useful_feedback_count_v1, useful_feedback_count_v2, total_hit_count_v1, total_hit_count_v2, first_hit_count_v1, first_hit_count_v2, num_times_solution_viewed_v2, num_completions_v1, num_completions_v2):
'Constructs a StateStats domain object.\n\n ... |
4592bad055fa283c2ce8b984062ebbcd839dc15b88d1871b5d7eee9420ab0d26 | @property
def total_answers_count(self):
'Returns the total number of answers submitted to this state.\n\n Returns:\n int. The total number of answers submitted to this state.\n '
return (self.total_answers_count_v1 + self.total_answers_count_v2) | Returns the total number of answers submitted to this state.
Returns:
int. The total number of answers submitted to this state. | core/domain/stats_domain.py | total_answers_count | yashdusing/oppia | 3 | python | @property
def total_answers_count(self):
'Returns the total number of answers submitted to this state.\n\n Returns:\n int. The total number of answers submitted to this state.\n '
return (self.total_answers_count_v1 + self.total_answers_count_v2) | @property
def total_answers_count(self):
'Returns the total number of answers submitted to this state.\n\n Returns:\n int. The total number of answers submitted to this state.\n '
return (self.total_answers_count_v1 + self.total_answers_count_v2)<|docstring|>Returns the total number of ... |
545a9255a5b932e8264ec495eb3b43cbc5df2f53029478c88af632eb3ac1b237 | @property
def useful_feedback_count(self):
'Returns the total number of answers that received useful feedback.\n\n Returns:\n int. The total number of answers that received useful feedback.\n '
return (self.useful_feedback_count_v1 + self.useful_feedback_count_v2) | Returns the total number of answers that received useful feedback.
Returns:
int. The total number of answers that received useful feedback. | core/domain/stats_domain.py | useful_feedback_count | yashdusing/oppia | 3 | python | @property
def useful_feedback_count(self):
'Returns the total number of answers that received useful feedback.\n\n Returns:\n int. The total number of answers that received useful feedback.\n '
return (self.useful_feedback_count_v1 + self.useful_feedback_count_v2) | @property
def useful_feedback_count(self):
'Returns the total number of answers that received useful feedback.\n\n Returns:\n int. The total number of answers that received useful feedback.\n '
return (self.useful_feedback_count_v1 + self.useful_feedback_count_v2)<|docstring|>Returns th... |
7a6a81bd8544b12ae269679f9bf860f01ee6b532a2178972a2614e2df44e036b | @property
def total_hit_count(self):
'Returns the total number of times the state was entered.\n\n Returns:\n int. The total number of times the state was entered.\n '
return (self.total_hit_count_v1 + self.total_hit_count_v2) | Returns the total number of times the state was entered.
Returns:
int. The total number of times the state was entered. | core/domain/stats_domain.py | total_hit_count | yashdusing/oppia | 3 | python | @property
def total_hit_count(self):
'Returns the total number of times the state was entered.\n\n Returns:\n int. The total number of times the state was entered.\n '
return (self.total_hit_count_v1 + self.total_hit_count_v2) | @property
def total_hit_count(self):
'Returns the total number of times the state was entered.\n\n Returns:\n int. The total number of times the state was entered.\n '
return (self.total_hit_count_v1 + self.total_hit_count_v2)<|docstring|>Returns the total number of times the state was ... |
36bee3e1a7fafde8f71dd415f53381b0f7188272343f7847353cff6460cf64f0 | @property
def first_hit_count(self):
'Returns the number of times the state was entered for the first time.\n\n Returns:\n int. The number of times the state was entered for the first time.\n '
return (self.first_hit_count_v1 + self.first_hit_count_v2) | Returns the number of times the state was entered for the first time.
Returns:
int. The number of times the state was entered for the first time. | core/domain/stats_domain.py | first_hit_count | yashdusing/oppia | 3 | python | @property
def first_hit_count(self):
'Returns the number of times the state was entered for the first time.\n\n Returns:\n int. The number of times the state was entered for the first time.\n '
return (self.first_hit_count_v1 + self.first_hit_count_v2) | @property
def first_hit_count(self):
'Returns the number of times the state was entered for the first time.\n\n Returns:\n int. The number of times the state was entered for the first time.\n '
return (self.first_hit_count_v1 + self.first_hit_count_v2)<|docstring|>Returns the number of ... |
a66c41020de57e4399b65b826f8762df541516d70335d423ad1e5afbc8e27ebe | @property
def num_completions(self):
'Returns total number of times the state was completed.\n\n Returns:\n int. The total number of times the state was completed.\n '
return (self.num_completions_v1 + self.num_completions_v2) | Returns total number of times the state was completed.
Returns:
int. The total number of times the state was completed. | core/domain/stats_domain.py | num_completions | yashdusing/oppia | 3 | python | @property
def num_completions(self):
'Returns total number of times the state was completed.\n\n Returns:\n int. The total number of times the state was completed.\n '
return (self.num_completions_v1 + self.num_completions_v2) | @property
def num_completions(self):
'Returns total number of times the state was completed.\n\n Returns:\n int. The total number of times the state was completed.\n '
return (self.num_completions_v1 + self.num_completions_v2)<|docstring|>Returns total number of times the state was comp... |
27f04fb3faef59f43a1c930db04f1363527a308f02a9058118ff09914a3c7dae | @property
def num_times_solution_viewed(self):
'Returns the number of times the solution button was triggered.\n\n Returns:\n int. Number of times the solution button was triggered to answer a\n state only for events for schema version 2.\n '
return self.num_times_solutio... | Returns the number of times the solution button was triggered.
Returns:
int. Number of times the solution button was triggered to answer a
state only for events for schema version 2. | core/domain/stats_domain.py | num_times_solution_viewed | yashdusing/oppia | 3 | python | @property
def num_times_solution_viewed(self):
'Returns the number of times the solution button was triggered.\n\n Returns:\n int. Number of times the solution button was triggered to answer a\n state only for events for schema version 2.\n '
return self.num_times_solutio... | @property
def num_times_solution_viewed(self):
'Returns the number of times the solution button was triggered.\n\n Returns:\n int. Number of times the solution button was triggered to answer a\n state only for events for schema version 2.\n '
return self.num_times_solutio... |
154af292f4d284b561a62741fc4ba58c1e240d2a3d70e21cd64c6c8148fe2f30 | @classmethod
def create_default(cls):
'Creates a StateStats domain object and sets all properties to 0.'
return cls(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) | Creates a StateStats domain object and sets all properties to 0. | core/domain/stats_domain.py | create_default | yashdusing/oppia | 3 | python | @classmethod
def create_default(cls):
return cls(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) | @classmethod
def create_default(cls):
return cls(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)<|docstring|>Creates a StateStats domain object and sets all properties to 0.<|endoftext|> |
d00e78dc491975e0c2afd2653899a2692eb3af002fe94358edd39abc43c0f96d | def to_dict(self):
'Returns a dict representation of the domain object.'
state_stats_dict = {'total_answers_count_v1': self.total_answers_count_v1, 'total_answers_count_v2': self.total_answers_count_v2, 'useful_feedback_count_v1': self.useful_feedback_count_v1, 'useful_feedback_count_v2': self.useful_feedback_c... | Returns a dict representation of the domain object. | core/domain/stats_domain.py | to_dict | yashdusing/oppia | 3 | python | def to_dict(self):
state_stats_dict = {'total_answers_count_v1': self.total_answers_count_v1, 'total_answers_count_v2': self.total_answers_count_v2, 'useful_feedback_count_v1': self.useful_feedback_count_v1, 'useful_feedback_count_v2': self.useful_feedback_count_v2, 'total_hit_count_v1': self.total_hit_count_v... | def to_dict(self):
state_stats_dict = {'total_answers_count_v1': self.total_answers_count_v1, 'total_answers_count_v2': self.total_answers_count_v2, 'useful_feedback_count_v1': self.useful_feedback_count_v1, 'useful_feedback_count_v2': self.useful_feedback_count_v2, 'total_hit_count_v1': self.total_hit_count_v... |
8b311229cd43a1e9269d168ef5189ec97da502520aececa2f98765a9625e9984 | def to_frontend_dict(self):
'Returns a dict representation of the domain object for use in the\n frontend.\n '
state_stats_dict = {'total_answers_count': self.total_answers_count, 'useful_feedback_count': self.useful_feedback_count, 'total_hit_count': self.total_hit_count, 'first_hit_count': self.... | Returns a dict representation of the domain object for use in the
frontend. | core/domain/stats_domain.py | to_frontend_dict | yashdusing/oppia | 3 | python | def to_frontend_dict(self):
'Returns a dict representation of the domain object for use in the\n frontend.\n '
state_stats_dict = {'total_answers_count': self.total_answers_count, 'useful_feedback_count': self.useful_feedback_count, 'total_hit_count': self.total_hit_count, 'first_hit_count': self.... | def to_frontend_dict(self):
'Returns a dict representation of the domain object for use in the\n frontend.\n '
state_stats_dict = {'total_answers_count': self.total_answers_count, 'useful_feedback_count': self.useful_feedback_count, 'total_hit_count': self.total_hit_count, 'first_hit_count': self.... |
54b9068d749deca67c27f3cf2a3f3188da95561700acefdcfd6388b065d93679 | @classmethod
def from_dict(cls, state_stats_dict):
'Constructs a StateStats domain object from a dict.'
return cls(state_stats_dict['total_answers_count_v1'], state_stats_dict['total_answers_count_v2'], state_stats_dict['useful_feedback_count_v1'], state_stats_dict['useful_feedback_count_v2'], state_stats_dict[... | Constructs a StateStats domain object from a dict. | core/domain/stats_domain.py | from_dict | yashdusing/oppia | 3 | python | @classmethod
def from_dict(cls, state_stats_dict):
return cls(state_stats_dict['total_answers_count_v1'], state_stats_dict['total_answers_count_v2'], state_stats_dict['useful_feedback_count_v1'], state_stats_dict['useful_feedback_count_v2'], state_stats_dict['total_hit_count_v1'], state_stats_dict['total_hit_c... | @classmethod
def from_dict(cls, state_stats_dict):
return cls(state_stats_dict['total_answers_count_v1'], state_stats_dict['total_answers_count_v2'], state_stats_dict['useful_feedback_count_v1'], state_stats_dict['useful_feedback_count_v2'], state_stats_dict['total_hit_count_v1'], state_stats_dict['total_hit_c... |
0393204f8804ce511b96dadd18e7ade93b000fb835665026550121e3d420769a | def validate(self):
'Validates the StateStats domain object.'
state_stats_properties = ['total_answers_count_v1', 'total_answers_count_v2', 'useful_feedback_count_v1', 'useful_feedback_count_v2', 'total_hit_count_v1', 'total_hit_count_v2', 'first_hit_count_v1', 'first_hit_count_v2', 'num_times_solution_viewed_v... | Validates the StateStats domain object. | core/domain/stats_domain.py | validate | yashdusing/oppia | 3 | python | def validate(self):
state_stats_properties = ['total_answers_count_v1', 'total_answers_count_v2', 'useful_feedback_count_v1', 'useful_feedback_count_v2', 'total_hit_count_v1', 'total_hit_count_v2', 'first_hit_count_v1', 'first_hit_count_v2', 'num_times_solution_viewed_v2', 'num_completions_v1', 'num_completion... | def validate(self):
state_stats_properties = ['total_answers_count_v1', 'total_answers_count_v2', 'useful_feedback_count_v1', 'useful_feedback_count_v2', 'total_hit_count_v1', 'total_hit_count_v2', 'first_hit_count_v1', 'first_hit_count_v2', 'num_times_solution_viewed_v2', 'num_completions_v1', 'num_completion... |
5e1186dd367dd57f1c37de2e450dcea1e1f38e03e3d20a057615fba720b06667 | def __init__(self, exp_id, exp_version, unresolved_issues):
'Constructs an ExplorationIssues domain object.\n\n Args:\n exp_id: str. ID of the exploration.\n exp_version: int. Version of the exploration.\n unresolved_issues: list(ExplorationIssue). List of exploration\n ... | Constructs an ExplorationIssues domain object.
Args:
exp_id: str. ID of the exploration.
exp_version: int. Version of the exploration.
unresolved_issues: list(ExplorationIssue). List of exploration
issues. | core/domain/stats_domain.py | __init__ | yashdusing/oppia | 3 | python | def __init__(self, exp_id, exp_version, unresolved_issues):
'Constructs an ExplorationIssues domain object.\n\n Args:\n exp_id: str. ID of the exploration.\n exp_version: int. Version of the exploration.\n unresolved_issues: list(ExplorationIssue). List of exploration\n ... | def __init__(self, exp_id, exp_version, unresolved_issues):
'Constructs an ExplorationIssues domain object.\n\n Args:\n exp_id: str. ID of the exploration.\n exp_version: int. Version of the exploration.\n unresolved_issues: list(ExplorationIssue). List of exploration\n ... |
c6bf6d0021e4a8c77743a21226eac9f68d4a717a91a6f0b20c867b214c720915 | @classmethod
def create_default(cls, exp_id, exp_version):
'Creates a default ExplorationIssues domain object.\n\n Args:\n exp_id: str. ID of the exploration.\n exp_version: int. Version of the exploration.\n\n Returns:\n ExplorationIssues. The exploration issues domai... | Creates a default ExplorationIssues domain object.
Args:
exp_id: str. ID of the exploration.
exp_version: int. Version of the exploration.
Returns:
ExplorationIssues. The exploration issues domain object. | core/domain/stats_domain.py | create_default | yashdusing/oppia | 3 | python | @classmethod
def create_default(cls, exp_id, exp_version):
'Creates a default ExplorationIssues domain object.\n\n Args:\n exp_id: str. ID of the exploration.\n exp_version: int. Version of the exploration.\n\n Returns:\n ExplorationIssues. The exploration issues domai... | @classmethod
def create_default(cls, exp_id, exp_version):
'Creates a default ExplorationIssues domain object.\n\n Args:\n exp_id: str. ID of the exploration.\n exp_version: int. Version of the exploration.\n\n Returns:\n ExplorationIssues. The exploration issues domai... |
675dbaa62d84710066933f46c8c026aaeb7c0bd6d9479ad9985eb0f8cb1d7368 | def to_dict(self):
'Returns a dict representation of the ExplorationIssues domain object.\n\n Returns:\n dict. A dict mapping of all fields of ExplorationIssues object.\n '
unresolved_issue_dicts = [unresolved_issue.to_dict() for unresolved_issue in self.unresolved_issues]
return {'... | Returns a dict representation of the ExplorationIssues domain object.
Returns:
dict. A dict mapping of all fields of ExplorationIssues object. | core/domain/stats_domain.py | to_dict | yashdusing/oppia | 3 | python | def to_dict(self):
'Returns a dict representation of the ExplorationIssues domain object.\n\n Returns:\n dict. A dict mapping of all fields of ExplorationIssues object.\n '
unresolved_issue_dicts = [unresolved_issue.to_dict() for unresolved_issue in self.unresolved_issues]
return {'... | def to_dict(self):
'Returns a dict representation of the ExplorationIssues domain object.\n\n Returns:\n dict. A dict mapping of all fields of ExplorationIssues object.\n '
unresolved_issue_dicts = [unresolved_issue.to_dict() for unresolved_issue in self.unresolved_issues]
return {'... |
ff0e68c0a82e9a45d78c0a22b4d8fbcd3312ac8e00a61de227c8b9657e5e06ac | @classmethod
def from_dict(cls, exp_issues_dict):
'Returns an ExplorationIssues object from a dict.\n\n Args:\n exp_issues_dict: dict. A dict mapping of all fields of\n ExplorationIssues object.\n\n Returns:\n ExplorationIssues. The corresponding ExplorationIssues ... | Returns an ExplorationIssues object from a dict.
Args:
exp_issues_dict: dict. A dict mapping of all fields of
ExplorationIssues object.
Returns:
ExplorationIssues. The corresponding ExplorationIssues domain
object. | core/domain/stats_domain.py | from_dict | yashdusing/oppia | 3 | python | @classmethod
def from_dict(cls, exp_issues_dict):
'Returns an ExplorationIssues object from a dict.\n\n Args:\n exp_issues_dict: dict. A dict mapping of all fields of\n ExplorationIssues object.\n\n Returns:\n ExplorationIssues. The corresponding ExplorationIssues ... | @classmethod
def from_dict(cls, exp_issues_dict):
'Returns an ExplorationIssues object from a dict.\n\n Args:\n exp_issues_dict: dict. A dict mapping of all fields of\n ExplorationIssues object.\n\n Returns:\n ExplorationIssues. The corresponding ExplorationIssues ... |
fb4ee4c93bc9f6384255edc54daa0e90bea83909dcde93e49be1054449206822 | def validate(self):
'Validates the ExplorationIssues domain object.'
if (not isinstance(self.exp_id, basestring)):
raise utils.ValidationError(('Expected exp_id to be a string, received %s' % type(self.exp_id)))
if (not isinstance(self.exp_version, int)):
raise utils.ValidationError(('Expect... | Validates the ExplorationIssues domain object. | core/domain/stats_domain.py | validate | yashdusing/oppia | 3 | python | def validate(self):
if (not isinstance(self.exp_id, basestring)):
raise utils.ValidationError(('Expected exp_id to be a string, received %s' % type(self.exp_id)))
if (not isinstance(self.exp_version, int)):
raise utils.ValidationError(('Expected exp_version to be an int, received %s' % type... | def validate(self):
if (not isinstance(self.exp_id, basestring)):
raise utils.ValidationError(('Expected exp_id to be a string, received %s' % type(self.exp_id)))
if (not isinstance(self.exp_version, int)):
raise utils.ValidationError(('Expected exp_version to be an int, received %s' % type... |
ac4a41c41a13ca968eb35b0622a5c2438ba99c8c2de5b18c0edc1964bba6f1a0 | def __init__(self, exp_id, exp_version, issue_type, issue_customization_args, actions):
'Constructs a Playthrough domain object.\n\n Args:\n exp_id: str. ID of the exploration.\n exp_version: int. Version of the exploration.\n issue_type: str. Type of the issue.\n ... | Constructs a Playthrough domain object.
Args:
exp_id: str. ID of the exploration.
exp_version: int. Version of the exploration.
issue_type: str. Type of the issue.
issue_customization_args: dict. The customization args dict for the
given issue_type.
actions: list(LearnerAction). List of pla... | core/domain/stats_domain.py | __init__ | yashdusing/oppia | 3 | python | def __init__(self, exp_id, exp_version, issue_type, issue_customization_args, actions):
'Constructs a Playthrough domain object.\n\n Args:\n exp_id: str. ID of the exploration.\n exp_version: int. Version of the exploration.\n issue_type: str. Type of the issue.\n ... | def __init__(self, exp_id, exp_version, issue_type, issue_customization_args, actions):
'Constructs a Playthrough domain object.\n\n Args:\n exp_id: str. ID of the exploration.\n exp_version: int. Version of the exploration.\n issue_type: str. Type of the issue.\n ... |
2e039e73dead5acf9aba96468fd782659e02fa5ef892a95bbbddc5b050bae2cf | def to_dict(self):
'Returns a dict representation of the Playthrough domain object.\n\n Returns:\n dict. A dict mapping of all fields of Playthrough object.\n '
action_dicts = [action.to_dict() for action in self.actions]
return {'exp_id': self.exp_id, 'exp_version': self.exp_versio... | Returns a dict representation of the Playthrough domain object.
Returns:
dict. A dict mapping of all fields of Playthrough object. | core/domain/stats_domain.py | to_dict | yashdusing/oppia | 3 | python | def to_dict(self):
'Returns a dict representation of the Playthrough domain object.\n\n Returns:\n dict. A dict mapping of all fields of Playthrough object.\n '
action_dicts = [action.to_dict() for action in self.actions]
return {'exp_id': self.exp_id, 'exp_version': self.exp_versio... | def to_dict(self):
'Returns a dict representation of the Playthrough domain object.\n\n Returns:\n dict. A dict mapping of all fields of Playthrough object.\n '
action_dicts = [action.to_dict() for action in self.actions]
return {'exp_id': self.exp_id, 'exp_version': self.exp_versio... |
e53c5f8b2d3bdf832e05747634d817c9b0df5f429ed49a72d74253686095b905 | @classmethod
def from_dict(cls, playthrough_dict):
'Returns a Playthrough object from a dict.\n\n Args:\n playthrough_dict: dict. A dict mapping of all fields of Playthrough\n object.\n\n Returns:\n Playthrough. The corresponding Playthrough domain object.\n ... | Returns a Playthrough object from a dict.
Args:
playthrough_dict: dict. A dict mapping of all fields of Playthrough
object.
Returns:
Playthrough. The corresponding Playthrough domain object. | core/domain/stats_domain.py | from_dict | yashdusing/oppia | 3 | python | @classmethod
def from_dict(cls, playthrough_dict):
'Returns a Playthrough object from a dict.\n\n Args:\n playthrough_dict: dict. A dict mapping of all fields of Playthrough\n object.\n\n Returns:\n Playthrough. The corresponding Playthrough domain object.\n ... | @classmethod
def from_dict(cls, playthrough_dict):
'Returns a Playthrough object from a dict.\n\n Args:\n playthrough_dict: dict. A dict mapping of all fields of Playthrough\n object.\n\n Returns:\n Playthrough. The corresponding Playthrough domain object.\n ... |
e3915acbf398b1359fc0ec05f0bb399fea6290549c338bac808bd8750a006767 | @classmethod
def from_backend_dict(cls, playthrough_data):
'Checks whether the playthrough dict has the correct keys and then\n returns a domain object instance.\n\n Args:\n playthrough_data: dict. Dict representing a playthrough.\n\n Returns:\n Playthrough. A playthrough ... | Checks whether the playthrough dict has the correct keys and then
returns a domain object instance.
Args:
playthrough_data: dict. Dict representing a playthrough.
Returns:
Playthrough. A playthrough domain object. | core/domain/stats_domain.py | from_backend_dict | yashdusing/oppia | 3 | python | @classmethod
def from_backend_dict(cls, playthrough_data):
'Checks whether the playthrough dict has the correct keys and then\n returns a domain object instance.\n\n Args:\n playthrough_data: dict. Dict representing a playthrough.\n\n Returns:\n Playthrough. A playthrough ... | @classmethod
def from_backend_dict(cls, playthrough_data):
'Checks whether the playthrough dict has the correct keys and then\n returns a domain object instance.\n\n Args:\n playthrough_data: dict. Dict representing a playthrough.\n\n Returns:\n Playthrough. A playthrough ... |
32a66cbe683c4300fedee291ecdf44f0ea835a7abaa7ddfddbe370574578c68b | def validate(self):
'Validates the Playthrough domain object.'
if (not isinstance(self.exp_id, basestring)):
raise utils.ValidationError(('Expected exp_id to be a string, received %s' % type(self.exp_id)))
if (not isinstance(self.exp_version, int)):
raise utils.ValidationError(('Expected exp... | Validates the Playthrough domain object. | core/domain/stats_domain.py | validate | yashdusing/oppia | 3 | python | def validate(self):
if (not isinstance(self.exp_id, basestring)):
raise utils.ValidationError(('Expected exp_id to be a string, received %s' % type(self.exp_id)))
if (not isinstance(self.exp_version, int)):
raise utils.ValidationError(('Expected exp_version to be an int, received %s' % type... | def validate(self):
if (not isinstance(self.exp_id, basestring)):
raise utils.ValidationError(('Expected exp_id to be a string, received %s' % type(self.exp_id)))
if (not isinstance(self.exp_version, int)):
raise utils.ValidationError(('Expected exp_version to be an int, received %s' % type... |
0f5b8e1610d0f0380609cdb2d519f2fdbb7583d364740dafaaea831c14ddeb7b | def __init__(self, issue_type, issue_customization_args, playthrough_ids, schema_version, is_valid):
"Constructs an ExplorationIssue domain object.\n\n Args:\n issue_type: str. Type of the issue.\n issue_customization_args: dict. The customization dict. The keys are\n nam... | Constructs an ExplorationIssue domain object.
Args:
issue_type: str. Type of the issue.
issue_customization_args: dict. The customization dict. The keys are
names of customization_args and the values are dicts with a
single key, 'value', whose corresponding value is the value of
the cus... | core/domain/stats_domain.py | __init__ | yashdusing/oppia | 3 | python | def __init__(self, issue_type, issue_customization_args, playthrough_ids, schema_version, is_valid):
"Constructs an ExplorationIssue domain object.\n\n Args:\n issue_type: str. Type of the issue.\n issue_customization_args: dict. The customization dict. The keys are\n nam... | def __init__(self, issue_type, issue_customization_args, playthrough_ids, schema_version, is_valid):
"Constructs an ExplorationIssue domain object.\n\n Args:\n issue_type: str. Type of the issue.\n issue_customization_args: dict. The customization dict. The keys are\n nam... |
fd807c4f21400511f8e5a1e8f21cd540d5e3358cf18a6a66f85aa997d9cdf102 | def to_dict(self):
'Returns a dict representation of the ExplorationIssue domain object.\n\n Returns:\n dict. A dict mapping of all fields of ExplorationIssue object.\n '
return {'issue_type': self.issue_type, 'issue_customization_args': customization_args_util.get_full_customization_ar... | Returns a dict representation of the ExplorationIssue domain object.
Returns:
dict. A dict mapping of all fields of ExplorationIssue object. | core/domain/stats_domain.py | to_dict | yashdusing/oppia | 3 | python | def to_dict(self):
'Returns a dict representation of the ExplorationIssue domain object.\n\n Returns:\n dict. A dict mapping of all fields of ExplorationIssue object.\n '
return {'issue_type': self.issue_type, 'issue_customization_args': customization_args_util.get_full_customization_ar... | def to_dict(self):
'Returns a dict representation of the ExplorationIssue domain object.\n\n Returns:\n dict. A dict mapping of all fields of ExplorationIssue object.\n '
return {'issue_type': self.issue_type, 'issue_customization_args': customization_args_util.get_full_customization_ar... |
0b16f947dd83edfe4c435d2f7767576c49377f3d4e19bc487ce157811a13aadd | @classmethod
def from_dict(cls, issue_dict):
'Returns an ExplorationIssue object from a dict.\n\n Args:\n issue_dict: dict. A dict mapping of all fields of ExplorationIssue\n object.\n\n Returns:\n ExplorationIssue. The corresponding ExplorationIssue domain object.... | Returns an ExplorationIssue object from a dict.
Args:
issue_dict: dict. A dict mapping of all fields of ExplorationIssue
object.
Returns:
ExplorationIssue. The corresponding ExplorationIssue domain object. | core/domain/stats_domain.py | from_dict | yashdusing/oppia | 3 | python | @classmethod
def from_dict(cls, issue_dict):
'Returns an ExplorationIssue object from a dict.\n\n Args:\n issue_dict: dict. A dict mapping of all fields of ExplorationIssue\n object.\n\n Returns:\n ExplorationIssue. The corresponding ExplorationIssue domain object.... | @classmethod
def from_dict(cls, issue_dict):
'Returns an ExplorationIssue object from a dict.\n\n Args:\n issue_dict: dict. A dict mapping of all fields of ExplorationIssue\n object.\n\n Returns:\n ExplorationIssue. The corresponding ExplorationIssue domain object.... |
56806154ea33a15dfcbbe5fa0d7a783dab86517ce7aeb6e9cd5d78bb9c334101 | @classmethod
def from_backend_dict(cls, exp_issue_dict):
'Checks whether the exploration issue dict has the correct keys and\n then returns a domain object instance.\n\n Args:\n exp_issue_dict: dict. Dict representing an exploration issue.\n\n Returns:\n ExplorationIssue. ... | Checks whether the exploration issue dict has the correct keys and
then returns a domain object instance.
Args:
exp_issue_dict: dict. Dict representing an exploration issue.
Returns:
ExplorationIssue. The exploration issue domain object. | core/domain/stats_domain.py | from_backend_dict | yashdusing/oppia | 3 | python | @classmethod
def from_backend_dict(cls, exp_issue_dict):
'Checks whether the exploration issue dict has the correct keys and\n then returns a domain object instance.\n\n Args:\n exp_issue_dict: dict. Dict representing an exploration issue.\n\n Returns:\n ExplorationIssue. ... | @classmethod
def from_backend_dict(cls, exp_issue_dict):
'Checks whether the exploration issue dict has the correct keys and\n then returns a domain object instance.\n\n Args:\n exp_issue_dict: dict. Dict representing an exploration issue.\n\n Returns:\n ExplorationIssue. ... |
7fab82c2eb55f0cfbeb6dacf352739f44eb4fe17b7b11a950f64c5a001cf4e5d | @classmethod
def update_exp_issue_from_model(cls, issue_dict):
'Converts the exploration issue blob given from\n current issue_schema_version to current issue_schema_version + 1.\n Note that the issue_dict being passed in is modified in-place.\n\n Args:\n issue_dict: dict. Dict repre... | Converts the exploration issue blob given from
current issue_schema_version to current issue_schema_version + 1.
Note that the issue_dict being passed in is modified in-place.
Args:
issue_dict: dict. Dict representing the ExplorationIssue object. | core/domain/stats_domain.py | update_exp_issue_from_model | yashdusing/oppia | 3 | python | @classmethod
def update_exp_issue_from_model(cls, issue_dict):
'Converts the exploration issue blob given from\n current issue_schema_version to current issue_schema_version + 1.\n Note that the issue_dict being passed in is modified in-place.\n\n Args:\n issue_dict: dict. Dict repre... | @classmethod
def update_exp_issue_from_model(cls, issue_dict):
'Converts the exploration issue blob given from\n current issue_schema_version to current issue_schema_version + 1.\n Note that the issue_dict being passed in is modified in-place.\n\n Args:\n issue_dict: dict. Dict repre... |
598fabc75bf6f1bc6e45aace829978dbca1d4b81d58c51d664211ff80088b77a | @classmethod
def _convert_issue_v1_dict_to_v2_dict(cls, issue_dict):
'Converts a v1 issue dict to a v2 issue dict. This function is now\n implemented only for testing purposes and must be rewritten when an\n actual schema migration from v1 to v2 takes place.\n '
raise NotImplementedError | Converts a v1 issue dict to a v2 issue dict. This function is now
implemented only for testing purposes and must be rewritten when an
actual schema migration from v1 to v2 takes place. | core/domain/stats_domain.py | _convert_issue_v1_dict_to_v2_dict | yashdusing/oppia | 3 | python | @classmethod
def _convert_issue_v1_dict_to_v2_dict(cls, issue_dict):
'Converts a v1 issue dict to a v2 issue dict. This function is now\n implemented only for testing purposes and must be rewritten when an\n actual schema migration from v1 to v2 takes place.\n '
raise NotImplementedError | @classmethod
def _convert_issue_v1_dict_to_v2_dict(cls, issue_dict):
'Converts a v1 issue dict to a v2 issue dict. This function is now\n implemented only for testing purposes and must be rewritten when an\n actual schema migration from v1 to v2 takes place.\n '
raise NotImplementedError<|d... |
1f894d7e6ab6759e2c9d5b92db76466246af9dac052a8349eb5ef9b711eb6a23 | def validate(self):
'Validates the ExplorationIssue domain object.'
if (not isinstance(self.issue_type, basestring)):
raise utils.ValidationError(('Expected issue_type to be a string, received %s' % type(self.issue_type)))
if (not isinstance(self.schema_version, int)):
raise utils.Validation... | Validates the ExplorationIssue domain object. | core/domain/stats_domain.py | validate | yashdusing/oppia | 3 | python | def validate(self):
if (not isinstance(self.issue_type, basestring)):
raise utils.ValidationError(('Expected issue_type to be a string, received %s' % type(self.issue_type)))
if (not isinstance(self.schema_version, int)):
raise utils.ValidationError(('Expected schema_version to be an int, r... | def validate(self):
if (not isinstance(self.issue_type, basestring)):
raise utils.ValidationError(('Expected issue_type to be a string, received %s' % type(self.issue_type)))
if (not isinstance(self.schema_version, int)):
raise utils.ValidationError(('Expected schema_version to be an int, r... |
18476e3d53fd7471e1dc7a9681e5671f59a22990b02af5161a13f165f1a66794 | def __init__(self, action_type, action_customization_args, schema_version):
"Constructs a LearnerAction domain object.\n\n Args:\n action_type: str. Type of the action.\n action_customization_args: dict. The customization dict. The keys\n are names of customization_args a... | Constructs a LearnerAction domain object.
Args:
action_type: str. Type of the action.
action_customization_args: dict. The customization dict. The keys
are names of customization_args and the values are dicts with a
single key, 'value', whose corresponding value is the value of
the cust... | core/domain/stats_domain.py | __init__ | yashdusing/oppia | 3 | python | def __init__(self, action_type, action_customization_args, schema_version):
"Constructs a LearnerAction domain object.\n\n Args:\n action_type: str. Type of the action.\n action_customization_args: dict. The customization dict. The keys\n are names of customization_args a... | def __init__(self, action_type, action_customization_args, schema_version):
"Constructs a LearnerAction domain object.\n\n Args:\n action_type: str. Type of the action.\n action_customization_args: dict. The customization dict. The keys\n are names of customization_args a... |
6cf814df56eed891b4d99892ab1468a9eb165d8f9ecd1ceaee1ab165495e7745 | def to_dict(self):
'Returns a dict representation of the LearnerAction domain object.\n\n Returns:\n dict. A dict mapping of all fields of LearnerAction object.\n '
return {'action_type': self.action_type, 'action_customization_args': customization_args_util.get_full_customization_args(... | Returns a dict representation of the LearnerAction domain object.
Returns:
dict. A dict mapping of all fields of LearnerAction object. | core/domain/stats_domain.py | to_dict | yashdusing/oppia | 3 | python | def to_dict(self):
'Returns a dict representation of the LearnerAction domain object.\n\n Returns:\n dict. A dict mapping of all fields of LearnerAction object.\n '
return {'action_type': self.action_type, 'action_customization_args': customization_args_util.get_full_customization_args(... | def to_dict(self):
'Returns a dict representation of the LearnerAction domain object.\n\n Returns:\n dict. A dict mapping of all fields of LearnerAction object.\n '
return {'action_type': self.action_type, 'action_customization_args': customization_args_util.get_full_customization_args(... |
ddef78c6dc524d6e57be707c3a1c737248c9fe94207b54dcb6df79f5a976b112 | @classmethod
def from_dict(cls, action_dict):
'Returns a LearnerAction object from a dict.\n\n Args:\n action_dict: dict. A dict mapping of all fields of LearnerAction\n object.\n\n Returns:\n LearnerAction. The corresponding LearnerAction domain object.\n '... | Returns a LearnerAction object from a dict.
Args:
action_dict: dict. A dict mapping of all fields of LearnerAction
object.
Returns:
LearnerAction. The corresponding LearnerAction domain object. | core/domain/stats_domain.py | from_dict | yashdusing/oppia | 3 | python | @classmethod
def from_dict(cls, action_dict):
'Returns a LearnerAction object from a dict.\n\n Args:\n action_dict: dict. A dict mapping of all fields of LearnerAction\n object.\n\n Returns:\n LearnerAction. The corresponding LearnerAction domain object.\n '... | @classmethod
def from_dict(cls, action_dict):
'Returns a LearnerAction object from a dict.\n\n Args:\n action_dict: dict. A dict mapping of all fields of LearnerAction\n object.\n\n Returns:\n LearnerAction. The corresponding LearnerAction domain object.\n '... |
1ad6e510fea5c191827bdd6a1e069b2b8295b60e76730c7d763f9d991053b9ea | @classmethod
def update_learner_action_from_model(cls, action_dict):
'Converts the learner action blob given from\n current action_schema_version to current action_schema_version + 1.\n Note that the action_dict being passed in is modified in-place.\n\n Args:\n action_dict: dict. Dic... | Converts the learner action blob given from
current action_schema_version to current action_schema_version + 1.
Note that the action_dict being passed in is modified in-place.
Args:
action_dict: dict. Dict representing the LearnerAction object. | core/domain/stats_domain.py | update_learner_action_from_model | yashdusing/oppia | 3 | python | @classmethod
def update_learner_action_from_model(cls, action_dict):
'Converts the learner action blob given from\n current action_schema_version to current action_schema_version + 1.\n Note that the action_dict being passed in is modified in-place.\n\n Args:\n action_dict: dict. Dic... | @classmethod
def update_learner_action_from_model(cls, action_dict):
'Converts the learner action blob given from\n current action_schema_version to current action_schema_version + 1.\n Note that the action_dict being passed in is modified in-place.\n\n Args:\n action_dict: dict. Dic... |
3feb9718f65270d7627e6e5b30f72c8de09cbb1e6ae9d947438b62125c2c275d | @classmethod
def _convert_action_v1_dict_to_v2_dict(cls, action_dict):
'Converts a v1 action dict to a v2 action dict. This function is now\n implemented only for testing purposes and must be rewritten when an\n actual schema migration from v1 to v2 takes place.\n '
raise NotImplementedErro... | Converts a v1 action dict to a v2 action dict. This function is now
implemented only for testing purposes and must be rewritten when an
actual schema migration from v1 to v2 takes place. | core/domain/stats_domain.py | _convert_action_v1_dict_to_v2_dict | yashdusing/oppia | 3 | python | @classmethod
def _convert_action_v1_dict_to_v2_dict(cls, action_dict):
'Converts a v1 action dict to a v2 action dict. This function is now\n implemented only for testing purposes and must be rewritten when an\n actual schema migration from v1 to v2 takes place.\n '
raise NotImplementedErro... | @classmethod
def _convert_action_v1_dict_to_v2_dict(cls, action_dict):
'Converts a v1 action dict to a v2 action dict. This function is now\n implemented only for testing purposes and must be rewritten when an\n actual schema migration from v1 to v2 takes place.\n '
raise NotImplementedErro... |
50536f4e611fa98c748fd1ed6fbba71344f22195e143a83b4238d78ba506317a | def validate(self):
'Validates the LearnerAction domain object.'
if (not isinstance(self.action_type, basestring)):
raise utils.ValidationError(('Expected action_type to be a string, received %s' % type(self.action_type)))
if (not isinstance(self.schema_version, int)):
raise utils.Validation... | Validates the LearnerAction domain object. | core/domain/stats_domain.py | validate | yashdusing/oppia | 3 | python | def validate(self):
if (not isinstance(self.action_type, basestring)):
raise utils.ValidationError(('Expected action_type to be a string, received %s' % type(self.action_type)))
if (not isinstance(self.schema_version, int)):
raise utils.ValidationError(('Expected schema_version to be an int... | def validate(self):
if (not isinstance(self.action_type, basestring)):
raise utils.ValidationError(('Expected action_type to be a string, received %s' % type(self.action_type)))
if (not isinstance(self.schema_version, int)):
raise utils.ValidationError(('Expected schema_version to be an int... |
1d9879842fcde6ff960b90fda8406796665fa9db8bfa203ead07b6196dd64ba8 | def __init__(self, exploration_id, exploration_version, state_name, interaction_id, submitted_answer_list, schema_version=feconf.CURRENT_STATE_ANSWERS_SCHEMA_VERSION):
'Constructs a StateAnswers domain object.\n\n Args:\n exploration_id: The ID of the exploration corresponding to submitted\n ... | Constructs a StateAnswers domain object.
Args:
exploration_id: The ID of the exploration corresponding to submitted
answers.
exploration_version: The version of the exploration corresponding to
submitted answers.
state_name: The state to which the answers were submitted.
interaction_id:... | core/domain/stats_domain.py | __init__ | yashdusing/oppia | 3 | python | def __init__(self, exploration_id, exploration_version, state_name, interaction_id, submitted_answer_list, schema_version=feconf.CURRENT_STATE_ANSWERS_SCHEMA_VERSION):
'Constructs a StateAnswers domain object.\n\n Args:\n exploration_id: The ID of the exploration corresponding to submitted\n ... | def __init__(self, exploration_id, exploration_version, state_name, interaction_id, submitted_answer_list, schema_version=feconf.CURRENT_STATE_ANSWERS_SCHEMA_VERSION):
'Constructs a StateAnswers domain object.\n\n Args:\n exploration_id: The ID of the exploration corresponding to submitted\n ... |
bcbd82815245b015f110ebf9d5c0ca9cf88aed170ce6380540581000d25b271f | def get_submitted_answer_dict_list(self):
'Returns the submitted_answer_list stored within this object as a list\n of StateAnswer dicts.\n '
return [state_answer.to_dict() for state_answer in self.submitted_answer_list] | Returns the submitted_answer_list stored within this object as a list
of StateAnswer dicts. | core/domain/stats_domain.py | get_submitted_answer_dict_list | yashdusing/oppia | 3 | python | def get_submitted_answer_dict_list(self):
'Returns the submitted_answer_list stored within this object as a list\n of StateAnswer dicts.\n '
return [state_answer.to_dict() for state_answer in self.submitted_answer_list] | def get_submitted_answer_dict_list(self):
'Returns the submitted_answer_list stored within this object as a list\n of StateAnswer dicts.\n '
return [state_answer.to_dict() for state_answer in self.submitted_answer_list]<|docstring|>Returns the submitted_answer_list stored within this object as a l... |
fd6571436332a9f895d13422760a871344b9390b03e603c09565bca3636557e1 | def validate(self):
'Validates StateAnswers domain object entity.'
if (not isinstance(self.exploration_id, basestring)):
raise utils.ValidationError(('Expected exploration_id to be a string, received %s' % str(self.exploration_id)))
if (not isinstance(self.state_name, basestring)):
raise uti... | Validates StateAnswers domain object entity. | core/domain/stats_domain.py | validate | yashdusing/oppia | 3 | python | def validate(self):
if (not isinstance(self.exploration_id, basestring)):
raise utils.ValidationError(('Expected exploration_id to be a string, received %s' % str(self.exploration_id)))
if (not isinstance(self.state_name, basestring)):
raise utils.ValidationError(('Expected state_name to be... | def validate(self):
if (not isinstance(self.exploration_id, basestring)):
raise utils.ValidationError(('Expected exploration_id to be a string, received %s' % str(self.exploration_id)))
if (not isinstance(self.state_name, basestring)):
raise utils.ValidationError(('Expected state_name to be... |
8c1cb30e48ba559ab111fe0afce480c90e9d40913d39ce11b5669d10652be674 | def to_dict(self):
'Returns the dict of submitted answer.\n\n Returns:\n dict. The submitted answer dict.\n '
submitted_answer_dict = {'answer': self.answer, 'interaction_id': self.interaction_id, 'answer_group_index': self.answer_group_index, 'rule_spec_index': self.rule_spec_index, 'c... | Returns the dict of submitted answer.
Returns:
dict. The submitted answer dict. | core/domain/stats_domain.py | to_dict | yashdusing/oppia | 3 | python | def to_dict(self):
'Returns the dict of submitted answer.\n\n Returns:\n dict. The submitted answer dict.\n '
submitted_answer_dict = {'answer': self.answer, 'interaction_id': self.interaction_id, 'answer_group_index': self.answer_group_index, 'rule_spec_index': self.rule_spec_index, 'c... | def to_dict(self):
'Returns the dict of submitted answer.\n\n Returns:\n dict. The submitted answer dict.\n '
submitted_answer_dict = {'answer': self.answer, 'interaction_id': self.interaction_id, 'answer_group_index': self.answer_group_index, 'rule_spec_index': self.rule_spec_index, 'c... |
d04edcb2f3d3e24ea1536983dee82aeff963920385e347d4ee6e4247514f1e5d | @classmethod
def from_dict(cls, submitted_answer_dict):
'Returns the domain object representing an answer submitted to a\n state.\n\n Returns:\n SubmittedAnswer. The SubmittedAnswer domin object.\n '
return cls(submitted_answer_dict['answer'], submitted_answer_dict['interaction_i... | Returns the domain object representing an answer submitted to a
state.
Returns:
SubmittedAnswer. The SubmittedAnswer domin object. | core/domain/stats_domain.py | from_dict | yashdusing/oppia | 3 | python | @classmethod
def from_dict(cls, submitted_answer_dict):
'Returns the domain object representing an answer submitted to a\n state.\n\n Returns:\n SubmittedAnswer. The SubmittedAnswer domin object.\n '
return cls(submitted_answer_dict['answer'], submitted_answer_dict['interaction_i... | @classmethod
def from_dict(cls, submitted_answer_dict):
'Returns the domain object representing an answer submitted to a\n state.\n\n Returns:\n SubmittedAnswer. The SubmittedAnswer domin object.\n '
return cls(submitted_answer_dict['answer'], submitted_answer_dict['interaction_i... |
a41cb2f92c73e72fce9d5835f4f578d454c280aa13b5b6deac3f39433a9e2faa | def validate(self):
'Validates this submitted answer object.'
if (self.time_spent_in_sec is None):
raise utils.ValidationError('SubmittedAnswers must have a provided time_spent_in_sec')
if (self.session_id is None):
raise utils.ValidationError('SubmittedAnswers must have a provided session_i... | Validates this submitted answer object. | core/domain/stats_domain.py | validate | yashdusing/oppia | 3 | python | def validate(self):
if (self.time_spent_in_sec is None):
raise utils.ValidationError('SubmittedAnswers must have a provided time_spent_in_sec')
if (self.session_id is None):
raise utils.ValidationError('SubmittedAnswers must have a provided session_id')
if ((self.rule_spec_str is not No... | def validate(self):
if (self.time_spent_in_sec is None):
raise utils.ValidationError('SubmittedAnswers must have a provided time_spent_in_sec')
if (self.session_id is None):
raise utils.ValidationError('SubmittedAnswers must have a provided session_id')
if ((self.rule_spec_str is not No... |
7f24b1efdd719285140ef68ac5c94b308b8c265b667d912d12fc4c605df180ff | def __init__(self, answer, frequency):
'Initialize domain object for answer occurrences.'
self.answer = answer
self.frequency = frequency | Initialize domain object for answer occurrences. | core/domain/stats_domain.py | __init__ | yashdusing/oppia | 3 | python | def __init__(self, answer, frequency):
self.answer = answer
self.frequency = frequency | def __init__(self, answer, frequency):
self.answer = answer
self.frequency = frequency<|docstring|>Initialize domain object for answer occurrences.<|endoftext|> |
71f1904d5d149273b9646164b81c0cd0015c6893fd6e259dce485ec38fb37f01 | def to_raw_type(self):
"Returns a Python dict representing the specific answer.\n\n Returns:\n dict. The specific answer dict in the following format:\n {\n 'answer': *. The answer submitted by the learner.\n 'frequency': int. The number of occurrences of t... | Returns a Python dict representing the specific answer.
Returns:
dict. The specific answer dict in the following format:
{
'answer': *. The answer submitted by the learner.
'frequency': int. The number of occurrences of the answer.
} | core/domain/stats_domain.py | to_raw_type | yashdusing/oppia | 3 | python | def to_raw_type(self):
"Returns a Python dict representing the specific answer.\n\n Returns:\n dict. The specific answer dict in the following format:\n {\n 'answer': *. The answer submitted by the learner.\n 'frequency': int. The number of occurrences of t... | def to_raw_type(self):
"Returns a Python dict representing the specific answer.\n\n Returns:\n dict. The specific answer dict in the following format:\n {\n 'answer': *. The answer submitted by the learner.\n 'frequency': int. The number of occurrences of t... |
3975048b13aa9e525f3c2524e0ffffcc41ff8e70038c7ec426d41653d0175c62 | @classmethod
def from_raw_type(cls, answer_occurrence_dict):
"Returns domain object that represents a specific answer that occurred\n some number of times.\n\n Args:\n answer_occurrence_dict: dict. The specific answer dict in the\n following format:\n {\n ... | Returns domain object that represents a specific answer that occurred
some number of times.
Args:
answer_occurrence_dict: dict. The specific answer dict in the
following format:
{
'answer': *. The answer submitted by the learner.
'frequency': int. The number of occurrences o... | core/domain/stats_domain.py | from_raw_type | yashdusing/oppia | 3 | python | @classmethod
def from_raw_type(cls, answer_occurrence_dict):
"Returns domain object that represents a specific answer that occurred\n some number of times.\n\n Args:\n answer_occurrence_dict: dict. The specific answer dict in the\n following format:\n {\n ... | @classmethod
def from_raw_type(cls, answer_occurrence_dict):
"Returns domain object that represents a specific answer that occurred\n some number of times.\n\n Args:\n answer_occurrence_dict: dict. The specific answer dict in the\n following format:\n {\n ... |
84d56110df2102bcde34c9b48068159916819b18ab514f749cc1857e81bec89d | def __init__(self, answer_occurrences=None):
'Initialize domain object for answer frequency list for a given list\n of AnswerOccurrence objects (default is empty list).\n '
super(AnswerFrequencyList, self).__init__(CALC_OUTPUT_TYPE_ANSWER_FREQUENCY_LIST)
self.answer_occurrences = (answer_occur... | Initialize domain object for answer frequency list for a given list
of AnswerOccurrence objects (default is empty list). | core/domain/stats_domain.py | __init__ | yashdusing/oppia | 3 | python | def __init__(self, answer_occurrences=None):
'Initialize domain object for answer frequency list for a given list\n of AnswerOccurrence objects (default is empty list).\n '
super(AnswerFrequencyList, self).__init__(CALC_OUTPUT_TYPE_ANSWER_FREQUENCY_LIST)
self.answer_occurrences = (answer_occur... | def __init__(self, answer_occurrences=None):
'Initialize domain object for answer frequency list for a given list\n of AnswerOccurrence objects (default is empty list).\n '
super(AnswerFrequencyList, self).__init__(CALC_OUTPUT_TYPE_ANSWER_FREQUENCY_LIST)
self.answer_occurrences = (answer_occur... |
a606a57a167e48ce9d17bdd01876b347fb867e01614958a1bad8020f2960124e | def to_raw_type(self):
"Returns the answer occurrences list with each answer represented as\n a Python dict.\n\n Returns:\n list(dict). A list of answer occurrence dicts. Each dict has the\n following format:\n {\n 'answer': *. The answer sub... | Returns the answer occurrences list with each answer represented as
a Python dict.
Returns:
list(dict). A list of answer occurrence dicts. Each dict has the
following format:
{
'answer': *. The answer submitted by the learner.
'frequency': int. The number of occurrences of t... | core/domain/stats_domain.py | to_raw_type | yashdusing/oppia | 3 | python | def to_raw_type(self):
"Returns the answer occurrences list with each answer represented as\n a Python dict.\n\n Returns:\n list(dict). A list of answer occurrence dicts. Each dict has the\n following format:\n {\n 'answer': *. The answer sub... | def to_raw_type(self):
"Returns the answer occurrences list with each answer represented as\n a Python dict.\n\n Returns:\n list(dict). A list of answer occurrence dicts. Each dict has the\n following format:\n {\n 'answer': *. The answer sub... |
5ab995e1792a0a9525c52faabedfcfcd4ade70854c3b2779b310d7849f07eda8 | @classmethod
def from_raw_type(cls, answer_occurrence_list):
"Creates a domain object that represents an output list of\n AnswerOccurrences.\n\n Args:\n answer_occurrence_list: list(dict). A list containing answer\n occurrence dicts in the following format:\n {... | Creates a domain object that represents an output list of
AnswerOccurrences.
Args:
answer_occurrence_list: list(dict). A list containing answer
occurrence dicts in the following format:
{
'answer': *. The answer submitted by the learner.
'frequency': int. The number of occur... | core/domain/stats_domain.py | from_raw_type | yashdusing/oppia | 3 | python | @classmethod
def from_raw_type(cls, answer_occurrence_list):
"Creates a domain object that represents an output list of\n AnswerOccurrences.\n\n Args:\n answer_occurrence_list: list(dict). A list containing answer\n occurrence dicts in the following format:\n {... | @classmethod
def from_raw_type(cls, answer_occurrence_list):
"Creates a domain object that represents an output list of\n AnswerOccurrences.\n\n Args:\n answer_occurrence_list: list(dict). A list containing answer\n occurrence dicts in the following format:\n {... |
488531a44ee574eefce792d2eeef317ef060c002fd74f6db83541507e665e8f0 | def __init__(self, categorized_answer_freq_lists=None):
'Initialize domain object for categorized answer frequency lists for\n a given dict (default is empty).\n '
super(CategorizedAnswerFrequencyLists, self).__init__(CALC_OUTPUT_TYPE_CATEGORIZED_ANSWER_FREQUENCY_LISTS)
self.categorized_answer... | Initialize domain object for categorized answer frequency lists for
a given dict (default is empty). | core/domain/stats_domain.py | __init__ | yashdusing/oppia | 3 | python | def __init__(self, categorized_answer_freq_lists=None):
'Initialize domain object for categorized answer frequency lists for\n a given dict (default is empty).\n '
super(CategorizedAnswerFrequencyLists, self).__init__(CALC_OUTPUT_TYPE_CATEGORIZED_ANSWER_FREQUENCY_LISTS)
self.categorized_answer... | def __init__(self, categorized_answer_freq_lists=None):
'Initialize domain object for categorized answer frequency lists for\n a given dict (default is empty).\n '
super(CategorizedAnswerFrequencyLists, self).__init__(CALC_OUTPUT_TYPE_CATEGORIZED_ANSWER_FREQUENCY_LISTS)
self.categorized_answer... |
2badaf1aacfb142193c643c2f481c4e8ab16f8f12008e378bfbf3a38cd17e15b | def to_raw_type(self):
"Returns the categorized frequency Python dict.\n\n Returns:\n dict. A dict whose keys are category names and whose corresponding\n values are lists of answer frequency dicts. Each answer\n frequency dict has the following keys and values:\n ... | Returns the categorized frequency Python dict.
Returns:
dict. A dict whose keys are category names and whose corresponding
values are lists of answer frequency dicts. Each answer
frequency dict has the following keys and values:
{
'answer': *. The answer submitted by the learner... | core/domain/stats_domain.py | to_raw_type | yashdusing/oppia | 3 | python | def to_raw_type(self):
"Returns the categorized frequency Python dict.\n\n Returns:\n dict. A dict whose keys are category names and whose corresponding\n values are lists of answer frequency dicts. Each answer\n frequency dict has the following keys and values:\n ... | def to_raw_type(self):
"Returns the categorized frequency Python dict.\n\n Returns:\n dict. A dict whose keys are category names and whose corresponding\n values are lists of answer frequency dicts. Each answer\n frequency dict has the following keys and values:\n ... |
b2c616c2813119b557f2ea71493a0be1018e560cf741e72776d830e2d2a6f11d | @classmethod
def from_raw_type(cls, categorized_frequency_dict):
"Returns the domain object for categorized answer frequency dict for\n a given dict.\n\n Args:\n categorized_frequency_dict: dict. The categorized answer frequency\n dict whose keys are category names and whose ... | Returns the domain object for categorized answer frequency dict for
a given dict.
Args:
categorized_frequency_dict: dict. The categorized answer frequency
dict whose keys are category names and whose corresponding
values are lists of answer frequency dicts. Each answer
frequency dict has th... | core/domain/stats_domain.py | from_raw_type | yashdusing/oppia | 3 | python | @classmethod
def from_raw_type(cls, categorized_frequency_dict):
"Returns the domain object for categorized answer frequency dict for\n a given dict.\n\n Args:\n categorized_frequency_dict: dict. The categorized answer frequency\n dict whose keys are category names and whose ... | @classmethod
def from_raw_type(cls, categorized_frequency_dict):
"Returns the domain object for categorized answer frequency dict for\n a given dict.\n\n Args:\n categorized_frequency_dict: dict. The categorized answer frequency\n dict whose keys are category names and whose ... |
7f1de4c2cd48e8e3f23655820003e4964c8919852574f98168966ab6f55cfef1 | def __init__(self, exploration_id, exploration_version, state_name, interaction_id, calculation_id, calculation_output):
'Initialize domain object for state answers calculation output.\n\n Args:\n exploration_id: str. The ID of the exploration corresponding to the\n answer calculati... | Initialize domain object for state answers calculation output.
Args:
exploration_id: str. The ID of the exploration corresponding to the
answer calculation output.
exploration_version: str. The version of the exploration
corresponding to the answer calculation output.
state_name: str. The n... | core/domain/stats_domain.py | __init__ | yashdusing/oppia | 3 | python | def __init__(self, exploration_id, exploration_version, state_name, interaction_id, calculation_id, calculation_output):
'Initialize domain object for state answers calculation output.\n\n Args:\n exploration_id: str. The ID of the exploration corresponding to the\n answer calculati... | def __init__(self, exploration_id, exploration_version, state_name, interaction_id, calculation_id, calculation_output):
'Initialize domain object for state answers calculation output.\n\n Args:\n exploration_id: str. The ID of the exploration corresponding to the\n answer calculati... |
6e5c5528f4d5f397f20684525580f6d60582d4959040853c0328122b8c1b9250 | def save(self):
'Validate the domain object and commit it to storage.'
self.validate()
stats_models.StateAnswersCalcOutputModel.create_or_update(self.exploration_id, self.exploration_version, self.state_name, self.interaction_id, self.calculation_id, self.calculation_output.calculation_output_type, self.cal... | Validate the domain object and commit it to storage. | core/domain/stats_domain.py | save | yashdusing/oppia | 3 | python | def save(self):
self.validate()
stats_models.StateAnswersCalcOutputModel.create_or_update(self.exploration_id, self.exploration_version, self.state_name, self.interaction_id, self.calculation_id, self.calculation_output.calculation_output_type, self.calculation_output.to_raw_type()) | def save(self):
self.validate()
stats_models.StateAnswersCalcOutputModel.create_or_update(self.exploration_id, self.exploration_version, self.state_name, self.interaction_id, self.calculation_id, self.calculation_output.calculation_output_type, self.calculation_output.to_raw_type())<|docstring|>Validate th... |
1014b419c1dec3141cecde6cba6ed232a26572acc212cc5f3476c3f4e295d5ce | def validate(self):
'Validates StateAnswersCalcOutputModel domain object entity before\n it is commited to storage.\n '
max_bytes_per_calc_output_data = 999999
if (not isinstance(self.exploration_id, basestring)):
raise utils.ValidationError(('Expected exploration_id to be a string, re... | Validates StateAnswersCalcOutputModel domain object entity before
it is commited to storage. | core/domain/stats_domain.py | validate | yashdusing/oppia | 3 | python | def validate(self):
'Validates StateAnswersCalcOutputModel domain object entity before\n it is commited to storage.\n '
max_bytes_per_calc_output_data = 999999
if (not isinstance(self.exploration_id, basestring)):
raise utils.ValidationError(('Expected exploration_id to be a string, re... | def validate(self):
'Validates StateAnswersCalcOutputModel domain object entity before\n it is commited to storage.\n '
max_bytes_per_calc_output_data = 999999
if (not isinstance(self.exploration_id, basestring)):
raise utils.ValidationError(('Expected exploration_id to be a string, re... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.