body stringlengths 26 98.2k | body_hash int64 -9,222,864,604,528,158,000 9,221,803,474B | docstring stringlengths 1 16.8k | path stringlengths 5 230 | name stringlengths 1 96 | repository_name stringlengths 7 89 | lang stringclasses 1
value | body_without_docstring stringlengths 20 98.2k |
|---|---|---|---|---|---|---|---|
def find_job_id_by_name(self, job_name: str) -> Optional[int]:
'\n Finds job id by its name. If there are multiple jobs with the same name, raises AirflowException.\n\n :param job_name: The name of the job to look up.\n :return: The job_id as an int or None if no job was found.\n '
a... | -3,557,110,850,345,249,300 | Finds job id by its name. If there are multiple jobs with the same name, raises AirflowException.
:param job_name: The name of the job to look up.
:return: The job_id as an int or None if no job was found. | airflow/providers/databricks/hooks/databricks.py | find_job_id_by_name | AMS-Kepler/airflow | python | def find_job_id_by_name(self, job_name: str) -> Optional[int]:
'\n Finds job id by its name. If there are multiple jobs with the same name, raises AirflowException.\n\n :param job_name: The name of the job to look up.\n :return: The job_id as an int or None if no job was found.\n '
a... |
def get_run_page_url(self, run_id: int) -> str:
'\n Retrieves run_page_url.\n\n :param run_id: id of the run\n :return: URL of the run page\n '
json = {'run_id': run_id}
response = self._do_api_call(GET_RUN_ENDPOINT, json)
return response['run_page_url'] | 3,152,716,416,204,417,000 | Retrieves run_page_url.
:param run_id: id of the run
:return: URL of the run page | airflow/providers/databricks/hooks/databricks.py | get_run_page_url | AMS-Kepler/airflow | python | def get_run_page_url(self, run_id: int) -> str:
'\n Retrieves run_page_url.\n\n :param run_id: id of the run\n :return: URL of the run page\n '
json = {'run_id': run_id}
response = self._do_api_call(GET_RUN_ENDPOINT, json)
return response['run_page_url'] |
def get_job_id(self, run_id: int) -> int:
'\n Retrieves job_id from run_id.\n\n :param run_id: id of the run\n :return: Job id for given Databricks run\n '
json = {'run_id': run_id}
response = self._do_api_call(GET_RUN_ENDPOINT, json)
return response['job_id'] | -6,716,865,040,276,354,000 | Retrieves job_id from run_id.
:param run_id: id of the run
:return: Job id for given Databricks run | airflow/providers/databricks/hooks/databricks.py | get_job_id | AMS-Kepler/airflow | python | def get_job_id(self, run_id: int) -> int:
'\n Retrieves job_id from run_id.\n\n :param run_id: id of the run\n :return: Job id for given Databricks run\n '
json = {'run_id': run_id}
response = self._do_api_call(GET_RUN_ENDPOINT, json)
return response['job_id'] |
def get_run_state(self, run_id: int) -> RunState:
'\n Retrieves run state of the run.\n\n Please note that any Airflow tasks that call the ``get_run_state`` method will result in\n failure unless you have enabled xcom pickling. This can be done using the following\n environment variable... | 4,658,948,002,425,555,000 | Retrieves run state of the run.
Please note that any Airflow tasks that call the ``get_run_state`` method will result in
failure unless you have enabled xcom pickling. This can be done using the following
environment variable: ``AIRFLOW__CORE__ENABLE_XCOM_PICKLING``
If you do not want to enable xcom pickling, use th... | airflow/providers/databricks/hooks/databricks.py | get_run_state | AMS-Kepler/airflow | python | def get_run_state(self, run_id: int) -> RunState:
'\n Retrieves run state of the run.\n\n Please note that any Airflow tasks that call the ``get_run_state`` method will result in\n failure unless you have enabled xcom pickling. This can be done using the following\n environment variable... |
def get_run_state_str(self, run_id: int) -> str:
'\n Return the string representation of RunState.\n\n :param run_id: id of the run\n :return: string describing run state\n '
state = self.get_run_state(run_id)
run_state_str = f'State: {state.life_cycle_state}. Result: {state.resu... | 3,414,676,769,183,912,000 | Return the string representation of RunState.
:param run_id: id of the run
:return: string describing run state | airflow/providers/databricks/hooks/databricks.py | get_run_state_str | AMS-Kepler/airflow | python | def get_run_state_str(self, run_id: int) -> str:
'\n Return the string representation of RunState.\n\n :param run_id: id of the run\n :return: string describing run state\n '
state = self.get_run_state(run_id)
run_state_str = f'State: {state.life_cycle_state}. Result: {state.resu... |
def get_run_state_lifecycle(self, run_id: int) -> str:
'\n Returns the lifecycle state of the run\n\n :param run_id: id of the run\n :return: string with lifecycle state\n '
return self.get_run_state(run_id).life_cycle_state | 556,569,400,692,368,640 | Returns the lifecycle state of the run
:param run_id: id of the run
:return: string with lifecycle state | airflow/providers/databricks/hooks/databricks.py | get_run_state_lifecycle | AMS-Kepler/airflow | python | def get_run_state_lifecycle(self, run_id: int) -> str:
'\n Returns the lifecycle state of the run\n\n :param run_id: id of the run\n :return: string with lifecycle state\n '
return self.get_run_state(run_id).life_cycle_state |
def get_run_state_result(self, run_id: int) -> str:
'\n Returns the resulting state of the run\n\n :param run_id: id of the run\n :return: string with resulting state\n '
return self.get_run_state(run_id).result_state | -7,836,864,939,624,392,000 | Returns the resulting state of the run
:param run_id: id of the run
:return: string with resulting state | airflow/providers/databricks/hooks/databricks.py | get_run_state_result | AMS-Kepler/airflow | python | def get_run_state_result(self, run_id: int) -> str:
'\n Returns the resulting state of the run\n\n :param run_id: id of the run\n :return: string with resulting state\n '
return self.get_run_state(run_id).result_state |
def get_run_state_message(self, run_id: int) -> str:
'\n Returns the state message for the run\n\n :param run_id: id of the run\n :return: string with state message\n '
return self.get_run_state(run_id).state_message | -2,459,958,259,318,688,300 | Returns the state message for the run
:param run_id: id of the run
:return: string with state message | airflow/providers/databricks/hooks/databricks.py | get_run_state_message | AMS-Kepler/airflow | python | def get_run_state_message(self, run_id: int) -> str:
'\n Returns the state message for the run\n\n :param run_id: id of the run\n :return: string with state message\n '
return self.get_run_state(run_id).state_message |
def get_run_output(self, run_id: int) -> dict:
'\n Retrieves run output of the run.\n\n :param run_id: id of the run\n :return: output of the run\n '
json = {'run_id': run_id}
run_output = self._do_api_call(OUTPUT_RUNS_JOB_ENDPOINT, json)
return run_output | -1,827,507,862,642,975,700 | Retrieves run output of the run.
:param run_id: id of the run
:return: output of the run | airflow/providers/databricks/hooks/databricks.py | get_run_output | AMS-Kepler/airflow | python | def get_run_output(self, run_id: int) -> dict:
'\n Retrieves run output of the run.\n\n :param run_id: id of the run\n :return: output of the run\n '
json = {'run_id': run_id}
run_output = self._do_api_call(OUTPUT_RUNS_JOB_ENDPOINT, json)
return run_output |
def cancel_run(self, run_id: int) -> None:
'\n Cancels the run.\n\n :param run_id: id of the run\n '
json = {'run_id': run_id}
self._do_api_call(CANCEL_RUN_ENDPOINT, json) | -7,019,494,973,630,746,000 | Cancels the run.
:param run_id: id of the run | airflow/providers/databricks/hooks/databricks.py | cancel_run | AMS-Kepler/airflow | python | def cancel_run(self, run_id: int) -> None:
'\n Cancels the run.\n\n :param run_id: id of the run\n '
json = {'run_id': run_id}
self._do_api_call(CANCEL_RUN_ENDPOINT, json) |
def restart_cluster(self, json: dict) -> None:
'\n Restarts the cluster.\n\n :param json: json dictionary containing cluster specification.\n '
self._do_api_call(RESTART_CLUSTER_ENDPOINT, json) | 6,216,211,878,414,445,000 | Restarts the cluster.
:param json: json dictionary containing cluster specification. | airflow/providers/databricks/hooks/databricks.py | restart_cluster | AMS-Kepler/airflow | python | def restart_cluster(self, json: dict) -> None:
'\n Restarts the cluster.\n\n :param json: json dictionary containing cluster specification.\n '
self._do_api_call(RESTART_CLUSTER_ENDPOINT, json) |
def start_cluster(self, json: dict) -> None:
'\n Starts the cluster.\n\n :param json: json dictionary containing cluster specification.\n '
self._do_api_call(START_CLUSTER_ENDPOINT, json) | 1,305,953,017,967,516,700 | Starts the cluster.
:param json: json dictionary containing cluster specification. | airflow/providers/databricks/hooks/databricks.py | start_cluster | AMS-Kepler/airflow | python | def start_cluster(self, json: dict) -> None:
'\n Starts the cluster.\n\n :param json: json dictionary containing cluster specification.\n '
self._do_api_call(START_CLUSTER_ENDPOINT, json) |
def terminate_cluster(self, json: dict) -> None:
'\n Terminates the cluster.\n\n :param json: json dictionary containing cluster specification.\n '
self._do_api_call(TERMINATE_CLUSTER_ENDPOINT, json) | -5,048,575,919,681,346,000 | Terminates the cluster.
:param json: json dictionary containing cluster specification. | airflow/providers/databricks/hooks/databricks.py | terminate_cluster | AMS-Kepler/airflow | python | def terminate_cluster(self, json: dict) -> None:
'\n Terminates the cluster.\n\n :param json: json dictionary containing cluster specification.\n '
self._do_api_call(TERMINATE_CLUSTER_ENDPOINT, json) |
def install(self, json: dict) -> None:
'\n Install libraries on the cluster.\n\n Utility function to call the ``2.0/libraries/install`` endpoint.\n\n :param json: json dictionary containing cluster_id and an array of library\n '
self._do_api_call(INSTALL_LIBS_ENDPOINT, json) | -789,050,516,703,948,400 | Install libraries on the cluster.
Utility function to call the ``2.0/libraries/install`` endpoint.
:param json: json dictionary containing cluster_id and an array of library | airflow/providers/databricks/hooks/databricks.py | install | AMS-Kepler/airflow | python | def install(self, json: dict) -> None:
'\n Install libraries on the cluster.\n\n Utility function to call the ``2.0/libraries/install`` endpoint.\n\n :param json: json dictionary containing cluster_id and an array of library\n '
self._do_api_call(INSTALL_LIBS_ENDPOINT, json) |
def uninstall(self, json: dict) -> None:
'\n Uninstall libraries on the cluster.\n\n Utility function to call the ``2.0/libraries/uninstall`` endpoint.\n\n :param json: json dictionary containing cluster_id and an array of library\n '
self._do_api_call(UNINSTALL_LIBS_ENDPOINT, json) | -3,274,519,760,249,699,000 | Uninstall libraries on the cluster.
Utility function to call the ``2.0/libraries/uninstall`` endpoint.
:param json: json dictionary containing cluster_id and an array of library | airflow/providers/databricks/hooks/databricks.py | uninstall | AMS-Kepler/airflow | python | def uninstall(self, json: dict) -> None:
'\n Uninstall libraries on the cluster.\n\n Utility function to call the ``2.0/libraries/uninstall`` endpoint.\n\n :param json: json dictionary containing cluster_id and an array of library\n '
self._do_api_call(UNINSTALL_LIBS_ENDPOINT, json) |
def update_repo(self, repo_id: str, json: Dict[(str, Any)]) -> dict:
'\n Updates given Databricks Repos\n\n :param repo_id: ID of Databricks Repos\n :param json: payload\n :return: metadata from update\n '
repos_endpoint = ('PATCH', f'api/2.0/repos/{repo_id}')
return self.... | -8,024,518,480,074,445,000 | Updates given Databricks Repos
:param repo_id: ID of Databricks Repos
:param json: payload
:return: metadata from update | airflow/providers/databricks/hooks/databricks.py | update_repo | AMS-Kepler/airflow | python | def update_repo(self, repo_id: str, json: Dict[(str, Any)]) -> dict:
'\n Updates given Databricks Repos\n\n :param repo_id: ID of Databricks Repos\n :param json: payload\n :return: metadata from update\n '
repos_endpoint = ('PATCH', f'api/2.0/repos/{repo_id}')
return self.... |
def delete_repo(self, repo_id: str):
'\n Deletes given Databricks Repos\n\n :param repo_id: ID of Databricks Repos\n :return:\n '
repos_endpoint = ('DELETE', f'api/2.0/repos/{repo_id}')
self._do_api_call(repos_endpoint) | 5,674,904,661,011,425,000 | Deletes given Databricks Repos
:param repo_id: ID of Databricks Repos
:return: | airflow/providers/databricks/hooks/databricks.py | delete_repo | AMS-Kepler/airflow | python | def delete_repo(self, repo_id: str):
'\n Deletes given Databricks Repos\n\n :param repo_id: ID of Databricks Repos\n :return:\n '
repos_endpoint = ('DELETE', f'api/2.0/repos/{repo_id}')
self._do_api_call(repos_endpoint) |
def create_repo(self, json: Dict[(str, Any)]) -> dict:
'\n Creates a Databricks Repos\n\n :param json: payload\n :return:\n '
repos_endpoint = ('POST', 'api/2.0/repos')
return self._do_api_call(repos_endpoint, json) | -7,546,461,420,643,207,000 | Creates a Databricks Repos
:param json: payload
:return: | airflow/providers/databricks/hooks/databricks.py | create_repo | AMS-Kepler/airflow | python | def create_repo(self, json: Dict[(str, Any)]) -> dict:
'\n Creates a Databricks Repos\n\n :param json: payload\n :return:\n '
repos_endpoint = ('POST', 'api/2.0/repos')
return self._do_api_call(repos_endpoint, json) |
def get_repo_by_path(self, path: str) -> Optional[str]:
"\n Obtains Repos ID by path\n :param path: path to a repository\n :return: Repos ID if it exists, None if doesn't.\n "
try:
result = self._do_api_call(WORKSPACE_GET_STATUS_ENDPOINT, {'path': path}, wrap_http_errors=Fals... | 4,764,001,046,479,572,000 | Obtains Repos ID by path
:param path: path to a repository
:return: Repos ID if it exists, None if doesn't. | airflow/providers/databricks/hooks/databricks.py | get_repo_by_path | AMS-Kepler/airflow | python | def get_repo_by_path(self, path: str) -> Optional[str]:
"\n Obtains Repos ID by path\n :param path: path to a repository\n :return: Repos ID if it exists, None if doesn't.\n "
try:
result = self._do_api_call(WORKSPACE_GET_STATUS_ENDPOINT, {'path': path}, wrap_http_errors=Fals... |
def start(self):
'\n Placeholder, this detector just reads out whatever buffer is on the\n scancontrol device. That device is managed manually from macros.\n '
pass | 7,744,862,992,731,217,000 | Placeholder, this detector just reads out whatever buffer is on the
scancontrol device. That device is managed manually from macros. | contrast/detectors/LC400Buffer.py | start | alexbjorling/acquisition-framework | python | def start(self):
'\n Placeholder, this detector just reads out whatever buffer is on the\n scancontrol device. That device is managed manually from macros.\n '
pass |
def get_coco_dataset():
"A dummy COCO dataset that includes only the 'classes' field."
ds = AttrDict()
classes = ['__background__', 'person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train', 'truck', 'boat', 'traffic light', 'fire hydrant', 'stop sign', 'parking meter', 'bench', 'bird', 'cat', 'd... | 2,974,285,091,224,692,700 | A dummy COCO dataset that includes only the 'classes' field. | lib/datasets/dummy_datasets.py | get_coco_dataset | Bigwode/FPN-Pytorch | python | def get_coco_dataset():
ds = AttrDict()
classes = ['__background__', 'person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train', 'truck', 'boat', 'traffic light', 'fire hydrant', 'stop sign', 'parking meter', 'bench', 'bird', 'cat', 'dog', 'horse', 'sheep', 'cow', 'elephant', 'bear', 'zebra', 'gi... |
def get_detections(self, frames):
'Returns all detections on frames'
assert (len(frames) <= self.max_num_frames)
all_detections = []
for i in range(len(frames)):
self.net.forward_async(frames[i])
outputs = self.net.grab_all_async()
for (i, out) in enumerate(outputs):
detections =... | -5,370,912,130,922,129,000 | Returns all detections on frames | multi_camera_multi_person_tracking/utils/network_wrappers.py | get_detections | 565353780/open-vino | python | def get_detections(self, frames):
assert (len(frames) <= self.max_num_frames)
all_detections = []
for i in range(len(frames)):
self.net.forward_async(frames[i])
outputs = self.net.grab_all_async()
for (i, out) in enumerate(outputs):
detections = self.__decode_detections(out, fra... |
def __decode_detections(self, out, frame_shape):
'Decodes raw SSD output'
detections = []
for detection in out[(0, 0)]:
confidence = detection[2]
if (confidence > self.confidence):
left = int((max(detection[3], 0) * frame_shape[1]))
top = int((max(detection[4], 0) * f... | 6,288,819,005,664,865,000 | Decodes raw SSD output | multi_camera_multi_person_tracking/utils/network_wrappers.py | __decode_detections | 565353780/open-vino | python | def __decode_detections(self, out, frame_shape):
detections = []
for detection in out[(0, 0)]:
confidence = detection[2]
if (confidence > self.confidence):
left = int((max(detection[3], 0) * frame_shape[1]))
top = int((max(detection[4], 0) * frame_shape[0]))
... |
def forward(self, batch):
'Performs forward of the underlying network on a given batch'
assert (len(batch) <= self.max_reqs)
for frame in batch:
self.net.forward_async(frame)
outputs = self.net.grab_all_async()
return outputs | -5,311,186,696,799,280,000 | Performs forward of the underlying network on a given batch | multi_camera_multi_person_tracking/utils/network_wrappers.py | forward | 565353780/open-vino | python | def forward(self, batch):
assert (len(batch) <= self.max_reqs)
for frame in batch:
self.net.forward_async(frame)
outputs = self.net.grab_all_async()
return outputs |
def convert_location_from_source_to_agent(self, source: carla.Location) -> Location:
"\n Convert Location data from Carla.location to Agent's lcoation data type\n invert the Z axis to make it into right hand coordinate system\n Args:\n source: carla.location\n\n Returns:\n\n ... | -6,020,882,996,146,611,000 | Convert Location data from Carla.location to Agent's lcoation data type
invert the Z axis to make it into right hand coordinate system
Args:
source: carla.location
Returns: | Bridges/carla_bridge.py | convert_location_from_source_to_agent | Amanda-Chiang/ROAR | python | def convert_location_from_source_to_agent(self, source: carla.Location) -> Location:
"\n Convert Location data from Carla.location to Agent's lcoation data type\n invert the Z axis to make it into right hand coordinate system\n Args:\n source: carla.location\n\n Returns:\n\n ... |
def convert_rotation_from_source_to_agent(self, source: carla.Rotation) -> Rotation:
'Convert a CARLA raw rotation to Rotation(pitch=float,yaw=float,roll=float).'
return Rotation(pitch=source.yaw, yaw=source.pitch, roll=source.roll) | 264,018,444,264,146,080 | Convert a CARLA raw rotation to Rotation(pitch=float,yaw=float,roll=float). | Bridges/carla_bridge.py | convert_rotation_from_source_to_agent | Amanda-Chiang/ROAR | python | def convert_rotation_from_source_to_agent(self, source: carla.Rotation) -> Rotation:
return Rotation(pitch=source.yaw, yaw=source.pitch, roll=source.roll) |
def convert_transform_from_source_to_agent(self, source: carla.Transform) -> Transform:
'Convert CARLA raw location and rotation to Transform(location,rotation).'
return Transform(location=self.convert_location_from_source_to_agent(source=source.location), rotation=self.convert_rotation_from_source_to_agent(sou... | -2,277,312,415,609,952,000 | Convert CARLA raw location and rotation to Transform(location,rotation). | Bridges/carla_bridge.py | convert_transform_from_source_to_agent | Amanda-Chiang/ROAR | python | def convert_transform_from_source_to_agent(self, source: carla.Transform) -> Transform:
return Transform(location=self.convert_location_from_source_to_agent(source=source.location), rotation=self.convert_rotation_from_source_to_agent(source=source.rotation)) |
def convert_control_from_source_to_agent(self, source: carla.VehicleControl) -> VehicleControl:
'Convert CARLA raw vehicle control to VehicleControl(throttle,steering).'
return VehicleControl(throttle=(((- 1) * source.throttle) if source.reverse else source.throttle), steering=source.steer) | -6,737,263,032,983,955,000 | Convert CARLA raw vehicle control to VehicleControl(throttle,steering). | Bridges/carla_bridge.py | convert_control_from_source_to_agent | Amanda-Chiang/ROAR | python | def convert_control_from_source_to_agent(self, source: carla.VehicleControl) -> VehicleControl:
return VehicleControl(throttle=(((- 1) * source.throttle) if source.reverse else source.throttle), steering=source.steer) |
def convert_rgb_from_source_to_agent(self, source: carla.Image) -> Union[(RGBData, None)]:
'Convert CARLA raw Image to a Union with RGB numpy array'
try:
source.convert(cc.Raw)
return RGBData(data=self._to_rgb_array(source))
except:
return None | -3,428,005,910,081,119,700 | Convert CARLA raw Image to a Union with RGB numpy array | Bridges/carla_bridge.py | convert_rgb_from_source_to_agent | Amanda-Chiang/ROAR | python | def convert_rgb_from_source_to_agent(self, source: carla.Image) -> Union[(RGBData, None)]:
try:
source.convert(cc.Raw)
return RGBData(data=self._to_rgb_array(source))
except:
return None |
def convert_depth_from_source_to_agent(self, source: carla.Image) -> Union[(DepthData, None)]:
'Convert CARLA raw depth info to '
try:
array = np.frombuffer(source.raw_data, dtype=np.dtype('uint8'))
array = np.reshape(array, (source.height, source.width, 4))
array = array[:, :, :3]
... | -4,212,296,384,200,390,700 | Convert CARLA raw depth info to | Bridges/carla_bridge.py | convert_depth_from_source_to_agent | Amanda-Chiang/ROAR | python | def convert_depth_from_source_to_agent(self, source: carla.Image) -> Union[(DepthData, None)]:
' '
try:
array = np.frombuffer(source.raw_data, dtype=np.dtype('uint8'))
array = np.reshape(array, (source.height, source.width, 4))
array = array[:, :, :3]
array = array[:, :, ::(- 1)]... |
def _to_bgra_array(self, image):
'Convert a CARLA raw image to a BGRA numpy array.'
if (not isinstance(image, carla.Image)):
raise ValueError('Argument must be a carla.sensor.Image')
array = np.frombuffer(image.raw_data, dtype=np.dtype('uint8'))
array = np.reshape(array, (image.height, image.wid... | 998,347,524,162,644,400 | Convert a CARLA raw image to a BGRA numpy array. | Bridges/carla_bridge.py | _to_bgra_array | Amanda-Chiang/ROAR | python | def _to_bgra_array(self, image):
if (not isinstance(image, carla.Image)):
raise ValueError('Argument must be a carla.sensor.Image')
array = np.frombuffer(image.raw_data, dtype=np.dtype('uint8'))
array = np.reshape(array, (image.height, image.width, 4))
return array |
def _to_rgb_array(self, image):
'Convert a CARLA raw image to a RGB numpy array.'
array = self._to_bgra_array(image)
array = array[:, :, :3]
return array | -8,760,952,046,813,695,000 | Convert a CARLA raw image to a RGB numpy array. | Bridges/carla_bridge.py | _to_rgb_array | Amanda-Chiang/ROAR | python | def _to_rgb_array(self, image):
array = self._to_bgra_array(image)
array = array[:, :, :3]
return array |
def find_plugins():
'Returns a list of plugin path names.'
for (root, dirs, files) in os.walk(PLUGINS_DIR):
for file in files:
if file.endswith('.py'):
(yield os.path.join(root, file)) | 1,893,547,758,489,075,200 | Returns a list of plugin path names. | app/processor.py | find_plugins | glombard/python-plugin-experiment | python | def find_plugins():
for (root, dirs, files) in os.walk(PLUGINS_DIR):
for file in files:
if file.endswith('.py'):
(yield os.path.join(root, file)) |
def load_plugins(hook_plugins, command_plugins):
'Populates the plugin lists.'
for file in find_plugins():
try:
module_name = os.path.splitext(os.path.basename(file))[0]
module = importlib.import_module(((PLUGINS_DIR + '.') + module_name))
for entry_name in dir(module... | 3,624,441,520,412,969,000 | Populates the plugin lists. | app/processor.py | load_plugins | glombard/python-plugin-experiment | python | def load_plugins(hook_plugins, command_plugins):
for file in find_plugins():
try:
module_name = os.path.splitext(os.path.basename(file))[0]
module = importlib.import_module(((PLUGINS_DIR + '.') + module_name))
for entry_name in dir(module):
entry = ge... |
def build_cmsinfo(cm_list, qreq_):
"\n Helper function to report results over multiple queries (chip matches).\n Basically given a group of queries of the same name, we only care if one of\n them is correct. This emulates encounters.\n\n Runs queries of a specific configuration returns the best rank of... | 1,409,253,002,260,995,000 | Helper function to report results over multiple queries (chip matches).
Basically given a group of queries of the same name, we only care if one of
them is correct. This emulates encounters.
Runs queries of a specific configuration returns the best rank of each
query.
Args:
cm_list (list): list of chip matches
... | wbia/expt/test_result.py | build_cmsinfo | WildMeOrg/wildbook-ia | python | def build_cmsinfo(cm_list, qreq_):
"\n Helper function to report results over multiple queries (chip matches).\n Basically given a group of queries of the same name, we only care if one of\n them is correct. This emulates encounters.\n\n Runs queries of a specific configuration returns the best rank of... |
def combine_testres_list(ibs, testres_list):
"\n combine test results over multiple annot configs\n\n The combination of pipeline and annotation config is indexed by cfgx.\n A cfgx corresponds to a unique query request\n\n CommandLine:\n python -m wbia --tf combine_testres_list\n\n python ... | 260,257,291,209,548,700 | combine test results over multiple annot configs
The combination of pipeline and annotation config is indexed by cfgx.
A cfgx corresponds to a unique query request
CommandLine:
python -m wbia --tf combine_testres_list
python -m wbia --tf -draw_rank_cmc --db PZ_MTEST --show
python -m wbia --tf -draw_rank_... | wbia/expt/test_result.py | combine_testres_list | WildMeOrg/wildbook-ia | python | def combine_testres_list(ibs, testres_list):
"\n combine test results over multiple annot configs\n\n The combination of pipeline and annotation config is indexed by cfgx.\n A cfgx corresponds to a unique query request\n\n CommandLine:\n python -m wbia --tf combine_testres_list\n\n python ... |
def get_infoprop_list(testres, key, qaids=None):
"\n key = 'qx2_gt_rank'\n key = 'qx2_gt_rank'\n qaids = testres.get_test_qaids()\n "
if (key == 'participant'):
cfgx2_infoprop = [np.in1d(qaids, aids_) for aids_ in testres.cfgx2_qaids]
else:
_tmp1_cfgx2_infoprop = ... | -6,915,283,949,004,807,000 | key = 'qx2_gt_rank'
key = 'qx2_gt_rank'
qaids = testres.get_test_qaids() | wbia/expt/test_result.py | get_infoprop_list | WildMeOrg/wildbook-ia | python | def get_infoprop_list(testres, key, qaids=None):
"\n key = 'qx2_gt_rank'\n key = 'qx2_gt_rank'\n qaids = testres.get_test_qaids()\n "
if (key == 'participant'):
cfgx2_infoprop = [np.in1d(qaids, aids_) for aids_ in testres.cfgx2_qaids]
else:
_tmp1_cfgx2_infoprop = ... |
def get_infoprop_mat(testres, key, qaids=None):
"\n key = 'qx2_gf_raw_score'\n key = 'qx2_gt_raw_score'\n "
cfgx2_infoprop = testres.get_infoprop_list(key, qaids)
infoprop_mat = np.vstack(cfgx2_infoprop).T
return infoprop_mat | 4,360,242,293,059,248,600 | key = 'qx2_gf_raw_score'
key = 'qx2_gt_raw_score' | wbia/expt/test_result.py | get_infoprop_mat | WildMeOrg/wildbook-ia | python | def get_infoprop_mat(testres, key, qaids=None):
"\n key = 'qx2_gf_raw_score'\n key = 'qx2_gt_raw_score'\n "
cfgx2_infoprop = testres.get_infoprop_list(key, qaids)
infoprop_mat = np.vstack(cfgx2_infoprop).T
return infoprop_mat |
def get_rank_histograms(testres, bins=None, key=None, join_acfgs=False):
"\n Ignore:\n testres.get_infoprop_mat('qnx2_gt_name_rank')\n testres.get_infoprop_mat('qnx2_gf_name_rank')\n testres.get_infoprop_mat('qnx2_qnid')\n\n Example:\n >>> # DISABLE_DOCTEST\... | 3,132,119,514,067,143,700 | Ignore:
testres.get_infoprop_mat('qnx2_gt_name_rank')
testres.get_infoprop_mat('qnx2_gf_name_rank')
testres.get_infoprop_mat('qnx2_qnid')
Example:
>>> # DISABLE_DOCTEST
>>> from wbia.expt.test_result import * # NOQA
>>> from wbia.init import main_helpers
>>> ibs, testres = main_helpers.tes... | wbia/expt/test_result.py | get_rank_histograms | WildMeOrg/wildbook-ia | python | def get_rank_histograms(testres, bins=None, key=None, join_acfgs=False):
"\n Ignore:\n testres.get_infoprop_mat('qnx2_gt_name_rank')\n testres.get_infoprop_mat('qnx2_gf_name_rank')\n testres.get_infoprop_mat('qnx2_qnid')\n\n Example:\n >>> # DISABLE_DOCTEST\... |
def get_rank_percentage_cumhist(testres, bins='dense', key=None, join_acfgs=False):
"\n Args:\n bins (unicode): (default = u'dense')\n key (None): (default = None)\n join_acfgs (bool): (default = False)\n\n Returns:\n tuple: (config_cdfs, edges)\n\n C... | -5,253,765,832,227,622,000 | Args:
bins (unicode): (default = u'dense')
key (None): (default = None)
join_acfgs (bool): (default = False)
Returns:
tuple: (config_cdfs, edges)
CommandLine:
python -m wbia --tf TestResult.get_rank_percentage_cumhist
python -m wbia --tf TestResult.get_rank_percentage_cumhist \
-t base... | wbia/expt/test_result.py | get_rank_percentage_cumhist | WildMeOrg/wildbook-ia | python | def get_rank_percentage_cumhist(testres, bins='dense', key=None, join_acfgs=False):
"\n Args:\n bins (unicode): (default = u'dense')\n key (None): (default = None)\n join_acfgs (bool): (default = False)\n\n Returns:\n tuple: (config_cdfs, edges)\n\n C... |
def get_cfgx_groupxs(testres):
"\n Returns the group indices of configurations specified to be joined.\n\n Ignore:\n a = [\n 'default:minqual=good,require_timestamp=True,view=left,crossval_enc=True,joinme=1',\n 'default:minqual=good,require_timestamp=True,view=right,cr... | -37,846,633,727,779,384 | Returns the group indices of configurations specified to be joined.
Ignore:
a = [
'default:minqual=good,require_timestamp=True,view=left,crossval_enc=True,joinme=1',
'default:minqual=good,require_timestamp=True,view=right,crossval_enc=True,joinme=1',
'default:minqual=ok,require_timestamp=True,view=left... | wbia/expt/test_result.py | get_cfgx_groupxs | WildMeOrg/wildbook-ia | python | def get_cfgx_groupxs(testres):
"\n Returns the group indices of configurations specified to be joined.\n\n Ignore:\n a = [\n 'default:minqual=good,require_timestamp=True,view=left,crossval_enc=True,joinme=1',\n 'default:minqual=good,require_timestamp=True,view=right,cr... |
def get_rank_histogram_bins(testres):
'easy to see histogram bins'
worst_possible_rank = testres.get_worst_possible_rank()
if (worst_possible_rank > 50):
bins = [0, 1, 5, 50, worst_possible_rank, (worst_possible_rank + 1)]
elif (worst_possible_rank > 5):
bins = [0, 1, 5, worst_possible_r... | 2,918,817,636,958,619,600 | easy to see histogram bins | wbia/expt/test_result.py | get_rank_histogram_bins | WildMeOrg/wildbook-ia | python | def get_rank_histogram_bins(testres):
worst_possible_rank = testres.get_worst_possible_rank()
if (worst_possible_rank > 50):
bins = [0, 1, 5, 50, worst_possible_rank, (worst_possible_rank + 1)]
elif (worst_possible_rank > 5):
bins = [0, 1, 5, worst_possible_rank, (worst_possible_rank + ... |
def get_X_LIST(testres):
'DEPRICATE or refactor'
X_LIST = ut.get_argval('--rank-lt-list', type_=list, default=[1, 5])
return X_LIST | -3,195,641,197,643,784,700 | DEPRICATE or refactor | wbia/expt/test_result.py | get_X_LIST | WildMeOrg/wildbook-ia | python | def get_X_LIST(testres):
X_LIST = ut.get_argval('--rank-lt-list', type_=list, default=[1, 5])
return X_LIST |
def get_nLessX_dict(testres):
'\n Build a (histogram) dictionary mapping X (as in #ranks < X) to a list\n of cfg scores\n '
X_LIST = testres.get_X_LIST()
nLessX_dict = {int(X): np.zeros(testres.nConfig) for X in X_LIST}
cfgx2_qx2_gt_rank = testres.get_infoprop_list('qx2_gt_rank')
... | 6,837,458,029,855,711,000 | Build a (histogram) dictionary mapping X (as in #ranks < X) to a list
of cfg scores | wbia/expt/test_result.py | get_nLessX_dict | WildMeOrg/wildbook-ia | python | def get_nLessX_dict(testres):
'\n Build a (histogram) dictionary mapping X (as in #ranks < X) to a list\n of cfg scores\n '
X_LIST = testres.get_X_LIST()
nLessX_dict = {int(X): np.zeros(testres.nConfig) for X in X_LIST}
cfgx2_qx2_gt_rank = testres.get_infoprop_list('qx2_gt_rank')
... |
def get_all_varied_params(testres):
"\n Returns the parameters that were varied between different\n configurations in this test\n\n Returns:\n list: varied_params\n\n CommandLine:\n python -m wbia TestResult.get_all_varied_params\n\n Example:\n >>>... | -8,763,251,522,791,680,000 | Returns the parameters that were varied between different
configurations in this test
Returns:
list: varied_params
CommandLine:
python -m wbia TestResult.get_all_varied_params
Example:
>>> # ENABLE_DOCTEST
>>> from wbia.expt.test_result import * # NOQA
>>> import wbia
>>> testres = wbia.test... | wbia/expt/test_result.py | get_all_varied_params | WildMeOrg/wildbook-ia | python | def get_all_varied_params(testres):
"\n Returns the parameters that were varied between different\n configurations in this test\n\n Returns:\n list: varied_params\n\n CommandLine:\n python -m wbia TestResult.get_all_varied_params\n\n Example:\n >>>... |
def get_param_basis(testres, key):
"\n Returns what a param was varied between over all tests\n key = 'K'\n key = 'dcfg_sample_size'\n "
if (key == 'len(daids)'):
basis = sorted(list(set([len(daids) for daids in testres.cfgx2_daids])))
elif any([(key in cfgdict) for cfgdi... | -1,060,106,364,104,284,900 | Returns what a param was varied between over all tests
key = 'K'
key = 'dcfg_sample_size' | wbia/expt/test_result.py | get_param_basis | WildMeOrg/wildbook-ia | python | def get_param_basis(testres, key):
"\n Returns what a param was varied between over all tests\n key = 'K'\n key = 'dcfg_sample_size'\n "
if (key == 'len(daids)'):
basis = sorted(list(set([len(daids) for daids in testres.cfgx2_daids])))
elif any([(key in cfgdict) for cfgdi... |
def get_cfgx_with_param(testres, key, val):
'\n Gets configs where the given parameter is held constant\n '
if (key == 'len(daids)'):
cfgx_list = [cfgx for (cfgx, daids) in enumerate(testres.cfgx2_daids) if (len(daids) == val)]
elif any([(key in cfgdict) for cfgdict in testres.varied_c... | -2,903,806,636,783,050,000 | Gets configs where the given parameter is held constant | wbia/expt/test_result.py | get_cfgx_with_param | WildMeOrg/wildbook-ia | python | def get_cfgx_with_param(testres, key, val):
'\n \n '
if (key == 'len(daids)'):
cfgx_list = [cfgx for (cfgx, daids) in enumerate(testres.cfgx2_daids) if (len(daids) == val)]
elif any([(key in cfgdict) for cfgdict in testres.varied_cfg_list]):
cfgx_list = [cfgx for (cfgx, cfgdict... |
def get_annotcfg_args(testres):
'\n CommandLine:\n # TODO: More robust fix\n # To reproduce the error\n wbia -e rank_cmc --db humpbacks_fb -a default:mingt=2,qsize=10,dsize=100 default:qmingt=2,qsize=10,dsize=100 -t default:proot=BC_DTW,decision=max,crop_dim_size=500,crop_ena... | -8,628,802,053,686,688,000 | CommandLine:
# TODO: More robust fix
# To reproduce the error
wbia -e rank_cmc --db humpbacks_fb -a default:mingt=2,qsize=10,dsize=100 default:qmingt=2,qsize=10,dsize=100 -t default:proot=BC_DTW,decision=max,crop_dim_size=500,crop_enabled=True,manual_extract=False,use_te_scorer=True,ignore_notch=True,te_sco... | wbia/expt/test_result.py | get_annotcfg_args | WildMeOrg/wildbook-ia | python | def get_annotcfg_args(testres):
'\n CommandLine:\n # TODO: More robust fix\n # To reproduce the error\n wbia -e rank_cmc --db humpbacks_fb -a default:mingt=2,qsize=10,dsize=100 default:qmingt=2,qsize=10,dsize=100 -t default:proot=BC_DTW,decision=max,crop_dim_size=500,crop_ena... |
def get_full_cfgstr(testres, cfgx):
'both qannots and dannots included'
full_cfgstr = testres.cfgx2_qreq_[cfgx].get_full_cfgstr()
return full_cfgstr | 4,782,968,721,399,948,000 | both qannots and dannots included | wbia/expt/test_result.py | get_full_cfgstr | WildMeOrg/wildbook-ia | python | def get_full_cfgstr(testres, cfgx):
full_cfgstr = testres.cfgx2_qreq_[cfgx].get_full_cfgstr()
return full_cfgstr |
@ut.memoize
def get_cfgstr(testres, cfgx):
'just dannots and config_str'
cfgstr = testres.cfgx2_qreq_[cfgx].get_cfgstr()
return cfgstr | 5,608,703,665,681,617,000 | just dannots and config_str | wbia/expt/test_result.py | get_cfgstr | WildMeOrg/wildbook-ia | python | @ut.memoize
def get_cfgstr(testres, cfgx):
cfgstr = testres.cfgx2_qreq_[cfgx].get_cfgstr()
return cfgstr |
def _shorten_lbls(testres, lbl):
'\n hacky function\n '
import re
repl_list = [('candidacy_', ''), ('viewpoint_compare', 'viewpoint'), ('fg_on=True', 'FG=True'), ('fg_on=False,?', 'FG=False'), ('lnbnn_on=True', 'LNBNN'), ('lnbnn_on=False,?', ''), ('normonly_on=True', 'normonly'), ('normonly_on... | -4,939,464,198,397,053,000 | hacky function | wbia/expt/test_result.py | _shorten_lbls | WildMeOrg/wildbook-ia | python | def _shorten_lbls(testres, lbl):
'\n \n '
import re
repl_list = [('candidacy_', ), ('viewpoint_compare', 'viewpoint'), ('fg_on=True', 'FG=True'), ('fg_on=False,?', 'FG=False'), ('lnbnn_on=True', 'LNBNN'), ('lnbnn_on=False,?', ), ('normonly_on=True', 'normonly'), ('normonly_on=False,?', ), ('ba... |
def get_short_cfglbls(testres, join_acfgs=False):
"\n Labels for published tables\n\n cfg_lbls = ['baseline:nRR=200+default:', 'baseline:+default:']\n\n CommandLine:\n python -m wbia --tf TestResult.get_short_cfglbls\n\n Example:\n >>> # SLOW_DOCTEST\n >>... | 2,210,508,630,745,849,600 | Labels for published tables
cfg_lbls = ['baseline:nRR=200+default:', 'baseline:+default:']
CommandLine:
python -m wbia --tf TestResult.get_short_cfglbls
Example:
>>> # SLOW_DOCTEST
>>> from wbia.expt.test_result import * # NOQA
>>> import wbia
>>> ibs, testres = wbia.testdata_expts('PZ_MTEST', a... | wbia/expt/test_result.py | get_short_cfglbls | WildMeOrg/wildbook-ia | python | def get_short_cfglbls(testres, join_acfgs=False):
"\n Labels for published tables\n\n cfg_lbls = ['baseline:nRR=200+default:', 'baseline:+default:']\n\n CommandLine:\n python -m wbia --tf TestResult.get_short_cfglbls\n\n Example:\n >>> # SLOW_DOCTEST\n >>... |
def get_varied_labels(testres, shorten=False, join_acfgs=False, sep=''):
'\n Returns labels indicating only the parameters that have been varied between\n different annot/pipeline configurations.\n\n Helper for consistent figure titles\n\n CommandLine:\n python -m wbia --tf Te... | 5,242,806,394,810,212,000 | Returns labels indicating only the parameters that have been varied between
different annot/pipeline configurations.
Helper for consistent figure titles
CommandLine:
python -m wbia --tf TestResult.make_figtitle --prefix "Seperability " --db GIRM_Master1 -a timectrl -t Ell:K=2 --hargv=scores
python -m w... | wbia/expt/test_result.py | get_varied_labels | WildMeOrg/wildbook-ia | python | def get_varied_labels(testres, shorten=False, join_acfgs=False, sep=):
'\n Returns labels indicating only the parameters that have been varied between\n different annot/pipeline configurations.\n\n Helper for consistent figure titles\n\n CommandLine:\n python -m wbia --tf Test... |
def get_sorted_config_labels(testres):
'\n helper\n '
key = 'qx2_gt_rank'
(cfgx2_cumhist_percent, edges) = testres.get_rank_percentage_cumhist(bins='dense', key=key)
label_list = testres.get_short_cfglbls()
label_list = [((('%6.2f%%' % (percent,)) + ' - ') + label) for (percent, label)... | 7,623,049,211,645,293,000 | helper | wbia/expt/test_result.py | get_sorted_config_labels | WildMeOrg/wildbook-ia | python | def get_sorted_config_labels(testres):
'\n \n '
key = 'qx2_gt_rank'
(cfgx2_cumhist_percent, edges) = testres.get_rank_percentage_cumhist(bins='dense', key=key)
label_list = testres.get_short_cfglbls()
label_list = [((('%6.2f%%' % (percent,)) + ' - ') + label) for (percent, label) in zi... |
def make_figtitle(testres, plotname='', filt_cfg=None):
'\n Helper for consistent figure titles\n\n CommandLine:\n python -m wbia --tf TestResult.make_figtitle --prefix "Seperability " --db GIRM_Master1 -a timectrl -t Ell:K=2 --hargv=scores\n python -m wbia --tf TestResult... | -4,311,391,420,868,987,400 | Helper for consistent figure titles
CommandLine:
python -m wbia --tf TestResult.make_figtitle --prefix "Seperability " --db GIRM_Master1 -a timectrl -t Ell:K=2 --hargv=scores
python -m wbia --tf TestResult.make_figtitle
Example:
>>> # ENABLE_DOCTEST
>>> from wbia.expt.test_result import * # NO... | wbia/expt/test_result.py | make_figtitle | WildMeOrg/wildbook-ia | python | def make_figtitle(testres, plotname=, filt_cfg=None):
'\n Helper for consistent figure titles\n\n CommandLine:\n python -m wbia --tf TestResult.make_figtitle --prefix "Seperability " --db GIRM_Master1 -a timectrl -t Ell:K=2 --hargv=scores\n python -m wbia --tf TestResult.m... |
def get_title_aug(testres, with_size=True, with_db=True, with_cfg=True, friendly=False):
"\n Args:\n with_size (bool): (default = True)\n\n Returns:\n str: title_aug\n\n CommandLine:\n python -m wbia --tf TestResult.get_title_aug --db PZ_Master1 -a timequalctrl:... | 8,572,646,108,948,270,000 | Args:
with_size (bool): (default = True)
Returns:
str: title_aug
CommandLine:
python -m wbia --tf TestResult.get_title_aug --db PZ_Master1 -a timequalctrl::timectrl
Example:
>>> # DISABLE_DOCTEST
>>> from wbia.expt.test_result import * # NOQA
>>> import wbia
>>> ibs, testres = wbia.testd... | wbia/expt/test_result.py | get_title_aug | WildMeOrg/wildbook-ia | python | def get_title_aug(testres, with_size=True, with_db=True, with_cfg=True, friendly=False):
"\n Args:\n with_size (bool): (default = True)\n\n Returns:\n str: title_aug\n\n CommandLine:\n python -m wbia --tf TestResult.get_title_aug --db PZ_Master1 -a timequalctrl:... |
def print_pcfg_info(testres):
'\n Prints verbose information about each pipeline configuration\n\n >>> from wbia.expt.test_result import * # NOQA\n '
experiment_helpers.print_pipe_configs(testres.cfgx2_pcfg, testres.cfgx2_qreq_) | -2,667,704,884,458,157,600 | Prints verbose information about each pipeline configuration
>>> from wbia.expt.test_result import * # NOQA | wbia/expt/test_result.py | print_pcfg_info | WildMeOrg/wildbook-ia | python | def print_pcfg_info(testres):
'\n Prints verbose information about each pipeline configuration\n\n >>> from wbia.expt.test_result import * # NOQA\n '
experiment_helpers.print_pipe_configs(testres.cfgx2_pcfg, testres.cfgx2_qreq_) |
def print_acfg_info(testres, **kwargs):
"\n Prints verbose information about the annotations used in each test\n configuration\n\n CommandLine:\n python -m wbia --tf TestResult.print_acfg_info\n\n Kwargs:\n see ibs.get_annot_stats_dict\n hashid, per_name,... | 8,689,599,207,488,858,000 | Prints verbose information about the annotations used in each test
configuration
CommandLine:
python -m wbia --tf TestResult.print_acfg_info
Kwargs:
see ibs.get_annot_stats_dict
hashid, per_name, per_qual, per_vp, per_name_vpedge, per_image,
min_name_hourdist
Example:
>>> # DISABLE_DOCTEST
>>... | wbia/expt/test_result.py | print_acfg_info | WildMeOrg/wildbook-ia | python | def print_acfg_info(testres, **kwargs):
"\n Prints verbose information about the annotations used in each test\n configuration\n\n CommandLine:\n python -m wbia --tf TestResult.print_acfg_info\n\n Kwargs:\n see ibs.get_annot_stats_dict\n hashid, per_name,... |
def print_unique_annot_config_stats(testres, ibs=None):
"\n Args:\n ibs (IBEISController): wbia controller object(default = None)\n\n CommandLine:\n python -m wbia TestResult.print_unique_annot_config_stats\n\n Example:\n >>> # DISABLE_DOCTEST\n >>> f... | -6,608,052,288,272,814,000 | Args:
ibs (IBEISController): wbia controller object(default = None)
CommandLine:
python -m wbia TestResult.print_unique_annot_config_stats
Example:
>>> # DISABLE_DOCTEST
>>> from wbia.expt.test_result import * # NOQA
>>> import wbia
>>> testres = wbia.testdata_expts('PZ_MTEST', a=['ctrl::unct... | wbia/expt/test_result.py | print_unique_annot_config_stats | WildMeOrg/wildbook-ia | python | def print_unique_annot_config_stats(testres, ibs=None):
"\n Args:\n ibs (IBEISController): wbia controller object(default = None)\n\n CommandLine:\n python -m wbia TestResult.print_unique_annot_config_stats\n\n Example:\n >>> # DISABLE_DOCTEST\n >>> f... |
def print_results(testres, **kwargs):
"\n CommandLine:\n python -m wbia --tf TestResult.print_results\n\n Example:\n >>> # DISABLE_DOCTEST\n >>> from wbia.expt.test_result import * # NOQA\n >>> from wbia.expt import harness\n >>> ibs, testres = h... | -4,263,183,096,241,799,000 | CommandLine:
python -m wbia --tf TestResult.print_results
Example:
>>> # DISABLE_DOCTEST
>>> from wbia.expt.test_result import * # NOQA
>>> from wbia.expt import harness
>>> ibs, testres = harness.testdata_expts('PZ_MTEST')
>>> result = testres.print_results()
>>> print(result) | wbia/expt/test_result.py | print_results | WildMeOrg/wildbook-ia | python | def print_results(testres, **kwargs):
"\n CommandLine:\n python -m wbia --tf TestResult.print_results\n\n Example:\n >>> # DISABLE_DOCTEST\n >>> from wbia.expt.test_result import * # NOQA\n >>> from wbia.expt import harness\n >>> ibs, testres = h... |
def get_all_tags(testres):
"\n CommandLine:\n python -m wbia --tf TestResult.get_all_tags --db PZ_Master1 --show --filt :\n python -m wbia --tf TestResult.get_all_tags --db PZ_Master1 --show --filt :min_gf_timedelta=24h\n python -m wbia --tf TestResult.get_all_tags --db PZ_Ma... | 7,433,998,893,923,260,000 | CommandLine:
python -m wbia --tf TestResult.get_all_tags --db PZ_Master1 --show --filt :
python -m wbia --tf TestResult.get_all_tags --db PZ_Master1 --show --filt :min_gf_timedelta=24h
python -m wbia --tf TestResult.get_all_tags --db PZ_Master1 --show --filt :min_gf_timedelta=24h,max_gt_rank=5
Example:
... | wbia/expt/test_result.py | get_all_tags | WildMeOrg/wildbook-ia | python | def get_all_tags(testres):
"\n CommandLine:\n python -m wbia --tf TestResult.get_all_tags --db PZ_Master1 --show --filt :\n python -m wbia --tf TestResult.get_all_tags --db PZ_Master1 --show --filt :min_gf_timedelta=24h\n python -m wbia --tf TestResult.get_all_tags --db PZ_Ma... |
def get_gf_tags(testres):
"\n Returns:\n list: case_pos_list\n\n CommandLine:\n python -m wbia --tf TestResult.get_gf_tags --db PZ_Master1 --show\n\n Example:\n >>> # DISABLE_DOCTEST\n >>> from wbia.expt.test_result import * # NOQA\n >>> f... | -6,750,314,083,588,924,000 | Returns:
list: case_pos_list
CommandLine:
python -m wbia --tf TestResult.get_gf_tags --db PZ_Master1 --show
Example:
>>> # DISABLE_DOCTEST
>>> from wbia.expt.test_result import * # NOQA
>>> from wbia.init import main_helpers
>>> ibs, testres = main_helpers.testdata_expts('PZ_Master1', a=['tim... | wbia/expt/test_result.py | get_gf_tags | WildMeOrg/wildbook-ia | python | def get_gf_tags(testres):
"\n Returns:\n list: case_pos_list\n\n CommandLine:\n python -m wbia --tf TestResult.get_gf_tags --db PZ_Master1 --show\n\n Example:\n >>> # DISABLE_DOCTEST\n >>> from wbia.expt.test_result import * # NOQA\n >>> f... |
def case_sample2(testres, filt_cfg, qaids=None, return_mask=False, verbose=None):
"\n Filters individual test result cases based on how they performed, what\n tags they had, and various other things.\n\n Args:\n filt_cfg (dict):\n\n Returns:\n list: case_pos_list (l... | 8,126,729,369,772,073,000 | Filters individual test result cases based on how they performed, what
tags they had, and various other things.
Args:
filt_cfg (dict):
Returns:
list: case_pos_list (list of (qx, cfgx)) or isvalid mask
CommandLine:
python -m wbia TestResult.case_sample2
python -m wbia TestResult.case_sample2:0
pyt... | wbia/expt/test_result.py | case_sample2 | WildMeOrg/wildbook-ia | python | def case_sample2(testres, filt_cfg, qaids=None, return_mask=False, verbose=None):
"\n Filters individual test result cases based on how they performed, what\n tags they had, and various other things.\n\n Args:\n filt_cfg (dict):\n\n Returns:\n list: case_pos_list (l... |
def get_truth2_prop(testres, qaids=None, join_acfg=False):
"\n Returns:\n tuple: (truth2_prop, prop2_mat)\n\n CommandLine:\n python -m wbia.expt.test_result --exec-get_truth2_prop --show\n\n Example:\n >>> # xdoctest: +REQUIRES(--slow)\n >>> # ENABLE_... | -7,367,768,152,250,038,000 | Returns:
tuple: (truth2_prop, prop2_mat)
CommandLine:
python -m wbia.expt.test_result --exec-get_truth2_prop --show
Example:
>>> # xdoctest: +REQUIRES(--slow)
>>> # ENABLE_DOCTEST
>>> from wbia.expt.test_result import * # NOQA
>>> import wbia
>>> ibs, testres = wbia.testdata_expts('PZ_MTE... | wbia/expt/test_result.py | get_truth2_prop | WildMeOrg/wildbook-ia | python | def get_truth2_prop(testres, qaids=None, join_acfg=False):
"\n Returns:\n tuple: (truth2_prop, prop2_mat)\n\n CommandLine:\n python -m wbia.expt.test_result --exec-get_truth2_prop --show\n\n Example:\n >>> # xdoctest: +REQUIRES(--slow)\n >>> # ENABLE_... |
def draw_score_diff_disti(testres):
"\n\n CommandLine:\n python -m wbia --tf TestResult.draw_score_diff_disti --show -a varynannots_td -t best --db PZ_Master1\n python -m wbia --tf TestResult.draw_score_diff_disti --show -a varynannots_td -t best --db GZ_Master1\n python -m w... | 1,651,632,516,879,799,300 | CommandLine:
python -m wbia --tf TestResult.draw_score_diff_disti --show -a varynannots_td -t best --db PZ_Master1
python -m wbia --tf TestResult.draw_score_diff_disti --show -a varynannots_td -t best --db GZ_Master1
python -m wbia --tf TestResult.draw_score_diff_disti --show -a varynannots_td1h -t best --d... | wbia/expt/test_result.py | draw_score_diff_disti | WildMeOrg/wildbook-ia | python | def draw_score_diff_disti(testres):
"\n\n CommandLine:\n python -m wbia --tf TestResult.draw_score_diff_disti --show -a varynannots_td -t best --db PZ_Master1\n python -m wbia --tf TestResult.draw_score_diff_disti --show -a varynannots_td -t best --db GZ_Master1\n python -m w... |
def draw_rank_cmc(testres):
'\n Wrapper\n '
from wbia.expt import experiment_drawing
experiment_drawing.draw_rank_cmc(testres.ibs, testres) | -2,835,022,498,734,089,000 | Wrapper | wbia/expt/test_result.py | draw_rank_cmc | WildMeOrg/wildbook-ia | python | def draw_rank_cmc(testres):
'\n \n '
from wbia.expt import experiment_drawing
experiment_drawing.draw_rank_cmc(testres.ibs, testres) |
def draw_match_cases(testres, **kwargs):
'\n Wrapper\n '
from wbia.expt import experiment_drawing
experiment_drawing.draw_match_cases(testres.ibs, testres, **kwargs) | 413,246,073,130,097,800 | Wrapper | wbia/expt/test_result.py | draw_match_cases | WildMeOrg/wildbook-ia | python | def draw_match_cases(testres, **kwargs):
'\n \n '
from wbia.expt import experiment_drawing
experiment_drawing.draw_match_cases(testres.ibs, testres, **kwargs) |
def draw_failure_cases(testres, **kwargs):
"\n >>> from wbia.other.dbinfo import * # NOQA\n >>> import wbia\n >>> ibs, testres = wbia.testdata_expts(defaultdb='PZ_MTEST', a='timectrl:qsize=2', t='invar:AI=[False],RI=False', use_cache=False)\n "
from wbia.expt import experiment_drawi... | 4,938,227,401,944,836,000 | >>> from wbia.other.dbinfo import * # NOQA
>>> import wbia
>>> ibs, testres = wbia.testdata_expts(defaultdb='PZ_MTEST', a='timectrl:qsize=2', t='invar:AI=[False],RI=False', use_cache=False) | wbia/expt/test_result.py | draw_failure_cases | WildMeOrg/wildbook-ia | python | def draw_failure_cases(testres, **kwargs):
"\n >>> from wbia.other.dbinfo import * # NOQA\n >>> import wbia\n >>> ibs, testres = wbia.testdata_expts(defaultdb='PZ_MTEST', a='timectrl:qsize=2', t='invar:AI=[False],RI=False', use_cache=False)\n "
from wbia.expt import experiment_drawi... |
def find_score_thresh_cutoff(testres):
'\n FIXME\n DUPLICATE CODE\n rectify with experiment_drawing\n '
import vtool as vt
if ut.VERBOSE:
logger.info('[dev] FIX DUPLICATE CODE find_thresh_cutoff')
assert (len(testres.cfgx2_qreq_) == 1), 'can only specify one config he... | 316,158,937,080,194,100 | FIXME
DUPLICATE CODE
rectify with experiment_drawing | wbia/expt/test_result.py | find_score_thresh_cutoff | WildMeOrg/wildbook-ia | python | def find_score_thresh_cutoff(testres):
'\n FIXME\n DUPLICATE CODE\n rectify with experiment_drawing\n '
import vtool as vt
if ut.VERBOSE:
logger.info('[dev] FIX DUPLICATE CODE find_thresh_cutoff')
assert (len(testres.cfgx2_qreq_) == 1), 'can only specify one config he... |
def print_percent_identification_success(testres):
'\n Prints names identified (at rank 1) / names queried.\n This combines results over multiple queries of a particular name using\n max\n\n OLD, MAYBE DEPRIATE\n\n Example:\n >>> # DISABLE_DOCTEST\n >>> from ... | -5,736,439,353,157,751,000 | Prints names identified (at rank 1) / names queried.
This combines results over multiple queries of a particular name using
max
OLD, MAYBE DEPRIATE
Example:
>>> # DISABLE_DOCTEST
>>> from wbia.expt.test_result import * # NOQA | wbia/expt/test_result.py | print_percent_identification_success | WildMeOrg/wildbook-ia | python | def print_percent_identification_success(testres):
'\n Prints names identified (at rank 1) / names queried.\n This combines results over multiple queries of a particular name using\n max\n\n OLD, MAYBE DEPRIATE\n\n Example:\n >>> # DISABLE_DOCTEST\n >>> from ... |
def map_score(testres):
"\n For each query compute a precision recall curve.\n Then, for each query compute the average precision.\n Then take the mean of all average precisions to obtain the mAP.\n\n Script:\n >>> #ibs = wbia.opendb('Oxford')\n >>> #ibs, testres = ... | -8,849,611,054,417,056,000 | For each query compute a precision recall curve.
Then, for each query compute the average precision.
Then take the mean of all average precisions to obtain the mAP.
Script:
>>> #ibs = wbia.opendb('Oxford')
>>> #ibs, testres = wbia.testdata_expts('Oxford', a='oxford', p='smk:nWords=[64000],nAssign=[1],SV=[False... | wbia/expt/test_result.py | map_score | WildMeOrg/wildbook-ia | python | def map_score(testres):
"\n For each query compute a precision recall curve.\n Then, for each query compute the average precision.\n Then take the mean of all average precisions to obtain the mAP.\n\n Script:\n >>> #ibs = wbia.opendb('Oxford')\n >>> #ibs, testres = ... |
def embed_testres(testres):
"\n CommandLine:\n python -m wbia TestResults.embed_testres\n\n Example:\n >>> # SCRIPT\n >>> from wbia.expt.test_result import * # NOQA\n >>> from wbia.init import main_helpers\n >>> ibs, testres = main_helpers.testda... | -6,328,134,899,002,221,000 | CommandLine:
python -m wbia TestResults.embed_testres
Example:
>>> # SCRIPT
>>> from wbia.expt.test_result import * # NOQA
>>> from wbia.init import main_helpers
>>> ibs, testres = main_helpers.testdata_expts(defaultdb='PZ_MTEST')
>>> embed_testres(testres) | wbia/expt/test_result.py | embed_testres | WildMeOrg/wildbook-ia | python | def embed_testres(testres):
"\n CommandLine:\n python -m wbia TestResults.embed_testres\n\n Example:\n >>> # SCRIPT\n >>> from wbia.expt.test_result import * # NOQA\n >>> from wbia.init import main_helpers\n >>> ibs, testres = main_helpers.testda... |
def cols_disagree(mat, val):
"\n is_success = prop2_mat['is_success']\n "
nCols = mat.shape[1]
sums = mat.sum(axis=1)
disagree_flags1d = np.logical_and((sums > 0), (sums < nCols))
disagree_flags2d = np.tile(disagree_flags1d[:, None], (1, nCols))
if (not val):
flags ... | -4,581,002,074,630,044,700 | is_success = prop2_mat['is_success'] | wbia/expt/test_result.py | cols_disagree | WildMeOrg/wildbook-ia | python | def cols_disagree(mat, val):
"\n \n "
nCols = mat.shape[1]
sums = mat.sum(axis=1)
disagree_flags1d = np.logical_and((sums > 0), (sums < nCols))
disagree_flags2d = np.tile(disagree_flags1d[:, None], (1, nCols))
if (not val):
flags = np.logical_not(disagree_flags2d)
... |
def cfg_scoresep(mat, val, op):
"\n Compares scores between different configs\n\n op = operator.ge\n is_success = prop2_mat['is_success']\n "
nCols = mat.shape[1]
pdistx = vt.pdist_indicies(nCols)
pdist_list = np.array([vt.safe_pdist(row) for row in mat])
... | -5,820,052,321,142,968,000 | Compares scores between different configs
op = operator.ge
is_success = prop2_mat['is_success'] | wbia/expt/test_result.py | cfg_scoresep | WildMeOrg/wildbook-ia | python | def cfg_scoresep(mat, val, op):
"\n Compares scores between different configs\n\n op = operator.ge\n is_success = prop2_mat['is_success']\n "
nCols = mat.shape[1]
pdistx = vt.pdist_indicies(nCols)
pdist_list = np.array([vt.safe_pdist(row) for row in mat])
... |
@pytest.fixture
def response():
'Sample pytest fixture.\n\n See more at: http://doc.pytest.org/en/latest/fixture.html\n '
import requests
return requests.get('https://github.com/torvalds/linux') | 8,155,420,939,485,564,000 | Sample pytest fixture.
See more at: http://doc.pytest.org/en/latest/fixture.html | tests/test_SEIR.py | response | sellisd/seir | python | @pytest.fixture
def response():
'Sample pytest fixture.\n\n See more at: http://doc.pytest.org/en/latest/fixture.html\n '
import requests
return requests.get('https://github.com/torvalds/linux') |
def test_content(response):
'Sample pytest test function with the pytest fixture as an argument.' | -9,075,191,156,716,607,000 | Sample pytest test function with the pytest fixture as an argument. | tests/test_SEIR.py | test_content | sellisd/seir | python | def test_content(response):
|
def test_command_line_interface():
'Test the CLI.'
runner = CliRunner()
help_result = runner.invoke(cli.main, ['--help'])
assert (help_result.exit_code == 0)
assert ('Show this message and exit.' in help_result.output) | 3,112,977,249,146,923,500 | Test the CLI. | tests/test_SEIR.py | test_command_line_interface | sellisd/seir | python | def test_command_line_interface():
runner = CliRunner()
help_result = runner.invoke(cli.main, ['--help'])
assert (help_result.exit_code == 0)
assert ('Show this message and exit.' in help_result.output) |
def image_path_at(self, i):
'\n Return the absolute path to image i in the image sequence.\n '
return self.image_path_from_index(self._image_index[i]) | -1,883,448,437,578,965,500 | Return the absolute path to image i in the image sequence. | faster_rcnn/datasets/pascal_voc2.py | image_path_at | zjjszj/PS_DM_mydetector_faster_rcnn_pytorch | python | def image_path_at(self, i):
'\n \n '
return self.image_path_from_index(self._image_index[i]) |
def image_path_from_index(self, index):
'\n Construct an image path from the image\'s "index" identifier.\n '
image_path = os.path.join(self._data_path, 'JPEGImages', (index + self._image_ext))
assert os.path.exists(image_path), 'Path does not exist: {}'.format(image_path)
return image_pat... | 6,881,484,836,329,622,000 | Construct an image path from the image's "index" identifier. | faster_rcnn/datasets/pascal_voc2.py | image_path_from_index | zjjszj/PS_DM_mydetector_faster_rcnn_pytorch | python | def image_path_from_index(self, index):
'\n Construct an image path from the image\'s "index" identifier.\n '
image_path = os.path.join(self._data_path, 'JPEGImages', (index + self._image_ext))
assert os.path.exists(image_path), 'Path does not exist: {}'.format(image_path)
return image_pat... |
def _load_image_set_index(self):
"\n Load the indexes listed in this dataset's image set file.\n "
image_set_file = os.path.join(self._data_path, 'ImageSets', 'Main', (self._image_set + '.txt'))
assert os.path.exists(image_set_file), 'Path does not exist: {}'.format(image_set_file)
with op... | -9,143,730,377,540,284,000 | Load the indexes listed in this dataset's image set file. | faster_rcnn/datasets/pascal_voc2.py | _load_image_set_index | zjjszj/PS_DM_mydetector_faster_rcnn_pytorch | python | def _load_image_set_index(self):
"\n \n "
image_set_file = os.path.join(self._data_path, 'ImageSets', 'Main', (self._image_set + '.txt'))
assert os.path.exists(image_set_file), 'Path does not exist: {}'.format(image_set_file)
with open(image_set_file) as f:
image_index = [x.strip()... |
def _get_default_path(self):
'\n Return the default path where PASCAL VOC is expected to be installed.\n '
return os.path.join(ROOT_DIR, 'data', 'PASCAL') | -5,326,098,657,779,618,000 | Return the default path where PASCAL VOC is expected to be installed. | faster_rcnn/datasets/pascal_voc2.py | _get_default_path | zjjszj/PS_DM_mydetector_faster_rcnn_pytorch | python | def _get_default_path(self):
'\n \n '
return os.path.join(ROOT_DIR, 'data', 'PASCAL') |
def gt_roidb(self):
'\n Return the database of ground-truth regions of interest.\n\n This function loads/saves from/to a cache file to speed up future calls.\n '
cache_file = os.path.join(self.cache_path, (self.name + '_gt_roidb.pkl'))
if os.path.exists(cache_file):
with open(ca... | 2,501,634,246,087,732,700 | Return the database of ground-truth regions of interest.
This function loads/saves from/to a cache file to speed up future calls. | faster_rcnn/datasets/pascal_voc2.py | gt_roidb | zjjszj/PS_DM_mydetector_faster_rcnn_pytorch | python | def gt_roidb(self):
'\n Return the database of ground-truth regions of interest.\n\n This function loads/saves from/to a cache file to speed up future calls.\n '
cache_file = os.path.join(self.cache_path, (self.name + '_gt_roidb.pkl'))
if os.path.exists(cache_file):
with open(ca... |
def _load_pascal_annotation(self, index):
'\n Load image and bounding boxes info from XML file in the PASCAL VOC\n format.\n '
filename = os.path.join(self._data_path, 'Annotations', (index + '.xml'))
def get_data_from_tag(node, tag):
return node.getElementsByTagName(tag)[0].ch... | -1,646,110,813,317,172,000 | Load image and bounding boxes info from XML file in the PASCAL VOC
format. | faster_rcnn/datasets/pascal_voc2.py | _load_pascal_annotation | zjjszj/PS_DM_mydetector_faster_rcnn_pytorch | python | def _load_pascal_annotation(self, index):
'\n Load image and bounding boxes info from XML file in the PASCAL VOC\n format.\n '
filename = os.path.join(self._data_path, 'Annotations', (index + '.xml'))
def get_data_from_tag(node, tag):
return node.getElementsByTagName(tag)[0].ch... |
def _load_pascal_subcategory_exemplar_annotation(self, index):
'\n Load image and bounding boxes info from txt file in the pascal subcategory exemplar format.\n '
if (self._image_set == 'test'):
return self._load_pascal_annotation(index)
filename = os.path.join(self._pascal_path, 'subc... | 2,134,446,988,790,855,400 | Load image and bounding boxes info from txt file in the pascal subcategory exemplar format. | faster_rcnn/datasets/pascal_voc2.py | _load_pascal_subcategory_exemplar_annotation | zjjszj/PS_DM_mydetector_faster_rcnn_pytorch | python | def _load_pascal_subcategory_exemplar_annotation(self, index):
'\n \n '
if (self._image_set == 'test'):
return self._load_pascal_annotation(index)
filename = os.path.join(self._pascal_path, 'subcategory_exemplars', (index + '.txt'))
assert os.path.exists(filename), 'Path does not e... |
def region_proposal_roidb(self):
'\n Return the database of regions of interest.\n Ground-truth ROIs are also included.\n\n This function loads/saves from/to a cache file to speed up future calls.\n '
cache_file = os.path.join(self.cache_path, (((self.name + '_') + cfg.REGION_PROPOSA... | -1,463,459,393,962,246,000 | Return the database of regions of interest.
Ground-truth ROIs are also included.
This function loads/saves from/to a cache file to speed up future calls. | faster_rcnn/datasets/pascal_voc2.py | region_proposal_roidb | zjjszj/PS_DM_mydetector_faster_rcnn_pytorch | python | def region_proposal_roidb(self):
'\n Return the database of regions of interest.\n Ground-truth ROIs are also included.\n\n This function loads/saves from/to a cache file to speed up future calls.\n '
cache_file = os.path.join(self.cache_path, (((self.name + '_') + cfg.REGION_PROPOSA... |
def selective_search_roidb(self):
'\n Return the database of selective search regions of interest.\n Ground-truth ROIs are also included.\n\n This function loads/saves from/to a cache file to speed up future calls.\n '
cache_file = os.path.join(self.cache_path, (self.name + '_selecti... | 8,759,385,287,031,027,000 | Return the database of selective search regions of interest.
Ground-truth ROIs are also included.
This function loads/saves from/to a cache file to speed up future calls. | faster_rcnn/datasets/pascal_voc2.py | selective_search_roidb | zjjszj/PS_DM_mydetector_faster_rcnn_pytorch | python | def selective_search_roidb(self):
'\n Return the database of selective search regions of interest.\n Ground-truth ROIs are also included.\n\n This function loads/saves from/to a cache file to speed up future calls.\n '
cache_file = os.path.join(self.cache_path, (self.name + '_selecti... |
def selective_search_IJCV_roidb(self):
'\n Return the database of selective search regions of interest.\n Ground-truth ROIs are also included.\n\n This function loads/saves from/to a cache file to speed up future calls.\n '
cache_file = os.path.join(self.cache_path, '{:s}_selective_s... | 8,391,850,426,552,893,000 | Return the database of selective search regions of interest.
Ground-truth ROIs are also included.
This function loads/saves from/to a cache file to speed up future calls. | faster_rcnn/datasets/pascal_voc2.py | selective_search_IJCV_roidb | zjjszj/PS_DM_mydetector_faster_rcnn_pytorch | python | def selective_search_IJCV_roidb(self):
'\n Return the database of selective search regions of interest.\n Ground-truth ROIs are also included.\n\n This function loads/saves from/to a cache file to speed up future calls.\n '
cache_file = os.path.join(self.cache_path, '{:s}_selective_s... |
def run(args: 'argparse.Namespace', name: str, runtime_cls, envs: Dict[(str, str)], is_started: Union[('multiprocessing.Event', 'threading.Event')], is_shutdown: Union[('multiprocessing.Event', 'threading.Event')], is_ready: Union[('multiprocessing.Event', 'threading.Event')], cancel_event: Union[('multiprocessing.Even... | 8,911,172,289,690,000,000 | Method representing the :class:`BaseRuntime` activity.
This method is the target for the Pea's `thread` or `process`
.. note::
:meth:`run` is running in subprocess/thread, the exception can not be propagated to the main process.
Hence, please do not raise any exception here.
.. note::
Please note that en... | jina/peapods/peas/__init__.py | run | MaxielMrvaljevic/jina | python | def run(args: 'argparse.Namespace', name: str, runtime_cls, envs: Dict[(str, str)], is_started: Union[('multiprocessing.Event', 'threading.Event')], is_shutdown: Union[('multiprocessing.Event', 'threading.Event')], is_ready: Union[('multiprocessing.Event', 'threading.Event')], cancel_event: Union[('multiprocessing.Even... |
def _set_ctrl_adrr(self):
'Sets control address for different runtimes'
self.runtime_ctrl_address = self.runtime_cls.get_control_address(host=self.args.host, port=self.args.port_ctrl, docker_kwargs=getattr(self.args, 'docker_kwargs', None))
if (not self.runtime_ctrl_address):
self.runtime_ctrl_addre... | 5,640,064,089,109,753,000 | Sets control address for different runtimes | jina/peapods/peas/__init__.py | _set_ctrl_adrr | MaxielMrvaljevic/jina | python | def _set_ctrl_adrr(self):
self.runtime_ctrl_address = self.runtime_cls.get_control_address(host=self.args.host, port=self.args.port_ctrl, docker_kwargs=getattr(self.args, 'docker_kwargs', None))
if (not self.runtime_ctrl_address):
self.runtime_ctrl_address = f'{self.args.host}:{self.args.port_in}' |
def start(self):
'Start the Pea.\n This method calls :meth:`start` in :class:`threading.Thread` or :class:`multiprocesssing.Process`.\n .. #noqa: DAR201\n '
self.worker.start()
if (not self.args.noblock_on_start):
self.wait_start_success()
return self | -4,257,458,394,315,266,000 | Start the Pea.
This method calls :meth:`start` in :class:`threading.Thread` or :class:`multiprocesssing.Process`.
.. #noqa: DAR201 | jina/peapods/peas/__init__.py | start | MaxielMrvaljevic/jina | python | def start(self):
'Start the Pea.\n This method calls :meth:`start` in :class:`threading.Thread` or :class:`multiprocesssing.Process`.\n .. #noqa: DAR201\n '
self.worker.start()
if (not self.args.noblock_on_start):
self.wait_start_success()
return self |
def join(self, *args, **kwargs):
'Joins the Pea.\n This method calls :meth:`join` in :class:`threading.Thread` or :class:`multiprocesssing.Process`.\n\n :param args: extra positional arguments to pass to join\n :param kwargs: extra keyword arguments to pass to join\n '
self.worker.jo... | -4,591,021,977,245,066,000 | Joins the Pea.
This method calls :meth:`join` in :class:`threading.Thread` or :class:`multiprocesssing.Process`.
:param args: extra positional arguments to pass to join
:param kwargs: extra keyword arguments to pass to join | jina/peapods/peas/__init__.py | join | MaxielMrvaljevic/jina | python | def join(self, *args, **kwargs):
'Joins the Pea.\n This method calls :meth:`join` in :class:`threading.Thread` or :class:`multiprocesssing.Process`.\n\n :param args: extra positional arguments to pass to join\n :param kwargs: extra keyword arguments to pass to join\n '
self.worker.jo... |
def terminate(self):
'Terminate the Pea.\n This method calls :meth:`terminate` in :class:`threading.Thread` or :class:`multiprocesssing.Process`.\n '
if hasattr(self.worker, 'terminate'):
self.worker.terminate() | -1,042,618,979,188,756,700 | Terminate the Pea.
This method calls :meth:`terminate` in :class:`threading.Thread` or :class:`multiprocesssing.Process`. | jina/peapods/peas/__init__.py | terminate | MaxielMrvaljevic/jina | python | def terminate(self):
'Terminate the Pea.\n This method calls :meth:`terminate` in :class:`threading.Thread` or :class:`multiprocesssing.Process`.\n '
if hasattr(self.worker, 'terminate'):
self.worker.terminate() |
def activate_runtime(self):
' Send activate control message. '
self.runtime_cls.activate(logger=self.logger, socket_in_type=self.args.socket_in, control_address=self.runtime_ctrl_address, timeout_ctrl=self._timeout_ctrl) | -2,365,994,081,478,579,000 | Send activate control message. | jina/peapods/peas/__init__.py | activate_runtime | MaxielMrvaljevic/jina | python | def activate_runtime(self):
' '
self.runtime_cls.activate(logger=self.logger, socket_in_type=self.args.socket_in, control_address=self.runtime_ctrl_address, timeout_ctrl=self._timeout_ctrl) |
def _cancel_runtime(self, skip_deactivate: bool=False):
'\n Send terminate control message.\n\n :param skip_deactivate: Mark that the DEACTIVATE signal may be missed if set to True\n '
self.runtime_cls.cancel(cancel_event=self.cancel_event, logger=self.logger, socket_in_type=self.args.socke... | -7,147,230,928,784,672,000 | Send terminate control message.
:param skip_deactivate: Mark that the DEACTIVATE signal may be missed if set to True | jina/peapods/peas/__init__.py | _cancel_runtime | MaxielMrvaljevic/jina | python | def _cancel_runtime(self, skip_deactivate: bool=False):
'\n Send terminate control message.\n\n :param skip_deactivate: Mark that the DEACTIVATE signal may be missed if set to True\n '
self.runtime_cls.cancel(cancel_event=self.cancel_event, logger=self.logger, socket_in_type=self.args.socke... |
def _wait_for_ready_or_shutdown(self, timeout: Optional[float]):
'\n Waits for the process to be ready or to know it has failed.\n\n :param timeout: The time to wait before readiness or failure is determined\n .. # noqa: DAR201\n '
return self.runtime_cls.wait_for_ready_or_shutdo... | -6,739,447,112,481,603,000 | Waits for the process to be ready or to know it has failed.
:param timeout: The time to wait before readiness or failure is determined
.. # noqa: DAR201 | jina/peapods/peas/__init__.py | _wait_for_ready_or_shutdown | MaxielMrvaljevic/jina | python | def _wait_for_ready_or_shutdown(self, timeout: Optional[float]):
'\n Waits for the process to be ready or to know it has failed.\n\n :param timeout: The time to wait before readiness or failure is determined\n .. # noqa: DAR201\n '
return self.runtime_cls.wait_for_ready_or_shutdo... |
def wait_start_success(self):
'Block until all peas starts successfully.\n\n If not success, it will raise an error hoping the outer function to catch it\n '
_timeout = self.args.timeout_ready
if (_timeout <= 0):
_timeout = None
else:
_timeout /= 1000.0
if self._wait_fo... | 5,697,993,069,352,098,000 | Block until all peas starts successfully.
If not success, it will raise an error hoping the outer function to catch it | jina/peapods/peas/__init__.py | wait_start_success | MaxielMrvaljevic/jina | python | def wait_start_success(self):
'Block until all peas starts successfully.\n\n If not success, it will raise an error hoping the outer function to catch it\n '
_timeout = self.args.timeout_ready
if (_timeout <= 0):
_timeout = None
else:
_timeout /= 1000.0
if self._wait_fo... |
@property
def _is_dealer(self):
'Return true if this `Pea` must act as a Dealer responding to a Router\n .. # noqa: DAR201\n '
return (self.args.socket_in == SocketType.DEALER_CONNECT) | 7,485,969,000,715,377,000 | Return true if this `Pea` must act as a Dealer responding to a Router
.. # noqa: DAR201 | jina/peapods/peas/__init__.py | _is_dealer | MaxielMrvaljevic/jina | python | @property
def _is_dealer(self):
'Return true if this `Pea` must act as a Dealer responding to a Router\n .. # noqa: DAR201\n '
return (self.args.socket_in == SocketType.DEALER_CONNECT) |
def close(self) -> None:
'Close the Pea\n\n This method makes sure that the `Process/thread` is properly finished and its resources properly released\n '
self.logger.debug('waiting for ready or shutdown signal from runtime')
if (self.is_ready.is_set() and (not self.is_shutdown.is_set())):
... | 7,289,301,697,291,670,000 | Close the Pea
This method makes sure that the `Process/thread` is properly finished and its resources properly released | jina/peapods/peas/__init__.py | close | MaxielMrvaljevic/jina | python | def close(self) -> None:
'Close the Pea\n\n This method makes sure that the `Process/thread` is properly finished and its resources properly released\n '
self.logger.debug('waiting for ready or shutdown signal from runtime')
if (self.is_ready.is_set() and (not self.is_shutdown.is_set())):
... |
@property
def role(self) -> 'PeaRoleType':
'Get the role of this pea in a pod\n\n\n .. #noqa: DAR201'
return self.args.pea_role | -7,939,200,317,559,389,000 | Get the role of this pea in a pod
.. #noqa: DAR201 | jina/peapods/peas/__init__.py | role | MaxielMrvaljevic/jina | python | @property
def role(self) -> 'PeaRoleType':
'Get the role of this pea in a pod\n\n\n .. #noqa: DAR201'
return self.args.pea_role |
@property
def _is_inner_pea(self) -> bool:
'Determine whether this is a inner pea or a head/tail\n\n\n .. #noqa: DAR201'
return ((self.role is PeaRoleType.SINGLETON) or (self.role is PeaRoleType.PARALLEL)) | 8,180,830,302,830,605,000 | Determine whether this is a inner pea or a head/tail
.. #noqa: DAR201 | jina/peapods/peas/__init__.py | _is_inner_pea | MaxielMrvaljevic/jina | python | @property
def _is_inner_pea(self) -> bool:
'Determine whether this is a inner pea or a head/tail\n\n\n .. #noqa: DAR201'
return ((self.role is PeaRoleType.SINGLETON) or (self.role is PeaRoleType.PARALLEL)) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.