Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/GoodStartLabs/AI_Diplomacy
/ functions
Functions
2,689 in github.com/GoodStartLabs/AI_Diplomacy
⨍
Functions
2,689
◇
Types & classes
474
↓ 896 callers
Method
owner_name
Retrieves owner name
diplomacy/tests/test_datc.py:80
↓ 742 callers
Method
check_results
Checks adjudication results
diplomacy/tests/test_datc.py:89
↓ 551 callers
Method
get
Return value associated with key, or default value if key not found.
diplomacy/utils/sorted_dict.py:100
↓ 450 callers
Method
append
(value)
diplomacy/web/src/diplomacy/utils/queue.js:28
↓ 361 callers
Method
set_orders
Submit orders
diplomacy/tests/test_datc.py:57
↓ 343 callers
Method
set_units
Sets units on the map
diplomacy/tests/test_datc.py:47
↓ 298 callers
Method
join
Return the joined parts
diplomacy/utils/splitter.py:51
↓ 220 callers
Method
items
Get an iterator to the items in the dict.
diplomacy/utils/sorted_dict.py:150
↓ 216 callers
Function
register_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 callers
Function
str_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 callers
Method
info
(message)
diplomacy/web/src/gui/pages/page.jsx:179
↓ 180 callers
Method
process
Processes the game
diplomacy/tests/test_datc.py:62
↓ 164 callers
Method
create_game
Creates a game object
diplomacy/tests/test_datc.py:32
↓ 163 callers
Method
clear_units
Clears units
diplomacy/tests/test_datc.py:37
↓ 163 callers
Method
values
Get an iterator to the values in the dict.
diplomacy/utils/sorted_dict.py:142
↓ 105 callers
Method
error
(self, msg)
experiment_runner.py:271
↓ 99 callers
Method
error
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 callers
Function
check_dislodged
Checks if a unit has been dislodged
diplomacy/tests/test_datc.py:5461
↓ 96 callers
Method
add
Add an element.
diplomacy/utils/sorted_set.py:96
↓ 93 callers
Method
remove
Remove and return element.
diplomacy/utils/sorted_set.py:141
↓ 86 callers
Method
get_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 callers
Method
from_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 callers
Method
set_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 callers
Method
pop
Remove and return value at given index.
diplomacy/utils/sorted_set.py:137
↓ 63 callers
Function
add_parentheses
Add parentheses to a list of bytes
diplomacy/daide/clauses.py:56
↓ 58 callers
Function
parse_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 callers
Function
parse_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 callers
Method
get_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 callers
Method
keys
Get an iterator to the keys in the dict.
diplomacy/utils/sorted_dict.py:138
↓ 51 callers
Method
get_current_phase
Returns the current phase (format 'S1901M' or 'FORMING' or 'COMPLETED')
diplomacy/engine/game.py:916
↓ 50 callers
Method
setdefault
Sets a default for a given key
diplomacy/utils/priority_dict.py:86
↓ 49 callers
Method
to_string
Returns the string representation of the order
diplomacy/integration/webdiplomacy_net/orders.py:657
↓ 45 callers
Method
keys
()
diplomacy/web/src/diplomacy/utils/sorted_dict.js:102
↓ 45 callers
Method
to_dict
Returns the dictionary representation of the order
diplomacy/integration/webdiplomacy_net/orders.py:674
↓ 44 callers
Function
compare_dicts
Checks if two dictionaries are equal
diplomacy/integration/webdiplomacy_net/tests/test_orders.py:20
↓ 44 callers
Method
set_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 callers
Method
sub
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 callers
Method
update_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 callers
Method
format
Format the message of the result
diplomacy/utils/common.py:280
↓ 43 callers
Method
values
()
diplomacy/web/src/diplomacy/utils/sorted_dict.js:106
↓ 40 callers
Method
area_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 callers
Function
_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 callers
Method
is_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 callers
Method
_req
(name, forcedParameters, localChannelFunction, parameters, game)
diplomacy/web/src/diplomacy/client/channel.js:42
↓ 36 callers
Method
set
(error)
diplomacy/web/src/diplomacy/utils/future_event.js:25
↓ 34 callers
Method
_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 callers
Function
assert_raises
Checks that given callback raises given exceptions.
diplomacy/utils/tests/test_common.py:22
↓ 32 callers
Method
process
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 callers
Method
copy
Return a copy of this sorted dict.
diplomacy/utils/sorted_dict.py:265
↓ 30 callers
Method
put
Add a key with a value to the dict.
diplomacy/utils/sorted_dict.py:104
↓ 30 callers
Method
warn
(message)
diplomacy/web/src/gui/pages/page.jsx:191
↓ 29 callers
Function
_attr
Shorthand method to retrieve an XML attribute
diplomacy/engine/renderer.py:35
↓ 29 callers
Method
getPage
* Return current page object displaying this content. * @returns {Page}
diplomacy/web/src/gui/pages/content_game.jsx:238
↓ 29 callers
Function
verify_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 callers
Method
clear_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 callers
Method
is_eliminated
Returns a flag to show if player is eliminated :return: If the current power is eliminated
diplomacy/engine/power.py:305
↓ 27 callers
Method
update
(self, element)
diplomacy/utils/parsing.py:417
↓ 25 callers
Method
__init__
(self, **kwargs)
diplomacy/communication/requests.py:843
↓ 25 callers
Method
clear
Remove all items from set.
diplomacy/utils/sorted_set.py:159
↓ 25 callers
Method
from_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 callers
Method
contains
(key)
diplomacy/web/src/diplomacy/utils/sorted_dict.js:63
↓ 24 callers
Method
getProvince
(abbr)
diplomacy/web/src/gui/utils/map_data.js:79
↓ 24 callers
Method
load
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 callers
Method
setState
(state)
diplomacy/web/src/gui/pages/content_game.jsx:226
↓ 24 callers
Method
to_dict
Convert this object to a python dictionary ready for any JSON work. :return: dict
diplomacy/utils/jsonable.py:91
↓ 23 callers
Method
error
(message)
diplomacy/web/src/gui/pages/page.jsx:173
↓ 22 callers
Method
_req
(channelMethod, parameters)
diplomacy/web/src/diplomacy/client/network_game.js:57
↓ 22 callers
Method
close
Close the aiohttp session.
ai_diplomacy/clients.py:1072
↓ 22 callers
Method
last_value
Get the value associated to highest key in the dict.
diplomacy/utils/sorted_dict.py:130
↓ 22 callers
Method
phase_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 callers
Method
set_centers
Transfers SC ownership to power
diplomacy/tests/test_datc.py:52
↓ 22 callers
Method
vet
Determines the type of every word in a compacted order phrase 0 - Undetermined, 1 - Power, 2 - Unit,
diplomacy/engine/map.py:941
↓ 21 callers
Function
_game_request_method
Create a game request method that calls channel counterpart.
diplomacy/client/network_game.py:27
↓ 21 callers
Method
clear_centers
Clears supply centers
diplomacy/tests/test_datc.py:42
↓ 21 callers
Method
index
Return index of element in the set, or None if element is not in the set.
diplomacy/utils/sorted_set.py:150
↓ 21 callers
Method
move_to_phase
Move to a specific phase
diplomacy/tests/test_datc.py:162
↓ 21 callers
Method
parse_bytes
Builds the request from DAIDE bytes
diplomacy/daide/requests.py:156
↓ 20 callers
Method
abuts
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 callers
Function
getPowerDisplayName
(power: PowerENUM | string)
ai_animation/src/utils/powerNames.ts:12
↓ 20 callers
Method
setState
(state)
diplomacy/web/src/gui/pages/page.jsx:76
↓ 20 callers
Function
str_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 callers
Function
strip_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 callers
Function
load_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 callers
Method
save_game
Update on-memory version of given server game. :param server_game: server game :type server_game: ServerGame
diplomacy/server/server.py:547
↓ 19 callers
Method
update
* Update the event queue, triggering events that are ready
ai_animation/src/events.ts:91
↓ 18 callers
Method
get_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 callers
Method
phase_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 callers
Method
validate
(self, element)
diplomacy/utils/parsing.py:410
↓ 17 callers
Method
__init__
Builds the response :param response_bytes: The bytes received for the request
diplomacy/daide/responses.py:763
↓ 17 callers
Function
break_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 callers
Method
has_power
Return True if this game has given power name.
diplomacy/engine/game.py:556
↓ 16 callers
Method
_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 callers
Function
_callback_clearing_method
Create a callback clearing method for a given notification class.
diplomacy/client/network_game.py:61
↓ 16 callers
Function
_callback_setting_method
Create a callback setting method for a given notification class.
diplomacy/client/network_game.py:47
↓ 16 callers
Method
addCallback
(notificationName, notificationCallback)
diplomacy/web/src/diplomacy/client/network_game.js:34
↓ 16 callers
Method
clearCallbacks
(notificationName)
diplomacy/web/src/diplomacy/client/network_game.js:41
↓ 16 callers
Method
compare_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 callers
Method
get_name
Return username of given token.
diplomacy/server/users.py:118
↓ 16 callers
Method
isPlayerGame
(powerName)
diplomacy/web/src/diplomacy/engine/game.js:296
↓ 15 callers
Method
format_power_with_model
Format power name with model in parentheses
analyze_game_moments.py:808
next →
1–100 of 2,689, ranked by callers