MCPcopy Create free account

hub / github.com/GoodStartLabs/AI_Diplomacy / functions

Functions2,689 in github.com/GoodStartLabs/AI_Diplomacy

↓ 896 callersMethodowner_name
Retrieves owner name
diplomacy/tests/test_datc.py:80
↓ 742 callersMethodcheck_results
Checks adjudication results
diplomacy/tests/test_datc.py:89
↓ 551 callersMethodget
Return value associated with key, or default value if key not found.
diplomacy/utils/sorted_dict.py:100
↓ 450 callersMethodappend
(value)
diplomacy/web/src/diplomacy/utils/queue.js:28
↓ 361 callersMethodset_orders
Submit orders
diplomacy/tests/test_datc.py:57
↓ 343 callersMethodset_units
Sets units on the map
diplomacy/tests/test_datc.py:47
↓ 298 callersMethodjoin
Return the joined parts
diplomacy/utils/splitter.py:51
↓ 220 callersMethoditems
Get an iterator to the items in the dict.
diplomacy/utils/sorted_dict.py:150
↓ 216 callersFunctionregister_token
Registers a token in the registry :param str_repr: The DAIDE string representation of the token (e.g. 'ECS') :param bytes_repr: The
diplomacy/daide/tokens.py:159
↓ 205 callersFunctionstr_to_bytes
Converts a str into its bytes representation :param daide_str: A DAIDE string with tokens separated by spaces :return: The bytes rep
diplomacy/daide/utils.py:40
↓ 204 callersMethodinfo
(message)
diplomacy/web/src/gui/pages/page.jsx:179
↓ 180 callersMethodprocess
Processes the game
diplomacy/tests/test_datc.py:62
↓ 164 callersMethodcreate_game
Creates a game object
diplomacy/tests/test_datc.py:32
↓ 163 callersMethodclear_units
Clears units
diplomacy/tests/test_datc.py:37
↓ 163 callersMethodvalues
Get an iterator to the values in the dict.
diplomacy/utils/sorted_dict.py:142
↓ 105 callersMethoderror
(self, msg)
experiment_runner.py:271
↓ 99 callersMethoderror
Performs the error action :param on_error: The action to take when an error is encountered ('raise', 'warn', 'ignore') :para
diplomacy/daide/clauses.py:135
↓ 98 callersFunctioncheck_dislodged
Checks if a unit has been dislodged
diplomacy/tests/test_datc.py:5461
↓ 96 callersMethodadd
Add an element.
diplomacy/utils/sorted_set.py:96
↓ 93 callersMethodremove
Remove and return element.
diplomacy/utils/sorted_set.py:141
↓ 86 callersMethodget_power
Retrieves a power instance from given power name. :param power_name: name of power instance to retrieve. Power name must be as given
diplomacy/engine/game.py:1094
↓ 80 callersMethodfrom_bytes
Builds the clause from a byte array :param daide_bytes: The bytes to use to build the clause :param on_error: The action to
diplomacy/daide/clauses.py:449
↓ 80 callersMethodset_orders
Sets the current orders for a power :param power_name: The name of the power (e.g. 'FRANCE') :param orders: The list of orde
diplomacy/engine/game.py:1224
↓ 69 callersMethodpop
Remove and return value at given index.
diplomacy/utils/sorted_set.py:137
↓ 63 callersFunctionadd_parentheses
Add parentheses to a list of bytes
diplomacy/daide/clauses.py:56
↓ 58 callersFunctionparse_bytes
Creates a clause object from a string of bytes :param clause_constructor: The type of clause to build :param daide_bytes: The bytes
diplomacy/daide/clauses.py:70
↓ 58 callersFunctionparse_string
Creates a clause object from a string :param clause_constructor: The type of clause to build :param string: The string to use to bui
diplomacy/daide/clauses.py:85
↓ 57 callersMethodget_orders
Retrieves the orders submitted by a specific power, or by all powers :param power_name: Optional. The name of the power (e.g. 'FRANCE')
diplomacy/engine/game.py:962
↓ 53 callersMethodkeys
Get an iterator to the keys in the dict.
diplomacy/utils/sorted_dict.py:138
↓ 51 callersMethodget_current_phase
Returns the current phase (format 'S1901M' or 'FORMING' or 'COMPLETED')
diplomacy/engine/game.py:916
↓ 50 callersMethodsetdefault
Sets a default for a given key
diplomacy/utils/priority_dict.py:86
↓ 49 callersMethodto_string
Returns the string representation of the order
diplomacy/integration/webdiplomacy_net/orders.py:657
↓ 45 callersMethodkeys
()
diplomacy/web/src/diplomacy/utils/sorted_dict.js:102
↓ 45 callersMethodto_dict
Returns the dictionary representation of the order
diplomacy/integration/webdiplomacy_net/orders.py:674
↓ 44 callersFunctioncompare_dicts
Checks if two dictionaries are equal
diplomacy/integration/webdiplomacy_net/tests/test_orders.py:20
↓ 44 callersMethodset_units
Sets units directly on the map :param power_name: The name of the power who will own the units (e.g. 'FRANCE') :param units:
diplomacy/engine/game.py:1104
↓ 44 callersMethodsub
Return a list of values associated to keys between key_from and key_to (both bounds included). - If key_from is None, lowest
diplomacy/utils/sorted_dict.py:163
↓ 44 callersMethodupdate_hash
Updates the zobrist hash for the current game :param power: The name of the power owning the unit, supply center or home :pa
diplomacy/engine/game.py:1536
↓ 43 callersMethodformat
Format the message of the result
diplomacy/utils/common.py:280
↓ 43 callersMethodvalues
()
diplomacy/web/src/diplomacy/utils/sorted_dict.js:106
↓ 40 callersMethodarea_type
Returns 'WATER', 'COAST', 'PORT', 'LAND', 'SHUT' :param loc: The name of the location to query :return: Type of the location
diplomacy/engine/map.py:1098
↓ 38 callersFunction_req_fn
Create channel request method that sends request with channel token. :param request_class: class of request to send with channel request met
diplomacy/client/channel.py:31
↓ 38 callersMethodis_valid_unit
Determines if a unit and location combination is valid (e.g. 'A BUR') is valid :param unit: The name of the unit with its location (e.g.
diplomacy/engine/map.py:1219
↓ 37 callersMethod_req
(name, forcedParameters, localChannelFunction, parameters, game)
diplomacy/web/src/diplomacy/client/channel.js:42
↓ 36 callersMethodset
(error)
diplomacy/web/src/diplomacy/utils/future_event.js:25
↓ 34 callersMethod_unit_owner
Finds the power who owns a unit :param unit: The name of the unit to find (e.g. 'A PAR') :param coast_required: Indicates th
diplomacy/engine/game.py:3621
↓ 32 callersFunctionassert_raises
Checks that given callback raises given exceptions.
diplomacy/utils/tests/test_common.py:22
↓ 32 callersMethodprocess
Process the current phase of the game, optionally providing a `phase_summary_callback(system_prompt, user_prompt) -> str` that genera
diplomacy/engine/game.py:1439
↓ 30 callersMethodcopy
Return a copy of this sorted dict.
diplomacy/utils/sorted_dict.py:265
↓ 30 callersMethodput
Add a key with a value to the dict.
diplomacy/utils/sorted_dict.py:104
↓ 30 callersMethodwarn
(message)
diplomacy/web/src/gui/pages/page.jsx:191
↓ 29 callersFunction_attr
Shorthand method to retrieve an XML attribute
diplomacy/engine/renderer.py:35
↓ 29 callersMethodgetPage
* Return current page object displaying this content. * @returns {Page}
diplomacy/web/src/gui/pages/content_game.jsx:238
↓ 29 callersFunctionverify_request
Verify request token, and game role and rights if request is a game request. Ignore connection requests (e.g. SignIn), as such requests don't
diplomacy/server/request_manager_utils.py:113
↓ 27 callersMethodclear_units
Clear the power's units :param power_name: Optional. The name of the power whose units will be cleared (e.g. 'FRANCE'),
diplomacy/engine/game.py:1284
↓ 27 callersMethodis_eliminated
Returns a flag to show if player is eliminated :return: If the current power is eliminated
diplomacy/engine/power.py:305
↓ 27 callersMethodupdate
(self, element)
diplomacy/utils/parsing.py:417
↓ 25 callersMethod__init__
(self, **kwargs)
diplomacy/communication/requests.py:843
↓ 25 callersMethodclear
Remove all items from set.
diplomacy/utils/sorted_set.py:159
↓ 25 callersMethodfrom_dict
Convert a JSON dictionary to an instance of this class. :param json_dict: a JSON dictionary to parse. Dictionary with basic types (int,
diplomacy/utils/jsonable.py:111
↓ 24 callersMethodcontains
(key)
diplomacy/web/src/diplomacy/utils/sorted_dict.js:63
↓ 24 callersMethodgetProvince
(abbr)
diplomacy/web/src/gui/utils/map_data.js:79
↓ 24 callersMethodload
Loads a map file from disk :param file_name: Optional. A string representing the file to open. Otherwise, defaults to the map name
diplomacy/engine/map.py:306
↓ 24 callersMethodsetState
(state)
diplomacy/web/src/gui/pages/content_game.jsx:226
↓ 24 callersMethodto_dict
Convert this object to a python dictionary ready for any JSON work. :return: dict
diplomacy/utils/jsonable.py:91
↓ 23 callersMethoderror
(message)
diplomacy/web/src/gui/pages/page.jsx:173
↓ 22 callersMethod_req
(channelMethod, parameters)
diplomacy/web/src/diplomacy/client/network_game.js:57
↓ 22 callersMethodclose
Close the aiohttp session.
ai_diplomacy/clients.py:1072
↓ 22 callersMethodlast_value
Get the value associated to highest key in the dict.
diplomacy/utils/sorted_dict.py:130
↓ 22 callersMethodphase_abbr
Constructs a 5 character representation (S1901M) from a phase (SPRING 1901 MOVEMENT) :param phase: The full phase (e.g. SPRING 1901 MOVE
diplomacy/engine/map.py:1420
↓ 22 callersMethodset_centers
Transfers SC ownership to power
diplomacy/tests/test_datc.py:52
↓ 22 callersMethodvet
Determines the type of every word in a compacted order phrase 0 - Undetermined, 1 - Power, 2 - Unit,
diplomacy/engine/map.py:941
↓ 21 callersFunction_game_request_method
Create a game request method that calls channel counterpart.
diplomacy/client/network_game.py:27
↓ 21 callersMethodclear_centers
Clears supply centers
diplomacy/tests/test_datc.py:42
↓ 21 callersMethodindex
Return index of element in the set, or None if element is not in the set.
diplomacy/utils/sorted_set.py:150
↓ 21 callersMethodmove_to_phase
Move to a specific phase
diplomacy/tests/test_datc.py:162
↓ 21 callersMethodparse_bytes
Builds the request from DAIDE bytes
diplomacy/daide/requests.py:156
↓ 20 callersMethodabuts
Determines if a order for unit_type from unit_loc to other_loc is adjacent. **Note**: This method uses the precomputed cache
diplomacy/engine/map.py:1134
↓ 20 callersFunctiongetPowerDisplayName
(power: PowerENUM | string)
ai_animation/src/utils/powerNames.ts:12
↓ 20 callersMethodsetState
(state)
diplomacy/web/src/gui/pages/page.jsx:76
↓ 20 callersFunctionstr_to_seconds
Converts a time in format 00W00D00H00M00S in number of seconds :param offset_str: The string to convert (e.g. '20D') :return: Its eq
diplomacy/utils/time.py:25
↓ 20 callersFunctionstrip_parentheses
Removes parentheses from the DAIDE bytes and returns the inner content. The first and last token are expected to be parentheses.
diplomacy/daide/clauses.py:62
↓ 19 callersFunctionload_prompt
Resolve *fname* to an absolute path and return its contents. Resolution rules (first match wins): 1. If *fname* is absolute -> use as-is
ai_diplomacy/utils.py:314
↓ 19 callersMethodsave_game
Update on-memory version of given server game. :param server_game: server game :type server_game: ServerGame
diplomacy/server/server.py:547
↓ 19 callersMethodupdate
* Update the event queue, triggering events that are ready
ai_animation/src/events.ts:91
↓ 18 callersMethodget_state
Gets the internal saved state of the game. This state is intended to represent current game view (powers states, orders resul
diplomacy/engine/game.py:1630
↓ 18 callersMethodphase_long
Constructs a full sentence of a phase from a 5 character abbreviation :param phase_abbr: 5 character abbrev. (e.g. S1901M) :
diplomacy/engine/map.py:1432
↓ 18 callersMethodvalidate
(self, element)
diplomacy/utils/parsing.py:410
↓ 17 callersMethod__init__
Builds the response :param response_bytes: The bytes received for the request
diplomacy/daide/responses.py:763
↓ 17 callersFunctionbreak_next_group
If the next token is a parenthesis, finds its matching closing parenthesis and returns a tuple of the items between parentheses and the items
diplomacy/daide/clauses.py:26
↓ 17 callersMethodhas_power
Return True if this game has given power name.
diplomacy/engine/game.py:556
↓ 16 callersMethod_abuts
Determines if a order for unit_type from unit_loc to other_loc is adjacent (Support and convoy only) :param unit_type: The type of unit
diplomacy/engine/game.py:3595
↓ 16 callersFunction_callback_clearing_method
Create a callback clearing method for a given notification class.
diplomacy/client/network_game.py:61
↓ 16 callersFunction_callback_setting_method
Create a callback setting method for a given notification class.
diplomacy/client/network_game.py:47
↓ 16 callersMethodaddCallback
(notificationName, notificationCallback)
diplomacy/web/src/diplomacy/client/network_game.js:34
↓ 16 callersMethodclearCallbacks
(notificationName)
diplomacy/web/src/diplomacy/client/network_game.js:41
↓ 16 callersMethodcompare_phases
Compare 2 phases (Strings) and return 1, -1, or 0 to indicate which phase is larger :param phase1: The first phase (e.g. S1901M, FORMIN
diplomacy/engine/map.py:1373
↓ 16 callersMethodget_name
Return username of given token.
diplomacy/server/users.py:118
↓ 16 callersMethodisPlayerGame
(powerName)
diplomacy/web/src/diplomacy/engine/game.js:296
↓ 15 callersMethodformat_power_with_model
Format power name with model in parentheses
analyze_game_moments.py:808
next →1–100 of 2,689, ranked by callers