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
52c35bfa96373e0097a83024a12f495f534734a1f3524692f1e068aac40e1c6f
@property def x_min(self): 'Getter method for x_min' return self._x_min
Getter method for x_min
src/rectangle.py
x_min
arobey1/RobustNN
0
python
@property def x_min(self): return self._x_min
@property def x_min(self): return self._x_min<|docstring|>Getter method for x_min<|endoftext|>
8a306f6775dca3a125eccd33aaf8836584365f636b0f64865ae303d80ff738a3
@property def x_max(self): 'Getter method for x_max' return self._x_max
Getter method for x_max
src/rectangle.py
x_max
arobey1/RobustNN
0
python
@property def x_max(self): return self._x_max
@property def x_max(self): return self._x_max<|docstring|>Getter method for x_max<|endoftext|>
0984750c8be37bd017309bd04f3a23868ec30f35d03cb0f1efbbee899c2e4935
@cmd_bp.cli.command('update') def _update(): 'Download employer and job summary list' source.fetch_all()
Download employer and job summary list
itviec/cmd_views.py
_update
josepgl/itviec
0
python
@cmd_bp.cli.command('update') def _update(): source.fetch_all()
@cmd_bp.cli.command('update') def _update(): source.fetch_all()<|docstring|>Download employer and job summary list<|endoftext|>
a93bf53ad889000d5df4af382683b2f041f77b43623e88ccf38f4af8ca3a31ae
@cmd_bp.cli.command('load') def _load(): 'Load employers from newest jobs to oldest' for emp_code in source.get_employers_with_jobs(): print('# Employer: {}'.format(emp_code)) employer = compose_employer(emp_code) db.session.add(employer) db.session.commit()
Load employers from newest jobs to oldest
itviec/cmd_views.py
_load
josepgl/itviec
0
python
@cmd_bp.cli.command('load') def _load(): for emp_code in source.get_employers_with_jobs(): print('# Employer: {}'.format(emp_code)) employer = compose_employer(emp_code) db.session.add(employer) db.session.commit()
@cmd_bp.cli.command('load') def _load(): for emp_code in source.get_employers_with_jobs(): print('# Employer: {}'.format(emp_code)) employer = compose_employer(emp_code) db.session.add(employer) db.session.commit()<|docstring|>Load employers from newest jobs to oldest<|endoftext...
84568fc2162dd1135d2c0b29b00291db9d899f3ba59fbb21eeb24aa2626043d1
@property def accuracy(self) -> float: "\n :return: The move's accuracy (0 to 1 scale).\n :rtype: float\n " accuracy = self.entry['accuracy'] if (accuracy is True): return 1.0 return (accuracy / 100)
:return: The move's accuracy (0 to 1 scale). :rtype: float
src/poke_env/environment/move.py
accuracy
Jay2645/poke-env
0
python
@property def accuracy(self) -> float: "\n :return: The move's accuracy (0 to 1 scale).\n :rtype: float\n " accuracy = self.entry['accuracy'] if (accuracy is True): return 1.0 return (accuracy / 100)
@property def accuracy(self) -> float: "\n :return: The move's accuracy (0 to 1 scale).\n :rtype: float\n " accuracy = self.entry['accuracy'] if (accuracy is True): return 1.0 return (accuracy / 100)<|docstring|>:return: The move's accuracy (0 to 1 scale). :rtype: float<|end...
b10fd5b6a6192cf7c7e010da854fd430366d04ed3fbabdee570c72e976960d80
@property def base_power(self) -> int: "\n :return: The move's base power.\n :rtype: int\n " return self.entry.get('basePower', 0)
:return: The move's base power. :rtype: int
src/poke_env/environment/move.py
base_power
Jay2645/poke-env
0
python
@property def base_power(self) -> int: "\n :return: The move's base power.\n :rtype: int\n " return self.entry.get('basePower', 0)
@property def base_power(self) -> int: "\n :return: The move's base power.\n :rtype: int\n " return self.entry.get('basePower', 0)<|docstring|>:return: The move's base power. :rtype: int<|endoftext|>
a7a8d4ec67559d17b58003edc6f4c74d7953b062df99875b55ebd81a7c0a7b3c
@property def boosts(self) -> Optional[Dict[(str, float)]]: '\n :return: Boosts conferred to the target by using the move.\n :rtype: Optional[Dict[str, float]]\n ' return self.entry.get('boosts', None)
:return: Boosts conferred to the target by using the move. :rtype: Optional[Dict[str, float]]
src/poke_env/environment/move.py
boosts
Jay2645/poke-env
0
python
@property def boosts(self) -> Optional[Dict[(str, float)]]: '\n :return: Boosts conferred to the target by using the move.\n :rtype: Optional[Dict[str, float]]\n ' return self.entry.get('boosts', None)
@property def boosts(self) -> Optional[Dict[(str, float)]]: '\n :return: Boosts conferred to the target by using the move.\n :rtype: Optional[Dict[str, float]]\n ' return self.entry.get('boosts', None)<|docstring|>:return: Boosts conferred to the target by using the move. :rtype: Optional[D...
39114474ee1b780b3a1c8cbf0151725325f60c6ad2650e54e31bb6d33a686fca
@property def breaks_protect(self) -> bool: '\n :return: Whether the move breaks proect-like defenses.\n :rtype: bool\n ' return self.entry.get('breaksProtect', False)
:return: Whether the move breaks proect-like defenses. :rtype: bool
src/poke_env/environment/move.py
breaks_protect
Jay2645/poke-env
0
python
@property def breaks_protect(self) -> bool: '\n :return: Whether the move breaks proect-like defenses.\n :rtype: bool\n ' return self.entry.get('breaksProtect', False)
@property def breaks_protect(self) -> bool: '\n :return: Whether the move breaks proect-like defenses.\n :rtype: bool\n ' return self.entry.get('breaksProtect', False)<|docstring|>:return: Whether the move breaks proect-like defenses. :rtype: bool<|endoftext|>
2156f2bd444cc40e927833894d58a98b35f563e123653b3cca900c4a31a57411
@property def can_z_move(self) -> bool: '\n :return: Wheter there exist a z-move version of this move.\n :rtype: bool\n ' return (self.id not in SPECIAL_MOVES)
:return: Wheter there exist a z-move version of this move. :rtype: bool
src/poke_env/environment/move.py
can_z_move
Jay2645/poke-env
0
python
@property def can_z_move(self) -> bool: '\n :return: Wheter there exist a z-move version of this move.\n :rtype: bool\n ' return (self.id not in SPECIAL_MOVES)
@property def can_z_move(self) -> bool: '\n :return: Wheter there exist a z-move version of this move.\n :rtype: bool\n ' return (self.id not in SPECIAL_MOVES)<|docstring|>:return: Wheter there exist a z-move version of this move. :rtype: bool<|endoftext|>
05f1706274f0cf4fd22d94db57c6451e48d73590b28fa41ae04bedaec77e34e9
@property def category(self) -> MoveCategory: '\n :return: The move category.\n :rtype: MoveCategory\n ' return MoveCategory[self.entry['category'].upper()]
:return: The move category. :rtype: MoveCategory
src/poke_env/environment/move.py
category
Jay2645/poke-env
0
python
@property def category(self) -> MoveCategory: '\n :return: The move category.\n :rtype: MoveCategory\n ' return MoveCategory[self.entry['category'].upper()]
@property def category(self) -> MoveCategory: '\n :return: The move category.\n :rtype: MoveCategory\n ' return MoveCategory[self.entry['category'].upper()]<|docstring|>:return: The move category. :rtype: MoveCategory<|endoftext|>
9ba92cf1153892dba5ee89c652d679e3a99f8d58c71eee17051d915327596d1f
@property def crit_ratio(self) -> int: "\n :return: The move's crit ratio. If the move is guaranteed to crit, returns 6.\n :rtype:\n " if ('critRatio' in self.entry): return int(self.entry['critRatio']) elif ('willCrit' in self.entry): return 6 return 0
:return: The move's crit ratio. If the move is guaranteed to crit, returns 6. :rtype:
src/poke_env/environment/move.py
crit_ratio
Jay2645/poke-env
0
python
@property def crit_ratio(self) -> int: "\n :return: The move's crit ratio. If the move is guaranteed to crit, returns 6.\n :rtype:\n " if ('critRatio' in self.entry): return int(self.entry['critRatio']) elif ('willCrit' in self.entry): return 6 return 0
@property def crit_ratio(self) -> int: "\n :return: The move's crit ratio. If the move is guaranteed to crit, returns 6.\n :rtype:\n " if ('critRatio' in self.entry): return int(self.entry['critRatio']) elif ('willCrit' in self.entry): return 6 return 0<|docstring|>:...
3341f45d287212a7fdebb04e46dc2fd9670ee6e8a0412fc053ca2957fd55b134
@property def current_pp(self) -> int: '\n :return: Remaining PP.\n :rtype: int\n ' return self._current_pp
:return: Remaining PP. :rtype: int
src/poke_env/environment/move.py
current_pp
Jay2645/poke-env
0
python
@property def current_pp(self) -> int: '\n :return: Remaining PP.\n :rtype: int\n ' return self._current_pp
@property def current_pp(self) -> int: '\n :return: Remaining PP.\n :rtype: int\n ' return self._current_pp<|docstring|>:return: Remaining PP. :rtype: int<|endoftext|>
23833d987058e558852864f37ac6f63d68fa9351f6911c4a803bf583469b2a1c
@property def damage(self) -> Union[(int, str)]: "\n :return: The move's fix damages. Can be an int or 'level' for moves such as\n Seismic Toss.\n :rtype: Union[int, str]\n " return self.entry.get('damage', 0)
:return: The move's fix damages. Can be an int or 'level' for moves such as Seismic Toss. :rtype: Union[int, str]
src/poke_env/environment/move.py
damage
Jay2645/poke-env
0
python
@property def damage(self) -> Union[(int, str)]: "\n :return: The move's fix damages. Can be an int or 'level' for moves such as\n Seismic Toss.\n :rtype: Union[int, str]\n " return self.entry.get('damage', 0)
@property def damage(self) -> Union[(int, str)]: "\n :return: The move's fix damages. Can be an int or 'level' for moves such as\n Seismic Toss.\n :rtype: Union[int, str]\n " return self.entry.get('damage', 0)<|docstring|>:return: The move's fix damages. Can be an int or 'level' ...
347b63c6331d1616e3f690f1a78db201acc9e231451da4aa9581e65c08151b5b
@property def defensive_category(self) -> MoveCategory: "\n :return: Move's defender category.\n :rtype: MoveCategory\n " if ('defensiveCategory' in self.entry): return MoveCategory[self.entry['defensiveCategory'].upper()] return self.category
:return: Move's defender category. :rtype: MoveCategory
src/poke_env/environment/move.py
defensive_category
Jay2645/poke-env
0
python
@property def defensive_category(self) -> MoveCategory: "\n :return: Move's defender category.\n :rtype: MoveCategory\n " if ('defensiveCategory' in self.entry): return MoveCategory[self.entry['defensiveCategory'].upper()] return self.category
@property def defensive_category(self) -> MoveCategory: "\n :return: Move's defender category.\n :rtype: MoveCategory\n " if ('defensiveCategory' in self.entry): return MoveCategory[self.entry['defensiveCategory'].upper()] return self.category<|docstring|>:return: Move's defende...
0d63aa22daca0d370218ab23c7e1290f5072b4669cc58e02317027eabefef908
@property def drain(self) -> float: '\n :return: Ratio of HP of inflicted damages, between 0 and 1.\n :rtype: float\n ' if ('drain' in self.entry): return (self.entry['drain'][0] / self.entry['drain'][1]) return 0.0
:return: Ratio of HP of inflicted damages, between 0 and 1. :rtype: float
src/poke_env/environment/move.py
drain
Jay2645/poke-env
0
python
@property def drain(self) -> float: '\n :return: Ratio of HP of inflicted damages, between 0 and 1.\n :rtype: float\n ' if ('drain' in self.entry): return (self.entry['drain'][0] / self.entry['drain'][1]) return 0.0
@property def drain(self) -> float: '\n :return: Ratio of HP of inflicted damages, between 0 and 1.\n :rtype: float\n ' if ('drain' in self.entry): return (self.entry['drain'][0] / self.entry['drain'][1]) return 0.0<|docstring|>:return: Ratio of HP of inflicted damages, between ...
2a1dbf4858d7318838fd1b6440ad0162706bcc8c7ca2e1c570a8dc0c342667f0
@property def entry(self) -> dict: '\n Should not be used directly.\n\n :return: The data entry corresponding to the move\n :rtype: dict\n ' if (self._id in MOVES): return MOVES[self._id] elif (self._id.startswith('z') and (self._id[1:] in MOVES)): return MOVES[se...
Should not be used directly. :return: The data entry corresponding to the move :rtype: dict
src/poke_env/environment/move.py
entry
Jay2645/poke-env
0
python
@property def entry(self) -> dict: '\n Should not be used directly.\n\n :return: The data entry corresponding to the move\n :rtype: dict\n ' if (self._id in MOVES): return MOVES[self._id] elif (self._id.startswith('z') and (self._id[1:] in MOVES)): return MOVES[se...
@property def entry(self) -> dict: '\n Should not be used directly.\n\n :return: The data entry corresponding to the move\n :rtype: dict\n ' if (self._id in MOVES): return MOVES[self._id] elif (self._id.startswith('z') and (self._id[1:] in MOVES)): return MOVES[se...
e0dc2fa71ee4b8a7e67df32c9b4cd495f28470c07b78069b12d54b3787004d54
@property def expected_hits(self) -> float: '\n :return: Expected number of hits, between 1 and 5. Equal to n_hits if n_hits is\n constant.\n :rtype: float\n ' if ((self._id == 'triplekick') or (self._id == 'tripleaxel')): return ((1 + (2 * 0.9)) + (3 * 0.81)) (min_hi...
:return: Expected number of hits, between 1 and 5. Equal to n_hits if n_hits is constant. :rtype: float
src/poke_env/environment/move.py
expected_hits
Jay2645/poke-env
0
python
@property def expected_hits(self) -> float: '\n :return: Expected number of hits, between 1 and 5. Equal to n_hits if n_hits is\n constant.\n :rtype: float\n ' if ((self._id == 'triplekick') or (self._id == 'tripleaxel')): return ((1 + (2 * 0.9)) + (3 * 0.81)) (min_hi...
@property def expected_hits(self) -> float: '\n :return: Expected number of hits, between 1 and 5. Equal to n_hits if n_hits is\n constant.\n :rtype: float\n ' if ((self._id == 'triplekick') or (self._id == 'tripleaxel')): return ((1 + (2 * 0.9)) + (3 * 0.81)) (min_hi...
944d619faf8fd4c6506152cbeb21c24365fb57089325ba82af2fbc227d2b42d9
@property def flags(self) -> Set[str]: '\n This property is not well defined, and may be missing some information.\n If you need more information on some flag, please open an issue in the project.\n\n :return: Flags associated with this move. These can come from the data or be\n cust...
This property is not well defined, and may be missing some information. If you need more information on some flag, please open an issue in the project. :return: Flags associated with this move. These can come from the data or be custom. :rtype: Set[str]
src/poke_env/environment/move.py
flags
Jay2645/poke-env
0
python
@property def flags(self) -> Set[str]: '\n This property is not well defined, and may be missing some information.\n If you need more information on some flag, please open an issue in the project.\n\n :return: Flags associated with this move. These can come from the data or be\n cust...
@property def flags(self) -> Set[str]: '\n This property is not well defined, and may be missing some information.\n If you need more information on some flag, please open an issue in the project.\n\n :return: Flags associated with this move. These can come from the data or be\n cust...
42b98ef901a10932b2304ffd97ee9d5c361dc6a1087c0be5724315fca25f1a00
@property def force_switch(self) -> bool: '\n :return: Whether this move forces switches.\n :rtype: bool\n ' return self.entry.get('forceSwitch', False)
:return: Whether this move forces switches. :rtype: bool
src/poke_env/environment/move.py
force_switch
Jay2645/poke-env
0
python
@property def force_switch(self) -> bool: '\n :return: Whether this move forces switches.\n :rtype: bool\n ' return self.entry.get('forceSwitch', False)
@property def force_switch(self) -> bool: '\n :return: Whether this move forces switches.\n :rtype: bool\n ' return self.entry.get('forceSwitch', False)<|docstring|>:return: Whether this move forces switches. :rtype: bool<|endoftext|>
c2bc10b0fbe6675acb5da7b2a7c97bbeabce686846ea7fba6b7db353cac332f5
@property def heal(self) -> float: "\n :return: Proportion of the user's HP recovered.\n :rtype: float\n " if ('heal' in self.entry): return (self.entry['heal'][0] / self.entry['heal'][1]) return 0.0
:return: Proportion of the user's HP recovered. :rtype: float
src/poke_env/environment/move.py
heal
Jay2645/poke-env
0
python
@property def heal(self) -> float: "\n :return: Proportion of the user's HP recovered.\n :rtype: float\n " if ('heal' in self.entry): return (self.entry['heal'][0] / self.entry['heal'][1]) return 0.0
@property def heal(self) -> float: "\n :return: Proportion of the user's HP recovered.\n :rtype: float\n " if ('heal' in self.entry): return (self.entry['heal'][0] / self.entry['heal'][1]) return 0.0<|docstring|>:return: Proportion of the user's HP recovered. :rtype: float<|endo...
f06559abc0487d519dd0fdf38c38057092092bc39eaf85d1db1f2ec716aef07c
@property def id(self) -> str: '\n :return: Move id.\n :rtype: str\n ' return self._id
:return: Move id. :rtype: str
src/poke_env/environment/move.py
id
Jay2645/poke-env
0
python
@property def id(self) -> str: '\n :return: Move id.\n :rtype: str\n ' return self._id
@property def id(self) -> str: '\n :return: Move id.\n :rtype: str\n ' return self._id<|docstring|>:return: Move id. :rtype: str<|endoftext|>
7db77e6d83b99780211b8618951c1ce5ce9a2b4093f6941bccc2ace643069f61
@property def ignore_ability(self) -> bool: "\n :return: Whether the move ignore its target's ability.\n :rtype: bool\n " return self.entry.get('ignoreAbility', False)
:return: Whether the move ignore its target's ability. :rtype: bool
src/poke_env/environment/move.py
ignore_ability
Jay2645/poke-env
0
python
@property def ignore_ability(self) -> bool: "\n :return: Whether the move ignore its target's ability.\n :rtype: bool\n " return self.entry.get('ignoreAbility', False)
@property def ignore_ability(self) -> bool: "\n :return: Whether the move ignore its target's ability.\n :rtype: bool\n " return self.entry.get('ignoreAbility', False)<|docstring|>:return: Whether the move ignore its target's ability. :rtype: bool<|endoftext|>
359e61055a1d4cde829502a0573a87e5c164350be31d42bfbefb42b2a67ee245
@property def ignore_defensive(self) -> bool: "\n :return: Whether the opponent's stat boosts are ignored.\n :rtype: bool\n " return self.entry.get('ignoreDefensive', False)
:return: Whether the opponent's stat boosts are ignored. :rtype: bool
src/poke_env/environment/move.py
ignore_defensive
Jay2645/poke-env
0
python
@property def ignore_defensive(self) -> bool: "\n :return: Whether the opponent's stat boosts are ignored.\n :rtype: bool\n " return self.entry.get('ignoreDefensive', False)
@property def ignore_defensive(self) -> bool: "\n :return: Whether the opponent's stat boosts are ignored.\n :rtype: bool\n " return self.entry.get('ignoreDefensive', False)<|docstring|>:return: Whether the opponent's stat boosts are ignored. :rtype: bool<|endoftext|>
b61adb0ba547f1f4779aaf1de99d37a3902b0758817d774853f4cf05d456d32d
@property def ignore_evasion(self) -> bool: "\n :return: Wheter the opponent's evasion is ignored.\n :rtype: bool\n " return self.entry.get('ignoreEvasion', False)
:return: Wheter the opponent's evasion is ignored. :rtype: bool
src/poke_env/environment/move.py
ignore_evasion
Jay2645/poke-env
0
python
@property def ignore_evasion(self) -> bool: "\n :return: Wheter the opponent's evasion is ignored.\n :rtype: bool\n " return self.entry.get('ignoreEvasion', False)
@property def ignore_evasion(self) -> bool: "\n :return: Wheter the opponent's evasion is ignored.\n :rtype: bool\n " return self.entry.get('ignoreEvasion', False)<|docstring|>:return: Wheter the opponent's evasion is ignored. :rtype: bool<|endoftext|>
d008a279d577a96e10b35384dcdff86065593897673c039d91399f71aaaf2b7e
@property def ignore_immunity(self) -> Union[(bool, Set[PokemonType])]: "\n :return: Whether the opponent's immunity is ignored, or a list of ignored\n immunities.\n :rtype: bool or set of Types\n " if ('ignoreImmunity' in self.entry): if isinstance(self.entry['ignoreImmu...
:return: Whether the opponent's immunity is ignored, or a list of ignored immunities. :rtype: bool or set of Types
src/poke_env/environment/move.py
ignore_immunity
Jay2645/poke-env
0
python
@property def ignore_immunity(self) -> Union[(bool, Set[PokemonType])]: "\n :return: Whether the opponent's immunity is ignored, or a list of ignored\n immunities.\n :rtype: bool or set of Types\n " if ('ignoreImmunity' in self.entry): if isinstance(self.entry['ignoreImmu...
@property def ignore_immunity(self) -> Union[(bool, Set[PokemonType])]: "\n :return: Whether the opponent's immunity is ignored, or a list of ignored\n immunities.\n :rtype: bool or set of Types\n " if ('ignoreImmunity' in self.entry): if isinstance(self.entry['ignoreImmu...
1b2af2d8db68f6d6a7df1054d054863b8c26100e830dec0bdc94355e187e467d
@property def is_empty(self) -> bool: '\n :return: Whether the move is an empty move.\n :rtype: bool\n ' return self._is_empty
:return: Whether the move is an empty move. :rtype: bool
src/poke_env/environment/move.py
is_empty
Jay2645/poke-env
0
python
@property def is_empty(self) -> bool: '\n :return: Whether the move is an empty move.\n :rtype: bool\n ' return self._is_empty
@property def is_empty(self) -> bool: '\n :return: Whether the move is an empty move.\n :rtype: bool\n ' return self._is_empty<|docstring|>:return: Whether the move is an empty move. :rtype: bool<|endoftext|>
2b2958c9b9da06ad827e2b398f77f802fd3da51b5f75d875f58ac63c85b952bc
@property def is_z(self) -> bool: '\n :return: Whether the move is a z move.\n :rtype: bool\n ' return Move.is_id_z(self.id)
:return: Whether the move is a z move. :rtype: bool
src/poke_env/environment/move.py
is_z
Jay2645/poke-env
0
python
@property def is_z(self) -> bool: '\n :return: Whether the move is a z move.\n :rtype: bool\n ' return Move.is_id_z(self.id)
@property def is_z(self) -> bool: '\n :return: Whether the move is a z move.\n :rtype: bool\n ' return Move.is_id_z(self.id)<|docstring|>:return: Whether the move is a z move. :rtype: bool<|endoftext|>
3c490ba29b3761be342b33577c4b090e76dd8e70804750fddd4554a0ea8e515e
@property def max_pp(self) -> int: "\n :return: The move's max pp.\n :rtype: int\n " return self.entry['pp']
:return: The move's max pp. :rtype: int
src/poke_env/environment/move.py
max_pp
Jay2645/poke-env
0
python
@property def max_pp(self) -> int: "\n :return: The move's max pp.\n :rtype: int\n " return self.entry['pp']
@property def max_pp(self) -> int: "\n :return: The move's max pp.\n :rtype: int\n " return self.entry['pp']<|docstring|>:return: The move's max pp. :rtype: int<|endoftext|>
f9a000da6c4cc34eea13931d19c17113ff98b2b6a0b18ffde9c184660b65cc81
@property def n_hit(self) -> Tuple: '\n :return: How many hits this move lands. Tuple of the form (min, max).\n :rtype: Tuple\n ' if ('multihit' in self.entry): if isinstance(self.entry['multihit'], list): return tuple(self.entry['multihit']) else: re...
:return: How many hits this move lands. Tuple of the form (min, max). :rtype: Tuple
src/poke_env/environment/move.py
n_hit
Jay2645/poke-env
0
python
@property def n_hit(self) -> Tuple: '\n :return: How many hits this move lands. Tuple of the form (min, max).\n :rtype: Tuple\n ' if ('multihit' in self.entry): if isinstance(self.entry['multihit'], list): return tuple(self.entry['multihit']) else: re...
@property def n_hit(self) -> Tuple: '\n :return: How many hits this move lands. Tuple of the form (min, max).\n :rtype: Tuple\n ' if ('multihit' in self.entry): if isinstance(self.entry['multihit'], list): return tuple(self.entry['multihit']) else: re...
56f726d668bd7106cdd5a0036c366f9195297f6adb9ad7f5b43f3dfb9d4c86d9
@property def no_pp_boosts(self) -> bool: '\n :return: Whether the move uses PPs.\n :rtype: bool\n ' return ('noPPBoosts' in self.entry)
:return: Whether the move uses PPs. :rtype: bool
src/poke_env/environment/move.py
no_pp_boosts
Jay2645/poke-env
0
python
@property def no_pp_boosts(self) -> bool: '\n :return: Whether the move uses PPs.\n :rtype: bool\n ' return ('noPPBoosts' in self.entry)
@property def no_pp_boosts(self) -> bool: '\n :return: Whether the move uses PPs.\n :rtype: bool\n ' return ('noPPBoosts' in self.entry)<|docstring|>:return: Whether the move uses PPs. :rtype: bool<|endoftext|>
560c9037d4f08ccba69c26a17bf2e02511e61e95fcc091c535aeaffca0e24282
@property def non_ghost_target(self) -> bool: '\n :return: True for curse.\n :rtype: bool\n ' return ('nonGhostTarget' in self.entry)
:return: True for curse. :rtype: bool
src/poke_env/environment/move.py
non_ghost_target
Jay2645/poke-env
0
python
@property def non_ghost_target(self) -> bool: '\n :return: True for curse.\n :rtype: bool\n ' return ('nonGhostTarget' in self.entry)
@property def non_ghost_target(self) -> bool: '\n :return: True for curse.\n :rtype: bool\n ' return ('nonGhostTarget' in self.entry)<|docstring|>:return: True for curse. :rtype: bool<|endoftext|>
84f45638140665b8cbddb636b645c3232a5b49141a305f18b2912aa617f28822
@property def priority(self) -> int: '\n :return: Move priority.\n :rtype: int\n ' return self.entry['priority']
:return: Move priority. :rtype: int
src/poke_env/environment/move.py
priority
Jay2645/poke-env
0
python
@property def priority(self) -> int: '\n :return: Move priority.\n :rtype: int\n ' return self.entry['priority']
@property def priority(self) -> int: '\n :return: Move priority.\n :rtype: int\n ' return self.entry['priority']<|docstring|>:return: Move priority. :rtype: int<|endoftext|>
e854cda28de6570765f7087b6717eeb954836a21974aa03c45aabf6ab7e92145
@property def pseudo_weather(self) -> str: '\n :return: Pseudo-weather activated by this move.\n :rtype: str\n ' return self.entry.get('pseudoWeather', None)
:return: Pseudo-weather activated by this move. :rtype: str
src/poke_env/environment/move.py
pseudo_weather
Jay2645/poke-env
0
python
@property def pseudo_weather(self) -> str: '\n :return: Pseudo-weather activated by this move.\n :rtype: str\n ' return self.entry.get('pseudoWeather', None)
@property def pseudo_weather(self) -> str: '\n :return: Pseudo-weather activated by this move.\n :rtype: str\n ' return self.entry.get('pseudoWeather', None)<|docstring|>:return: Pseudo-weather activated by this move. :rtype: str<|endoftext|>
e4364a268e8d5c8ab115bd16e38c29b953b7b368116f242ed9d2e46e3e3ffed7
@property def recoil(self) -> float: "\n :return: Proportion of the move's damage inflicted as recoil.\n :rtype: float\n " if ('recoil' in self.entry): return (self.entry['recoil'][0] / self.entry['recoil'][1]) elif ('struggleRecoil' in self.entry): return 0.25 retur...
:return: Proportion of the move's damage inflicted as recoil. :rtype: float
src/poke_env/environment/move.py
recoil
Jay2645/poke-env
0
python
@property def recoil(self) -> float: "\n :return: Proportion of the move's damage inflicted as recoil.\n :rtype: float\n " if ('recoil' in self.entry): return (self.entry['recoil'][0] / self.entry['recoil'][1]) elif ('struggleRecoil' in self.entry): return 0.25 retur...
@property def recoil(self) -> float: "\n :return: Proportion of the move's damage inflicted as recoil.\n :rtype: float\n " if ('recoil' in self.entry): return (self.entry['recoil'][0] / self.entry['recoil'][1]) elif ('struggleRecoil' in self.entry): return 0.25 retur...
9740d3fd95defc4f5c899a169997b4c4055ac3d9f9e057c7d54d68ccffb74c47
@staticmethod @lru_cache(maxsize=4096) def retrieve_id(move_name: str) -> str: 'Retrieve the id of a move based on its full name.\n\n :param move_name: The string to convert into a move id.\n :type move_name: str\n :return: The corresponding move id.\n :rtype: str\n ' move_nam...
Retrieve the id of a move based on its full name. :param move_name: The string to convert into a move id. :type move_name: str :return: The corresponding move id. :rtype: str
src/poke_env/environment/move.py
retrieve_id
Jay2645/poke-env
0
python
@staticmethod @lru_cache(maxsize=4096) def retrieve_id(move_name: str) -> str: 'Retrieve the id of a move based on its full name.\n\n :param move_name: The string to convert into a move id.\n :type move_name: str\n :return: The corresponding move id.\n :rtype: str\n ' move_nam...
@staticmethod @lru_cache(maxsize=4096) def retrieve_id(move_name: str) -> str: 'Retrieve the id of a move based on its full name.\n\n :param move_name: The string to convert into a move id.\n :type move_name: str\n :return: The corresponding move id.\n :rtype: str\n ' move_nam...
94e5dd2726c1b33d8adfd93c2ce7bd2991391fd39a0d6f5e389903454f56624b
@property def secondary(self) -> List[dict]: '\n :return: Secondary effects. At this point, the precise content of this property\n is not too clear.\n :rtype: Optional[Dict]\n ' if (('secondary' in self.entry) and self.entry['secondary']): return [self.entry['secondary']]...
:return: Secondary effects. At this point, the precise content of this property is not too clear. :rtype: Optional[Dict]
src/poke_env/environment/move.py
secondary
Jay2645/poke-env
0
python
@property def secondary(self) -> List[dict]: '\n :return: Secondary effects. At this point, the precise content of this property\n is not too clear.\n :rtype: Optional[Dict]\n ' if (('secondary' in self.entry) and self.entry['secondary']): return [self.entry['secondary']]...
@property def secondary(self) -> List[dict]: '\n :return: Secondary effects. At this point, the precise content of this property\n is not too clear.\n :rtype: Optional[Dict]\n ' if (('secondary' in self.entry) and self.entry['secondary']): return [self.entry['secondary']]...
951a0c7b6aa6229451f80ecd81fe3ae5d8bec09499edd360698fb0accb9227bb
@property def self_boost(self) -> Optional[Dict[(str, int)]]: "\n :return: Boosts applied to the move's user.\n :rtype: Dict[str, int]\n " if ('selfBoost' in self.entry): return self.entry['selfBoost'].get('boosts', None) elif (('self' in self.entry) and ('boosts' in self.entry[...
:return: Boosts applied to the move's user. :rtype: Dict[str, int]
src/poke_env/environment/move.py
self_boost
Jay2645/poke-env
0
python
@property def self_boost(self) -> Optional[Dict[(str, int)]]: "\n :return: Boosts applied to the move's user.\n :rtype: Dict[str, int]\n " if ('selfBoost' in self.entry): return self.entry['selfBoost'].get('boosts', None) elif (('self' in self.entry) and ('boosts' in self.entry[...
@property def self_boost(self) -> Optional[Dict[(str, int)]]: "\n :return: Boosts applied to the move's user.\n :rtype: Dict[str, int]\n " if ('selfBoost' in self.entry): return self.entry['selfBoost'].get('boosts', None) elif (('self' in self.entry) and ('boosts' in self.entry[...
784c1200cad7c4fb29449061271d20e75442f64278f3da9b1842181ccc6b41bc
@property def self_destruct(self) -> Optional[str]: "\n :return: Move's self destruct consequences.\n :rtype: Optional[str]\n " return self.entry.get('selfdestruct', None)
:return: Move's self destruct consequences. :rtype: Optional[str]
src/poke_env/environment/move.py
self_destruct
Jay2645/poke-env
0
python
@property def self_destruct(self) -> Optional[str]: "\n :return: Move's self destruct consequences.\n :rtype: Optional[str]\n " return self.entry.get('selfdestruct', None)
@property def self_destruct(self) -> Optional[str]: "\n :return: Move's self destruct consequences.\n :rtype: Optional[str]\n " return self.entry.get('selfdestruct', None)<|docstring|>:return: Move's self destruct consequences. :rtype: Optional[str]<|endoftext|>
a3d9b68ae1f4faa63a0c7731f2879c7c512771cd63fb1b1f7ce805c680f461c8
@property def self_switch(self) -> Union[(str, bool)]: '\n :return: What kind of self swtich this move implies for the user.\n :rtype: Optional[str]\n ' return self.entry.get('selfSwitch', False)
:return: What kind of self swtich this move implies for the user. :rtype: Optional[str]
src/poke_env/environment/move.py
self_switch
Jay2645/poke-env
0
python
@property def self_switch(self) -> Union[(str, bool)]: '\n :return: What kind of self swtich this move implies for the user.\n :rtype: Optional[str]\n ' return self.entry.get('selfSwitch', False)
@property def self_switch(self) -> Union[(str, bool)]: '\n :return: What kind of self swtich this move implies for the user.\n :rtype: Optional[str]\n ' return self.entry.get('selfSwitch', False)<|docstring|>:return: What kind of self swtich this move implies for the user. :rtype: Optional[...
762f8c5ad88e95a178e0d2cafe53d68e0a3d36d6d34fddd9c255a97090bda7f9
@property def side_condition(self) -> Optional[str]: '\n :return: Side condition inflicted by the move.\n :rtype: Optional[str]\n ' return self.entry.get('sideCondition', None)
:return: Side condition inflicted by the move. :rtype: Optional[str]
src/poke_env/environment/move.py
side_condition
Jay2645/poke-env
0
python
@property def side_condition(self) -> Optional[str]: '\n :return: Side condition inflicted by the move.\n :rtype: Optional[str]\n ' return self.entry.get('sideCondition', None)
@property def side_condition(self) -> Optional[str]: '\n :return: Side condition inflicted by the move.\n :rtype: Optional[str]\n ' return self.entry.get('sideCondition', None)<|docstring|>:return: Side condition inflicted by the move. :rtype: Optional[str]<|endoftext|>
f39ca05a450d29f604d91bf7d47b79b4d161ab543f9e891c99b193a1fec5642d
@property def sleep_usable(self) -> bool: '\n :return: Whether the move can be user by a sleeping pokemon.\n :rtype: bool\n ' return self.entry.get('sleepUsable', False)
:return: Whether the move can be user by a sleeping pokemon. :rtype: bool
src/poke_env/environment/move.py
sleep_usable
Jay2645/poke-env
0
python
@property def sleep_usable(self) -> bool: '\n :return: Whether the move can be user by a sleeping pokemon.\n :rtype: bool\n ' return self.entry.get('sleepUsable', False)
@property def sleep_usable(self) -> bool: '\n :return: Whether the move can be user by a sleeping pokemon.\n :rtype: bool\n ' return self.entry.get('sleepUsable', False)<|docstring|>:return: Whether the move can be user by a sleeping pokemon. :rtype: bool<|endoftext|>
76a0da37d3397174eda3bc32ebed02c4b59414c2c525555c105a6c3a2a0377a3
@property def slot_condition(self) -> Optional[str]: '\n :return: Which slot condition is started by this move.\n :rtype: Optional[str]\n ' return self.entry.get('slotCondition', None)
:return: Which slot condition is started by this move. :rtype: Optional[str]
src/poke_env/environment/move.py
slot_condition
Jay2645/poke-env
0
python
@property def slot_condition(self) -> Optional[str]: '\n :return: Which slot condition is started by this move.\n :rtype: Optional[str]\n ' return self.entry.get('slotCondition', None)
@property def slot_condition(self) -> Optional[str]: '\n :return: Which slot condition is started by this move.\n :rtype: Optional[str]\n ' return self.entry.get('slotCondition', None)<|docstring|>:return: Which slot condition is started by this move. :rtype: Optional[str]<|endoftext|>
1a4d4c44fe6f6306e6ebf51a74457def54b725b9b46a6208cafc2f63055a624f
@property def stalling_move(self) -> bool: '\n :return: Showdown classification of the move as a stalling move.\n :rtype: bool\n ' return self.entry.get('stallingMove', False)
:return: Showdown classification of the move as a stalling move. :rtype: bool
src/poke_env/environment/move.py
stalling_move
Jay2645/poke-env
0
python
@property def stalling_move(self) -> bool: '\n :return: Showdown classification of the move as a stalling move.\n :rtype: bool\n ' return self.entry.get('stallingMove', False)
@property def stalling_move(self) -> bool: '\n :return: Showdown classification of the move as a stalling move.\n :rtype: bool\n ' return self.entry.get('stallingMove', False)<|docstring|>:return: Showdown classification of the move as a stalling move. :rtype: bool<|endoftext|>
40387b7873f7b994e4fc724a8d249559fb50a4bd01e9235fcd05d78992a4affd
@property def status(self) -> Optional[Status]: '\n :return: The status inflicted by the move.\n :rtype: Optional[Status]\n ' if ('status' in self.entry): return Status[self.entry['status'].upper()] return None
:return: The status inflicted by the move. :rtype: Optional[Status]
src/poke_env/environment/move.py
status
Jay2645/poke-env
0
python
@property def status(self) -> Optional[Status]: '\n :return: The status inflicted by the move.\n :rtype: Optional[Status]\n ' if ('status' in self.entry): return Status[self.entry['status'].upper()] return None
@property def status(self) -> Optional[Status]: '\n :return: The status inflicted by the move.\n :rtype: Optional[Status]\n ' if ('status' in self.entry): return Status[self.entry['status'].upper()] return None<|docstring|>:return: The status inflicted by the move. :rtype: Optio...
4d5e176f4cdf6b30af447d87ae40f7bb3da914f05b45da9f935a8be1877f574c
@property def steals_boosts(self) -> bool: "\n :return: Whether the move steals its target's boosts.\n :rtype: bool\n " return self.entry.get('stealsBoosts', False)
:return: Whether the move steals its target's boosts. :rtype: bool
src/poke_env/environment/move.py
steals_boosts
Jay2645/poke-env
0
python
@property def steals_boosts(self) -> bool: "\n :return: Whether the move steals its target's boosts.\n :rtype: bool\n " return self.entry.get('stealsBoosts', False)
@property def steals_boosts(self) -> bool: "\n :return: Whether the move steals its target's boosts.\n :rtype: bool\n " return self.entry.get('stealsBoosts', False)<|docstring|>:return: Whether the move steals its target's boosts. :rtype: bool<|endoftext|>
1d7d6238fd7e0b67211e2192ba13fd44805b7ffd2eea3986c5100398636ddfcc
@property def target(self) -> str: '\n :return: Move target.\n :rtype: str\n ' return self.entry['target']
:return: Move target. :rtype: str
src/poke_env/environment/move.py
target
Jay2645/poke-env
0
python
@property def target(self) -> str: '\n :return: Move target.\n :rtype: str\n ' return self.entry['target']
@property def target(self) -> str: '\n :return: Move target.\n :rtype: str\n ' return self.entry['target']<|docstring|>:return: Move target. :rtype: str<|endoftext|>
b4d2f7b8907b63ae3278303fcd045ef0b5eff8be534da8479c747c6d35fef265
@property def terrain(self) -> Optional[str]: '\n :return: Terrain started by the move.\n :rtype: Optional[str]\n ' return self.entry.get('terrain', None)
:return: Terrain started by the move. :rtype: Optional[str]
src/poke_env/environment/move.py
terrain
Jay2645/poke-env
0
python
@property def terrain(self) -> Optional[str]: '\n :return: Terrain started by the move.\n :rtype: Optional[str]\n ' return self.entry.get('terrain', None)
@property def terrain(self) -> Optional[str]: '\n :return: Terrain started by the move.\n :rtype: Optional[str]\n ' return self.entry.get('terrain', None)<|docstring|>:return: Terrain started by the move. :rtype: Optional[str]<|endoftext|>
9fc54593c8e35a663f24de7dfe97f13819fa0fde0e1f486991dd6a3036c98ac3
@property def thaws_target(self) -> bool: '\n :return: Whether the move thaws its target.\n :rtype: bool\n ' return self.entry.get('thawsTarget', False)
:return: Whether the move thaws its target. :rtype: bool
src/poke_env/environment/move.py
thaws_target
Jay2645/poke-env
0
python
@property def thaws_target(self) -> bool: '\n :return: Whether the move thaws its target.\n :rtype: bool\n ' return self.entry.get('thawsTarget', False)
@property def thaws_target(self) -> bool: '\n :return: Whether the move thaws its target.\n :rtype: bool\n ' return self.entry.get('thawsTarget', False)<|docstring|>:return: Whether the move thaws its target. :rtype: bool<|endoftext|>
6241865378f154e5a7c9a742082e696706e331cc8abb5b1ba6d8b8936dfec5ac
@property def type(self) -> PokemonType: '\n :return: Move type.\n :rtype: PokemonType\n ' return PokemonType[self.entry['type'].upper()]
:return: Move type. :rtype: PokemonType
src/poke_env/environment/move.py
type
Jay2645/poke-env
0
python
@property def type(self) -> PokemonType: '\n :return: Move type.\n :rtype: PokemonType\n ' return PokemonType[self.entry['type'].upper()]
@property def type(self) -> PokemonType: '\n :return: Move type.\n :rtype: PokemonType\n ' return PokemonType[self.entry['type'].upper()]<|docstring|>:return: Move type. :rtype: PokemonType<|endoftext|>
68ab08457265e3c512090971d7b6c6fc1bb230babb7bd1aa0bf0c785edbb780a
@property def use_target_offensive(self) -> bool: "\n :return: Whether the move uses the target's offensive statistics.\n :rtype: bool\n " return self.entry.get('useTargetOffensive', False)
:return: Whether the move uses the target's offensive statistics. :rtype: bool
src/poke_env/environment/move.py
use_target_offensive
Jay2645/poke-env
0
python
@property def use_target_offensive(self) -> bool: "\n :return: Whether the move uses the target's offensive statistics.\n :rtype: bool\n " return self.entry.get('useTargetOffensive', False)
@property def use_target_offensive(self) -> bool: "\n :return: Whether the move uses the target's offensive statistics.\n :rtype: bool\n " return self.entry.get('useTargetOffensive', False)<|docstring|>:return: Whether the move uses the target's offensive statistics. :rtype: bool<|endoftext...
37ad343d0291615ffffdc742ccee159de34dc0f6252e99a691be51049b735da2
@property def volatile_status(self) -> Optional[str]: '\n :return: Volatile status inflicted by the move.\n :rtype: Optional[str]\n ' return self.entry.get('volatileStatus', None)
:return: Volatile status inflicted by the move. :rtype: Optional[str]
src/poke_env/environment/move.py
volatile_status
Jay2645/poke-env
0
python
@property def volatile_status(self) -> Optional[str]: '\n :return: Volatile status inflicted by the move.\n :rtype: Optional[str]\n ' return self.entry.get('volatileStatus', None)
@property def volatile_status(self) -> Optional[str]: '\n :return: Volatile status inflicted by the move.\n :rtype: Optional[str]\n ' return self.entry.get('volatileStatus', None)<|docstring|>:return: Volatile status inflicted by the move. :rtype: Optional[str]<|endoftext|>
c3f0b5546e3a1d4002a8d6ebadcadcbd611717b8fcb69209f3ddf902f766478a
@property def weather(self) -> Optional[Weather]: '\n :return: Weather started by the move.\n :rtype: Optional[Weather]\n ' if ('weather' in self.entry): return Weather[self.entry['weather'].upper()] return None
:return: Weather started by the move. :rtype: Optional[Weather]
src/poke_env/environment/move.py
weather
Jay2645/poke-env
0
python
@property def weather(self) -> Optional[Weather]: '\n :return: Weather started by the move.\n :rtype: Optional[Weather]\n ' if ('weather' in self.entry): return Weather[self.entry['weather'].upper()] return None
@property def weather(self) -> Optional[Weather]: '\n :return: Weather started by the move.\n :rtype: Optional[Weather]\n ' if ('weather' in self.entry): return Weather[self.entry['weather'].upper()] return None<|docstring|>:return: Weather started by the move. :rtype: Optional[...
b50a77e35ca842459ff714879fea928b4b208a2df63d1e3fd52143868b9916cb
@property def z_move_boost(self) -> Optional[Dict[(str, int)]]: '\n :return: Boosts associated with the z-move version of this move.\n :rtype: Dict[str, int]\n ' if (('zMove' in self.entry) and ('boost' in self.entry['zMove'])): return self.entry['zMove']['boost'] return None
:return: Boosts associated with the z-move version of this move. :rtype: Dict[str, int]
src/poke_env/environment/move.py
z_move_boost
Jay2645/poke-env
0
python
@property def z_move_boost(self) -> Optional[Dict[(str, int)]]: '\n :return: Boosts associated with the z-move version of this move.\n :rtype: Dict[str, int]\n ' if (('zMove' in self.entry) and ('boost' in self.entry['zMove'])): return self.entry['zMove']['boost'] return None
@property def z_move_boost(self) -> Optional[Dict[(str, int)]]: '\n :return: Boosts associated with the z-move version of this move.\n :rtype: Dict[str, int]\n ' if (('zMove' in self.entry) and ('boost' in self.entry['zMove'])): return self.entry['zMove']['boost'] return None<|d...
7938237b816dd7b307af3708014fb2ef6d55854f0f8ce08341294369875f3283
@property def z_move_effect(self) -> Optional[str]: '\n :return: Effects associated with the z-move version of this move.\n :rtype: Optional[str]\n ' if (('zMove' in self.entry) and ('effect' in self.entry['zMove'])): return self.entry['zMove']['effect'] return None
:return: Effects associated with the z-move version of this move. :rtype: Optional[str]
src/poke_env/environment/move.py
z_move_effect
Jay2645/poke-env
0
python
@property def z_move_effect(self) -> Optional[str]: '\n :return: Effects associated with the z-move version of this move.\n :rtype: Optional[str]\n ' if (('zMove' in self.entry) and ('effect' in self.entry['zMove'])): return self.entry['zMove']['effect'] return None
@property def z_move_effect(self) -> Optional[str]: '\n :return: Effects associated with the z-move version of this move.\n :rtype: Optional[str]\n ' if (('zMove' in self.entry) and ('effect' in self.entry['zMove'])): return self.entry['zMove']['effect'] return None<|docstring|>...
3f29c7580951fbc2fad8c5f0287f516ef949f70086f8dfb8f429b85729a359cd
@property def z_move_power(self) -> int: '\n :return: Base power of the z-move version of this move.\n :rtype: int\n ' if (('zMove' in self.entry) and ('basePower' in self.entry['zMove'])): return self.entry['zMove']['basePower'] elif (self.category == MoveCategory.STATUS): ...
:return: Base power of the z-move version of this move. :rtype: int
src/poke_env/environment/move.py
z_move_power
Jay2645/poke-env
0
python
@property def z_move_power(self) -> int: '\n :return: Base power of the z-move version of this move.\n :rtype: int\n ' if (('zMove' in self.entry) and ('basePower' in self.entry['zMove'])): return self.entry['zMove']['basePower'] elif (self.category == MoveCategory.STATUS): ...
@property def z_move_power(self) -> int: '\n :return: Base power of the z-move version of this move.\n :rtype: int\n ' if (('zMove' in self.entry) and ('basePower' in self.entry['zMove'])): return self.entry['zMove']['basePower'] elif (self.category == MoveCategory.STATUS): ...
e389550cab99ff51eb7cd7b3bd74a8eda4a9b897467e3cb2da34cebd3b0e3190
@bp.route('/<int:ID>', methods=['DELETE']) @url def delete_overtime(ID): '\n 删除一个请假请求。\n\n 只有当该请求没有被审批时才能由员工本人取消。\n ' o = Leave.ByID(ID) if ((o.status == 0) and (o.staff.ID == current_user().ID)): o.delete() else: raise Exception
删除一个请假请求。 只有当该请求没有被审批时才能由员工本人取消。
app/api/leaves.py
delete_overtime
kk456852/Staff-attendance-system
2
python
@bp.route('/<int:ID>', methods=['DELETE']) @url def delete_overtime(ID): '\n 删除一个请假请求。\n\n 只有当该请求没有被审批时才能由员工本人取消。\n ' o = Leave.ByID(ID) if ((o.status == 0) and (o.staff.ID == current_user().ID)): o.delete() else: raise Exception
@bp.route('/<int:ID>', methods=['DELETE']) @url def delete_overtime(ID): '\n 删除一个请假请求。\n\n 只有当该请求没有被审批时才能由员工本人取消。\n ' o = Leave.ByID(ID) if ((o.status == 0) and (o.staff.ID == current_user().ID)): o.delete() else: raise Exception<|docstring|>删除一个请假请求。 只有当该请求没有被审批时才能由员工本人取消。<|en...
287a12739e3b2cf32fba7a1e498b0ff27d1af407a83c81884f0d2d6e02725bad
def second_key_from_tuple(tuple): '\n Return second value of a tuple, used for sorting array of dimension [n, 2] on the second value\n ' return tuple[1]
Return second value of a tuple, used for sorting array of dimension [n, 2] on the second value
app/reranking.py
second_key_from_tuple
moreymat/fastapi-search-reranking
0
python
def second_key_from_tuple(tuple): '\n \n ' return tuple[1]
def second_key_from_tuple(tuple): '\n \n ' return tuple[1]<|docstring|>Return second value of a tuple, used for sorting array of dimension [n, 2] on the second value<|endoftext|>
444b5eea3afc42bb7ed68a4f530a6ba6b901632c860be18675a56bfe249979d1
def sort_array_of_tuple_with_second_value(array): '\n Return an array of tuple sorted by second key values\n ' array.sort(key=second_key_from_tuple, reverse=True) return array
Return an array of tuple sorted by second key values
app/reranking.py
sort_array_of_tuple_with_second_value
moreymat/fastapi-search-reranking
0
python
def sort_array_of_tuple_with_second_value(array): '\n \n ' array.sort(key=second_key_from_tuple, reverse=True) return array
def sort_array_of_tuple_with_second_value(array): '\n \n ' array.sort(key=second_key_from_tuple, reverse=True) return array<|docstring|>Return an array of tuple sorted by second key values<|endoftext|>
4797914d0a94c0ce46498e1999bc29f31b0c9f8c2f6982b6887670ac2ba68bdf
def compute_feedback_score(user_search, result): '\n Compute the feedback score\n Input: user_search: keyword entered by the user\n result: proposed result to the user\n Output: Feedback score, default value to 0.4 if no feedbacks available\n ' '\n # get feedback for that particular s...
Compute the feedback score Input: user_search: keyword entered by the user result: proposed result to the user Output: Feedback score, default value to 0.4 if no feedbacks available
app/reranking.py
compute_feedback_score
moreymat/fastapi-search-reranking
0
python
def compute_feedback_score(user_search, result): '\n Compute the feedback score\n Input: user_search: keyword entered by the user\n result: proposed result to the user\n Output: Feedback score, default value to 0.4 if no feedbacks available\n ' '\n # get feedback for that particular s...
def compute_feedback_score(user_search, result): '\n Compute the feedback score\n Input: user_search: keyword entered by the user\n result: proposed result to the user\n Output: Feedback score, default value to 0.4 if no feedbacks available\n ' '\n # get feedback for that particular s...
039cffefa03fe659d1a34e08a35d249a87a3c90ffb5b55e20121a989d2bbe1d8
def add_feedback_score_to_results(user_search, results_list): '\n Get feedback score for each result in result_list\n\n Input: user_search: keyword entered by the user\n results_list: list of proposed result to the user\n\n Output: list of type ((result_url, result_title), feedback_score)\n ...
Get feedback score for each result in result_list Input: user_search: keyword entered by the user results_list: list of proposed result to the user Output: list of type ((result_url, result_title), feedback_score)
app/reranking.py
add_feedback_score_to_results
moreymat/fastapi-search-reranking
0
python
def add_feedback_score_to_results(user_search, results_list): '\n Get feedback score for each result in result_list\n\n Input: user_search: keyword entered by the user\n results_list: list of proposed result to the user\n\n Output: list of type ((result_url, result_title), feedback_score)\n ...
def add_feedback_score_to_results(user_search, results_list): '\n Get feedback score for each result in result_list\n\n Input: user_search: keyword entered by the user\n results_list: list of proposed result to the user\n\n Output: list of type ((result_url, result_title), feedback_score)\n ...
29d3dfdf86836733171526f883f99f1102751f5081190476faa6c81b38ac0050
@atomic async def list_rnacentral_ids(request): "\n In order to have a text search, this endpoint has to pass a list of rnacentral_ids to\n EBI search (which will be able to provide facets then).\n\n In production environment list of rnacentral_ids is constructed from the database data.\n\n Other enviro...
In order to have a text search, this endpoint has to pass a list of rnacentral_ids to EBI search (which will be able to provide facets then). In production environment list of rnacentral_ids is constructed from the database data. Other environments have to send a request to production machine's post-rnacentral-ids en...
sequence_search/producer/views/list_rnacentral_ids.py
list_rnacentral_ids
RNAcentral/sequence_search
2
python
@atomic async def list_rnacentral_ids(request): "\n In order to have a text search, this endpoint has to pass a list of rnacentral_ids to\n EBI search (which will be able to provide facets then).\n\n In production environment list of rnacentral_ids is constructed from the database data.\n\n Other enviro...
@atomic async def list_rnacentral_ids(request): "\n In order to have a text search, this endpoint has to pass a list of rnacentral_ids to\n EBI search (which will be able to provide facets then).\n\n In production environment list of rnacentral_ids is constructed from the database data.\n\n Other enviro...
64867d71b9e4ca6c177bc6c9dfc31cbd4c4a237ea572bdfd6a5c3ea9e5c0e868
@commands.group(name='fah') @commands.bot_has_permissions(embed_links=True) async def _fah(self, ctx: commands.Context): 'Folding@Home Team & Donor Statistics'
Folding@Home Team & Donor Statistics
fah/fah.py
_fah
Onii-Chan-Discord/OB13-Cogs
10
python
@commands.group(name='fah') @commands.bot_has_permissions(embed_links=True) async def _fah(self, ctx: commands.Context):
@commands.group(name='fah') @commands.bot_has_permissions(embed_links=True) async def _fah(self, ctx: commands.Context): <|docstring|>Folding@Home Team & Donor Statistics<|endoftext|>
1005e6d194ec4b60b298fcc3c4c87a09100fbf0535d1bbb2a7c2ef7e38696de4
@commands.bot_has_permissions(embed_links=True) @_fah.command(name='donor') async def _donor(self, ctx: commands.Context, donor_id: int): 'FaH Donor Statistics' async with ctx.typing(): async with aiohttp.ClientSession() as session: async with session.get(f'{FAH}/api/donor/{donor_id}') as re...
FaH Donor Statistics
fah/fah.py
_donor
Onii-Chan-Discord/OB13-Cogs
10
python
@commands.bot_has_permissions(embed_links=True) @_fah.command(name='donor') async def _donor(self, ctx: commands.Context, donor_id: int): async with ctx.typing(): async with aiohttp.ClientSession() as session: async with session.get(f'{FAH}/api/donor/{donor_id}') as resp: da...
@commands.bot_has_permissions(embed_links=True) @_fah.command(name='donor') async def _donor(self, ctx: commands.Context, donor_id: int): async with ctx.typing(): async with aiohttp.ClientSession() as session: async with session.get(f'{FAH}/api/donor/{donor_id}') as resp: da...
0d6b2d166c50f0f05869520a5ead51b2f551737e2ccd9e7f2714df9eb12bf38b
@commands.bot_has_permissions(embed_links=True) @_fah.command(name='team') async def _team(self, ctx: commands.Context, team_id: int): 'FaH Team Statistics' async with ctx.typing(): async with aiohttp.ClientSession() as session: async with session.get(f'{FAH}/api/team/{team_id}') as resp: ...
FaH Team Statistics
fah/fah.py
_team
Onii-Chan-Discord/OB13-Cogs
10
python
@commands.bot_has_permissions(embed_links=True) @_fah.command(name='team') async def _team(self, ctx: commands.Context, team_id: int): async with ctx.typing(): async with aiohttp.ClientSession() as session: async with session.get(f'{FAH}/api/team/{team_id}') as resp: data = ...
@commands.bot_has_permissions(embed_links=True) @_fah.command(name='team') async def _team(self, ctx: commands.Context, team_id: int): async with ctx.typing(): async with aiohttp.ClientSession() as session: async with session.get(f'{FAH}/api/team/{team_id}') as resp: data = ...
f8e2a7c33b7b941309eb6c457daca9a93add518209b41a7be3dc6d1dacde1133
@_fah.command(name='project') async def _project(self, ctx: commands.Context, project_id: int): 'Get a link to an FaH project page.' return (await ctx.send(f'https://stats.foldingathome.org/project?p={project_id}'))
Get a link to an FaH project page.
fah/fah.py
_project
Onii-Chan-Discord/OB13-Cogs
10
python
@_fah.command(name='project') async def _project(self, ctx: commands.Context, project_id: int): return (await ctx.send(f'https://stats.foldingathome.org/project?p={project_id}'))
@_fah.command(name='project') async def _project(self, ctx: commands.Context, project_id: int): return (await ctx.send(f'https://stats.foldingathome.org/project?p={project_id}'))<|docstring|>Get a link to an FaH project page.<|endoftext|>
6cd1405dbd76e64ce3e038310777572accd231789320e368712ca7a6bf3d726e
@property def method(self) -> str: '\n The HTTP request method for the upstream request\n\n :return: The upstream HTTP request method\n :rtype: str\n ' return self._method
The HTTP request method for the upstream request :return: The upstream HTTP request method :rtype: str
proxy.py
method
AndrewSchenck/flask-restful-proxy
2
python
@property def method(self) -> str: '\n The HTTP request method for the upstream request\n\n :return: The upstream HTTP request method\n :rtype: str\n ' return self._method
@property def method(self) -> str: '\n The HTTP request method for the upstream request\n\n :return: The upstream HTTP request method\n :rtype: str\n ' return self._method<|docstring|>The HTTP request method for the upstream request :return: The upstream HTTP request method :rtype: ...
8f971dbb7ba082b0cfb79fdb2a88186b11509ddd942fbad025d3dadde7aaa147
@method.setter def method(self, value: str) -> None: '\n The HTTP request method for the upstream request\n\n :param value: HTTP request method\n :type value: str\n ' if (value not in PROXY_METHODS): raise APIRequestProxyError('Method not supported by proxy: {}'.format(value)...
The HTTP request method for the upstream request :param value: HTTP request method :type value: str
proxy.py
method
AndrewSchenck/flask-restful-proxy
2
python
@method.setter def method(self, value: str) -> None: '\n The HTTP request method for the upstream request\n\n :param value: HTTP request method\n :type value: str\n ' if (value not in PROXY_METHODS): raise APIRequestProxyError('Method not supported by proxy: {}'.format(value)...
@method.setter def method(self, value: str) -> None: '\n The HTTP request method for the upstream request\n\n :param value: HTTP request method\n :type value: str\n ' if (value not in PROXY_METHODS): raise APIRequestProxyError('Method not supported by proxy: {}'.format(value)...
5993242fde00d025a32d3c3557bd08fc0faac3dd81f175473e23e7cb03977f89
def make_request(self, stream=False) -> requests.Response: '\n Return the upstream request\n\n :param stream: Set to True to use streaming mode\n :type stream: bool\n :return: Response from upstream host\n :rtype: requests.Response\n ' try: return requests.reque...
Return the upstream request :param stream: Set to True to use streaming mode :type stream: bool :return: Response from upstream host :rtype: requests.Response
proxy.py
make_request
AndrewSchenck/flask-restful-proxy
2
python
def make_request(self, stream=False) -> requests.Response: '\n Return the upstream request\n\n :param stream: Set to True to use streaming mode\n :type stream: bool\n :return: Response from upstream host\n :rtype: requests.Response\n ' try: return requests.reque...
def make_request(self, stream=False) -> requests.Response: '\n Return the upstream request\n\n :param stream: Set to True to use streaming mode\n :type stream: bool\n :return: Response from upstream host\n :rtype: requests.Response\n ' try: return requests.reque...
d80f6ba1b6404055bf5cf2f51f4d66456d25fe50875f70f6667680706000979d
@classmethod def initialize_cache(cls) -> None: '\n Initialize the cache dictionary\n ' cls.proxy_request_cache = defaultdict((lambda : defaultdict(dict)))
Initialize the cache dictionary
proxy.py
initialize_cache
AndrewSchenck/flask-restful-proxy
2
python
@classmethod def initialize_cache(cls) -> None: '\n \n ' cls.proxy_request_cache = defaultdict((lambda : defaultdict(dict)))
@classmethod def initialize_cache(cls) -> None: '\n \n ' cls.proxy_request_cache = defaultdict((lambda : defaultdict(dict)))<|docstring|>Initialize the cache dictionary<|endoftext|>
8011b98ef08273ed613335243c646410d00cd1421e1070917c43d952a6ce609c
@property def headers(self) -> dict: '\n The HTTP headers for the proxy request\n\n :return: HTTP headers\n :rtype: dict\n ' try: return (self.upstream.headers if self.upstream else None) except AttributeError as e: raise APIRequestProxyError('Proxy Error: {}'.for...
The HTTP headers for the proxy request :return: HTTP headers :rtype: dict
proxy.py
headers
AndrewSchenck/flask-restful-proxy
2
python
@property def headers(self) -> dict: '\n The HTTP headers for the proxy request\n\n :return: HTTP headers\n :rtype: dict\n ' try: return (self.upstream.headers if self.upstream else None) except AttributeError as e: raise APIRequestProxyError('Proxy Error: {}'.for...
@property def headers(self) -> dict: '\n The HTTP headers for the proxy request\n\n :return: HTTP headers\n :rtype: dict\n ' try: return (self.upstream.headers if self.upstream else None) except AttributeError as e: raise APIRequestProxyError('Proxy Error: {}'.for...
a32eaf874e5cbcf43e5d2e3fa45123af5c2a353abbca2d9118774c1a660ec681
@headers.setter def headers(self, value: dict) -> None: '\n The HTTP headers for the proxy request\n\n :param value: HTTP headers\n :type value: dict\n ' try: if self.upstream: self.upstream.headers.update(value) except (TypeError, AttributeError) as e: ...
The HTTP headers for the proxy request :param value: HTTP headers :type value: dict
proxy.py
headers
AndrewSchenck/flask-restful-proxy
2
python
@headers.setter def headers(self, value: dict) -> None: '\n The HTTP headers for the proxy request\n\n :param value: HTTP headers\n :type value: dict\n ' try: if self.upstream: self.upstream.headers.update(value) except (TypeError, AttributeError) as e: ...
@headers.setter def headers(self, value: dict) -> None: '\n The HTTP headers for the proxy request\n\n :param value: HTTP headers\n :type value: dict\n ' try: if self.upstream: self.upstream.headers.update(value) except (TypeError, AttributeError) as e: ...
40bdcfe150e15970877296c2adf35d5bc5c3da69d87284f3939b9db3843ce71f
@property def method(self) -> str: '\n The HTTP verb for the proxy request\n\n :return: HTTP verb\n :rtype: str\n ' try: return (self.upstream.method if self.upstream else None) except AttributeError as e: raise APIRequestProxyError('Proxy Error: {}'.format(str(e)...
The HTTP verb for the proxy request :return: HTTP verb :rtype: str
proxy.py
method
AndrewSchenck/flask-restful-proxy
2
python
@property def method(self) -> str: '\n The HTTP verb for the proxy request\n\n :return: HTTP verb\n :rtype: str\n ' try: return (self.upstream.method if self.upstream else None) except AttributeError as e: raise APIRequestProxyError('Proxy Error: {}'.format(str(e)...
@property def method(self) -> str: '\n The HTTP verb for the proxy request\n\n :return: HTTP verb\n :rtype: str\n ' try: return (self.upstream.method if self.upstream else None) except AttributeError as e: raise APIRequestProxyError('Proxy Error: {}'.format(str(e)...
5ea2199ca357e44619c31436b64cb6cc09f67b7da6859cf392c35b68280e2f51
@method.setter def method(self, value: str) -> None: '\n The HTTP verb for the proxy request\n\n :param value: HTTP verb\n :type value: str\n ' try: if self.upstream: self.upstream.method = value except AttributeError as e: raise APIRequestProxyError('...
The HTTP verb for the proxy request :param value: HTTP verb :type value: str
proxy.py
method
AndrewSchenck/flask-restful-proxy
2
python
@method.setter def method(self, value: str) -> None: '\n The HTTP verb for the proxy request\n\n :param value: HTTP verb\n :type value: str\n ' try: if self.upstream: self.upstream.method = value except AttributeError as e: raise APIRequestProxyError('...
@method.setter def method(self, value: str) -> None: '\n The HTTP verb for the proxy request\n\n :param value: HTTP verb\n :type value: str\n ' try: if self.upstream: self.upstream.method = value except AttributeError as e: raise APIRequestProxyError('...
6300557f9356a4e0f3462fdca2cf60cc8d73977f1d524c63560a9e32b9fcdd65
@property def url(self) -> str: '\n The URL for the proxy request\n :return: URL\n :rtype: str\n ' try: return (self.upstream.url if self.upstream else None) except AttributeError as e: raise APIRequestProxyError('Proxy Error: {}'.format(str(e))) from e
The URL for the proxy request :return: URL :rtype: str
proxy.py
url
AndrewSchenck/flask-restful-proxy
2
python
@property def url(self) -> str: '\n The URL for the proxy request\n :return: URL\n :rtype: str\n ' try: return (self.upstream.url if self.upstream else None) except AttributeError as e: raise APIRequestProxyError('Proxy Error: {}'.format(str(e))) from e
@property def url(self) -> str: '\n The URL for the proxy request\n :return: URL\n :rtype: str\n ' try: return (self.upstream.url if self.upstream else None) except AttributeError as e: raise APIRequestProxyError('Proxy Error: {}'.format(str(e))) from e<|docstring...
8312d99d0b7a47e68a3c48295dd1a13731e6c91bbb697813086009f4d72fecad
@url.setter def url(self, value: str) -> None: '\n The URL for the proxy request\n\n :param value: URL\n :type value: str\n ' try: if self.upstream: self.upstream.url = value except AttributeError as e: raise APIRequestProxyError('Proxy Error: {}'.form...
The URL for the proxy request :param value: URL :type value: str
proxy.py
url
AndrewSchenck/flask-restful-proxy
2
python
@url.setter def url(self, value: str) -> None: '\n The URL for the proxy request\n\n :param value: URL\n :type value: str\n ' try: if self.upstream: self.upstream.url = value except AttributeError as e: raise APIRequestProxyError('Proxy Error: {}'.form...
@url.setter def url(self, value: str) -> None: '\n The URL for the proxy request\n\n :param value: URL\n :type value: str\n ' try: if self.upstream: self.upstream.url = value except AttributeError as e: raise APIRequestProxyError('Proxy Error: {}'.form...
d56d332d6f0c8e15cc88ed5c4e521a3d46cbe5966ead2513836c63ac98ad5532
@property def payload(self) -> dict: '\n The optional request payload data to be passed on to the\n upstream request as json\n\n :return: Request payload\n :rtype: dict\n ' try: return (self.upstream.payload if self.upstream else None) except AttributeError as e: ...
The optional request payload data to be passed on to the upstream request as json :return: Request payload :rtype: dict
proxy.py
payload
AndrewSchenck/flask-restful-proxy
2
python
@property def payload(self) -> dict: '\n The optional request payload data to be passed on to the\n upstream request as json\n\n :return: Request payload\n :rtype: dict\n ' try: return (self.upstream.payload if self.upstream else None) except AttributeError as e: ...
@property def payload(self) -> dict: '\n The optional request payload data to be passed on to the\n upstream request as json\n\n :return: Request payload\n :rtype: dict\n ' try: return (self.upstream.payload if self.upstream else None) except AttributeError as e: ...
a237ecd3626fd1b95d5b7dcd0e6c6e9d8a66bc958fcb8f663742b803af070263
@payload.setter def payload(self, value: dict) -> None: '\n The data value of the payload is passed upstream, while\n the meta value controls our own behavior\n\n :param value: Request payload data\n :type value: dict\n ' try: self.upstream.payload = value.get('data') ...
The data value of the payload is passed upstream, while the meta value controls our own behavior :param value: Request payload data :type value: dict
proxy.py
payload
AndrewSchenck/flask-restful-proxy
2
python
@payload.setter def payload(self, value: dict) -> None: '\n The data value of the payload is passed upstream, while\n the meta value controls our own behavior\n\n :param value: Request payload data\n :type value: dict\n ' try: self.upstream.payload = value.get('data') ...
@payload.setter def payload(self, value: dict) -> None: '\n The data value of the payload is passed upstream, while\n the meta value controls our own behavior\n\n :param value: Request payload data\n :type value: dict\n ' try: self.upstream.payload = value.get('data') ...
859da9039de5e75e70ac1d87463868d1f6d2f59bfd73418b06773c02bc7ae7e8
@property def enable_cache(self) -> bool: '\n True if request caching is enabled\n\n :return: True if request caching is enabled\n :rtype: bool\n ' return self._enable_cache
True if request caching is enabled :return: True if request caching is enabled :rtype: bool
proxy.py
enable_cache
AndrewSchenck/flask-restful-proxy
2
python
@property def enable_cache(self) -> bool: '\n True if request caching is enabled\n\n :return: True if request caching is enabled\n :rtype: bool\n ' return self._enable_cache
@property def enable_cache(self) -> bool: '\n True if request caching is enabled\n\n :return: True if request caching is enabled\n :rtype: bool\n ' return self._enable_cache<|docstring|>True if request caching is enabled :return: True if request caching is enabled :rtype: bool<|endo...
7edbc95dabe5ab454dd0543ae113f374d77698802fa907ca599423b59ec9d302
@enable_cache.setter def enable_cache(self, value: bool) -> None: '\n True if request caching is enabled\n\n :param value: enable_cache\n :type value: bool\n ' self._enable_cache = (value if (self.method in PROXY_CACHE_METHODS) else False)
True if request caching is enabled :param value: enable_cache :type value: bool
proxy.py
enable_cache
AndrewSchenck/flask-restful-proxy
2
python
@enable_cache.setter def enable_cache(self, value: bool) -> None: '\n True if request caching is enabled\n\n :param value: enable_cache\n :type value: bool\n ' self._enable_cache = (value if (self.method in PROXY_CACHE_METHODS) else False)
@enable_cache.setter def enable_cache(self, value: bool) -> None: '\n True if request caching is enabled\n\n :param value: enable_cache\n :type value: bool\n ' self._enable_cache = (value if (self.method in PROXY_CACHE_METHODS) else False)<|docstring|>True if request caching is enabl...
f1f3c4dbffac9cb42c4eba230e1dd70d9fd4d656313f97c8a2b22f956e7e2b2e
@property def cache_age(self) -> int: '\n If request caching is being used, the time in seconds to\n cache the object\n\n :return: Request cache timer, in seconds\n :rtype: int\n ' return self._cache_age
If request caching is being used, the time in seconds to cache the object :return: Request cache timer, in seconds :rtype: int
proxy.py
cache_age
AndrewSchenck/flask-restful-proxy
2
python
@property def cache_age(self) -> int: '\n If request caching is being used, the time in seconds to\n cache the object\n\n :return: Request cache timer, in seconds\n :rtype: int\n ' return self._cache_age
@property def cache_age(self) -> int: '\n If request caching is being used, the time in seconds to\n cache the object\n\n :return: Request cache timer, in seconds\n :rtype: int\n ' return self._cache_age<|docstring|>If request caching is being used, the time in seconds to cach...
f5174cc7f3c0737c4e3f1f53721f524dccf85145303043e18c4b963ecdaa2cbe
@cache_age.setter def cache_age(self, value: int) -> None: '\n If request caching is being used, the time in seconds to\n cache the object\n\n :param value: The time to cache the response\n :type value: int\n ' self._cache_age = (value if (value >= 0) else PROXY_CACHE_AGE)
If request caching is being used, the time in seconds to cache the object :param value: The time to cache the response :type value: int
proxy.py
cache_age
AndrewSchenck/flask-restful-proxy
2
python
@cache_age.setter def cache_age(self, value: int) -> None: '\n If request caching is being used, the time in seconds to\n cache the object\n\n :param value: The time to cache the response\n :type value: int\n ' self._cache_age = (value if (value >= 0) else PROXY_CACHE_AGE)
@cache_age.setter def cache_age(self, value: int) -> None: '\n If request caching is being used, the time in seconds to\n cache the object\n\n :param value: The time to cache the response\n :type value: int\n ' self._cache_age = (value if (value >= 0) else PROXY_CACHE_AGE)<|do...
7119a0d734aac667741efca14a35a26aa1ed2941f05a0961ab88b25e5df4b1c7
@property def proxy_request(self) -> dict: '\n A dictionary describing the upstream request to proxy\n\n :return:\n :rtype:\n :return: Request to proxy\n :rtype: dict\n ' return self._proxy_request
A dictionary describing the upstream request to proxy :return: :rtype: :return: Request to proxy :rtype: dict
proxy.py
proxy_request
AndrewSchenck/flask-restful-proxy
2
python
@property def proxy_request(self) -> dict: '\n A dictionary describing the upstream request to proxy\n\n :return:\n :rtype:\n :return: Request to proxy\n :rtype: dict\n ' return self._proxy_request
@property def proxy_request(self) -> dict: '\n A dictionary describing the upstream request to proxy\n\n :return:\n :rtype:\n :return: Request to proxy\n :rtype: dict\n ' return self._proxy_request<|docstring|>A dictionary describing the upstream request to proxy :retu...
05698b9bcd97936c88a5b13b57c65121ee0ba17523d9922fa9343a954e0de0ac
@proxy_request.setter def proxy_request(self, value: dict) -> None: '\n A dictionary describing the upstream request to proxy\n\n :param value: Request to proxy\n :type value: dict\n ' try: self.method = value['method'] self.url = value['url'] self.headers = v...
A dictionary describing the upstream request to proxy :param value: Request to proxy :type value: dict
proxy.py
proxy_request
AndrewSchenck/flask-restful-proxy
2
python
@proxy_request.setter def proxy_request(self, value: dict) -> None: '\n A dictionary describing the upstream request to proxy\n\n :param value: Request to proxy\n :type value: dict\n ' try: self.method = value['method'] self.url = value['url'] self.headers = v...
@proxy_request.setter def proxy_request(self, value: dict) -> None: '\n A dictionary describing the upstream request to proxy\n\n :param value: Request to proxy\n :type value: dict\n ' try: self.method = value['method'] self.url = value['url'] self.headers = v...
46bbdaea2121b0b6a086cfb9d2ee31424d5cc9f54273e9d2db4eb89c2686a1a5
@property def chunk_size(self) -> int: '\n When in streaming mode, the size of the generator buffer\n\n :return: Streaming chunk size\n :rtype: int\n ' return self.proxy_request.get('chunk_size', PROXY_CHUNK_SIZE)
When in streaming mode, the size of the generator buffer :return: Streaming chunk size :rtype: int
proxy.py
chunk_size
AndrewSchenck/flask-restful-proxy
2
python
@property def chunk_size(self) -> int: '\n When in streaming mode, the size of the generator buffer\n\n :return: Streaming chunk size\n :rtype: int\n ' return self.proxy_request.get('chunk_size', PROXY_CHUNK_SIZE)
@property def chunk_size(self) -> int: '\n When in streaming mode, the size of the generator buffer\n\n :return: Streaming chunk size\n :rtype: int\n ' return self.proxy_request.get('chunk_size', PROXY_CHUNK_SIZE)<|docstring|>When in streaming mode, the size of the generator buffer ...
6cc7e44615e8b7dafab916571beab0c5605ed890b61a50e4ebc731ccf496666f
@property def status_passthrough(self) -> bool: "\n If True, instead of passing through HTTP status as received\n from the upstream, we set the status code ourselves (only\n applies to 2XX codes)\n\n :return: True to set status, False to pass on the 'real'\n status\n ...
If True, instead of passing through HTTP status as received from the upstream, we set the status code ourselves (only applies to 2XX codes) :return: True to set status, False to pass on the 'real' status :rtype: bool
proxy.py
status_passthrough
AndrewSchenck/flask-restful-proxy
2
python
@property def status_passthrough(self) -> bool: "\n If True, instead of passing through HTTP status as received\n from the upstream, we set the status code ourselves (only\n applies to 2XX codes)\n\n :return: True to set status, False to pass on the 'real'\n status\n ...
@property def status_passthrough(self) -> bool: "\n If True, instead of passing through HTTP status as received\n from the upstream, we set the status code ourselves (only\n applies to 2XX codes)\n\n :return: True to set status, False to pass on the 'real'\n status\n ...
8e7aac9f8a97209fdf360211652a40eed6a7cde15c4b4b4a002ce020621457e1
def response_from_upstream(self) -> Response: '\n Open an upstream request and return the resulting Response\n\n :return: Response from upstream\n :rtype: Response\n ' try: upstream_request = self.upstream.make_request() response = Response(response=upstream_request.c...
Open an upstream request and return the resulting Response :return: Response from upstream :rtype: Response
proxy.py
response_from_upstream
AndrewSchenck/flask-restful-proxy
2
python
def response_from_upstream(self) -> Response: '\n Open an upstream request and return the resulting Response\n\n :return: Response from upstream\n :rtype: Response\n ' try: upstream_request = self.upstream.make_request() response = Response(response=upstream_request.c...
def response_from_upstream(self) -> Response: '\n Open an upstream request and return the resulting Response\n\n :return: Response from upstream\n :rtype: Response\n ' try: upstream_request = self.upstream.make_request() response = Response(response=upstream_request.c...
42e4728f009d9452b8773ac60ba396a731d2a5d7cdbadb73de676e422d141ee6
def response_from_cache(self) -> Response: '\n Fetch the requested Response from cache, if valid, otherwise\n fall back to making an upstream request\n\n :return: Response from upstream\n :rtype: Response\n ' try: if (time() < self.proxy_request_cache[self.method][self...
Fetch the requested Response from cache, if valid, otherwise fall back to making an upstream request :return: Response from upstream :rtype: Response
proxy.py
response_from_cache
AndrewSchenck/flask-restful-proxy
2
python
def response_from_cache(self) -> Response: '\n Fetch the requested Response from cache, if valid, otherwise\n fall back to making an upstream request\n\n :return: Response from upstream\n :rtype: Response\n ' try: if (time() < self.proxy_request_cache[self.method][self...
def response_from_cache(self) -> Response: '\n Fetch the requested Response from cache, if valid, otherwise\n fall back to making an upstream request\n\n :return: Response from upstream\n :rtype: Response\n ' try: if (time() < self.proxy_request_cache[self.method][self...
45bc1bf095fc2fbb3b11759fd17aec9a4db200551f7223f68aac676a5e7c6874
def make_response(self) -> None: '\n Create a response out of the results from the upstream\n request\n ' if (self.enable_cache is True): self.response = self.response_from_cache() else: self.response = self.response_from_upstream()
Create a response out of the results from the upstream request
proxy.py
make_response
AndrewSchenck/flask-restful-proxy
2
python
def make_response(self) -> None: '\n Create a response out of the results from the upstream\n request\n ' if (self.enable_cache is True): self.response = self.response_from_cache() else: self.response = self.response_from_upstream()
def make_response(self) -> None: '\n Create a response out of the results from the upstream\n request\n ' if (self.enable_cache is True): self.response = self.response_from_cache() else: self.response = self.response_from_upstream()<|docstring|>Create a response out of t...
4ead8895b0b88cb970e50194e3be2251a7b954d233ec412e533bf8a175971b87
def stream_response(self) -> Response: '\n Streaming mode -- stream the upstream request through to the\n client using an iterator, enabling efficient fetching of\n larger payloads\n\n :return: The response from the upstream\n :rtype: Response\n ' try: upstream_...
Streaming mode -- stream the upstream request through to the client using an iterator, enabling efficient fetching of larger payloads :return: The response from the upstream :rtype: Response
proxy.py
stream_response
AndrewSchenck/flask-restful-proxy
2
python
def stream_response(self) -> Response: '\n Streaming mode -- stream the upstream request through to the\n client using an iterator, enabling efficient fetching of\n larger payloads\n\n :return: The response from the upstream\n :rtype: Response\n ' try: upstream_...
def stream_response(self) -> Response: '\n Streaming mode -- stream the upstream request through to the\n client using an iterator, enabling efficient fetching of\n larger payloads\n\n :return: The response from the upstream\n :rtype: Response\n ' try: upstream_...
88aecb5d2fbbca7066888f1e23ac07763c763d36749c6ade54734707ed4c24ba
def __init__(self, f, M=30, N=60, emax=1e-08, imax=1000): '\n Initializes the optimizer.\n\n To create an optimizer of this type, instantiate the class with the\n parameters given below:\n\n :Parameters:\n f\n A multivariable function to be optimized. The function sho...
Initializes the optimizer. To create an optimizer of this type, instantiate the class with the parameters given below: :Parameters: f A multivariable function to be optimized. The function should have only one parameter, a multidimensional line-vector, and return the function value, a scalar. M Si...
lib/peach/peach/optm/stochastic.py
__init__
serddmitry/goog_challenge
1
python
def __init__(self, f, M=30, N=60, emax=1e-08, imax=1000): '\n Initializes the optimizer.\n\n To create an optimizer of this type, instantiate the class with the\n parameters given below:\n\n :Parameters:\n f\n A multivariable function to be optimized. The function sho...
def __init__(self, f, M=30, N=60, emax=1e-08, imax=1000): '\n Initializes the optimizer.\n\n To create an optimizer of this type, instantiate the class with the\n parameters given below:\n\n :Parameters:\n f\n A multivariable function to be optimized. The function sho...
d7bf937164f292bd174222ef07d3c9c242a95f02850d46e09b5f389c10ec41f5
def step(self): '\n One step of the search (*NOT IMPLEMENTED YET*)\n\n In this method, the solution set is searched for the M best solutions.\n Mean and variance of these solutions is calculated, and these values are\n used to randomly generate, from a gaussian distribution, a set of N n...
One step of the search (*NOT IMPLEMENTED YET*) In this method, the solution set is searched for the M best solutions. Mean and variance of these solutions is calculated, and these values are used to randomly generate, from a gaussian distribution, a set of N new solutions.
lib/peach/peach/optm/stochastic.py
step
serddmitry/goog_challenge
1
python
def step(self): '\n One step of the search (*NOT IMPLEMENTED YET*)\n\n In this method, the solution set is searched for the M best solutions.\n Mean and variance of these solutions is calculated, and these values are\n used to randomly generate, from a gaussian distribution, a set of N n...
def step(self): '\n One step of the search (*NOT IMPLEMENTED YET*)\n\n In this method, the solution set is searched for the M best solutions.\n Mean and variance of these solutions is calculated, and these values are\n used to randomly generate, from a gaussian distribution, a set of N n...
49937b8bffef21dfb953fdce84a319b11b88d9a4e0a537a9acc77c85c9271ee7
def __init__(self, uri, extent, crs_transformer, tmp_dir, class_map=None): 'Constructor.\n\n Args:\n uri: (str) URI of GeoTIFF file used for storing predictions as RGB values\n crs_transformer: (CRSTransformer)\n tmp_dir: (str) temp directory to use\n class_map: (C...
Constructor. Args: uri: (str) URI of GeoTIFF file used for storing predictions as RGB values crs_transformer: (CRSTransformer) tmp_dir: (str) temp directory to use class_map: (ClassMap) with color values used to convert class ids to RGB values
rastervision/data/label_store/semantic_segmentation_raster_store.py
__init__
AirbusAerial/raster-vision
2
python
def __init__(self, uri, extent, crs_transformer, tmp_dir, class_map=None): 'Constructor.\n\n Args:\n uri: (str) URI of GeoTIFF file used for storing predictions as RGB values\n crs_transformer: (CRSTransformer)\n tmp_dir: (str) temp directory to use\n class_map: (C...
def __init__(self, uri, extent, crs_transformer, tmp_dir, class_map=None): 'Constructor.\n\n Args:\n uri: (str) URI of GeoTIFF file used for storing predictions as RGB values\n crs_transformer: (CRSTransformer)\n tmp_dir: (str) temp directory to use\n class_map: (C...
7e39cc6e00f479e5c0387ae79fbac60a09eadc41f666b6e259e156df62217899
def get_labels(self): 'Get all labels.\n\n Returns:\n SemanticSegmentationLabels\n ' source = rv.RasterSourceConfig.builder(rv.GEOTIFF_SOURCE).with_uri(self.uri).build().create_source(self.tmp_dir) with source.activate(): raw_labels = source.get_raw_image_array() if ...
Get all labels. Returns: SemanticSegmentationLabels
rastervision/data/label_store/semantic_segmentation_raster_store.py
get_labels
AirbusAerial/raster-vision
2
python
def get_labels(self): 'Get all labels.\n\n Returns:\n SemanticSegmentationLabels\n ' source = rv.RasterSourceConfig.builder(rv.GEOTIFF_SOURCE).with_uri(self.uri).build().create_source(self.tmp_dir) with source.activate(): raw_labels = source.get_raw_image_array() if ...
def get_labels(self): 'Get all labels.\n\n Returns:\n SemanticSegmentationLabels\n ' source = rv.RasterSourceConfig.builder(rv.GEOTIFF_SOURCE).with_uri(self.uri).build().create_source(self.tmp_dir) with source.activate(): raw_labels = source.get_raw_image_array() if ...
094ad649eb2c7bce5c335e6c297214b43195da00c3b537a196c6c01969aa55c1
def save(self, labels): 'Save.\n\n Args:\n labels - (SemanticSegmentationLabels) labels to be saved\n ' local_path = get_local_path(self.uri, self.tmp_dir) make_dir(local_path, use_dirname=True) transform = self.crs_transformer.transform crs = self.crs_transformer.get_image_...
Save. Args: labels - (SemanticSegmentationLabels) labels to be saved
rastervision/data/label_store/semantic_segmentation_raster_store.py
save
AirbusAerial/raster-vision
2
python
def save(self, labels): 'Save.\n\n Args:\n labels - (SemanticSegmentationLabels) labels to be saved\n ' local_path = get_local_path(self.uri, self.tmp_dir) make_dir(local_path, use_dirname=True) transform = self.crs_transformer.transform crs = self.crs_transformer.get_image_...
def save(self, labels): 'Save.\n\n Args:\n labels - (SemanticSegmentationLabels) labels to be saved\n ' local_path = get_local_path(self.uri, self.tmp_dir) make_dir(local_path, use_dirname=True) transform = self.crs_transformer.transform crs = self.crs_transformer.get_image_...
504460944c53e28a19455363ed3823bd346a6972ff848d4fb40c6626a6a21dd1
def empty_labels(self): 'Returns an empty SemanticSegmentationLabels object.' return SemanticSegmentationLabels()
Returns an empty SemanticSegmentationLabels object.
rastervision/data/label_store/semantic_segmentation_raster_store.py
empty_labels
AirbusAerial/raster-vision
2
python
def empty_labels(self): return SemanticSegmentationLabels()
def empty_labels(self): return SemanticSegmentationLabels()<|docstring|>Returns an empty SemanticSegmentationLabels object.<|endoftext|>
01f09e3f0aed8455fef78a0f4739e555e1a8f5b087ae1d9fabfd92e9ef0707de
@require_GET @staff_member_required def customer(request, customer_id): '\n Method: GET\n Path: /api/customer/<id>\n Get given customer:\n - id: the customer ID\n Return: the customer as Json\n ' return Customer.objects.get(id=customer_id)
Method: GET Path: /api/customer/<id> Get given customer: - id: the customer ID Return: the customer as Json
api/views.py
customer
c4s4/backend
1
python
@require_GET @staff_member_required def customer(request, customer_id): '\n Method: GET\n Path: /api/customer/<id>\n Get given customer:\n - id: the customer ID\n Return: the customer as Json\n ' return Customer.objects.get(id=customer_id)
@require_GET @staff_member_required def customer(request, customer_id): '\n Method: GET\n Path: /api/customer/<id>\n Get given customer:\n - id: the customer ID\n Return: the customer as Json\n ' return Customer.objects.get(id=customer_id)<|docstring|>Method: GET Path: /api/customer/<id> Get g...
feea756b2b003c728730b93c716368571e796f4aed33336c1a2329fe90e4fbff
@require_POST @staff_member_required def customer_create(request): '\n Method: POST\n Path: /api/customer/create\n Create a customer:\n - data: customer fields as json in request body\n Return: nothing\n ' json_to_model(request.body.decode('utf-8'), Customer).save() return HttpResponse()
Method: POST Path: /api/customer/create Create a customer: - data: customer fields as json in request body Return: nothing
api/views.py
customer_create
c4s4/backend
1
python
@require_POST @staff_member_required def customer_create(request): '\n Method: POST\n Path: /api/customer/create\n Create a customer:\n - data: customer fields as json in request body\n Return: nothing\n ' json_to_model(request.body.decode('utf-8'), Customer).save() return HttpResponse()
@require_POST @staff_member_required def customer_create(request): '\n Method: POST\n Path: /api/customer/create\n Create a customer:\n - data: customer fields as json in request body\n Return: nothing\n ' json_to_model(request.body.decode('utf-8'), Customer).save() return HttpResponse()<|...
5ca54a8ddddbe77b44e1a486ba5401cc6e08be40cda21f2dd636347653b6e62f
@require_GET @staff_member_required def customer_search(request): "\n Method: GET\n Path: /api/customer/search<id>\n Search for customers. Search parameters are passed as URL parameters. Thus to get customers\n with named Bob, you would add parameters '?first_name=Bob'.\n Return: the customers list\n...
Method: GET Path: /api/customer/search<id> Search for customers. Search parameters are passed as URL parameters. Thus to get customers with named Bob, you would add parameters '?first_name=Bob'. Return: the customers list
api/views.py
customer_search
c4s4/backend
1
python
@require_GET @staff_member_required def customer_search(request): "\n Method: GET\n Path: /api/customer/search<id>\n Search for customers. Search parameters are passed as URL parameters. Thus to get customers\n with named Bob, you would add parameters '?first_name=Bob'.\n Return: the customers list\n...
@require_GET @staff_member_required def customer_search(request): "\n Method: GET\n Path: /api/customer/search<id>\n Search for customers. Search parameters are passed as URL parameters. Thus to get customers\n with named Bob, you would add parameters '?first_name=Bob'.\n Return: the customers list\n...
dfe6cce846435997ce59b6f1d3c6dbdf01fa8796fd735e1f0443771de8431e4c
def __init__(self): ' \n Configuration parameters for each frame: tuned in main_images.py\n ' self.sobel_kernel = 3 self.thresh_color_s_channel = (80, 255) self.thresh_sobel_x = (20, 100) self.thresh_dir_gradient = (0.7, 1.3) self.thresh_magnitude = (30, 100) self.left_low = (1...
Configuration parameters for each frame: tuned in main_images.py
source/lane_detection.py
__init__
48cfu/CarND-Advanced-Lane-Lines
0
python
def __init__(self): ' \n \n ' self.sobel_kernel = 3 self.thresh_color_s_channel = (80, 255) self.thresh_sobel_x = (20, 100) self.thresh_dir_gradient = (0.7, 1.3) self.thresh_magnitude = (30, 100) self.left_low = (100, 720) self.left_high = (600, 450) self.right_low = (1...
def __init__(self): ' \n \n ' self.sobel_kernel = 3 self.thresh_color_s_channel = (80, 255) self.thresh_sobel_x = (20, 100) self.thresh_dir_gradient = (0.7, 1.3) self.thresh_magnitude = (30, 100) self.left_low = (100, 720) self.left_high = (600, 450) self.right_low = (1...
0b9ffb7c76f0e2730319b72f07adeb7aaa5eacd369fedf1ecc5e3516b8392841
def region_of_interest(self, img, vertices): '\n Applies an image mask.\n \n Only keeps the region of the image defined by the polygon\n formed from `vertices`. The rest of the image is set to black.\n `vertices` should be a numpy array of integer points.\n ' mask = np....
Applies an image mask. Only keeps the region of the image defined by the polygon formed from `vertices`. The rest of the image is set to black. `vertices` should be a numpy array of integer points.
source/lane_detection.py
region_of_interest
48cfu/CarND-Advanced-Lane-Lines
0
python
def region_of_interest(self, img, vertices): '\n Applies an image mask.\n \n Only keeps the region of the image defined by the polygon\n formed from `vertices`. The rest of the image is set to black.\n `vertices` should be a numpy array of integer points.\n ' mask = np....
def region_of_interest(self, img, vertices): '\n Applies an image mask.\n \n Only keeps the region of the image defined by the polygon\n formed from `vertices`. The rest of the image is set to black.\n `vertices` should be a numpy array of integer points.\n ' mask = np....