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 |
|---|---|---|---|---|---|---|---|---|---|
1102641b323d87404d4f1cd6b36517af7ec6ccf63aa5b58eaee86abd60fa0f31 | @pytest.mark.serial
def test_delete_zone_twice(shared_zone_test_context):
'\n Test deleting a zone with deleted status returns 404\n '
client = shared_zone_test_context.ok_vinyldns_client
result_zone = None
try:
zone_name = f'one-time{shared_zone_test_context.partition_id}'
zone = ... | Test deleting a zone with deleted status returns 404 | modules/api/src/test/functional/tests/zones/delete_zone_test.py | test_delete_zone_twice | Jay07GIT/vinyldns | 0 | python | @pytest.mark.serial
def test_delete_zone_twice(shared_zone_test_context):
'\n \n '
client = shared_zone_test_context.ok_vinyldns_client
result_zone = None
try:
zone_name = f'one-time{shared_zone_test_context.partition_id}'
zone = {'name': zone_name, 'email': 'example@example.com', ... | @pytest.mark.serial
def test_delete_zone_twice(shared_zone_test_context):
'\n \n '
client = shared_zone_test_context.ok_vinyldns_client
result_zone = None
try:
zone_name = f'one-time{shared_zone_test_context.partition_id}'
zone = {'name': zone_name, 'email': 'example@example.com', ... |
089a1ad491a8f31f81ced3d08a8ab90b2696d5952fe3f411f0d36dd6268bd2b5 | def test_delete_zone_returns_404_if_zone_not_found(shared_zone_test_context):
'\n Test deleting a zone returns a 404 if the zone was not found\n '
client = shared_zone_test_context.ok_vinyldns_client
client.delete_zone('nothere', status=404) | Test deleting a zone returns a 404 if the zone was not found | modules/api/src/test/functional/tests/zones/delete_zone_test.py | test_delete_zone_returns_404_if_zone_not_found | Jay07GIT/vinyldns | 0 | python | def test_delete_zone_returns_404_if_zone_not_found(shared_zone_test_context):
'\n \n '
client = shared_zone_test_context.ok_vinyldns_client
client.delete_zone('nothere', status=404) | def test_delete_zone_returns_404_if_zone_not_found(shared_zone_test_context):
'\n \n '
client = shared_zone_test_context.ok_vinyldns_client
client.delete_zone('nothere', status=404)<|docstring|>Test deleting a zone returns a 404 if the zone was not found<|endoftext|> |
7d0125b2273da0ae00a5f869cf10ca40ebb75d675e3dfd671e1e85e0fbf1b43f | def test_delete_zone_no_authorization(shared_zone_test_context):
'\n Test deleting a zone without authorization\n '
client = shared_zone_test_context.ok_vinyldns_client
client.delete_zone('1234', sign_request=False, status=401) | Test deleting a zone without authorization | modules/api/src/test/functional/tests/zones/delete_zone_test.py | test_delete_zone_no_authorization | Jay07GIT/vinyldns | 0 | python | def test_delete_zone_no_authorization(shared_zone_test_context):
'\n \n '
client = shared_zone_test_context.ok_vinyldns_client
client.delete_zone('1234', sign_request=False, status=401) | def test_delete_zone_no_authorization(shared_zone_test_context):
'\n \n '
client = shared_zone_test_context.ok_vinyldns_client
client.delete_zone('1234', sign_request=False, status=401)<|docstring|>Test deleting a zone without authorization<|endoftext|> |
8d20b1e7de817628462edf5e4e96faa3deb6919c0c6666e3c03b86ff9ac41b3b | def __init__(self, service: str, reason: t.Optional[str]=None) -> None:
'\n Parameters\n ----------\n reason: str\n The reason for the Error. Defaults to None.\n '
error = f'There was an issue with the {service} API.'
if reason:
error += f' Reason: {reason}.'
... | Parameters
----------
reason: str
The reason for the Error. Defaults to None. | hypixelio/exceptions/exceptions.py | __init__ | GrandMoff100/HypixelIO | 0 | python | def __init__(self, service: str, reason: t.Optional[str]=None) -> None:
'\n Parameters\n ----------\n reason: str\n The reason for the Error. Defaults to None.\n '
error = f'There was an issue with the {service} API.'
if reason:
error += f' Reason: {reason}.'
... | def __init__(self, service: str, reason: t.Optional[str]=None) -> None:
'\n Parameters\n ----------\n reason: str\n The reason for the Error. Defaults to None.\n '
error = f'There was an issue with the {service} API.'
if reason:
error += f' Reason: {reason}.'
... |
de0b05f8dc6485475519625c985d346de577cf09002a3f2073c722685c1b229e | def __init__(self, reason: t.Optional[str]=None) -> None:
'\n Parameters\n ----------\n reason: str\n The reason for the Error. Defaults to None.\n '
super().__init__('Hypixel', reason) | Parameters
----------
reason: str
The reason for the Error. Defaults to None. | hypixelio/exceptions/exceptions.py | __init__ | GrandMoff100/HypixelIO | 0 | python | def __init__(self, reason: t.Optional[str]=None) -> None:
'\n Parameters\n ----------\n reason: str\n The reason for the Error. Defaults to None.\n '
super().__init__('Hypixel', reason) | def __init__(self, reason: t.Optional[str]=None) -> None:
'\n Parameters\n ----------\n reason: str\n The reason for the Error. Defaults to None.\n '
super().__init__('Hypixel', reason)<|docstring|>Parameters
----------
reason: str
The reason for the Error. Defaults to... |
a06c35f2692d590c4480d0a0968ea087d685c6f4d2ced9d514b1f67c02ffe7c9 | def __init__(self, reason: t.Optional[str]=None) -> None:
'\n Parameters\n ----------\n reason: str\n The reason for the Error. Defaults to None.\n '
super().__init__('Crafatar', reason) | Parameters
----------
reason: str
The reason for the Error. Defaults to None. | hypixelio/exceptions/exceptions.py | __init__ | GrandMoff100/HypixelIO | 0 | python | def __init__(self, reason: t.Optional[str]=None) -> None:
'\n Parameters\n ----------\n reason: str\n The reason for the Error. Defaults to None.\n '
super().__init__('Crafatar', reason) | def __init__(self, reason: t.Optional[str]=None) -> None:
'\n Parameters\n ----------\n reason: str\n The reason for the Error. Defaults to None.\n '
super().__init__('Crafatar', reason)<|docstring|>Parameters
----------
reason: str
The reason for the Error. Defaults t... |
71973f2fc340d7befa86b536e5469e41195808d87f0394f768651a173ee528ca | def __init__(self, reason: t.Optional[str]=None) -> None:
'\n Parameters\n ----------\n reason: str\n The reason for the Error. Defaults to None.\n '
super().__init__('Mojang', reason) | Parameters
----------
reason: str
The reason for the Error. Defaults to None. | hypixelio/exceptions/exceptions.py | __init__ | GrandMoff100/HypixelIO | 0 | python | def __init__(self, reason: t.Optional[str]=None) -> None:
'\n Parameters\n ----------\n reason: str\n The reason for the Error. Defaults to None.\n '
super().__init__('Mojang', reason) | def __init__(self, reason: t.Optional[str]=None) -> None:
'\n Parameters\n ----------\n reason: str\n The reason for the Error. Defaults to None.\n '
super().__init__('Mojang', reason)<|docstring|>Parameters
----------
reason: str
The reason for the Error. Defaults to ... |
1500a69248777ef192cd88a6d173f2377b9c73936e839881949a923d70895f59 | def __init__(self, retry_after: datetime) -> None:
'\n Parameters\n ----------\n retry_after: datetime\n The time when the API will be available again for fetching.\n '
error = f"The rate-limit for the Hypixel API was hit. Try again after{retry_after.strftime('%Y-%m-%d %H:... | Parameters
----------
retry_after: datetime
The time when the API will be available again for fetching. | hypixelio/exceptions/exceptions.py | __init__ | GrandMoff100/HypixelIO | 0 | python | def __init__(self, retry_after: datetime) -> None:
'\n Parameters\n ----------\n retry_after: datetime\n The time when the API will be available again for fetching.\n '
error = f"The rate-limit for the Hypixel API was hit. Try again after{retry_after.strftime('%Y-%m-%d %H:... | def __init__(self, retry_after: datetime) -> None:
'\n Parameters\n ----------\n retry_after: datetime\n The time when the API will be available again for fetching.\n '
error = f"The rate-limit for the Hypixel API was hit. Try again after{retry_after.strftime('%Y-%m-%d %H:... |
f4e2115b021b832445cd1e6d96542669ebca6fcee175453598925b01ecefb37f | def __init__(self, reason: t.Optional[str]=None, user: t.Optional[str]=None) -> None:
'\n Parameters\n ----------\n reason: str\n The reason for the error.\n user: t.Optional[str]\n The user not found when searched for.\n '
error = 'Player not found.'
... | Parameters
----------
reason: str
The reason for the error.
user: t.Optional[str]
The user not found when searched for. | hypixelio/exceptions/exceptions.py | __init__ | GrandMoff100/HypixelIO | 0 | python | def __init__(self, reason: t.Optional[str]=None, user: t.Optional[str]=None) -> None:
'\n Parameters\n ----------\n reason: str\n The reason for the error.\n user: t.Optional[str]\n The user not found when searched for.\n '
error = 'Player not found.'
... | def __init__(self, reason: t.Optional[str]=None, user: t.Optional[str]=None) -> None:
'\n Parameters\n ----------\n reason: str\n The reason for the error.\n user: t.Optional[str]\n The user not found when searched for.\n '
error = 'Player not found.'
... |
3964cea8338e8d90048f8bd7df8bea356b0380ba529696ea5a0085eefcbcb5b0 | def __init__(self, reason: t.Optional[str]=None) -> None:
'\n Parameters\n ----------\n reason: str\n The reason for the Error. Defaults to None.\n '
error = 'Guild not found.'
if reason:
error += f' {reason}.'
super().__init__(error)
self.error = error | Parameters
----------
reason: str
The reason for the Error. Defaults to None. | hypixelio/exceptions/exceptions.py | __init__ | GrandMoff100/HypixelIO | 0 | python | def __init__(self, reason: t.Optional[str]=None) -> None:
'\n Parameters\n ----------\n reason: str\n The reason for the Error. Defaults to None.\n '
error = 'Guild not found.'
if reason:
error += f' {reason}.'
super().__init__(error)
self.error = error | def __init__(self, reason: t.Optional[str]=None) -> None:
'\n Parameters\n ----------\n reason: str\n The reason for the Error. Defaults to None.\n '
error = 'Guild not found.'
if reason:
error += f' {reason}.'
super().__init__(error)
self.error = error... |
d06d16036854a3bda9d4b38a0162a04fc77cea7b559c5d1b92f33716d0448c51 | def __init__(self):
'\n Init method.\n '
super().__init__() | Init method. | HybridNet/submodel.py | __init__ | GANWANSHUI/HybridNet | 0 | python | def __init__(self):
'\n \n '
super().__init__() | def __init__(self):
'\n \n '
super().__init__()<|docstring|>Init method.<|endoftext|> |
63e2621e539c4f7081a967d70552be2c044ba1d6cc91d5e0d4084da8018a7a46 | def forward(self, input):
'\n Forward pass of the function.\n '
return (input * torch.tanh(F.softplus(input))) | Forward pass of the function. | HybridNet/submodel.py | forward | GANWANSHUI/HybridNet | 0 | python | def forward(self, input):
'\n \n '
return (input * torch.tanh(F.softplus(input))) | def forward(self, input):
'\n \n '
return (input * torch.tanh(F.softplus(input)))<|docstring|>Forward pass of the function.<|endoftext|> |
74bea9d4c0fe8616e0d76b9f54858f5f802b489856383f056798ad6af7d18d35 | def largest_indices(ary, n):
'Returns the n largest indices from a numpy array.'
flat = ary.flatten()
indices = np.argpartition(flat, (- n))[(- n):]
indices = indices[np.argsort((- flat[indices]))]
return np.unravel_index(indices, ary.shape) | Returns the n largest indices from a numpy array. | VPR_Techniques/CoHOG_Python/CoHOG.py | largest_indices | oravus/VPR-Bench | 30 | python | def largest_indices(ary, n):
flat = ary.flatten()
indices = np.argpartition(flat, (- n))[(- n):]
indices = indices[np.argsort((- flat[indices]))]
return np.unravel_index(indices, ary.shape) | def largest_indices(ary, n):
flat = ary.flatten()
indices = np.argpartition(flat, (- n))[(- n):]
indices = indices[np.argsort((- flat[indices]))]
return np.unravel_index(indices, ary.shape)<|docstring|>Returns the n largest indices from a numpy array.<|endoftext|> |
353c9ee2915c34cea6a446c28f8c9be428980e7f46b7a4aba61f227862c09af3 | def compute_map_features(ref_map):
'INPUT: reference list of images to be matched.'
'OUTPUT: Feature descriptors of all reference images to be matched.'
ref_desc = []
for ref in range(len(ref_map)):
img_1 = cv2.cvtColor(ref_map[ref], cv2.COLOR_BGR2GRAY)
if (img_1 is not None):
... | INPUT: reference list of images to be matched. | VPR_Techniques/CoHOG_Python/CoHOG.py | compute_map_features | oravus/VPR-Bench | 30 | python | def compute_map_features(ref_map):
'OUTPUT: Feature descriptors of all reference images to be matched.'
ref_desc = []
for ref in range(len(ref_map)):
img_1 = cv2.cvtColor(ref_map[ref], cv2.COLOR_BGR2GRAY)
if (img_1 is not None):
img_1 = cv2.resize(img_1, (magic_height, magic... | def compute_map_features(ref_map):
'OUTPUT: Feature descriptors of all reference images to be matched.'
ref_desc = []
for ref in range(len(ref_map)):
img_1 = cv2.cvtColor(ref_map[ref], cv2.COLOR_BGR2GRAY)
if (img_1 is not None):
img_1 = cv2.resize(img_1, (magic_height, magic... |
b63145126a9bf35e065bafd1c05fe6192c24a4cc308ae943958963a28472af4e | def perform_VPR(query_info, ref_map_features):
"INPUT: Query desc and reference list of images' features to be matched."
'OUTPUT: Matching Score and Best Matched Image.'
vector_2 = query_info[0]
regional_goodness = query_info[1]
confusion_vector = np.zeros(len(ref_map_features), dtype=np.float32)
... | INPUT: Query desc and reference list of images' features to be matched. | VPR_Techniques/CoHOG_Python/CoHOG.py | perform_VPR | oravus/VPR-Bench | 30 | python | def perform_VPR(query_info, ref_map_features):
'OUTPUT: Matching Score and Best Matched Image.'
vector_2 = query_info[0]
regional_goodness = query_info[1]
confusion_vector = np.zeros(len(ref_map_features), dtype=np.float32)
ref_desc = ref_map_features
for ref in range(len(ref_map_features))... | def perform_VPR(query_info, ref_map_features):
'OUTPUT: Matching Score and Best Matched Image.'
vector_2 = query_info[0]
regional_goodness = query_info[1]
confusion_vector = np.zeros(len(ref_map_features), dtype=np.float32)
ref_desc = ref_map_features
for ref in range(len(ref_map_features))... |
20a622012c7dcbf107ce2bf93bc7c4815fa31b92af499ae8fd7dc1b2a3b14043 | def check_inputs(self):
' Ensure all layers exist\n '
check_vals = {}
good = True
for lyr in [self.pop_layer, self.urban_layer, self.urban_hd_layer]:
check_vals[lyr] = os.path.exists(lyr)
if (not check_vals[lyr]):
good = False
self.check_vals = check_vals
retur... | Ensure all layers exist | src/urban_helper.py | check_inputs | eigotateishi/GOST_Urban | 3 | python | def check_inputs(self):
' \n '
check_vals = {}
good = True
for lyr in [self.pop_layer, self.urban_layer, self.urban_hd_layer]:
check_vals[lyr] = os.path.exists(lyr)
if (not check_vals[lyr]):
good = False
self.check_vals = check_vals
return good | def check_inputs(self):
' \n '
check_vals = {}
good = True
for lyr in [self.pop_layer, self.urban_layer, self.urban_hd_layer]:
check_vals[lyr] = os.path.exists(lyr)
if (not check_vals[lyr]):
good = False
self.check_vals = check_vals
return good<|docstring|>Ensu... |
2fcf653d9492809400f651227f0d857163e020be3f1f0d94cba2e650129039f9 | def __init__(self, iso3, output_folder, country_bounds, pop_files, final_folder='', ghspop_suffix=''):
" Create object for managing input data for summarizing urban extents\n \n INPUT\n :param: iso3 - string describing iso3 code\n :param: output_folder - string path to folder to hold res... | Create object for managing input data for summarizing urban extents
INPUT
:param: iso3 - string describing iso3 code
:param: output_folder - string path to folder to hold results
:param: country_bounds - geopandas dataframe of admin0 boundary
NAMING CONVENTION
To save this renaming step on my side, which can also in... | src/urban_helper.py | __init__ | eigotateishi/GOST_Urban | 3 | python | def __init__(self, iso3, output_folder, country_bounds, pop_files, final_folder=, ghspop_suffix=):
" Create object for managing input data for summarizing urban extents\n \n INPUT\n :param: iso3 - string describing iso3 code\n :param: output_folder - string path to folder to hold results... | def __init__(self, iso3, output_folder, country_bounds, pop_files, final_folder=, ghspop_suffix=):
" Create object for managing input data for summarizing urban extents\n \n INPUT\n :param: iso3 - string describing iso3 code\n :param: output_folder - string path to folder to hold results... |
80e1ed231e44a6a5902ab848f128a57b70289c4c28b0a4cf7caec27d2fede328 | def process_dem(self, global_dem=''):
' Download DEM from AWS, calculate slope\n '
if ((not os.path.exists(self.dem_file)) and (global_dem == '')):
tPrint('Downloading DEM')
elevation.clip(bounds=self.inD.total_bounds, max_download_tiles=90000, output=self.dem_file, product='SRTM3')
i... | Download DEM from AWS, calculate slope | src/urban_helper.py | process_dem | eigotateishi/GOST_Urban | 3 | python | def process_dem(self, global_dem=):
' \n '
if ((not os.path.exists(self.dem_file)) and (global_dem == )):
tPrint('Downloading DEM')
elevation.clip(bounds=self.inD.total_bounds, max_download_tiles=90000, output=self.dem_file, product='SRTM3')
if ((not os.path.exists(self.dem_file)) and... | def process_dem(self, global_dem=):
' \n '
if ((not os.path.exists(self.dem_file)) and (global_dem == )):
tPrint('Downloading DEM')
elevation.clip(bounds=self.inD.total_bounds, max_download_tiles=90000, output=self.dem_file, product='SRTM3')
if ((not os.path.exists(self.dem_file)) and... |
fbfd796611a2954963f8905eb906f2b7a2e911b2dfbbcc163bea4aaf596c7550 | def extract_layers(self, global_landcover, global_ghspop, global_ghspop1k, global_ghbuilt, global_ghsl, global_smod):
' extract global layers for current country\n '
if (not os.path.exists(self.lc_file_h20)):
tPrint('Extracting water')
if (not os.path.exists(self.lc_file)):
rM... | extract global layers for current country | src/urban_helper.py | extract_layers | eigotateishi/GOST_Urban | 3 | python | def extract_layers(self, global_landcover, global_ghspop, global_ghspop1k, global_ghbuilt, global_ghsl, global_smod):
' \n '
if (not os.path.exists(self.lc_file_h20)):
tPrint('Extracting water')
if (not os.path.exists(self.lc_file)):
rMisc.clipRaster(rasterio.open(global_landc... | def extract_layers(self, global_landcover, global_ghspop, global_ghspop1k, global_ghbuilt, global_ghsl, global_smod):
' \n '
if (not os.path.exists(self.lc_file_h20)):
tPrint('Extracting water')
if (not os.path.exists(self.lc_file)):
rMisc.clipRaster(rasterio.open(global_landc... |
84518453bc30544fbdf99365594a82e8ec4f77567789f65f74713a74475c6bda | def calculate_urban(self, urb_val=300, hd_urb_val=1500):
' Calculate urban and HD urban extents from population files\n '
ghs_R = rasterio.open(self.ghspop_file)
for p_file in self.pop_files:
final_pop = os.path.join(self.final_folder, os.path.basename(p_file).replace(self.iso3.lower(), ('%s%... | Calculate urban and HD urban extents from population files | src/urban_helper.py | calculate_urban | eigotateishi/GOST_Urban | 3 | python | def calculate_urban(self, urb_val=300, hd_urb_val=1500):
' \n '
ghs_R = rasterio.open(self.ghspop_file)
for p_file in self.pop_files:
final_pop = os.path.join(self.final_folder, os.path.basename(p_file).replace(self.iso3.lower(), ('%s%s' % (self.iso3.lower(), self.suffix))))
if ('1k1k... | def calculate_urban(self, urb_val=300, hd_urb_val=1500):
' \n '
ghs_R = rasterio.open(self.ghspop_file)
for p_file in self.pop_files:
final_pop = os.path.join(self.final_folder, os.path.basename(p_file).replace(self.iso3.lower(), ('%s%s' % (self.iso3.lower(), self.suffix))))
if ('1k1k... |
e3b607cea159e8e452880231858dbda32e26642fa3980ad170ea78e4324f6251 | def pop_zonal_admin(self, admin_layer):
' calculate urban and rural \n \n :param: - admin_layer\n '
for p_file in self.pop_files:
pop_file = os.path.join(self.final_folder, os.path.basename(p_file).replace(self.iso3.lower(), ('%s%s' % (self.iso3.lower(), self.suffix))))
... | calculate urban and rural
:param: - admin_layer | src/urban_helper.py | pop_zonal_admin | eigotateishi/GOST_Urban | 3 | python | def pop_zonal_admin(self, admin_layer):
' calculate urban and rural \n \n :param: - admin_layer\n '
for p_file in self.pop_files:
pop_file = os.path.join(self.final_folder, os.path.basename(p_file).replace(self.iso3.lower(), ('%s%s' % (self.iso3.lower(), self.suffix))))
... | def pop_zonal_admin(self, admin_layer):
' calculate urban and rural \n \n :param: - admin_layer\n '
for p_file in self.pop_files:
pop_file = os.path.join(self.final_folder, os.path.basename(p_file).replace(self.iso3.lower(), ('%s%s' % (self.iso3.lower(), self.suffix))))
... |
2cebd5bcea87b5dcbc55b8ebdcb355030d915f0f8ab5fdd3477cdccdacfedec7 | def compare_pop_rasters(self, verbose=True):
' read in and summarize population rasters \n '
all_res = []
for pFile in self.pop_files:
inR = rasterio.open(pFile)
inD = inR.read()
inD = inD[(inD > 0)]
all_res.append([os.path.basename(pFile), inD.sum()])
i... | read in and summarize population rasters | src/urban_helper.py | compare_pop_rasters | eigotateishi/GOST_Urban | 3 | python | def compare_pop_rasters(self, verbose=True):
' \n '
all_res = []
for pFile in self.pop_files:
inR = rasterio.open(pFile)
inD = inR.read()
inD = inD[(inD > 0)]
all_res.append([os.path.basename(pFile), inD.sum()])
if verbose:
print(f'{os.path.... | def compare_pop_rasters(self, verbose=True):
' \n '
all_res = []
for pFile in self.pop_files:
inR = rasterio.open(pFile)
inD = inR.read()
inD = inD[(inD > 0)]
all_res.append([os.path.basename(pFile), inD.sum()])
if verbose:
print(f'{os.path.... |
14b396ad7cceb3faaf6e2b94ae11d3d83a5ec5ecd8343dbf51585c82345fcfb0 | def evaluateOutput(self, admin_stats, commune_stats):
'\n Check the outputs to determine if processing worked correctly\n \n 1. compare population totals between raw, 250m and 1km data\n 2. Calculate urbanization rate\n 3. Water mask\n a. calculate overla... | Check the outputs to determine if processing worked correctly
1. compare population totals between raw, 250m and 1km data
2. Calculate urbanization rate
3. Water mask
a. calculate overlap between water classes
b. calculate overlap between water and population
c. calculate overlap betwe... | src/urban_helper.py | evaluateOutput | eigotateishi/GOST_Urban | 3 | python | def evaluateOutput(self, admin_stats, commune_stats):
'\n Check the outputs to determine if processing worked correctly\n \n 1. compare population totals between raw, 250m and 1km data\n 2. Calculate urbanization rate\n 3. Water mask\n a. calculate overla... | def evaluateOutput(self, admin_stats, commune_stats):
'\n Check the outputs to determine if processing worked correctly\n \n 1. compare population totals between raw, 250m and 1km data\n 2. Calculate urbanization rate\n 3. Water mask\n a. calculate overla... |
f2b40f7bd699b11f60ae22238cb41552ca452ef706528ba10d448bce6939114a | def get_flags(config):
'Get glob flags.'
flags = ((((glob.GLOBSTAR | glob.DOTGLOB) | glob.NEGATE) | glob.SPLIT) | glob.NEGATEALL)
if config.get('brace_expansion', False):
flags |= glob.BRACE
if config.get('extended_glob', False):
flags |= glob.EXTGLOB
if config.get('minus_negate', Tr... | Get glob flags. | label_bot/wildcard_labels.py | get_flags | gir-bot/do-not-merge | 13 | python | def get_flags(config):
flags = ((((glob.GLOBSTAR | glob.DOTGLOB) | glob.NEGATE) | glob.SPLIT) | glob.NEGATEALL)
if config.get('brace_expansion', False):
flags |= glob.BRACE
if config.get('extended_glob', False):
flags |= glob.EXTGLOB
if config.get('minus_negate', True):
flag... | def get_flags(config):
flags = ((((glob.GLOBSTAR | glob.DOTGLOB) | glob.NEGATE) | glob.SPLIT) | glob.NEGATEALL)
if config.get('brace_expansion', False):
flags |= glob.BRACE
if config.get('extended_glob', False):
flags |= glob.EXTGLOB
if config.get('minus_negate', True):
flag... |
be79995a0266ec0ae5e6e58551a4d51051cdc05c9b7240e2f9fabc2f81bee3d5 | def get_labels(rules, files, flags):
'Sync labels.'
add_labels = {}
for file in files:
for label in rules:
try:
names = label['labels']
lows = [n.lower() for n in names]
except Exception:
traceback.print_exc(file=sys.stdout)
... | Sync labels. | label_bot/wildcard_labels.py | get_labels | gir-bot/do-not-merge | 13 | python | def get_labels(rules, files, flags):
add_labels = {}
for file in files:
for label in rules:
try:
names = label['labels']
lows = [n.lower() for n in names]
except Exception:
traceback.print_exc(file=sys.stdout)
c... | def get_labels(rules, files, flags):
add_labels = {}
for file in files:
for label in rules:
try:
names = label['labels']
lows = [n.lower() for n in names]
except Exception:
traceback.print_exc(file=sys.stdout)
c... |
7bc990d0bd7388d71b55399c76b75df02d552dad52b3678fc073ec7dc94c8377 | async def wildcard_labels(event, gh, config):
'Label issues by files that have changed.'
rules = config.get('rules', [])
if rules:
flags = get_flags(config)
files = (await get_changed_files(event, gh))
(add, remove) = get_labels(rules, files, flags)
(await update_issue_labels... | Label issues by files that have changed. | label_bot/wildcard_labels.py | wildcard_labels | gir-bot/do-not-merge | 13 | python | async def wildcard_labels(event, gh, config):
rules = config.get('rules', [])
if rules:
flags = get_flags(config)
files = (await get_changed_files(event, gh))
(add, remove) = get_labels(rules, files, flags)
(await update_issue_labels(event, gh, add, remove)) | async def wildcard_labels(event, gh, config):
rules = config.get('rules', [])
if rules:
flags = get_flags(config)
files = (await get_changed_files(event, gh))
(add, remove) = get_labels(rules, files, flags)
(await update_issue_labels(event, gh, add, remove))<|docstring|>Labe... |
9919b2f0d3e0020bcc9aecbdbff3b394665146a3dd2cc7bc134bf2bef15b7703 | async def get_changed_files(event, gh):
'Get changed files.'
files = []
compare = (await gh.getitem(event.compare_url, {'base': event.base, 'head': event.head}))
for file in compare['files']:
files.append(file['filename'])
return files | Get changed files. | label_bot/wildcard_labels.py | get_changed_files | gir-bot/do-not-merge | 13 | python | async def get_changed_files(event, gh):
files = []
compare = (await gh.getitem(event.compare_url, {'base': event.base, 'head': event.head}))
for file in compare['files']:
files.append(file['filename'])
return files | async def get_changed_files(event, gh):
files = []
compare = (await gh.getitem(event.compare_url, {'base': event.base, 'head': event.head}))
for file in compare['files']:
files.append(file['filename'])
return files<|docstring|>Get changed files.<|endoftext|> |
9554eea4f809a94a4d38f24b7f9f99a0f6cdb7d61887a8545101aed563c23bbc | async def update_issue_labels(event, gh, add_labels, remove_labels):
'Update issue labels.'
remove = []
async for name in event.get_issue_labels(gh):
low = name.lower()
if (low not in remove_labels):
if (low in add_labels):
del add_labels[low]
else:
... | Update issue labels. | label_bot/wildcard_labels.py | update_issue_labels | gir-bot/do-not-merge | 13 | python | async def update_issue_labels(event, gh, add_labels, remove_labels):
remove = []
async for name in event.get_issue_labels(gh):
low = name.lower()
if (low not in remove_labels):
if (low in add_labels):
del add_labels[low]
else:
remove.append(na... | async def update_issue_labels(event, gh, add_labels, remove_labels):
remove = []
async for name in event.get_issue_labels(gh):
low = name.lower()
if (low not in remove_labels):
if (low in add_labels):
del add_labels[low]
else:
remove.append(na... |
9690522cf42c196c5d18d3f0c335f7c09622036bdae4a4cf4008b2c0b298dc55 | async def pending(event, gh):
'Set task to pending.'
(await event.set_status(gh, util.EVT_PENDING, 'labels/auto-labels', 'Pending')) | Set task to pending. | label_bot/wildcard_labels.py | pending | gir-bot/do-not-merge | 13 | python | async def pending(event, gh):
(await event.set_status(gh, util.EVT_PENDING, 'labels/auto-labels', 'Pending')) | async def pending(event, gh):
(await event.set_status(gh, util.EVT_PENDING, 'labels/auto-labels', 'Pending'))<|docstring|>Set task to pending.<|endoftext|> |
3e8d34060129a96b8dd7d9fae5edbb95cf60f5f33c6d322a10ae7b5267877d28 | async def run(event, gh, config, **kwargs):
'Run task.'
print(f'WILDCARD: {event.full_name}')
try:
if config.get('error', ''):
raise Exception(config['error'])
(await wildcard_labels(event, gh, config))
success = True
except Exception:
traceback.print_exc(file... | Run task. | label_bot/wildcard_labels.py | run | gir-bot/do-not-merge | 13 | python | async def run(event, gh, config, **kwargs):
print(f'WILDCARD: {event.full_name}')
try:
if config.get('error', ):
raise Exception(config['error'])
(await wildcard_labels(event, gh, config))
success = True
except Exception:
traceback.print_exc(file=sys.stdout)
... | async def run(event, gh, config, **kwargs):
print(f'WILDCARD: {event.full_name}')
try:
if config.get('error', ):
raise Exception(config['error'])
(await wildcard_labels(event, gh, config))
success = True
except Exception:
traceback.print_exc(file=sys.stdout)
... |
8e354be01e6d7893ae015d4bc8d24163768aad78ce8d7a7144e52f54bd63297c | def _update_type_str(self):
'\n Get type string for Label\n\n Returns\n -------\n : ~str\n\n '
self.type_str = repr(type(self.value)) | Get type string for Label
Returns
-------
: ~str | tardis/plasma/properties/base.py | _update_type_str | wkerzendorf/tardis | 1 | python | def _update_type_str(self):
'\n Get type string for Label\n\n Returns\n -------\n : ~str\n\n '
self.type_str = repr(type(self.value)) | def _update_type_str(self):
'\n Get type string for Label\n\n Returns\n -------\n : ~str\n\n '
self.type_str = repr(type(self.value))<|docstring|>Get type string for Label
Returns
-------
: ~str<|endoftext|> |
62ac963262b237195c7af04717d7e618089b8bb8b4e7c4dcc1a7a2808679a894 | def _update_inputs(self):
'\n This function uses the CPython API to read the variable names from the\n `calculate`-function and makes the plasma routines easily programmable.\n '
calculate_call_signature = self.calculate.func_code.co_varnames[:self.calculate.func_code.co_argcount]
self.... | This function uses the CPython API to read the variable names from the
`calculate`-function and makes the plasma routines easily programmable. | tardis/plasma/properties/base.py | _update_inputs | wkerzendorf/tardis | 1 | python | def _update_inputs(self):
'\n This function uses the CPython API to read the variable names from the\n `calculate`-function and makes the plasma routines easily programmable.\n '
calculate_call_signature = self.calculate.func_code.co_varnames[:self.calculate.func_code.co_argcount]
self.... | def _update_inputs(self):
'\n This function uses the CPython API to read the variable names from the\n `calculate`-function and makes the plasma routines easily programmable.\n '
calculate_call_signature = self.calculate.func_code.co_varnames[:self.calculate.func_code.co_argcount]
self.... |
9e4c2182878ab61f07ab1e748cb80ae336a9bfd0155799475fbc6abbdb81a710 | def update(self):
'\n Updates the processing Plasma by calling the `calculate`-method with\n the required inputs\n\n :return:\n '
if (len(self.outputs) == 1):
setattr(self, self.outputs[0], self.calculate(*self._get_input_values()))
else:
new_values = self.calcula... | Updates the processing Plasma by calling the `calculate`-method with
the required inputs
:return: | tardis/plasma/properties/base.py | update | wkerzendorf/tardis | 1 | python | def update(self):
'\n Updates the processing Plasma by calling the `calculate`-method with\n the required inputs\n\n :return:\n '
if (len(self.outputs) == 1):
setattr(self, self.outputs[0], self.calculate(*self._get_input_values()))
else:
new_values = self.calcula... | def update(self):
'\n Updates the processing Plasma by calling the `calculate`-method with\n the required inputs\n\n :return:\n '
if (len(self.outputs) == 1):
setattr(self, self.outputs[0], self.calculate(*self._get_input_values()))
else:
new_values = self.calcula... |
2c8ed47490a3d5b4b274e6e4979988229f4d28307a77ad9991c07c17d560e602 | @abc.abstractmethod
def _create_commit_lock(self, cursor):
'\n Create the global lock held during commit.\n\n (MySQL and PostgreSQL do this differently.)\n '
raise NotImplementedError() | Create the global lock held during commit.
(MySQL and PostgreSQL do this differently.) | relstorage/adapters/schema.py | _create_commit_lock | dpedu/relstorage | 1 | python | @abc.abstractmethod
def _create_commit_lock(self, cursor):
'\n Create the global lock held during commit.\n\n (MySQL and PostgreSQL do this differently.)\n '
raise NotImplementedError() | @abc.abstractmethod
def _create_commit_lock(self, cursor):
'\n Create the global lock held during commit.\n\n (MySQL and PostgreSQL do this differently.)\n '
raise NotImplementedError()<|docstring|>Create the global lock held during commit.
(MySQL and PostgreSQL do this differently.)<|endo... |
a9bf50ac586fc2c2b43ab479a07ecb996d274452c883b85fd2e31f8ccb184ff5 | @abc.abstractmethod
def _create_pack_lock(self, cursor):
'\n Create the global lock held during pack.\n\n (MySQL and PostgreSQL do this differently.)\n '
raise NotImplementedError() | Create the global lock held during pack.
(MySQL and PostgreSQL do this differently.) | relstorage/adapters/schema.py | _create_pack_lock | dpedu/relstorage | 1 | python | @abc.abstractmethod
def _create_pack_lock(self, cursor):
'\n Create the global lock held during pack.\n\n (MySQL and PostgreSQL do this differently.)\n '
raise NotImplementedError() | @abc.abstractmethod
def _create_pack_lock(self, cursor):
'\n Create the global lock held during pack.\n\n (MySQL and PostgreSQL do this differently.)\n '
raise NotImplementedError()<|docstring|>Create the global lock held during pack.
(MySQL and PostgreSQL do this differently.)<|endoftext|... |
e377771d9e0453d22cc6f86578bd860cc8ada129dbd6b477cf82c754fb373af5 | @abc.abstractmethod
def _create_transaction(self, cursor):
'\n The transaction table lists all the transactions in the database.\n\n This table is only used for history-preserving databases.\n '
raise NotImplementedError() | The transaction table lists all the transactions in the database.
This table is only used for history-preserving databases. | relstorage/adapters/schema.py | _create_transaction | dpedu/relstorage | 1 | python | @abc.abstractmethod
def _create_transaction(self, cursor):
'\n The transaction table lists all the transactions in the database.\n\n This table is only used for history-preserving databases.\n '
raise NotImplementedError() | @abc.abstractmethod
def _create_transaction(self, cursor):
'\n The transaction table lists all the transactions in the database.\n\n This table is only used for history-preserving databases.\n '
raise NotImplementedError()<|docstring|>The transaction table lists all the transactions in the ... |
bb137e976f508c47d4a55e90e205b1caa8bb1c8f49cfe69a66a77cf04175d249 | @abc.abstractmethod
def _create_new_oid(self, cursor):
'\n Create the incrementing sequence for new OIDs.\n\n This should be the same for history free and preserving\n schemas.\n '
raise NotImplementedError() | Create the incrementing sequence for new OIDs.
This should be the same for history free and preserving
schemas. | relstorage/adapters/schema.py | _create_new_oid | dpedu/relstorage | 1 | python | @abc.abstractmethod
def _create_new_oid(self, cursor):
'\n Create the incrementing sequence for new OIDs.\n\n This should be the same for history free and preserving\n schemas.\n '
raise NotImplementedError() | @abc.abstractmethod
def _create_new_oid(self, cursor):
'\n Create the incrementing sequence for new OIDs.\n\n This should be the same for history free and preserving\n schemas.\n '
raise NotImplementedError()<|docstring|>Create the incrementing sequence for new OIDs.
This should be ... |
a78e9a8c5e27adc575179209f07f0311901e4d4d26ed83bd3464fd776b221194 | @abc.abstractmethod
def _create_object_state(self, cursor):
'\n Create the table holding all object states for all transactions.\n\n If the schema is history-free, only store the current state.\n History-preserving schemas may have a NULL `object_state` to represent\n uncreation.\n ... | Create the table holding all object states for all transactions.
If the schema is history-free, only store the current state.
History-preserving schemas may have a NULL `object_state` to represent
uncreation. | relstorage/adapters/schema.py | _create_object_state | dpedu/relstorage | 1 | python | @abc.abstractmethod
def _create_object_state(self, cursor):
'\n Create the table holding all object states for all transactions.\n\n If the schema is history-free, only store the current state.\n History-preserving schemas may have a NULL `object_state` to represent\n uncreation.\n ... | @abc.abstractmethod
def _create_object_state(self, cursor):
'\n Create the table holding all object states for all transactions.\n\n If the schema is history-free, only store the current state.\n History-preserving schemas may have a NULL `object_state` to represent\n uncreation.\n ... |
5423d5ed658d7a0b48280eb77ee3d0c6e47f67e361b46ba8e4ed95df55dbfb1d | @abc.abstractmethod
def _create_blob_chunk(self, cursor):
'\n Create the table holding all blob states for all transactions.\n\n If the schema is history-free, only store the current state.\n '
raise NotImplementedError() | Create the table holding all blob states for all transactions.
If the schema is history-free, only store the current state. | relstorage/adapters/schema.py | _create_blob_chunk | dpedu/relstorage | 1 | python | @abc.abstractmethod
def _create_blob_chunk(self, cursor):
'\n Create the table holding all blob states for all transactions.\n\n If the schema is history-free, only store the current state.\n '
raise NotImplementedError() | @abc.abstractmethod
def _create_blob_chunk(self, cursor):
'\n Create the table holding all blob states for all transactions.\n\n If the schema is history-free, only store the current state.\n '
raise NotImplementedError()<|docstring|>Create the table holding all blob states for all transact... |
1dc04931f9e855d2622f4035336a4ed9bf440467f5efccfbe9dcbf10a20037a2 | @abc.abstractmethod
def _create_current_object(self, cursor):
'\n Table that stores pointers to the current object state.\n\n This table is only used for history-preserving databases.\n '
raise NotImplementedError() | Table that stores pointers to the current object state.
This table is only used for history-preserving databases. | relstorage/adapters/schema.py | _create_current_object | dpedu/relstorage | 1 | python | @abc.abstractmethod
def _create_current_object(self, cursor):
'\n Table that stores pointers to the current object state.\n\n This table is only used for history-preserving databases.\n '
raise NotImplementedError() | @abc.abstractmethod
def _create_current_object(self, cursor):
'\n Table that stores pointers to the current object state.\n\n This table is only used for history-preserving databases.\n '
raise NotImplementedError()<|docstring|>Table that stores pointers to the current object state.
This t... |
079602306d4fcc43c76f397d97eba29e8a7593981876b48ef18cda0c2afaf618 | @abc.abstractmethod
def _create_object_ref(self, cursor):
'\n A list of referenced OIDs from each object_state. This\n table is populated as needed during packing. To prevent unnecessary\n table locking, it does not use foreign keys, which is safe because\n rows in object_state are never... | A list of referenced OIDs from each object_state. This
table is populated as needed during packing. To prevent unnecessary
table locking, it does not use foreign keys, which is safe because
rows in object_state are never modified once committed, and rows are
removed from object_state only by packing. | relstorage/adapters/schema.py | _create_object_ref | dpedu/relstorage | 1 | python | @abc.abstractmethod
def _create_object_ref(self, cursor):
'\n A list of referenced OIDs from each object_state. This\n table is populated as needed during packing. To prevent unnecessary\n table locking, it does not use foreign keys, which is safe because\n rows in object_state are never... | @abc.abstractmethod
def _create_object_ref(self, cursor):
'\n A list of referenced OIDs from each object_state. This\n table is populated as needed during packing. To prevent unnecessary\n table locking, it does not use foreign keys, which is safe because\n rows in object_state are never... |
c51cddf16d75cac37e8801dbc1e25537dd288a1a2fce7b758c4f5a0752be0774 | @abc.abstractmethod
def _create_object_refs_added(self, cursor):
'\n The object_refs_added table tracks whether object_refs has been\n populated for all states in a given transaction. An entry is added\n only when the work is finished. To prevent unnecessary table locking,\n it does not ... | The object_refs_added table tracks whether object_refs has been
populated for all states in a given transaction. An entry is added
only when the work is finished. To prevent unnecessary table locking,
it does not use foreign keys, which is safe because object states are
never added to a transaction once committed, and ... | relstorage/adapters/schema.py | _create_object_refs_added | dpedu/relstorage | 1 | python | @abc.abstractmethod
def _create_object_refs_added(self, cursor):
'\n The object_refs_added table tracks whether object_refs has been\n populated for all states in a given transaction. An entry is added\n only when the work is finished. To prevent unnecessary table locking,\n it does not ... | @abc.abstractmethod
def _create_object_refs_added(self, cursor):
'\n The object_refs_added table tracks whether object_refs has been\n populated for all states in a given transaction. An entry is added\n only when the work is finished. To prevent unnecessary table locking,\n it does not ... |
b124021d88da845db82b64db756394d22896619312834ff68b1a967f4b573268 | @abc.abstractmethod
def _create_pack_object(self, cursor):
"\n pack_object contains temporary state during garbage collection: The\n list of all objects, a flag signifying whether the object should be\n kept, and a flag signifying whether the object's references have been\n visited. The ... | pack_object contains temporary state during garbage collection: The
list of all objects, a flag signifying whether the object should be
kept, and a flag signifying whether the object's references have been
visited. The keep_tid field specifies the current revision of the
object. | relstorage/adapters/schema.py | _create_pack_object | dpedu/relstorage | 1 | python | @abc.abstractmethod
def _create_pack_object(self, cursor):
"\n pack_object contains temporary state during garbage collection: The\n list of all objects, a flag signifying whether the object should be\n kept, and a flag signifying whether the object's references have been\n visited. The ... | @abc.abstractmethod
def _create_pack_object(self, cursor):
"\n pack_object contains temporary state during garbage collection: The\n list of all objects, a flag signifying whether the object should be\n kept, and a flag signifying whether the object's references have been\n visited. The ... |
194e4cba2d7e36656bdd334187c79697a928e5ca14da3412797c7054954cf449 | @abc.abstractmethod
def _create_pack_state(self, cursor):
'\n Temporary state during packing: the list of object states\n # to pack.\n\n This is only used in history-preserving databases.\n '
raise NotImplementedError() | Temporary state during packing: the list of object states
# to pack.
This is only used in history-preserving databases. | relstorage/adapters/schema.py | _create_pack_state | dpedu/relstorage | 1 | python | @abc.abstractmethod
def _create_pack_state(self, cursor):
'\n Temporary state during packing: the list of object states\n # to pack.\n\n This is only used in history-preserving databases.\n '
raise NotImplementedError() | @abc.abstractmethod
def _create_pack_state(self, cursor):
'\n Temporary state during packing: the list of object states\n # to pack.\n\n This is only used in history-preserving databases.\n '
raise NotImplementedError()<|docstring|>Temporary state during packing: the list of object s... |
fa837b778215ec99e26474774547d3f5da876d50940e29ddf9dc9fc60588a4ba | @abc.abstractmethod
def _create_pack_state_tid(self, cursor):
'\n Temporary state during packing: the list of\n transactions that have at least one object state to pack.\n\n This is only used in history-preserving databases.\n '
raise NotImplementedError() | Temporary state during packing: the list of
transactions that have at least one object state to pack.
This is only used in history-preserving databases. | relstorage/adapters/schema.py | _create_pack_state_tid | dpedu/relstorage | 1 | python | @abc.abstractmethod
def _create_pack_state_tid(self, cursor):
'\n Temporary state during packing: the list of\n transactions that have at least one object state to pack.\n\n This is only used in history-preserving databases.\n '
raise NotImplementedError() | @abc.abstractmethod
def _create_pack_state_tid(self, cursor):
'\n Temporary state during packing: the list of\n transactions that have at least one object state to pack.\n\n This is only used in history-preserving databases.\n '
raise NotImplementedError()<|docstring|>Temporary state... |
d01d75f1bc51ccf507a6c77e5512157ac3e1a516eafdf02883b3745488a5d999 | def _create_temp_store(self, _cursor):
'States that will soon be stored.'
return | States that will soon be stored. | relstorage/adapters/schema.py | _create_temp_store | dpedu/relstorage | 1 | python | def _create_temp_store(self, _cursor):
return | def _create_temp_store(self, _cursor):
return<|docstring|>States that will soon be stored.<|endoftext|> |
ef5d23457d4202501efa8205bf3855d203c397093e8735dfa0c2fe6ed369aef1 | def _create_temp_blob_chunk(self, _cursor):
'\n Temporary state during packing: a list of objects\n whose references need to be examined.\n '
return | Temporary state during packing: a list of objects
whose references need to be examined. | relstorage/adapters/schema.py | _create_temp_blob_chunk | dpedu/relstorage | 1 | python | def _create_temp_blob_chunk(self, _cursor):
'\n Temporary state during packing: a list of objects\n whose references need to be examined.\n '
return | def _create_temp_blob_chunk(self, _cursor):
'\n Temporary state during packing: a list of objects\n whose references need to be examined.\n '
return<|docstring|>Temporary state during packing: a list of objects
whose references need to be examined.<|endoftext|> |
f2ade3e860c51478e3fa2ae169a48fb1b0e72f44538a9b79182bcf45f98e52f1 | def _create_temp_undo(self, _cursor):
'\n Temporary state during undo: a list of objects\n to be undone and the tid of the undone state.\n '
return | Temporary state during undo: a list of objects
to be undone and the tid of the undone state. | relstorage/adapters/schema.py | _create_temp_undo | dpedu/relstorage | 1 | python | def _create_temp_undo(self, _cursor):
'\n Temporary state during undo: a list of objects\n to be undone and the tid of the undone state.\n '
return | def _create_temp_undo(self, _cursor):
'\n Temporary state during undo: a list of objects\n to be undone and the tid of the undone state.\n '
return<|docstring|>Temporary state during undo: a list of objects
to be undone and the tid of the undone state.<|endoftext|> |
2d0eeeb2c880ce3de1abb16f1ec4af6d54fd4028acf1ab3ec1b3121eb465871b | def _init_after_create(self, cursor):
"\n Create a special '0' transaction to represent object creation. The\n '0' transaction is often referenced by object_state.prev_tid, but\n never by object_state.tid.\n\n Only in history-preserving databases.\n "
if self.keep_history:
... | Create a special '0' transaction to represent object creation. The
'0' transaction is often referenced by object_state.prev_tid, but
never by object_state.tid.
Only in history-preserving databases. | relstorage/adapters/schema.py | _init_after_create | dpedu/relstorage | 1 | python | def _init_after_create(self, cursor):
"\n Create a special '0' transaction to represent object creation. The\n '0' transaction is often referenced by object_state.prev_tid, but\n never by object_state.tid.\n\n Only in history-preserving databases.\n "
if self.keep_history:
... | def _init_after_create(self, cursor):
"\n Create a special '0' transaction to represent object creation. The\n '0' transaction is often referenced by object_state.prev_tid, but\n never by object_state.tid.\n\n Only in history-preserving databases.\n "
if self.keep_history:
... |
7daac01eda963767e5556d3f2ca98e1467dc8db533c5ef31784a2ebb0838c6b5 | def create(self, cursor):
'Create the database tables.'
for table in self.all_tables:
meth = getattr(self, ('_create_' + table))
meth(cursor)
self._init_after_create(cursor)
tables = self.list_tables(cursor)
self.check_compatibility(cursor, tables) | Create the database tables. | relstorage/adapters/schema.py | create | dpedu/relstorage | 1 | python | def create(self, cursor):
for table in self.all_tables:
meth = getattr(self, ('_create_' + table))
meth(cursor)
self._init_after_create(cursor)
tables = self.list_tables(cursor)
self.check_compatibility(cursor, tables) | def create(self, cursor):
for table in self.all_tables:
meth = getattr(self, ('_create_' + table))
meth(cursor)
self._init_after_create(cursor)
tables = self.list_tables(cursor)
self.check_compatibility(cursor, tables)<|docstring|>Create the database tables.<|endoftext|> |
765cb8fd1d4b22d7a28644f0b679d1f42a9d9deb67919610ae8f70a5db0c592a | def prepare(self):
'Create the database schema if it does not already exist.'
def callback(_conn, cursor):
tables = self.list_tables(cursor)
if ('object_state' not in tables):
self.create(cursor)
else:
self.check_compatibility(cursor, tables)
self.upd... | Create the database schema if it does not already exist. | relstorage/adapters/schema.py | prepare | dpedu/relstorage | 1 | python | def prepare(self):
def callback(_conn, cursor):
tables = self.list_tables(cursor)
if ('object_state' not in tables):
self.create(cursor)
else:
self.check_compatibility(cursor, tables)
self.update_schema(cursor, tables)
self.connmanager.open_and_c... | def prepare(self):
def callback(_conn, cursor):
tables = self.list_tables(cursor)
if ('object_state' not in tables):
self.create(cursor)
else:
self.check_compatibility(cursor, tables)
self.update_schema(cursor, tables)
self.connmanager.open_and_c... |
bb6fb995e7f00533bb00625bb9d57d98d7c9f4d68ff8585a8bc1b94ab2890bdb | def zap_all(self, reset_oid=True, slow=False):
'\n Clear all data out of the database.\n\n :keyword bool slow: If True (*not* the default) then database\n specific optimizations will be skipped and rows will simply be\n DELETEd. This is helpful when other connections might be ope... | Clear all data out of the database.
:keyword bool slow: If True (*not* the default) then database
specific optimizations will be skipped and rows will simply be
DELETEd. This is helpful when other connections might be open and
holding some kind of locks. | relstorage/adapters/schema.py | zap_all | dpedu/relstorage | 1 | python | def zap_all(self, reset_oid=True, slow=False):
'\n Clear all data out of the database.\n\n :keyword bool slow: If True (*not* the default) then database\n specific optimizations will be skipped and rows will simply be\n DELETEd. This is helpful when other connections might be ope... | def zap_all(self, reset_oid=True, slow=False):
'\n Clear all data out of the database.\n\n :keyword bool slow: If True (*not* the default) then database\n specific optimizations will be skipped and rows will simply be\n DELETEd. This is helpful when other connections might be ope... |
4d4b9675605f51823727566f5514818ea63163dbd9ec716f3bc8c301841957a2 | def drop_all(self):
'Drop all tables and sequences.'
def callback(_conn, cursor):
existent = set(self.list_tables(cursor))
todo = list(self.all_tables)
todo.reverse()
for table in todo:
if (table in existent):
cursor.execute(('DROP TABLE %s' % table))... | Drop all tables and sequences. | relstorage/adapters/schema.py | drop_all | dpedu/relstorage | 1 | python | def drop_all(self):
def callback(_conn, cursor):
existent = set(self.list_tables(cursor))
todo = list(self.all_tables)
todo.reverse()
for table in todo:
if (table in existent):
cursor.execute(('DROP TABLE %s' % table))
for sequence in self.li... | def drop_all(self):
def callback(_conn, cursor):
existent = set(self.list_tables(cursor))
todo = list(self.all_tables)
todo.reverse()
for table in todo:
if (table in existent):
cursor.execute(('DROP TABLE %s' % table))
for sequence in self.li... |
2c0c7dc0ca55c5e023b558fc4c702385e149bab4474379c9e19a57ad7047d04f | def buildProtocol(self, addr):
'\n Creates an instance of the ChatClient protocol. Invoked when\n the user attempts to connect to the server.\n\n Returns:\n An instance of the chat client protocol.\n '
return self.protocol(self.username, self.delegate) | Creates an instance of the ChatClient protocol. Invoked when
the user attempts to connect to the server.
Returns:
An instance of the chat client protocol. | client/core/client/chatclientfactory.py | buildProtocol | pkrll/ChatMaster3000 | 0 | python | def buildProtocol(self, addr):
'\n Creates an instance of the ChatClient protocol. Invoked when\n the user attempts to connect to the server.\n\n Returns:\n An instance of the chat client protocol.\n '
return self.protocol(self.username, self.delegate) | def buildProtocol(self, addr):
'\n Creates an instance of the ChatClient protocol. Invoked when\n the user attempts to connect to the server.\n\n Returns:\n An instance of the chat client protocol.\n '
return self.protocol(self.username, self.delegate)<|doc... |
92b08e464ac529e71cb09f95f0d2659964fe47294e583ff65743897b18276a87 | def clientConnectionFailed(self, connector, reason):
'\n Called when the connection has failed.\n '
self.delegate.didFailConnection(reason.getErrorMessage()) | Called when the connection has failed. | client/core/client/chatclientfactory.py | clientConnectionFailed | pkrll/ChatMaster3000 | 0 | python | def clientConnectionFailed(self, connector, reason):
'\n \n '
self.delegate.didFailConnection(reason.getErrorMessage()) | def clientConnectionFailed(self, connector, reason):
'\n \n '
self.delegate.didFailConnection(reason.getErrorMessage())<|docstring|>Called when the connection has failed.<|endoftext|> |
6448fbee5f2ecea1c9d5ddf4ff242f50214ba566852458d35553d21de6102f18 | def add_sdd_mosek(task, A, b, Ac=None):
' \n add a variable C and constraints\n A*x - Ac vec(C) = b\n C SDD\n which with an appropriate choice of Ac makes A*x - b >= 0\n\n if Ac is not given it is set to identity\n '
if (Ac is None):
n_Ac = A.shape[0]
Ac = sp.coo_matrix((np.o... | add a variable C and constraints
A*x - Ac vec(C) = b
C SDD
which with an appropriate choice of Ac makes A*x - b >= 0
if Ac is not given it is set to identity | posipoly/ppp.py | add_sdd_mosek | pettni/posipoly | 1 | python | def add_sdd_mosek(task, A, b, Ac=None):
' \n add a variable C and constraints\n A*x - Ac vec(C) = b\n C SDD\n which with an appropriate choice of Ac makes A*x - b >= 0\n\n if Ac is not given it is set to identity\n '
if (Ac is None):
n_Ac = A.shape[0]
Ac = sp.coo_matrix((np.o... | def add_sdd_mosek(task, A, b, Ac=None):
' \n add a variable C and constraints\n A*x - Ac vec(C) = b\n C SDD\n which with an appropriate choice of Ac makes A*x - b >= 0\n\n if Ac is not given it is set to identity\n '
if (Ac is None):
n_Ac = A.shape[0]
Ac = sp.coo_matrix((np.o... |
cb2fddde8cf7bbb6fd3c7f25edca2d37378e932e6d2309325180cafbd651197e | def add_psd_mosek(task, A, b, Ac=None):
' \n add a variable C and constraints\n A*x - Ac*vec(C) = b\n C PSD\n which with an appropriate choice of Ac makes A*x - b >= 0\n\n if Ac is not given it is set to identity\n '
if (Ac is None):
n_Ac = A.shape[0]
Ac = sp.coo_matrix((np.ones(n_Ac),... | add a variable C and constraints
A*x - Ac*vec(C) = b
C PSD
which with an appropriate choice of Ac makes A*x - b >= 0
if Ac is not given it is set to identity | posipoly/ppp.py | add_psd_mosek | pettni/posipoly | 1 | python | def add_psd_mosek(task, A, b, Ac=None):
' \n add a variable C and constraints\n A*x - Ac*vec(C) = b\n C PSD\n which with an appropriate choice of Ac makes A*x - b >= 0\n\n if Ac is not given it is set to identity\n '
if (Ac is None):
n_Ac = A.shape[0]
Ac = sp.coo_matrix((np.ones(n_Ac),... | def add_psd_mosek(task, A, b, Ac=None):
' \n add a variable C and constraints\n A*x - Ac*vec(C) = b\n C PSD\n which with an appropriate choice of Ac makes A*x - b >= 0\n\n if Ac is not given it is set to identity\n '
if (Ac is None):
n_Ac = A.shape[0]
Ac = sp.coo_matrix((np.ones(n_Ac),... |
0fc85e4a1731655fc8ba93bd9f0a20aaa75dc2ba63e6ecf793789a868db6ffd2 | def is_dd(A):
" Returns 'True' if A is dd (diagonally dominant), 'False' otherwise "
epsilon = 1e-10
A_arr = np.array(A)
if (A_arr.shape[0] != A_arr.shape[1]):
return False
n = A_arr.shape[0]
for i in range(n):
if (not ((A[(i, i)] + epsilon) >= sum(np.abs(A[(i, [j for j in range(... | Returns 'True' if A is dd (diagonally dominant), 'False' otherwise | posipoly/ppp.py | is_dd | pettni/posipoly | 1 | python | def is_dd(A):
" "
epsilon = 1e-10
A_arr = np.array(A)
if (A_arr.shape[0] != A_arr.shape[1]):
return False
n = A_arr.shape[0]
for i in range(n):
if (not ((A[(i, i)] + epsilon) >= sum(np.abs(A[(i, [j for j in range(n) if (i != j)])])))):
return False
return True | def is_dd(A):
" "
epsilon = 1e-10
A_arr = np.array(A)
if (A_arr.shape[0] != A_arr.shape[1]):
return False
n = A_arr.shape[0]
for i in range(n):
if (not ((A[(i, i)] + epsilon) >= sum(np.abs(A[(i, [j for j in range(n) if (i != j)])])))):
return False
return True<|d... |
a45dde8a30079ec4b46c9a921a36b68070c2ad6a47b8ab07162e15ccc98044ba | def sdd_index(i, j, n):
" An n x n sdd matrix A can be written as A = sum Mij.\n Given Mij's stored as a (n-1)*n/2 x 3 matrix, where each row represents a 2x2 symmetric matrix, return\n the indices i_s, j_s such that A_ij = sum_s Mij(i_s, j_s) "
num_vars = int(((n * (n - 1)) / 2))
if (i == j):
... | An n x n sdd matrix A can be written as A = sum Mij.
Given Mij's stored as a (n-1)*n/2 x 3 matrix, where each row represents a 2x2 symmetric matrix, return
the indices i_s, j_s such that A_ij = sum_s Mij(i_s, j_s) | posipoly/ppp.py | sdd_index | pettni/posipoly | 1 | python | def sdd_index(i, j, n):
" An n x n sdd matrix A can be written as A = sum Mij.\n Given Mij's stored as a (n-1)*n/2 x 3 matrix, where each row represents a 2x2 symmetric matrix, return\n the indices i_s, j_s such that A_ij = sum_s Mij(i_s, j_s) "
num_vars = int(((n * (n - 1)) / 2))
if (i == j):
... | def sdd_index(i, j, n):
" An n x n sdd matrix A can be written as A = sum Mij.\n Given Mij's stored as a (n-1)*n/2 x 3 matrix, where each row represents a 2x2 symmetric matrix, return\n the indices i_s, j_s such that A_ij = sum_s Mij(i_s, j_s) "
num_vars = int(((n * (n - 1)) / 2))
if (i == j):
... |
cbebc5bd59a8aa40ff4d25bfcdabf36e9ae33676510a9e83b81244682f5d4f98 | @property
def varnames(self):
'get names of all variables'
return list(self.varinfo.keys()) | get names of all variables | posipoly/ppp.py | varnames | pettni/posipoly | 1 | python | @property
def varnames(self):
return list(self.varinfo.keys()) | @property
def varnames(self):
return list(self.varinfo.keys())<|docstring|>get names of all variables<|endoftext|> |
d3d81656bf42a8b395ade257869501be65a0dd128b9aa374c9b01596a95c17d1 | @property
def varsizes(self):
'get coefficient sizes of all polynomial variables'
return [self.varsize(name) for name in self.varinfo.keys()] | get coefficient sizes of all polynomial variables | posipoly/ppp.py | varsizes | pettni/posipoly | 1 | python | @property
def varsizes(self):
return [self.varsize(name) for name in self.varinfo.keys()] | @property
def varsizes(self):
return [self.varsize(name) for name in self.varinfo.keys()]<|docstring|>get coefficient sizes of all polynomial variables<|endoftext|> |
fa3d4081682b6eaf1b4b028a63ff5349e74d3e90547589d8b5e91c86e9bc981f | @property
def numvar(self):
'total number of coefficient variables'
return sum(self.varsizes) | total number of coefficient variables | posipoly/ppp.py | numvar | pettni/posipoly | 1 | python | @property
def numvar(self):
return sum(self.varsizes) | @property
def numvar(self):
return sum(self.varsizes)<|docstring|>total number of coefficient variables<|endoftext|> |
0ad6cfb6ea33e9bc0dcf050022669720a424abb268d609b832e96f7220d44ea2 | @property
def numcon(self):
'total number of constraints'
return (self.Aeq.shape[0] + self.Aiq.shape[0]) | total number of constraints | posipoly/ppp.py | numcon | pettni/posipoly | 1 | python | @property
def numcon(self):
return (self.Aeq.shape[0] + self.Aiq.shape[0]) | @property
def numcon(self):
return (self.Aeq.shape[0] + self.Aiq.shape[0])<|docstring|>total number of constraints<|endoftext|> |
7371b2fbdc61e4f61a898b46a8a49fcec86f33aacb43e4005bedc64f6b9d20b2 | def varsize(self, varname):
'get size of variable "varname"'
if (varname not in self.varinfo.keys()):
raise Exception('unknown variable {}'.format(varname))
n = self.varinfo[varname][0]
d = self.varinfo[varname][1]
if (self.varinfo[varname][2] == 'pp'):
num_mon = count_monomials_leq(... | get size of variable "varname" | posipoly/ppp.py | varsize | pettni/posipoly | 1 | python | def varsize(self, varname):
if (varname not in self.varinfo.keys()):
raise Exception('unknown variable {}'.format(varname))
n = self.varinfo[varname][0]
d = self.varinfo[varname][1]
if (self.varinfo[varname][2] == 'pp'):
num_mon = count_monomials_leq(n, int(ceil((float(d) / 2))))
... | def varsize(self, varname):
if (varname not in self.varinfo.keys()):
raise Exception('unknown variable {}'.format(varname))
n = self.varinfo[varname][0]
d = self.varinfo[varname][1]
if (self.varinfo[varname][2] == 'pp'):
num_mon = count_monomials_leq(n, int(ceil((float(d) / 2))))
... |
28f9a7fdd3be61cc7e83a49acfe6d35e500257d72ee81628d439c8c23a3d2fb1 | def varpos(self, varname):
'return starting position of variable'
if (varname not in self.varinfo.keys()):
raise Exception('unknown variable {}'.format(varname))
ret = 0
for name in self.varnames:
if (name == varname):
break
ret += self.varsize(name)
return ret | return starting position of variable | posipoly/ppp.py | varpos | pettni/posipoly | 1 | python | def varpos(self, varname):
if (varname not in self.varinfo.keys()):
raise Exception('unknown variable {}'.format(varname))
ret = 0
for name in self.varnames:
if (name == varname):
break
ret += self.varsize(name)
return ret | def varpos(self, varname):
if (varname not in self.varinfo.keys()):
raise Exception('unknown variable {}'.format(varname))
ret = 0
for name in self.varnames:
if (name == varname):
break
ret += self.varsize(name)
return ret<|docstring|>return starting position of ... |
91280ab9726b13ad5d00ee5794bb3a156f86b9fa3cdb32766bddc08d50ad6d7b | def add_constraint(self, Aop_dict, b, tp):
" \n add a constraint to problem of form\n T1 var1 + T2 var2 <= b if tp=='iq' (coefficient-wise inequality)\n T1 var1 + T2 var2 = b if tp=='eq' (coefficient-wise equality)\n T1 var1 + T2 var2 - b pp if tp=='pp' (positive polynomial)\n\n Para... | add a constraint to problem of form
T1 var1 + T2 var2 <= b if tp=='iq' (coefficient-wise inequality)
T1 var1 + T2 var2 = b if tp=='eq' (coefficient-wise equality)
T1 var1 + T2 var2 - b pp if tp=='pp' (positive polynomial)
Parameters
----------
Aop_dict : dict
dict with values PTrans.
Variable... | posipoly/ppp.py | add_constraint | pettni/posipoly | 1 | python | def add_constraint(self, Aop_dict, b, tp):
" \n add a constraint to problem of form\n T1 var1 + T2 var2 <= b if tp=='iq' (coefficient-wise inequality)\n T1 var1 + T2 var2 = b if tp=='eq' (coefficient-wise equality)\n T1 var1 + T2 var2 - b pp if tp=='pp' (positive polynomial)\n\n Para... | def add_constraint(self, Aop_dict, b, tp):
" \n add a constraint to problem of form\n T1 var1 + T2 var2 <= b if tp=='iq' (coefficient-wise inequality)\n T1 var1 + T2 var2 = b if tp=='eq' (coefficient-wise equality)\n T1 var1 + T2 var2 - b pp if tp=='pp' (positive polynomial)\n\n Para... |
dd05a93e733982e027343b154e2c8c98e98c0a398e1541b5ab824f2bd4fef1dc | def set_objective(self, c_dict):
" \n add objective to problem \n\n Parameters\n ----------\n c_dict : dict\n keys: varnames\n values: PTrans with final degree 0 (scalar) or array_like\n\n Example\n ----------\n >>> T = PTrans.integrate(n,d,dims,boxes) # results in scalar\n >>... | add objective to problem
Parameters
----------
c_dict : dict
keys: varnames
values: PTrans with final degree 0 (scalar) or array_like
Example
----------
>>> T = PTrans.integrate(n,d,dims,boxes) # results in scalar
>>> prob.add_constraint({'a': [0,1 ], 'b': T} ) | posipoly/ppp.py | set_objective | pettni/posipoly | 1 | python | def set_objective(self, c_dict):
" \n add objective to problem \n\n Parameters\n ----------\n c_dict : dict\n keys: varnames\n values: PTrans with final degree 0 (scalar) or array_like\n\n Example\n ----------\n >>> T = PTrans.integrate(n,d,dims,boxes) # results in scalar\n >>... | def set_objective(self, c_dict):
" \n add objective to problem \n\n Parameters\n ----------\n c_dict : dict\n keys: varnames\n values: PTrans with final degree 0 (scalar) or array_like\n\n Example\n ----------\n >>> T = PTrans.integrate(n,d,dims,boxes) # results in scalar\n >>... |
349f0a4a43468da8b5f8438e4338984cf42b1afdb075de9ca7f4a2e1402fe801 | def get_bmat(self, Aop_dict, numcon):
' \n concatenate matrices in dict in variable order, fill in with zero matrix\n for those variables that do not appear\n '
def pick_mat(varname):
if (varname not in Aop_dict.keys()):
return spzeros(numcon, self.varsize(varname))
if (sel... | concatenate matrices in dict in variable order, fill in with zero matrix
for those variables that do not appear | posipoly/ppp.py | get_bmat | pettni/posipoly | 1 | python | def get_bmat(self, Aop_dict, numcon):
' \n concatenate matrices in dict in variable order, fill in with zero matrix\n for those variables that do not appear\n '
def pick_mat(varname):
if (varname not in Aop_dict.keys()):
return spzeros(numcon, self.varsize(varname))
if (sel... | def get_bmat(self, Aop_dict, numcon):
' \n concatenate matrices in dict in variable order, fill in with zero matrix\n for those variables that do not appear\n '
def pick_mat(varname):
if (varname not in Aop_dict.keys()):
return spzeros(numcon, self.varsize(varname))
if (sel... |
9eb282b70fc131004fc47fee317236387c277e46bcbf9068b816f600c0a9fc8c | def solve(self, pp_cone):
" \n solve Positive Polynomial Program \n\n Parameters\n ----------\n pp_cone : {'psd', 'sdd'}\n cone for positivity constraints\n \n Returns\n ----------\n sol : solution vector\n sta : status\n "
Aeq = sp.coo_matrix((0, self.numvar))
Aiq = sp.co... | solve Positive Polynomial Program
Parameters
----------
pp_cone : {'psd', 'sdd'}
cone for positivity constraints
Returns
----------
sol : solution vector
sta : status | posipoly/ppp.py | solve | pettni/posipoly | 1 | python | def solve(self, pp_cone):
" \n solve Positive Polynomial Program \n\n Parameters\n ----------\n pp_cone : {'psd', 'sdd'}\n cone for positivity constraints\n \n Returns\n ----------\n sol : solution vector\n sta : status\n "
Aeq = sp.coo_matrix((0, self.numvar))
Aiq = sp.co... | def solve(self, pp_cone):
" \n solve Positive Polynomial Program \n\n Parameters\n ----------\n pp_cone : {'psd', 'sdd'}\n cone for positivity constraints\n \n Returns\n ----------\n sol : solution vector\n sta : status\n "
Aeq = sp.coo_matrix((0, self.numvar))
Aiq = sp.co... |
59fb6f05480c1d0f45f00fc4332e938cf316992e9094173b4806b15a1fc6cc7f | def check_sol(self, Aiq, biq, Aeq, beq, tol=1e-06):
'\n check solution against tolerance to see if constraints are met,\n prints warnings messages if violations above tol are found\n REMARK: currently does not check manually added pp constraints\n '
if ((Aiq.shape[0] > 0) and (min((biq - Aiq.dot(sel... | check solution against tolerance to see if constraints are met,
prints warnings messages if violations above tol are found
REMARK: currently does not check manually added pp constraints | posipoly/ppp.py | check_sol | pettni/posipoly | 1 | python | def check_sol(self, Aiq, biq, Aeq, beq, tol=1e-06):
'\n check solution against tolerance to see if constraints are met,\n prints warnings messages if violations above tol are found\n REMARK: currently does not check manually added pp constraints\n '
if ((Aiq.shape[0] > 0) and (min((biq - Aiq.dot(sel... | def check_sol(self, Aiq, biq, Aeq, beq, tol=1e-06):
'\n check solution against tolerance to see if constraints are met,\n prints warnings messages if violations above tol are found\n REMARK: currently does not check manually added pp constraints\n '
if ((Aiq.shape[0] > 0) and (min((biq - Aiq.dot(sel... |
b8652e3ba4b9c994a2fd7b8adaf81925a7f2f769341c4bb8fc9bfa4cd7d27c9a | def get_poly(self, varname):
'return a Polynomial object from solution'
if (self.sol is None):
raise Exception('no solution stored')
if (varname not in self.varnames):
raise Exception('unknown variable {}'.format())
a = self.varpos(varname)
b = (a + self.varsize(varname))
n = sel... | return a Polynomial object from solution | posipoly/ppp.py | get_poly | pettni/posipoly | 1 | python | def get_poly(self, varname):
if (self.sol is None):
raise Exception('no solution stored')
if (varname not in self.varnames):
raise Exception('unknown variable {}'.format())
a = self.varpos(varname)
b = (a + self.varsize(varname))
n = self.varinfo[varname][0]
d = self.varinfo... | def get_poly(self, varname):
if (self.sol is None):
raise Exception('no solution stored')
if (varname not in self.varnames):
raise Exception('unknown variable {}'.format())
a = self.varpos(varname)
b = (a + self.varsize(varname))
n = self.varinfo[varname][0]
d = self.varinfo... |
4b2282af96d846a00d89dff2fffc08526d85b854196e7f7465e55677cc8c936b | def get_versions():
'\n Return basic information on our software installation, and out installed versions of packages.\n '
d = {'host': get_system_info(), 'packages': get_package_info(required_packages), 'optional': get_optional_info()}
return d | Return basic information on our software installation, and out installed versions of packages. | src/hangar/diagnostics/ecosystem.py | get_versions | dxenonb/hangar-py | 0 | python | def get_versions():
'\n \n '
d = {'host': get_system_info(), 'packages': get_package_info(required_packages), 'optional': get_optional_info()}
return d | def get_versions():
'\n \n '
d = {'host': get_system_info(), 'packages': get_package_info(required_packages), 'optional': get_optional_info()}
return d<|docstring|>Return basic information on our software installation, and out installed versions of packages.<|endoftext|> |
040590345ef1eeb3664414c07d9754da9574998419c9021d74f27302915ad4b0 | def get_package_info(pkgs):
' get package versions for the passed required & optional packages '
pversions = []
for (modname, ver_f) in pkgs:
try:
mod = importlib.import_module(modname)
ver = ver_f(mod)
pversions.append((modname, ver))
except Exception:
... | get package versions for the passed required & optional packages | src/hangar/diagnostics/ecosystem.py | get_package_info | dxenonb/hangar-py | 0 | python | def get_package_info(pkgs):
' '
pversions = []
for (modname, ver_f) in pkgs:
try:
mod = importlib.import_module(modname)
ver = ver_f(mod)
pversions.append((modname, ver))
except Exception:
pversions.append((modname, None))
return pversions | def get_package_info(pkgs):
' '
pversions = []
for (modname, ver_f) in pkgs:
try:
mod = importlib.import_module(modname)
ver = ver_f(mod)
pversions.append((modname, ver))
except Exception:
pversions.append((modname, None))
return pversions... |
3cfd1ce127c5aa45beb28a8527f8ca5285e695d74b08ea3bf78d5efeb316589d | def process_data(params):
'Provides end-to-end signal processing, including reading, detrending,\n tapering, filtering, instrument response removal, and saving.\n\n Parameters\n ----------\n params : SignalProcessing object\n Object containing signal processing parameters passed.\n\n Returns\n... | Provides end-to-end signal processing, including reading, detrending,
tapering, filtering, instrument response removal, and saving.
Parameters
----------
params : SignalProcessing object
Object containing signal processing parameters passed.
Returns
-------
int
Number of files saved to disk. | RISProcess/workflows.py | process_data | firstkingofrome/RISProcess | 0 | python | def process_data(params):
'Provides end-to-end signal processing, including reading, detrending,\n tapering, filtering, instrument response removal, and saving.\n\n Parameters\n ----------\n params : SignalProcessing object\n Object containing signal processing parameters passed.\n\n Returns\n... | def process_data(params):
'Provides end-to-end signal processing, including reading, detrending,\n tapering, filtering, instrument response removal, and saving.\n\n Parameters\n ----------\n params : SignalProcessing object\n Object containing signal processing parameters passed.\n\n Returns\n... |
69a6cdb15124c9b081cfedda0bdab643ab5731261bf55b381ba31370f1ea79e8 | def to_json_serializable(data):
'Make an object containing numpy arrays/scalars JSON serializable.'
if (data is None):
return None
if isinstance(data, dict):
return {key: to_json_serializable(value) for (key, value) in data.items()}
elif (isinstance(data, list) or isinstance(data, tuple)... | Make an object containing numpy arrays/scalars JSON serializable. | shepherd/runner/json_runner.py | to_json_serializable | iterait/shepherd | 5 | python | def to_json_serializable(data):
if (data is None):
return None
if isinstance(data, dict):
return {key: to_json_serializable(value) for (key, value) in data.items()}
elif (isinstance(data, list) or isinstance(data, tuple)):
return [to_json_serializable(v) for v in data]
elif ... | def to_json_serializable(data):
if (data is None):
return None
if isinstance(data, dict):
return {key: to_json_serializable(value) for (key, value) in data.items()}
elif (isinstance(data, list) or isinstance(data, tuple)):
return [to_json_serializable(v) for v in data]
elif ... |
9da664b5c774a97a988de72029ace0500f6ea8fc1ad2fbcb06d5d477d90b37f8 | def run(model: el.AbstractModel, dataset: el.AbstractDataset, stream_name: str, payload: Any) -> el.Batch:
'\n Get the specified data stream from the given dataset, apply the given model on its batches and return the results.\n\n The components have to be **emloop** compatible with:\n - dataset having ... | Get the specified data stream from the given dataset, apply the given model on its batches and return the results.
The components have to be **emloop** compatible with:
- dataset having method named ``[stream_name]_stream`` taking the payload and returning the stream
- (optional) dataset having method named ``... | shepherd/runner/json_runner.py | run | iterait/shepherd | 5 | python | def run(model: el.AbstractModel, dataset: el.AbstractDataset, stream_name: str, payload: Any) -> el.Batch:
'\n Get the specified data stream from the given dataset, apply the given model on its batches and return the results.\n\n The components have to be **emloop** compatible with:\n - dataset having ... | def run(model: el.AbstractModel, dataset: el.AbstractDataset, stream_name: str, payload: Any) -> el.Batch:
'\n Get the specified data stream from the given dataset, apply the given model on its batches and return the results.\n\n The components have to be **emloop** compatible with:\n - dataset having ... |
97feba130cace2c037110d86d2acf5ea25eec9429baed5cdd72fc23232626ec6 | def _process_job(self, input_path: str, output_path: str) -> None:
'\n Process a JSON job\n - load ``input_path``/``input``\n - create dataset stream with the loaded JSON\n - run the model\n - save the output to ``output_path``/``output``\n\n :param input_pa... | Process a JSON job
- load ``input_path``/``input``
- create dataset stream with the loaded JSON
- run the model
- save the output to ``output_path``/``output``
:param input_path: input data directory
:param output_path: output data directory | shepherd/runner/json_runner.py | _process_job | iterait/shepherd | 5 | python | def _process_job(self, input_path: str, output_path: str) -> None:
'\n Process a JSON job\n - load ``input_path``/``input``\n - create dataset stream with the loaded JSON\n - run the model\n - save the output to ``output_path``/``output``\n\n :param input_pa... | def _process_job(self, input_path: str, output_path: str) -> None:
'\n Process a JSON job\n - load ``input_path``/``input``\n - create dataset stream with the loaded JSON\n - run the model\n - save the output to ``output_path``/``output``\n\n :param input_pa... |
21df66eb71da9371128ed988b1ca7b2c76ff611bb653315912d53b7bccd0e74c | def repackage_hidden(h):
'Wraps hidden states in new Tensors, to detach them from their history.'
if isinstance(h, torch.Tensor):
return h.detach()
else:
return tuple((repackage_hidden(v) for v in h)) | Wraps hidden states in new Tensors, to detach them from their history. | telemanom/modeling.py | repackage_hidden | sedgewickmm18/telemanom | 0 | python | def repackage_hidden(h):
if isinstance(h, torch.Tensor):
return h.detach()
else:
return tuple((repackage_hidden(v) for v in h)) | def repackage_hidden(h):
if isinstance(h, torch.Tensor):
return h.detach()
else:
return tuple((repackage_hidden(v) for v in h))<|docstring|>Wraps hidden states in new Tensors, to detach them from their history.<|endoftext|> |
edf8e2edc8deb9823ac22596955909ccf8bf58ea4ed730a8cdfc59879b1768c0 | def __init__(self, config, run_id, channel, Path=None, Train=True):
'\n Loads/trains RNN and predicts future telemetry values for a channel.\n\n Args:\n config (obj): Config object containing parameters for processing\n and model training\n run_id (str): Datetime r... | Loads/trains RNN and predicts future telemetry values for a channel.
Args:
config (obj): Config object containing parameters for processing
and model training
run_id (str): Datetime referencing set of predictions in use
channel (obj): Channel class object containing train/test data
for X,y ... | telemanom/modeling.py | __init__ | sedgewickmm18/telemanom | 0 | python | def __init__(self, config, run_id, channel, Path=None, Train=True):
'\n Loads/trains RNN and predicts future telemetry values for a channel.\n\n Args:\n config (obj): Config object containing parameters for processing\n and model training\n run_id (str): Datetime r... | def __init__(self, config, run_id, channel, Path=None, Train=True):
'\n Loads/trains RNN and predicts future telemetry values for a channel.\n\n Args:\n config (obj): Config object containing parameters for processing\n and model training\n run_id (str): Datetime r... |
26cdb7311e4d4801f26d1723f7ba41003755d5a7275e15b4a1fc5b0e89fafb01 | def load(self, Path=None):
'\n Load model for channel.\n '
logger.info('Loading pre-trained model')
self.model = self.model.load_state_dict(torch.load(os.path.join(Path, self.config.use_id, 'models', (self.chan_id + '.h5')))) | Load model for channel. | telemanom/modeling.py | load | sedgewickmm18/telemanom | 0 | python | def load(self, Path=None):
'\n \n '
logger.info('Loading pre-trained model')
self.model = self.model.load_state_dict(torch.load(os.path.join(Path, self.config.use_id, 'models', (self.chan_id + '.h5')))) | def load(self, Path=None):
'\n \n '
logger.info('Loading pre-trained model')
self.model = self.model.load_state_dict(torch.load(os.path.join(Path, self.config.use_id, 'models', (self.chan_id + '.h5'))))<|docstring|>Load model for channel.<|endoftext|> |
6c29c56cbfaf032788d2669d2d673244d45ed1fa1820f68402aa2c0217d4379c | def load_onnx(self, Path=None):
'\n Load ONNX model\n '
import onnxruntime
if (Path is None):
Path = ''
self.onnx_session = onnxruntime.InferenceSession(Path) | Load ONNX model | telemanom/modeling.py | load_onnx | sedgewickmm18/telemanom | 0 | python | def load_onnx(self, Path=None):
'\n \n '
import onnxruntime
if (Path is None):
Path =
self.onnx_session = onnxruntime.InferenceSession(Path) | def load_onnx(self, Path=None):
'\n \n '
import onnxruntime
if (Path is None):
Path =
self.onnx_session = onnxruntime.InferenceSession(Path)<|docstring|>Load ONNX model<|endoftext|> |
30c01d4bba4bf344474db1b16951bae8d6aba2c4756c36cb062d8791a5ea5af8 | def new_model(self, Input_shape):
'\n Train LSTM model according to specifications in config.yaml.\n\n Args:\n channel (obj): Channel class object containing train/test data\n for X,y for a single channel\n '
if (self.model is not None):
return
self.mod... | Train LSTM model according to specifications in config.yaml.
Args:
channel (obj): Channel class object containing train/test data
for X,y for a single channel | telemanom/modeling.py | new_model | sedgewickmm18/telemanom | 0 | python | def new_model(self, Input_shape):
'\n Train LSTM model according to specifications in config.yaml.\n\n Args:\n channel (obj): Channel class object containing train/test data\n for X,y for a single channel\n '
if (self.model is not None):
return
self.mod... | def new_model(self, Input_shape):
'\n Train LSTM model according to specifications in config.yaml.\n\n Args:\n channel (obj): Channel class object containing train/test data\n for X,y for a single channel\n '
if (self.model is not None):
return
self.mod... |
4e40e3ebf66f8e2c067f7dfd59e6a6b4b604cefccc892843559688e812b134ec | def train_new(self, channel):
'\n Train LSTM model according to specifications in config.yaml.\n\n Args:\n channel (obj): Channel class object containing train/test data\n for X,y for a single channel\n '
self.new_model((None, channel.X_train.shape[2]))
self.mo... | Train LSTM model according to specifications in config.yaml.
Args:
channel (obj): Channel class object containing train/test data
for X,y for a single channel | telemanom/modeling.py | train_new | sedgewickmm18/telemanom | 0 | python | def train_new(self, channel):
'\n Train LSTM model according to specifications in config.yaml.\n\n Args:\n channel (obj): Channel class object containing train/test data\n for X,y for a single channel\n '
self.new_model((None, channel.X_train.shape[2]))
self.mo... | def train_new(self, channel):
'\n Train LSTM model according to specifications in config.yaml.\n\n Args:\n channel (obj): Channel class object containing train/test data\n for X,y for a single channel\n '
self.new_model((None, channel.X_train.shape[2]))
self.mo... |
552b35655e82d7d5d1187c18176e2d0702f68fe718a68de0158ce383d71ac559 | def export(self, Path=None):
'\n Export trained model as ONNX\n '
self.model.eval()
if (Path is None):
Path = ''
torch_in = None
torch_out = None
with torch.no_grad():
torch_in = torch.randn(self.model.batch_size, self.model.hidden_dim, self.model.n_features, requir... | Export trained model as ONNX | telemanom/modeling.py | export | sedgewickmm18/telemanom | 0 | python | def export(self, Path=None):
'\n \n '
self.model.eval()
if (Path is None):
Path =
torch_in = None
torch_out = None
with torch.no_grad():
torch_in = torch.randn(self.model.batch_size, self.model.hidden_dim, self.model.n_features, requires_grad=True)
(torch_o... | def export(self, Path=None):
'\n \n '
self.model.eval()
if (Path is None):
Path =
torch_in = None
torch_out = None
with torch.no_grad():
torch_in = torch.randn(self.model.batch_size, self.model.hidden_dim, self.model.n_features, requires_grad=True)
(torch_o... |
3fb612763cce0ec7b064fafc75f540b5f03ad837e9f46f5e745fe9fac442b5f9 | def save(self, Path=None):
'\n Save trained model.\n '
self.model.eval()
if (Path is None):
Path = ''
torch.save(self.model.state_dict(), os.path.join(Path, 'data', self.run_id, 'models', '{}.torch'.format(self.chan_id))) | Save trained model. | telemanom/modeling.py | save | sedgewickmm18/telemanom | 0 | python | def save(self, Path=None):
'\n \n '
self.model.eval()
if (Path is None):
Path =
torch.save(self.model.state_dict(), os.path.join(Path, 'data', self.run_id, 'models', '{}.torch'.format(self.chan_id))) | def save(self, Path=None):
'\n \n '
self.model.eval()
if (Path is None):
Path =
torch.save(self.model.state_dict(), os.path.join(Path, 'data', self.run_id, 'models', '{}.torch'.format(self.chan_id)))<|docstring|>Save trained model.<|endoftext|> |
c66a575629427c42929dbda0c506e51bb404adcda066eaec85fbf78586ac0e93 | def aggregate_predictions(self, y_hat_batch, method='first'):
'\n Aggregates predictions for each timestep. When predicting n steps\n ahead where n > 1, will end up with multiple predictions for a\n timestep.\n\n Args:\n y_hat_batch (arr): predictions shape (<batch length>, <n... | Aggregates predictions for each timestep. When predicting n steps
ahead where n > 1, will end up with multiple predictions for a
timestep.
Args:
y_hat_batch (arr): predictions shape (<batch length>, <n_preds)
method (string): indicates how to aggregate for a timestep - "first"
or "mean" | telemanom/modeling.py | aggregate_predictions | sedgewickmm18/telemanom | 0 | python | def aggregate_predictions(self, y_hat_batch, method='first'):
'\n Aggregates predictions for each timestep. When predicting n steps\n ahead where n > 1, will end up with multiple predictions for a\n timestep.\n\n Args:\n y_hat_batch (arr): predictions shape (<batch length>, <n... | def aggregate_predictions(self, y_hat_batch, method='first'):
'\n Aggregates predictions for each timestep. When predicting n steps\n ahead where n > 1, will end up with multiple predictions for a\n timestep.\n\n Args:\n y_hat_batch (arr): predictions shape (<batch length>, <n... |
d61e5d8d5e8039f70753999b6c3d4db5739979370f2b4abdec72ca5708db6080 | def batch_predict(self, channel, Train=False, Path=None):
'\n Used trained LSTM model to predict test data arriving in batches.\n\n Args:\n channel (obj): Channel class object containing train/test data\n for X,y for a single channel\n\n Returns:\n channel (... | Used trained LSTM model to predict test data arriving in batches.
Args:
channel (obj): Channel class object containing train/test data
for X,y for a single channel
Returns:
channel (obj): Channel class object with y_hat values as attribute | telemanom/modeling.py | batch_predict | sedgewickmm18/telemanom | 0 | python | def batch_predict(self, channel, Train=False, Path=None):
'\n Used trained LSTM model to predict test data arriving in batches.\n\n Args:\n channel (obj): Channel class object containing train/test data\n for X,y for a single channel\n\n Returns:\n channel (... | def batch_predict(self, channel, Train=False, Path=None):
'\n Used trained LSTM model to predict test data arriving in batches.\n\n Args:\n channel (obj): Channel class object containing train/test data\n for X,y for a single channel\n\n Returns:\n channel (... |
74d41f21b8ef8ddc31d7054478e6c5571b6c1c7f023d5740a83b3fb932ad8046 | def __init__(__self__, *, encryption_algorithm: str, value: str, encryption_cert_thumbprint: Optional[str]=None):
'\n Represent the secrets intended for encryption with asymmetric key pair.\n :param str encryption_algorithm: The algorithm used to encrypt "Value".\n :param str value: The value o... | Represent the secrets intended for encryption with asymmetric key pair.
:param str encryption_algorithm: The algorithm used to encrypt "Value".
:param str value: The value of the secret.
:param str encryption_cert_thumbprint: Thumbprint certificate that was used to encrypt "Value". If the value in unencrypted, it will ... | sdk/python/pulumi_azure_native/storsimple/outputs.py | __init__ | pulumi-bot/pulumi-azure-native | 31 | python | def __init__(__self__, *, encryption_algorithm: str, value: str, encryption_cert_thumbprint: Optional[str]=None):
'\n Represent the secrets intended for encryption with asymmetric key pair.\n :param str encryption_algorithm: The algorithm used to encrypt "Value".\n :param str value: The value o... | def __init__(__self__, *, encryption_algorithm: str, value: str, encryption_cert_thumbprint: Optional[str]=None):
'\n Represent the secrets intended for encryption with asymmetric key pair.\n :param str encryption_algorithm: The algorithm used to encrypt "Value".\n :param str value: The value o... |
33ef9ec755dda7c2696c55275316fd8b716cd45e27b8b88a10a77e4a73b2d7a6 | @property
@pulumi.getter(name='encryptionAlgorithm')
def encryption_algorithm(self) -> str:
'\n The algorithm used to encrypt "Value".\n '
return pulumi.get(self, 'encryption_algorithm') | The algorithm used to encrypt "Value". | sdk/python/pulumi_azure_native/storsimple/outputs.py | encryption_algorithm | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='encryptionAlgorithm')
def encryption_algorithm(self) -> str:
'\n \n '
return pulumi.get(self, 'encryption_algorithm') | @property
@pulumi.getter(name='encryptionAlgorithm')
def encryption_algorithm(self) -> str:
'\n \n '
return pulumi.get(self, 'encryption_algorithm')<|docstring|>The algorithm used to encrypt "Value".<|endoftext|> |
a72b97818c5757b45e23443833e92535957f24e9405b4d1edad11cd16dede7a0 | @property
@pulumi.getter
def value(self) -> str:
'\n The value of the secret.\n '
return pulumi.get(self, 'value') | The value of the secret. | sdk/python/pulumi_azure_native/storsimple/outputs.py | value | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter
def value(self) -> str:
'\n \n '
return pulumi.get(self, 'value') | @property
@pulumi.getter
def value(self) -> str:
'\n \n '
return pulumi.get(self, 'value')<|docstring|>The value of the secret.<|endoftext|> |
5c563ba8474071a16f58934a68e897716d81b54e2dfe42b0a6ddf23ecc369258 | @property
@pulumi.getter(name='encryptionCertThumbprint')
def encryption_cert_thumbprint(self) -> Optional[str]:
'\n Thumbprint certificate that was used to encrypt "Value". If the value in unencrypted, it will be null.\n '
return pulumi.get(self, 'encryption_cert_thumbprint') | Thumbprint certificate that was used to encrypt "Value". If the value in unencrypted, it will be null. | sdk/python/pulumi_azure_native/storsimple/outputs.py | encryption_cert_thumbprint | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='encryptionCertThumbprint')
def encryption_cert_thumbprint(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'encryption_cert_thumbprint') | @property
@pulumi.getter(name='encryptionCertThumbprint')
def encryption_cert_thumbprint(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'encryption_cert_thumbprint')<|docstring|>Thumbprint certificate that was used to encrypt "Value". If the value in unencrypted, it will be null.<|endoft... |
a41e87ace6e7900f90a28d6418c3d92eac2bf949788db8802dafe629cc18d615 | def __init__(__self__, *, days: Sequence[str], rate_in_mbps: int, start: 'outputs.TimeResponse', stop: 'outputs.TimeResponse'):
"\n The schedule for bandwidth setting.\n :param Sequence[str] days: The days of the week when this schedule is applicable.\n :param int rate_in_mbps: The rate in Mbps... | The schedule for bandwidth setting.
:param Sequence[str] days: The days of the week when this schedule is applicable.
:param int rate_in_mbps: The rate in Mbps.
:param 'TimeResponseArgs' start: The start time of the schedule.
:param 'TimeResponseArgs' stop: The stop time of the schedule. | sdk/python/pulumi_azure_native/storsimple/outputs.py | __init__ | pulumi-bot/pulumi-azure-native | 31 | python | def __init__(__self__, *, days: Sequence[str], rate_in_mbps: int, start: 'outputs.TimeResponse', stop: 'outputs.TimeResponse'):
"\n The schedule for bandwidth setting.\n :param Sequence[str] days: The days of the week when this schedule is applicable.\n :param int rate_in_mbps: The rate in Mbps... | def __init__(__self__, *, days: Sequence[str], rate_in_mbps: int, start: 'outputs.TimeResponse', stop: 'outputs.TimeResponse'):
"\n The schedule for bandwidth setting.\n :param Sequence[str] days: The days of the week when this schedule is applicable.\n :param int rate_in_mbps: The rate in Mbps... |
c2418695034b5aa45c313188df5302ee0baa29e5ade01e84100eaba31c4fd89c | @property
@pulumi.getter
def days(self) -> Sequence[str]:
'\n The days of the week when this schedule is applicable.\n '
return pulumi.get(self, 'days') | The days of the week when this schedule is applicable. | sdk/python/pulumi_azure_native/storsimple/outputs.py | days | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter
def days(self) -> Sequence[str]:
'\n \n '
return pulumi.get(self, 'days') | @property
@pulumi.getter
def days(self) -> Sequence[str]:
'\n \n '
return pulumi.get(self, 'days')<|docstring|>The days of the week when this schedule is applicable.<|endoftext|> |
76f52346508bf7dceed7d4aea14ba5ab4c354270e8d3605a065e08a3de17ff70 | @property
@pulumi.getter(name='rateInMbps')
def rate_in_mbps(self) -> int:
'\n The rate in Mbps.\n '
return pulumi.get(self, 'rate_in_mbps') | The rate in Mbps. | sdk/python/pulumi_azure_native/storsimple/outputs.py | rate_in_mbps | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='rateInMbps')
def rate_in_mbps(self) -> int:
'\n \n '
return pulumi.get(self, 'rate_in_mbps') | @property
@pulumi.getter(name='rateInMbps')
def rate_in_mbps(self) -> int:
'\n \n '
return pulumi.get(self, 'rate_in_mbps')<|docstring|>The rate in Mbps.<|endoftext|> |
e93b02335adb81368019c807a19a5a53f2a31e5c34edbff1216e0916a3087962 | @property
@pulumi.getter
def start(self) -> 'outputs.TimeResponse':
'\n The start time of the schedule.\n '
return pulumi.get(self, 'start') | The start time of the schedule. | sdk/python/pulumi_azure_native/storsimple/outputs.py | start | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter
def start(self) -> 'outputs.TimeResponse':
'\n \n '
return pulumi.get(self, 'start') | @property
@pulumi.getter
def start(self) -> 'outputs.TimeResponse':
'\n \n '
return pulumi.get(self, 'start')<|docstring|>The start time of the schedule.<|endoftext|> |
210083d0ee5e8470dd23e897b01c185460dab15042d0617072eeaae85bf3dca6 | @property
@pulumi.getter
def stop(self) -> 'outputs.TimeResponse':
'\n The stop time of the schedule.\n '
return pulumi.get(self, 'stop') | The stop time of the schedule. | sdk/python/pulumi_azure_native/storsimple/outputs.py | stop | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter
def stop(self) -> 'outputs.TimeResponse':
'\n \n '
return pulumi.get(self, 'stop') | @property
@pulumi.getter
def stop(self) -> 'outputs.TimeResponse':
'\n \n '
return pulumi.get(self, 'stop')<|docstring|>The stop time of the schedule.<|endoftext|> |
fca50fda1a74c790d7b302867e99845f94cfec640a797167476dc0e79f7bc59e | def __init__(__self__, *, error_message: Optional[str]=None, is_eligible_for_failover: Optional[bool]=None):
'\n The eligibility result of failover set, for failover.\n :param str error_message: The error message, if the failover set is not eligible for failover.\n :param bool is_eligible_for_f... | The eligibility result of failover set, for failover.
:param str error_message: The error message, if the failover set is not eligible for failover.
:param bool is_eligible_for_failover: Represents if this failover set is eligible for failover or not. | sdk/python/pulumi_azure_native/storsimple/outputs.py | __init__ | pulumi-bot/pulumi-azure-native | 31 | python | def __init__(__self__, *, error_message: Optional[str]=None, is_eligible_for_failover: Optional[bool]=None):
'\n The eligibility result of failover set, for failover.\n :param str error_message: The error message, if the failover set is not eligible for failover.\n :param bool is_eligible_for_f... | def __init__(__self__, *, error_message: Optional[str]=None, is_eligible_for_failover: Optional[bool]=None):
'\n The eligibility result of failover set, for failover.\n :param str error_message: The error message, if the failover set is not eligible for failover.\n :param bool is_eligible_for_f... |
b914ce06e2ac41c5b4ac85bb59b78173884fcb6fceb6fdfe680d3ce8d3d7df3e | @property
@pulumi.getter(name='errorMessage')
def error_message(self) -> Optional[str]:
'\n The error message, if the failover set is not eligible for failover.\n '
return pulumi.get(self, 'error_message') | The error message, if the failover set is not eligible for failover. | sdk/python/pulumi_azure_native/storsimple/outputs.py | error_message | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='errorMessage')
def error_message(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'error_message') | @property
@pulumi.getter(name='errorMessage')
def error_message(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'error_message')<|docstring|>The error message, if the failover set is not eligible for failover.<|endoftext|> |
09457cc4d41e8950d2e6b2ecf27e19b2fe1bbfde091ea2f76d4fb565338c53ac | @property
@pulumi.getter(name='isEligibleForFailover')
def is_eligible_for_failover(self) -> Optional[bool]:
'\n Represents if this failover set is eligible for failover or not.\n '
return pulumi.get(self, 'is_eligible_for_failover') | Represents if this failover set is eligible for failover or not. | sdk/python/pulumi_azure_native/storsimple/outputs.py | is_eligible_for_failover | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='isEligibleForFailover')
def is_eligible_for_failover(self) -> Optional[bool]:
'\n \n '
return pulumi.get(self, 'is_eligible_for_failover') | @property
@pulumi.getter(name='isEligibleForFailover')
def is_eligible_for_failover(self) -> Optional[bool]:
'\n \n '
return pulumi.get(self, 'is_eligible_for_failover')<|docstring|>Represents if this failover set is eligible for failover or not.<|endoftext|> |
964a76c98cf3ea728f0a341c0fdfc781cd8842f2f245f4e6d264d2ee8fc2f4b6 | def __init__(__self__, *, eligibility_result: Optional['outputs.FailoverSetEligibilityResultResponseResult']=None, volume_containers: Optional[Sequence['outputs.VolumeContainerFailoverMetadataResponseResult']]=None):
"\n The failover set on a device.\n :param 'FailoverSetEligibilityResultResponseArgs'... | The failover set on a device.
:param 'FailoverSetEligibilityResultResponseArgs' eligibility_result: The eligibility result of the failover set, for failover.
:param Sequence['VolumeContainerFailoverMetadataResponseArgs'] volume_containers: The list of meta data of volume containers, which are part of the failover set. | sdk/python/pulumi_azure_native/storsimple/outputs.py | __init__ | pulumi-bot/pulumi-azure-native | 31 | python | def __init__(__self__, *, eligibility_result: Optional['outputs.FailoverSetEligibilityResultResponseResult']=None, volume_containers: Optional[Sequence['outputs.VolumeContainerFailoverMetadataResponseResult']]=None):
"\n The failover set on a device.\n :param 'FailoverSetEligibilityResultResponseArgs'... | def __init__(__self__, *, eligibility_result: Optional['outputs.FailoverSetEligibilityResultResponseResult']=None, volume_containers: Optional[Sequence['outputs.VolumeContainerFailoverMetadataResponseResult']]=None):
"\n The failover set on a device.\n :param 'FailoverSetEligibilityResultResponseArgs'... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.