code
stringlengths
114
1.05M
path
stringlengths
3
312
quality_prob
float64
0.5
0.99
learning_prob
float64
0.2
1
filename
stringlengths
3
168
kind
stringclasses
1 value
__doc__ = """ SCons compatibility package for old Python versions This subpackage holds modules that provide backwards-compatible implementations of various things that we'd like to use in SCons but which only show up in later versions of Python than the early, old version(s) we still support. Other code will not ge...
/sc0ns-2.2.0-1.zip/sc0ns-2.2.0-1/SCons/compat/__init__.py
0.557002
0.346237
__init__.py
pypi
__revision__ = "src/engine/SCons/Scanner/Dir.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo" import SCons.Node.FS import SCons.Scanner def only_dirs(nodes): is_Dir = lambda n: isinstance(n.disambiguate(), SCons.Node.FS.Dir) return list(filter(is_Dir, nodes)) def DirScanner(**kw): """Return a ...
/sc0ns-2.2.0-1.zip/sc0ns-2.2.0-1/SCons/Scanner/Dir.py
0.607314
0.182845
Dir.py
pypi
# $Id: sc14n.py $ # $Date: 2019-12-28 20:53:00 $ # ************************** LICENSE ***************************************** # Copyright (C) 2017-19 David Ireland, DI Management Services Pty Limited. # <www.di-mgt.com.au> <www.cryptosys.net> # This code is provided 'as-is' without any express or implied warranty. #...
/sc14npy-2.1.1.zip/sc14npy-2.1.1/sc14n.py
0.749546
0.195249
sc14n.py
pypi
from typing import Tuple, Set, FrozenSet, Sequence, Generator from copy import deepcopy import itertools from .position import Point2, Size, Rect from .pixel_map import PixelMap from .player import Player from typing import List, Dict, Set, Tuple, Any, Optional, Union # mypy type checking class Ramp: def __init...
/sc2_X-1.0.4-py3-none-any.whl/sc2_X/game_info.py
0.850469
0.373019
game_info.py
pypi
import enum from s2clientprotocol import ( sc2_Xapi_pb2 as sc_pb, raw_pb2 as raw_pb, data_pb2 as data_pb, common_pb2 as common_pb, error_pb2 as error_pb ) from typing import List, Dict, Set, Tuple, Any, Optional, Union # mypy type checking from .ids.unit_typeid import UnitTypeId from .ids.ability_i...
/sc2_X-1.0.4-py3-none-any.whl/sc2_X/data.py
0.6137
0.222172
data.py
pypi
import random from .unit import Unit from .ids.unit_typeid import UnitTypeId from .position import Point2, Point3 from typing import List, Dict, Set, Tuple, Any, Optional, Union # mypy type checking class Units(list): """A collection for units. Makes it easy to select units by selectors.""" @classmethod d...
/sc2_X-1.0.4-py3-none-any.whl/sc2_X/units.py
0.900218
0.565359
units.py
pypi
from .data import PlayerType, Race, Difficulty from .bot_ai import BotAI class AbstractPlayer(object): def __init__(self, type, race=None, difficulty=None): assert isinstance(type, PlayerType) if type == PlayerType.Computer: assert isinstance(difficulty, Difficulty) elif type ...
/sc2_X-1.0.4-py3-none-any.whl/sc2_X/player.py
0.756358
0.359392
player.py
pypi
from functools import lru_cache, reduce from typing import List, Dict, Set, Tuple, Any, Optional, Union # mypy type checking from .data import Attribute, Race from .unit_command import UnitCommand from .ids.unit_typeid import UnitTypeId from .ids.ability_id import AbilityId from .constants import ZERGLING FREE_MORP...
/sc2_X-1.0.4-py3-none-any.whl/sc2_X/game_data.py
0.851119
0.399402
game_data.py
pypi
from s2clientprotocol import ( sc2_Xapi_pb2 as sc_pb, common_pb2 as common_pb, query_pb2 as query_pb, debug_pb2 as debug_pb, raw_pb2 as raw_pb, ) import logging from sc2_X.ids.ability_id import AbilityId from sc2_X.ids.unit_typeid import UnitTypeId logger = logging.getLogger(__name__) from .cach...
/sc2_X-1.0.4-py3-none-any.whl/sc2_X/client.py
0.73173
0.248249
client.py
pypi
from s2clientprotocol import sc2_Xapi_pb2 as sc_pb, raw_pb2 as raw_pb from sc2_X.ids.buff_id import BuffId from .position import Point2, Point3 from .data import Alliance, Attribute, DisplayType, warpgate_abilities, TargetType, Race, CloakState from .game_data import GameData from .ids.unit_typeid import UnitTypeId fr...
/sc2_X-1.0.4-py3-none-any.whl/sc2_X/unit.py
0.895762
0.511961
unit.py
pypi
from typing import Callable, Set, FrozenSet, List from .position import Point2 class PixelMap(object): def __init__(self, proto): self._proto = proto assert self.bits_per_pixel % 8 == 0, "Unsupported pixel density" assert self.width * self.height * self.bits_per_pixel / 8 == len(self._prot...
/sc2_X-1.0.4-py3-none-any.whl/sc2_X/pixel_map.py
0.735452
0.505615
pixel_map.py
pypi
class ScoreDetails(object): """ Accessable in self.state.score during step function For more information, see https://github.com/Blizzard/s2client-proto/blob/master/s2clientprotocol/score.proto """ def __init__(self, proto): self._data = proto self._proto = proto.score_details @prop...
/sc2_X-1.0.4-py3-none-any.whl/sc2_X/score.py
0.831143
0.30461
score.py
pypi
EXAMPLE_SYNTHETIC_REPLAYPACKS = [ ( "2022_TestReplaypack", "https://github.com/Kaszanas/SC2EGSet_Dataset/raw/main/tests/test_files/2022_TestReplaypack.zip", # noqa ) ] EXAMPLE_REAL_REPLAYPACKS = [ ( "2016_IEM_10_Taipei", "https://zenodo.org/record/6903505/files/2016_IEM_10_...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/available_replaypacks.py
0.537041
0.492859
available_replaypacks.py
pypi
from typing import Any, Dict from sc2_datasets.replay_parser.toon_player_desc_map.color import Color class ToonPlayerInfo: """ Specifies ToonPlayerInfo class representation :param nickname: Specifies player name in the game :type nickname: str :param playerID: Specifies player id number in the ...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/replay_parser/toon_player_desc_map/toon_player_info.py
0.933381
0.655477
toon_player_info.py
pypi
from typing import Any, Dict from sc2_datasets.replay_parser.init_data.game_description import GameDescription class InitData: """ Data type containing some "init data" information about StarCraft II game. :param gameDescription: Specifies the object that contains list of parameters which are descr...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/replay_parser/init_data/init_data.py
0.84228
0.447823
init_data.py
pypi
from typing import Any, Dict from sc2_datasets.replay_parser.init_data.game_options import GameOptions class GameDescription: """ GameDescription specifies an information about some basic parameters of a StarCraft II replay. :param gameOptions: Specifies options in the game,\ for example you can...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/replay_parser/init_data/game_description.py
0.847385
0.583915
game_description.py
pypi
from typing import Any, Dict class GameOptions: """ GameOptions represents the replay game options :param advancedSharedControl: Specifies if advanced shared control is enabled :type advancedSharedControl: bool :param amm: Specifies if AMM (AutoMM - Automated Match Making) is enabled :type am...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/replay_parser/init_data/game_options.py
0.902045
0.569015
game_options.py
pypi
from typing import Dict from sc2_datasets.replay_parser.tracker_events.events.player_setup import PlayerSetup from sc2_datasets.replay_parser.tracker_events.events.player_stats.player_stats import ( PlayerStats, ) from sc2_datasets.replay_parser.tracker_events.events.unit_born import UnitBorn from sc2_datasets.re...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/replay_parser/tracker_events/tracker_events_parser.py
0.819893
0.327158
tracker_events_parser.py
pypi
from typing import Dict from sc2_datasets.replay_parser.tracker_events.tracker_event import TrackerEvent class UnitBorn(TrackerEvent): """ UnitBorn is containing some "details" information about unit at the moment of it has appeared in the game :param controlPlayerId: Specifies the information abou...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/replay_parser/tracker_events/events/unit_born.py
0.924764
0.506836
unit_born.py
pypi
from typing import Dict from sc2_datasets.replay_parser.tracker_events.tracker_event import TrackerEvent class UnitDied(TrackerEvent): """ UnitDied is containing some "details" information about unit at the moment of it has died in the game :param id: Specifies the ID of an event which corresponds ...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/replay_parser/tracker_events/events/unit_died.py
0.9399
0.55263
unit_died.py
pypi
from typing import Dict from sc2_datasets.replay_parser.tracker_events.tracker_event import TrackerEvent class UnitOwnerChange(TrackerEvent): """ UnitOwnerChange holds some detail information about how the unit position was changing during the game. :param controlPlayerId: Specifies the information...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/replay_parser/tracker_events/events/unit_owner_change.py
0.906151
0.558327
unit_owner_change.py
pypi
from typing import Dict from sc2_datasets.replay_parser.tracker_events.tracker_event import TrackerEvent class UnitInit(TrackerEvent): """ UnitInit holds information about initializing object in the game :param controlPlayerId: Specifies the information about player id who made\ the unit in the gam...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/replay_parser/tracker_events/events/unit_init.py
0.9339
0.511717
unit_init.py
pypi
from typing import Dict from sc2_datasets.replay_parser.tracker_events.tracker_event import TrackerEvent class Stats(TrackerEvent): """ Stats holds specific fields on the economy of a player and is used in PlayerStats event. :param foodMade: Specifies the amount of supply that a player created.\ Thi...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/replay_parser/tracker_events/events/player_stats/stats.py
0.781997
0.592991
stats.py
pypi
from typing import Any, Dict class Header: """ Header represents the replay header parameters representation. :param elapsedGameLoops: Specifies how much game loops (game-engine ticks) the game lasted. :type elapsedGameLoops: int :param version: Specifies the game version that players have used t...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/replay_parser/header/header.py
0.953805
0.702109
header.py
pypi
from typing import Dict from sc2_datasets.replay_parser.game_events.events.camera_save import CameraSave from sc2_datasets.replay_parser.game_events.events.camera_update import CameraUpdate from sc2_datasets.replay_parser.game_events.events.cmd import Cmd from sc2_datasets.replay_parser.game_events.events.cmd_update_t...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/replay_parser/game_events/game_events_parser.py
0.817756
0.249299
game_events_parser.py
pypi
from typing import Dict from sc2_datasets.replay_parser.game_events.game_event import GameEvent class ControlGroupUpdate(GameEvent): """ ControlGroupUpdate is containing some "details" information about updates and changes player's control groups in the game. :param controlGroupIndex: Highly likely ...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/replay_parser/game_events/events/control_group_update.py
0.899262
0.475544
control_group_update.py
pypi
from types import NoneType from typing import Dict from sc2_datasets.replay_parser.game_events.game_event import GameEvent from sc2_datasets.replay_parser.game_events.events.nested.target_2d import Target2D class CameraUpdate(GameEvent): """ CameraUpdate represents the replay information about updated ca...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/replay_parser/game_events/events/camera_update.py
0.92948
0.592224
camera_update.py
pypi
from typing import Dict from sc2_datasets.replay_parser.game_events.game_event import GameEvent class UserOptions(GameEvent): """ UserOptions is containing some "details" information about player's settings, profiles, configuration in the game. :param baseBuildNum: Specifies a unique version number ...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/replay_parser/game_events/events/user_options.py
0.881283
0.530297
user_options.py
pypi
from typing import Dict from sc2_datasets.replay_parser.game_events.game_event import GameEvent from sc2_datasets.replay_parser.game_events.events.nested.target_2d import Target2D class CameraSave(GameEvent): """ CameraSave represents the replay information about saved camera in the game. :param id: Hig...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/replay_parser/game_events/events/camera_save.py
0.900207
0.518912
camera_save.py
pypi
from types import NoneType from typing import Dict from sc2_datasets.replay_parser.game_events.game_event import GameEvent # TODO: Can the sequence be an int here? # Should this be encoded somehow if there is a NoneType detected? class Cmd(GameEvent): """ Cmd is containing some "details" information about ...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/replay_parser/game_events/events/cmd.py
0.603114
0.478407
cmd.py
pypi
from types import NoneType from typing import Dict, List from sc2_datasets.replay_parser.game_events.game_event import GameEvent class AddSubgroups(GameEvent): """ AddSubgroups is a data type holding information about some subgroup change. We were not able to resolve its specific meaning. :param co...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/replay_parser/game_events/events/nested/delta.py
0.912993
0.394405
delta.py
pypi
from typing import Any, Dict class Details: """ Data type containing some "details" information about an StarCraft II game. :param gameSpeed: Game speed setting as set in the game options.\ Can be one of "slower", "slow", "normal", "fast", or "faster".\ Typically competitive or ranked games are p...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/replay_parser/details/details.py
0.927523
0.531696
details.py
pypi
from typing import Dict from sc2_datasets.replay_parser.message_events.message_event import MessageEvent class Chat(MessageEvent): """ Chat holds information about messages between players during the game :param id: Specifies id of the chat event :type id: int :param loop: Specifies game loop n...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/replay_parser/message_events/events/chat.py
0.896179
0.527682
chat.py
pypi
from typing import Dict, List import numpy as np # pylama:ignore=E501 from sc2_datasets.replay_parser.tracker_events.events.player_stats.player_stats import ( PlayerStats, ) from sc2_datasets.replay_data.sc2_replay_data import SC2ReplayData def filter_player_stats( sc2_replay: SC2ReplayData, ) -> Dict[str, ...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/transforms/utils.py
0.81626
0.627495
utils.py
pypi
from typing import Dict import pandas as pd from sc2_datasets.replay_data.sc2_replay_data import SC2ReplayData from sc2_datasets.transforms.pandas.player_stats_to_dict import ( playerstats_average_to_dict, ) from sc2_datasets.transforms.utils import select_apm_1v1, select_outcome_1v1 # REVIEW: Verify this: def...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/transforms/pandas/avg_playerstats_pd_dict.py
0.903503
0.547041
avg_playerstats_pd_dict.py
pypi
from typing import Any, List, Dict import pandas as pd from sc2_datasets.replay_data.sc2_replay_data import SC2ReplayData from sc2_datasets.transforms.utils import filter_player_stats # TODO: Document this: # TODO: Consider renaming: # REVIEW: Verify this code! def playerstats_average_to_dict(sc2_replay: SC2Replay...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/transforms/pandas/player_stats_to_dict.py
0.580471
0.68052
player_stats_to_dict.py
pypi
from typing import Any, Callable, Dict, List, Set, Tuple from torch.utils.data import Dataset from sc2_datasets.torch.datasets.sc2_replaypack_dataset import SC2ReplaypackDataset from sc2_datasets.replay_data.sc2_replay_data import SC2ReplayData class SC2Dataset(Dataset): """ Inherits from PyTorch Dataset an...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/torch/datasets/sc2_dataset.py
0.839175
0.525673
sc2_dataset.py
pypi
from pathlib import Path from typing import List, Set, Tuple from concurrent.futures import ProcessPoolExecutor from tqdm import tqdm import math from sc2_datasets.validators.validate_chunk import validate_chunk from sc2_datasets.validators.validator_utils import ( read_validation_file, save_validation_file,...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/validators/multiprocess_validator.py
0.806434
0.636925
multiprocess_validator.py
pypi
import logging from pathlib import Path from typing import Set, Tuple import json # TODO: consider splitting file creation out from this method def read_validation_file( path: Path, ) -> Tuple[Set[str], Set[str]]: """ Attempts to read the validation file from a specified path :param path: Specifies ...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/validators/validator_utils.py
0.552057
0.532425
validator_utils.py
pypi
from pathlib import Path from typing import List, Set, Tuple from sc2_datasets.validators.validate_chunk import validate_chunk from sc2_datasets.validators.validator_utils import ( read_validation_file, save_validation_file, ) # REVIEW: This function: # TODO: Add temporary files to be used as a validator fil...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/validators/singleprocess_validator.py
0.630571
0.68615
singleprocess_validator.py
pypi
import json import os from sc2_datasets.utils.zip_utils import unpack_zipfile from typing import Dict, Tuple def load_replaypack_information( replaypack_name: str, replaypack_path: str, unpack_n_workers: int, ) -> Tuple[str, Dict[str, str], Dict[str, str]]: """ Helper function that loads replayp...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/utils/dataset_utils.py
0.812793
0.228404
dataset_utils.py
pypi
import os import requests from sc2_datasets.utils.zip_utils import unpack_zipfile # REVIEW: This was changed, needs review: def download_replaypack( destination_dir: str, replaypack_name: str, replaypack_url: str ) -> str: """ Exposes logic for downloading a single StarCraft II replaypack from an url. ...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/utils/download_utils.py
0.844922
0.276349
download_utils.py
pypi
import logging import os import zipfile import math from concurrent.futures import ProcessPoolExecutor from typing import List from tqdm import tqdm # REVIEW: Check this: def unpack_chunk(zip_path: str, filenames: List[str], path_to_extract: str): """ Helper function for unpacking a chunk of files from an a...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/utils/zip_utils.py
0.809916
0.482429
zip_utils.py
pypi
from typing import Callable, List, Tuple from sc2_datasets.available_replaypacks import SC2EGSET_DATASET_REPLAYPACKS from sc2_datasets.lightning.datamodules.sc2_datamodule import SC2DataModule class SC2EGSetDataModule(SC2DataModule): """ Defines a LightningDataModule abstraction for the SC2EGSet: StarCr...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/lightning/sc2_egset_datamodule.py
0.913
0.514095
sc2_egset_datamodule.py
pypi
from typing import Callable, Optional import pytorch_lightning as pl from torch.utils.data import random_split from torch.utils.data.dataloader import DataLoader from sc2_datasets.torch.datasets.sc2_replaypack_dataset import SC2ReplaypackDataset class SC2ReplaypackDataModule(pl.LightningDataModule): """ Def...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/lightning/datamodules/sc2_replaypack_datamodule.py
0.928571
0.515315
sc2_replaypack_datamodule.py
pypi
from typing import Callable, List, Optional, Tuple import pytorch_lightning as pl from torch.utils.data import random_split from torch.utils.data.dataloader import DataLoader from sc2_datasets.torch.datasets.sc2_dataset import SC2Dataset class SC2DataModule(pl.LightningDataModule): """ Defines a LightningDa...
/sc2_datasets-1.0.2-py3-none-any.whl/sc2_datasets/lightning/datamodules/sc2_datamodule.py
0.936241
0.643931
sc2_datamodule.py
pypi
from collections import deque from typing import Any, Dict, FrozenSet, Generator, List, Optional, Sequence, Set, Tuple, Union from .pixel_map import PixelMap from .player import Player from .position import Point2, Rect, Size class Ramp: def __init__(self, points: Set[Point2], game_info: "GameInfo"): sel...
/sc2-env-0.11.1.2.tar.gz/sc2-env-0.11.1.2/sc2Env/game_info.py
0.822759
0.427755
game_info.py
pypi
import enum from s2clientprotocol import ( sc2api_pb2 as sc_pb, raw_pb2 as raw_pb, data_pb2 as data_pb, common_pb2 as common_pb, error_pb2 as error_pb ) from typing import List, Dict, Set, Tuple, Any, Optional, Union # mypy type checking from .ids.unit_typeid import UnitTypeId from .ids.ability_id ...
/sc2-env-0.11.1.2.tar.gz/sc2-env-0.11.1.2/sc2Env/data.py
0.617628
0.21892
data.py
pypi
import random from .unit import Unit from .ids.unit_typeid import UnitTypeId from .position import Point2, Point3 from typing import List, Dict, Set, Tuple, Any, Optional, Union # mypy type checking class Units(list): """A collection for units. Makes it easy to select units by selectors.""" @classmethod ...
/sc2-env-0.11.1.2.tar.gz/sc2-env-0.11.1.2/sc2Env/units.py
0.851429
0.448245
units.py
pypi
from .data import PlayerType, Race, Difficulty from .bot_ai import BotAI class AbstractPlayer: def __init__(self, p_type, race=None, name=None, difficulty=None): assert isinstance(p_type, PlayerType) assert name is None or isinstance(name, str) self.name = name if p_type == Player...
/sc2-env-0.11.1.2.tar.gz/sc2-env-0.11.1.2/sc2Env/player.py
0.717804
0.332351
player.py
pypi
from bisect import bisect_left from functools import lru_cache, reduce from typing import List, Dict, Set, Tuple, Any, Optional, Union # mypy type checking from .data import Attribute, Race from .unit_command import UnitCommand from .ids.unit_typeid import UnitTypeId from .ids.ability_id import AbilityId from .const...
/sc2-env-0.11.1.2.tar.gz/sc2-env-0.11.1.2/sc2Env/game_data.py
0.895981
0.450239
game_data.py
pypi
from typing import Any, Dict, List, Optional, Set, Tuple, Union # mypy type checking from sc2.ids.buff_id import BuffId from .cache import property_mutable_cache, property_immutable_cache from . import unit_command from .data import Alliance, Attribute, CloakState, DisplayType, Race, TargetType, warpgate_abilities f...
/sc2-env-0.11.1.2.tar.gz/sc2-env-0.11.1.2/sc2Env/unit.py
0.874788
0.275973
unit.py
pypi
from typing import Callable, Set, FrozenSet, List from .position import Point2 class PixelMap: def __init__(self, proto): self._proto = proto assert self.bits_per_pixel % 8 == 0, "Unsupported pixel density" assert self.width * self.height * self.bits_per_pixel / 8 == len(self._proto.data)...
/sc2-env-0.11.1.2.tar.gz/sc2-env-0.11.1.2/sc2Env/pixel_map.py
0.793066
0.513668
pixel_map.py
pypi
import logging from select import select from gym.spaces import Space from .bot_ai import BotAI logger = logging.getLogger(__name__) class Sc2Bot(BotAI): def __init__(self, runner_pipe, initializer, observer, actuator): ''' Sc2 bot launched in an other thread by Sc2Env. params: ...
/sc2-env-0.11.1.2.tar.gz/sc2-env-0.11.1.2/sc2Env/Sc2Bot.py
0.802865
0.333354
Sc2Bot.py
pypi
import datetime from s2clientprotocol import ( score_pb2 as score_pb, ) from sc2.position import Point2 class Renderer(object): def __init__(self, client, map_size, minimap_size) -> None: self._client = client self._window = None self._map_size = map_size self._map_image = ...
/sc2-env-0.11.1.2.tar.gz/sc2-env-0.11.1.2/sc2Env/renderer.py
0.657428
0.210644
renderer.py
pypi
class ScoreDetails: """ Accessable in self.state.score during step function For more information, see https://github.com/Blizzard/s2client-proto/blob/master/s2clientprotocol/score.proto """ def __init__(self, proto): self._data = proto self._proto = proto.score_details @property ...
/sc2-env-0.11.1.2.tar.gz/sc2-env-0.11.1.2/sc2Env/score.py
0.842831
0.339992
score.py
pypi
import sc2 from sc2 import Race from sc2.player import Bot from sc2.units import Units from sc2.unit import Unit from sc2.position import Point2, Point3 from sc2.ids.unit_typeid import UnitTypeId from sc2.ids.upgrade_id import UpgradeId from sc2.ids.buff_id import BuffId from sc2.ids.ability_id import AbilityId from...
/sc2-0.11.2.tar.gz/sc2-0.11.2/examples/arcade_bot.py
0.614625
0.382776
arcade_bot.py
pypi
from functools import reduce from operator import or_ import random import sc2 from sc2 import Race, Difficulty from sc2.constants import * from sc2.player import Bot, Computer from sc2.data import race_townhalls import enum class Hydralisk(sc2.BotAI): def select_target(self): if self.known_enemy_structu...
/sc2-0.11.2.tar.gz/sc2-0.11.2/examples/zerg/hydralisk_push.py
0.470007
0.232746
hydralisk_push.py
pypi
from functools import reduce from operator import or_ import random import sc2 from sc2 import Race, Difficulty from sc2.constants import * from sc2.player import Bot, Computer from sc2.data import race_townhalls import enum class BroodlordBot(sc2.BotAI): def select_target(self): if self.known_enemy_stru...
/sc2-0.11.2.tar.gz/sc2-0.11.2/examples/zerg/onebase_broodlord.py
0.459561
0.240574
onebase_broodlord.py
pypi
[![PyPI](https://img.shields.io/pypi/v/sc2gameLobby.svg)](https://pypi.org/project/sc2gameLobby/) [![Build Status](https://travis-ci.org/ttinies/sc2gameLobby.svg?branch=master)](https://travis-ci.org/ttinies/sc2gameLobby) [![Coverage Status](https://coveralls.io/repos/github/ttinies/sc2gameLobby/badge.svg?branch=master...
/sc2gameLobby-1.1.11.tar.gz/sc2gameLobby-1.1.11/README.md
0.462959
0.928279
README.md
pypi
[![PyPI](https://img.shields.io/pypi/v/sc2maptool.svg)](https://pypi.org/project/sc2maptool/) [![Build Status](https://travis-ci.org/ttinies/sc2gameMapRepo.svg?branch=master)](https://travis-ci.org/ttinies/sc2gameMapRepo) [![Coverage Status](https://coveralls.io/repos/github/ttinies/sc2gameMapRepo/badge.svg?branch=mast...
/sc2maptool-1.1.2.tar.gz/sc2maptool-1.1.2/README.md
0.9189
0.781539
README.md
pypi
import enum from sc2 import Race from sc2.player import Bot from sc2rl.environments.EnvironmentBase import SC2EnvironmentBase from sc2rl.environments.SC2BotAI import SimpleSC2BotAI from sc2rl.utils.sc2_utils import get_random_action VERY_LARGE_NUMBER = 1e10 class Status(enum.Enum): RUNNING = 0 END = 1 clas...
/environments/MicroTestEnvironment.py
0.662796
0.317797
MicroTestEnvironment.py
pypi
[![PyPI](https://img.shields.io/pypi/v/sc2simulator.svg)](https://pypi.org/project/sc2simulator/) [![Build Status](https://travis-ci.org/ttinies/sc2simulator.svg?branch=master)](https://travis-ci.org/ttinies/sc2simulator) [![Coverage Status](https://coveralls.io/repos/github/ttinies/sc2simulator/badge.svg?branch=master...
/sc2simulator-0.8.2.tar.gz/sc2simulator-0.8.2/README.md
0.864382
0.952131
README.md
pypi
import spotipy from spotipy.oauth2 import SpotifyClientCredentials # spotify api cid = '591812685f3f4a16bac164011f7f3e33' secret = 'cec92bbc981b41d49fc7dadcbce0d0f6' class SpotipyObj(): def __init__(self, cid=cid, secret=secret): self.cid = cid self.secret = secret def sp(self): c...
/sc3mylibrary-1.0.0-py3-none-any.whl/lib/get_myplaylist_api.py
0.510008
0.231343
get_myplaylist_api.py
pypi
## Helper functions ``` import numpy as np import matplotlib.pyplot as plt %matplotlib inline import sc3nb as scn ``` * SuperCollider coders are familiar and frequently use a number of useful converter functions * the helper functions provide pythonic pendants namely currently for (to be extended): ### `linlin(x, ...
/sc3nb-1.1.0.tar.gz/sc3nb-1.1.0/examples/helper-examples.ipynb
0.428233
0.922761
helper-examples.ipynb
pypi
``` # header / imports import numpy as np import matplotlib.pyplot as plt %matplotlib inline import sc3nb as scn from sc3nb import Buffer example_file = "../media/blip.wav" sc = scn.startup() ``` # Buffer Buffer is the Python class in sc3nb to interface with Buffers on the SuperCollider server. ``` # uncomment f...
/sc3nb-1.1.0.tar.gz/sc3nb-1.1.0/examples/supercollider-objects/buffer-examples.ipynb
0.738763
0.887058
buffer-examples.ipynb
pypi
|PyPI| |travis| |Docs| scArches (PyTorch) - single-cell architecture surgery ========================================================================= .. raw:: html <img src="https://user-images.githubusercontent.com/33202701/89729020-15f7c200-da32-11ea-989b-1b9a3283f642.png" width="700px" align="center"> scArches ...
/scArches-0.5.9.tar.gz/scArches-0.5.9/docs/about.rst
0.931001
0.865906
about.rst
pypi
from collections import Counter import numpy as np import torch from torch.utils.data import Dataset from scipy import sparse from ._utils import label_encoder, remove_sparsity class MultiConditionAnnotatedDataset(Dataset): """Dataset handler for scPoli model and trainer. Parameters ---------- ...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/dataset/scpoli/anndata.py
0.928627
0.486575
anndata.py
pypi
from collections import Counter import numpy as np import torch from torch.utils.data import Dataset from scipy import sparse from .data_handling import remove_sparsity from ._utils import label_encoder class AnnotatedDataset(Dataset): """Dataset handler for TRVAE model and trainer. Parameters ---...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/dataset/trvae/anndata.py
0.933408
0.485478
anndata.py
pypi
import inspect import os import torch import pickle import numpy as np from copy import deepcopy from anndata import AnnData, read from typing import Optional, Union from torch.distributions import Normal from scipy.sparse import issparse from ._utils import _validate_var_names class BaseMixin: """ Adapted from...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/models/base/_base.py
0.863204
0.24495
_base.py
pypi
import inspect import os import torch import pickle import numpy as np import pandas as pd from anndata import AnnData, read from copy import deepcopy from typing import Optional, Union from .expimap import expiMap from ...trainers import expiMapTrainer from ..base._utils import _validate_var_names from ..base._base ...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/models/expimap/expimap_model.py
0.902888
0.418222
expimap_model.py
pypi
import torch import torch.nn as nn import numpy as np from typing import Optional from ..trvae._utils import one_hot_encoder class MaskedLinear(nn.Linear): def __init__(self, n_in, n_out, mask, bias=True): # mask should have the same dimensions as the transposed linear weight # n_input x n_outpu...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/models/expimap/modules.py
0.918781
0.433562
modules.py
pypi
from typing import Optional import torch import torch.nn as nn from torch.distributions import Normal, kl_divergence import torch.nn.functional as F from .modules import MaskedLinearDecoder, ExtEncoder from ..trvae.losses import mse, nb from .losses import hsic from ..trvae._utils import one_hot_encoder from ..base._...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/models/expimap/expimap.py
0.932199
0.575111
expimap.py
pypi
import torch import torch.nn as nn class Encoder(nn.Module): """ Constructs the encoder sub-network of VAE. This class implements the encoder part of Variational Auto-encoder. It will transform primary data in the `n_vars` dimension-space to means and log variances of `z_dimension` latent space. ...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/models/scgen/modules.py
0.924993
0.581719
modules.py
pypi
import torch import torch.nn as nn from torch.nn import functional as F import numpy as np from scipy import sparse import scanpy as sc import anndata from .modules import Encoder, Decoder from ._utils import balancer, extractor class vaeArith(nn.Module): """ScArches model class. This class contains the impleme...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/models/scgen/vaearith.py
0.952309
0.72708
vaearith.py
pypi
import torch import numpy as np from anndata import AnnData from typing import Optional, Union from .vaearith import vaeArith from ...trainers import vaeArithTrainer from ..base._utils import _validate_var_names from ..base._base import BaseMixin class scgen(BaseMixin): """Model for scArches class. This class c...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/models/scgen/vaearith_model.py
0.940633
0.627937
vaearith_model.py
pypi
import anndata import numpy as np from scipy import sparse import logging logger = logging.getLogger(__name__) def extractor(data, cell_type, conditions, cell_type_key="cell_type", condition_key="condition"): """ Returns a list of `data` files while filtering for a specific `cell_type`. Parameters -...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/models/scgen/_utils.py
0.874694
0.554712
_utils.py
pypi
import warnings import os import csv import numpy as np from sklearn.metrics import * from sklearn.covariance import GraphicalLassoCV, graphical_lasso, LedoitWolf from sklearn.preprocessing import StandardScaler import torch import torch_geometric.nn as pyg_nn import torch_geometric.data as geo_dt from sklearn.utils....
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/models/sagenet/utils.py
0.878497
0.662128
utils.py
pypi
from .utils import * from .classifier import Classifier from .model import * from os import listdir import numpy as np import anndata import re class sagenet(): """ A `sagenet` object. Parameters ---------- device : str, default = 'cpu' the processing unit to be...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/models/sagenet/sagenet.py
0.746046
0.46642
sagenet.py
pypi
import warnings import torch import torch.nn as nn import torch.nn.functional as F import torch_geometric.nn as pyg_nn class NN(nn.Module): def __init__(self, \ n_features, \ n_classes, \ n_hidden_GNN=[], \ n_hidden_FC=[10], \ dropout_GNN=0, \ dropout_FC=0): ...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/models/sagenet/model.py
0.810216
0.366335
model.py
pypi
import torch import torch.nn as nn import torch.nn.functional as F from torch.distributions import Normal, kl_divergence from ._utils import one_hot_encoder from ..trvae.losses import mse, nb, zinb, bce, poisson, nb_dist from ...trainers.scpoli._utils import cov class scpoli(nn.Module): def __init__( self...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/models/scpoli/scpoli.py
0.91384
0.360855
scpoli.py
pypi
from scvi.distributions import NegativeBinomial import torch from torch.autograd import Variable from torch.distributions import Poisson import torch.nn.functional as F from ._utils import partition def bce(recon_x, x): """Computes BCE loss between reconstructed data and ground truth data. Parameters ...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/models/trvae/losses.py
0.954764
0.853547
losses.py
pypi
import torch import torch.nn as nn from ._utils import one_hot_encoder class CondLayers(nn.Module): def __init__( self, n_in: int, n_out: int, n_cond: int, bias: bool, ): super().__init__() self.n_cond = n_cond self.expr_L = ...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/models/trvae/modules.py
0.937139
0.472866
modules.py
pypi
import os import numpy as np import torch import pickle from typing import Optional, Union from copy import deepcopy from .trvae_model import TRVAE class Adaptor: """Adaptor class for trVAE. Allows to save and load trainded conditional weights for trVAE models. Parameters ---------- t...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/models/trvae/adaptors.py
0.878079
0.365825
adaptors.py
pypi
from typing import Optional import torch import torch.nn as nn from torch.distributions import Normal, kl_divergence import torch.nn.functional as F from .modules import Encoder, Decoder from .losses import mse, mmd, zinb, nb from ._utils import one_hot_encoder from ..base._base import CVAELatentsModelMixin class t...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/models/trvae/trvae.py
0.966418
0.595757
trvae.py
pypi
import inspect import os import torch import pickle import numpy as np from anndata import AnnData, read from copy import deepcopy from typing import Optional, Union from .trvae import trVAE from ...trainers.trvae.unsupervised import trVAETrainer from ..base._utils import _validate_var_names from ..base._base import ...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/models/trvae/trvae_model.py
0.909601
0.488832
trvae_model.py
pypi
import numpy as np import torch import anndata from ..models.trvae.trvae import trVAE from ..trainers.trvae.unsupervised import trVAETrainer def trvae_operate( network: trVAE, data: anndata, condition_key: str = None, size_factor_key: str = None, n_epochs: int = 20, fr...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/surgery/trvae.py
0.808446
0.579162
trvae.py
pypi
import os import requests def download_file(link: str, save_path: str = None, make_dir: bool = False ): """Downloads the file in the ``link`` and saves it in ``save_path``. Parameters ---------- link: str Direct downloadab...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/zenodo/file.py
0.628179
0.166438
file.py
pypi
from typing import Union from ..models import TRVAE, SCVI, SCANVI, TOTALVI from .file import * from .deposition import * from .zip import * def upload_model(model: Union[TRVAE, SCVI, SCANVI, TOTALVI, str], deposition_id: str, access_token: str, model_name: str = Non...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/zenodo/__init__.py
0.836521
0.16492
__init__.py
pypi
import json import requests def create_deposition(access_token: str, upload_type: str, title: str, description: str, **kwargs): """Creates a deposition in your Zenodo account. Parameters ---------- acc...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/zenodo/deposition.py
0.628863
0.174551
deposition.py
pypi
import numpy as np class EarlyStopping(object): """Class for EarlyStopping. This class contains the implementation of early stopping for TRVAE/CVAE training. This early stopping class was inspired by: Title: scvi-tools Authors: Romain Lopez <romain_lopez@gmail.com>, Adam Gayo...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/utils/monitor.py
0.907661
0.534612
monitor.py
pypi
import scanpy as sc import pandas as pd import os import numpy as np import anndata from sklearn.neighbors import KNeighborsTransformer #These function were created by Lisa Sikemma def weighted_knn_trainer(train_adata, train_adata_emb, n_neighbors=50): """Trains a weighted KNN classifier on ``train_adata``. P...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/utils/knn.py
0.868255
0.579609
knn.py
pypi
import scanpy as sc import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from ..dataset import remove_sparsity def opt_louvain(adata, label_key, cluster_key, function=None, resolutions=None, inplace=True, plot=False, verbose=True, **kwargs): """ This Louvain Clustering ...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/metrics/clustering.py
0.788176
0.490907
clustering.py
pypi
import numpy as np import pandas as pd from scipy.stats import entropy from sklearn.metrics import silhouette_score, normalized_mutual_info_score, silhouette_samples from sklearn.neighbors import NearestNeighbors from sklearn.preprocessing import LabelEncoder from ..dataset import remove_sparsity from .clustering impo...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/metrics/metrics.py
0.92211
0.646976
metrics.py
pypi
from itertools import product import numpy as np import matplotlib.pyplot as plt from typing import Union def plot_abs_bfs_key(scores, terms, key, n_points=30, lim_val=2.3, fontsize=8, scale_y=2, yt_step=0.3, title=None, ax=None): txt_args = dict( rotation='vertical', verticala...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/plotting/terms_scores.py
0.859103
0.359378
terms_scores.py
pypi
from ..metrics.metrics import entropy_batch_mixing, knn_purity, asw, nmi from ..models import SCVI, SCANVI, TOTALVI from scipy.sparse import issparse import numpy as np import scanpy as sc import torch from typing import Union, Optional from sklearn.metrics import f1_score import anndata import matplotlib.pyplot as pl...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/plotting/scvi_eval.py
0.80502
0.237985
scvi_eval.py
pypi
import numpy as np import scanpy as sc import torch import anndata import matplotlib.pyplot as plt from typing import Union from ..dataset.trvae._utils import label_encoder from ..metrics.metrics import entropy_batch_mixing, knn_purity, asw, nmi from ..models import trVAE, TRVAE from ..trainers import trVAETrainer sc...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/plotting/trvae_eval.py
0.789599
0.330674
trvae_eval.py
pypi
from ..trvae.unsupervised import trVAETrainer import torch import sys class ProxGroupLasso: def __init__(self, alpha, omega=None, inplace=True): # omega - vector of coefficients with size # equal to the number of groups if omega is None: self._group_coeff = alpha else: ...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/trainers/expimap/regularized.py
0.716219
0.554531
regularized.py
pypi
import torch from scipy import sparse from anndata import AnnData from collections import defaultdict from ._utils import shuffle_adata, print_progress from ...utils.monitor import EarlyStopping class vaeArithTrainer: """ This class contains the implementation of the VAEARITH Trainer Parameters ----...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/trainers/scgen/trainer.py
0.857201
0.621656
trainer.py
pypi
from random import shuffle import sys import anndata import numpy as np from scipy import sparse from sklearn import preprocessing def print_progress(epoch, logs, n_epochs=10000): """Creates Message for '_print_progress_bar'. Parameters ---------- epoch: Integer Current epoch ite...
/scArches-0.5.9.tar.gz/scArches-0.5.9/scarches/trainers/scgen/_utils.py
0.721351
0.380759
_utils.py
pypi