query
stringlengths
10
2k
document
stringlengths
20
51.2k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
The URL of the Regional Gateway for the API Management Service in the specified region.
def gateway_regional_url(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "gateway_regional_url")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gateway_regional_url(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"gateway_regional_url\")", "def get_region_url(project_id, region):\n assert is_valid_project_id(project_id), project_id\n assert is_valid_region(region), region\n return 'https://www.googleapis.com/compute/v1/projects/%s/...
[ "0.8032841", "0.7067141", "0.65278375", "0.6152768", "0.61329734", "0.59425765", "0.5825457", "0.5775363", "0.5770281", "0.5768285", "0.5718867", "0.5696058", "0.5667354", "0.56317335", "0.56317335", "0.56299305", "0.56102616", "0.56065416", "0.56065416", "0.55747086", "0.556...
0.77111506
1
The URL for the Management API associated with this API Management service.
def management_api_url(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "management_api_url")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def management_api_url(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"management_api_url\")", "def api_url(self):\n return self.get_api_url()", "def api_url(self):\n return self._api_url", "def apiurl(self):\n return self._apiurl", "def apiurl (self):\n return L...
[ "0.85889703", "0.764987", "0.74431026", "0.73483723", "0.7221183", "0.7220506", "0.7213687", "0.7191533", "0.70443726", "0.7034329", "0.69759965", "0.6912301", "0.69109505", "0.6901003", "0.68666995", "0.68319327", "0.678284", "0.6764317", "0.6675863", "0.6594262", "0.6593361...
0.83097833
1
Email address from which the notification will be sent.
def notification_sender_email(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "notification_sender_email")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def email_address() -> str:\n\n return os.environ.get(\"EMAIL_NOTIFICATION\", \"\")", "def notification_sender_email(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"notification_sender_email\")", "def generate_email_address(self):\n return \"%s.%s@%s\" % (uuid.uuid4(), self.mailbox, \...
[ "0.8191204", "0.80174744", "0.7613062", "0.74585193", "0.74514425", "0.74514425", "0.74514425", "0.7412389", "0.72602934", "0.7259813", "0.72285235", "0.72228503", "0.7219816", "0.7219816", "0.7219816", "0.7219816", "0.7191841", "0.7142307", "0.70599717", "0.7038014", "0.7005...
0.76546335
3
The URL for the Publisher Portal associated with this API Management service.
def portal_url(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "portal_url")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def developer_portal_url(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"developer_portal_url\")", "def management_api_url(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"management_api_url\")", "def api_url(self):\n return self.get_api_url()", "def resource_url(self):\...
[ "0.6860555", "0.67442745", "0.6679423", "0.66233873", "0.6613646", "0.66019756", "0.65981716", "0.6567077", "0.6476128", "0.6415434", "0.6399984", "0.6344932", "0.62774104", "0.6223587", "0.61649317", "0.61649317", "0.6132838", "0.612867", "0.60603267", "0.6029677", "0.602967...
0.6264982
13
The email of publisher/company.
def publisher_email(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "publisher_email")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def publisher_email(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"publisher_email\")", "def publisher_email(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"publisher_email\")", "def email(self) -> str:\n return pulumi.get(self, \"email\")", "def email(self) -> str:\n ...
[ "0.8418234", "0.823683", "0.8145944", "0.8145944", "0.8145944", "0.8093843", "0.8018317", "0.80142", "0.80142", "0.80142", "0.80142", "0.7830933", "0.7830933", "0.7830933", "0.7830933", "0.78219426", "0.7783638", "0.77834326", "0.7782989", "0.7751573", "0.7746207", "0.77438...
0.81170917
5
The name of the Resource Group in which the API Management Service should be exist. Changing this forces a new resource to be created.
def resource_group_name(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "resource_group_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resource_group_name(self) -> str:\n return pulumi.get(self, \"resource_group_name\")", "def resource_group_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"resource_group_name\")", "def resource_group_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"resource_gro...
[ "0.7519007", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044",...
0.7252912
52
A mapping of tags assigned to the resource.
def tags(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]: return pulumi.get(self, "tags")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tags(self) -> Mapping[str, str]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, str]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, str]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, str]:\n return pulumi....
[ "0.8047764", "0.8047764", "0.8047764", "0.8047764", "0.7979305", "0.7979305", "0.7540683", "0.7516949", "0.73094535", "0.7300278", "0.7238649", "0.7197904", "0.71846336", "0.71488696", "0.71181715", "0.70630586", "0.7004693", "0.69596815", "0.69234526", "0.69234526", "0.69234...
0.0
-1
The URL for the Developer Portal associated with this API Management service.
def developer_portal_url(self) -> pulumi.Output[str]: return pulumi.get(self, "developer_portal_url")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def developer_portal_url(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"developer_portal_url\")", "def api_url(self):\n return self.get_api_url()", "def api_url(self):\n return self._api_url", "def apiurl(self):\n return self._apiurl", "def management_api_url(...
[ "0.78904295", "0.7377523", "0.71191704", "0.6955641", "0.69545794", "0.689547", "0.68257946", "0.6691102", "0.6682509", "0.6652316", "0.66401094", "0.66367257", "0.6621785", "0.65991664", "0.65986437", "0.657356", "0.65540826", "0.654707", "0.6482262", "0.64011085", "0.636301...
0.8189453
0
The URL of the Regional Gateway for the API Management Service in the specified region.
def gateway_regional_url(self) -> pulumi.Output[str]: return pulumi.get(self, "gateway_regional_url")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gateway_regional_url(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"gateway_regional_url\")", "def get_region_url(project_id, region):\n assert is_valid_project_id(project_id), project_id\n assert is_valid_region(region), region\n return 'https://www.googleapis.com/compute/v1/pro...
[ "0.77111506", "0.7067141", "0.65278375", "0.6152768", "0.61329734", "0.59425765", "0.5825457", "0.5775363", "0.5770281", "0.5768285", "0.5718867", "0.5696058", "0.5667354", "0.56317335", "0.56317335", "0.56299305", "0.56102616", "0.56065416", "0.56065416", "0.55747086", "0.55...
0.8032841
0
The URL for the Management API associated with this API Management service.
def management_api_url(self) -> pulumi.Output[str]: return pulumi.get(self, "management_api_url")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def management_api_url(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"management_api_url\")", "def api_url(self):\n return self.get_api_url()", "def api_url(self):\n return self._api_url", "def apiurl(self):\n return self._apiurl", "def apiurl (self):\n ...
[ "0.83097833", "0.764987", "0.74431026", "0.73483723", "0.7221183", "0.7220506", "0.7213687", "0.7191533", "0.70443726", "0.7034329", "0.69759965", "0.6912301", "0.69109505", "0.6901003", "0.68666995", "0.68319327", "0.678284", "0.6764317", "0.6675863", "0.6594262", "0.6593361...
0.85889703
0
Email address from which the notification will be sent.
def notification_sender_email(self) -> pulumi.Output[str]: return pulumi.get(self, "notification_sender_email")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def email_address() -> str:\n\n return os.environ.get(\"EMAIL_NOTIFICATION\", \"\")", "def notification_sender_email(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"notification_sender_email\")", "def notification_sender_email(self) -> Optional[pulumi.Input[str]]:\n return pu...
[ "0.8191204", "0.76546335", "0.76546335", "0.7613062", "0.74585193", "0.74514425", "0.74514425", "0.74514425", "0.7412389", "0.72602934", "0.7259813", "0.72285235", "0.72228503", "0.7219816", "0.7219816", "0.7219816", "0.7219816", "0.7191841", "0.7142307", "0.70599717", "0.703...
0.80174744
1
The URL for the Publisher Portal associated with this API Management service.
def portal_url(self) -> pulumi.Output[str]: return pulumi.get(self, "portal_url")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def developer_portal_url(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"developer_portal_url\")", "def management_api_url(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"management_api_url\")", "def api_url(self):\n return self.get_api_url()", "def resource_url(self):\...
[ "0.6860555", "0.67442745", "0.6679423", "0.66233873", "0.66019756", "0.65981716", "0.6567077", "0.6476128", "0.6415434", "0.6399984", "0.6344932", "0.62774104", "0.6264982", "0.6223587", "0.61649317", "0.61649317", "0.6132838", "0.612867", "0.60603267", "0.6029677", "0.602967...
0.6613646
4
The email of publisher/company.
def publisher_email(self) -> pulumi.Output[str]: return pulumi.get(self, "publisher_email")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def publisher_email(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"publisher_email\")", "def email(self) -> str:\n return pulumi.get(self, \"email\")", "def email(self) -> str:\n return pulumi.get(self, \"email\")", "def email(self) -> str:\n return pulumi.get(self, \"ema...
[ "0.823683", "0.8145944", "0.8145944", "0.8145944", "0.81170917", "0.8093843", "0.8018317", "0.80142", "0.80142", "0.80142", "0.80142", "0.7830933", "0.7830933", "0.7830933", "0.7830933", "0.78219426", "0.7783638", "0.77834326", "0.7782989", "0.7751573", "0.7746207", "0.7743...
0.8418234
0
The name of the Resource Group in which the API Management Service should be exist. Changing this forces a new resource to be created.
def resource_group_name(self) -> pulumi.Output[str]: return pulumi.get(self, "resource_group_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resource_group_name(self) -> str:\n return pulumi.get(self, \"resource_group_name\")", "def resource_group_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"resource_group_name\")", "def resource_group_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"resource_gro...
[ "0.7519007", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044", "0.73299044",...
0.7011773
67
A mapping of tags assigned to the resource.
def tags(self) -> pulumi.Output[Optional[Mapping[str, str]]]: return pulumi.get(self, "tags")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tags(self) -> Mapping[str, str]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, str]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, str]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, str]:\n return pulumi....
[ "0.8047764", "0.8047764", "0.8047764", "0.8047764", "0.7979305", "0.7979305", "0.7540683", "0.7516949", "0.73094535", "0.7300278", "0.7238649", "0.7197904", "0.71846336", "0.71488696", "0.71181715", "0.70630586", "0.7004693", "0.69596815", "0.6905929", "0.68955946", "0.687554...
0.69234526
37
Activate all four game buttons.
def activate_buts(self): for b in self.gamebuttons: b.activate()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def four_buttons():\n a_is_pressed = microbit.button_a.is_pressed()\n b_is_pressed = microbit.button_b.is_pressed()\n\n # let's call the two pin-buttons c and d:\n c_is_pressed = pin_is_touched(1)\n d_is_pressed = pin_is_touched(2)\n\n if a_is_pressed:\n light_row(2)\n paint_box(rig...
[ "0.68962854", "0.6650524", "0.6515614", "0.6421187", "0.64034784", "0.6363755", "0.63476175", "0.6325821", "0.6308852", "0.63069874", "0.6226606", "0.614768", "0.61271274", "0.61151385", "0.609403", "0.6073121", "0.6051676", "0.60386074", "0.6023776", "0.6001559", "0.59936243...
0.8661612
0
Turn off all the buttons, stopping light and sound.
def all_off(self): for b in self.gamebuttons: b.but_off()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop_all():\r\n motors.stop_all_motors()\r\n led.set_colour_solid(0)\r\n display.clear()", "def off(self):\n for light in self.all:\n GPIO.output(light, 0)", "def _stop_all(self):\n # LEDs\n self.cam_led.off\n self.analysis_led[0].off\n self.analysis_l...
[ "0.7689176", "0.7556003", "0.74953777", "0.7459995", "0.74347675", "0.7406658", "0.73330504", "0.72575563", "0.7213743", "0.70674264", "0.70298404", "0.698902", "0.6989017", "0.692952", "0.6923035", "0.6922025", "0.68977445", "0.6888867", "0.6882904", "0.6881302", "0.68723327...
0.8083057
0
Creates the Settings window.
def __init__(self, parent, state, position = wx.DefaultPosition): ##Set up data. self.state = state modeName = MODE_LIST[self.state.GetSurface("Mode")] wx.Dialog.__init__(self, parent, -1, "%s Mode Settings" %(modeName), pos = position, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_settings_window():\n settings_window = ModalView(size_hint=(0.5, 0.5), auto_dismiss=False)\n settings_window.add_widget(SettingsView(settings_window))\n settings_window.open()", "def showSettingsWindow(self) -> None:\n if not self._settings_dialog:\n self._settings...
[ "0.7467314", "0.7451298", "0.7006844", "0.7003392", "0.67454296", "0.673275", "0.6638617", "0.65985674", "0.6523002", "0.65181446", "0.6467749", "0.6362588", "0.63616174", "0.63009757", "0.629968", "0.629185", "0.6289978", "0.6288987", "0.6288847", "0.6254795", "0.6234435", ...
0.5717621
53
Sets the id of this UploadSnap.
def id(self, id): self._id = id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_id(self, id_):\n\n self.id_ = id_", "def set_id(self, id):\n self.__id = id", "def SetId(self, id):\n self.id = int(id)", "def set_id(self, id):\n self.data['id'] = id", "def id(self, id):\n \n self._id = id", "def id(self, id):\n \n self._i...
[ "0.7511363", "0.747934", "0.73070776", "0.7269727", "0.71869624", "0.71869624", "0.71869624", "0.71869624", "0.71869624" ]
0.7175189
64
Sets the snap of this UploadSnap.
def snap(self, snap): self._snap = snap
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def snap_id(self, snap_id):\n\n self._snap_id = snap_id", "def snapshot(self, snapshot):\n self._context[\"snapshot\"] = snapshot", "def select_snap_path(self):\n default = os.getcwd()\n if self.target_path.get():\n default = self.target_path.get()\n target_path = ...
[ "0.6859907", "0.58296126", "0.54144615", "0.53195244", "0.5285036", "0.52040625", "0.5174207", "0.5168553", "0.51326436", "0.5042593", "0.50418967", "0.5016102", "0.5016102", "0.49909735", "0.4961858", "0.49042475", "0.49042475", "0.48944172", "0.48880136", "0.4885204", "0.48...
0.80703914
0
Sets the snap_id of this UploadSnap.
def snap_id(self, snap_id): self._snap_id = snap_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def snap(self, snap):\n\n self._snap = snap", "def sid(self, sid):\n self._sid = sid", "def set_student_id(self, student_id):\n self._student_id = student_id", "def set_student(self, student_id):\n self._student = student_id", "def set_jid(self, jid):\n log.debug(\"settin...
[ "0.7044211", "0.56522083", "0.5568157", "0.5480164", "0.54171205", "0.5370708", "0.5370708", "0.5370708", "0.5370708", "0.5364746", "0.5331126", "0.53068906", "0.52556294", "0.5254014", "0.5254014", "0.5225276", "0.52236104", "0.52236104", "0.52236104", "0.5212722", "0.521272...
0.841878
0
Sets the confidence of this UploadSnap.
def confidence(self, confidence): self._confidence = confidence
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def confidence(self, confidence):\n self._confidence = confidence", "def confidence(self, confidence):\n self._confidence = confidence", "def confidence(self, confidence: float):\n\n self._confidence = confidence", "def set_min_confidence(self, new_min):\n self.__min_confidence = ...
[ "0.7810027", "0.7810027", "0.7770509", "0.69977", "0.6715225", "0.6715225", "0.648673", "0.6480841", "0.6434077", "0.6434077", "0.609914", "0.60986197", "0.60986197", "0.58938813", "0.5673728", "0.5480926", "0.5415105", "0.53337854", "0.52382064", "0.52266896", "0.52266896", ...
0.77648205
4
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, UploadSnap): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
Initializes a PCFG instance with the specified set of rules and start variable.
def __init__(self, start_variable="S", rules=None): self.start_variable = start_variable if rules is None: rules = [] self.rules = rules
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, start, productions):\n assert _chktype(1, start, Nonterminal)\n assert _chktype(2, productions, (PCFGProduction,), [PCFGProduction])\n CFG.__init__(self, start, productions)\n\n # Make sure that the probabilities sum to one.\n probs = {}\n for production...
[ "0.6918424", "0.6818147", "0.6676437", "0.6351444", "0.62154675", "0.6086306", "0.59200406", "0.5890092", "0.571267", "0.56986314", "0.5580757", "0.5498402", "0.5498402", "0.5488067", "0.5471447", "0.54557765", "0.5376397", "0.53593946", "0.5346746", "0.53368783", "0.5324618"...
0.7149478
0
Returns a copy of this rule, with the copied rule kept in an attribute.
def copy(self): new_rule = copy.deepcopy(self) if not new_rule.original_rule: new_rule.original_rule = {"rule": self} return new_rule
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clone(self):\n return _libsbml.Rule_clone(self)", "def clone(self):\n return _libsbml.AssignmentRule_clone(self)", "def clone(self):\n return _libsbml.AlgebraicRule_clone(self)", "def clone(self):\n return attr.evolve(self)", "def copy(self):\n new = self.__class__(in...
[ "0.74728733", "0.74569803", "0.726095", "0.67953587", "0.66212475", "0.66168374", "0.6607509", "0.65343225", "0.6495351", "0.6490554", "0.6482419", "0.6272752", "0.62726027", "0.62146693", "0.6181747", "0.6162925", "0.6133127", "0.6127104", "0.61227363", "0.61089456", "0.6108...
0.8282818
0
Returns a string representation of the PCFG rule.
def __repr__(self): return 'PCFGRule(%s, %s, %s)' % (self.variable, self.derivation, self.probability)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__ (self) :\n\t\ttext_rule = \"\"\n\t\t\n\t\tfor key, rules in self.production_rules.items() :\n\t\t\ttext_rule += \"\\nRULE \" + key + \" = [\\n\\t\"\n\t\t\trule_in_a_line = []\n\t\t\tfor rule in rules :\n\t\t\t\t#rule_in_a_line.append(\" + \".join([r.val+\"(\"+r.type+\")\" for r in rule]))\n\t\t\t\trule...
[ "0.72731006", "0.6914612", "0.6863054", "0.67765236", "0.667142", "0.6472702", "0.6460267", "0.6454881", "0.6311176", "0.6138851", "0.6082467", "0.5995145", "0.5926686", "0.5917817", "0.5899881", "0.58760774", "0.58568007", "0.58386093", "0.57995796", "0.579322", "0.5772385",...
0.54174656
65
Read a utf8 encoded text file and return its contents.
def read_file(filename): with codecs.open(filename, 'r', 'utf8') as f: return f.read()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_text_file(fpath, encoding, read_size=-1, force_unix_linebreaks=True):\n with codecs.open(fpath, encoding=encoding) as f:\n contents = f.read(read_size)\n\n if read_size > 0:\n contents = contents[:read_size]\n\n if force_unix_linebreaks:\n contents = linebreak...
[ "0.77134204", "0.7614767", "0.76061934", "0.75781465", "0.7553593", "0.75099313", "0.74945265", "0.7488157", "0.7465261", "0.7410554", "0.7405463", "0.73217803", "0.731961", "0.731961", "0.7297014", "0.7265897", "0.71820676", "0.7177159", "0.7168671", "0.7157522", "0.7140818"...
0.769733
2
Specifies whether or not to save the model at the current epoch.
def save_epoch(self): if self._best_epoch: # save if we have the best performance return True # otherwise save only every save iter return (self.epoch % self._save_iter) == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_epoch(self, epoch):\r\n pass", "def checkpoint(self, epoch: int):\n if self.exp.scheduler_stepper is not None:\n torch.save(\n {\n \"model_state_dict\": self.exp.model.state_dict(),\n \"optimizer_state_dict\": self.exp.optimize...
[ "0.68670803", "0.67023814", "0.66755927", "0.65416074", "0.6525766", "0.6504314", "0.6486852", "0.64241904", "0.6312553", "0.6273056", "0.62646484", "0.62508523", "0.62448466", "0.62189704", "0.62047935", "0.6189693", "0.6189133", "0.6182387", "0.6174063", "0.6083707", "0.607...
0.7414132
0
Load the model and optimizers from the most recent epoch.
def load_checkpoint(self, model, optimizers): self.epoch = get_last_epoch(self.log_path) model_state_dict = torch.load(os.path.join(self.log_path, 'checkpoints', str(self.epoch), 'model.ckpt')) model.load_state_dict(model_state_dict) optimizer_state_dict = torch.load(os.path.join(self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_model(self):\n self._load_scaler('scaler.save')\n self._load_encoder('encoder0.save', 0)\n self._load_encoder('encoder1.save', 1)\n self._load_neural_network('model.json', 'model.h5')\n return", "def load_optimizers(self, epoch):\n for i, optimizer in enumerate...
[ "0.74786997", "0.7371077", "0.70991945", "0.7054186", "0.69073784", "0.68957776", "0.68957776", "0.6891431", "0.68743557", "0.6789913", "0.67792255", "0.6772974", "0.67342657", "0.6685493", "0.665662", "0.6620736", "0.65854925", "0.6581128", "0.654461", "0.65372485", "0.65317...
0.74433905
1
Initialize this dataset class.
def __init__(self, opt): BaseDataset.__init__(self, opt) transform_list = [ transforms.ToTensor() ] self.transform = transforms.Compose(transform_list) dir_self = "./datasets/self_2020/wOBJ_processed/" + str(opt.phase) self.files_self_A_rgbd = sorted(glob.glob(dir_self + '/A_rg...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.__dataset = None", "def __init__(self, dataset):\n self._dataset = dataset", "def __init__(self, dataset: Dataset):\n self.dataset = dataset", "def __init__(self, config):\n logger.info(f\"{self.__class__.__name__}: Dataset initializing ...\")\n s...
[ "0.816631", "0.81641185", "0.8013762", "0.76137954", "0.7422038", "0.7393049", "0.7352237", "0.73437655", "0.7111143", "0.71019876", "0.7099074", "0.7096382", "0.70223516", "0.696418", "0.6961817", "0.6889772", "0.6879775", "0.68740934", "0.68599087", "0.68520594", "0.6842619...
0.0
-1
Attach a lot of summaries to a Tensor
def variable_summaries(variable, name): with tf.name_scope('summaries'): mean = tf.reduce_mean(variable) tf.scalar_summary('mean/' + name, mean) with tf.name_scope('stddev'): stddev = tf.sqrt(tf.reduce_sum(tf.square(variable - mean))) tf.scalar_summary('sttdev/' + name, s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_summary(self):\n for k, v in self.metrics.items():\n tf.summary.scalar(k, v)\n \n self.summary_op = tf.summary.merge_all()", "def build_summaries(self):\n\n # Loss summary.\n tf.summary.scalar('loss', self.loss)\n\n merged = tf.summary.merge_all()\n self.summary_op = merged\n ...
[ "0.72127706", "0.7122828", "0.7122828", "0.69307214", "0.68027735", "0.67884105", "0.6778805", "0.67116094", "0.664624", "0.651495", "0.65025246", "0.64518976", "0.6418636", "0.64070934", "0.6395541", "0.6350012", "0.6331073", "0.6235902", "0.6221092", "0.6217595", "0.6208109...
0.0
-1
Takes a set of character folders and labels and returns paths to image files paired with labels.
def get_images(paths, labels, nb_samples=None, shuffle=True): if nb_samples is not None: sampler = lambda x: random.sample(x, nb_samples) else: sampler = lambda x: x images_labels = [(i, os.path.join(path, image)) for i, path in zip(labels, paths) fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_image_path_label(all_paths):\r\n n_folders_int = random.sample(range(0, len(all_paths)), n_way)\r\n image_labels = [[(glob.glob(all_paths[n] + '\\*')[k], n) # (path, label)\r\n for n in n_folders_int\r\n for k in random.sample(range(0, len(glob.glob(all_paths[n]...
[ "0.7875825", "0.739325", "0.71017206", "0.6980468", "0.68674016", "0.68117267", "0.6808696", "0.67802685", "0.6759404", "0.67360824", "0.67039096", "0.66744095", "0.665738", "0.66389525", "0.6623084", "0.65938514", "0.6568905", "0.64979", "0.6495697", "0.6481333", "0.64552546...
0.73174477
2
This is ran automatically at the end of the test cases defined below It is good to factor out any tear downcode for subsequent tests It is NOT required to define tearDown, it is just helpful in many cases
def tearDown(self): pass #because we dont have anything to tearDown.
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tearDown(self):\n pass\n # teardown called after each test\n # e.g. maybe write test results to some text file", "def tearDown(self) -> None:\n pass", "def tearDown(self) -> None:\n pass", "def tearDown(self) -> None:\n pass", "def tearDown(self):\n\t\tpass", ...
[ "0.86746573", "0.86285985", "0.86285985", "0.86285985", "0.86088014", "0.86062396", "0.8582784", "0.8582784", "0.8582784", "0.8578176", "0.8559175", "0.855182", "0.855182", "0.85510796", "0.85510796", "0.85510796", "0.85510796", "0.85510796", "0.85510796", "0.85510796", "0.85...
0.0
-1
Creates edge from node with val1 and node with val2 with given weight.
def add_edge(self, val1, val2, weight, directional=False): node1 = self.get_node(val1) node2 = self.get_node(val2) node1.add_edge(node2, weight) if not directional: node2.add_edge(node1, weight)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_edge(self, val1, val2, weight=0):\n self.setdefault(val1, {})\n self.setdefault(val2, {})\n if val2 not in self[val1]:\n self[val1][val2] = weight", "def add_edge(self, n1, n2, weight=0):\n self.add_node(n1)\n self.add_node(n2)\n self.dict[n1][n2] = we...
[ "0.7941413", "0.747169", "0.7332521", "0.7312926", "0.71932644", "0.6794435", "0.67684793", "0.6721157", "0.6694576", "0.66431695", "0.6617579", "0.6593082", "0.6581354", "0.6543639", "0.6525958", "0.64871365", "0.64767396", "0.64696485", "0.64517295", "0.6409681", "0.6395417...
0.7654623
1
Check if row, col and box are valid
def valid(grid, num, pos): # Check row for i in range(LEN_GRID): if grid[pos[0]][i] == num and pos[1] != i: return False for i in range(LEN_GRID): if grid[pos[0]][i] == num and pos[1] != i: return False # Check column for i in range(LEN_GRID): if gri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_valid_position(self, somerow, somecol):\n valid_row = 0 <= somerow <= (self.size-1)\n valid_col = 0 <= somecol <= (self.size-1)\n #need to use self.size - 1 because while we're thinking of an 8x8 chess board, the computer is thinking of a 0x7 chess board\n return valid_row and va...
[ "0.75742817", "0.7467699", "0.74090254", "0.7370982", "0.73057574", "0.72271466", "0.72207695", "0.7201106", "0.71821445", "0.7094689", "0.7062221", "0.7046373", "0.70319146", "0.7023907", "0.6947145", "0.6924911", "0.69007754", "0.69004005", "0.68888354", "0.6866636", "0.686...
0.71280473
9
r"""Converts a quaternions to coeffs in [x, y, z, w] format
def quaternion_to_coeff(quat: np.quaternion) -> np.array: coeffs = np.zeros((4,)) coeffs[3] = quat.real coeffs[0:3] = quat.imag return coeffs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def multiply_quaternions( qa, qb ):\n combined = Quaternion()\n\n combined.w = (qa.w * qb.w - qa.x * qb.x - qa.y * qb.y - qa.z * qb.z)\n combined.x = (qa.x * qb.w + qa.w * qb.x + qa.y * qb.z - qa.z * qb.y)\n combined.y = (qa.w * qb.y - qa.x * qb.z + qa.y * qb.w + qa.z * qb.x)\n combined.z = (qa.w * ...
[ "0.6838738", "0.67883563", "0.6519596", "0.6356952", "0.6322742", "0.6189939", "0.6142145", "0.61412567", "0.6109183", "0.60983413", "0.60717314", "0.5999544", "0.5981303", "0.59151673", "0.58967614", "0.5895758", "0.5845222", "0.584088", "0.58313555", "0.5814837", "0.581009"...
0.72975194
0
Compose preprocessing transforms for model The imported models use a range of different preprocessing options, depending on how they were originally trained. Models trained in MatConvNet typically require input images that have been scaled to [0,255], rather than the [0,1] range favoured by PyTorch.
def compose_transforms(meta, center_crop=True, new_imageSize = None, override_meta_imsize=False): normalize = transforms.Normalize(mean=meta['mean'], std=meta['std']) im_size = meta['imageSize'] if override_meta_imsize: im_size = new_imageSize assert im_size[0] == im_size[1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def imagenet_transforms():\n channel_stats = dict(mean=[0.485, 0.456, 0.406],\n std=[0.229, 0.224, 0.225])\n train_transforms = transforms.Compose([\n transforms.ToPILImage(),\n transforms.Resize(256),\n transforms.CenterCrop(224),\n transforms.ColorJitter(...
[ "0.68218637", "0.64674497", "0.64609164", "0.6405251", "0.6403162", "0.63758117", "0.63758117", "0.63758117", "0.6292603", "0.6265891", "0.6226832", "0.6203441", "0.6173793", "0.61263686", "0.60846186", "0.60638595", "0.60289633", "0.60140985", "0.599824", "0.5993941", "0.599...
0.6342984
8
Return whether this input is optional or mandatory.
def is_optional(self): return self.default is not NotImplemented
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def optional(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"optional\")", "def optional(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"optional\")", "def optional(self) -> Optional[pulumi.Input[bool]]:\n return pulumi.get(self, \"optional\")", "def...
[ "0.7898654", "0.7898654", "0.7898654", "0.7898654", "0.7898654", "0.7898654", "0.78647995", "0.7767956", "0.7514606", "0.7514606", "0.73671466", "0.73312396", "0.71767914", "0.7173764", "0.7173764", "0.7173764", "0.7173764", "0.7173764", "0.7173764", "0.7173764", "0.7173764",...
0.6797933
63
Decorate setUp method to handle skips, and resources requests.
def _decorate_setup(self, setup_method): @wraps(setup_method) def setup_method_wrapper(*args, **kwargs): """setup method wrapper. * Locks the required resources for the test. * Executes the original setUp method. * Upon exception, finalizes the resources....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp_extra(self):\n pass", "def setUp(self):\n raise NotImplementedError", "def setUp(self):\n\n return", "def setUp(self) -> None:\n pass", "def setUp(self) -> None:\n pass", "def setUp(self):\n super(UrlResetMixin, self).setUp()\n self._reset_urls()...
[ "0.75365853", "0.73845303", "0.73749065", "0.7358126", "0.7358126", "0.73399687", "0.72974414", "0.72799265", "0.72395635", "0.72289056", "0.72238266", "0.7222834", "0.72011095", "0.71940535", "0.71940535", "0.71866536", "0.71866536", "0.71866536", "0.71866536", "0.71866536", ...
0.68334067
70
Check if the given parameter is a valid inputs for the component.
def _is_valid_input(self, parameter_name): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isInputValid(self, input):\r\n pass", "def validate_input(self, *args):\n return", "def _check_input(self, func, args, kwargs):\n fullargspec = inspect.getfullargspec(func)\n return_msg = ''\n if fullargspec.varkw is None:\n for key in kwargs:\n ...
[ "0.78938955", "0.73111725", "0.6981186", "0.69493735", "0.6863495", "0.6850296", "0.6775349", "0.6705345", "0.6688547", "0.66801023", "0.6678583", "0.6675324", "0.66537243", "0.6611432", "0.6578093", "0.6573", "0.6572051", "0.6512315", "0.650166", "0.64947397", "0.6481649", ...
0.8006903
0
Gets the user's first and last name concatenated. This way, if the format for names changes, the update only needs to be reflected in this method.
def full_name(self): return f"{self.first_name} {self.last_name}"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_full_name(self):\n full_name = f'{self.first_name} {self.last_name}' if self.first_name and self.last_name else self.username\n return full_name.strip()", "def get_full_name(self):\n # The user is identified by their email address\n return self.first_name+' '+self.last_name", ...
[ "0.81967413", "0.81664395", "0.81311864", "0.8124859", "0.81120116", "0.8061995", "0.80291814", "0.80235213", "0.80203897", "0.7974807", "0.7930989", "0.7911468", "0.78983486", "0.7897529", "0.78960305", "0.7879909", "0.7879909", "0.7866213", "0.78658", "0.78658", "0.7862544"...
0.7611471
67
Gets the date and time the post was created in a more casaul form.
def friendly_date(self): return self.created_at.strftime("%a %b %#d %Y, %#I:%M %p")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_creation_time(self):\n return self.get_attr('date_created')", "def created_date_time(self) -> str:\n return pulumi.get(self, \"created_date_time\")", "def time_created(self):\n return self._time_created", "def time_created(self):\n return self._time_created", "def time_c...
[ "0.7693784", "0.7575657", "0.75704277", "0.75704277", "0.75704277", "0.75704277", "0.75545096", "0.75545096", "0.75545096", "0.73823285", "0.73795587", "0.7375237", "0.7375237", "0.7362152", "0.735284", "0.735284", "0.735284", "0.7325676", "0.7325676", "0.7325676", "0.7307122...
0.6515888
100
Calculates the quantiles for an array
def quantile(agg, k=4, name='quantile'): w = 100.0 / k p = np.arange(w, 100 + w, w) if p[-1] > 100.0: p[-1] = 100.0 q = np.array([stats.scoreatpercentile(agg.data, pct) for pct in p]) q = np.unique(q) k_q = len(q) if k_q < k: print("Quantile Warning: Not enough unique val...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _process_quantiles(x, dim):\r\n x = np.asarray(x, dtype=float)\r\n\r\n if x.ndim == 0:\r\n x = x[np.newaxis]\r\n elif x.ndim == 1:\r\n if dim == 1:\r\n x = x[:, np.newaxis]\r\n else:\r\n x = x[np.newaxis, :]\r\n\r\n return x", "def quantile_ndim(arr, qua...
[ "0.7251345", "0.7216592", "0.7133247", "0.7106315", "0.69545215", "0.6900969", "0.687984", "0.68746287", "0.68466365", "0.684101", "0.68230665", "0.6768543", "0.67042035", "0.6685787", "0.6683506", "0.6683348", "0.6683348", "0.6683348", "0.6658784", "0.66571367", "0.6656848",...
0.6210803
37
Return a description of this value, or None. GraphQL favors the Markdown format. return basestring The description.
def _description(self): return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def description(self):\r\n if \"description\" in self.data:\r\n return self.data[\"description\"]\r\n return None", "def description(self) -> typing.Optional[str]:\n return self._values.get('description')", "def description(self) -> Optional[str]:\n return pulumi.get(self...
[ "0.7901277", "0.7868353", "0.78654087", "0.78654087", "0.78654087", "0.78654087", "0.78654087", "0.78654087", "0.78654087", "0.78654087", "0.78654087", "0.78654087", "0.78654087", "0.78654087", "0.78654087", "0.78654087", "0.78654087", "0.78654087", "0.78654087", "0.78654087", ...
0.0
-1
Return the string representation of the default value of this field. Return the GraphQL document string representation of the default value of this field, if any, or None.
def _default_value(self): return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default(self):\n\n return self._get_field(\"value\")", "def to_string_with_default(value: Any, default_value: str) -> str:\n result = StringConverter.to_nullable_string(value)\n return result if not (result is None) else default_value", "def default_value(self):\n return self._d...
[ "0.7642904", "0.71370226", "0.71030396", "0.71030396", "0.7059839", "0.7016615", "0.6918234", "0.68382716", "0.67369616", "0.6683766", "0.6683766", "0.6657304", "0.6651199", "0.66467327", "0.6610293", "0.6589807", "0.6563949", "0.64945656", "0.64832085", "0.647353", "0.646032...
0.673497
9
Convert a list of namedtuples to a list of dicts.
def namedtuples_to_dicts(nts): return [dict(nt._asdict()) for nt in nts]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def namedtuples2dicts(namedtuples):\n return {k: dict(v._asdict()) for k, v in namedtuples.items()}", "def _convert_list_tuples_to_dict(self, headers_list):\n # type: (List[Tuple[str, str]]) -> Dict[str, str]\n headers_dict = {} # type: Dict\n if headers_list is not None:\n fo...
[ "0.7817066", "0.6758727", "0.66412526", "0.64723957", "0.64278114", "0.6394096", "0.63894594", "0.6282187", "0.6216985", "0.6095934", "0.6095079", "0.6058382", "0.6039374", "0.60156596", "0.59870535", "0.59787893", "0.5960707", "0.5944669", "0.59195745", "0.5884043", "0.58442...
0.79805464
0
Get RAID configuration for this DRAC.
def get_raid_config(bmc): controllers = bmc.list_raid_controllers() pdisks = bmc.list_physical_disks() vdisks = bmc.list_virtual_disks() controllers = namedtuples_to_dicts(controllers) pdisks = namedtuples_to_dicts(pdisks) vdisks = namedtuples_to_dicts(vdisks) return controllers, pdisks, vdi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replica_configuration(self) -> 'outputs.ReplicaConfigurationResponse':\n return pulumi.get(self, \"replica_configuration\")", "def replica_configuration(self) -> pulumi.Output['outputs.ReplicaConfigurationResponse']:\n return pulumi.get(self, \"replica_configuration\")", "def get_all_raid_con...
[ "0.6074116", "0.5990398", "0.59449524", "0.58756995", "0.56307507", "0.56167793", "0.5540216", "0.5513968", "0.5363289", "0.53597236", "0.53197277", "0.5315866", "0.52662474", "0.52431804", "0.5229185", "0.51930565", "0.5190713", "0.5171382", "0.5161307", "0.5161307", "0.5161...
0.6847694
0
Initialize our weight using the given `prob` dict.
def __init__(self, prob, pt=None): self.pt = pt if prob['BaseValueAttribute'] != 'None': raise Exception('Cannot handle BVA at the moment') if prob['InitializationDefinition'] == 'None': self.bvc = round(float(prob['BaseValueConstant']), 6) else: if p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, weightsDictionary):\n self.weightsDictionary = weightsDictionary", "def init_weight(self):\n init_bn(self.norm0)", "def __init__(self, weights):\n self._weights = weights", "def __init__(self, weights, keys=None):\n n = self.n = len(weights)\n if ...
[ "0.6657062", "0.6617697", "0.6477255", "0.64551485", "0.643897", "0.6419869", "0.6368359", "0.6329848", "0.628035", "0.6222019", "0.61786747", "0.61668336", "0.61280805", "0.61208236", "0.6113796", "0.6086853", "0.60847235", "0.60838646", "0.60830677", "0.6041032", "0.6036923...
0.58597076
41
Returns a list of children of ourselves which match the given prefix to the child name.
def get_children_with_name(self, prefix): prefix = prefix.lower() for childname, child in self.children.items(): if childname.lower().startswith(prefix): yield child
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def items_with_prefix(self, prefix):\n node = self.get_node(self.root, 0, prefix)\n # look at the middle subtree only (since only it has exact matches)\n return self.collect(node.middle, prefix)", "def search_prefix(self, prefix):\n current = self.root\n for letter in prefix:\n...
[ "0.6770849", "0.6600128", "0.6495988", "0.64550245", "0.6418861", "0.6245262", "0.6121086", "0.61016935", "0.6089816", "0.60410255", "0.5967848", "0.59350145", "0.5895098", "0.58767796", "0.58699125", "0.58631915", "0.58324337", "0.5819725", "0.58158004", "0.5761066", "0.5760...
0.85868233
0
Generate the workstation query string. Supports setting the image with overlay or a reader_study.
def get_workstation_path_and_query_string( # noqa: C901 image=None, reader_study=None, algorithm_job=None, archive_item=None, config=None, user=None, display_set=None, ): if image: path = f"{settings.WORKSTATIONS_BASE_IMAGE_PATH_PARAM}/{getattr(image, 'pk', image)}" elif dis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def construct_wowdb_url(itype, slot, expansion, source):\n #url = f\"https://www.wowdb.com/items/{itype}?filter-bind={bind}&filter-expansion={xpac_filt}&filter-slot={slot_filt}&filter-source={sour_filt}\"\n url = f'https://www.wowhead.com/{itype}'\n if itype == \"armor\" or itype == \"weapons\":\n ...
[ "0.5476684", "0.53578734", "0.53553236", "0.5349658", "0.5326908", "0.5296239", "0.52699965", "0.5252346", "0.5246", "0.5227675", "0.52073395", "0.52018476", "0.5200634", "0.51603264", "0.51580846", "0.51478916", "0.51153433", "0.50952214", "0.50773436", "0.5053784", "0.50298...
0.7278978
0
Sets the intermission_time_remaining of this GameLinescoreIntermissionInfo.
def intermission_time_remaining(self, intermission_time_remaining): self._intermission_time_remaining = intermission_time_remaining
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def intermission_time_elapsed(self, intermission_time_elapsed):\n\n self._intermission_time_elapsed = intermission_time_elapsed", "def time_remaining_minutes(self, time_remaining_minutes):\n\n self._time_remaining_minutes = time_remaining_minutes", "def time_remaining_seconds(self, time_remaining...
[ "0.69672805", "0.6751469", "0.6676688", "0.60492975", "0.5371108", "0.51417714", "0.5016502", "0.49284938", "0.49267244", "0.4819703", "0.47928286", "0.4695228", "0.46379936", "0.4570687", "0.45588508", "0.45588508", "0.45285955", "0.45177945", "0.45129186", "0.44630712", "0....
0.857617
0
Sets the intermission_time_elapsed of this GameLinescoreIntermissionInfo.
def intermission_time_elapsed(self, intermission_time_elapsed): self._intermission_time_elapsed = intermission_time_elapsed
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def intermission_time_remaining(self, intermission_time_remaining):\n\n self._intermission_time_remaining = intermission_time_remaining", "def __init__(self, intermission_time_remaining=None, intermission_time_elapsed=None, in_intermission=None): # noqa: E501 # noqa: E501\n self._intermission_tim...
[ "0.6697917", "0.55704236", "0.49364233", "0.48595253", "0.48530403", "0.46908185", "0.4585138", "0.45659852", "0.45494285", "0.45441353", "0.45352384", "0.45206323", "0.44234252", "0.43833986", "0.43749312", "0.4370119", "0.43544975", "0.43544975", "0.4321036", "0.43180215", ...
0.8470693
0
Sets the in_intermission of this GameLinescoreIntermissionInfo.
def in_intermission(self, in_intermission): self._in_intermission = in_intermission
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, intermission_time_remaining=None, intermission_time_elapsed=None, in_intermission=None): # noqa: E501 # noqa: E501\n self._intermission_time_remaining = None\n self._intermission_time_elapsed = None\n self._in_intermission = None\n self.discriminator = None\n ...
[ "0.6098776", "0.5795174", "0.57515126", "0.5584758", "0.55753607", "0.5436638", "0.5436638", "0.5436638", "0.5436638", "0.5436638", "0.5342003", "0.5293667", "0.5213031", "0.509661", "0.50306225", "0.48586065", "0.48515713", "0.48505744", "0.47776714", "0.4758859", "0.4739976...
0.81938934
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, GameLinescoreIntermissionInfo): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
Defines `C(n, k)` as the number of ways to pick `k` items among `n`
def comb(n: int, k: int) -> int: if k > n: raise ValueError result = 1 for i in range(n - k + 1, n + 1): result *= i for i in range(2, k + 1): result /= i return int(result)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def n_choose_kv(newK):\n values = np.zeros((1,newK+1))\n ks = np.arange(newK+1)\n \n for i in range(newK+1):\n values[i] = scipy.misc.comb(newK, ks[i])\n\n return values", "def combinations(n, k):\n return factorial(n) / (factorial(k) * factorial(n - k))", "def n_choose_k(N,K):\n re...
[ "0.73505104", "0.715888", "0.7128304", "0.7010093", "0.7006238", "0.6969344", "0.6916041", "0.6911911", "0.68487436", "0.6757279", "0.67442524", "0.6695749", "0.6663959", "0.663854", "0.6634696", "0.6613549", "0.6603175", "0.65733325", "0.65733325", "0.653248", "0.6518686", ...
0.63701993
29
Return `True` if `n` passes `k` rounds of the MillerRabin primality test (and is probably prime). Return `False` if `n` is proved to be composite.
def maybe_prime(n: int, k: int = 3) -> bool: if n < 2: return False for p in small_primes: if n < p * p: return True if n % p == 0: return False r, s = 0, n - 1 while s % 2 == 0: r += 1 s //= 2 for _ in range(k): a = randrange(2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_miller_rabin_prime(n):\n if n <= 1:\n return False\n elif n == 2:\n return True\n elif n % 2 == 0:\n return False\n \n witnesses = get_witnesses(n)\n if witnesses is None:\n msg = 'No definite Miller-Rabin test is available for %d' % n\n raise ValueError(...
[ "0.8286414", "0.8286414", "0.7837594", "0.75324184", "0.75093573", "0.7506464", "0.74567384", "0.7455075", "0.7400499", "0.73274815", "0.72831213", "0.7273223", "0.7258809", "0.7233196", "0.7232985", "0.72253776", "0.722515", "0.7212825", "0.71969444", "0.7193044", "0.7190779...
0.74399346
8
Computes the GCD of all items from an `Iterator`
def reduce_to_gcd(it: Iterator): return reduce(gcd, it, next(it))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def zzx_heu_gcd(f, g, **flags):\n def interpolate(h, x):\n f = []\n\n while h:\n g = h % x\n\n if g > x // 2:\n g -= x\n\n f.insert(0, g)\n h = (h-g) // x\n\n return f\n\n def finalize(h, cff, cfg, gcd):\n h = zzx_mul_cons...
[ "0.5868378", "0.58008903", "0.5747364", "0.5737022", "0.56543446", "0.5648989", "0.5632083", "0.5632083", "0.5590387", "0.553907", "0.55175877", "0.54886276", "0.5457125", "0.5435342", "0.54321516", "0.54260874", "0.54194427", "0.5408416", "0.54013544", "0.53867835", "0.53809...
0.8005254
0
Returns the rows in the table as a tuple of dicts
def rows(self, table_name): # still sticking to full caching client-side without # support for memory-preserving iterators. Given our # use case, I think this will be fine. Can always change later cursor = self.connection.cursor() cursor.execute('SELECT * FROM %s' % table_name...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _dictfetchall(self):\n return [dict(zip([col[0] for col in self.cursor.description], row)) \\\n for row in self.cursor.fetchall()]", "def Result(row, schema):\r\n return dict(zip(schema.fields(), row))", "def __toListOfDict(self, cursor):\n lst = []\n for row in curso...
[ "0.71447", "0.7045556", "0.68054247", "0.67171305", "0.67171305", "0.66233313", "0.66233313", "0.6595286", "0.6585456", "0.6505285", "0.64341414", "0.6403422", "0.63620377", "0.63620377", "0.6337688", "0.6286496", "0.6264586", "0.62470895", "0.6242803", "0.6213794", "0.619985...
0.0
-1
Sets the value of this var. This is only allowed to be done once
def set(self,data): with self.__cond: if self.__isset: raise VarSetTwiceException("A thread attempted to set a filled" + "write once variable a second time") self.__isset = True self.__data = data for f in self.__me...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setval(self, val):\r\n self.value = val", "def updateValue(self):\n self.value = self.var.get()", "def set_value(self, val):\n self.value = val", "def assign(self, value):\n self.value = value", "def set_value(self, val):\n self._value = val", "def set_value(self, v...
[ "0.80588543", "0.7984344", "0.79813695", "0.796231", "0.7930305", "0.7930305", "0.789141", "0.78878146", "0.7869965", "0.78689474", "0.78689474", "0.7780524", "0.7780524", "0.7780524", "0.76622313", "0.7658537", "0.7658537", "0.7658537", "0.7658537", "0.7658537", "0.7658537",...
0.0
-1
We create a multihead neural network which jointly learns an approximation of the statevalue function and the stateaction value function. Its convolutional layers are fully shared whereas once the feature maps get flattened we add a specific hidden layer before the outputs which estimate V(s) and Q(s,a). For the differ...
def build_duelling_models(self): input_state = Input(shape=(84, 84, 4), name='game_state') first_conv = Conv2D( 32, (8, 8), strides=( 4, 4), activation='relu')(input_state) second_conv = Conv2D( 64, (4, 4), strides=( 2, 2), activation='re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_model(self):\n states = layers.Input(shape=(self.state_size,), name='states')\n actions = layers.Input(shape=(self.action_size,), name='actions')\n\n # Hidden Layers for state pathway\n net_states = layers.Dense(units=320, kernel_regularizer=regularizers.l2(0.01), activation='...
[ "0.6835366", "0.6787757", "0.6639846", "0.6495322", "0.6435148", "0.63943493", "0.63321877", "0.6330303", "0.6293193", "0.62709874", "0.6247748", "0.6238156", "0.62016296", "0.61803854", "0.61752415", "0.61737376", "0.6155191", "0.61312187", "0.61289", "0.6106562", "0.609554"...
0.0
-1
render the shop page
def shop(request): return render(request, 'shop/shop.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index(request):\n return render(request, 'shop/index.html')", "def products():\n\n\treturn render_template(\"products.html\")", "def view_shoppingbag(request):\n\n return render(request, 'shoppingbag/shoppingbag.html')", "def view_basket(request):\n\n return render(request, 'basket/basket.html')...
[ "0.744742", "0.70073193", "0.6869518", "0.6811567", "0.67606133", "0.6760605", "0.674106", "0.6724063", "0.6724063", "0.6724063", "0.6635341", "0.65971035", "0.65971035", "0.6513482", "0.649033", "0.6481877", "0.64639807", "0.6438102", "0.64173865", "0.64070916", "0.637622", ...
0.8127534
0
helper function to filter a dict by a dict key
def get_config_part(config_parent, match_key, match_value): return {k: v for (k, v) in config_parent.items() if v[match_key] == match_value}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_dict(dictionary, pred):\n return dict((k, v) for k, v in dictionary.items() if pred(k, v))", "def filter_keys(func, a_dict):\n return dict((k, v) for (k, v) in a_dict.items() if func(k))", "def filter_dict(fdict, mask):\n\n if fdict is None:\n fdict = dict()\n\n if mask is None:\n...
[ "0.773288", "0.76445735", "0.72936165", "0.724765", "0.72248065", "0.71677727", "0.71633196", "0.7130337", "0.7092645", "0.7021775", "0.7012441", "0.6812451", "0.67870086", "0.677302", "0.67513335", "0.66598976", "0.6646052", "0.6594211", "0.65440637", "0.6518743", "0.6491298...
0.0
-1
This function returns (min_birth, max_death) from the persistence.
def __min_birth_max_death(persistence, band=0.0): # Look for minimum birth date and maximum death date for plot optimisation max_death = 0 min_birth = persistence[0][1][0] for interval in reversed(persistence): if float(interval[1][1]) != float("inf"): if floa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def age_extents(self):\n age_df = self.dismod_file.age\n return age_df.age.min(), age_df.age.max()", "def find_x_max(self, persistence, inf_delta=0.1, band=0.0):\n\n (min_birth, max_death) = self.__min_birth_max_death(persistence, band)\n delta = (max_death - min_birth) * inf_delta\n ...
[ "0.5899358", "0.5881325", "0.5661318", "0.55898505", "0.55795324", "0.54763824", "0.53813905", "0.5352748", "0.5336196", "0.53039163", "0.5296036", "0.5290725", "0.5286891", "0.5260927", "0.5239374", "0.52169144", "0.5185975", "0.51684934", "0.51615936", "0.5150936", "0.51388...
0.79057974
0
If user submits bad (blank) form, form errors displayed
def test_view_with_bad_blank_data(self): site = Site.test_objects.create_site('site name') response = self.client.post( reverse('streamwebs:camera_point_add', kwargs={'site_slug': site.site_slug} ), { 'camera_point-TOTAL_FORMS': '3', #...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def form_invalid(self, form, request):\n return", "def form_invalid(self, form, request):\n return", "def form_invalid(self, form):\n return self.render_to_response(\n self.get_context_data(result=form.errors.as_text()))", "def form_invalid(self, form):\n return self.re...
[ "0.75501215", "0.75501215", "0.73720896", "0.71829796", "0.71829796", "0.71118057", "0.6979715", "0.69683945", "0.6857075", "0.6857075", "0.6826126", "0.6826126", "0.68255764", "0.6819498", "0.68168914", "0.6816588", "0.6801578", "0.6801578", "0.67434096", "0.67434096", "0.67...
0.0
-1
Initialise a Quartus Synthesiser instance
def __init__(self, project, user_paths): super(Quartus, self).__init__(project, self.executables, user_paths) self.quartus_sh = os.path.join(self.path, 'quartus_sh')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init(q: qreg) -> control:\n\n return", "def __init__(self, *args):\n _snap.TFltQu_swiginit(self, _snap.new_TFltQu(*args))", "def __init__(self, quaternion=None, beta=None, samplePeriod=None):\r\n if quaternion is not None:\r\n self.quaternion = quaternion\r\n if beta is n...
[ "0.6310578", "0.6217103", "0.6069628", "0.6059048", "0.6058794", "0.60394454", "0.6035063", "0.6000956", "0.59919447", "0.59582096", "0.5884167", "0.5869243", "0.58563316", "0.58337396", "0.58119035", "0.58060163", "0.57565385", "0.5727302", "0.57029814", "0.56907", "0.565626...
0.0
-1
Get He's constant for the given layer
def getLayerNormalizationFactor(x, gain): size = x.weight.size() fan_in = prod(size[1:]) return gain * math.sqrt(1.0 / fan_in)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_specific_heat() -> float:\n return 1006.0", "def get_duct_linear_heat_loss_coefficient() -> float:\n return 0.49", "def energy_atom(atom,layer):\n global r,c,h\n backval= r*((atom**2/layer**2))\n return float('%.2E' % Decimal(str(backval)))", "def H(self, z):\n return self.H0 * ...
[ "0.68291503", "0.6137144", "0.60796916", "0.6004062", "0.5886632", "0.58120126", "0.57895094", "0.5788709", "0.5787688", "0.5747631", "0.5741245", "0.5724301", "0.5699232", "0.56729484", "0.55906075", "0.55719507", "0.5552763", "0.5552763", "0.55492437", "0.5530428", "0.55231...
0.5349069
43
Tests standard roi head loss when truth is empty and nonempty.
def test_standard_roi_head_loss(self, with_shared_head): if not torch.cuda.is_available(): # RoI pooling only support in GPU return unittest.skip('test requires GPU and torch+cuda') s = 256 roi_head_cfg = _fake_roi_head(with_shared_head=with_shared_head) roi_head ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_empty_img():\n assert detected_boxes[-1] == ground_truth_boxes[-1]", "def _check_loss(self, loss):\n assert not np.isnan(loss), \"Model diverged with loss = NaN\"", "def test_non_zero_loss(self):\n # Reset models.\n self.model.load_state_dict(self.initial_model_dict)\n self....
[ "0.6630715", "0.5900274", "0.5891999", "0.58664995", "0.5649074", "0.56405854", "0.55586785", "0.554255", "0.5507735", "0.5480439", "0.5434002", "0.53969556", "0.53587246", "0.5340794", "0.53252834", "0.53201187", "0.5317818", "0.52895206", "0.52850646", "0.52742416", "0.5253...
0.75855255
0
Draw bounding boxes on image.
def draw_boxes(image: np.ndarray, boxes: np.ndarray, box_classes: List[int], class_names: List[str], scores: List[float] = None): image = Image.fromarray(np.floor(image * 255 + 0.5).astype('uint8')) font = ImageFont.truetype( font='RictyDiminished-Regular.ttf', size=np.floor(3e-2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_bounding_boxes(self, image_path):\n img = cv.imread(image_path, cv.IMREAD_ANYDEPTH)\n bboxes = np.zeros((img.shape[0], img.shape[1], 3), dtype=np.uint8)\n unique, counts = np.unique(img, return_counts=True)\n for uni in unique:\n if uni == 0:\n continu...
[ "0.80702066", "0.7804719", "0.76538426", "0.75976384", "0.75510824", "0.75370336", "0.7513122", "0.74529815", "0.74439275", "0.74271363", "0.7421404", "0.7405068", "0.7302394", "0.7282591", "0.72423345", "0.72420937", "0.72209686", "0.72165626", "0.7193688", "0.71887493", "0....
0.6531832
60
Return list of random colors for number of classes given.
def _get_colors_for_classes(num_classes): # Use previously generated colors if num_classes is the same. if (hasattr(_get_colors_for_classes, "colors") and len(_get_colors_for_classes.colors) == num_classes): return _get_colors_for_classes.colors hsv_tuples = [(x / num_classes, 1., 1.) f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_colors_for_classes(num_classes):\n # Use previously generated colors if num_classes is the same.\n if (hasattr(get_colors_for_classes, \"colors\") and\n len(get_colors_for_classes.colors) == num_classes):\n return get_colors_for_classes.colors\n\n hsv_tuples = [(float(x) / num_cl...
[ "0.7893131", "0.77728426", "0.74452984", "0.7418036", "0.7350331", "0.73058707", "0.7200909", "0.7189055", "0.7189055", "0.7189055", "0.7157736", "0.71494246", "0.7112276", "0.710539", "0.7090242", "0.7040318", "0.70354927", "0.70328844", "0.7028532", "0.69534725", "0.6714349...
0.79241276
0
Divides given dataframe into list of test and train sets, within the time period of interest.
def groups_of_train_test_set(df, config, fbprophet=None): tvar = config.variables['tvar'] xvar = config.variables['xvar'] + config.variables['xvar_derived'] begin_date = config.timestamps['begin_date'] end_date = config.timestamps['end_date'] deltat = config.timestamps['deltat'] begin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_split_dataset(df, train_start_date, train_end_date, holdout_end_date, date_col):\n\n train_set = df.copy()[\n (df[date_col] >= train_start_date) & (df[date_col] <= train_end_date)]\n\n test_set = df.copy()[\n (df[date_col] > train_end_date) & (df[date_col] <= holdout_end_date)]\n\n ...
[ "0.74436104", "0.73339665", "0.72733957", "0.694838", "0.6944863", "0.6889575", "0.68596375", "0.6849533", "0.68419445", "0.6733868", "0.6711337", "0.6573086", "0.6539149", "0.65350944", "0.64913404", "0.6469819", "0.6439456", "0.6430458", "0.64299405", "0.6413641", "0.641048...
0.72377473
3
Returns object type. Archival objects that have children are mapped differently from those without.
def get_target_object_type(self, data): if data.get("jsonmodel_type") == "archival_object": if self.aspace_helper.has_children(data["uri"]): return "archival_object_collection" return data.get("jsonmodel_type")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def object_type(self):\n return self._object_type", "def object_type(self):\n return self._object_type", "def object_type(self):\n return self._object_type", "def object_type(self):\n return self._object_type", "def object_type(self):\n return self._object_type", "def o...
[ "0.68849576", "0.68849576", "0.68849576", "0.68849576", "0.68849576", "0.68797916", "0.68797916", "0.68797916", "0.68797916", "0.68797916", "0.68797916", "0.68797916", "0.68797916", "0.68797916", "0.68797916", "0.68797916", "0.68797916", "0.68797916", "0.68797916", "0.68797916"...
0.73462844
0
r"""Initialize Runner. __init__(self, D, NP, nFES, nRuns, useAlgorithms, useBenchmarks, ...)
def __init__(self, D, NP, nFES, nRuns, useAlgorithms, useBenchmarks, **kwargs): self.D = D self.NP = NP self.nFES = nFES self.nRuns = nRuns self.useAlgorithms = useAlgorithms self.useBenchmarks = useBenchmarks self.A = kwargs.get('A', 0.5) self.r = kwargs.get('r', 0.5) self.Qmin = kwargs.get('Qmin', 0...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, D, nFES=inf, nGEN=inf, benchmark=None, o=None, fo=None, M=None, fM=None, optF=None, optType=OptimizationType.MINIMIZATION, **kwargs):\n\t\tATask.__init__(self)\n\t\tself.D = D # dimension of the problem\n\t\tself.nGEN, self.nFES = nGEN, nFES\n\t\tself.benchmark = self.get_benchmark(benchmark) i...
[ "0.715041", "0.70560753", "0.6858815", "0.6852311", "0.676944", "0.67538583", "0.66964144", "0.66648585", "0.66288215", "0.6588328", "0.6575916", "0.65599287", "0.65202016", "0.6518476", "0.650799", "0.6485779", "0.64814353", "0.6454969", "0.6454721", "0.645414", "0.6441317",...
0.74177665
0
Replaces characters in a string value based on specified Regex pattern
def regex_sub_value(val, pattern, val_sub='', val_exception=np.nan, val_none=np.nan): try: stripped = re.sub(pattern, val_sub, val) new_val = val_none if stripped == '' else stripped return new_val except: return val_exception
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_re_replace(val: AnyStr, pattern: str, repl: str) -> str:\n return re.sub(pattern, repl, str(val))", "def regex_search_and_replace(string, regex, replace):\n return re.sub(regex, replace, string)", "def str_replace(pat, rep, subject):\n return subject.replace(pat, rep)", "def lreplace(patter...
[ "0.74421453", "0.6847357", "0.6694614", "0.66883945", "0.66564864", "0.6552084", "0.6541106", "0.6453723", "0.6437678", "0.6134753", "0.6109662", "0.60975724", "0.6072224", "0.5917033", "0.5891155", "0.58741814", "0.58679634", "0.58628213", "0.586113", "0.5830483", "0.5823310...
0.56642365
37
Saves current version of self.df to file in csv format
def to_file(self, target_filename, **to_csv_kwargs): # TODO: to_file saves will need trigger log file in future versions self.df.to_csv(target_filename, index=False, **to_csv_kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_csv(self):\n self.tableView.df.to_csv('Data export.csv', index=False)\n print('CSV file exported')", "def save(self):\n\t\t# save self.dfAnalysis\n\t\tcsvPath = self._getSavePath()\n\t\tprint('saving:', csvPath)\n\t\tself.dfAnalysis.to_csv(csvPath)", "def save_csv(self, filename): # DON...
[ "0.80089116", "0.79884464", "0.79748064", "0.775471", "0.77102184", "0.76648504", "0.7616287", "0.7555002", "0.74944687", "0.7473863", "0.74496186", "0.74067503", "0.73827493", "0.7333779", "0.72661597", "0.72044915", "0.71645325", "0.7160156", "0.7109729", "0.704585", "0.703...
0.67652
49
Get the date 1 month ago.
def last_month(): return datetime.now() + relativedelta(months=-1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def timestamp_month_ago():\n\n d = str(datetime.date.today() - datetime.timedelta(days=31)).split('-')\n y = d[0]\n m = d[1]\n d = d[2]\n a_month_ago = get_timestamp(int(y),int(m),int(d))\n return a_month_ago", "def last_month_day():\r\n return (datetime.now().replace(day=1) + relativedelta(...
[ "0.67350656", "0.6614442", "0.6595124", "0.6511224", "0.6149043", "0.6101112", "0.60151637", "0.5930122", "0.5921141", "0.5875613", "0.5861944", "0.581373", "0.58128756", "0.57573056", "0.5754512", "0.57052547", "0.5700669", "0.569793", "0.55903983", "0.5571026", "0.5566859",...
0.7280777
0
Given a parent post id, retrieve all child ids.
async def get_child_ids(db, post_id): sql = "SELECT id FROM hive_posts WHERE parent_id = :id AND is_deleted = '0'" return await db.query_col(sql, id=post_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parent_ids(self):\n return self._parent_ids", "def children(parent, data):\n\n kids = []\n for pid in data:\n if data[pid][\"parentId1\"] == parent or data[pid][\"parentId2\"] == parent:\n kids.append(pid)\n\n return kids", "def children_ids(self):\n return self._ch...
[ "0.66563797", "0.6616185", "0.64384764", "0.6375195", "0.6267642", "0.62036073", "0.60970503", "0.60939294", "0.6078386", "0.6071468", "0.5984083", "0.5983352", "0.594516", "0.59440553", "0.59118915", "0.5890208", "0.5885428", "0.58638424", "0.5843883", "0.58213043", "0.57484...
0.8081592
0
Get a list of post_ids representing comments by an author.
async def pids_by_account_comments(db, account: str, start_permlink: str = '', limit: int = 20): seek = '' start_id = None if start_permlink: start_id = await _get_post_id(db, account, start_permlink) if not start_id: return [] seek = "AND id <= :start_id" # `depth`...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_quotes_for_author(self, author: str) -> List[Quote]:\n params = (f'%{author}%',)\n query = '''\n SELECT *\n FROM quotes\n WHERE author LIKE ?\n ORDER BY created_at DESC\n '''\n\n ret = self.__execute_query(query, params)\n\n ret...
[ "0.6329552", "0.6130291", "0.60110927", "0.582621", "0.58215576", "0.5753566", "0.562087", "0.56208557", "0.5594092", "0.55755395", "0.55081016", "0.5498637", "0.5479328", "0.5465211", "0.5447182", "0.54296464", "0.5415945", "0.53362143", "0.5323411", "0.531617", "0.5306798",...
0.5281778
21
Build a geocodable location string from the Contact address related fields.
def getLocationString(self): street = ' '.join(self.context.getAddress().strip().split()) # Remove Postfach from street, otherwise Google geocoder API will # return wrong results street = street.replace('Postfach', '').replace('\r','').strip() zip_code = self.context.getZip() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def address_str(self):\n return self._plrevgeoloc.addressString", "def location_build(self, location: Location) -> str:\n if not location:\n return \"{}\"\n if not location.external_id and location.lat:\n try:\n location = self.location_search(location.la...
[ "0.6900671", "0.66811323", "0.66786385", "0.6627425", "0.659564", "0.6512036", "0.649883", "0.64451563", "0.6436682", "0.6406653", "0.6307216", "0.62407905", "0.623429", "0.61475194", "0.612165", "0.601474", "0.5997596", "0.5937755", "0.5920146", "0.5917177", "0.58359456", ...
0.7336709
0
Loads a file into a json object
def load_file(file_path, graceful=False): try: with open(file_path) as data_file: json_obj = json.load(data_file) logging.debug("Loaded JSON file from '{0}'".format(file_path)) except IOError: if graceful: json_obj = [] else: logging.error("¯\_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_json(file_name):\n return json.load(open(file_name))", "def load_json_data(filepath):\n with open(filepath,'r') as f:\n return json.load(f)", "def json_load(file_path):\n\n with open(file_path) as f:\n return json_loads(f.read())", "def load_json(filepath: str):\n with ...
[ "0.8160014", "0.80558413", "0.80401045", "0.80277985", "0.8020446", "0.79793316", "0.7925492", "0.79125565", "0.78715533", "0.78351843", "0.78052545", "0.77917355", "0.77337104", "0.7725889", "0.77238894", "0.7710487", "0.77079916", "0.77047944", "0.7676533", "0.7669659", "0....
0.72388184
98
Saves json object into a file
def save_file(file_path, json_obj): try: with open(file_path, 'w') as outfile: json.dump(json_obj, outfile) logging.debug("Saved JSON to file '{0}'".format(file_path)) except IOError: logging.error("¯\_(ツ)_/¯ Can't even open the file for writing: {0}'".format(file_path)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_to_json_file(my_obj, filename):\n with open(filename, \"w\") as myfile:\n return myfile.write(json.dumps(my_obj))", "def save_to_json_file(my_obj, filename):\n with open(filename, \"w\") as f:\n j = json.dumps(my_obj)\n f.write(j)\n f.close()", "def save_to_json_file(...
[ "0.8210631", "0.8190138", "0.8153875", "0.8134198", "0.81234175", "0.81187624", "0.81182235", "0.8117645", "0.81106603", "0.808504", "0.80817527", "0.807828", "0.8061442", "0.804218", "0.80137026", "0.79933846", "0.7954396", "0.7920673", "0.79199034", "0.78771186", "0.7874284...
0.85248685
0
Builds a route and prints the results
def do_request(route, text): emojis = fetch_emojis(_config['route'][route].format(text=text)) return emojis
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_print_routes(self, line=''):\n self.fibbing.print_routes()", "def print_routes(self):\n\n for route in self.app.router.routes():\n route_info = route.get_info()\n if \"formatter\" in route_info:\n url = route_info[\"formatter\"]\n elif \"path\"...
[ "0.6684212", "0.6482325", "0.64281625", "0.6268979", "0.62687176", "0.6168973", "0.6162189", "0.61178166", "0.60517156", "0.59484076", "0.5940868", "0.5880119", "0.58738565", "0.5846851", "0.58458465", "0.584034", "0.5822171", "0.58123714", "0.58007604", "0.5763432", "0.57575...
0.0
-1
Assert that events can be retrieved and decoded from the Queue.
async def test_account_mailer_queue(app, session, stan_server, event_loop, client_id, events_stan, future): # Call back for the subscription from account_mailer.worker import cb_subscription_handler # vars org_id = '1' events_subject = 'test_subject' events_queue = 'test_queue' events_dura...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_queue_simple(self):\n events = self.run_and_get_events('fixtures/queue/queue_simple.json')\n\n expected_events = self.events_from_tuples((\n ('on_b_dial', {\n 'call_id': 'e83df36bebbe-1507019160.61',\n 'caller': CallerId(code=15001, number='+311500100...
[ "0.66706574", "0.6602465", "0.65494907", "0.64545363", "0.64254266", "0.63869125", "0.6384696", "0.6306324", "0.62395716", "0.61526036", "0.6133326", "0.6132558", "0.60419923", "0.6025255", "0.602304", "0.6010839", "0.60008454", "0.5985004", "0.5969868", "0.5965943", "0.59467...
0.0
-1
Close and destroy the connection.
def _close_connection(self): if self.connection: self.connection.destroy() self.connection = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close(self):\n self.conn.close()\n self.destroy()", "def close(self):\n try:\n self.connection.Close()\n del self.connection\n except:\n pass", "def close_connection(self):\n self.conn.close()", "def close(self): \n self.connectio...
[ "0.8492485", "0.838679", "0.8188217", "0.8156528", "0.8150865", "0.811717", "0.811717", "0.8095707", "0.8089314", "0.80809814", "0.80809814", "0.80809814", "0.80809814", "0.80809814", "0.80809814", "0.80809814", "0.80729043", "0.80647624", "0.8056233", "0.8056233", "0.8056233...
0.84066886
1
The current size of the unprocessed message queue.
def queue_size(self): # pylint: disable=protected-access if self._handler._received_messages: return self._handler._received_messages.qsize() return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def queue_size(self):\n return self._queue_size", "def get_message_queue_size(self):\n with self.lock:\n return len(self.message_queue)", "def _getqueuesize(self):\n return self._queuesize", "def queue_size(self) -> int:\n return self._queue.qsize()", "def size(self):...
[ "0.8814214", "0.881014", "0.8804012", "0.8578221", "0.84403694", "0.84403694", "0.84403694", "0.84403694", "0.8436363", "0.8386133", "0.8365248", "0.8365248", "0.82419676", "0.8035233", "0.80280215", "0.7996625", "0.78940266", "0.78412265", "0.78359604", "0.7755767", "0.77216...
0.88520896
0
The sequence number of the event data object.
def sequence_number(self): return self._annotations.get(EventData.PROP_SEQ_NUMBER, None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sequence_number(self):\n return self._sequence_number", "def sequence_number(self):\n # type: () -> int\n return self._sequence_number", "def get_sequence(self):\n self.__sequence = self.__sequence + 1\n return self.__sequence - 1", "def eventNumber(self):\n rais...
[ "0.81413203", "0.80038565", "0.74812114", "0.71769285", "0.7103246", "0.6986202", "0.69479114", "0.69479114", "0.6861508", "0.6823983", "0.67224044", "0.67224044", "0.67224044", "0.67224044", "0.67224044", "0.67224044", "0.67224044", "0.67224044", "0.67224044", "0.67224044", ...
0.8483477
0
The enqueued timestamp of the event data object.
def enqueued_time(self): timestamp = self._annotations.get(EventData.PROP_TIMESTAMP, None) if timestamp: return datetime.datetime.fromtimestamp(float(timestamp)/1000) return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def timestamp(self):\n return self.__timestamp", "def timestamp(self) -> str:\n return self._event.get('timestamp')", "def timestamp(self):\n return self._data.get('timestamp')", "def timestamp(self):\n return self._timestamp", "def timestamp(self):\n return self._timesta...
[ "0.7150643", "0.7143084", "0.7118233", "0.7058567", "0.7058567", "0.7058567", "0.7058567", "0.7058567", "0.7058567", "0.7058567", "0.70223176", "0.69215727", "0.6892342", "0.68881404", "0.6852454", "0.66900676", "0.66288716", "0.6625173", "0.662145", "0.66146773", "0.6598347"...
0.8351335
0
The partition key of the event data object.
def partition_key(self): try: return self._annotations[self._partition_key] except KeyError: return self._annotations.get(EventData.PROP_PARTITION_KEY, None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def partition_key(self) -> str:\n return pulumi.get(self, \"partition_key\")", "def partition_id(self) -> 'outputs.PreventionJobTriggerInspectJobStorageConfigDatastoreOptionsPartitionId':\n return pulumi.get(self, \"partition_id\")", "def _key_for_partition(self, user_partition):\r\n retur...
[ "0.82765335", "0.75514567", "0.73077136", "0.70803934", "0.69453585", "0.69014627", "0.6878324", "0.6632337", "0.6621219", "0.6588396", "0.65506613", "0.6531013", "0.6531013", "0.6531013", "0.6531013", "0.6516916", "0.6504027", "0.64949614", "0.6466879", "0.64633155", "0.6453...
0.84334105
0
Take a string and return a valid filename constructed from the string.
def format_filename(s): valid_chars = "-_.() %s%s" % (string.ascii_letters, string.digits) filename = ''.join(c for c in s if c in valid_chars) filename = filename.replace(' ', '_') # I don't like spaces in filenames. return filename
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_filename(s: str):\n # from: https://gist.github.com/seanh/93666\n\n valid_chars = \"-_.() %s%s\" % (string.ascii_letters, string.digits)\n filename = ''.join(c for c in s if c in valid_chars)\n filename = filename.replace(' ', '_') # I don't like spaces in filenames.\n return filename", ...
[ "0.80485183", "0.798944", "0.7949801", "0.787847", "0.7862182", "0.7727231", "0.77141064", "0.76735306", "0.75296444", "0.7505588", "0.747976", "0.743618", "0.7330777", "0.73069334", "0.7068746", "0.70555854", "0.6852573", "0.68469024", "0.6833942", "0.6758523", "0.6737564", ...
0.7855741
5
Get mute state of the speaker.
def get_mute(self): return on_off_bool(self.get(COMMAND_UIC, 'GetMute')['mute'])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mute(self) -> bool:\n return bool(self.audio_mixer.getmute()[0])", "def is_volume_muted(self):\n return self._state.get(\"mute\", None)", "def is_volume_muted(self):\n return self._mute", "def is_volume_muted(self):\n return self._muted", "def is_volume_muted(self):\n ...
[ "0.7412152", "0.7371846", "0.7234999", "0.70857537", "0.70857537", "0.70857537", "0.7037071", "0.6884125", "0.68593425", "0.6836174", "0.6785089", "0.6702399", "0.6659513", "0.6589866", "0.6583619", "0.65818727", "0.6564398", "0.65634894", "0.63981074", "0.62883896", "0.62418...
0.7656735
0
Move to next/previous track on the playlist.
def set_trick_mode(self, trick_mode): if trick_mode not in ['previous', 'next']: raise ValueError('Trick mode must one of: previous, next') self.get(COMMAND_UIC, 'SetTrickMode', [('trickmode', trick_mode)])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def media_next_track(self):\n self._lms.query(self._id, 'playlist', 'index', '+1')\n self.update_ha_state()", "async def async_media_previous_track(self) -> None:\n cur_track_index = self._get_current_track_index()\n\n await self._table.active_playlist.play(\n self._table.a...
[ "0.7268913", "0.7132297", "0.7018076", "0.68977964", "0.6770746", "0.67404974", "0.66657495", "0.6595054", "0.6557199", "0.65094566", "0.6498649", "0.64872855", "0.6460142", "0.6429666", "0.629187", "0.62825674", "0.6282156", "0.62480557", "0.6244872", "0.6225449", "0.6196972...
0.0
-1
Get information about play/pause status for the playlist.
def get_play_status(self): return self.get(COMMAND_UIC, 'GetPlayStatus')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetPlayingStatus(self):\n iStatus = self.SendCommand(WM_USER, 0, 104)\n if iStatus == 1:\n return 'playing'\n elif iStatus == 3:\n return 'paused'\n else:\n return 'stopped'", "def status(self):\n msg = None\n if self.is_playing():\n ...
[ "0.74153364", "0.7277669", "0.66414845", "0.64505315", "0.63410336", "0.6168048", "0.6124715", "0.6049898", "0.60348386", "0.59428096", "0.5915116", "0.59078234", "0.5902283", "0.58811784", "0.58753276", "0.58178", "0.5782274", "0.57797146", "0.5773777", "0.57717884", "0.5765...
0.7457967
0
Retrieve current equalizer settings.
def get_current_eq_mode(self): response = self.get(COMMAND_UIC, 'GetCurrentEQMode') return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_settings(self):\n return self.settings", "def get_settings(self):\n return [('test_environment', self.test_environment),\n ('base_data_dir', self.base_data_dir),\n ('locale', self.locale)]", "def getSettings(self):\n return self.cfg", "def get_settin...
[ "0.6454838", "0.6344876", "0.6327196", "0.62404555", "0.62283885", "0.62283885", "0.6129262", "0.6106142", "0.59993875", "0.5978146", "0.5978146", "0.5968423", "0.59618074", "0.5914553", "0.5896762", "0.58522385", "0.58411753", "0.5824779", "0.5824779", "0.5824779", "0.582477...
0.54321253
52
Update speaker's group name.
def set_group_name(self, name): params = [('groupname', name, 'cdata')] self.get(COMMAND_UIC, 'SetGroupName', params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_group_name(self):\n self._scene_gen.group_name = self._group_name_le.text()\n self._refresh_view()", "def set_group_name(self, name):\n self.groupname = name", "def set_group(self, bot, update, args):\n username = str(update.message.from_user['username'])\n chat_id =...
[ "0.72930276", "0.6973785", "0.6310089", "0.6240467", "0.61231035", "0.6086739", "0.60575366", "0.601936", "0.599674", "0.5877336", "0.5873178", "0.5873178", "0.58631116", "0.5863042", "0.5826277", "0.5793431", "0.57924306", "0.5786083", "0.57846045", "0.5774433", "0.5698133",...
0.66988647
2
Get playback repeat mode.
def get_repeat_mode(self): response = self.get(COMMAND_UIC, 'GetRepeatMode') return response['repeat']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def get_repeat(self) -> models.player.RepeatMode:\n repeat, _ = await self.get_play_mode()\n return repeat", "def repeat(self) -> RepeatMode:\n if self._state.get(\"repeat\", None):\n return RepeatMode.ALL\n return RepeatMode.OFF", "async def get_play_mode(self) -> ...
[ "0.8759287", "0.7520064", "0.7341372", "0.68714434", "0.66754025", "0.6666837", "0.6645824", "0.6528589", "0.64225835", "0.6320685", "0.6131621", "0.6124961", "0.60611165", "0.5923108", "0.5833501", "0.5734518", "0.57005984", "0.56791925", "0.5678876", "0.5670475", "0.5626018...
0.8606278
1
Set playback repeat mode.
def set_repeat_mode(self, mode): params = [('repeatmode', mode)] self.get(COMMAND_UIC, 'SetRepeatMode', params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def set_repeat(self, value: models.player.RepeatMode):\n _, shuffle = await self.get_play_mode()\n await self._pytheos.api.player.set_play_mode(self.id, models.player.PlayMode(repeat=value, shuffle=shuffle))\n self._repeat = value", "async def async_set_repeat(self, repeat):\n i...
[ "0.8326535", "0.8022578", "0.7444486", "0.69771224", "0.69415987", "0.6853051", "0.65171134", "0.6435453", "0.63791716", "0.637696", "0.6147666", "0.6085352", "0.59794635", "0.5918307", "0.5847122", "0.5821394", "0.57737947", "0.57112974", "0.5658261", "0.541751", "0.5379867"...
0.82119
1
Return QR factorization for ``BlockLowRank`` or ``Dense`` object.
def qr(obj): if isinstance(obj, (core.Dense, numpy.ndarray)): Q, R = numpy.linalg.qr(obj) return core.Dense(Q), core.Dense(R) if isinstance(obj, core.BlockLowRank): return _blr_mbgs(obj) return NotImplemented
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _blr_tsqr(obj):\n nb = obj.nb[0]\n A = obj\n Q = core.BlockLowRank(numpy.full((nb, 1), None))\n B = numpy.full(nb, None)\n\n for i in range(nb):\n if isinstance(A[i, 0], core.LowRank):\n Qi, Ri = qr(A[i, 0].U)\n Q[i, 0] = Qi\n B[i] = Ri * A[i, 0].V\n ...
[ "0.6148071", "0.61402565", "0.6087356", "0.5921867", "0.5711478", "0.56443816", "0.54241216", "0.51829326", "0.51816314", "0.5113818", "0.5091204", "0.50504506", "0.50398135", "0.5032619", "0.5024967", "0.50182575", "0.500674", "0.500141", "0.4994111", "0.4986033", "0.4955621...
0.74550647
0
Returns an initial probability distribution over the grading differences.
def get_initial_marking_distribution(informed_prior): support = np.arange(0, MAX_MARK_VALUE+1) loc = support.min() max = support.max() scale = max-loc if not informed_prior: probs = ss.uniform(loc=loc, scale=scale).pdf(support) else: probs = ss.norm.pdf(support, scale=0.7, lo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uniform_start_probs(self) -> np.ndarray:\n return np.ones(self.n_states) / self.n_states", "def _starting_prob(self, s):\n return self._starting_state_distribution.pdf(s)", "def stdProbabilityNorm(self):\n return 1./factorial(self.alpha-1)", "def getProbabilityDistribution(probEnter = 0....
[ "0.65166795", "0.6436501", "0.6433655", "0.62486255", "0.6230732", "0.61948603", "0.6187933", "0.614211", "0.61136293", "0.61105", "0.61019915", "0.60847306", "0.60325", "0.60140276", "0.5932007", "0.5929696", "0.5928996", "0.591312", "0.5889367", "0.5879461", "0.5865655", ...
0.6152241
7
Returns a delta distribution with nonzeroprobability argument given by non_zero_value
def get_delta_distribution(non_zero_value): support = np.arange(0, MAX_MARK_VALUE + 1) probs = [0] * len(support) probs[non_zero_value] = 1.0 return ProbabilityDistribution(support, probs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def zero_proximal(sigma=1.0):\n return ZeroOperator(self.domain)", "def beta_gen_nonneg(p):\n return np.clip(np.random.normal(0, 3, p), 0, None)", "def get_ideal_difference_distribution():\n\n global ideal_difference\n\n if (ideal_difference is None):\n support = compute_support()\n ...
[ "0.6010931", "0.5961237", "0.5784762", "0.57396317", "0.5612133", "0.55213976", "0.550416", "0.54358464", "0.5430404", "0.5405835", "0.5385237", "0.53486186", "0.53243136", "0.5317628", "0.5299076", "0.5291502", "0.52798235", "0.5278757", "0.5278757", "0.5270487", "0.52672213...
0.8336389
0